Updated VGMStream to r1721-52-g4eb40f00

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
CQTexperiment
Christopher Snowhill 2022-04-21 14:29:41 -07:00
parent 6a9b37f91e
commit 2995f67c56
8 changed files with 94 additions and 8 deletions

View File

@ -507,6 +507,7 @@
837CEB0423487F2C00E62A4A /* jstm.c in Sources */ = {isa = PBXBuildFile; fileRef = 837CEAEF23487F2C00E62A4A /* jstm.c */; };
837CEB0523487F2C00E62A4A /* sqex_sead_streamfile.h in Headers */ = {isa = PBXBuildFile; fileRef = 837CEAF023487F2C00E62A4A /* sqex_sead_streamfile.h */; };
837CEB072348809400E62A4A /* seb.c in Sources */ = {isa = PBXBuildFile; fileRef = 837CEB062348809400E62A4A /* seb.c */; };
8383A62C281203C60062E49E /* s3v.c in Sources */ = {isa = PBXBuildFile; fileRef = 8383A62B281203C50062E49E /* s3v.c */; };
83852B0B2680247900378854 /* rxws.c in Sources */ = {isa = PBXBuildFile; fileRef = 83852B092680247900378854 /* rxws.c */; };
83852B0C2680247900378854 /* ads_midway.c in Sources */ = {isa = PBXBuildFile; fileRef = 83852B0A2680247900378854 /* ads_midway.c */; };
8385D4E6245174C700FF8E67 /* diva.c in Sources */ = {isa = PBXBuildFile; fileRef = 8385D4E2245174C600FF8E67 /* diva.c */; };
@ -1299,6 +1300,7 @@
837CEAEF23487F2C00E62A4A /* jstm.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = jstm.c; sourceTree = "<group>"; };
837CEAF023487F2C00E62A4A /* sqex_sead_streamfile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sqex_sead_streamfile.h; sourceTree = "<group>"; };
837CEB062348809400E62A4A /* seb.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = seb.c; sourceTree = "<group>"; };
8383A62B281203C50062E49E /* s3v.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = s3v.c; sourceTree = "<group>"; };
83852B092680247900378854 /* rxws.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = rxws.c; sourceTree = "<group>"; };
83852B0A2680247900378854 /* ads_midway.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ads_midway.c; sourceTree = "<group>"; };
8385D4E2245174C600FF8E67 /* diva.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = diva.c; sourceTree = "<group>"; };
@ -2115,6 +2117,7 @@
836F6EE818BDC2190095E648 /* rwsd.c */,
836F6EE918BDC2190095E648 /* rwx.c */,
83852B092680247900378854 /* rxws.c */,
8383A62B281203C50062E49E /* s3v.c */,
836F6EEA18BDC2190095E648 /* s14_sss.c */,
83AA7F772519C042004C5298 /* sab_streamfile.h */,
8349A8F11FE6257D00E26435 /* sab.c */,
@ -2566,6 +2569,7 @@
834FE0F1215C79ED000A5D3D /* a2m.c in Sources */,
8301659A1F256BD000CA0941 /* txth.c in Sources */,
837CEA7823487E2500E62A4A /* ptadpcm_decoder.c in Sources */,
8383A62C281203C60062E49E /* s3v.c in Sources */,
8301659B1F256BD000CA0941 /* ea_schl_fixed.c in Sources */,
8301659C1F256BD000CA0941 /* nds_strm_ffta2.c in Sources */,
837CEA7923487E2500E62A4A /* ubi_adpcm_decoder.c in Sources */,

View File

