diff --git a/src/formats.c b/src/formats.c index 87920ebd..0257c2ce 100644 --- a/src/formats.c +++ b/src/formats.c @@ -1073,7 +1073,7 @@ static const meta_info meta_info_list[] = { {meta_UBI_JADE, "Ubisoft Jade RIFF header"}, {meta_SEG, "Stormfront SEG header"}, {meta_NDS_STRM_FFTA2, "Final Fantasy Tactics A2 RIFF Header"}, - {meta_STR_ASR, "Donkey Kong Jet Race KNON/WII Header"}, + {meta_KNON, "Paon KNON header"}, {meta_ZWDSP, "Zack and Wiki custom DSP Header"}, {meta_GCA, "GCA DSP Header"}, {meta_SPT_SPD, "SPT+SPD DSP Header"}, @@ -1095,7 +1095,7 @@ static const meta_info meta_info_list[] = { {meta_RSTM_shrunken, "Nintendo RSTM header, corrupted by Atlus"}, {meta_RIFF_WAVE_MWV, "RIFF WAVE header with .mwv flavoring"}, {meta_FFCC_STR, "Final Fantasy: Crystal Chronicles STR header"}, - {meta_SAT_BAKA, "BAKA header from Crypt Killer"}, + {meta_SAT_BAKA, "Konami BAKA header"}, {meta_SWAV, "Nintendo SWAV header"}, {meta_VSF, "Square-Enix VSF header"}, {meta_NDS_RRDS, "Ridger Racer DS Header"}, diff --git a/src/meta/meta.h b/src/meta/meta.h index d75b90b1..4acb54e4 100644 --- a/src/meta/meta.h +++ b/src/meta/meta.h @@ -330,7 +330,7 @@ VGMSTREAM * init_vgmstream_seg(STREAMFILE * streamFile); VGMSTREAM * init_vgmstream_nds_strm_ffta2(STREAMFILE * streamFile); -VGMSTREAM * init_vgmstream_str_asr(STREAMFILE * streamFile); +VGMSTREAM * init_vgmstream_knon(STREAMFILE * streamFile); VGMSTREAM * init_vgmstream_zwdsp(STREAMFILE * streamFile); diff --git a/src/meta/str_asr.c b/src/meta/str_asr.c index 9a78476e..b0804f05 100644 --- a/src/meta/str_asr.c +++ b/src/meta/str_asr.c @@ -3,7 +3,7 @@ /* KNON - from Donkey Kong: Barrel Blast (Wii) */ -VGMSTREAM* init_vgmstream_str_asr(STREAMFILE* sf) { +VGMSTREAM* init_vgmstream_knon(STREAMFILE* sf) { VGMSTREAM* vgmstream = NULL; off_t start_offset; int loop_flag, channels; @@ -34,25 +34,27 @@ VGMSTREAM* init_vgmstream_str_asr(STREAMFILE* sf) { switch (read_32bitBE(0x20,sf)) { case 0x4B415354: /* "KAST" */ vgmstream->coding_type = coding_NGC_DSP; - vgmstream->num_samples = (read_32bitBE(0x3C,sf))*14/8/channels; - vgmstream->loop_start_sample = (read_32bitBE(0x44,sf))*14/8/channels; - vgmstream->loop_end_sample = (read_32bitBE(0x48,sf))*14/8/channels; + vgmstream->num_samples = dsp_bytes_to_samples(read_32bitBE(0x3C,sf), channels); + vgmstream->loop_start_sample = dsp_bytes_to_samples(read_32bitBE(0x44,sf), channels); + vgmstream->loop_end_sample = dsp_bytes_to_samples(read_32bitBE(0x48,sf), channels); vgmstream->interleave_block_size = 0x10; dsp_read_coefs_be(vgmstream, sf, 0x8c, 0x60); break; + case 0x4B505354: /* "KPST" */ vgmstream->coding_type = coding_PCM16BE; - vgmstream->num_samples = (read_32bitBE(0x3C,sf))/2/channels; - vgmstream->loop_start_sample = (read_32bitBE(0x44,sf))/2/channels; - vgmstream->loop_end_sample = (read_32bitBE(0x48,sf))/2/channels; + vgmstream->num_samples = pcm16_bytes_to_samples(read_32bitBE(0x3C,sf), channels); + vgmstream->loop_start_sample = pcm16_bytes_to_samples(read_32bitBE(0x44,sf), channels); + vgmstream->loop_end_sample = pcm16_bytes_to_samples(read_32bitBE(0x48,sf), channels); vgmstream->interleave_block_size = 0x10; break; + default: goto fail; } vgmstream->layout_type = layout_interleave; - vgmstream->meta_type = meta_STR_ASR; + vgmstream->meta_type = meta_KNON; if (!vgmstream_open_stream(vgmstream, sf, start_offset)) goto fail; diff --git a/src/vgmstream.c b/src/vgmstream.c index 68a17551..8e14055e 100644 --- a/src/vgmstream.c +++ b/src/vgmstream.c @@ -153,7 +153,7 @@ VGMSTREAM* (*init_vgmstream_functions[])(STREAMFILE* sf) = { init_vgmstream_ubi_jade_container, init_vgmstream_seg, init_vgmstream_nds_strm_ffta2, - init_vgmstream_str_asr, + init_vgmstream_knon, init_vgmstream_gca, init_vgmstream_spt_spd, init_vgmstream_ish_isd, diff --git a/src/vgmstream.h b/src/vgmstream.h index cd3d88e2..104b51f2 100644 --- a/src/vgmstream.h +++ b/src/vgmstream.h @@ -431,7 +431,7 @@ typedef enum { meta_PS2_ASS, /* ASS */ meta_SEG, /* Eragon */ meta_NDS_STRM_FFTA2, /* Final Fantasy Tactics A2 */ - meta_STR_ASR, /* Donkey Kong Jet Race */ + meta_KNON, meta_ZWDSP, /* Zack and Wiki */ meta_VGS, /* Guitar Hero Encore - Rocks the 80s */ meta_DCS_WAV,