From f090a8035c63da16d1fa914c607dca2a2d6e2a4e Mon Sep 17 00:00:00 2001 From: Chris Moeller Date: Fri, 23 May 2014 16:42:46 -0700 Subject: [PATCH] Update to work with some files found in Paper Mario: Sticker Star, thanks soneek --- Frameworks/vgmstream/vgmstream/src/meta/bcstm.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Frameworks/vgmstream/vgmstream/src/meta/bcstm.c b/Frameworks/vgmstream/vgmstream/src/meta/bcstm.c index 9ee9d544f..e210682b2 100644 --- a/Frameworks/vgmstream/vgmstream/src/meta/bcstm.c +++ b/Frameworks/vgmstream/vgmstream/src/meta/bcstm.c @@ -37,8 +37,6 @@ VGMSTREAM * init_vgmstream_bcstm(STREAMFILE *streamFile) { seek_offset = read_32bitLE(0x24, streamFile); - if ((uint32_t)read_32bitBE(seek_offset, streamFile) != 0x5345454B) /* "SEEK" If this header doesn't exist, assuming that the file is IMA */ - ima = 1; /* check type details */ codec_number = read_8bit(head_offset + 0x20, streamFile); @@ -50,11 +48,13 @@ VGMSTREAM * init_vgmstream_bcstm(STREAMFILE *streamFile) { coding_type = coding_PCM8; break; case 1: - coding_type = coding_PCM16BE; + coding_type = coding_PCM16LE; break; case 2: - if (ima) - coding_type = coding_INT_IMA; + if ((uint32_t)read_32bitBE(seek_offset, streamFile) != 0x5345454B) { /* "SEEK" If this header doesn't exist, assuming that the file is IMA */ + ima = 1; + coding_type = coding_INT_IMA; + } else coding_type = coding_NGC_DSP; break; @@ -136,8 +136,10 @@ VGMSTREAM * init_vgmstream_bcstm(STREAMFILE *streamFile) { if (ima) // No SEEK (ADPC) header, so just start where the SEEK header is supposed to be. start_offset = seek_offset; - else + else if (vgmstream->coding_type == coding_NGC_DSP) start_offset = read_32bitLE(0x30, streamFile) + 0x20; + else // No SEEK header and not IMA, so just start after the DATA header + start_offset = 0x120;