Unify dupe STER meta [Baroque, Star Soldier (PS2)]

This commit is contained in:
bnnm 2021-12-06 13:20:36 +01:00
parent 52276fc921
commit 7a6af2ee0e
8 changed files with 12 additions and 85 deletions

View File

@ -1021,7 +1021,7 @@ static const meta_info meta_info_list[] = {
{meta_LEG, "Legaia 2 - Duel Saga LEG Header"},
{meta_FILP, "Bio Hazard - Gun Survivor FILp Header"},
{meta_IKM, "MiCROViSiON IKM header"},
{meta_SFS, "String .SFS header"},
{meta_STER, "ALCHEMY STER header"},
{meta_SAT_DVI, "Konami KCEN DVI. header"},
{meta_DC_KCEY, "Konami KCEY KCEYCOMP header"},
{meta_BG00, "Falcom BG00 Header"},
@ -1140,7 +1140,6 @@ static const meta_info meta_info_list[] = {
{meta_PONA_PSX, "Policenauts BGM header"},
{meta_NGC_DSP_AAAP, "Acclaim Austin AAAp DSP header"},
{meta_NGC_DSP_KONAMI, "Konami DSP header"},
{meta_PS2_STER, "STER Header"},
{meta_BNSF, "Namco Bandai BNSF header"},
{meta_PS2_WB, "Shooting Love. ~TRIZEAL~ WB header"},
{meta_S14, "Namco .S14 raw header"},

View File

@ -492,7 +492,6 @@
<ClCompile Include="meta\ps2_smpl.c" />
<ClCompile Include="meta\ps2_snd.c" />
<ClCompile Include="meta\ps2_sps.c" />
<ClCompile Include="meta\ps2_ster.c" />
<ClCompile Include="meta\svag_kcet.c" />
<ClCompile Include="meta\svag_snk.c" />
<ClCompile Include="meta\ps2_tec.c" />

View File

@ -955,9 +955,6 @@
<ClCompile Include="meta\ps2_sps.c">
<Filter>meta\Source Files</Filter>
</ClCompile>
<ClCompile Include="meta\ps2_ster.c">
<Filter>meta\Source Files</Filter>
</ClCompile>
<ClCompile Include="meta\svag_kcet.c">
<Filter>meta\Source Files</Filter>
</ClCompile>

View File

@ -225,7 +225,7 @@ VGMSTREAM * init_vgmstream_filp(STREAMFILE * streamFile);
VGMSTREAM* init_vgmstream_ikm(STREAMFILE* sf);
VGMSTREAM * init_vgmstream_sfs(STREAMFILE * streamFile);
VGMSTREAM* init_vgmstream_ster(STREAMFILE* sf);
VGMSTREAM * init_vgmstream_sat_dvi(STREAMFILE * streamFile);
@ -451,8 +451,6 @@ VGMSTREAM * init_vgmstream_dmsg(STREAMFILE* streamFile);
VGMSTREAM * init_vgmstream_ngc_dsp_konami(STREAMFILE* streamFile);
VGMSTREAM * init_vgmstream_ps2_ster(STREAMFILE* streamFile);
VGMSTREAM * init_vgmstream_bnsf(STREAMFILE* streamFile);
VGMSTREAM * init_vgmstream_ps2_wb(STREAMFILE* streamFile);

View File

@ -1,8 +1,8 @@
#include "meta.h"
#include "../coding/coding.h"
/* SFS - from Sting games [Baroque (PS2)] */
VGMSTREAM* init_vgmstream_sfs(STREAMFILE* sf) {
/* STER - from Silicon Studios/Vicarious Visions's ALCHEMY middleware [Baroque (PS2), Star Soldier (PS2)] */
VGMSTREAM* init_vgmstream_ster(STREAMFILE* sf) {
VGMSTREAM* vgmstream = NULL;
off_t start_offset;
int loop_flag, channels, sample_rate;
@ -10,8 +10,9 @@ VGMSTREAM* init_vgmstream_sfs(STREAMFILE* sf) {
/* checks */
/* .sfs: bigfile extension (no apparent names) */
if (!check_extensions(sf, "sfs"))
/* .ster: header id (no apparent names/extensions)
* .sfs: generic bigfile extension (to be removed?)*/
if (!check_extensions(sf, "ster,sfs"))
goto fail;
if (!is_id32be(0x00,sf, "STER"))
@ -20,9 +21,10 @@ VGMSTREAM* init_vgmstream_sfs(STREAMFILE* sf) {
loop_start = read_u32le(0x08, sf); /* absolute (ex. offset 0x50 for full loops) */
/* 0x0c: data size BE */
sample_rate = read_s32be(0x10,sf);
/* 0x14~20: null */
loop_flag = loop_start != 0xFFFFFFFF;
channels = 2;
channels = 2; /* mono files are simply .VAG */
start_offset = 0x30;
@ -30,7 +32,7 @@ VGMSTREAM* init_vgmstream_sfs(STREAMFILE* sf) {
vgmstream = allocate_vgmstream(channels, loop_flag);
if (!vgmstream) goto fail;
vgmstream->meta_type = meta_SFS;
vgmstream->meta_type = meta_STER;
vgmstream->sample_rate = sample_rate;
vgmstream->num_samples = ps_bytes_to_samples(channel_size, 1);

View File

@ -1,66 +0,0 @@
#include "meta.h"
#include "../util.h"
/* STER (from Juuni Kokuki: Kakukaku Taru Ou Michi Beni Midori no Uka) */
VGMSTREAM * init_vgmstream_ps2_ster(STREAMFILE *streamFile) {
VGMSTREAM * vgmstream = NULL;
char filename[PATH_LIMIT];
off_t start_offset;
int loop_flag;
int channel_count;
/* check extension, case insensitive */
streamFile->get_name(streamFile,filename,sizeof(filename));
if (strcasecmp("ster",filename_extension(filename))) goto fail;
/* check header */
if (read_32bitBE(0x00,streamFile) != 0x53544552) /* "STER" */
goto fail;
loop_flag = (read_16bitLE(0xB,streamFile)==0);
channel_count = 2;
/* build the VGMSTREAM */
vgmstream = allocate_vgmstream(channel_count,loop_flag);
if (!vgmstream) goto fail;
/* fill in the vital statistics */
start_offset = 0x30;
vgmstream->channels = channel_count;
vgmstream->sample_rate = read_32bitBE(0x10,streamFile);
vgmstream->coding_type = coding_PSX;
vgmstream->num_samples = read_32bitLE(0x4,streamFile)*56/32;
if (loop_flag) {
vgmstream->loop_start_sample = read_32bitLE(0x8,streamFile)*28/32;
vgmstream->loop_end_sample = vgmstream->num_samples;
}
vgmstream->layout_type = layout_interleave;
vgmstream->interleave_block_size = 0x10;
vgmstream->meta_type = meta_PS2_STER;
/* open the file for reading */
{
int i;
STREAMFILE * file;
file = streamFile->open(streamFile,filename,STREAMFILE_DEFAULT_BUFFER_SIZE);
if (!file) goto fail;
for (i=0;i<channel_count;i++) {
vgmstream->ch[i].streamfile = file;
vgmstream->ch[i].channel_start_offset=
vgmstream->ch[i].offset=start_offset+
vgmstream->interleave_block_size*i;
}
}
return vgmstream;
/* clean up anything we may have opened */
fail:
if (vgmstream) close_vgmstream(vgmstream);
return NULL;
}

View File

@ -93,7 +93,7 @@ VGMSTREAM* (*init_vgmstream_functions[])(STREAMFILE* sf) = {
init_vgmstream_leg,
init_vgmstream_filp,
init_vgmstream_ikm,
init_vgmstream_sfs,
init_vgmstream_ster,
init_vgmstream_bg00,
init_vgmstream_sat_dvi,
init_vgmstream_dc_kcey,
@ -216,7 +216,6 @@ VGMSTREAM* (*init_vgmstream_functions[])(STREAMFILE* sf) = {
init_vgmstream_dmsg,
init_vgmstream_ngc_dsp_aaap,
init_vgmstream_ngc_dsp_konami,
init_vgmstream_ps2_ster,
init_vgmstream_ps2_wb,
init_vgmstream_bnsf,
init_vgmstream_ps2_gcm,

View File

@ -383,7 +383,7 @@ typedef enum {
meta_LEG, /* Legaia 2 [no header_id] */
meta_FILP, /* Resident Evil - Dead Aim */
meta_IKM,
meta_SFS, /* Baroque */
meta_STER,
meta_BG00, /* Ibara, Mushihimesama */
meta_PS2_RSTM, /* Midnight Club 3 */
meta_PS2_KCES, /* Dance Dance Revolution */
@ -513,7 +513,6 @@ typedef enum {
meta_AST_MMV,
meta_DMSG, /* Nightcaster II - Equinox (XBOX) */
meta_NGC_DSP_AAAP, /* Turok: Evolution (NGC), Vexx (NGC) */
meta_PS2_STER, /* Juuni Kokuki: Kakukaku Taru Ou Michi Beni Midori no Uka */
meta_PS2_WB, /* Shooting Love. ~TRIZEAL~ */
meta_S14, /* raw Siren 14, 24kbit mono */
meta_SSS, /* raw Siren 14, 48kbit stereo */