From 321321e9b6bdb6cf2f95068c28fa33bab5d98081 Mon Sep 17 00:00:00 2001 From: bnnm Date: Sat, 10 Jun 2023 16:39:54 +0200 Subject: [PATCH] Remove .ulw raw format (use TXTH + ULAW) --- doc/TXTH.md | 2 +- src/formats.c | 1 - src/meta/meta.h | 6 +---- src/meta/ngc_ulw.c | 60 ------------------------------------------- src/vgmstream.c | 1 - src/vgmstream_types.h | 1 - 6 files changed, 2 insertions(+), 69 deletions(-) delete mode 100644 src/meta/ngc_ulw.c diff --git a/doc/TXTH.md b/doc/TXTH.md index bc8e4365..397a27e4 100644 --- a/doc/TXTH.md +++ b/doc/TXTH.md @@ -111,7 +111,7 @@ as explained below, but often will use default values. Accepted codec strings: # * For few rare games [Burnout (GC)] # * Interleave is multiple of 0x1 (default) # - ALAW A-Law 8-bit PCM -# * For few rare games [Conquest of Elysium 3 (PC), Dominions 3/4 (PC)] +# * For few rare games [Illwinter Game Design games: Conquest of Elysium 3 (PC), Dominions 3/4 (PC)] # * Interleave is multiple of 0x1 (default) # # - IMA IMA ADPCM (mono/stereo) diff --git a/src/formats.c b/src/formats.c index 106539b6..7937bb32 100644 --- a/src/formats.c +++ b/src/formats.c @@ -1258,7 +1258,6 @@ static const meta_info meta_info_list[] = { {meta_GHS, "Hexadrive GHS/S_P_STH header"}, {meta_AAC_TRIACE, "tri-Ace AAC header"}, {meta_MTA2, "Konami MTA2 header"}, - {meta_NGC_ULW, "Criterion ULW raw header"}, {meta_XA_XA30, "Reflections XA30 header"}, {meta_XA_04SW, "Reflections 04SW header"}, {meta_TXTH, "TXTH generic header"}, diff --git a/src/meta/meta.h b/src/meta/meta.h index c0d9c08c..d48b30b0 100644 --- a/src/meta/meta.h +++ b/src/meta/meta.h @@ -606,8 +606,6 @@ VGMSTREAM * init_vgmstream_va3(STREAMFILE *streamFile); VGMSTREAM * init_vgmstream_mta2(STREAMFILE *streamFile); VGMSTREAM * init_vgmstream_mta2_container(STREAMFILE *streamFile); -VGMSTREAM * init_vgmstream_ngc_ulw(STREAMFILE * streamFile); - VGMSTREAM * init_vgmstream_xa_xa30(STREAMFILE * streamFile); VGMSTREAM * init_vgmstream_xa_04sw(STREAMFILE * streamFile); @@ -627,7 +625,7 @@ VGMSTREAM * init_vgmstream_ea_schl_fixed(STREAMFILE * streamFile); VGMSTREAM * init_vgmstream_sk_aud(STREAMFILE * streamFile); -VGMSTREAM * init_vgmstream_stm(STREAMFILE * streamFile); +VGMSTREAM* init_vgmstream_stm(STREAMFILE* sf); VGMSTREAM * init_vgmstream_awc(STREAMFILE * streamFile); @@ -646,8 +644,6 @@ VGMSTREAM* init_vgmstream_opus_nsopus(STREAMFILE* sf); VGMSTREAM* init_vgmstream_opus_sqex(STREAMFILE* sf); VGMSTREAM* init_vgmstream_opus_rsnd(STREAMFILE* sf); -VGMSTREAM * init_vgmstream_raw_al(STREAMFILE * streamFile); - VGMSTREAM * init_vgmstream_pc_ast(STREAMFILE * streamFile); VGMSTREAM * init_vgmstream_naac(STREAMFILE * streamFile); diff --git a/src/meta/ngc_ulw.c b/src/meta/ngc_ulw.c deleted file mode 100644 index e873ac1d..00000000 --- a/src/meta/ngc_ulw.c +++ /dev/null @@ -1,60 +0,0 @@ -#include "meta.h" -#include "../coding/coding.h" - -/* ULW - headerless U-law, found in Burnout (GC) */ -VGMSTREAM * init_vgmstream_ngc_ulw(STREAMFILE *streamFile) { - VGMSTREAM * vgmstream = NULL; - off_t start_offset; - int loop_flag = 0, channel_count; - - - /* check extension, case insensitive */ - if ( !check_extensions(streamFile,"ulw")) - goto fail; - - /* raw data, the info is in the filename (really!) */ - { - char filename[PATH_LIMIT] = {0}; - - get_streamfile_filename(streamFile, filename,PATH_LIMIT); - - /* first letter gives the channels */ - if (filename[0]=='M') /* Mono */ - channel_count = 1; - else if (filename[0]=='S' || filename[0]=='D') /* Stereo/Dolby */ - channel_count = 2; - else - goto fail; - - /* not very robust but meh (other tracks don't loop) */ - if (strcmp(filename,"MMenu.ulw")==0 || strcmp(filename,"DMenu.ulw")==0) { - loop_flag = 1; - } - } - - - /* build the VGMSTREAM */ - vgmstream = allocate_vgmstream(channel_count,loop_flag); - if (!vgmstream) goto fail; - - vgmstream->sample_rate = 32000; - vgmstream->coding_type = coding_ULAW; - vgmstream->layout_type = layout_interleave; - vgmstream->interleave_block_size = 0x01; - vgmstream->meta_type = meta_NGC_ULW; - vgmstream->num_samples = pcm_bytes_to_samples(get_streamfile_size(streamFile), channel_count, 8); - if (loop_flag) { - vgmstream->loop_start_sample = 0; - vgmstream->loop_end_sample = vgmstream->num_samples; - } - - start_offset = 0; - - if ( !vgmstream_open_stream(vgmstream, streamFile, start_offset) ) - goto fail; - return vgmstream; - -fail: - close_vgmstream(vgmstream); - return NULL; -} diff --git a/src/vgmstream.c b/src/vgmstream.c index 22d941c7..2c8d79d7 100644 --- a/src/vgmstream.c +++ b/src/vgmstream.c @@ -553,7 +553,6 @@ init_vgmstream_t init_vgmstream_functions[] = { init_vgmstream_raw_wavm, /* .wavm raw xbox */ init_vgmstream_raw_pcm, /* .raw raw PCM */ init_vgmstream_s14_sss, /* .s14/sss raw siren14 */ - init_vgmstream_ngc_ulw, /* .ulw raw u-Law */ init_vgmstream_exakt_sc, /* .sc raw PCM */ init_vgmstream_zwdsp, /* fake format */ init_vgmstream_ps2_adm, /* weird non-constant PSX blocks */ diff --git a/src/vgmstream_types.h b/src/vgmstream_types.h index d79e7315..6e37e24e 100644 --- a/src/vgmstream_types.h +++ b/src/vgmstream_types.h @@ -549,7 +549,6 @@ typedef enum { meta_GHS, meta_AAC_TRIACE, meta_MTA2, - meta_NGC_ULW, /* Burnout 1 (GC only) */ meta_XA_XA30, meta_XA_04SW, meta_TXTH, /* generic text header */