@ -431,7 +431,7 @@ static const char* extension_list[] = {
"rxx", //txth/reserved [Full Auto (X360)]
"s14",
"s3v", //txth/reserved [Sound Voltex 5 (AC)]
"s3v", //Sound Voltex (AC)
"sab",
"sad",
"saf",
@ -1388,6 +1388,7 @@ static const meta_info meta_info_list[] = {
{meta_DSP_APEX, "Koei Tecmo APEX header"},
{meta_MPEG, "MPEG header"},
{meta_SSPF, "Konami SSPF header"},
{meta_S3V, "Konami S3V header"},
};
void get_vgmstream_coding_description(VGMSTREAM* vgmstream, char* out, size_t out_size) {

View File

@ -24,7 +24,8 @@ VGMSTREAM * init_vgmstream_2dx9(STREAMFILE *streamFile) {
if (read_32bitBE(0x6a,streamFile) != 0x64617461) /* data */
goto fail;
loop_flag = 0;
/* IIDX 13 has a false flag for looping files. Konami, pls. */
loop_flag = (read_16bitLE(0x0e,streamFile) > -1);
channel_count = read_16bitLE(0x2e,streamFile);
start_offset = 0x72;
@ -35,6 +36,11 @@ VGMSTREAM * init_vgmstream_2dx9(STREAMFILE *streamFile) {
vgmstream->meta_type = meta_2DX9;
vgmstream->sample_rate = read_32bitLE(0x30,streamFile);
vgmstream->num_samples = read_32bitLE(0x66,streamFile);
if (loop_flag) {
vgmstream->loop_start_sample = 0;
vgmstream->loop_end_sample = vgmstream->num_samples;
}
vgmstream->coding_type = coding_MSADPCM;
vgmstream->layout_type = layout_none;
vgmstream->frame_size = read_16bitLE(0x38,streamFile);

View File

@ -980,4 +980,6 @@ VGMSTREAM* init_vgmstream_mpeg(STREAMFILE* sf);
VGMSTREAM* init_vgmstream_sspf(STREAMFILE* sf);
VGMSTREAM* init_vgmstream_s3v(STREAMFILE* sf);
#endif /*_META_H*/

View File

@ -0,0 +1,62 @@
#include "meta.h"
#include "../coding/coding.h"
/* S3V - from Konami arcade games [SOUND VOLTEX series (AC)] */
VGMSTREAM * init_vgmstream_s3v(STREAMFILE *sf) {
VGMSTREAM * vgmstream = NULL;
off_t start_offset;
int32_t channel_count, loop_flag;
size_t data_size;
/* checks */
if (!check_extensions(sf, "s3v"))
goto fail;
/* check header */
if (read_32bitBE(0x00,sf) != 0x53335630) /* S3V0 */
goto fail;
/* No discernible loop_flag so we'll just use signatures.
Might have to update on a per game basis. */
switch (read_32bitBE(0x14, sf)) {
case 0x82FA0000: // SOUND VOLTEX EXCEED GEAR ver5
case 0x1BFD0000: // SOUND VOLTEX EXCEED GEAR ver6
loop_flag = 1;
break;
default:
loop_flag = 0;
}
start_offset = 0x20;
data_size = read_32bitLE(0x08, sf);
channel_count = 2;
/* build the VGMSTREAM */
vgmstream = allocate_vgmstream(channel_count,loop_flag);
if (!vgmstream) goto fail;
vgmstream->meta_type = meta_S3V;
#ifdef VGM_USE_FFMPEG
vgmstream->codec_data = init_ffmpeg_offset(sf, start_offset, data_size);
if (!vgmstream->codec_data) goto fail;
vgmstream->sample_rate = ffmpeg_get_sample_rate(vgmstream->codec_data);
vgmstream->num_samples = ffmpeg_get_samples(vgmstream->codec_data);
if (loop_flag) {
vgmstream->loop_start_sample = read_32bitLE(0x10, sf);
vgmstream->loop_end_sample = vgmstream->num_samples;
}
vgmstream->coding_type = coding_FFmpeg;
vgmstream->layout_type = layout_none;
#endif
if (!vgmstream_open_stream(vgmstream, sf, start_offset))
goto fail;
return vgmstream;
fail:
close_vgmstream(vgmstream);
return NULL;
}

View File

@ -22,12 +22,11 @@ VGMSTREAM * init_vgmstream_sd9(STREAMFILE *streamFile) {
if (read_32bitBE(0x72, streamFile) != 0x64617461) /* data */
goto fail;
/* Probably better to check if loop end exists and use as loop flag.
Blame SD9s from beatmania IIDX 21: Spada that have a flase flag
but still "loop" */
/* Some SD9s may loop without any loop points specificed.
If loop_flag is set with no points, loop entire song. */
//loop_flag = (read_16bitLE(0x0e,streamFile)==0x1);
loop_flag = read_32bitLE(0x18, streamFile); // use loop end
loop_flag = read_16bitLE(0x0e,streamFile);
//loop_flag = read_32bitLE(0x18, streamFile); // use loop end
channel_count = read_16bitLE(0x36, streamFile);
start_offset = 0x7a;
@ -37,7 +36,17 @@ VGMSTREAM * init_vgmstream_sd9(STREAMFILE *streamFile) {
vgmstream->sample_rate = read_32bitLE(0x38, streamFile);
vgmstream->num_samples = read_32bitLE(0x6e, streamFile);
if (loop_flag) {
if (loop_flag > 0) {
vgmstream->loop_start_sample = read_32bitLE(0x14, streamFile) / 2 / channel_count;
vgmstream->loop_end_sample = read_32bitLE(0x18, streamFile) / 2 / channel_count;
if (vgmstream->loop_end_sample == 0) {
vgmstream->loop_end_sample = vgmstream->num_samples;
}
}
/* beatmania IIDX 21: Spada is a special case. Loop flag is false but loops exist.
Konami, Why? */
if ((loop_flag < 0) && (read_32bitLE(0x18, streamFile) !=0)) {
vgmstream->loop_start_sample = read_32bitLE(0x14, streamFile) / 2 / channel_count;
vgmstream->loop_end_sample = read_32bitLE(0x18, streamFile) / 2 / channel_count;
}

View File

@ -521,6 +521,7 @@ VGMSTREAM* (*init_vgmstream_functions[])(STREAMFILE* sf) = {
init_vgmstream_ubi_ckd_cwav,
init_vgmstream_sspf,
init_vgmstream_opus_rsnd,
init_vgmstream_s3v,
/* lower priority metas (no clean header identity, somewhat ambiguous, or need extension/companion file to identify) */
init_vgmstream_mpeg,

View File

@ -764,6 +764,7 @@ typedef enum {
meta_DSP_APEX,
meta_MPEG,
meta_SSPF,
meta_S3V,
} meta_t;