diff --git a/src/meta/adx_header.c b/src/meta/adx_header.c index 26d83471..57952118 100644 --- a/src/meta/adx_header.c +++ b/src/meta/adx_header.c @@ -183,46 +183,46 @@ static struct { /* Clover Studio (GOD HAND, Okami) */ /* I'm pretty sure this is right, based on a decrypted version of some GOD HAND tracks. */ /* Also it is the 2nd result from guessadx */ - {.start=0x49e1,.mult=0x4a57,.add=0x553d}, + {0x49e1,0x4a57,0x553d}, /* Grasshopper Manufacture 0 (Blood+) */ /* this is estimated */ - {.start=0x5f5d,.mult=0x58bd,.add=0x55ed}, + {0x5f5d,0x58bd,0x55ed}, /* Grasshopper Manufacture 1 (Killer7) */ /* this is estimated */ - {.start=0x50fb,.mult=0x5803,.add=0x5701}, + {0x50fb,0x5803,0x5701}, /* Grasshopper Manufacture 2 (Samurai Champloo) */ /* confirmed unique with guessadx */ - {.start=0x4f3f,.mult=0x472f,.add=0x562f}, + {0x4f3f,0x472f,0x562f}, /* Moss Ltd (Raiden III) */ /* this is estimated */ - {.start=0x66f5,.mult=0x58bd,.add=0x4459}, + {0x66f5,0x58bd,0x4459}, /* Sonic Team 0 (Phantasy Star Universe) */ /* this is estimated */ - {.start=0x5deb,.mult=0x5f27,.add=0x673f}, + {0x5deb,0x5f27,0x673f}, /* G.dev (Senko no Ronde) */ /* this is estimated */ - {.start=0x46d3,.mult=0x5ced,.add=0x474d}, + {0x46d3,0x5ced,0x474d}, /* Sonic Team 1 (NiGHTS: Journey of Dreams) */ /* this seems to be dead on, but still estimated */ - {.start=0x440b,.mult=0x6539,.add=0x5723}, + {0x440b,0x6539,0x5723}, /* from guessadx (unique?), unknown source */ - {.start=0x586d,.mult=0x5d65,.add=0x63eb}, + {0x586d,0x5d65,0x63eb}, /* Navel (Shuffle! On the Stage) */ /* 2nd key from guessadx */ - {.start=0x4969,.mult=0x5deb,.add=0x467f}, + {0x4969,0x5deb,0x467f}, /* Success (Aoishiro) */ /* 1st key from guessadx */ - {.start=0x4d65,.mult=0x5eb7,.add=0x5dfd}, + {0x4d65,0x5eb7,0x5dfd}, }; static const int key_count = sizeof(keys)/sizeof(keys[0]); diff --git a/src/meta/emff.c b/src/meta/emff.c index d369ad61..a3a8cb2a 100644 --- a/src/meta/emff.c +++ b/src/meta/emff.c @@ -3,7 +3,7 @@ #include "../util.h" /* EMFF - Eidos Music File Format (PS2), -found in Tomb Raider Legend/Anniversary, Legacy of Kain - Defiance, possibly more... */ +Legacy of Kain - Defiance, possibly more... */ VGMSTREAM * init_vgmstream_emff_ps2(STREAMFILE *streamFile) { VGMSTREAM * vgmstream = NULL; char filename[260]; @@ -76,7 +76,7 @@ fail: /* EMFF - Eidos Music File Format (NGC/WII), -found in Tomb Raider Legend/Anniversary, Legacy of Kain - Defiance, possibly more... */ +found in Tomb Raider Legend/Anniversary/Underworld, possibly more... */ VGMSTREAM * init_vgmstream_emff_ngc(STREAMFILE *streamFile) { VGMSTREAM * vgmstream = NULL; char filename[260]; @@ -86,8 +86,7 @@ VGMSTREAM * init_vgmstream_emff_ngc(STREAMFILE *streamFile) { int frequency; int i; int j; - off_t coef_table1[8] = {0xC8,0xF6,0x124,0x152,0x180,0x1AE,0x1DC,0x20A}; - off_t coef_table2[8] = {0x2D0,0x2FE,0x32C,0x35A,0x388,0x3B6,0x3E4,0x412}; + off_t coef_table[8]; /* check extension, case insensitive */ streamFile->get_name(streamFile,filename,sizeof(filename)); @@ -121,37 +120,34 @@ VGMSTREAM * init_vgmstream_emff_ngc(STREAMFILE *streamFile) { vgmstream->coding_type = coding_NGC_DSP; /* Retrieving coefs and loops, depending on the file layout... */ - if (read_32bitBE(0xC8,streamFile) == 0x0 && - read_32bitBE(0xCC,streamFile) == 0x0 && - read_32bitBE(0xD0,streamFile) == 0x0 && - read_32bitBE(0xD4,streamFile) == 0x0 && - read_32bitBE(0xD8,streamFile) == 0x0 && - read_32bitBE(0xDC,streamFile) == 0x0 && - read_32bitBE(0xE0,streamFile) == 0x0 && - read_32bitBE(0xE4,streamFile) == 0x0) { - - for (j=0;jchannels;j++) { - for (i=0;i<16;i++) { - vgmstream->ch[j].adpcm_coef[i] = read_16bitBE(coef_table2[j]+i*2,streamFile); - } + /* Found in Tomb Raider - Legend for GameCube */ + if (read_32bitBE(0xC8,streamFile) > 0x0) { + off_t coef_table[8] = {0xC8,0xF6,0x124,0x152,0x180,0x1AE,0x1DC,0x20A}; + for (j=0;jchannels;j++) { + for (i=0;i<16;i++) { + vgmstream->ch[j].adpcm_coef[i] = read_16bitBE(coef_table[j]+i*2,streamFile); + } } - } else if (read_32bitBE(0x2D0,streamFile) == 0x0 && - read_32bitBE(0x2D4,streamFile) == 0x0 && - read_32bitBE(0x2D8,streamFile) == 0x0 && - read_32bitBE(0x2DC,streamFile) == 0x0 && - read_32bitBE(0x2E0,streamFile) == 0x0 && - read_32bitBE(0x2E4,streamFile) == 0x0 && - read_32bitBE(0x2E8,streamFile) == 0x0 && - read_32bitBE(0x2EC,streamFile) == 0x0) { - - for (j=0;jchannels;j++) { - for (i=0;i<16;i++) { - vgmstream->ch[j].adpcm_coef[i] = read_16bitBE(coef_table1[j]+i*2,streamFile); - } -} - } else { - goto fail; + /* Found in Tomb Raider - Anniversary for WII */ + } else if (read_32bitBE(0xCC,streamFile) > 0x0) { + off_t coef_table[8] = {0xCC,0xFA,0x128,0x156,0x184,0x1B2,0x1E0,0x20E}; + for (j=0;jchannels;j++) { + for (i=0;i<16;i++) { + vgmstream->ch[j].adpcm_coef[i] = read_16bitBE(coef_table[j]+i*2,streamFile); + } +} + /* Found in Tomb Raider - Underworld for WII */ + } else if (read_32bitBE(0x2D0,streamFile) > 0x0) { + off_t coef_table[8] = {0x2D0,0x2FE,0x32C,0x35A,0x388,0x3B6,0x3E4,0x412}; + for (j=0;jchannels;j++) { + for (i=0;i<16;i++) { + vgmstream->ch[j].adpcm_coef[i] = read_16bitBE(coef_table[j]+i*2,streamFile); } +} + + } else { + goto fail; + } vgmstream->layout_type = layout_emff_ngc_blocked; vgmstream->interleave_block_size = 0x10;