From cb646cfbdeac1fcb0dd1a84224b3ffd66b438e05 Mon Sep 17 00:00:00 2001 From: bnnm Date: Sat, 9 Dec 2017 17:57:18 +0100 Subject: [PATCH] Add VAGp .vig [MX vs. ATV Untamed (PS2)] --- src/meta/ps2_vag.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/meta/ps2_vag.c b/src/meta/ps2_vag.c index b983c8e6..9af6a79e 100644 --- a/src/meta/ps2_vag.c +++ b/src/meta/ps2_vag.c @@ -17,8 +17,8 @@ VGMSTREAM * init_vgmstream_ps2_vag(STREAMFILE *streamFile) { int channel_count = 0; int is_swag = 0; - /* check extension, case insensitive */ - if ( !check_extensions(streamFile,"vag,swag,str") ) + /* check extension (.swag: Frantix PSP, .str: Ben10 Galactic Racing, .vig: MX vs. ATV Untamed PS2) */ + if ( !check_extensions(streamFile,"vag,swag,str,vig") ) goto fail; /* check VAG Header */ @@ -63,7 +63,11 @@ VGMSTREAM * init_vgmstream_ps2_vag(STREAMFILE *streamFile) { break; case 'p': /* "VAGp" (extended) [most common, ex Ratchet & Clank] */ - if (read_32bitBE(0x6000,streamFile) == 0x56414770) { /* "VAGp" */ + if (check_extensions(streamFile,"vig")) { /* MX vs. ATV Untamed PS2 */ + channel_count = 2; /* normal interleave */ + loop_flag = 0; + } + else if (read_32bitBE(0x6000,streamFile) == 0x56414770) { /* "VAGp" */ channel_count = 2; /* The Simpsons Wrestling PSX interleave */ loop_flag = 0; } @@ -136,7 +140,14 @@ VGMSTREAM * init_vgmstream_ps2_vag(STREAMFILE *streamFile) { case 'p': // VAGp interleave=0x10; - if (read_32bitBE(0x6000,streamFile) == 0x56414770) { /* "VAGp" */ + if (check_extensions(streamFile,"vig")) { /* MX vs. ATV Untamed PS2 */ + vgmstream->layout_type=layout_interleave; + vgmstream->meta_type=meta_PS2_VAGp; + + vgmstream->num_samples = (datasize - 0x10*channel_count) / 16 * 28; + start_offset = 0x800; + } + else if (read_32bitBE(0x6000,streamFile) == 0x56414770) { /* interleaved "VAGp" */ interleave = 0x6000; /* The Simpsons Wrestling PSX interleave, includes header */ vgmstream->layout_type = layout_interleave; vgmstream->meta_type = meta_PS2_VAGs;