mirror of
https://github.com/vgmstream/vgmstream.git
synced 2025-01-17 23:36:41 +01:00
Add various metas
- DSP: itl, vag (PPP) - PS2: int (A2M), ahv, msv, sdf, svg, vis - PC: .aif (Asobo), ao, apc, wv2 - Xbox: xau (Konami)
This commit is contained in:
parent
72d0b7a3b0
commit
d5a11d58e8
@ -33,6 +33,7 @@ static const char* extension_list[] = {
|
||||
"afc",
|
||||
"agsc",
|
||||
"ahx",
|
||||
"ahv",
|
||||
"ai",
|
||||
//"aif", //common
|
||||
"aifc", //common?
|
||||
@ -43,8 +44,8 @@ static const char* extension_list[] = {
|
||||
"akb",
|
||||
"al2",
|
||||
"amts", //fake extension/header id for .stm (to be removed)
|
||||
"ao", //txth/reserved [Cloudphobia (PC)]
|
||||
"apc", //txth/reserved [MegaRace 3 (PC)]
|
||||
"ao",
|
||||
"apc",
|
||||
"as4",
|
||||
"asd",
|
||||
"asf",
|
||||
@ -167,10 +168,11 @@ static const char* extension_list[] = {
|
||||
"int",
|
||||
"isd",
|
||||
"isws",
|
||||
"itl", //txth/reserved [Charinko Hero (GC)]
|
||||
"itl",
|
||||
"ivaud",
|
||||
"ivag",
|
||||
"ivb",
|
||||
"ivs", //txth/reserved [Burnout 2 (PS2)]
|
||||
|
||||
"joe",
|
||||
"jstm",
|
||||
@ -227,7 +229,7 @@ static const char* extension_list[] = {
|
||||
"msd",
|
||||
"msf",
|
||||
"mss",
|
||||
"msv", //txh/reserved [Fight Club (PS2)]
|
||||
"msv",
|
||||
"msvp",
|
||||
"mta2",
|
||||
"mtaf",
|
||||
@ -313,7 +315,7 @@ static const char* extension_list[] = {
|
||||
"scd",
|
||||
"sck",
|
||||
"sd9",
|
||||
"sdf", //txth/reserved [Gummy Bears Mini Golf (3DS), Agent Hugo - Lemoon Twist (PS2)]
|
||||
"sdf",
|
||||
"sdt",
|
||||
"seg",
|
||||
"sf0",
|
||||
@ -357,7 +359,7 @@ static const char* extension_list[] = {
|
||||
"stx",
|
||||
"svag",
|
||||
"svs",
|
||||
"svg", //txth/reserved [Hunter: The Reckoning - Wayward (PS2)]
|
||||
"svg",
|
||||
"swag",
|
||||
"swav",
|
||||
"swd",
|
||||
@ -384,7 +386,7 @@ static const char* extension_list[] = {
|
||||
"v0",
|
||||
//"v1", //dual channel with v0
|
||||
"vag",
|
||||
"vai", //txth/reserved [Ratatouille (GC)]
|
||||
"vai",
|
||||
"vas",
|
||||
"vawx",
|
||||
"vb",
|
||||
@ -395,7 +397,7 @@ static const char* extension_list[] = {
|
||||
"vgs",
|
||||
"vgv",
|
||||
"vig",
|
||||
"vis", //txth/reserved [AirForce Delta (PS2)]
|
||||
"vis",
|
||||
"vms",
|
||||
"voi",
|
||||
"vpk",
|
||||
@ -424,7 +426,7 @@ static const char* extension_list[] = {
|
||||
"wsd",
|
||||
"wsi",
|
||||
"wua",
|
||||
"wv2", //txth/reserved [Slave Zero (PC)]
|
||||
"wv2",
|
||||
"wv6",
|
||||
"wve",
|
||||
"wvs",
|
||||
@ -1067,6 +1069,24 @@ static const meta_info meta_info_list[] = {
|
||||
{meta_HD3_BD3, "Sony HD3+BD3 header"},
|
||||
{meta_BNK_SONY, "Sony BNK header"},
|
||||
{meta_SCD_SSCF, "Square-Enix SCD (SSCF) header"},
|
||||
{meta_DSP_VAG, ".VAG DSP header"},
|
||||
{meta_DSP_ITL, ".ITL DSP header"},
|
||||
|
||||
{meta_A2M, "Artificial Mind & Movement A2M header"},
|
||||
{meta_AHV, "Amuze AHV header"},
|
||||
{meta_MSV, "Sony MultiStream MSV header"},
|
||||
{meta_SDF_PS2, "Beyond Reality PS2 SDF header"},
|
||||
{meta_SVG, "High Voltage SVG header"},
|
||||
{meta_VIS, "Konami VIS header"},
|
||||
|
||||
{meta_SDF_3DS, "Beyond Reality 3DS SDF header"},
|
||||
{meta_VAI, "Asobo Studio .VAI header"},
|
||||
|
||||
{meta_AIF_ASOBO, "Asobo Studio .AIF header"},
|
||||
{meta_AO, "AlphaOgg .AO header"},
|
||||
{meta_APC, "Cryo APC header"},
|
||||
{meta_WV2, "Infogrames North America WAV2 header"},
|
||||
{meta_XAU_KONAMI, "Konami XAU header"},
|
||||
|
||||
};
|
||||
|
||||
|
@ -275,6 +275,54 @@
|
||||
<File
|
||||
RelativePath=".\meta\2dx9.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\meta\ahv.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\meta\a2m.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\meta\msv.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\meta\sdf.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\meta\svg.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\meta\vis.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\meta\vai.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\meta\aif_asobo.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\meta\ao.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\meta\apc.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\meta\wv2.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\meta\xau_konami.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\meta\aax.c"
|
||||
|
@ -191,6 +191,18 @@
|
||||
<ClCompile Include="util.c" />
|
||||
<ClCompile Include="vgmstream.c" />
|
||||
<ClCompile Include="meta\2dx9.c" />
|
||||
<ClCompile Include="meta\a2m.c" />
|
||||
<ClCompile Include="meta\ahv.c" />
|
||||
<ClCompile Include="meta\msv.c" />
|
||||
<ClCompile Include="meta\sdf.c" />
|
||||
<ClCompile Include="meta\svg.c" />
|
||||
<ClCompile Include="meta\vis.c" />
|
||||
<ClCompile Include="meta\vai.c" />
|
||||
<ClCompile Include="meta\aif_asobo.c" />
|
||||
<ClCompile Include="meta\ao.c" />
|
||||
<ClCompile Include="meta\apc.c" />
|
||||
<ClCompile Include="meta\wv2.c" />
|
||||
<ClCompile Include="meta\xau_konami.c" />
|
||||
<ClCompile Include="meta\aax.c" />
|
||||
<ClCompile Include="meta\acm.c" />
|
||||
<ClCompile Include="meta\ads.c" />
|
||||
|
@ -169,6 +169,42 @@
|
||||
<ClCompile Include="meta\2dx9.c">
|
||||
<Filter>meta\Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="meta\a2m.c">
|
||||
<Filter>meta\Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="meta\ahv.c">
|
||||
<Filter>meta\Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="meta\msv.c">
|
||||
<Filter>meta\Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="meta\sdf.c">
|
||||
<Filter>meta\Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="meta\svg.c">
|
||||
<Filter>meta\Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="meta\vis.c">
|
||||
<Filter>meta\Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="meta\vai.c">
|
||||
<Filter>meta\Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="meta\aif_asobo.c">
|
||||
<Filter>meta\Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="meta\ao.c">
|
||||
<Filter>meta\Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="meta\apc.c">
|
||||
<Filter>meta\Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="meta\wv2.c">
|
||||
<Filter>meta\Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="meta\xau_konami.c">
|
||||
<Filter>meta\Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="meta\aax.c">
|
||||
<Filter>meta\Source Files</Filter>
|
||||
</ClCompile>
|
||||
|
45
src/meta/a2m.c
Normal file
45
src/meta/a2m.c
Normal file
@ -0,0 +1,45 @@
|
||||
#include "meta.h"
|
||||
#include "../coding/coding.h"
|
||||
|
||||
/* A2M - from Artificial Mind & Movement games [Scooby-Doo! Unmasked (PS2)] */
|
||||
VGMSTREAM * init_vgmstream_a2m(STREAMFILE *streamFile) {
|
||||
VGMSTREAM * vgmstream = NULL;
|
||||
off_t start_offset;
|
||||
size_t data_size;
|
||||
int loop_flag, channel_count;
|
||||
|
||||
|
||||
/* checks */
|
||||
if ( !check_extensions(streamFile,"int") )
|
||||
goto fail;
|
||||
if (read_32bitBE(0x00,streamFile) != 0x41324D00) /* "A2M\0" */
|
||||
goto fail;
|
||||
if (read_32bitBE(0x04,streamFile) != 0x50533200) /* "PS2\0" */
|
||||
goto fail;
|
||||
|
||||
start_offset = 0x30;
|
||||
data_size = get_streamfile_size(streamFile) - start_offset;
|
||||
channel_count = 2;
|
||||
loop_flag = 0;
|
||||
|
||||
|
||||
/* build the VGMSTREAM */
|
||||
vgmstream = allocate_vgmstream(channel_count,loop_flag);
|
||||
if (!vgmstream) goto fail;
|
||||
|
||||
vgmstream->meta_type = meta_A2M;
|
||||
vgmstream->sample_rate = read_32bitBE(0x10,streamFile);
|
||||
vgmstream->num_samples = ps_bytes_to_samples(data_size,channel_count);
|
||||
|
||||
vgmstream->coding_type = coding_PSX;
|
||||
vgmstream->layout_type = layout_interleave;
|
||||
vgmstream->interleave_block_size = 0x6000;
|
||||
|
||||
if ( !vgmstream_open_stream(vgmstream, streamFile, start_offset) )
|
||||
goto fail;
|
||||
return vgmstream;
|
||||
|
||||
fail:
|
||||
close_vgmstream(vgmstream);
|
||||
return NULL;
|
||||
}
|
48
src/meta/ahv.c
Normal file
48
src/meta/ahv.c
Normal file
@ -0,0 +1,48 @@
|
||||
#include "meta.h"
|
||||
#include "../coding/coding.h"
|
||||
|
||||
/* AHV - from Amuze games [Headhunter (PS2)] */
|
||||
VGMSTREAM * init_vgmstream_ahv(STREAMFILE *streamFile) {
|
||||
VGMSTREAM * vgmstream = NULL;
|
||||
off_t start_offset;
|
||||
size_t data_size, channel_size, interleave;
|
||||
int loop_flag, channel_count;
|
||||
|
||||
|
||||
/* checks (.ahv: from names in bigfile) */
|
||||
if ( !check_extensions(streamFile,"ahv") )
|
||||
goto fail;
|
||||
if (read_32bitBE(0x00,streamFile) != 0x41485600) /* "AHV\0" */
|
||||
goto fail;
|
||||
|
||||
start_offset = 0x800;
|
||||
data_size = get_streamfile_size(streamFile) - start_offset;
|
||||
interleave = read_32bitLE(0x10,streamFile);
|
||||
channel_count = (interleave != 0) ? 2 : 1;
|
||||
channel_size = read_32bitLE(0x08,streamFile);
|
||||
loop_flag = 0;
|
||||
/* VAGp header after 0x14 */
|
||||
|
||||
|
||||
/* build the VGMSTREAM */
|
||||
vgmstream = allocate_vgmstream(channel_count,loop_flag);
|
||||
if (!vgmstream) goto fail;
|
||||
|
||||
vgmstream->meta_type = meta_AHV;
|
||||
vgmstream->sample_rate = read_32bitLE(0x0c,streamFile);
|
||||
vgmstream->num_samples = ps_bytes_to_samples(channel_size,1);
|
||||
|
||||
vgmstream->coding_type = coding_PSX;
|
||||
vgmstream->layout_type = layout_interleave;
|
||||
vgmstream->interleave_block_size = interleave;
|
||||
if (interleave)
|
||||
vgmstream->interleave_last_block_size = (data_size % (interleave*channel_count)) / channel_count;
|
||||
|
||||
if ( !vgmstream_open_stream(vgmstream, streamFile, start_offset) )
|
||||
goto fail;
|
||||
return vgmstream;
|
||||
|
||||
fail:
|
||||
close_vgmstream(vgmstream);
|
||||
return NULL;
|
||||
}
|
49
src/meta/aif_asobo.c
Normal file
49
src/meta/aif_asobo.c
Normal file
@ -0,0 +1,49 @@
|
||||
#include "meta.h"
|
||||
#include "../coding/coding.h"
|
||||
|
||||
/* .AIF - from Asobo Studio games [Ratatouille (PC)] */
|
||||
VGMSTREAM * init_vgmstream_aif_asobo(STREAMFILE *streamFile) {
|
||||
VGMSTREAM * vgmstream = NULL;
|
||||
off_t start_offset;
|
||||
size_t data_size;
|
||||
int loop_flag, channel_count;
|
||||
|
||||
|
||||
/* checks */
|
||||
/* aif: standard, aiffl: for plugins? */
|
||||
if ( !check_extensions(streamFile,"aif,aiffl") )
|
||||
goto fail;
|
||||
if ((uint16_t)read_16bitLE(0x00,streamFile) != 0x69) /* Xbox codec */
|
||||
goto fail;
|
||||
|
||||
channel_count = read_16bitLE(0x02,streamFile); /* assumed */
|
||||
/* 0x08: ? */
|
||||
if ((uint16_t)read_16bitLE(0x0c,streamFile) != 0x24*channel_count) /* Xbox block */
|
||||
goto fail;
|
||||
if ((uint16_t)read_16bitLE(0x0e,streamFile) != 0x04) /* Xbox bps */
|
||||
goto fail;
|
||||
loop_flag = 0;
|
||||
|
||||
start_offset = 0x14;
|
||||
data_size = get_streamfile_size(streamFile) - start_offset;
|
||||
|
||||
|
||||
/* build the VGMSTREAM */
|
||||
vgmstream = allocate_vgmstream(channel_count,loop_flag);
|
||||
if (!vgmstream) goto fail;
|
||||
|
||||
vgmstream->meta_type = meta_AIF_ASOBO;
|
||||
vgmstream->sample_rate = read_32bitLE(0x04,streamFile);
|
||||
vgmstream->num_samples = xbox_ima_bytes_to_samples(data_size,channel_count);
|
||||
|
||||
vgmstream->coding_type = coding_XBOX_IMA;
|
||||
vgmstream->layout_type = layout_none;
|
||||
|
||||
if ( !vgmstream_open_stream(vgmstream, streamFile, start_offset) )
|
||||
goto fail;
|
||||
return vgmstream;
|
||||
|
||||
fail:
|
||||
close_vgmstream(vgmstream);
|
||||
return NULL;
|
||||
}
|
36
src/meta/ao.c
Normal file
36
src/meta/ao.c
Normal file
@ -0,0 +1,36 @@
|
||||
#include "meta.h"
|
||||
#include "../coding/coding.h"
|
||||
|
||||
/* .AO - from AlphaOgg lib [Cloudphobia (PC)] */
|
||||
VGMSTREAM * init_vgmstream_ao(STREAMFILE *streamFile) {
|
||||
VGMSTREAM * vgmstream = NULL;
|
||||
off_t start_offset;
|
||||
|
||||
|
||||
/* checks */
|
||||
if ( !check_extensions(streamFile,"ao") )
|
||||
goto fail;
|
||||
if (read_32bitBE(0x00,streamFile) != 0x414C5048) /* "ALPH" */
|
||||
goto fail;
|
||||
if (read_32bitBE(0x04,streamFile) != 0x414F4747) /* "AOGG" */
|
||||
goto fail;
|
||||
|
||||
#ifdef VGM_USE_VORBIS
|
||||
{
|
||||
ogg_vorbis_meta_info_t ovmi = {0};
|
||||
|
||||
ovmi.meta_type = meta_AO;
|
||||
/* values at 0x08/0x0c/0x10 may be related to looping? */
|
||||
start_offset = 0xc8;
|
||||
vgmstream = init_vgmstream_ogg_vorbis_callbacks(streamFile, NULL, start_offset, &ovmi);
|
||||
}
|
||||
#else
|
||||
goto fail
|
||||
#endif
|
||||
|
||||
return vgmstream;
|
||||
|
||||
fail:
|
||||
close_vgmstream(vgmstream);
|
||||
return NULL;
|
||||
}
|
48
src/meta/apc.c
Normal file
48
src/meta/apc.c
Normal file
@ -0,0 +1,48 @@
|
||||
#include "meta.h"
|
||||
#include "../coding/coding.h"
|
||||
|
||||
/* APC - from Cryo games [MegaRace 3 (PC)] */
|
||||
VGMSTREAM * init_vgmstream_apc(STREAMFILE *streamFile) {
|
||||
VGMSTREAM * vgmstream = NULL;
|
||||
off_t start_offset;
|
||||
size_t data_size;
|
||||
int loop_flag, channel_count;
|
||||
|
||||
|
||||
/* checks */
|
||||
if ( !check_extensions(streamFile,"apc") )
|
||||
goto fail;
|
||||
if (read_32bitBE(0x00,streamFile) != 0x4352594F) /* "CRYO" */
|
||||
goto fail;
|
||||
if (read_32bitBE(0x04,streamFile) != 0x5F415043) /* "_APC" */
|
||||
goto fail;
|
||||
//if (read_32bitBE(0x08,streamFile) != 0x312E3230) /* "1.20" */
|
||||
// goto fail;
|
||||
|
||||
/* 0x14/18: L/R hist sample? */
|
||||
|
||||
start_offset = 0x20;
|
||||
data_size = get_streamfile_size(streamFile) - start_offset;
|
||||
channel_count = read_32bitLE(0x1c,streamFile) == 0 ? 1 : 2;
|
||||
loop_flag = 0;
|
||||
|
||||
|
||||
/* build the VGMSTREAM */
|
||||
vgmstream = allocate_vgmstream(channel_count,loop_flag);
|
||||
if (!vgmstream) goto fail;
|
||||
|
||||
vgmstream->meta_type = meta_APC;
|
||||
vgmstream->sample_rate = read_32bitLE(0x10,streamFile);
|
||||
vgmstream->num_samples = ima_bytes_to_samples(data_size,channel_count);
|
||||
|
||||
vgmstream->coding_type = coding_IMA;
|
||||
vgmstream->layout_type = layout_none;
|
||||
|
||||
if ( !vgmstream_open_stream(vgmstream, streamFile, start_offset) )
|
||||
goto fail;
|
||||
return vgmstream;
|
||||
|
||||
fail:
|
||||
close_vgmstream(vgmstream);
|
||||
return NULL;
|
||||
}
|
@ -3,8 +3,6 @@
|
||||
|
||||
#include "../vgmstream.h"
|
||||
|
||||
VGMSTREAM * init_vgmstream_idsp_nus3(STREAMFILE *streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_adx(STREAMFILE *streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_afc(STREAMFILE *streamFile);
|
||||
@ -26,14 +24,30 @@ VGMSTREAM * init_vgmstream_nds_strm(STREAMFILE *streamFile);
|
||||
VGMSTREAM * init_vgmstream_ngc_adpdtk(STREAMFILE *streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_ngc_dsp_std(STREAMFILE *streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_ngc_mdsp_std(STREAMFILE *streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_ngc_dsp_stm(STREAMFILE *streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_ngc_mpdsp(STREAMFILE *streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_ngc_dsp_std_int(STREAMFILE *streamFile);
|
||||
VGMSTREAM * init_vgmstream_idsp_nus3(STREAMFILE *streamFile);
|
||||
VGMSTREAM * init_vgmstream_sadb(STREAMFILE *streamFile);
|
||||
VGMSTREAM * init_vgmstream_sadf(STREAMFILE *streamFile);
|
||||
VGMSTREAM * init_vgmstream_ngc_swd(STREAMFILE * streamFile);
|
||||
VGMSTREAM * init_vgmstream_idsp_tt(STREAMFILE *streamFile);
|
||||
VGMSTREAM * init_vgmstream_idsp_nl(STREAMFILE * streamFile);
|
||||
VGMSTREAM * init_vgmstream_wii_wsd(STREAMFILE *streamFile);
|
||||
VGMSTREAM * init_vgmstream_dsp_ddsp(STREAMFILE* streamFile);
|
||||
VGMSTREAM * init_vgmstream_wii_was(STREAMFILE* streamFile);
|
||||
VGMSTREAM * init_vgmstream_dsp_str_ig(STREAMFILE* streamFile);
|
||||
VGMSTREAM * init_vgmstream_dsp_xiii(STREAMFILE* streamFile);
|
||||
VGMSTREAM * init_vgmstream_dsp_cabelas(STREAMFILE* streamFile);
|
||||
VGMSTREAM * init_vgmstream_wii_ndp(STREAMFILE *streamFile);
|
||||
VGMSTREAM * init_vgmstream_ngc_dsp_aaap(STREAMFILE* streamFile);
|
||||
VGMSTREAM * init_vgmstream_dsp_dspw(STREAMFILE* streamFile);
|
||||
VGMSTREAM * init_vgmstream_ngc_dsp_iadp(STREAMFILE* streamFile);
|
||||
VGMSTREAM * init_vgmstream_dsp_mcadpcm(STREAMFILE *streamFile);
|
||||
VGMSTREAM * init_vgmstream_dsp_switch_audio(STREAMFILE *streamFile);
|
||||
VGMSTREAM * init_vgmstream_dsp_vag(STREAMFILE *streamFile);
|
||||
VGMSTREAM * init_vgmstream_dsp_itl_ch(STREAMFILE *streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_csmp(STREAMFILE *streamFile);
|
||||
|
||||
@ -133,8 +147,6 @@ VGMSTREAM * init_vgmstream_sli_ogg(STREAMFILE * streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_sfl_ogg(STREAMFILE * streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_sadb(STREAMFILE *streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_ps2_bmdx(STREAMFILE * streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_wsi(STREAMFILE * streamFile);
|
||||
@ -152,7 +164,6 @@ VGMSTREAM * init_vgmstream_ivb(STREAMFILE * streamFile);
|
||||
VGMSTREAM * init_vgmstream_svs(STREAMFILE * streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_riff(STREAMFILE * streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_rifx(STREAMFILE * streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_xnb(STREAMFILE * streamFile);
|
||||
@ -236,8 +247,6 @@ VGMSTREAM * init_vgmstream_aix(STREAMFILE * streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_ngc_tydsp(STREAMFILE * streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_ngc_swd(STREAMFILE * streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_capdsp(STREAMFILE * streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_xbox_wvs(STREAMFILE *streamFile);
|
||||
@ -264,8 +273,6 @@ VGMSTREAM * init_vgmstream_dc_idvi(STREAMFILE *streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_ps2_rnd(STREAMFILE *streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_idsp_tt(STREAMFILE *streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_kraw(STREAMFILE *streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_ps2_omu(STREAMFILE *streamFile);
|
||||
@ -273,7 +280,6 @@ VGMSTREAM * init_vgmstream_ps2_omu(STREAMFILE *streamFile);
|
||||
VGMSTREAM * init_vgmstream_ps2_xa2(STREAMFILE * streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_nub_idsp(STREAMFILE * streamFile);
|
||||
VGMSTREAM * init_vgmstream_idsp_nl(STREAMFILE * streamFile);
|
||||
VGMSTREAM * init_vgmstream_idsp_ie(STREAMFILE * streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_ngc_ymf(STREAMFILE * streamFile);
|
||||
@ -397,10 +403,6 @@ VGMSTREAM * init_vgmstream_RedSpark(STREAMFILE *streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_ivaud(STREAMFILE *streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_wii_wsd(STREAMFILE *streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_wii_ndp(STREAMFILE *streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_ps2_sps(STREAMFILE *streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_ps2_xa2_rrp(STREAMFILE *streamFile);
|
||||
@ -437,8 +439,6 @@ VGMSTREAM * init_vgmstream_exakt_sc(STREAMFILE* streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_wii_bns(STREAMFILE* streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_wii_was(STREAMFILE* streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_pona_3do(STREAMFILE* streamFile);
|
||||
VGMSTREAM * init_vgmstream_pona_psx(STREAMFILE* streamFile);
|
||||
|
||||
@ -454,8 +454,6 @@ VGMSTREAM * init_vgmstream_ps2_ast(STREAMFILE* streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_dmsg(STREAMFILE* streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_ngc_dsp_aaap(STREAMFILE* streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_ngc_dsp_konami(STREAMFILE* streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_ps2_ster(STREAMFILE* streamFile);
|
||||
@ -480,24 +478,16 @@ VGMSTREAM * init_vgmstream_pc_smp(STREAMFILE* streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_ngc_rkv(STREAMFILE* streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_dsp_ddsp(STREAMFILE* streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_p3d(STREAMFILE* streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_ngc_dsp_mpds(STREAMFILE* streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_dsp_str_ig(STREAMFILE* streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_ea_swvr(STREAMFILE* streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_ps2_b1s(STREAMFILE* streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_ps2_wad(STREAMFILE* streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_dsp_xiii(STREAMFILE* streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_dsp_cabelas(STREAMFILE* streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_ps2_adm(STREAMFILE* streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_ps2_lpcm(STREAMFILE* streamFile);
|
||||
@ -512,8 +502,6 @@ VGMSTREAM * init_vgmstream_bar(STREAMFILE* streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_ffw(STREAMFILE* streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_dsp_dspw(STREAMFILE* streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_ps2_jstm(STREAMFILE* streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_xvag(STREAMFILE* streamFile);
|
||||
@ -528,8 +516,6 @@ VGMSTREAM * init_vgmstream_baf(STREAMFILE* streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_ps3_msf(STREAMFILE* streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_ngc_dsp_iadp(STREAMFILE* streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_nub_vag(STREAMFILE* streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_ps3_past(STREAMFILE* streamFile);
|
||||
@ -733,8 +719,6 @@ VGMSTREAM * init_vgmstream_ngc_dsp_std_le(STREAMFILE *streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_pcm_sre(STREAMFILE *streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_dsp_mcadpcm(STREAMFILE *streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_ubi_lyn(STREAMFILE * streamFile);
|
||||
VGMSTREAM * init_vgmstream_ubi_lyn_container(STREAMFILE * streamFile);
|
||||
|
||||
@ -752,10 +736,6 @@ VGMSTREAM * init_vgmstream_opus_ppp(STREAMFILE *streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_ubi_bao_pk(STREAMFILE *streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_dsp_switch_audio(STREAMFILE *streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_dsp_sadf(STREAMFILE *streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_h4m(STREAMFILE *streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_asf(STREAMFILE *streamFile);
|
||||
@ -779,4 +759,20 @@ VGMSTREAM * init_vgmstream_nus3bank(STREAMFILE *streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_scd_sscf(STREAMFILE *streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_a2m(STREAMFILE *streamFile);
|
||||
VGMSTREAM * init_vgmstream_ahv(STREAMFILE *streamFile);
|
||||
VGMSTREAM * init_vgmstream_msv(STREAMFILE *streamFile);
|
||||
VGMSTREAM * init_vgmstream_sdf_ps2(STREAMFILE *streamFile);
|
||||
VGMSTREAM * init_vgmstream_svg(STREAMFILE *streamFile);
|
||||
VGMSTREAM * init_vgmstream_vis(STREAMFILE *streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_sdf_3ds(STREAMFILE *streamFile);
|
||||
VGMSTREAM * init_vgmstream_vai(STREAMFILE *streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_aif_asobo(STREAMFILE *streamFile);
|
||||
VGMSTREAM * init_vgmstream_ao(STREAMFILE *streamFile);
|
||||
VGMSTREAM * init_vgmstream_apc(STREAMFILE *streamFile);
|
||||
VGMSTREAM * init_vgmstream_wv2(STREAMFILE *streamFile);
|
||||
VGMSTREAM * init_vgmstream_xau_konami(STREAMFILE *streamFile);
|
||||
|
||||
#endif /*_META_H*/
|
||||
|
43
src/meta/msv.c
Normal file
43
src/meta/msv.c
Normal file
@ -0,0 +1,43 @@
|
||||
#include "meta.h"
|
||||
#include "../coding/coding.h"
|
||||
|
||||
/* MSV - from Sony MultiStream format [Fight Club (PS2)] */
|
||||
VGMSTREAM * init_vgmstream_msv(STREAMFILE *streamFile) {
|
||||
VGMSTREAM * vgmstream = NULL;
|
||||
off_t start_offset;
|
||||
size_t channel_size;
|
||||
int loop_flag, channel_count;
|
||||
|
||||
|
||||
/* checks */
|
||||
if ( !check_extensions(streamFile,"msv") )
|
||||
goto fail;
|
||||
if (read_32bitBE(0x00,streamFile) != 0x4D535670) /* "MSVp" */
|
||||
goto fail;
|
||||
|
||||
start_offset = 0x30;
|
||||
channel_count = 1;
|
||||
channel_size = read_32bitBE(0x0c,streamFile);
|
||||
loop_flag = 0; /* no looping and last 16 bytes (end frame) are removed, from Sony's docs */
|
||||
|
||||
|
||||
/* build the VGMSTREAM */
|
||||
vgmstream = allocate_vgmstream(channel_count,loop_flag);
|
||||
if (!vgmstream) goto fail;
|
||||
|
||||
vgmstream->meta_type = meta_MSV;
|
||||
vgmstream->sample_rate = read_32bitBE(0x10,streamFile);
|
||||
vgmstream->num_samples = ps_bytes_to_samples(channel_size,1);
|
||||
|
||||
vgmstream->coding_type = coding_PSX;
|
||||
vgmstream->layout_type = layout_none;
|
||||
read_string(vgmstream->stream_name,0x10+1, 0x20,streamFile);
|
||||
|
||||
if ( !vgmstream_open_stream(vgmstream, streamFile, start_offset) )
|
||||
goto fail;
|
||||
return vgmstream;
|
||||
|
||||
fail:
|
||||
close_vgmstream(vgmstream);
|
||||
return NULL;
|
||||
}
|
@ -101,7 +101,7 @@ static VGMSTREAM * init_vgmstream_dsp_common(STREAMFILE *streamFile, dsp_meta *d
|
||||
int loop_flag;
|
||||
struct dsp_header ch_header[COMMON_DSP_MAX_CHANNELS];
|
||||
|
||||
|
||||
VGM_LOG("1\n");
|
||||
if (dspm->channel_count > dspm->max_channels)
|
||||
goto fail;
|
||||
if (dspm->channel_count > COMMON_DSP_MAX_CHANNELS)
|
||||
@ -114,6 +114,7 @@ static VGMSTREAM * init_vgmstream_dsp_common(STREAMFILE *streamFile, dsp_meta *d
|
||||
goto fail;
|
||||
}
|
||||
}
|
||||
VGM_LOG("2\n");
|
||||
|
||||
/* fix bad/fixed value in loop start */
|
||||
if (dspm->fix_loop_start) {
|
||||
@ -122,6 +123,7 @@ static VGMSTREAM * init_vgmstream_dsp_common(STREAMFILE *streamFile, dsp_meta *d
|
||||
ch_header[i].loop_start_offset = 0x00;
|
||||
}
|
||||
}
|
||||
VGM_LOG("3\n");
|
||||
|
||||
/* check type==0 and gain==0 */
|
||||
{
|
||||
@ -130,6 +132,7 @@ static VGMSTREAM * init_vgmstream_dsp_common(STREAMFILE *streamFile, dsp_meta *d
|
||||
goto fail;
|
||||
}
|
||||
}
|
||||
VGM_LOG("4\n");
|
||||
|
||||
/* check for agreement between channels */
|
||||
if (!dspm->ignore_header_agreement) {
|
||||
@ -144,6 +147,7 @@ static VGMSTREAM * init_vgmstream_dsp_common(STREAMFILE *streamFile, dsp_meta *d
|
||||
}
|
||||
}
|
||||
}
|
||||
VGM_LOG("5\n");
|
||||
|
||||
/* check expected initial predictor/scale */
|
||||
{
|
||||
@ -157,6 +161,7 @@ static VGMSTREAM * init_vgmstream_dsp_common(STREAMFILE *streamFile, dsp_meta *d
|
||||
goto fail;
|
||||
}
|
||||
}
|
||||
VGM_LOG("6\n");
|
||||
|
||||
/* check expected loop predictor/scale */
|
||||
if (ch_header[0].loop_flag) {
|
||||
@ -170,11 +175,12 @@ static VGMSTREAM * init_vgmstream_dsp_common(STREAMFILE *streamFile, dsp_meta *d
|
||||
loop_offset = loop_offset / 16 * 8;
|
||||
loop_offset = (loop_offset / dspm->interleave * dspm->interleave * channels) + (loop_offset % dspm->interleave);
|
||||
}
|
||||
|
||||
VGM_LOG("%x vs %lx\n", ch_header[i].loop_ps, dspm->start_offset + i*dspm->interleave + loop_offset);
|
||||
if (ch_header[i].loop_ps != (uint8_t)read_8bit(dspm->start_offset + i*dspm->interleave + loop_offset,streamFile))
|
||||
goto fail;
|
||||
}
|
||||
}
|
||||
VGM_LOG("7\n");
|
||||
|
||||
/* all done, must be DSP */
|
||||
|
||||
@ -629,7 +635,7 @@ fail:
|
||||
}
|
||||
|
||||
/* sadf - Procyon Studio Header Variant [Xenoblade Chronicles 2 (Switch)] (sfx) */
|
||||
VGMSTREAM * init_vgmstream_dsp_sadf(STREAMFILE *streamFile) {
|
||||
VGMSTREAM * init_vgmstream_sadf(STREAMFILE *streamFile) {
|
||||
VGMSTREAM * vgmstream = NULL;
|
||||
int channel_count, loop_flag;
|
||||
off_t start_offset;
|
||||
@ -1111,3 +1117,56 @@ VGMSTREAM * init_vgmstream_dsp_switch_audio(STREAMFILE *streamFile) {
|
||||
fail:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* .vag - from Penny-Punching Princess (Switch) sfx */
|
||||
VGMSTREAM * init_vgmstream_dsp_vag(STREAMFILE *streamFile) {
|
||||
dsp_meta dspm = {0};
|
||||
|
||||
/* checks */
|
||||
if (!check_extensions(streamFile, "vag"))
|
||||
goto fail;
|
||||
if (read_32bitBE(0x00,streamFile) != 0x08000000) /* file type? OPUSs had 09 */
|
||||
goto fail;
|
||||
if (read_32bitLE(0x08,streamFile) != read_32bitLE(0x24,streamFile)) /* header has various repeated values */
|
||||
goto fail;
|
||||
|
||||
dspm.channel_count = 1;
|
||||
dspm.max_channels = 1;
|
||||
dspm.little_endian = 1;
|
||||
|
||||
dspm.header_offset = 0x1c;
|
||||
dspm.header_spacing = 0x60;
|
||||
dspm.start_offset = dspm.header_offset + dspm.header_spacing*dspm.channel_count;
|
||||
dspm.interleave = 0;
|
||||
|
||||
dspm.fix_loop_start = 1;
|
||||
|
||||
dspm.meta_type = meta_DSP_VAG;
|
||||
return init_vgmstream_dsp_common(streamFile, &dspm);
|
||||
fail:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* .itl - from Chanrinko Hero (GC) */
|
||||
VGMSTREAM * init_vgmstream_dsp_itl_ch(STREAMFILE *streamFile) {
|
||||
dsp_meta dspm = {0};
|
||||
|
||||
/* checks */
|
||||
if (!check_extensions(streamFile, "itl"))
|
||||
goto fail;
|
||||
|
||||
dspm.channel_count = 2;
|
||||
dspm.max_channels = 2;
|
||||
|
||||
dspm.header_offset = 0x00;
|
||||
dspm.header_spacing = 0x60;
|
||||
dspm.start_offset = dspm.header_offset + dspm.header_spacing*dspm.channel_count;
|
||||
dspm.interleave = 0x23C0;
|
||||
|
||||
dspm.fix_looping = 1;
|
||||
|
||||
dspm.meta_type = meta_DSP_ITL;
|
||||
return init_vgmstream_dsp_common(streamFile, &dspm);
|
||||
fail:
|
||||
return NULL;
|
||||
}
|
||||
|
96
src/meta/sdf.c
Normal file
96
src/meta/sdf.c
Normal file
@ -0,0 +1,96 @@
|
||||
#include "meta.h"
|
||||
#include "../coding/coding.h"
|
||||
|
||||
/* SDF - from Beyond Reality games [Agent Hugo - Lemoon Twist (PS2)] */
|
||||
VGMSTREAM * init_vgmstream_sdf_ps2(STREAMFILE *streamFile) {
|
||||
VGMSTREAM * vgmstream = NULL;
|
||||
off_t start_offset;
|
||||
size_t data_size;
|
||||
int loop_flag, channel_count;
|
||||
|
||||
|
||||
/* checks */
|
||||
if ( !check_extensions(streamFile,"sdf") )
|
||||
goto fail;
|
||||
if (read_32bitBE(0x00,streamFile) != 0x53444600) /* "SDF\0" */
|
||||
goto fail;
|
||||
if (read_32bitBE(0x04,streamFile) != 0x03000000) /* version? */
|
||||
goto fail;
|
||||
|
||||
start_offset = 0x18;
|
||||
data_size = get_streamfile_size(streamFile) - start_offset;
|
||||
if (read_32bitLE(0x08,streamFile) != data_size)
|
||||
goto fail;
|
||||
|
||||
channel_count = read_32bitLE(0x10,streamFile);
|
||||
loop_flag = 0; /* all files have loop flags but simply fade out normally and repeat */
|
||||
|
||||
|
||||
/* build the VGMSTREAM */
|
||||
vgmstream = allocate_vgmstream(channel_count,loop_flag);
|
||||
if (!vgmstream) goto fail;
|
||||
|
||||
vgmstream->meta_type = meta_SDF_PS2;
|
||||
vgmstream->sample_rate = read_32bitLE(0x0c,streamFile);
|
||||
vgmstream->num_samples = ps_bytes_to_samples(data_size,channel_count);
|
||||
|
||||
vgmstream->coding_type = coding_PSX;
|
||||
vgmstream->layout_type = layout_interleave;
|
||||
vgmstream->interleave_block_size = read_32bitLE(0x14,streamFile);
|
||||
|
||||
if ( !vgmstream_open_stream(vgmstream, streamFile, start_offset) )
|
||||
goto fail;
|
||||
return vgmstream;
|
||||
|
||||
fail:
|
||||
close_vgmstream(vgmstream);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* SDF - from Beyond Reality games [Gummy Bears Mini Golf (3DS)] */
|
||||
VGMSTREAM * init_vgmstream_sdf_3ds(STREAMFILE *streamFile) {
|
||||
VGMSTREAM * vgmstream = NULL;
|
||||
off_t start_offset;
|
||||
size_t data_size;
|
||||
int loop_flag, channel_count;
|
||||
|
||||
|
||||
/* checks */
|
||||
if ( !check_extensions(streamFile,"sdf") )
|
||||
goto fail;
|
||||
if (read_32bitBE(0x00,streamFile) != 0x53444600) /* "SDF\0" */
|
||||
goto fail;
|
||||
if (read_32bitBE(0x04,streamFile) != 0x03000000) /* version? */
|
||||
goto fail;
|
||||
|
||||
start_offset = 0x78; /* assumed */
|
||||
data_size = get_streamfile_size(streamFile) - start_offset;
|
||||
if (read_32bitLE(0x08,streamFile) != data_size)
|
||||
goto fail;
|
||||
|
||||
channel_count = read_32bitLE(0x14,streamFile);
|
||||
loop_flag = 0;
|
||||
|
||||
|
||||
/* build the VGMSTREAM */
|
||||
vgmstream = allocate_vgmstream(channel_count,loop_flag);
|
||||
if (!vgmstream) goto fail;
|
||||
|
||||
vgmstream->meta_type = meta_SDF_3DS;
|
||||
vgmstream->sample_rate = read_32bitLE(0x10,streamFile);
|
||||
vgmstream->num_samples = dsp_bytes_to_samples(data_size,channel_count);
|
||||
|
||||
vgmstream->coding_type = coding_NGC_DSP;
|
||||
vgmstream->layout_type = layout_interleave;
|
||||
vgmstream->interleave_block_size = data_size / channel_count;
|
||||
dsp_read_coefs_le(vgmstream,streamFile,0x1c,0x2e);
|
||||
//todo: there be hist around 0x3c
|
||||
|
||||
if ( !vgmstream_open_stream(vgmstream, streamFile, start_offset) )
|
||||
goto fail;
|
||||
return vgmstream;
|
||||
|
||||
fail:
|
||||
close_vgmstream(vgmstream);
|
||||
return NULL;
|
||||
}
|
48
src/meta/svg.c
Normal file
48
src/meta/svg.c
Normal file
@ -0,0 +1,48 @@
|
||||
#include "meta.h"
|
||||
#include "../coding/coding.h"
|
||||
|
||||
/* SVG - from High Voltage games [Hunter: The Reckoning - Wayward (PS2)] */
|
||||
VGMSTREAM * init_vgmstream_svg(STREAMFILE *streamFile) {
|
||||
VGMSTREAM * vgmstream = NULL;
|
||||
off_t start_offset;
|
||||
size_t data_size, interleave;
|
||||
int loop_flag, channel_count;
|
||||
int32_t loop_start = 0, loop_end = 0;
|
||||
|
||||
|
||||
/* checks */
|
||||
if ( !check_extensions(streamFile,"svg") )
|
||||
goto fail;
|
||||
if (read_32bitBE(0x00,streamFile) != 0x53564770) /* "SVGp" */
|
||||
goto fail;
|
||||
|
||||
start_offset = 0x800;
|
||||
data_size = read_32bitLE(0x18,streamFile);
|
||||
interleave = read_32bitLE(0x14,streamFile);
|
||||
channel_count = 2;
|
||||
loop_flag = ps_find_loop_offsets(streamFile, start_offset, data_size, channel_count, interleave,&loop_start, &loop_end);
|
||||
|
||||
|
||||
/* build the VGMSTREAM */
|
||||
vgmstream = allocate_vgmstream(channel_count,loop_flag);
|
||||
if (!vgmstream) goto fail;
|
||||
|
||||
vgmstream->meta_type = meta_SVG;
|
||||
vgmstream->sample_rate = read_32bitBE(0x2c,streamFile);
|
||||
vgmstream->num_samples = ps_bytes_to_samples(data_size,channel_count);
|
||||
vgmstream->loop_start_sample = loop_start;
|
||||
vgmstream->loop_end_sample = loop_end;
|
||||
|
||||
vgmstream->coding_type = coding_PSX;
|
||||
vgmstream->layout_type = layout_interleave;
|
||||
vgmstream->interleave_block_size = interleave;
|
||||
read_string(vgmstream->stream_name,0x10+1, 0x04,streamFile);
|
||||
|
||||
if ( !vgmstream_open_stream(vgmstream, streamFile, start_offset) )
|
||||
goto fail;
|
||||
return vgmstream;
|
||||
|
||||
fail:
|
||||
close_vgmstream(vgmstream);
|
||||
return NULL;
|
||||
}
|
45
src/meta/vai.c
Normal file
45
src/meta/vai.c
Normal file
@ -0,0 +1,45 @@
|
||||
#include "meta.h"
|
||||
#include "../coding/coding.h"
|
||||
|
||||
/* .VAI - from Asobo Studio games [Ratatouille (GC)] */
|
||||
VGMSTREAM * init_vgmstream_vai(STREAMFILE *streamFile) {
|
||||
VGMSTREAM * vgmstream = NULL;
|
||||
off_t start_offset;
|
||||
size_t data_size;
|
||||
int loop_flag, channel_count;
|
||||
|
||||
|
||||
/* checks */
|
||||
if ( !check_extensions(streamFile,"vai") )
|
||||
goto fail;
|
||||
|
||||
start_offset = 0x4060;
|
||||
data_size = get_streamfile_size(streamFile) - start_offset;
|
||||
if (read_32bitBE(0x04,streamFile) != data_size)
|
||||
goto fail;
|
||||
|
||||
channel_count = 2;
|
||||
loop_flag = 0;
|
||||
|
||||
|
||||
/* build the VGMSTREAM */
|
||||
vgmstream = allocate_vgmstream(channel_count,loop_flag);
|
||||
if (!vgmstream) goto fail;
|
||||
|
||||
vgmstream->meta_type = meta_VAI;
|
||||
vgmstream->sample_rate = read_32bitBE(0x00,streamFile);
|
||||
vgmstream->num_samples = dsp_bytes_to_samples(data_size,channel_count);
|
||||
|
||||
vgmstream->coding_type = coding_NGC_DSP;
|
||||
vgmstream->layout_type = layout_interleave;
|
||||
vgmstream->interleave_block_size = 0x4000;
|
||||
dsp_read_coefs_be(vgmstream,streamFile,0x0c,0x20);
|
||||
|
||||
if ( !vgmstream_open_stream(vgmstream, streamFile, start_offset) )
|
||||
goto fail;
|
||||
return vgmstream;
|
||||
|
||||
fail:
|
||||
close_vgmstream(vgmstream);
|
||||
return NULL;
|
||||
}
|
52
src/meta/vis.c
Normal file
52
src/meta/vis.c
Normal file
@ -0,0 +1,52 @@
|
||||
#include "meta.h"
|
||||
#include "../coding/coding.h"
|
||||
|
||||
/* VIS - from Konami games [AirForce Delta Strike (PS2) (PS2)] */
|
||||
VGMSTREAM * init_vgmstream_vis(STREAMFILE *streamFile) {
|
||||
VGMSTREAM * vgmstream = NULL;
|
||||
off_t start_offset;
|
||||
size_t data_size;
|
||||
int loop_flag, channel_count;
|
||||
|
||||
|
||||
/* checks */
|
||||
if ( !check_extensions(streamFile,"vis") )
|
||||
goto fail;
|
||||
if (read_32bitBE(0x00,streamFile) != 0x56495341) /* "VISA" */
|
||||
goto fail;
|
||||
|
||||
start_offset = 0x800;
|
||||
data_size = get_streamfile_size(streamFile) - start_offset;
|
||||
|
||||
loop_flag = read_32bitLE(0x18,streamFile);
|
||||
channel_count = read_32bitLE(0x20,streamFile); /* assumed */
|
||||
/* 0x1c: always 0x10 */
|
||||
/* 0x24: always 0x01 */
|
||||
|
||||
|
||||
/* build the VGMSTREAM */
|
||||
vgmstream = allocate_vgmstream(channel_count,loop_flag);
|
||||
if (!vgmstream) goto fail;
|
||||
|
||||
vgmstream->meta_type = meta_VIS;
|
||||
vgmstream->sample_rate = read_32bitLE(0x08,streamFile);
|
||||
vgmstream->num_samples = ps_bytes_to_samples(data_size,channel_count);
|
||||
vgmstream->loop_start_sample = ps_bytes_to_samples(read_32bitLE(0x0c,streamFile),channel_count);
|
||||
vgmstream->loop_end_sample = ps_bytes_to_samples(read_32bitLE(0x10,streamFile),channel_count);
|
||||
|
||||
vgmstream->coding_type = coding_PSX;
|
||||
vgmstream->layout_type = layout_interleave;
|
||||
vgmstream->interleave_block_size = read_32bitLE(0x14,streamFile); /* usually 0x10 or 0x4000 */
|
||||
if (vgmstream->interleave_block_size)
|
||||
vgmstream->interleave_last_block_size =
|
||||
(data_size % (vgmstream->interleave_block_size*channel_count)) / channel_count;
|
||||
read_string(vgmstream->stream_name,0x10+1, 0x28,streamFile);
|
||||
|
||||
if ( !vgmstream_open_stream(vgmstream, streamFile, start_offset) )
|
||||
goto fail;
|
||||
return vgmstream;
|
||||
|
||||
fail:
|
||||
close_vgmstream(vgmstream);
|
||||
return NULL;
|
||||
}
|
43
src/meta/wv2.c
Normal file
43
src/meta/wv2.c
Normal file
@ -0,0 +1,43 @@
|
||||
#include "meta.h"
|
||||
#include "../coding/coding.h"
|
||||
|
||||
/* WAV2 - from Infrogrames North America games [Slave Zero (PC) (PS2)] */
|
||||
VGMSTREAM * init_vgmstream_wv2(STREAMFILE *streamFile) {
|
||||
VGMSTREAM * vgmstream = NULL;
|
||||
off_t start_offset;
|
||||
size_t data_size;
|
||||
int loop_flag, channel_count;
|
||||
|
||||
|
||||
/* checks */
|
||||
if ( !check_extensions(streamFile,"wv2") )
|
||||
goto fail;
|
||||
if (read_32bitBE(0x00,streamFile) != 0x57415632) /* "WAV2" */
|
||||
goto fail;
|
||||
|
||||
start_offset = 0x1c;
|
||||
data_size = get_streamfile_size(streamFile) - start_offset;
|
||||
channel_count = read_8bit(0x0c,streamFile);
|
||||
loop_flag = 0;
|
||||
|
||||
|
||||
/* build the VGMSTREAM */
|
||||
vgmstream = allocate_vgmstream(channel_count,loop_flag);
|
||||
if (!vgmstream) goto fail;
|
||||
|
||||
vgmstream->meta_type = meta_WV2;
|
||||
vgmstream->sample_rate = read_32bitLE(0x10,streamFile);
|
||||
vgmstream->num_samples = ima_bytes_to_samples(data_size,channel_count); /* also 0x18 */
|
||||
|
||||
vgmstream->coding_type = coding_DVI_IMA_int;
|
||||
vgmstream->layout_type = layout_interleave;
|
||||
vgmstream->interleave_block_size = 0xFA;
|
||||
|
||||
if ( !vgmstream_open_stream(vgmstream, streamFile, start_offset) )
|
||||
goto fail;
|
||||
return vgmstream;
|
||||
|
||||
fail:
|
||||
close_vgmstream(vgmstream);
|
||||
return NULL;
|
||||
}
|
61
src/meta/xau_konami.c
Normal file
61
src/meta/xau_konami.c
Normal file
@ -0,0 +1,61 @@
|
||||
#include "meta.h"
|
||||
#include "../coding/coding.h"
|
||||
|
||||
/* XAU - from Konami games [Yu-Gi-Oh - The Dawn of Destiny (Xbox)] */
|
||||
VGMSTREAM * init_vgmstream_xau_konami(STREAMFILE *streamFile) {
|
||||
VGMSTREAM * vgmstream = NULL;
|
||||
off_t start_offset, header_offset;
|
||||
size_t stream_size;
|
||||
int loop_flag, channel_count, sample_rate;
|
||||
off_t loop_start, loop_end;
|
||||
|
||||
|
||||
/* checks */
|
||||
if ( !check_extensions(streamFile,"xau") )
|
||||
goto fail;
|
||||
if (read_32bitBE(0x00,streamFile) != 0x53465842) /* "SFXB" */
|
||||
goto fail;
|
||||
|
||||
//todo: subsongs used in sfx packs (rare)
|
||||
if (read_32bitLE(0x54,streamFile) != 1) /* subsong count */
|
||||
goto fail;
|
||||
|
||||
start_offset = 0x60 + read_32bitLE(0x34,streamFile);
|
||||
header_offset = 0x60 + 0x20 + 0x40*0; /* target subsong */
|
||||
VGM_LOG("ok=%lx\n",header_offset);
|
||||
|
||||
if (read_32bitBE(header_offset+0x00,streamFile) != 0x52494646) /* "RIFF" */
|
||||
goto fail;
|
||||
if (read_16bitLE(header_offset+0x14,streamFile) != 0x01) /* codec */
|
||||
goto fail;
|
||||
channel_count = read_16bitLE(header_offset+0x16,streamFile);
|
||||
sample_rate = read_32bitLE(header_offset+0x18,streamFile);
|
||||
loop_start = read_32bitLE(header_offset+030,streamFile);
|
||||
loop_end = read_32bitLE(header_offset+0x34,streamFile);
|
||||
loop_flag = (loop_end > 0);
|
||||
|
||||
stream_size = get_streamfile_size(streamFile) - start_offset;
|
||||
|
||||
|
||||
/* build the VGMSTREAM */
|
||||
vgmstream = allocate_vgmstream(channel_count,loop_flag);
|
||||
if (!vgmstream) goto fail;
|
||||
|
||||
vgmstream->meta_type = meta_XAU_KONAMI;
|
||||
vgmstream->sample_rate = sample_rate;
|
||||
vgmstream->num_samples = pcm_bytes_to_samples(stream_size,channel_count,16);
|
||||
vgmstream->loop_start_sample = pcm_bytes_to_samples(loop_start,channel_count,16);
|
||||
vgmstream->loop_end_sample = pcm_bytes_to_samples(loop_end,channel_count,16);
|
||||
|
||||
vgmstream->coding_type = coding_PCM16LE;
|
||||
vgmstream->layout_type = layout_interleave;
|
||||
vgmstream->interleave_block_size = 0x02;
|
||||
|
||||
if ( !vgmstream_open_stream(vgmstream, streamFile, start_offset) )
|
||||
goto fail;
|
||||
return vgmstream;
|
||||
|
||||
fail:
|
||||
close_vgmstream(vgmstream);
|
||||
return NULL;
|
||||
}
|
@ -408,7 +408,7 @@ VGMSTREAM * (*init_vgmstream_functions[])(STREAMFILE *streamFile) = {
|
||||
init_vgmstream_opus_ppp,
|
||||
init_vgmstream_ubi_bao_pk,
|
||||
init_vgmstream_dsp_switch_audio,
|
||||
init_vgmstream_dsp_sadf,
|
||||
init_vgmstream_sadf,
|
||||
init_vgmstream_h4m,
|
||||
init_vgmstream_ps2_ads_container,
|
||||
init_vgmstream_asf,
|
||||
@ -422,8 +422,27 @@ VGMSTREAM * (*init_vgmstream_functions[])(STREAMFILE *streamFile) = {
|
||||
init_vgmstream_bnk_sony,
|
||||
init_vgmstream_nus3bank,
|
||||
init_vgmstream_scd_sscf,
|
||||
init_vgmstream_dsp_vag,
|
||||
init_vgmstream_dsp_itl_ch,
|
||||
|
||||
/* lowest priority metas (TXTH should go before raw formats) */
|
||||
init_vgmstream_a2m,
|
||||
init_vgmstream_ahv,
|
||||
init_vgmstream_msv,
|
||||
init_vgmstream_sdf_ps2,
|
||||
init_vgmstream_svg,
|
||||
init_vgmstream_vis,
|
||||
|
||||
init_vgmstream_sdf_3ds,
|
||||
init_vgmstream_vai,
|
||||
|
||||
init_vgmstream_aif_asobo,
|
||||
init_vgmstream_ao,
|
||||
init_vgmstream_apc,
|
||||
init_vgmstream_wv2,
|
||||
init_vgmstream_xau_konami,
|
||||
|
||||
|
||||
/* lowest priority metas (should go after all metas, and TXTH should go before raw formats) */
|
||||
init_vgmstream_txth, /* proper parsers should supersede TXTH, once added */
|
||||
init_vgmstream_ps2_int, /* .int raw PS-ADPCM */
|
||||
init_vgmstream_ps_headerless, /* tries to detect a bunch of PS-ADPCM formats */
|
||||
|
@ -691,6 +691,24 @@ typedef enum {
|
||||
meta_HD3_BD3, /* Sony PS3 bank */
|
||||
meta_BNK_SONY, /* Sony Scream Tool bank */
|
||||
meta_SCD_SSCF, /* Square Enix SCD old version */
|
||||
meta_DSP_VAG, /* Penny-Punching Princess (Switch) sfx */
|
||||
meta_DSP_ITL, /* Charinko Hero (GC) */
|
||||
|
||||
meta_A2M, /* Scooby-Doo! Unmasked (PS2) */
|
||||
meta_AHV, /* Headhunter (PS2) */
|
||||
meta_MSV, /* Fight Club (PS2) */
|
||||
meta_SDF_PS2, /* Agent Hugo - Lemoon Twist (PS2) */
|
||||
meta_SVG, /* Hunter - The Reckoning - Wayward (PS2) */
|
||||
meta_VIS, /* AirForce Delta Strike (PS2) */
|
||||
|
||||
meta_VAI, /* Ratatouille (GC) */
|
||||
meta_SDF_3DS, /* Gummy Bears Mini Golf (3DS) */
|
||||
|
||||
meta_AIF_ASOBO, /* Ratatouille (PC) */
|
||||
meta_AO, /* Cloudphobia (PC) */
|
||||
meta_APC, /* MegaRace 3 (PC) */
|
||||
meta_WV2, /* Slave Zero (PC) */
|
||||
meta_XAU_KONAMI, /* Yu-Gi-Oh - The Dawn of Destiny (Xbox) */
|
||||
|
||||
} meta_t;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user