From 5720278d2d5d3be6c7ad8db8503d2fa2763cb700 Mon Sep 17 00:00:00 2001 From: bnnm Date: Sun, 12 Aug 2018 18:04:19 +0200 Subject: [PATCH] IDSP cleanup --- src/formats.c | 4 +++- src/meta/idsp.c | 29 +++++++++++++---------------- src/meta/meta.h | 8 ++++---- src/meta/ngc_dsp_std.c | 2 +- src/vgmstream.c | 8 ++++---- src/vgmstream.h | 4 +++- 6 files changed, 28 insertions(+), 27 deletions(-) diff --git a/src/formats.c b/src/formats.c index 9dbab79c..af4a70c4 100644 --- a/src/formats.c +++ b/src/formats.c @@ -820,7 +820,9 @@ static const meta_info meta_info_list[] = { {meta_FFXI_BGW, "BGW BGMStream header"}, {meta_FFXI_SPW, "SPW SeWave header"}, {meta_PS2_ASS, "ASS Header"}, - {meta_IDSP, "IDSP Header"}, + {meta_NUB_IDSP, "Namco NUB IDSP header"}, + {meta_IDSP_NL, "Next Level IDSP header"}, + {meta_IDSP_IE, "Inevitable Entertainment IDSP Header"}, {meta_UBI_JADE, "Ubisoft Jade RIFF header"}, {meta_PS2_SEG, "SEG (PS2) Header"}, {meta_XBOX_SEG, "SEG (XBOX) Header"}, diff --git a/src/meta/idsp.c b/src/meta/idsp.c index 82f79a5d..aa21bdc9 100644 --- a/src/meta/idsp.c +++ b/src/meta/idsp.c @@ -1,11 +1,9 @@ #include "meta.h" -#include "../util.h" -/* "idsp/IDSP" - Soul Calibur Legends (Wii) - Sky Crawlers: Innocent Aces (Wii) -*/ -VGMSTREAM * init_vgmstream_idsp2(STREAMFILE *streamFile) { +//todo cleanup + +/* "idsp" - from Namco's Wii NUB archives [Soul Calibur Legends (Wii), Sky Crawlers: Innocent Aces (Wii)] */ +VGMSTREAM * init_vgmstream_nub_idsp(STREAMFILE *streamFile) { VGMSTREAM * vgmstream = NULL; char filename[PATH_LIMIT]; int loop_flag; @@ -18,8 +16,8 @@ VGMSTREAM * init_vgmstream_idsp2(STREAMFILE *streamFile) { if (strcasecmp("idsp",filename_extension(filename))) goto fail; /* check header */ - if (read_32bitBE(0x00,streamFile) != 0x69647370 || /* "idsp" */ - read_32bitBE(0xBC,streamFile) != 0x49445350) /* IDSP */ + if (read_32bitBE(0x00,streamFile) != 0x69647370 || /* "idsp" */ + read_32bitBE(0xBC,streamFile) != 0x49445350) /* "IDSP" */ goto fail; loop_flag = read_32bitBE(0x20,streamFile); @@ -56,7 +54,7 @@ VGMSTREAM * init_vgmstream_idsp2(STREAMFILE *streamFile) { } } - vgmstream->meta_type = meta_IDSP; + vgmstream->meta_type = meta_NUB_IDSP; { if (vgmstream->coding_type == coding_NGC_DSP) { @@ -94,9 +92,8 @@ fail: return NULL; } -/* IDSP (Mario Strikers Charged) - - Single "IDSP" header... */ -VGMSTREAM * init_vgmstream_idsp3(STREAMFILE *streamFile) { +/* IDSP - from Next Level games [Mario Strikers Charged (Wii)] */ +VGMSTREAM * init_vgmstream_idsp_nl(STREAMFILE *streamFile) { VGMSTREAM * vgmstream = NULL; char filename[PATH_LIMIT]; int loop_flag = 1; @@ -133,7 +130,7 @@ VGMSTREAM * init_vgmstream_idsp3(STREAMFILE *streamFile) { vgmstream->interleave_last_block_size = ((vgmstream->num_samples/7*8)%(vgmstream->interleave_block_size)/vgmstream->channels); vgmstream->layout_type = layout_interleave; - vgmstream->meta_type = meta_IDSP; + vgmstream->meta_type = meta_IDSP_NL; if (vgmstream->coding_type == coding_NGC_DSP) { int i; @@ -170,8 +167,8 @@ fail: return NULL; } -/* IDSP (Defender NGC) */ -VGMSTREAM * init_vgmstream_idsp4(STREAMFILE *streamFile) { +/* IDSP - from Inevitable Entertainment games [Defender (GC)] */ +VGMSTREAM * init_vgmstream_idsp_ie(STREAMFILE *streamFile) { VGMSTREAM * vgmstream = NULL; char filename[PATH_LIMIT]; int loop_flag = 0; @@ -212,7 +209,7 @@ VGMSTREAM * init_vgmstream_idsp4(STREAMFILE *streamFile) { vgmstream->interleave_block_size = read_32bitBE(0x10,streamFile); } - vgmstream->meta_type = meta_IDSP; + vgmstream->meta_type = meta_IDSP_IE; { int i; diff --git a/src/meta/meta.h b/src/meta/meta.h index 4b4d7b0a..ae60aadb 100644 --- a/src/meta/meta.h +++ b/src/meta/meta.h @@ -260,7 +260,7 @@ VGMSTREAM * init_vgmstream_dc_idvi(STREAMFILE *streamFile); VGMSTREAM * init_vgmstream_ps2_rnd(STREAMFILE *streamFile); -VGMSTREAM * init_vgmstream_wii_idsp(STREAMFILE *streamFile); +VGMSTREAM * init_vgmstream_idsp_tt(STREAMFILE *streamFile); VGMSTREAM * init_vgmstream_kraw(STREAMFILE *streamFile); @@ -268,9 +268,9 @@ VGMSTREAM * init_vgmstream_ps2_omu(STREAMFILE *streamFile); VGMSTREAM * init_vgmstream_ps2_xa2(STREAMFILE * streamFile); -VGMSTREAM * init_vgmstream_idsp2(STREAMFILE * streamFile); -VGMSTREAM * init_vgmstream_idsp3(STREAMFILE * streamFile); -VGMSTREAM * init_vgmstream_idsp4(STREAMFILE * streamFile); +VGMSTREAM * init_vgmstream_nub_idsp(STREAMFILE * streamFile); +VGMSTREAM * init_vgmstream_idsp_nl(STREAMFILE * streamFile); +VGMSTREAM * init_vgmstream_idsp_ie(STREAMFILE * streamFile); VGMSTREAM * init_vgmstream_ngc_ymf(STREAMFILE * streamFile); diff --git a/src/meta/ngc_dsp_std.c b/src/meta/ngc_dsp_std.c index bb59272b..c310ae9b 100644 --- a/src/meta/ngc_dsp_std.c +++ b/src/meta/ngc_dsp_std.c @@ -868,7 +868,7 @@ fail: } /* IDSP - Traveller's Tales header + interleaved dsps [Lego Batman (Wii), Lego Dimensions (Wii U)] */ -VGMSTREAM * init_vgmstream_wii_idsp(STREAMFILE *streamFile) { +VGMSTREAM * init_vgmstream_idsp_tt(STREAMFILE *streamFile) { dsp_meta dspm = {0}; int version_main, version_sub; diff --git a/src/vgmstream.c b/src/vgmstream.c index 2f765fec..c858b1b3 100644 --- a/src/vgmstream.c +++ b/src/vgmstream.c @@ -141,13 +141,13 @@ VGMSTREAM * (*init_vgmstream_functions[])(STREAMFILE *streamFile) = { init_vgmstream_sat_sap, init_vgmstream_dc_idvi, init_vgmstream_ps2_rnd, - init_vgmstream_wii_idsp, + init_vgmstream_idsp_tt, init_vgmstream_kraw, init_vgmstream_ps2_omu, init_vgmstream_ps2_xa2, - init_vgmstream_idsp2, - init_vgmstream_idsp3, - init_vgmstream_idsp4, + init_vgmstream_nub_idsp, + init_vgmstream_idsp_nl, + init_vgmstream_idsp_ie, init_vgmstream_ngc_ymf, init_vgmstream_sadl, init_vgmstream_ps2_ccc, diff --git a/src/vgmstream.h b/src/vgmstream.h index 932fbf89..efe70243 100644 --- a/src/vgmstream.h +++ b/src/vgmstream.h @@ -401,7 +401,9 @@ typedef enum { meta_KRAW, /* Geometry Wars - Galaxies */ meta_PS2_OMU, /* PS2 Int file with Header */ meta_PS2_XA2, /* XG3 Extreme-G Racing */ - meta_IDSP, /* Chronicles of Narnia, Soul Calibur Legends, Mario Strikers Charged */ + meta_NUB_IDSP, /* Soul Calibur Legends (Wii) */ + meta_IDSP_NL, /* Mario Strikers Charged (Wii) */ + meta_IDSP_IE, /* Defencer (GC) */ meta_SPT_SPD, /* Various (SPT+SPT DSP) */ meta_ISH_ISD, /* Various (ISH+ISD DSP) */ meta_GSP_GSB, /* Tecmo games (Super Swing Golf 1 & 2, Quamtum Theory) */