.asd added for DC (Miss Moonlight)

git-svn-id: https://vgmstream.svn.sourceforge.net/svnroot/vgmstream@457 51a99a44-fe44-0410-b1ba-c3e57ba2b86b
This commit is contained in:
manakoAT 2008-10-30 15:43:36 +00:00
parent 47300a952a
commit 058b0edb75
8 changed files with 96 additions and 2 deletions

View File

@ -140,7 +140,8 @@ META_OBJS=meta/adx_header.o \
meta/psx_fag.o \
meta/ps2_mihb.o \
meta/ngc_pdt.o \
meta/wii_mus.o
meta/wii_mus.o \
meta/dc_asd.o
OBJECTS=vgmstream.o streamfile.o util.o $(CODING_OBJS) $(LAYOUT_OBJS) $(META_OBJS)

View File

@ -235,6 +235,10 @@
RelativePath=".\meta\Cstr.c"
>
</File>
<File
RelativePath=".\meta\dc_asd.c"
>
</File>
<File
RelativePath=".\meta\dc_idvi.c"
>

View File

@ -109,4 +109,5 @@ libmeta_la_SOURCES += psx_fag.c
libmeta_la_SOURCES += ps2_mihb.c
libmeta_la_SOURCES += ngc_pdt.c
libmeta_la_SOURCES += wii_mus.c
libmeta_la_SOURCES += dc_asd.c
EXTRA_DIST = meta.h

81
src/meta/dc_asd.c Normal file
View File

@ -0,0 +1,81 @@
#include "meta.h"
#include "../util.h"
/* ASD (found in Miss Moonlight) */
VGMSTREAM * init_vgmstream_dc_asd(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("asd",filename_extension(filename))) goto fail;
/* check header */
if (read_32bitBE(0x20,streamFile) != 0x00000000)
goto fail;
if (read_32bitBE(0x24,streamFile) != 0x00000000)
goto fail;
loop_flag = 0; /* (read_32bitLE(0x144,streamFile)!=0); */
channel_count = read_16bitLE(0x0A,streamFile);
/* build the VGMSTREAM */
vgmstream = allocate_vgmstream(channel_count,loop_flag);
if (!vgmstream) goto fail;
/* fill in the vital statistics */
start_offset = 0x800;
vgmstream->channels = channel_count;
vgmstream->sample_rate = read_32bitLE(0x0C,streamFile);
vgmstream->coding_type = coding_PCM16LE;
vgmstream->num_samples = read_32bitLE(0x0,streamFile)/2/channel_count;
if (loop_flag) {
vgmstream->loop_start_sample = 0; /* read_32bitLE(0x144,streamFile)/2/channel_count; */
vgmstream->loop_end_sample = read_32bitLE(0x0,streamFile)/2/channel_count;
}
switch (channel_count) {
case 1:
vgmstream->layout_type = layout_none;
break;
case 2:
vgmstream->layout_type = layout_interleave;
vgmstream->interleave_block_size = 0x2;
break;
default:
goto fail;
}
vgmstream->meta_type = meta_DC_ASD;
/* 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

@ -247,4 +247,6 @@ VGMSTREAM * init_vgmstream_rsd4vag(STREAMFILE * streamFile);
VGMSTREAM * init_vgmstream_rsd6vag(STREAMFILE * streamFile);
VGMSTREAM * init_vgmstream_dc_asd(STREAMFILE * streamFile);
#endif

View File

@ -134,6 +134,7 @@ VGMSTREAM * (*init_vgmstream_fcns[])(STREAMFILE *streamFile) = {
init_vgmstream_ps2_mihb,
init_vgmstream_ngc_pdt,
init_vgmstream_wii_mus,
init_vgmstream_dc_asd,
init_vgmstream_rsd2vag,
init_vgmstream_rsd2xadp,
@ -1732,6 +1733,9 @@ void describe_vgmstream(VGMSTREAM * vgmstream, char * desc, int length) {
break;
case meta_RSD6VAG:
snprintf(temp,TEMPSIZE,"RSD6/VAG Header");
break;
case meta_DC_ASD:
snprintf(temp,TEMPSIZE,"ASD Header");
break;
default:
snprintf(temp,TEMPSIZE,"THEY SHOULD HAVE SENT A POET");

View File

@ -241,7 +241,7 @@ typedef enum {
meta_PSX_FAG, /* Jackie Chan - Stuntmaster */
meta_PS2_MIHB, /* Merged MIH+MIB */
meta_NGC_PDT, /* Mario Party 6 */
meta_DC_ASD, /* Miss Moonligh */
meta_RSD2VAG, /* RSD2VAG */
meta_RSD2XADP, /* RSD2XADP */
meta_RSD4PCMB, /* RSD4PCMB */

View File

@ -190,6 +190,7 @@ char * extension_list[] = {
"fag\0FAG Audio File (*.FAG)\0",
"mihb\0MIHB Audio File (*.MIHB)\0",
"pdt\0PDT Audio File (*.PDT)\0",
"asd\0ASD Audio File (*.ASD)\0",
};
void about(HWND hwndParent) {