mirror of
https://github.com/vgmstream/vgmstream.git
synced 2025-01-19 00:04:04 +01:00
new idsp added (Mario Strikers Charged)
git-svn-id: https://vgmstream.svn.sourceforge.net/svnroot/vgmstream@592 51a99a44-fe44-0410-b1ba-c3e57ba2b86b
This commit is contained in:
parent
5b6d801686
commit
dd693435c2
@ -95,7 +95,7 @@ VGMSTREAM * init_vgmstream_idsp2(STREAMFILE *streamFile) {
|
||||
|
||||
/* check header */
|
||||
if (read_32bitBE(0x00,streamFile) != 0x69647370 || /* "idsp" */
|
||||
read_32bitBE(0xBC,streamFile) != 0x49445350) /* IDSP */
|
||||
read_32bitBE(0xBC,streamFile) != 0x49445350) /* IDSP */
|
||||
goto fail;
|
||||
|
||||
|
||||
@ -159,4 +159,83 @@ fail:
|
||||
}
|
||||
|
||||
|
||||
/* IDSP (Mario Strikers Charged)
|
||||
- Single "IDSP" header... */
|
||||
VGMSTREAM * init_vgmstream_idsp3(STREAMFILE *streamFile) {
|
||||
VGMSTREAM * vgmstream = NULL;
|
||||
char filename[260];
|
||||
off_t start_offset;
|
||||
|
||||
int loop_flag = 1;
|
||||
int channel_count;
|
||||
|
||||
/* check extension, case insensitive */
|
||||
streamFile->get_name(streamFile,filename,sizeof(filename));
|
||||
if (strcasecmp("idsp",filename_extension(filename))) goto fail;
|
||||
|
||||
/* check header */
|
||||
if (read_32bitBE(0x00,streamFile) != 0x49445350) /* IDSP */
|
||||
goto fail;
|
||||
|
||||
|
||||
// loop_flag = read_32bitBE(0x08,streamFile);
|
||||
channel_count = read_32bitBE(0x24,streamFile);
|
||||
|
||||
/* build the VGMSTREAM */
|
||||
vgmstream = allocate_vgmstream(channel_count,loop_flag);
|
||||
if (!vgmstream) goto fail;
|
||||
|
||||
/* fill in the vital statistics */
|
||||
start_offset = 0xD4;
|
||||
vgmstream->channels = channel_count;
|
||||
vgmstream->sample_rate = read_32bitBE(0x14,streamFile);
|
||||
vgmstream->coding_type = coding_NGC_DSP;
|
||||
vgmstream->num_samples = read_32bitBE(0x0C,streamFile);
|
||||
if (loop_flag) {
|
||||
vgmstream->loop_start_sample = 0;
|
||||
vgmstream->loop_end_sample = (read_32bitBE(0x0C,streamFile));
|
||||
}
|
||||
|
||||
vgmstream->layout_type = layout_interleave;
|
||||
vgmstream->interleave_block_size = read_32bitBE(0x04,streamFile);
|
||||
vgmstream->meta_type = meta_IDSP3;
|
||||
|
||||
|
||||
if (vgmstream->coding_type == coding_NGC_DSP) {
|
||||
int i;
|
||||
for (i=0;i<16;i++) {
|
||||
vgmstream->ch[0].adpcm_coef[i] = read_16bitBE(0x28+i*2,streamFile);
|
||||
}
|
||||
if (vgmstream->channels) {
|
||||
for (i=0;i<16;i++) {
|
||||
vgmstream->ch[1].adpcm_coef[i] = read_16bitBE(0x88+i*2,streamFile);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* open the file for reading */
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -241,6 +241,8 @@ VGMSTREAM * init_vgmstream_idsp(STREAMFILE * streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_idsp2(STREAMFILE * streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_idsp3(STREAMFILE * streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_ngc_ymf(STREAMFILE * streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_sadl(STREAMFILE * streamFile);
|
||||
@ -250,6 +252,7 @@ VGMSTREAM * init_vgmstream_ps2_ccc(STREAMFILE * streamFile);
|
||||
VGMSTREAM * init_vgmstream_psx_fag(STREAMFILE * streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_ps2_mihb(STREAMFILE * streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_ngc_pdt(STREAMFILE * streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_wii_mus(STREAMFILE * streamFile);
|
||||
|
@ -137,6 +137,7 @@ VGMSTREAM * (*init_vgmstream_fcns[])(STREAMFILE *streamFile) = {
|
||||
init_vgmstream_ps2_xa2,
|
||||
init_vgmstream_idsp,
|
||||
init_vgmstream_idsp2,
|
||||
init_vgmstream_idsp3,
|
||||
init_vgmstream_ngc_ymf,
|
||||
init_vgmstream_sadl,
|
||||
init_vgmstream_ps2_ccc,
|
||||
@ -1998,6 +1999,9 @@ void describe_vgmstream(VGMSTREAM * vgmstream, char * desc, int length) {
|
||||
break;
|
||||
case meta_IDSP2:
|
||||
snprintf(temp,TEMPSIZE,"IDSP Header");
|
||||
break;
|
||||
case meta_IDSP3:
|
||||
snprintf(temp,TEMPSIZE,"IDSP Header");
|
||||
break;
|
||||
case meta_WAA_WAC_WAD_WAM:
|
||||
snprintf(temp,TEMPSIZE,"WAA/WAC/WAD/WAM RIFF Header");
|
||||
|
@ -265,13 +265,15 @@ 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_IDSP2, /* Soul Calibur */
|
||||
meta_IDSP3, /* Mario Strikers Charged */
|
||||
meta_SPT_SPD, /* Variouis */
|
||||
meta_ISH_ISD, /* Various */
|
||||
meta_GSP_GSB, /* Various */
|
||||
meta_YDSP, /* WWE Day of Reckoning */
|
||||
meta_FFCC_STR, /* Final Fantasy: Crystal Chronicles */
|
||||
|
||||
meta_IDSP2, /* Chronicles of Narnia */
|
||||
|
||||
meta_WAA_WAC_WAD_WAM, /* Beyond Good & Evil */
|
||||
meta_GCA, /* Metal Slug Anthology */
|
||||
meta_MSVP, /* Popcap Hits */
|
||||
|
Loading…
x
Reference in New Issue
Block a user