mirror of
https://github.com/vgmstream/vgmstream.git
synced 2024-11-12 01:30:49 +01:00
YSDP added
SPT+SPD added ISH+ISD added git-svn-id: https://vgmstream.svn.sourceforge.net/svnroot/vgmstream@492 51a99a44-fe44-0410-b1ba-c3e57ba2b86b
This commit is contained in:
parent
c11656570c
commit
0b3be50b28
@ -149,7 +149,10 @@ META_OBJS=meta/adx_header.o \
|
||||
meta/ps2_seg.o \
|
||||
meta/str_asr.o \
|
||||
meta/zwdsp.o \
|
||||
meta/gca.o
|
||||
meta/gca.o \
|
||||
meta/ish_isd.o \
|
||||
meta/spt_spd.o \
|
||||
meta/ydsp.o
|
||||
|
||||
OBJECTS=vgmstream.o streamfile.o util.o $(CODING_OBJS) $(LAYOUT_OBJS) $(META_OBJS)
|
||||
|
||||
|
@ -291,6 +291,10 @@
|
||||
RelativePath=".\meta\idsp.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\meta\ish_isd.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\meta\ivb.c"
|
||||
>
|
||||
@ -609,6 +613,10 @@
|
||||
RelativePath=".\meta\sli.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\meta\spt_spd.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\meta\str_asr.c"
|
||||
>
|
||||
@ -665,6 +673,10 @@
|
||||
RelativePath=".\meta\xwb.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\meta\ydsp.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\meta\zwdsp.c"
|
||||
>
|
||||
|
@ -118,4 +118,7 @@ libmeta_la_SOURCES += ps2_seg.c
|
||||
libmeta_la_SOURCES += str_asr.c
|
||||
libmeta_la_SOURCES += zwdsp.c
|
||||
libmeta_la_SOURCES += gca.c
|
||||
libmeta_la_SOURCES += ish_isd.c
|
||||
libmeta_la_SOURCES += spt_spd.c
|
||||
libmeta_la_SOURCES += ydsp.c
|
||||
EXTRA_DIST = meta.h
|
||||
|
98
src/meta/ish_isd.c
Normal file
98
src/meta/ish_isd.c
Normal file
@ -0,0 +1,98 @@
|
||||
#include "meta.h"
|
||||
#include "../util.h"
|
||||
|
||||
/* SPT+SPT
|
||||
|
||||
2008-11-27 - manakoAT : First try for splitted files...
|
||||
*/
|
||||
|
||||
VGMSTREAM * init_vgmstream_ish_isd(STREAMFILE *streamFile) {
|
||||
|
||||
VGMSTREAM * vgmstream = NULL;
|
||||
STREAMFILE * streamFileISH = NULL;
|
||||
char filename[260];
|
||||
char filenameISH[260];
|
||||
|
||||
int i;
|
||||
int channel_count;
|
||||
int loop_flag;
|
||||
|
||||
/* check extension, case insensitive */
|
||||
streamFile->get_name(streamFile,filename,sizeof(filename));
|
||||
if (strcasecmp("isd",filename_extension(filename))) goto fail;
|
||||
|
||||
|
||||
strcpy(filenameISH,filename);
|
||||
strcpy(filenameISH+strlen(filenameISH)-3,"ISH");
|
||||
|
||||
streamFileISH = streamFile->open(streamFile,filenameISH,STREAMFILE_DEFAULT_BUFFER_SIZE);
|
||||
if (!streamFileISH) goto fail;
|
||||
|
||||
/* check header */
|
||||
if (read_32bitBE(0x00,streamFileISH) != 0x495F5346) /* "I_SF" */
|
||||
goto fail;
|
||||
|
||||
channel_count = read_32bitBE(0x14,streamFileISH);
|
||||
loop_flag = read_32bitBE(0x20,streamFileISH);
|
||||
|
||||
/* build the VGMSTREAM */
|
||||
vgmstream = allocate_vgmstream(channel_count,loop_flag);
|
||||
if (!vgmstream) goto fail;
|
||||
|
||||
/* fill in the vital statistics */
|
||||
vgmstream->channels = channel_count;
|
||||
vgmstream->sample_rate = read_32bitBE(0x08,streamFileISH);
|
||||
vgmstream->num_samples=read_32bitBE(0x0C,streamFileISH);
|
||||
vgmstream->coding_type = coding_NGC_DSP;
|
||||
|
||||
if(loop_flag) {
|
||||
vgmstream->loop_start_sample = read_32bitBE(0x20,streamFileISH)*14/8/channel_count;
|
||||
vgmstream->loop_end_sample = read_32bitBE(0x24,streamFileISH)*14/8/channel_count;
|
||||
}
|
||||
|
||||
if (channel_count == 1) {
|
||||
vgmstream->layout_type = layout_none;
|
||||
} else if (channel_count == 2) {
|
||||
vgmstream->layout_type = layout_interleave;
|
||||
vgmstream->interleave_block_size = read_32bitBE(0x18,streamFileISH);
|
||||
}
|
||||
|
||||
|
||||
|
||||
vgmstream->meta_type = meta_ISH_ISD;
|
||||
|
||||
/* open the file for reading */
|
||||
{
|
||||
for (i=0;i<channel_count;i++) {
|
||||
vgmstream->ch[i].streamfile = streamFile->open(streamFile,filename,vgmstream->interleave_block_size);
|
||||
vgmstream->ch[i].offset = 0;
|
||||
|
||||
if (!vgmstream->ch[i].streamfile) goto fail;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (vgmstream->coding_type == coding_NGC_DSP) {
|
||||
int i;
|
||||
for (i=0;i<16;i++) {
|
||||
vgmstream->ch[0].adpcm_coef[i] = read_16bitBE(0x40+i*2,streamFileISH);
|
||||
}
|
||||
if (vgmstream->channels == 2) {
|
||||
for (i=0;i<16;i++) {
|
||||
vgmstream->ch[1].adpcm_coef[i] = read_16bitBE(0x80+i*2,streamFileISH);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
close_streamfile(streamFileISH); streamFileISH=NULL;
|
||||
|
||||
return vgmstream;
|
||||
|
||||
/* clean up anything we may have opened */
|
||||
fail:
|
||||
if (streamFileISH) close_streamfile(streamFileISH);
|
||||
if (vgmstream) close_vgmstream(vgmstream);
|
||||
return NULL;
|
||||
}
|
@ -287,4 +287,10 @@ VGMSTREAM * init_vgmstream_zwdsp(STREAMFILE * streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_gca(STREAMFILE * streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_spt_spd(STREAMFILE * streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_ish_isd(STREAMFILE * streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_ydsp(STREAMFILE * streamFile);
|
||||
|
||||
#endif
|
||||
|
96
src/meta/spt_spd.c
Normal file
96
src/meta/spt_spd.c
Normal file
@ -0,0 +1,96 @@
|
||||
#include "meta.h"
|
||||
#include "../util.h"
|
||||
|
||||
/* SPT+SPT
|
||||
|
||||
2008-11-27 - manakoAT : First try for splitted files...
|
||||
*/
|
||||
|
||||
VGMSTREAM * init_vgmstream_spt_spd(STREAMFILE *streamFile) {
|
||||
|
||||
VGMSTREAM * vgmstream = NULL;
|
||||
STREAMFILE * streamFileSPT = NULL;
|
||||
char filename[260];
|
||||
char filenameSPT[260];
|
||||
|
||||
int i;
|
||||
int channel_count;
|
||||
int loop_flag;
|
||||
|
||||
/* check extension, case insensitive */
|
||||
streamFile->get_name(streamFile,filename,sizeof(filename));
|
||||
if (strcasecmp("spd",filename_extension(filename))) goto fail;
|
||||
|
||||
|
||||
strcpy(filenameSPT,filename);
|
||||
strcpy(filenameSPT+strlen(filenameSPT)-3,"SPT");
|
||||
|
||||
streamFileSPT = streamFile->open(streamFile,filenameSPT,STREAMFILE_DEFAULT_BUFFER_SIZE);
|
||||
|
||||
|
||||
if (!streamFileSPT) goto fail;
|
||||
|
||||
channel_count = read_32bitBE(0x00,streamFileSPT);
|
||||
loop_flag = read_32bitBE(0x04,streamFileSPT);
|
||||
|
||||
/* build the VGMSTREAM */
|
||||
vgmstream = allocate_vgmstream(channel_count,loop_flag);
|
||||
if (!vgmstream) goto fail;
|
||||
|
||||
/* fill in the vital statistics */
|
||||
vgmstream->channels = channel_count;
|
||||
vgmstream->sample_rate = read_32bitBE(0x08,streamFileSPT);
|
||||
vgmstream->num_samples=read_32bitBE(0x14,streamFileSPT)*14/16/channel_count;
|
||||
vgmstream->coding_type = coding_NGC_DSP;
|
||||
|
||||
if(loop_flag) {
|
||||
vgmstream->loop_start_sample = 0;
|
||||
vgmstream->loop_end_sample = read_32bitBE(0x14,streamFileSPT)*14/16/channel_count;
|
||||
}
|
||||
|
||||
if (channel_count == 1) {
|
||||
vgmstream->layout_type = layout_none;
|
||||
} else if (channel_count == 2) {
|
||||
vgmstream->layout_type = layout_interleave;
|
||||
vgmstream->interleave_block_size=0x4000; /* Unknown now, never seen 2ch files in psd+spt */
|
||||
}
|
||||
|
||||
|
||||
|
||||
vgmstream->meta_type = meta_SPT_SPD;
|
||||
|
||||
/* open the file for reading */
|
||||
{
|
||||
for (i=0;i<channel_count;i++) {
|
||||
/* Not sure, i'll put a fake value here for now */
|
||||
vgmstream->ch[i].streamfile = streamFile->open(streamFile,filename,0x8000);
|
||||
vgmstream->ch[i].offset = 0;
|
||||
|
||||
if (!vgmstream->ch[i].streamfile) goto fail;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (vgmstream->coding_type == coding_NGC_DSP) {
|
||||
int i;
|
||||
for (i=0;i<16;i++) {
|
||||
vgmstream->ch[0].adpcm_coef[i] = read_16bitBE(0x20+i*2,streamFileSPT);
|
||||
}
|
||||
if (vgmstream->channels == 2) {
|
||||
for (i=0;i<16;i++) {
|
||||
vgmstream->ch[1].adpcm_coef[i] = read_16bitBE(0x40+i*2,streamFileSPT);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
close_streamfile(streamFileSPT); streamFileSPT=NULL;
|
||||
return vgmstream;
|
||||
|
||||
/* clean up anything we may have opened */
|
||||
fail:
|
||||
if (streamFileSPT) close_streamfile(streamFileSPT);
|
||||
if (vgmstream) close_vgmstream(vgmstream);
|
||||
return NULL;
|
||||
}
|
83
src/meta/ydsp.c
Normal file
83
src/meta/ydsp.c
Normal file
@ -0,0 +1,83 @@
|
||||
#include "meta.h"
|
||||
#include "../util.h"
|
||||
|
||||
/* YDSP (from WWE Day of Reckoning) */
|
||||
VGMSTREAM * init_vgmstream_ydsp(STREAMFILE *streamFile) {
|
||||
VGMSTREAM * vgmstream = NULL;
|
||||
char filename[260];
|
||||
off_t start_offset;
|
||||
|
||||
int loop_flag;
|
||||
int channel_count;
|
||||
|
||||
/* check extension, case insensitive */
|
||||
streamFile->get_name(streamFile,filename,sizeof(filename));
|
||||
if (strcasecmp("ydsp",filename_extension(filename))) goto fail;
|
||||
|
||||
/* check header */
|
||||
if (read_32bitBE(0x00,streamFile) != 0x59445350) /* "YDSP" */
|
||||
goto fail;
|
||||
|
||||
loop_flag = (read_32bitBE(0xB0,streamFile)!=0);
|
||||
channel_count = 2; /* (uint32_t)read_16bitBE(0x10,streamFile); */
|
||||
|
||||
/* build the VGMSTREAM */
|
||||
vgmstream = allocate_vgmstream(channel_count,loop_flag);
|
||||
if (!vgmstream) goto fail;
|
||||
|
||||
/* fill in the vital statistics */
|
||||
start_offset = 0x120;
|
||||
vgmstream->channels = channel_count;
|
||||
vgmstream->sample_rate = read_32bitBE(0x0C,streamFile);
|
||||
vgmstream->coding_type = coding_NGC_DSP;
|
||||
vgmstream->num_samples = (read_32bitBE(0x08,streamFile))*14/8/channel_count;
|
||||
if (loop_flag) {
|
||||
vgmstream->loop_start_sample = read_32bitBE(0xB0,streamFile);
|
||||
vgmstream->loop_end_sample = read_32bitBE(0xB4,streamFile);
|
||||
}
|
||||
|
||||
if (channel_count == 1) {
|
||||
vgmstream->layout_type = layout_none;
|
||||
} else if (channel_count == 2) {
|
||||
vgmstream->interleave_block_size = read_32bitBE(0x14,streamFile);
|
||||
vgmstream->layout_type = layout_interleave;
|
||||
}
|
||||
|
||||
vgmstream->meta_type = meta_YDSP;
|
||||
|
||||
/* open the file for reading */
|
||||
|
||||
if (vgmstream->coding_type == coding_NGC_DSP) {
|
||||
int i;
|
||||
for (i=0;i<16;i++) {
|
||||
vgmstream->ch[0].adpcm_coef[i] = read_16bitBE(0x20+i*2,streamFile);
|
||||
}
|
||||
if (vgmstream->channels == 2) {
|
||||
for (i=0;i<16;i++) {
|
||||
vgmstream->ch[1].adpcm_coef[i] = read_16bitBE(0x44+i*2,streamFile);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
int i;
|
||||
STREAMFILE * file;
|
||||
file = streamFile->open(streamFile,filename,STREAMFILE_DEFAULT_BUFFER_SIZE);
|
||||
if (!file) goto fail;
|
||||
for (i=0;i<channel_count;i++) {
|
||||
vgmstream->ch[i].streamfile = file;
|
||||
|
||||
vgmstream->ch[i].channel_start_offset=
|
||||
vgmstream->ch[i].offset=start_offset+
|
||||
vgmstream->interleave_block_size*i;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return vgmstream;
|
||||
|
||||
/* clean up anything we may have opened */
|
||||
fail:
|
||||
if (vgmstream) close_vgmstream(vgmstream);
|
||||
return NULL;
|
||||
}
|
@ -160,6 +160,9 @@ VGMSTREAM * (*init_vgmstream_fcns[])(STREAMFILE *streamFile) = {
|
||||
init_vgmstream_str_asr,
|
||||
init_vgmstream_zwdsp,
|
||||
init_vgmstream_gca,
|
||||
init_vgmstream_spt_spd,
|
||||
init_vgmstream_ish_isd,
|
||||
init_vgmstream_ydsp,
|
||||
};
|
||||
|
||||
#define INIT_VGMSTREAM_FCNS (sizeof(init_vgmstream_fcns)/sizeof(init_vgmstream_fcns[0]))
|
||||
@ -1839,6 +1842,15 @@ void describe_vgmstream(VGMSTREAM * vgmstream, char * desc, int length) {
|
||||
break;
|
||||
case meta_GCA:
|
||||
snprintf(temp,TEMPSIZE,"GCA DSP Header");
|
||||
break;
|
||||
case meta_SPT_SPD:
|
||||
snprintf(temp,TEMPSIZE,"SPT+SPD DSP Header");
|
||||
break;
|
||||
case meta_ISH_ISD:
|
||||
snprintf(temp,TEMPSIZE,"ISH+ISD DSP Header");
|
||||
break;
|
||||
case meta_YDSP:
|
||||
snprintf(temp,TEMPSIZE,"YDSP Header");
|
||||
break;
|
||||
default:
|
||||
snprintf(temp,TEMPSIZE,"THEY SHOULD HAVE SENT A POET");
|
||||
|
@ -243,6 +243,9 @@ typedef enum {
|
||||
meta_PS2_OMU, /* PS2 Int file with Header */
|
||||
meta_PS2_XA2, /* XA2 XG3 file */
|
||||
meta_IDSP, /* Chronicles of Narnia */
|
||||
meta_SPT_SPD, /* Variouis */
|
||||
meta_ISH_ISD, /* Various */
|
||||
meta_YDSP, /* WWE Day of Reckoning */
|
||||
|
||||
meta_IDSP2, /* Chronicles of Narnia */
|
||||
meta_WAA_WAC_WAD_WAM, /* Beyond Good & Evil */
|
||||
|
@ -203,6 +203,9 @@ char * extension_list[] = {
|
||||
"asr\0ASR Audio File (*.ASR)\0",
|
||||
"zwdsp\0ZWDSP Audio File (*.ZWDSP)\0",
|
||||
"gca\0GCA Audio File (*.GCA)\0",
|
||||
"spd\0SPD Audio File (*.SPD)\0",
|
||||
"isd\0ISD Audio File (*.ISD)\0",
|
||||
"ydsp\0YDSP Audio File (*.YDSP)\0",
|
||||
};
|
||||
|
||||
void about(HWND hwndParent) {
|
||||
|
Loading…
Reference in New Issue
Block a user