Add EZW for EZ2DJ (Arcade)

This commit is contained in:
bxaimc 2017-11-21 21:30:48 -05:00
parent bf41d53690
commit ed36ae44a3
8 changed files with 55 additions and 0 deletions

View File

@ -104,6 +104,7 @@ static const char* extension_list[] = {
"emff",
"enth",
"exa",
"ezw",
"fag",
"ffw",
@ -900,6 +901,7 @@ static const meta_info meta_info_list[] = {
{meta_PC_AL2, "Illwinter Game Design AL2 raw header"},
{meta_PC_AST, "Capcom AST (PC) header"},
{meta_UBI_SB, "Ubisoft SBx header"},
{meta_EZW, "EZ2DJ EZWAVE header"},
#ifdef VGM_USE_VORBIS
{meta_OGG_VORBIS, "Ogg Vorbis"},

View File

@ -372,6 +372,10 @@
RelativePath=".\meta\excitebots.c"
>
</File>
<File
RelativePath=".\meta\ezw.c"
>
</File>
<File
RelativePath=".\meta\ffmpeg.c"
>

View File

@ -150,6 +150,7 @@
<ClCompile Include="meta\bfstm.c" />
<ClCompile Include="meta\bfwav.c" />
<ClCompile Include="meta\excitebots.c" />
<ClCompile Include="meta\ezw.c" />
<ClCompile Include="meta\ffmpeg.c" />
<ClCompile Include="meta\g1l.c" />
<ClCompile Include="meta\ios_psnd.c" />

View File

@ -1198,5 +1198,8 @@
<ClCompile Include="meta\pc_ast.c">
<Filter>meta\Source Files</Filter>
</ClCompile>
<ClCompile Include="meta\ezw.c">
<Filter>meta\Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>

41
src/meta/ezw.c Normal file
View File

@ -0,0 +1,41 @@
#include "meta.h"
#include "../coding/coding.h"
/* EZWAVE - EZ2DJ (Arcade) */
VGMSTREAM * init_vgmstream_ezw(STREAMFILE *streamFile) {
VGMSTREAM * vgmstream = NULL;
off_t start_offset, data_size;
int loop_flag, channel_count;
/* check extension, case insensitive */
if ( !check_extensions(streamFile,"ezw"))
goto fail;
loop_flag = 0;
channel_count = read_8bit(0x0, streamFile);
data_size = read_32bitLE(0xE,streamFile);
/* build the VGMSTREAM */
vgmstream = allocate_vgmstream(channel_count,loop_flag);
if (!vgmstream) goto fail;
start_offset = 0x12;
vgmstream->sample_rate = read_32bitLE(0x2,streamFile);
vgmstream->coding_type = coding_PCM16LE;
vgmstream->num_samples = data_size/(channel_count*2);
vgmstream->layout_type = layout_interleave;
vgmstream->interleave_block_size = 0x2;
vgmstream->meta_type = meta_EZW;
/* open the file for reading */
if ( !vgmstream_open_stream(vgmstream, streamFile, start_offset) )
goto fail;
return vgmstream;
fail:
close_vgmstream(vgmstream);
return NULL;
}

View File

@ -689,4 +689,6 @@ VGMSTREAM * init_vgmstream_pc_ast(STREAMFILE * streamFile);
VGMSTREAM * init_vgmstream_ubi_sb(STREAMFILE * streamFile);
VGMSTREAM * init_vgmstream_ezw(STREAMFILE * streamFile);
#endif /*_META_H*/

View File

@ -369,6 +369,7 @@ VGMSTREAM * (*init_vgmstream_fcns[])(STREAMFILE *streamFile) = {
init_vgmstream_pc_al2,
init_vgmstream_pc_ast,
init_vgmstream_ubi_sb,
init_vgmstream_ezw,
init_vgmstream_txth, /* should go at the end (lower priority) */
#ifdef VGM_USE_FFMPEG

View File

@ -628,6 +628,7 @@ typedef enum {
meta_PC_AL2, /* Conquest of Elysium 3 (PC) */
meta_PC_AST, /* Dead Rising (PC) */
meta_UBI_SB, /* Ubisoft banks */
meta_EZW, /* EZ2DJ (Arcade) EZWAV */
#ifdef VGM_USE_VORBIS
meta_OGG_VORBIS, /* Ogg Vorbis */