mirror of
https://github.com/vgmstream/vgmstream.git
synced 2024-11-14 18:47:39 +01:00
Add .diva [Hatsune Miku: Project DIVA Arcade Future Tone (AC)]
This commit is contained in:
parent
14dc85664d
commit
55072211cb
@ -145,6 +145,7 @@ static const char* extension_list[] = {
|
||||
"ddsp",
|
||||
"de2",
|
||||
"dec",
|
||||
"diva",
|
||||
"dmsg",
|
||||
"ds2", //txth/reserved [Star Wars Bounty Hunter (GC)]
|
||||
"dsf",
|
||||
@ -1285,6 +1286,7 @@ static const meta_info meta_info_list[] = {
|
||||
{meta_KWB, "Koei Tecmo WaveBank header"},
|
||||
{meta_LRMD, "Sony LRMD header"},
|
||||
{meta_WWISE_FX, "Audiokinetic Wwise FX header"},
|
||||
{meta_DIVA, "DIVA header"},
|
||||
|
||||
};
|
||||
|
||||
|
@ -301,6 +301,7 @@
|
||||
<ClCompile Include="meta\dc_str.c" />
|
||||
<ClCompile Include="meta\dec.c" />
|
||||
<ClCompile Include="meta\derf.c" />
|
||||
<ClCompile Include="meta\diva.c" />
|
||||
<ClCompile Include="meta\dmsg_segh.c" />
|
||||
<ClCompile Include="meta\dsf.c" />
|
||||
<ClCompile Include="meta\dsp_adx.c" />
|
||||
|
@ -1747,5 +1747,8 @@
|
||||
<ClCompile Include="meta\tgc.c">
|
||||
<Filter>meta\Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="meta\diva.c">
|
||||
<Filter>meta\Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
38
src/meta/diva.c
Normal file
38
src/meta/diva.c
Normal file
@ -0,0 +1,38 @@
|
||||
#include "meta.h"
|
||||
#include "../coding/coding.h"
|
||||
|
||||
/* DIVA - Hatsune Miku: Project DIVA Arcade */
|
||||
VGMSTREAM * init_vgmstream_diva(STREAMFILE *streamFile) {
|
||||
VGMSTREAM * vgmstream = NULL;
|
||||
off_t start_offset;
|
||||
int channel_count, loop_flag = 0;
|
||||
|
||||
/* checks */
|
||||
if (!check_extensions(streamFile, "diva"))
|
||||
goto fail;
|
||||
|
||||
if (read_32bitBE(0x00, streamFile) != 0x44495641) /* "DIVA" */
|
||||
goto fail;
|
||||
|
||||
start_offset = 0x40;
|
||||
channel_count = read_8bit(0x1C, streamFile);
|
||||
|
||||
/* build the VGMSTREAM */
|
||||
vgmstream = allocate_vgmstream(channel_count, loop_flag);
|
||||
if (!vgmstream) goto fail;
|
||||
|
||||
vgmstream->sample_rate = read_32bitLE(0x0C, streamFile);
|
||||
vgmstream->num_samples = read_32bitLE(0x10, streamFile);
|
||||
vgmstream->meta_type = meta_DIVA;
|
||||
vgmstream->layout_type = layout_none;
|
||||
vgmstream->coding_type = coding_DVI_IMA;
|
||||
|
||||
if (!vgmstream_open_stream(vgmstream, streamFile, start_offset))
|
||||
goto fail;
|
||||
|
||||
return vgmstream;
|
||||
|
||||
fail:
|
||||
close_vgmstream(vgmstream);
|
||||
return NULL;
|
||||
}
|
@ -893,4 +893,6 @@ VGMSTREAM* init_vgmstream_bkhd_fx(STREAMFILE* sf);
|
||||
|
||||
VGMSTREAM* init_vgmstream_encrypted(STREAMFILE* sf);
|
||||
|
||||
VGMSTREAM* init_vgmstream_diva(STREAMFILE* sf);
|
||||
|
||||
#endif /*_META_H*/
|
||||
|
@ -492,6 +492,7 @@ VGMSTREAM * (*init_vgmstream_functions[])(STREAMFILE *streamFile) = {
|
||||
init_vgmstream_lrmd,
|
||||
init_vgmstream_bkhd,
|
||||
init_vgmstream_bkhd_fx,
|
||||
init_vgmstream_diva,
|
||||
|
||||
/* 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 */
|
||||
|
@ -726,6 +726,7 @@ typedef enum {
|
||||
meta_KWB,
|
||||
meta_LRMD,
|
||||
meta_WWISE_FX,
|
||||
meta_DIVA,
|
||||
} meta_t;
|
||||
|
||||
/* standard WAVEFORMATEXTENSIBLE speaker positions */
|
||||
|
Loading…
Reference in New Issue
Block a user