Merge pull request #143 from bxaimc/master

Add EZW for EZ2DJ (Arcade)
This commit is contained in:
Christopher Snowhill 2017-11-25 17:36:31 -08:00 committed by GitHub
commit d84dd0369f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 55 additions and 0 deletions

View File

@ -105,6 +105,7 @@ static const char* extension_list[] = {
"emff",
"enth",
"exa",
"ezw",
"fag",
"ffw",
@ -906,6 +907,7 @@ static const meta_info meta_info_list[] = {
{meta_PC_AST, "Capcom AST (PC) header"},
{meta_UBI_SB, "Ubisoft SBx header"},
{meta_NAAC, "Namco NAAC 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

@ -1201,5 +1201,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

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

View File

@ -365,6 +365,7 @@ VGMSTREAM * (*init_vgmstream_functions[])(STREAMFILE *streamFile) = {
init_vgmstream_pc_ast,
init_vgmstream_naac,
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_AST, /* Dead Rising (PC) */
meta_NAAC, /* Namco AAC (3DS) */
meta_UBI_SB, /* Ubisoft banks */
meta_EZW, /* EZ2DJ (Arcade) EZWAV */
#ifdef VGM_USE_VORBIS
meta_OGG_VORBIS, /* Ogg Vorbis */