mirror of
https://github.com/vgmstream/vgmstream.git
synced 2024-11-28 00:20:47 +01:00
add Mattel Hyperscan format
git-svn-id: https://vgmstream.svn.sourceforge.net/svnroot/vgmstream@923 51a99a44-fe44-0410-b1ba-c3e57ba2b86b
This commit is contained in:
parent
8489991ec9
commit
f514642b76
@ -274,7 +274,8 @@ META_OBJS=meta/adx_header.o \
|
||||
meta/lsf.o \
|
||||
meta/ps3_vawx.o \
|
||||
meta/pc_snds.o \
|
||||
meta/ps2_wmus.o
|
||||
meta/ps2_wmus.o \
|
||||
meta/mattel_hyperscan.o
|
||||
|
||||
OBJECTS=vgmstream.o streamfile.o util.o $(CODING_OBJS) $(LAYOUT_OBJS) $(META_OBJS)
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="9.00"
|
||||
Version="9,00"
|
||||
Name="libvgmstream"
|
||||
ProjectGUID="{54A6AD11-5369-4895-A06F-E255ABB99B11}"
|
||||
RootNamespace="libvgmstream"
|
||||
@ -380,6 +380,10 @@
|
||||
RelativePath=".\meta\lsf.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\meta\mattel_hyperscan.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\meta\maxis_xa.c"
|
||||
>
|
||||
|
@ -222,5 +222,6 @@ libmeta_la_SOURCES += lsf.c
|
||||
libmeta_la_SOURCES += ps3_vawx.c
|
||||
libmeta_la_SOURCES += pc_snds.c
|
||||
libmeta_la_SOURCES += ps2_wmus.c
|
||||
libmeta_la_SOURCES += mattel_hyperscan.c
|
||||
|
||||
EXTRA_DIST = meta.h
|
||||
|
66
src/meta/mattel_hyperscan.c
Normal file
66
src/meta/mattel_hyperscan.c
Normal file
@ -0,0 +1,66 @@
|
||||
#include "meta.h"
|
||||
#include "../util.h"
|
||||
|
||||
/* Mattel Hyperscan,
|
||||
- Place all metas for this console here (there are just 5 games) */
|
||||
VGMSTREAM * init_vgmstream_hyperscan_kvag(STREAMFILE *streamFile) {
|
||||
VGMSTREAM * vgmstream = NULL;
|
||||
char filename[260];
|
||||
off_t start_offset;
|
||||
int loop_flag = 0;
|
||||
int channel_count;
|
||||
|
||||
/* check extension, case insensitive */
|
||||
streamFile->get_name(streamFile,filename,sizeof(filename));
|
||||
if (strcasecmp("bvg",filename_extension(filename))) goto fail;
|
||||
|
||||
/* check header */
|
||||
if (read_32bitBE(0x00,streamFile) != 0x4B564147) /* "KVAG" */
|
||||
goto fail;
|
||||
|
||||
channel_count = 1;
|
||||
|
||||
/* build the VGMSTREAM */
|
||||
vgmstream = allocate_vgmstream(channel_count,loop_flag);
|
||||
if (!vgmstream) goto fail;
|
||||
|
||||
/* fill in the vital statistics */
|
||||
start_offset = 0xE;
|
||||
vgmstream->channels = channel_count;
|
||||
vgmstream->sample_rate = read_32bitLE(0x8,streamFile);
|
||||
vgmstream->coding_type = coding_DVI_IMA;
|
||||
vgmstream->num_samples = read_32bitLE(0x4,streamFile)*2;
|
||||
|
||||
#if 0
|
||||
if (loop_flag) {
|
||||
vgmstream->loop_start_sample = (read_32bitLE(0x08,streamFile)-1)*28;
|
||||
vgmstream->loop_end_sample = (read_32bitLE(0x0c,streamFile)-1)*28;
|
||||
}
|
||||
#endif
|
||||
|
||||
vgmstream->layout_type = layout_none;
|
||||
vgmstream->meta_type = meta_HYPERSCAN_KVAG;
|
||||
|
||||
/* open the file for reading */
|
||||
{
|
||||
int i;
|
||||
STREAMFILE * file;
|
||||
file = streamFile->open(streamFile,filename,STREAMFILE_DEFAULT_BUFFER_SIZE);
|
||||
if (!file) goto fail;
|
||||
for (i=0;i<channel_count;i++) {
|
||||
vgmstream->ch[i].streamfile = file;
|
||||
|
||||
vgmstream->ch[i].channel_start_offset=
|
||||
vgmstream->ch[i].offset=start_offset+
|
||||
vgmstream->interleave_block_size*i;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return vgmstream;
|
||||
|
||||
/* clean up anything we may have opened */
|
||||
fail:
|
||||
if (vgmstream) close_vgmstream(vgmstream);
|
||||
return NULL;
|
||||
}
|
@ -561,4 +561,6 @@ VGMSTREAM * init_vgmstream_pc_snds(STREAMFILE* streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_ps2_wmus(STREAMFILE* streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_hyperscan_kvag(STREAMFILE* streamFile);
|
||||
|
||||
#endif
|
||||
|
@ -302,6 +302,7 @@ VGMSTREAM * (*init_vgmstream_fcns[])(STREAMFILE *streamFile) = {
|
||||
init_vgmstream_ps3_vawx,
|
||||
init_vgmstream_pc_snds,
|
||||
init_vgmstream_ps2_wmus,
|
||||
init_vgmstream_hyperscan_kvag,
|
||||
};
|
||||
|
||||
#define INIT_VGMSTREAM_FCNS (sizeof(init_vgmstream_fcns)/sizeof(init_vgmstream_fcns[0]))
|
||||
@ -2806,6 +2807,9 @@ void describe_vgmstream(VGMSTREAM * vgmstream, char * desc, int length) {
|
||||
break;
|
||||
case meta_PS2_WMUS:
|
||||
snprintf(temp,TEMPSIZE,"assumed The Warriors Sony ADPCM by .wmus extension");
|
||||
break;
|
||||
case meta_HYPERSCAN_KVAG:
|
||||
snprintf(temp,TEMPSIZE,"Mattel Hyperscan KVAG");
|
||||
break;
|
||||
default:
|
||||
snprintf(temp,TEMPSIZE,"THEY SHOULD HAVE SENT A POET");
|
||||
|
@ -515,6 +515,7 @@ typedef enum {
|
||||
meta_PS3_VAWX, // No More Heroes: Heroes Paradise (PS3)
|
||||
meta_PC_SNDS, // Incredibles PC .snds
|
||||
meta_PS2_WMUS, // The Warriors (PS2)
|
||||
meta_HYPERSCAN_KVAG, // Hyperscan KVAG/BVG
|
||||
} meta_t;
|
||||
|
||||
typedef struct {
|
||||
|
@ -114,6 +114,7 @@ char * extension_list[] = {
|
||||
"bnsf\0BNSF Audio File (*.BNSF)\0",
|
||||
"bo2\0BO2 Audio File (*.BO2)\0",
|
||||
"brstm;brstmspm\0BRSTM Audio File (*.BRSTM)\0",
|
||||
"bvg\0BVG Audio File (*.BVG)\0",
|
||||
|
||||
"caf\0CAF Audio File (*.CAF)\0",
|
||||
"capdsp\0CAPDSP Audio File (*.CAPDSP)\0", /* Capcom custom coefs */
|
||||
|
Loading…
Reference in New Issue
Block a user