Added support for "DAT8" MUSX from GoldenEye 007 (Wii)

Added support for NGCA files found in MUSX "containers" from GoldenEye 007 (Wii)

git-svn-id: https://vgmstream.svn.sourceforge.net/svnroot/vgmstream@877 51a99a44-fe44-0410-b1ba-c3e57ba2b86b
This commit is contained in:
bxaimc 2010-11-09 04:21:22 +00:00
parent bb6ed86d98
commit 4588ff77b7
11 changed files with 89 additions and 2 deletions

View File

@ -379,6 +379,7 @@ bool input_vgmstream::g_is_our_path(const char * p_path,const char * p_extension
if(!stricmp_utf8(p_extension,"myspd")) return 1; if(!stricmp_utf8(p_extension,"myspd")) return 1;
if(!stricmp_utf8(p_extension,"ndp")) return 1; if(!stricmp_utf8(p_extension,"ndp")) return 1;
if(!stricmp_utf8(p_extension,"ngca")) return 1;
if(!stricmp_utf8(p_extension,"npsf")) return 1; if(!stricmp_utf8(p_extension,"npsf")) return 1;
if(!stricmp_utf8(p_extension,"nwa")) return 1; if(!stricmp_utf8(p_extension,"nwa")) return 1;
@ -671,6 +672,7 @@ DECLARE_MULTIPLE_FILE_TYPE("MxSt Audio File (*.MxSt)", mxst);
DECLARE_MULTIPLE_FILE_TYPE("MYSPD Audio File (*.MYSPD)", myspd); DECLARE_MULTIPLE_FILE_TYPE("MYSPD Audio File (*.MYSPD)", myspd);
DECLARE_MULTIPLE_FILE_TYPE("NDP Audio File (*.NDP)", ndp); DECLARE_MULTIPLE_FILE_TYPE("NDP Audio File (*.NDP)", ndp);
DECLARE_MULTIPLE_FILE_TYPE("NGCA Audio File (*.NGCA)", ngca);
DECLARE_MULTIPLE_FILE_TYPE("PS2 NPSF Audio File (*.NPSF)", npsf); DECLARE_MULTIPLE_FILE_TYPE("PS2 NPSF Audio File (*.NPSF)", npsf);
DECLARE_MULTIPLE_FILE_TYPE("NWA Audio File (*.NWA)", nwa); DECLARE_MULTIPLE_FILE_TYPE("NWA Audio File (*.NWA)", nwa);

View File

@ -259,7 +259,8 @@ META_OBJS=meta/adx_header.o \
meta/ps3_msf.o \ meta/ps3_msf.o \
meta/nub.o \ meta/nub.o \
meta/ps3_past.o \ meta/ps3_past.o \
meta/ps3_sgh_sgb.o meta/ps3_sgh_sgb.o \
meta/ngca.o
OBJECTS=vgmstream.o streamfile.o util.o $(CODING_OBJS) $(LAYOUT_OBJS) $(META_OBJS) OBJECTS=vgmstream.o streamfile.o util.o $(CODING_OBJS) $(LAYOUT_OBJS) $(META_OBJS)

View File

@ -522,6 +522,10 @@
RelativePath=".\meta\ngc_ymf.c" RelativePath=".\meta\ngc_ymf.c"
> >
</File> </File>
<File
RelativePath=".\meta\ngca.c"
>
</File>
<File <File
RelativePath=".\meta\nub.c" RelativePath=".\meta\nub.c"
> >

View File

@ -212,5 +212,6 @@ libmeta_la_SOURCES += ps3_msf.c
libmeta_la_SOURCES += nub.c libmeta_la_SOURCES += nub.c
libmeta_la_SOURCES += ps3_past.c libmeta_la_SOURCES += ps3_past.c
libmeta_la_SOURCES += ps3_sgh_sgb.c libmeta_la_SOURCES += ps3_sgh_sgb.c
libmeta_la_SOURCES += ngca.c
EXTRA_DIST = meta.h EXTRA_DIST = meta.h

View File

@ -539,5 +539,7 @@ VGMSTREAM * init_vgmstream_ps3_past(STREAMFILE* streamFile);
VGMSTREAM * init_vgmstream_ps3_sgh_sgb(STREAMFILE* streamFile); VGMSTREAM * init_vgmstream_ps3_sgh_sgb(STREAMFILE* streamFile);
VGMSTREAM * init_vgmstream_ngca(STREAMFILE* streamFile);
#endif #endif

View File

@ -294,7 +294,8 @@ VGMSTREAM * init_vgmstream_musx_v010(STREAMFILE *streamFile) {
musx_type=(read_32bitBE(0x10,streamFile)); musx_type=(read_32bitBE(0x10,streamFile));
if (musx_type == 0x5749495F && /* WII_ */ if (musx_type == 0x5749495F && /* WII_ */
read_32bitBE(0x40,streamFile) == 0x44415434) /* DAT4 */ (read_16bitBE(0x40,streamFile) == 0x4441) && /* DA */
(read_8bit(0x42,streamFile) == 0x54)) /* T */
{ {
channel_count = read_32bitLE(0x48,streamFile); channel_count = read_32bitLE(0x48,streamFile);
loop_flag = (read_32bitLE(0x64,streamFile) != -1); loop_flag = (read_32bitLE(0x64,streamFile) != -1);
@ -347,6 +348,7 @@ VGMSTREAM * init_vgmstream_musx_v010(STREAMFILE *streamFile) {
switch (read_32bitBE(0x40,streamFile)) switch (read_32bitBE(0x40,streamFile))
{ {
case 0x44415434: /* DAT4 */ case 0x44415434: /* DAT4 */
case 0x44415438: /* DAT8 */
vgmstream->coding_type = coding_DAT4_IMA; vgmstream->coding_type = coding_DAT4_IMA;
break; break;
default: default:

67
src/meta/ngca.c Normal file
View File

@ -0,0 +1,67 @@
#include "meta.h"
#include "../util.h"
/* NGCA (from GoldenEye 007) */
VGMSTREAM * init_vgmstream_ngca(STREAMFILE *streamFile) {
VGMSTREAM * vgmstream = NULL;
char filename[260];
off_t start_offset;
int loop_flag;
int channel_count;
/* check extension, case insensitive */
streamFile->get_name(streamFile,filename,sizeof(filename));
if (strcasecmp("ngca",filename_extension(filename))) goto fail;
/* check header */
if (read_32bitBE(0x00,streamFile) != 0x4E474341) /* "NGCA" */
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 = 32000;
vgmstream->coding_type = coding_NGC_DSP;
vgmstream->num_samples = (((read_32bitBE(0x4,streamFile))/2) - 1) / 8 * 14;
vgmstream->layout_type = layout_none;
vgmstream->meta_type = meta_NGCA;
if (vgmstream->coding_type == coding_NGC_DSP) {
int i;
for (i=0;i<16;i++) {
vgmstream->ch[0].adpcm_coef[i] = read_16bitBE(0xC+i*2,streamFile);
}
}
/* 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;
}

View File

@ -291,6 +291,7 @@ VGMSTREAM * (*init_vgmstream_fcns[])(STREAMFILE *streamFile) = {
init_vgmstream_nub_vag, init_vgmstream_nub_vag,
init_vgmstream_ps3_past, init_vgmstream_ps3_past,
init_vgmstream_ps3_sgh_sgb, init_vgmstream_ps3_sgh_sgb,
init_vgmstream_ngca,
}; };
#define INIT_VGMSTREAM_FCNS (sizeof(init_vgmstream_fcns)/sizeof(init_vgmstream_fcns[0])) #define INIT_VGMSTREAM_FCNS (sizeof(init_vgmstream_fcns)/sizeof(init_vgmstream_fcns[0]))
@ -326,6 +327,7 @@ VGMSTREAM * init_vgmstream_internal(STREAMFILE *streamFile, int do_dfs) {
(vgmstream->meta_type == meta_DSP_YGO) || (vgmstream->meta_type == meta_DSP_YGO) ||
(vgmstream->meta_type == meta_DSP_AGSC) || (vgmstream->meta_type == meta_DSP_AGSC) ||
(vgmstream->meta_type == meta_PS2_SMPL) || (vgmstream->meta_type == meta_PS2_SMPL) ||
(vgmstream->meta_type == meta_NGCA) ||
(vgmstream->meta_type == meta_NUB_VAG) || (vgmstream->meta_type == meta_NUB_VAG) ||
(vgmstream->meta_type == meta_SPT_SPD) (vgmstream->meta_type == meta_SPT_SPD)
) && vgmstream->channels == 1) { ) && vgmstream->channels == 1) {
@ -2710,6 +2712,9 @@ void describe_vgmstream(VGMSTREAM * vgmstream, char * desc, int length) {
break; break;
case meta_PS3_SGH_SGB: case meta_PS3_SGH_SGB:
snprintf(temp,TEMPSIZE,"SGH+SGB SGXD header"); snprintf(temp,TEMPSIZE,"SGH+SGB SGXD header");
break;
case meta_NGCA:
snprintf(temp,TEMPSIZE,"NGCA header");
break; break;
default: default:
snprintf(temp,TEMPSIZE,"THEY SHOULD HAVE SENT A POET"); snprintf(temp,TEMPSIZE,"THEY SHOULD HAVE SENT A POET");

View File

@ -495,6 +495,7 @@ typedef enum {
meta_NUB_VAG, /* VAG from Nub archives */ meta_NUB_VAG, /* VAG from Nub archives */
meta_PS3_PAST, /* Bakugan Battle Brawlers (PS3) */ meta_PS3_PAST, /* Bakugan Battle Brawlers (PS3) */
meta_PS3_SGH_SGB, /* Folklore (PS3) */ meta_PS3_SGH_SGB, /* Folklore (PS3) */
meta_NGCA, /* GoldenEye 007 (Wii) */
} meta_t; } meta_t;
typedef struct { typedef struct {

View File

@ -136,6 +136,7 @@ gchar *vgmstream_exts [] = {
"myspd", "myspd",
"ndp", "ndp",
"ngca",
"npsf", "npsf",
"nwa", "nwa",

View File

@ -202,6 +202,7 @@ char * extension_list[] = {
"myspd\0MYSPD Audio File (*.MYSPD)\0", "myspd\0MYSPD Audio File (*.MYSPD)\0",
"ndp\0NDP Audio File (*.NDP)\0", "ndp\0NDP Audio File (*.NDP)\0",
"ngca\0NGCA Audio File (*.NGCA)\0",
"npsf\0PS2 NPSF Audio File (*.NPSF)\0", "npsf\0PS2 NPSF Audio File (*.NPSF)\0",
"nwa\0NWA Audio File (*.NWA)\0", "nwa\0NWA Audio File (*.NWA)\0",