Merge pull request #134 from bxaimc/master

Added AST (ASTL) variant for Dead Rising (PC)
This commit is contained in:
Christopher Snowhill 2017-10-28 18:21:59 -07:00 committed by GitHub
commit 37697d95f5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 57 additions and 0 deletions

View File

@ -894,6 +894,7 @@ static const meta_info meta_info_list[] = {
{meta_AWC, "Rockstar AWC header"},
{meta_NSW_OPUS, ".OPUS header"},
{meta_PC_AL2, "Illwinter Game Design AL2 raw header"},
{meta_PC_AST, "Capcom AST header"},
#ifdef VGM_USE_VORBIS
{meta_OGG_VORBIS, "Ogg Vorbis"},

View File

@ -661,6 +661,10 @@
<File
RelativePath=".\meta\pc_al2.c"
>
</File>
<File
RelativePath=".\meta\pc_ast.c"
>
</File>
<File
RelativePath=".\meta\pc_mxst.c"

View File

@ -160,6 +160,7 @@
<ClCompile Include="meta\nsw_opus.c" />
<ClCompile Include="meta\nub_vag.c" />
<ClCompile Include="meta\pc_adp.c" />
<ClCompile Include="meta\pc_ast.c" />
<ClCompile Include="meta\pc_snds.c" />
<ClCompile Include="meta\ps2_2pfs.c" />
<ClCompile Include="meta\ps2_hsf.c" />

View File

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

View File

@ -686,4 +686,6 @@ VGMSTREAM * init_vgmstream_nsw_opus(STREAMFILE * streamFile);
VGMSTREAM * init_vgmstream_pc_al2(STREAMFILE * streamFile);
VGMSTREAM * init_vgmstream_pc_ast(STREAMFILE * streamFile);
#endif /*_META_H*/

44
src/meta/pc_ast.c Normal file
View File

@ -0,0 +1,44 @@
#include "meta.h"
#include "../coding/coding.h"
/* ASTL - found in Dead Rising (PC) */
VGMSTREAM * init_vgmstream_pc_ast(STREAMFILE *streamFile) {
VGMSTREAM * vgmstream = NULL;
off_t start_offset, data_size;
int loop_flag, channel_count;
/* check extension, case insensitive */
if ( !check_extensions(streamFile,"ast"))
goto fail;
if (read_32bitBE(0x00,streamFile) != 0x4153544C) /* "ASTL" */
goto fail;
loop_flag = 0; //TODO - Find hidden loop point calc and flag
channel_count = read_8bit(0x32, streamFile);
data_size = read_32bitLE(0x20,streamFile);
/* build the VGMSTREAM */
vgmstream = allocate_vgmstream(channel_count,loop_flag);
if (!vgmstream) goto fail;
/* TODO - Find non-obvious loop points and flag (if any) */
start_offset = read_32bitLE(0x10,streamFile);
vgmstream->sample_rate = read_32bitLE(0x34,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_PC_AST;
/* 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

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

View File

@ -629,6 +629,7 @@ typedef enum {
meta_AWC, /* Rockstar AWC (GTA5, RDR) */
meta_NSW_OPUS, /* Lego City Undercover (Switch) */
meta_PC_AL2, /* Conquest of Elysium 3 (PC) */
meta_PC_AST, /* Dead Rising (PC) */
#ifdef VGM_USE_VORBIS
meta_OGG_VORBIS, /* Ogg Vorbis */