mirror of
https://github.com/vgmstream/vgmstream.git
synced 2024-11-24 06:50:20 +01:00
added new musx format
gca added (Metal SLug Anthology) git-svn-id: https://vgmstream.svn.sourceforge.net/svnroot/vgmstream@491 51a99a44-fe44-0410-b1ba-c3e57ba2b86b
This commit is contained in:
parent
641d7afaa0
commit
c11656570c
@ -148,7 +148,8 @@ META_OBJS=meta/adx_header.o \
|
||||
meta/ngc_waa_wac_wad_wam.o \
|
||||
meta/ps2_seg.o \
|
||||
meta/str_asr.o \
|
||||
meta/zwdsp.o
|
||||
meta/zwdsp.o \
|
||||
meta/gca.o
|
||||
|
||||
OBJECTS=vgmstream.o streamfile.o util.o $(CODING_OBJS) $(LAYOUT_OBJS) $(META_OBJS)
|
||||
|
||||
|
@ -271,6 +271,10 @@
|
||||
RelativePath=".\meta\fsb.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\meta\gca.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\meta\gcsw.c"
|
||||
>
|
||||
|
@ -117,4 +117,5 @@ libmeta_la_SOURCES += ngc_waa_wac_wad_wam.c
|
||||
libmeta_la_SOURCES += ps2_seg.c
|
||||
libmeta_la_SOURCES += str_asr.c
|
||||
libmeta_la_SOURCES += zwdsp.c
|
||||
libmeta_la_SOURCES += gca.c
|
||||
EXTRA_DIST = meta.h
|
||||
|
@ -139,6 +139,7 @@ VGMSTREAM * init_vgmstream_fsb3(STREAMFILE *streamFile) {
|
||||
case 0x41008800: /* PS2 (Flat Out) */
|
||||
case 0x42008800: /* PS2 (Jackass - The Game) */
|
||||
case 0x01008804: /* PS2 (Cold Fear) */
|
||||
case 0x02008804: /* PS2 (Shrek - Smash 'n Crash */
|
||||
vgmstream->coding_type = coding_PSX;
|
||||
vgmstream->layout_type = layout_interleave;
|
||||
vgmstream->interleave_block_size = 0x10;
|
||||
|
74
src/meta/gca.c
Normal file
74
src/meta/gca.c
Normal file
@ -0,0 +1,74 @@
|
||||
#include "meta.h"
|
||||
#include "../util.h"
|
||||
|
||||
/* GCA (from Metal Slug Anthology [Wii]) */
|
||||
VGMSTREAM * init_vgmstream_gca(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("gca",filename_extension(filename))) goto fail;
|
||||
|
||||
/* check header */
|
||||
if (read_32bitBE(0x00,streamFile) != 0x47434131) /* "GCA1" */
|
||||
goto fail;
|
||||
|
||||
loop_flag = 0;
|
||||
channel_count = 1;
|
||||
|
||||
/* build the VGMSTREAM */
|
||||
vgmstream = allocate_vgmstream(channel_count,loop_flag);
|
||||
if (!vgmstream) goto fail;
|
||||
|
||||
/* fill in the vital statistics */
|
||||
start_offset = 0x40;
|
||||
vgmstream->channels = channel_count;
|
||||
vgmstream->sample_rate = read_32bitBE(0x2A,streamFile);
|
||||
vgmstream->coding_type = coding_NGC_DSP;
|
||||
vgmstream->num_samples = read_32bitBE(0x26,streamFile)*7/8;
|
||||
if (loop_flag) {
|
||||
vgmstream->loop_start_sample = 0;
|
||||
vgmstream->loop_end_sample = read_32bitBE(0x26,streamFile)*7/8;
|
||||
}
|
||||
|
||||
/* We have no interleave, so we have no layout */
|
||||
vgmstream->layout_type = layout_none;
|
||||
vgmstream->meta_type = meta_GCA;
|
||||
|
||||
/* 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;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/*Retrieving the coef table */
|
||||
{
|
||||
int i;
|
||||
for (i=0;i<16;i++) {
|
||||
vgmstream->ch[0].adpcm_coef[i] = read_16bitBE(0x04+i*2,streamFile);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return vgmstream;
|
||||
|
||||
/* clean up anything we may have opened */
|
||||
fail:
|
||||
if (vgmstream) close_vgmstream(vgmstream);
|
||||
return NULL;
|
||||
}
|
@ -285,4 +285,6 @@ VGMSTREAM * init_vgmstream_str_asr(STREAMFILE * streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_zwdsp(STREAMFILE * streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_gca(STREAMFILE * streamFile);
|
||||
|
||||
#endif
|
||||
|
@ -285,6 +285,9 @@ VGMSTREAM * init_vgmstream_musx_v201(STREAMFILE *streamFile) {
|
||||
loop_detect = read_32bitBE(0x800,streamFile);
|
||||
|
||||
switch (loop_detect) {
|
||||
case 0x02000000:
|
||||
loop_offsets = 0x8E0;
|
||||
break;
|
||||
case 0x03000000:
|
||||
loop_offsets = 0x880;
|
||||
break;
|
||||
|
@ -159,6 +159,7 @@ VGMSTREAM * (*init_vgmstream_fcns[])(STREAMFILE *streamFile) = {
|
||||
init_vgmstream_nds_strm_ffta2,
|
||||
init_vgmstream_str_asr,
|
||||
init_vgmstream_zwdsp,
|
||||
init_vgmstream_gca,
|
||||
};
|
||||
|
||||
#define INIT_VGMSTREAM_FCNS (sizeof(init_vgmstream_fcns)/sizeof(init_vgmstream_fcns[0]))
|
||||
@ -1835,6 +1836,9 @@ void describe_vgmstream(VGMSTREAM * vgmstream, char * desc, int length) {
|
||||
break;
|
||||
case meta_ZWDSP:
|
||||
snprintf(temp,TEMPSIZE,"Zack and Wiki custom DSP Header");
|
||||
break;
|
||||
case meta_GCA:
|
||||
snprintf(temp,TEMPSIZE,"GCA DSP Header");
|
||||
break;
|
||||
default:
|
||||
snprintf(temp,TEMPSIZE,"THEY SHOULD HAVE SENT A POET");
|
||||
|
@ -246,6 +246,7 @@ typedef enum {
|
||||
|
||||
meta_IDSP2, /* Chronicles of Narnia */
|
||||
meta_WAA_WAC_WAD_WAM, /* Beyond Good & Evil */
|
||||
meta_GCA, /* Metal Slug Anthology */
|
||||
|
||||
meta_NGC_YMF, /* WWE WrestleMania X8 */
|
||||
meta_SADL, /* .sad */
|
||||
|
@ -202,6 +202,7 @@ char * extension_list[] = {
|
||||
"seg\0SEG Audio File (*.SEG)\0",
|
||||
"asr\0ASR Audio File (*.ASR)\0",
|
||||
"zwdsp\0ZWDSP Audio File (*.ZWDSP)\0",
|
||||
"gca\0GCA Audio File (*.GCA)\0",
|
||||
};
|
||||
|
||||
void about(HWND hwndParent) {
|
||||
|
Loading…
Reference in New Issue
Block a user