From b9c255cd25460d0672ec8e75c6bdeba06757cc11 Mon Sep 17 00:00:00 2001 From: bnnm Date: Sat, 30 Sep 2023 20:57:15 +0200 Subject: [PATCH] cleanup: nxa to nxa1 --- doc/FORMATS.md | 10 +++++----- src/formats.c | 2 +- src/libvgmstream.vcxproj | 2 +- src/libvgmstream.vcxproj.filters | 2 +- src/meta/meta.h | 3 ++- src/meta/{nxa.c => nxa1.c} | 10 +++++----- src/vgmstream.c | 2 +- src/vgmstream_types.h | 2 +- 8 files changed, 17 insertions(+), 16 deletions(-) rename src/meta/{nxa.c => nxa1.c} (92%) diff --git a/doc/FORMATS.md b/doc/FORMATS.md index 3ef348f2..99410b6a 100644 --- a/doc/FORMATS.md +++ b/doc/FORMATS.md @@ -271,7 +271,7 @@ different internally (encrypted, different versions, etc) and not always can be - RIFF WAVE header (ctrl looping) [*RIFF_WAVE_MWV*] - RIFX WAVE header [*RIFX_WAVE*] - RIFX WAVE header (smpl looping) [*RIFX_WAVE_smpl*] - - *riff*: `.wav .lwav .xwav .mwv .da .dax .cd .med .snd .adx .adp .xss .xsew .adpcm .adw .wd .(extensionless) .sbv .wvx .str .at3 .rws .aud .at9 .ckd .saf .ima .nsa .pcm .xvag .ogg .logg .p1d .xms .mus .dat .ldat` + - *riff*: `.wav .lwav .xwav .mwv .da .dax .cd .med .snd .adx .adp .xss .xsew .adpcm .adw .wd .(extensionless) .sbv .wvx .str .at3 .rws .aud .at9 .ckd .saf .ima .nsa .pcm .xvag .ogg .logg .p1d .xms .mus .dat .ldat .wma .lwma` - *rifx*: `.wav .lwav` - Codecs: AICA_int PCM32LE PCM24LE PCM16BE PCM16LE PCM8_U MSADPCM IMA PCMFLOAT MS_IMA AICA MPEG_custom XBOX_IMA MS_IMA_3BIT DVI_IMA L5_555 OGG_VORBIS ATRAC9 ATRAC3 MPEG MSADPCM_int - **nwa.c** @@ -1120,10 +1120,6 @@ different internally (encrypted, different versions, etc) and not always can be - *opus_sqex*: `.wav .lwav` - *opus_rsnd*: `.rsnd` - Codecs: Opus -- **nxa.c** - - Entergram NXA header [*NXA*] - - *opus_nxa*: `.nxa` - - Codecs: Opus - **pc_ast.c** - Capcom AST (PC) header [*PC_AST*] - *pc_ast*: `.ast` @@ -1370,6 +1366,10 @@ different internally (encrypted, different versions, etc) and not always can be - Maxis UTK header [*UTK*] - *utk*: `.utk` - Codecs: EA_MT +- **nxa1.c** + - Entergram NXA1 header [*NXA1*] + - *nxa1*: `.nxa` + - Codecs: Opus - **adpcm_capcom.c** - Capcom .ADPCM header [*ADPCM_CAPCOM*] - *adpcm_capcom*: `.adpcm .mca` diff --git a/src/formats.c b/src/formats.c index 95ea839a..84bb04cb 100644 --- a/src/formats.c +++ b/src/formats.c @@ -1328,7 +1328,7 @@ static const meta_info meta_info_list[] = { {meta_XAU_KONAMI, "Konami XAU header"}, {meta_DERF, "Xilam DERF header"}, {meta_UTK, "Maxis UTK header"}, - {meta_NXA, "Entergram NXA header"}, + {meta_NXA1, "Entergram NXA1 header"}, {meta_ADPCM_CAPCOM, "Capcom .ADPCM header"}, {meta_UE4OPUS, "Epic Games UE4OPUS header"}, {meta_XWMA, "Microsoft XWMA RIFF header"}, diff --git a/src/libvgmstream.vcxproj b/src/libvgmstream.vcxproj index 252291b0..2746640a 100644 --- a/src/libvgmstream.vcxproj +++ b/src/libvgmstream.vcxproj @@ -533,7 +533,7 @@ - + diff --git a/src/libvgmstream.vcxproj.filters b/src/libvgmstream.vcxproj.filters index e1d5a370..d40ab759 100644 --- a/src/libvgmstream.vcxproj.filters +++ b/src/libvgmstream.vcxproj.filters @@ -1420,7 +1420,7 @@ meta\Source Files - + meta\Source Files diff --git a/src/meta/meta.h b/src/meta/meta.h index d40f7f47..00cac342 100644 --- a/src/meta/meta.h +++ b/src/meta/meta.h @@ -618,7 +618,6 @@ VGMSTREAM* init_vgmstream_opus_nop(STREAMFILE* sf); VGMSTREAM* init_vgmstream_opus_shinen(STREAMFILE* sf); VGMSTREAM* init_vgmstream_opus_nus3(STREAMFILE* sf); VGMSTREAM* init_vgmstream_opus_sps_n1(STREAMFILE* sf); -VGMSTREAM* init_vgmstream_opus_nxa(STREAMFILE* sf); VGMSTREAM* init_vgmstream_opus_opusx(STREAMFILE* sf); VGMSTREAM* init_vgmstream_opus_prototype(STREAMFILE* sf); VGMSTREAM* init_vgmstream_opus_opusnx(STREAMFILE* sf); @@ -758,6 +757,8 @@ VGMSTREAM * init_vgmstream_derf(STREAMFILE *streamFile); VGMSTREAM * init_vgmstream_utk(STREAMFILE *streamFile); +VGMSTREAM* init_vgmstream_nxa1(STREAMFILE* sf); + VGMSTREAM * init_vgmstream_adpcm_capcom(STREAMFILE *streamFile); VGMSTREAM * init_vgmstream_ue4opus(STREAMFILE *streamFile); diff --git a/src/meta/nxa.c b/src/meta/nxa1.c similarity index 92% rename from src/meta/nxa.c rename to src/meta/nxa1.c index d1f1ba20..3ea0c9be 100644 --- a/src/meta/nxa.c +++ b/src/meta/nxa1.c @@ -2,8 +2,8 @@ #include "../coding/coding.h" -/* Entergram NXA Opus [Higurashi no Naku Koro ni Hou (Switch), Gensou Rougoku no Kaleidoscope (Switch)] */ -VGMSTREAM* init_vgmstream_opus_nxa(STREAMFILE* sf) { +/* Entergram NXA1 Opus [Higurashi no Naku Koro ni Hou (Switch), Gensou Rougoku no Kaleidoscope (Switch)] */ +VGMSTREAM* init_vgmstream_nxa1(STREAMFILE* sf) { VGMSTREAM* vgmstream = NULL; off_t start_offset; int loop_flag, channels, type, sample_rate; @@ -11,10 +11,10 @@ VGMSTREAM* init_vgmstream_opus_nxa(STREAMFILE* sf) { size_t data_size, frame_size; /* checks */ - if (!check_extensions(sf, "nxa")) - goto fail; if (!is_id32be(0x00, sf, "NXA1")) goto fail; + if (!check_extensions(sf, "nxa")) + goto fail; start_offset = 0x30; type = read_u32le(0x04, sf); @@ -36,7 +36,7 @@ VGMSTREAM* init_vgmstream_opus_nxa(STREAMFILE* sf) { vgmstream = allocate_vgmstream(channels, loop_flag); if (!vgmstream) goto fail; - vgmstream->meta_type = meta_NXA; + vgmstream->meta_type = meta_NXA1; vgmstream->sample_rate = sample_rate; vgmstream->num_samples = num_samples; vgmstream->loop_start_sample = loop_start; diff --git a/src/vgmstream.c b/src/vgmstream.c index fc2f9515..7f65bd76 100644 --- a/src/vgmstream.c +++ b/src/vgmstream.c @@ -308,7 +308,6 @@ init_vgmstream_t init_vgmstream_functions[] = { init_vgmstream_opus_shinen, init_vgmstream_opus_nus3, init_vgmstream_opus_sps_n1, - init_vgmstream_opus_nxa, init_vgmstream_pc_ast, init_vgmstream_naac, init_vgmstream_ubi_sb, @@ -386,6 +385,7 @@ init_vgmstream_t init_vgmstream_functions[] = { init_vgmstream_xau_konami, init_vgmstream_derf, init_vgmstream_utk, + init_vgmstream_nxa1, init_vgmstream_adpcm_capcom, init_vgmstream_ue4opus, init_vgmstream_xwma, diff --git a/src/vgmstream_types.h b/src/vgmstream_types.h index 600874ad..a3c48af0 100644 --- a/src/vgmstream_types.h +++ b/src/vgmstream_types.h @@ -612,7 +612,7 @@ typedef enum { meta_DERF, /* Stupid Invaders (PC) */ meta_SADF, meta_UTK, - meta_NXA, + meta_NXA1, meta_ADPCM_CAPCOM, meta_UE4OPUS, meta_XWMA,