From 64318e24d4f5dfa9e681ae8272ac208f1d7996e0 Mon Sep 17 00:00:00 2001 From: bnnm Date: Sat, 24 Jun 2023 15:41:59 +0200 Subject: [PATCH] cleanup: lp_ap_lep --- src/formats.c | 2 +- src/meta/meta.h | 2 +- src/meta/ps2_enth.c | 9 ++++++--- src/vgmstream.c | 2 +- src/vgmstream_types.h | 2 +- 5 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/formats.c b/src/formats.c index e0dd4491..e819e3b3 100644 --- a/src/formats.c +++ b/src/formats.c @@ -1080,7 +1080,7 @@ static const meta_info meta_info_list[] = { {meta_PS2_PCM, "Konami KCEJ East .PCM header"}, {meta_PS2_RKV, "Legacy of Kain - Blood Omen 2 RKV PS2 header"}, {meta_PS2_VAS, "Konami .VAS header"}, - {meta_PS2_ENTH, ".enth Header"}, + {meta_LP_AP_LEP, "Konami LP/AP/LEP header"}, {meta_SDT, "High Voltage .sdt header"}, {meta_NGC_TYDSP, ".tydsp Header"}, {meta_WVS, "Swingin' Ape .WVS header"}, diff --git a/src/meta/meta.h b/src/meta/meta.h index 1db64229..a350ddd1 100644 --- a/src/meta/meta.h +++ b/src/meta/meta.h @@ -256,7 +256,7 @@ VGMSTREAM * init_vgmstream_ps2_rkv(STREAMFILE * streamFile); VGMSTREAM * init_vgmstream_ps2_vas(STREAMFILE * streamFile); VGMSTREAM * init_vgmstream_ps2_vas_container(STREAMFILE * streamFile); -VGMSTREAM * init_vgmstream_ps2_enth(STREAMFILE * streamFile); +VGMSTREAM* init_vgmstream_lp_ap_lep(STREAMFILE* sf); VGMSTREAM * init_vgmstream_sdt(STREAMFILE * streamFile); diff --git a/src/meta/ps2_enth.c b/src/meta/ps2_enth.c index 4501a1f5..449cf533 100644 --- a/src/meta/ps2_enth.c +++ b/src/meta/ps2_enth.c @@ -3,7 +3,7 @@ #include "ps2_enth_streamfile.h" /* LP/AP/LEP - from Konami (KCES)'s Enthusia: Professional Racing (PS2) */ -VGMSTREAM* init_vgmstream_ps2_enth(STREAMFILE* sf) { +VGMSTREAM* init_vgmstream_lp_ap_lep(STREAMFILE* sf) { VGMSTREAM* vgmstream = NULL; STREAMFILE* temp_sf = NULL; off_t start_offset; @@ -13,10 +13,13 @@ VGMSTREAM* init_vgmstream_ps2_enth(STREAMFILE* sf) { /* checks */ + if (!is_id32be(0x00,sf,"LP ") && !is_id32be(0x00,sf,"AP ") && !is_id32be(0x00,sf,"LEP ")) + return NULL; + /* .bin/lbin: internal (no names in bigfiles but exes mention "bgm%05d.bin" and "LEP data") * .lp/lep/ap: header ID */ if (!check_extensions(sf, "bin,lbin,lp,lep,ap")) - goto fail; + return NULL; id = read_u32be(0x00,sf); switch (id) { @@ -49,7 +52,7 @@ VGMSTREAM* init_vgmstream_ps2_enth(STREAMFILE* sf) { vgmstream = allocate_vgmstream(channels, loop_flag); if (!vgmstream) goto fail; - vgmstream->meta_type = meta_PS2_ENTH; + vgmstream->meta_type = meta_LP_AP_LEP; vgmstream->sample_rate = sample_rate; switch (id) { diff --git a/src/vgmstream.c b/src/vgmstream.c index 2ecaf6b0..a8605ee5 100644 --- a/src/vgmstream.c +++ b/src/vgmstream.c @@ -101,7 +101,7 @@ init_vgmstream_t init_vgmstream_functions[] = { init_vgmstream_ps2_rkv, init_vgmstream_ps2_vas, init_vgmstream_ps2_vas_container, - init_vgmstream_ps2_enth, + init_vgmstream_lp_ap_lep, init_vgmstream_sdt, init_vgmstream_aix, init_vgmstream_ngc_tydsp, diff --git a/src/vgmstream_types.h b/src/vgmstream_types.h index 2e647d70..2560820e 100644 --- a/src/vgmstream_types.h +++ b/src/vgmstream_types.h @@ -346,7 +346,7 @@ typedef enum { meta_PS2_PCM, /* Konami KCEJ East: Ephemeral Fantasia, Yu-Gi-Oh! The Duelists of the Roses, 7 Blades */ meta_PS2_RKV, /* Legacy of Kain - Blood Omen 2 (PS2) */ meta_PS2_VAS, /* Pro Baseball Spirits 5 */ - meta_PS2_ENTH, /* Enthusia */ + meta_LP_AP_LEP, meta_SDT, /* Baldur's Gate - Dark Alliance */ meta_NGC_TYDSP, /* Ty - The Tasmanian Tiger */ meta_DC_STR, /* SEGA Stream Asset Builder */