mirror of
https://github.com/vgmstream/vgmstream.git
synced 2025-01-31 04:13:47 +01:00
Remove .smpl fake extension [Homura (PS2)]
This commit is contained in:
parent
bb9b20238c
commit
d362fe92a4
@ -508,7 +508,6 @@ static const char* extension_list[] = {
|
|||||||
"smc",
|
"smc",
|
||||||
"smk",
|
"smk",
|
||||||
"smp",
|
"smp",
|
||||||
"smpl", //fake extension/header id for .v0/v1 (renamed, to be removed)
|
|
||||||
"smv",
|
"smv",
|
||||||
"snb",
|
"snb",
|
||||||
"snd",
|
"snd",
|
||||||
@ -1179,7 +1178,7 @@ static const meta_info meta_info_list[] = {
|
|||||||
{meta_S14, "Namco .S14 raw header"},
|
{meta_S14, "Namco .S14 raw header"},
|
||||||
{meta_SSS, "Namco .SSS raw header"},
|
{meta_SSS, "Namco .SSS raw header"},
|
||||||
{meta_PS2_GCM, "Namco GCM header"},
|
{meta_PS2_GCM, "Namco GCM header"},
|
||||||
{meta_PS2_SMPL, "Homura SMPL header"},
|
{meta_SMPL, "Skonec SMPL header"},
|
||||||
{meta_PS2_MSA, "Success .MSA header"},
|
{meta_PS2_MSA, "Success .MSA header"},
|
||||||
{meta_NGC_PDT, "Hudson .PDT header"},
|
{meta_NGC_PDT, "Hudson .PDT header"},
|
||||||
{meta_NGC_RKV, "Legacy of Kain - Blood Omen 2 RKV GC header"},
|
{meta_NGC_RKV, "Legacy of Kain - Blood Omen 2 RKV GC header"},
|
||||||
|
@ -448,7 +448,7 @@ VGMSTREAM * init_vgmstream_s14_sss(STREAMFILE* streamFile);
|
|||||||
|
|
||||||
VGMSTREAM * init_vgmstream_ps2_gcm(STREAMFILE* streamFile);
|
VGMSTREAM * init_vgmstream_ps2_gcm(STREAMFILE* streamFile);
|
||||||
|
|
||||||
VGMSTREAM * init_vgmstream_ps2_smpl(STREAMFILE* streamFile);
|
VGMSTREAM* init_vgmstream_smpl(STREAMFILE* sf);
|
||||||
|
|
||||||
VGMSTREAM * init_vgmstream_ps2_msa(STREAMFILE* streamFile);
|
VGMSTREAM * init_vgmstream_ps2_msa(STREAMFILE* streamFile);
|
||||||
|
|
||||||
|
@ -1,47 +1,48 @@
|
|||||||
#include "meta.h"
|
#include "meta.h"
|
||||||
#include "../coding/coding.h"
|
#include "../coding/coding.h"
|
||||||
|
|
||||||
/* SMPL - from Homura (PS2) */
|
/* SMPL - from Homura (PS2) */
|
||||||
VGMSTREAM * init_vgmstream_ps2_smpl(STREAMFILE *streamFile) {
|
VGMSTREAM* init_vgmstream_smpl(STREAMFILE* sf) {
|
||||||
VGMSTREAM * vgmstream = NULL;
|
VGMSTREAM* vgmstream = NULL;
|
||||||
off_t start_offset;
|
uint32_t start_offset, channel_size;
|
||||||
int loop_flag, channel_count;
|
int loop_flag, channels;
|
||||||
size_t channel_size;
|
|
||||||
|
/* checks*/
|
||||||
/* checks*/
|
if (!is_id32be(0x00,sf, "SMPL"))
|
||||||
/* .v0: left channel, .v1: right channel
|
return NULL;
|
||||||
* .smpl: header id */
|
|
||||||
if ( !check_extensions(streamFile,"v0,v1,smpl") )
|
/* .v0: left channel, .v1: right channel
|
||||||
goto fail;
|
* .smpl: header id */
|
||||||
if (read_32bitBE(0x00,streamFile) != 0x534D504C) /* "SMPL" */
|
if (!check_extensions(sf,"v0,v1") )
|
||||||
goto fail;
|
return NULL;
|
||||||
|
|
||||||
channel_count = 1;
|
/* 0x04: version (VAG-clone) */
|
||||||
loop_flag = (read_32bitLE(0x30,streamFile) != 0); /* .v1 doesn't have loop points */
|
channels = 1;
|
||||||
start_offset = 0x40;
|
loop_flag = (read_s32le(0x30,sf) != 0); /* .v1 doesn't have loop points */
|
||||||
channel_size = read_32bitBE(0x0c,streamFile) - 0x10;
|
start_offset = 0x40;
|
||||||
|
channel_size = read_u32be(0x0c,sf) - 0x10;
|
||||||
/* build the VGMSTREAM */
|
|
||||||
vgmstream = allocate_vgmstream(channel_count,loop_flag);
|
/* build the VGMSTREAM */
|
||||||
if (!vgmstream) goto fail;
|
vgmstream = allocate_vgmstream(channels,loop_flag);
|
||||||
|
if (!vgmstream) goto fail;
|
||||||
vgmstream->sample_rate = read_32bitBE(0x10,streamFile);
|
|
||||||
vgmstream->num_samples = ps_bytes_to_samples(channel_size*channel_count, channel_count);
|
vgmstream->sample_rate = read_s32be(0x10,sf);
|
||||||
vgmstream->loop_start_sample = read_32bitLE(0x30,streamFile);
|
vgmstream->num_samples = ps_bytes_to_samples(channel_size*channels, channels);
|
||||||
vgmstream->loop_end_sample = vgmstream->num_samples;
|
vgmstream->loop_start_sample = read_s32le(0x30,sf);
|
||||||
|
vgmstream->loop_end_sample = vgmstream->num_samples;
|
||||||
vgmstream->meta_type = meta_PS2_SMPL;
|
|
||||||
vgmstream->allow_dual_stereo = 1;
|
vgmstream->meta_type = meta_SMPL;
|
||||||
vgmstream->coding_type = coding_PSX;
|
vgmstream->allow_dual_stereo = 1;
|
||||||
vgmstream->layout_type = layout_none;
|
vgmstream->coding_type = coding_PSX;
|
||||||
|
vgmstream->layout_type = layout_none;
|
||||||
read_string(vgmstream->stream_name,0x10+1, 0x20,streamFile);
|
|
||||||
|
read_string(vgmstream->stream_name,0x10+1, 0x20,sf);
|
||||||
if ( !vgmstream_open_stream(vgmstream, streamFile, start_offset) )
|
|
||||||
goto fail;
|
if (!vgmstream_open_stream(vgmstream, sf, start_offset))
|
||||||
return vgmstream;
|
goto fail;
|
||||||
|
return vgmstream;
|
||||||
fail:
|
|
||||||
close_vgmstream(vgmstream);
|
fail:
|
||||||
return NULL;
|
close_vgmstream(vgmstream);
|
||||||
}
|
return NULL;
|
||||||
|
}
|
||||||
|
@ -207,7 +207,7 @@ init_vgmstream_t init_vgmstream_functions[] = {
|
|||||||
init_vgmstream_ps2_wb,
|
init_vgmstream_ps2_wb,
|
||||||
init_vgmstream_bnsf,
|
init_vgmstream_bnsf,
|
||||||
init_vgmstream_ps2_gcm,
|
init_vgmstream_ps2_gcm,
|
||||||
init_vgmstream_ps2_smpl,
|
init_vgmstream_smpl,
|
||||||
init_vgmstream_ps2_msa,
|
init_vgmstream_ps2_msa,
|
||||||
init_vgmstream_ps2_voi,
|
init_vgmstream_ps2_voi,
|
||||||
init_vgmstream_ngc_rkv,
|
init_vgmstream_ngc_rkv,
|
||||||
@ -1024,7 +1024,7 @@ static void try_dual_file_stereo(VGMSTREAM* opened_vgmstream, STREAMFILE* sf, in
|
|||||||
|
|
||||||
/* check these even if there is no loop, because they should then be zero in both
|
/* check these even if there is no loop, because they should then be zero in both
|
||||||
* (Homura PS2 right channel doesn't have loop points so this check is ignored) */
|
* (Homura PS2 right channel doesn't have loop points so this check is ignored) */
|
||||||
if (new_vgmstream->meta_type != meta_PS2_SMPL &&
|
if (new_vgmstream->meta_type != meta_SMPL &&
|
||||||
!(new_vgmstream->loop_flag == opened_vgmstream->loop_flag &&
|
!(new_vgmstream->loop_flag == opened_vgmstream->loop_flag &&
|
||||||
new_vgmstream->loop_start_sample== opened_vgmstream->loop_start_sample &&
|
new_vgmstream->loop_start_sample== opened_vgmstream->loop_start_sample &&
|
||||||
new_vgmstream->loop_end_sample == opened_vgmstream->loop_end_sample)) {
|
new_vgmstream->loop_end_sample == opened_vgmstream->loop_end_sample)) {
|
||||||
|
@ -465,7 +465,7 @@ typedef enum {
|
|||||||
meta_S14, /* raw Siren 14, 24kbit mono */
|
meta_S14, /* raw Siren 14, 24kbit mono */
|
||||||
meta_SSS, /* raw Siren 14, 48kbit stereo */
|
meta_SSS, /* raw Siren 14, 48kbit stereo */
|
||||||
meta_PS2_GCM, /* NamCollection */
|
meta_PS2_GCM, /* NamCollection */
|
||||||
meta_PS2_SMPL, /* Homura */
|
meta_SMPL,
|
||||||
meta_PS2_MSA, /* Psyvariar -Complete Edition- */
|
meta_PS2_MSA, /* Psyvariar -Complete Edition- */
|
||||||
meta_PS2_VOI, /* RAW Danger (Zettaizetsumei Toshi 2 - Itetsuita Kiokutachi) [PS2] */
|
meta_PS2_VOI, /* RAW Danger (Zettaizetsumei Toshi 2 - Itetsuita Kiokutachi) [PS2] */
|
||||||
meta_P3D, /* Prototype P3D */
|
meta_P3D, /* Prototype P3D */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user