Added .2dx from beatmaniaIIDX16 - EMPRESS (Arcade)

git-svn-id: https://vgmstream.svn.sourceforge.net/svnroot/vgmstream@657 51a99a44-fe44-0410-b1ba-c3e57ba2b86b
This commit is contained in:
bxaimc 2009-05-31 18:56:16 +00:00
parent c61f08387d
commit 775dac0221
9 changed files with 89 additions and 4 deletions

View File

@ -197,7 +197,8 @@ META_OBJS=meta/adx_header.o \
meta/ngc_lps.o \
meta/ps2_snd.o \
meta/naomi_adpcm.o \
meta/sd9.o
meta/sd9.o \
meta/2dx.o
OBJECTS=vgmstream.o streamfile.o util.o $(CODING_OBJS) $(LAYOUT_OBJS) $(META_OBJS)

View File

@ -196,6 +196,10 @@
<Filter
Name="Source Files"
>
<File
RelativePath=".\meta\2dx.c"
>
</File>
<File
RelativePath=".\meta\aax.c"
>

69
src/meta/2dx.c Normal file
View File

@ -0,0 +1,69 @@
#include "meta.h"
#include "../util.h"
/* 2DX (found in beatmaniaIIDX16 - EMPRESS (Arcade) */
VGMSTREAM * init_vgmstream_2dx(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("2dx",filename_extension(filename))) goto fail;
/* check header */
if (read_32bitBE(0x0,streamFile) != 0x32445839) /* 2DX9 */
goto fail;
if (read_32bitBE(0x18,streamFile) != 0x52494646) /* RIFF */
goto fail;
if (read_32bitBE(0x20,streamFile) != 0x57415645) /* WAVE */
goto fail;
if (read_32bitBE(0x24,streamFile) != 0x666D7420) /* fmt */
goto fail;
if (read_32bitBE(0x6a,streamFile) != 0x64617461) /* data */
goto fail;
loop_flag = 0;
channel_count = read_16bitLE(0x2e,streamFile);
/* build the VGMSTREAM */
vgmstream = allocate_vgmstream(channel_count,loop_flag);
if (!vgmstream) goto fail;
/* fill in the vital statistics */
start_offset = 0x72;
vgmstream->channels = channel_count;
vgmstream->sample_rate = read_32bitLE(0x30,streamFile);
vgmstream->coding_type = coding_MSADPCM;
vgmstream->num_samples = read_32bitLE(0x66,streamFile);
vgmstream->layout_type = layout_none;
vgmstream->interleave_block_size = read_16bitLE(0x38,streamFile);
vgmstream->meta_type = meta_2DX;
/* 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;
fail:
/* clean up anything we may have opened */
if (vgmstream) close_vgmstream(vgmstream);
return NULL;
}

View File

@ -157,5 +157,6 @@ libmeta_la_SOURCES += ngc_lps.c
libmeta_la_SOURCES += ps2_snd.c
libmeta_la_SOURCES += naomi_adpcm.c
libmeta_la_SOURCES += sd9.c
libmeta_la_SOURCES += 2dx.c
EXTRA_DIST = meta.h

View File

@ -391,4 +391,6 @@ VGMSTREAM * init_vgmstream_rsd3gadp(STREAMFILE * streamFile);
VGMSTREAM * init_vgmstream_sd9(STREAMFILE * streamFile);
VGMSTREAM * init_vgmstream_2dx(STREAMFILE * streamFile);
#endif

View File

@ -215,6 +215,7 @@ VGMSTREAM * (*init_vgmstream_fcns[])(STREAMFILE *streamFile) = {
init_vgmstream_ps2_snd,
init_vgmstream_naomi_adpcm,
init_vgmstream_sd9,
init_vgmstream_2dx,
};
#define INIT_VGMSTREAM_FCNS (sizeof(init_vgmstream_fcns)/sizeof(init_vgmstream_fcns[0]))
@ -2191,6 +2192,9 @@ void describe_vgmstream(VGMSTREAM * vgmstream, char * desc, int length) {
break;
case meta_SD9:
snprintf(temp,TEMPSIZE,"beatmaniaIIDX SD9 header");
break;
case meta_2DX:
snprintf(temp,TEMPSIZE,"beatmaniaIIDX 2DX9 header");
break;
default:
snprintf(temp,TEMPSIZE,"THEY SHOULD HAVE SENT A POET");

View File

@ -395,7 +395,8 @@ typedef enum {
meta_NDS_HWAS, /* Spider-Man 3, Tony Hawk's Downhill Jam, possibly more... */
meta_NGC_LPS, /* Rave Master (Groove Adventure Rave)(GC) */
meta_NAOMI_ADPCM, /* NAOMI/NAOMI2 ARcade games */
meta_SD9 /* beatmaniaIIDX16 - EMPRESS (Arcade) */
meta_SD9, /* beatmaniaIIDX16 - EMPRESS (Arcade) */
meta_2DX, /* beatmaniaIIDX16 - EMPRESS (Arcade) */
} meta_t;
typedef struct {

View File

@ -176,6 +176,7 @@ gchar *vgmstream_exts [] = {
"mcg",
"wii",
"sd9",
"dx9",
/* terminator */
NULL
};

View File

@ -71,7 +71,7 @@ int decode_pos_samples = 0;
int stream_length_samples = 0;
int fade_samples = 0;
#define EXTENSION_LIST_SIZE 9216
#define EXTENSION_LIST_SIZE 10240
char working_extension_list[EXTENSION_LIST_SIZE] = {0};
char * extension_list[] = {
/*WIP formats, enable on demand...! */
@ -80,7 +80,9 @@ char * extension_list[] = {
"pdt\0PDT Audio File (*.PDT)\0", /* Mario Party and some other games */
#endif
"aax\0AAX Audio File (*.AAX)\0",
"2dx\0\02DX Audio File (*.2DX)\0",
"aax\0AAX Audio File (*.AAX)\0",
"acm\0ACM Audio File (*.ACM)\0",
"adpcm\0ADPCM Audio File (*.ADPCM)\0",
"aix\0AIX Audio File (*.AIX)\0",