This commit is contained in:
bnnm 2021-06-20 11:31:30 +02:00
parent 05ff8464fd
commit c26684ffc1
6 changed files with 458 additions and 456 deletions

View File

@ -921,7 +921,7 @@ static const meta_info meta_info_list[] = {
{meta_DSP_STD, "Nintendo DSP header"}, {meta_DSP_STD, "Nintendo DSP header"},
{meta_DSP_CSTR, "Namco Cstr header"}, {meta_DSP_CSTR, "Namco Cstr header"},
{meta_GCSW, "MileStone GCSW header"}, {meta_GCSW, "MileStone GCSW header"},
{meta_PS2_SShd, "Sony ADS header"}, {meta_ADS, "Sony ADS header"},
{meta_NPS, "Namco NPSF header"}, {meta_NPS, "Namco NPSF header"},
{meta_RWSD, "Nintendo RWSD header (single stream)"}, {meta_RWSD, "Nintendo RWSD header (single stream)"},
{meta_RWAR, "Nintendo RWAR header (single RWAV stream)"}, {meta_RWAR, "Nintendo RWAR header (single RWAV stream)"},
@ -1080,7 +1080,7 @@ static const meta_info meta_info_list[] = {
{meta_PS2_TK5, "Tekken 5 Stream Header"}, {meta_PS2_TK5, "Tekken 5 Stream Header"},
{meta_PS2_SND, "Might and Magic SSND Header"}, {meta_PS2_SND, "Might and Magic SSND Header"},
{meta_PS2_VSF_TTA, "VSF with SMSS Header"}, {meta_PS2_VSF_TTA, "VSF with SMSS Header"},
{meta_ADS, "dhSS Header"}, {meta_ADS_MIDWAY, "Midway ADS header"},
{meta_PS2_MCG, "Gunvari MCG Header"}, {meta_PS2_MCG, "Gunvari MCG Header"},
{meta_ZSD, "ZSD Header"}, {meta_ZSD, "ZSD Header"},
{meta_REDSPARK, "RedSpark Header"}, {meta_REDSPARK, "RedSpark Header"},

View File

@ -2,59 +2,61 @@
#include "../util.h" #include "../util.h"
#include "../coding/coding.h" #include "../coding/coding.h"
/* ADS - from Gauntlet Dark Legacy (GC/Xbox) */ /* .ADS - from Gauntlet Dark Legacy (GC/Xbox) */
VGMSTREAM * init_vgmstream_ads(STREAMFILE *streamFile) { VGMSTREAM* init_vgmstream_ads_midway(STREAMFILE* sf) {
VGMSTREAM* vgmstream = NULL; VGMSTREAM* vgmstream = NULL;
off_t start_offset; off_t start_offset;
int loop_flag, channel_count, codec; int loop_flag, channels, codec;
/* check extension, case insensitive */ /* checks */
if (!check_extensions(streamFile,"ads")) goto fail; if (!check_extensions(sf,"ads"))
if (read_32bitBE(0x00,streamFile) != 0x64685353) /* "dhSS" */
goto fail; goto fail;
if (read_32bitBE(0x20,streamFile) != 0x64625353) /* "dbSS" */
/* fake PS2 .ads but BE */
if (!is_id32be(0x00,sf, "dhSS"))
goto fail;
if (!is_id32be(0x20,sf, "dbSS"))
goto fail; goto fail;
loop_flag = 1; loop_flag = 1;
channel_count = read_32bitBE(0x10,streamFile); channels = read_32bitBE(0x10,sf);
if (channels > 2)
if (channel_count > 2)
goto fail; goto fail;
/* build the VGMSTREAM */ /* build the VGMSTREAM */
vgmstream = allocate_vgmstream(channel_count,loop_flag); vgmstream = allocate_vgmstream(channels, loop_flag);
if (!vgmstream) goto fail; if (!vgmstream) goto fail;
vgmstream->sample_rate = read_32bitBE(0x0c,streamFile); vgmstream->sample_rate = read_32bitBE(0x0c,sf);
codec = read_32bitBE(0x08,streamFile); codec = read_32bitBE(0x08,sf);
switch (codec) { switch (codec) {
case 0x00000020: /* GC */ case 0x00000020: /* GC */
start_offset = 0x28 + 0x60 * channel_count; start_offset = 0x28 + 0x60 * channels;
vgmstream->coding_type = coding_NGC_DSP; vgmstream->coding_type = coding_NGC_DSP;
vgmstream->num_samples = read_32bitBE(0x28,streamFile); vgmstream->num_samples = read_32bitBE(0x28,sf);
if (loop_flag) { if (loop_flag) {
vgmstream->loop_start_sample = 0; vgmstream->loop_start_sample = 0;
vgmstream->loop_end_sample = vgmstream->num_samples; vgmstream->loop_end_sample = vgmstream->num_samples;
} }
if (channel_count == 1) { if (channels == 1) {
vgmstream->layout_type = layout_none; vgmstream->layout_type = layout_none;
} else if (channel_count == 2) { } else if (channels == 2) {
vgmstream->layout_type = layout_interleave; vgmstream->layout_type = layout_interleave;
vgmstream->interleave_block_size = read_32bitBE(0x14,streamFile); vgmstream->interleave_block_size = read_32bitBE(0x14,sf);
} }
dsp_read_coefs_be(vgmstream, streamFile, 0x44,0x60); dsp_read_coefs_be(vgmstream, sf, 0x44,0x60);
break; break;
case 0x00000021: /* Xbox */ case 0x00000021: /* Xbox */
start_offset = 0x28; start_offset = 0x28;
vgmstream->coding_type = coding_XBOX_IMA_int; vgmstream->coding_type = coding_XBOX_IMA_int;
vgmstream->num_samples = xbox_ima_bytes_to_samples(read_32bitBE(0x24,streamFile), vgmstream->channels); vgmstream->num_samples = xbox_ima_bytes_to_samples(read_32bitBE(0x24,sf), vgmstream->channels);
vgmstream->layout_type = channel_count == 1 ? layout_none : layout_interleave; vgmstream->layout_type = channels == 1 ? layout_none : layout_interleave;
vgmstream->interleave_block_size = 0x24; vgmstream->interleave_block_size = 0x24;
if (loop_flag) { if (loop_flag) {
vgmstream->loop_start_sample = 0; vgmstream->loop_start_sample = 0;
@ -66,9 +68,9 @@ VGMSTREAM * init_vgmstream_ads(STREAMFILE *streamFile) {
goto fail; goto fail;
} }
vgmstream->meta_type = meta_ADS; vgmstream->meta_type = meta_ADS_MIDWAY;
if (!vgmstream_open_stream(vgmstream, streamFile, start_offset)) if (!vgmstream_open_stream(vgmstream, sf, start_offset))
goto fail; goto fail;
return vgmstream; return vgmstream;

View File

@ -66,8 +66,8 @@ VGMSTREAM * init_vgmstream_csmp(STREAMFILE *streamFile);
VGMSTREAM * init_vgmstream_rfrm(STREAMFILE *streamFile); VGMSTREAM * init_vgmstream_rfrm(STREAMFILE *streamFile);
VGMSTREAM * init_vgmstream_ps2_ads(STREAMFILE *streamFile); VGMSTREAM* init_vgmstream_ads(STREAMFILE* sf);
VGMSTREAM * init_vgmstream_ps2_ads_container(STREAMFILE *streamFile); VGMSTREAM* init_vgmstream_ads_container(STREAMFILE* sf);
VGMSTREAM * init_vgmstream_nps(STREAMFILE *streamFile); VGMSTREAM * init_vgmstream_nps(STREAMFILE *streamFile);
@ -384,7 +384,7 @@ VGMSTREAM * init_vgmstream_ps2_tk1(STREAMFILE* streamFile);
VGMSTREAM * init_vgmstream_ps2_vsf_tta(STREAMFILE *streamFile); VGMSTREAM * init_vgmstream_ps2_vsf_tta(STREAMFILE *streamFile);
VGMSTREAM * init_vgmstream_ads(STREAMFILE *streamFile); VGMSTREAM* init_vgmstream_ads_midway(STREAMFILE* sf);
VGMSTREAM * init_vgmstream_ps2_mcg(STREAMFILE *streamFile); VGMSTREAM * init_vgmstream_ps2_mcg(STREAMFILE *streamFile);

View File

@ -3,10 +3,10 @@
/* .ADS - Sony's "Audio Stream" format [Edit Racing (PS2), Evergrace II (PS2), Pri-Saga! Portable (PSP)] */ /* .ADS - Sony's "Audio Stream" format [Edit Racing (PS2), Evergrace II (PS2), Pri-Saga! Portable (PSP)] */
VGMSTREAM * init_vgmstream_ps2_ads(STREAMFILE *streamFile) { VGMSTREAM* init_vgmstream_ads(STREAMFILE* sf) {
VGMSTREAM* vgmstream = NULL; VGMSTREAM* vgmstream = NULL;
off_t start_offset; off_t start_offset;
int loop_flag, channel_count, sample_rate, interleave, is_loop_samples = 0; int loop_flag, channels, sample_rate, interleave, is_loop_samples = 0;
size_t body_size, stream_size, file_size; size_t body_size, stream_size, file_size;
uint32_t codec, loop_start_sample = 0, loop_end_sample = 0, loop_start_offset = 0, loop_end_offset = 0; uint32_t codec, loop_start_sample = 0, loop_end_sample = 0, loop_start_offset = 0, loop_end_offset = 0;
coding_t coding_type; coding_t coding_type;
@ -18,25 +18,25 @@ VGMSTREAM * init_vgmstream_ps2_ads(STREAMFILE *streamFile) {
* .ss2: demuxed videos (fake?) * .ss2: demuxed videos (fake?)
* .pcm: Taisho Mononoke Ibunroku (PS2) * .pcm: Taisho Mononoke Ibunroku (PS2)
* .adx: Armored Core 3 (PS2) * .adx: Armored Core 3 (PS2)
* [no actual extension]: MotoGP (PS2) * (extensionless): MotoGP (PS2)
* .800: Mobile Suit Gundam: The One Year War (PS2) */ * .800: Mobile Suit Gundam: The One Year War (PS2) */
if (!check_extensions(streamFile, "ads,ss2,pcm,adx,,800")) if (!check_extensions(sf, "ads,ss2,pcm,adx,,800"))
goto fail; goto fail;
if (read_32bitBE(0x00,streamFile) != 0x53536864 && /* "SShd" */ if (!is_id32be(0x00,sf,"SShd") &&
read_32bitBE(0x20,streamFile) != 0x53536264) /* "SSbd" */ !is_id32be(0x20,sf,"SSbd"))
goto fail; goto fail;
if (read_32bitLE(0x04,streamFile) != 0x18 && /* standard header size */ if (read_32bitLE(0x04,sf) != 0x18 && /* standard header size */
read_32bitLE(0x04,streamFile) != 0x20) /* True Fortune (PS2) */ read_32bitLE(0x04,sf) != 0x20) /* True Fortune (PS2) */
goto fail; goto fail;
/* base values (a bit unorderly since devs hack ADS too much and detection is messy) */ /* base values (a bit unorderly since devs hack ADS too much and detection is messy) */
{ {
codec = read_32bitLE(0x08,streamFile); codec = read_32bitLE(0x08,sf);
sample_rate = read_32bitLE(0x0C,streamFile); sample_rate = read_32bitLE(0x0C,sf);
channel_count = read_32bitLE(0x10,streamFile); /* up to 4 [Eve of Extinction (PS2)] */ channels = read_32bitLE(0x10,sf); /* up to 4 [Eve of Extinction (PS2)] */
interleave = read_32bitLE(0x14,streamFile); /* set even when mono */ interleave = read_32bitLE(0x14,sf); /* set even when mono */
switch(codec) { switch(codec) {
@ -69,8 +69,8 @@ VGMSTREAM * init_vgmstream_ps2_ads(STREAMFILE *streamFile) {
/* sizes */ /* sizes */
{ {
file_size = get_streamfile_size(streamFile); file_size = get_streamfile_size(sf);
body_size = read_32bitLE(0x24,streamFile); body_size = read_32bitLE(0x24,sf);
/* bigger than file_size in rare cases, even if containing all data (ex. Megaman X7's SY04.ADS) */ /* bigger than file_size in rare cases, even if containing all data (ex. Megaman X7's SY04.ADS) */
if (body_size + 0x28 > file_size) { if (body_size + 0x28 > file_size) {
@ -101,15 +101,15 @@ VGMSTREAM * init_vgmstream_ps2_ads(STREAMFILE *streamFile) {
/* "ADSC" container */ /* "ADSC" container */
if (coding_type == coding_PSX if (coding_type == coding_PSX
&& read_32bitLE(0x28,streamFile) == 0x1000 /* real start */ && read_32bitLE(0x28,sf) == 0x1000 /* real start */
&& read_32bitLE(0x2c,streamFile) == 0 && read_32bitLE(0x2c,sf) == 0
&& read_32bitLE(0x1008,streamFile) != 0) { && read_32bitLE(0x1008,sf) != 0) {
int i; int i;
int is_adsc = 1; int is_adsc = 1;
/* should be empty up to data start */ /* should be empty up to data start */
for (i = 0; i < 0xFDC/4; i++) { for (i = 0; i < 0xFDC/4; i++) {
if (read_32bitLE(0x2c+(i*4),streamFile) != 0) { if (read_32bitLE(0x2c+(i*4),sf) != 0) {
is_adsc = 0; is_adsc = 0;
break; break;
} }
@ -127,8 +127,8 @@ VGMSTREAM * init_vgmstream_ps2_ads(STREAMFILE *streamFile) {
{ {
uint32_t loop_start, loop_end; uint32_t loop_start, loop_end;
loop_start = read_32bitLE(0x18,streamFile); loop_start = read_32bitLE(0x18,sf);
loop_end = read_32bitLE(0x1C,streamFile); loop_end = read_32bitLE(0x1C,sf);
loop_flag = 0; loop_flag = 0;
@ -144,10 +144,10 @@ VGMSTREAM * init_vgmstream_ps2_ads(STREAMFILE *streamFile) {
loop_start_offset = loop_start * 0x10; loop_start_offset = loop_start * 0x10;
ignore_silent_frame_capcom = 1; ignore_silent_frame_capcom = 1;
} }
else if (read_32bitBE(0x28,streamFile) == 0x50414421) { /* "PAD!" padding until 0x800 */ else if (read_32bitBE(0x28,sf) == 0x50414421) { /* "PAD!" padding until 0x800 */
/* Super Galdelic Hour: loop_start is PCM bytes */ /* Super Galdelic Hour: loop_start is PCM bytes */
loop_flag = 1; loop_flag = 1;
loop_start_sample = loop_start / 2 / channel_count; loop_start_sample = loop_start / 2 / channels;
is_loop_samples = 1; is_loop_samples = 1;
} }
else if ((loop_start % 0x800 == 0) && loop_start > 0) { /* sector-aligned, min/0 is 0x800 */ else if ((loop_start % 0x800 == 0) && loop_start > 0) { /* sector-aligned, min/0 is 0x800 */
@ -199,8 +199,8 @@ VGMSTREAM * init_vgmstream_ps2_ads(STREAMFILE *streamFile) {
loop_end_offset = loop_end * 0x20; loop_end_offset = loop_end * 0x20;
} }
else if (loop_end <= body_size / 0x10 && coding_type == coding_PSX else if (loop_end <= body_size / 0x10 && coding_type == coding_PSX
&& (read_32bitBE(0x28 + loop_end*0x10 + 0x10 + 0x00, streamFile) == 0x00077777 || && (read_32bitBE(0x28 + loop_end*0x10 + 0x10 + 0x00, sf) == 0x00077777 ||
read_32bitBE(0x28 + loop_end*0x10 + 0x20 + 0x00, streamFile) == 0x00077777)) { read_32bitBE(0x28 + loop_end*0x10 + 0x20 + 0x00, sf) == 0x00077777)) {
/* not-quite-looping sfx, ending with a "non-looping PS-ADPCM end frame" [Kono Aozora ni Yakusoku, Chanter] */ /* not-quite-looping sfx, ending with a "non-looping PS-ADPCM end frame" [Kono Aozora ni Yakusoku, Chanter] */
loop_flag = 0; loop_flag = 0;
} }
@ -229,26 +229,26 @@ VGMSTREAM * init_vgmstream_ps2_ads(STREAMFILE *streamFile) {
do { do {
offset -= 0x10; offset -= 0x10;
if (read_8bit(offset+0x01,streamFile) == 0x07) { if (read_8bit(offset+0x01,sf) == 0x07) {
stream_size -= 0x10*channel_count;/* ignore don't decode flag/padding frame (most common) [ex. Capcom games] */ stream_size -= 0x10*channels;/* ignore don't decode flag/padding frame (most common) [ex. Capcom games] */
} }
else if (read_32bitBE(offset+0x00,streamFile) == 0x00000000 && read_32bitBE(offset+0x04,streamFile) == 0x00000000 && else if (read_32bitBE(offset+0x00,sf) == 0x00000000 && read_32bitBE(offset+0x04,sf) == 0x00000000 &&
read_32bitBE(offset+0x08,streamFile) == 0x00000000 && read_32bitBE(offset+0x0c,streamFile) == 0x00000000) { read_32bitBE(offset+0x08,sf) == 0x00000000 && read_32bitBE(offset+0x0c,sf) == 0x00000000) {
stream_size -= 0x10*channel_count; /* ignore null frame [ex. A.C.E. Another Century Episode 1/2/3] */ stream_size -= 0x10*channels; /* ignore null frame [ex. A.C.E. Another Century Episode 1/2/3] */
} }
else if (read_32bitBE(offset+0x00,streamFile) == 0x00007777 && read_32bitBE(offset+0x04,streamFile) == 0x77777777 && else if (read_32bitBE(offset+0x00,sf) == 0x00007777 && read_32bitBE(offset+0x04,sf) == 0x77777777 &&
read_32bitBE(offset+0x08,streamFile) == 0x77777777 && read_32bitBE(offset+0x0c,streamFile) == 0x77777777) { read_32bitBE(offset+0x08,sf) == 0x77777777 && read_32bitBE(offset+0x0c,sf) == 0x77777777) {
stream_size -= 0x10*channel_count; /* ignore padding frame [ex. Akane Iro ni Somaru Saka - Parallel] */ stream_size -= 0x10*channels; /* ignore padding frame [ex. Akane Iro ni Somaru Saka - Parallel] */
} }
else if (read_32bitBE(offset+0x00,streamFile) == 0x0C020000 && read_32bitBE(offset+0x04,streamFile) == 0x00000000 && else if (read_32bitBE(offset+0x00,sf) == 0x0C020000 && read_32bitBE(offset+0x04,sf) == 0x00000000 &&
read_32bitBE(offset+0x08,streamFile) == 0x00000000 && read_32bitBE(offset+0x0c,streamFile) == 0x00000000 && read_32bitBE(offset+0x08,sf) == 0x00000000 && read_32bitBE(offset+0x0c,sf) == 0x00000000 &&
ignore_silent_frame_cavia) { ignore_silent_frame_cavia) {
stream_size -= 0x10*channel_count; /* ignore silent frame [ex. cavia games] */ stream_size -= 0x10*channels; /* ignore silent frame [ex. cavia games] */
} }
else if (read_32bitBE(offset+0x00,streamFile) == 0x0C010000 && read_32bitBE(offset+0x04,streamFile) == 0x00000000 && else if (read_32bitBE(offset+0x00,sf) == 0x0C010000 && read_32bitBE(offset+0x04,sf) == 0x00000000 &&
read_32bitBE(offset+0x08,streamFile) == 0x00000000 && read_32bitBE(offset+0x0c,streamFile) == 0x00000000 && read_32bitBE(offset+0x08,sf) == 0x00000000 && read_32bitBE(offset+0x0c,sf) == 0x00000000 &&
ignore_silent_frame_capcom) { ignore_silent_frame_capcom) {
stream_size -= 0x10*channel_count; /* ignore silent frame [ex. Capcom games] */ stream_size -= 0x10*channels; /* ignore silent frame [ex. Capcom games] */
} }
else { else {
break; /* standard frame */ break; /* standard frame */
@ -261,24 +261,24 @@ VGMSTREAM * init_vgmstream_ps2_ads(STREAMFILE *streamFile) {
/* build the VGMSTREAM */ /* build the VGMSTREAM */
vgmstream = allocate_vgmstream(channel_count,loop_flag); vgmstream = allocate_vgmstream(channels, loop_flag);
if (!vgmstream) goto fail; if (!vgmstream) goto fail;
vgmstream->sample_rate = sample_rate; vgmstream->sample_rate = sample_rate;
vgmstream->coding_type = coding_type; vgmstream->coding_type = coding_type;
vgmstream->interleave_block_size = interleave; vgmstream->interleave_block_size = interleave;
vgmstream->layout_type = layout_interleave; vgmstream->layout_type = layout_interleave;
vgmstream->meta_type = meta_PS2_SShd; vgmstream->meta_type = meta_ADS;
switch(coding_type) { switch(coding_type) {
case coding_PCM16LE: case coding_PCM16LE:
vgmstream->num_samples = pcm_bytes_to_samples(stream_size, channel_count, 16); vgmstream->num_samples = pcm16_bytes_to_samples(stream_size, channels);
break; break;
case coding_PSX: case coding_PSX:
vgmstream->num_samples = ps_bytes_to_samples(stream_size, channel_count); vgmstream->num_samples = ps_bytes_to_samples(stream_size, channels);
break; break;
case coding_DVI_IMA_int: case coding_DVI_IMA_int:
vgmstream->num_samples = ima_bytes_to_samples(stream_size, channel_count); vgmstream->num_samples = ima_bytes_to_samples(stream_size, channels);
break; break;
default: default:
goto fail; goto fail;
@ -292,12 +292,12 @@ VGMSTREAM * init_vgmstream_ps2_ads(STREAMFILE *streamFile) {
else { else {
switch(vgmstream->coding_type) { switch(vgmstream->coding_type) {
case coding_PCM16LE: case coding_PCM16LE:
vgmstream->loop_start_sample = pcm_bytes_to_samples(loop_start_offset,channel_count,16); vgmstream->loop_start_sample = pcm16_bytes_to_samples(loop_start_offset, channels);
vgmstream->loop_end_sample = pcm_bytes_to_samples(loop_end_offset,channel_count,16); vgmstream->loop_end_sample = pcm16_bytes_to_samples(loop_end_offset, channels);
break; break;
case coding_PSX: case coding_PSX:
vgmstream->loop_start_sample = ps_bytes_to_samples(loop_start_offset,channel_count); vgmstream->loop_start_sample = ps_bytes_to_samples(loop_start_offset, channels);
vgmstream->loop_end_sample = ps_bytes_to_samples(loop_end_offset,channel_count); vgmstream->loop_end_sample = ps_bytes_to_samples(loop_end_offset, channels);
break; break;
default: default:
goto fail; goto fail;
@ -314,7 +314,7 @@ VGMSTREAM * init_vgmstream_ps2_ads(STREAMFILE *streamFile) {
} }
if (!vgmstream_open_stream(vgmstream,streamFile,start_offset)) if (!vgmstream_open_stream(vgmstream, sf, start_offset))
goto fail; goto fail;
return vgmstream; return vgmstream;
@ -326,24 +326,24 @@ fail:
/* ****************************************************************************** */ /* ****************************************************************************** */
/* ADS in containers */ /* ADS in containers */
VGMSTREAM * init_vgmstream_ps2_ads_container(STREAMFILE *streamFile) { VGMSTREAM* init_vgmstream_ads_container(STREAMFILE* sf) {
VGMSTREAM* vgmstream = NULL; VGMSTREAM* vgmstream = NULL;
STREAMFILE *temp_streamFile = NULL; STREAMFILE* temp_sf = NULL;
off_t subfile_offset; off_t subfile_offset;
size_t subfile_size; size_t subfile_size;
/* checks */ /* checks */
if (!check_extensions(streamFile, "ads")) if (!check_extensions(sf, "ads"))
goto fail; goto fail;
if (read_32bitBE(0x00,streamFile) == 0x41445343 && /* "ADSC" */ if (read_32bitBE(0x00,sf) == 0x41445343 && /* "ADSC" */
read_32bitBE(0x04,streamFile) == 0x01000000) { read_32bitBE(0x04,sf) == 0x01000000) {
/* Kenka Bancho 2, Kamen Rider Hibiki/Kabuto, Shinjuku no Okami */ /* Kenka Bancho 2, Kamen Rider Hibiki/Kabuto, Shinjuku no Okami */
subfile_offset = 0x08; subfile_offset = 0x08;
} }
else if (read_32bitBE(0x00,streamFile) == 0x63617669 && /* "cavi" */ else if (read_32bitBE(0x00,sf) == 0x63617669 && /* "cavi" */
read_32bitBE(0x04,streamFile) == 0x61207374 && /* "a st" */ read_32bitBE(0x04,sf) == 0x61207374 && /* "a st" */
read_32bitBE(0x08,streamFile) == 0x7265616D) { /* "ream" */ read_32bitBE(0x08,sf) == 0x7265616D) { /* "ream" */
/* cavia games: Drakengard 1/2, Dragon Quest Yangus, GITS: Stand Alone Complex */ /* cavia games: Drakengard 1/2, Dragon Quest Yangus, GITS: Stand Alone Complex */
subfile_offset = 0x7d8; subfile_offset = 0x7d8;
} }
@ -351,18 +351,18 @@ VGMSTREAM * init_vgmstream_ps2_ads_container(STREAMFILE *streamFile) {
goto fail; goto fail;
} }
subfile_size = get_streamfile_size(streamFile) - subfile_offset; subfile_size = get_streamfile_size(sf) - subfile_offset;
temp_streamFile = setup_subfile_streamfile(streamFile, subfile_offset,subfile_size, NULL); temp_sf = setup_subfile_streamfile(sf, subfile_offset, subfile_size, NULL);
if (!temp_streamFile) goto fail; if (!temp_sf) goto fail;
vgmstream = init_vgmstream_ps2_ads(temp_streamFile); vgmstream = init_vgmstream_ads(temp_sf);
close_streamfile(temp_streamFile); close_streamfile(temp_sf);
return vgmstream; return vgmstream;
fail: fail:
close_streamfile(temp_streamFile); close_streamfile(temp_sf);
close_vgmstream(vgmstream); close_vgmstream(vgmstream);
return NULL; return NULL;
} }

View File

@ -40,7 +40,7 @@ VGMSTREAM* (*init_vgmstream_functions[])(STREAMFILE* sf) = {
init_vgmstream_rfrm, init_vgmstream_rfrm,
init_vgmstream_cstr, init_vgmstream_cstr,
init_vgmstream_gcsw, init_vgmstream_gcsw,
init_vgmstream_ps2_ads, init_vgmstream_ads,
init_vgmstream_nps, init_vgmstream_nps,
init_vgmstream_rwsd, init_vgmstream_rwsd,
init_vgmstream_xa, init_vgmstream_xa,
@ -193,7 +193,7 @@ VGMSTREAM* (*init_vgmstream_functions[])(STREAMFILE* sf) = {
init_vgmstream_nds_rrds, init_vgmstream_nds_rrds,
init_vgmstream_ps2_tk5, init_vgmstream_ps2_tk5,
init_vgmstream_ps2_vsf_tta, init_vgmstream_ps2_vsf_tta,
init_vgmstream_ads, init_vgmstream_ads_midway,
init_vgmstream_ps2_mcg, init_vgmstream_ps2_mcg,
init_vgmstream_zsd, init_vgmstream_zsd,
init_vgmstream_ps2_vgs, init_vgmstream_ps2_vgs,
@ -393,7 +393,7 @@ VGMSTREAM* (*init_vgmstream_functions[])(STREAMFILE* sf) = {
init_vgmstream_dsp_switch_audio, init_vgmstream_dsp_switch_audio,
init_vgmstream_sadf, init_vgmstream_sadf,
init_vgmstream_h4m, init_vgmstream_h4m,
init_vgmstream_ps2_ads_container, init_vgmstream_ads_container,
init_vgmstream_asf, init_vgmstream_asf,
init_vgmstream_xmd, init_vgmstream_xmd,
init_vgmstream_cks, init_vgmstream_cks,

View File

@ -357,7 +357,7 @@ typedef enum {
meta_BNSF, /* Bandai Namco Sound Format */ meta_BNSF, /* Bandai Namco Sound Format */
meta_XA, /* CD-ROM XA */ meta_XA, /* CD-ROM XA */
meta_PS2_SShd, /* .ADS with SShd header */ meta_ADS,
meta_NPS, meta_NPS,
meta_RXWS, meta_RXWS,
meta_RAW_INT, meta_RAW_INT,
@ -455,7 +455,7 @@ typedef enum {
meta_SAT_BAKA, /* Crypt Killer */ meta_SAT_BAKA, /* Crypt Killer */
meta_VSF, meta_VSF,
meta_PS2_VSF_TTA, /* Tiny Toon Adventures: Defenders of the Universe */ meta_PS2_VSF_TTA, /* Tiny Toon Adventures: Defenders of the Universe */
meta_ADS, /* Gauntlet Dark Legends (GC) */ meta_ADS_MIDWAY,
meta_PS2_SPS, /* Ape Escape 2 */ meta_PS2_SPS, /* Ape Escape 2 */
meta_PS2_XA2_RRP, /* RC Revenge Pro */ meta_PS2_XA2_RRP, /* RC Revenge Pro */
meta_NGC_DSP_KONAMI, /* Konami DSP header, found in various games */ meta_NGC_DSP_KONAMI, /* Konami DSP header, found in various games */