cleanup: renames

This commit is contained in:
bnnm 2023-01-29 22:58:13 +01:00
parent 0c392714a2
commit a77427f907
5 changed files with 32 additions and 34 deletions

View File

@ -1085,14 +1085,13 @@ static const meta_info meta_info_list[] = {
{meta_DC_IDVI, "Capcom IDVI header"},
{meta_KRAW, "Geometry Wars: Galaxies KRAW header"},
{meta_NGC_YMF, "YMF DSP Header"},
{meta_PS2_CCC, "CCC Header"},
{meta_FAG, "Radical .FAG Header"},
{meta_PS2_MIHB, "Sony MultiStream MIC header"},
{meta_DSP_WII_MUS, "mus header"},
{meta_WII_SNG, "SNG DSP Header"},
{meta_RSD, "Radical RSD header"},
{meta_DC_ASD, "ASD Header"},
{meta_NAOMI_SPSD, "Naomi SPSD header"},
{meta_SPSD, "Sega Naomi SPSD header"},
{meta_FFXI_BGW, "Square Enix .BGW header"},
{meta_FFXI_SPW, "Square Enix .SPW header"},
{meta_PS2_ASS, "SystemSoft .ASS header"},

View File

@ -309,7 +309,7 @@ VGMSTREAM * init_vgmstream_rsd(STREAMFILE * streamFile);
VGMSTREAM * init_vgmstream_dc_asd(STREAMFILE * streamFile);
VGMSTREAM * init_vgmstream_naomi_spsd(STREAMFILE * streamFile);
VGMSTREAM* init_vgmstream_spsd(STREAMFILE* sf);
VGMSTREAM * init_vgmstream_bgw(STREAMFILE * streamFile);
VGMSTREAM * init_vgmstream_spw(STREAMFILE * streamFile);

View File

@ -2,66 +2,66 @@
#include "../coding/coding.h"
/* SPSD - Naomi (arcade) and early Dreamcast streams [Guilty Gear X (Naomi), Crazy Taxi (Naomi), Virtua Tennis 2 (Naomi)] */
VGMSTREAM * init_vgmstream_naomi_spsd(STREAMFILE *streamFile) {
VGMSTREAM * vgmstream = NULL;
VGMSTREAM* init_vgmstream_spsd(STREAMFILE *sf) {
VGMSTREAM* vgmstream = NULL;
off_t start_offset;
size_t data_size;
int loop_flag, channel_count, codec, flags, index;
int loop_flag, channels, codec, flags, index;
/* checks */
if (!is_id32be(0x00,sf, "SPSD"))
goto fail;
/* .str: actual extension, rare [Shenmue (DC)]
* .spsd: header id */
if (!check_extensions(streamFile, "str,spsd"))
goto fail;
if (read_32bitBE(0x00,streamFile) != 0x53505344) /* "SPSD" */
* .spsd: header id (maybe real ext is .PSD, similar to "SMLT" > .MLT) */
if (!check_extensions(sf, "str,spsd"))
goto fail;
if (read_32bitBE(0x04,streamFile) != 0x01010004 && /* standard version */
read_32bitBE(0x04,streamFile) != 0x00010004) /* uncommon version [Crazy Taxi (Naomi)] */
if (read_32bitBE(0x04,sf) != 0x01010004 && /* standard version */
read_32bitBE(0x04,sf) != 0x00010004) /* uncommon version [Crazy Taxi (Naomi)] */
goto fail;
codec = read_8bit(0x08,streamFile);
flags = read_8bit(0x09,streamFile);
index = read_16bitLE(0x0a,streamFile);
data_size = read_32bitLE(0x0c,streamFile);
codec = read_8bit(0x08,sf);
flags = read_8bit(0x09,sf);
index = read_16bitLE(0x0a,sf);
data_size = read_32bitLE(0x0c,sf);
//if (data_size + start_offset != get_streamfile_size(streamFile))
// goto fail; /* some rips out there have incorrect padding */
//todo with 0x80 seems 0x2c is a loop_start_sample but must be adjusted to +1 block? (uncommon flag though)
loop_flag = (flags & 0x80);
channel_count = ((flags & 0x01) || (flags & 0x02)) ? 2 : 1; /* 0x02 is rare but looks normal (Virtua Tennis 2) */
channels = ((flags & 0x01) || (flags & 0x02)) ? 2 : 1; /* 0x02 is rare but looks normal (Virtua Tennis 2) */
start_offset = 0x40;
/* build the VGMSTREAM */
vgmstream = allocate_vgmstream(channel_count,loop_flag);
vgmstream = allocate_vgmstream(channels,loop_flag);
if (!vgmstream) goto fail;
vgmstream->sample_rate = (uint16_t)read_16bitLE(0x2A,streamFile);
vgmstream->sample_rate = (uint16_t)read_16bitLE(0x2A,sf);
vgmstream->meta_type = meta_NAOMI_SPSD;
vgmstream->meta_type = meta_SPSD;
switch (codec) {
case 0x00: /* [Virtua Tennis 2 (Naomi), Club Kart - European Session (Naomi)] */
case 0x00: /* [Virtua Tennis 2 (Naomi), Club Kart: European Session (Naomi)] */
vgmstream->coding_type = coding_PCM16LE;
vgmstream->num_samples = pcm_bytes_to_samples(data_size,channel_count,16);
vgmstream->loop_start_sample = read_32bitLE(0x2c,streamFile) + pcm_bytes_to_samples(0x2000*channel_count,channel_count,16);
vgmstream->num_samples = pcm_bytes_to_samples(data_size,channels,16);
vgmstream->loop_start_sample = read_32bitLE(0x2c,sf) + pcm_bytes_to_samples(0x2000*channels,channels,16);
vgmstream->loop_end_sample = vgmstream->num_samples;
break;
case 0x01: /* [Virtua Tennis 2 (Naomi)] */
vgmstream->coding_type = coding_PCM8;
vgmstream->num_samples = pcm_bytes_to_samples(data_size,channel_count,8);
vgmstream->loop_start_sample = read_32bitLE(0x2c,streamFile) + pcm_bytes_to_samples(0x2000*channel_count,channel_count,8);
vgmstream->num_samples = pcm_bytes_to_samples(data_size,channels,8);
vgmstream->loop_start_sample = read_32bitLE(0x2c,sf) + pcm_bytes_to_samples(0x2000*channels,channels,8);
vgmstream->loop_end_sample = vgmstream->num_samples;
break;
case 0x03: /* standard */
vgmstream->coding_type = coding_AICA_int;
vgmstream->num_samples = yamaha_bytes_to_samples(data_size,channel_count);
vgmstream->loop_start_sample = /*read_32bitLE(0x2c,streamFile) +*/ yamaha_bytes_to_samples(0x2000*channel_count,channel_count);
vgmstream->num_samples = yamaha_bytes_to_samples(data_size,channels);
vgmstream->loop_start_sample = /*read_32bitLE(0x2c,streamFile) +*/ yamaha_bytes_to_samples(0x2000*channels,channels);
vgmstream->loop_end_sample = vgmstream->num_samples;
break;
@ -72,7 +72,7 @@ VGMSTREAM * init_vgmstream_naomi_spsd(STREAMFILE *streamFile) {
/* interleave index, maybe */
switch(index) {
case 0x0000:
if (channel_count != 1) goto fail;
if (channels != 1) goto fail;
vgmstream->layout_type = layout_none;
break;
@ -85,7 +85,7 @@ VGMSTREAM * init_vgmstream_naomi_spsd(STREAMFILE *streamFile) {
case 0x00ff:
vgmstream->layout_type = layout_interleave;
vgmstream->interleave_block_size = data_size / channel_count;
vgmstream->interleave_block_size = data_size / channels;
break;
default:
@ -97,13 +97,13 @@ VGMSTREAM * init_vgmstream_naomi_spsd(STREAMFILE *streamFile) {
* at 0x30(4*ch) is some config per channel but doesn't seem to affect ADPCM (found with PCM too) */
{
int i;
for (i = 0; i < channel_count; i++) {
for (i = 0; i < channels; i++) {
vgmstream->ch[i].adpcm_step_index = 0x7f;
}
}
if (!vgmstream_open_stream(vgmstream,streamFile,start_offset))
if (!vgmstream_open_stream(vgmstream, sf, start_offset))
goto fail;
return vgmstream;

View File

@ -133,7 +133,7 @@ VGMSTREAM* (*init_vgmstream_functions[])(STREAMFILE* sf) = {
init_vgmstream_ngc_pdt,
init_vgmstream_wii_mus,
init_vgmstream_dc_asd,
init_vgmstream_naomi_spsd,
init_vgmstream_spsd,
init_vgmstream_rsd,
init_vgmstream_bgw,
init_vgmstream_spw,

View File

@ -418,12 +418,11 @@ typedef enum {
meta_PS2_JOE, /* Wall-E / Pixar games */
meta_NGC_YMF, /* WWE WrestleMania X8 */
meta_SADL,
meta_PS2_CCC, /* Tokyo Xtreme Racer DRIFT 2 */
meta_FAG, /* Jackie Chan - Stuntmaster */
meta_PS2_MIHB, /* Merged MIH+MIB */
meta_NGC_PDT, /* Mario Party 6 */
meta_DC_ASD, /* Miss Moonligh */
meta_NAOMI_SPSD, /* Guilty Gear X */
meta_SPSD,
meta_RSD,
meta_PS2_ASS, /* ASS */
meta_SEG, /* Eragon */