mirror of
https://github.com/vgmstream/vgmstream.git
synced 2024-11-12 01:30:49 +01:00
.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:
parent
47300a952a
commit
058b0edb75
@ -140,7 +140,8 @@ META_OBJS=meta/adx_header.o \
|
|||||||
meta/psx_fag.o \
|
meta/psx_fag.o \
|
||||||
meta/ps2_mihb.o \
|
meta/ps2_mihb.o \
|
||||||
meta/ngc_pdt.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)
|
OBJECTS=vgmstream.o streamfile.o util.o $(CODING_OBJS) $(LAYOUT_OBJS) $(META_OBJS)
|
||||||
|
|
||||||
|
@ -235,6 +235,10 @@
|
|||||||
RelativePath=".\meta\Cstr.c"
|
RelativePath=".\meta\Cstr.c"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\meta\dc_asd.c"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\meta\dc_idvi.c"
|
RelativePath=".\meta\dc_idvi.c"
|
||||||
>
|
>
|
||||||
|
@ -109,4 +109,5 @@ libmeta_la_SOURCES += psx_fag.c
|
|||||||
libmeta_la_SOURCES += ps2_mihb.c
|
libmeta_la_SOURCES += ps2_mihb.c
|
||||||
libmeta_la_SOURCES += ngc_pdt.c
|
libmeta_la_SOURCES += ngc_pdt.c
|
||||||
libmeta_la_SOURCES += wii_mus.c
|
libmeta_la_SOURCES += wii_mus.c
|
||||||
|
libmeta_la_SOURCES += dc_asd.c
|
||||||
EXTRA_DIST = meta.h
|
EXTRA_DIST = meta.h
|
||||||
|
81
src/meta/dc_asd.c
Normal file
81
src/meta/dc_asd.c
Normal 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;
|
||||||
|
}
|
@ -247,4 +247,6 @@ VGMSTREAM * init_vgmstream_rsd4vag(STREAMFILE * streamFile);
|
|||||||
|
|
||||||
VGMSTREAM * init_vgmstream_rsd6vag(STREAMFILE * streamFile);
|
VGMSTREAM * init_vgmstream_rsd6vag(STREAMFILE * streamFile);
|
||||||
|
|
||||||
|
VGMSTREAM * init_vgmstream_dc_asd(STREAMFILE * streamFile);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -134,6 +134,7 @@ VGMSTREAM * (*init_vgmstream_fcns[])(STREAMFILE *streamFile) = {
|
|||||||
init_vgmstream_ps2_mihb,
|
init_vgmstream_ps2_mihb,
|
||||||
init_vgmstream_ngc_pdt,
|
init_vgmstream_ngc_pdt,
|
||||||
init_vgmstream_wii_mus,
|
init_vgmstream_wii_mus,
|
||||||
|
init_vgmstream_dc_asd,
|
||||||
|
|
||||||
init_vgmstream_rsd2vag,
|
init_vgmstream_rsd2vag,
|
||||||
init_vgmstream_rsd2xadp,
|
init_vgmstream_rsd2xadp,
|
||||||
@ -1732,6 +1733,9 @@ void describe_vgmstream(VGMSTREAM * vgmstream, char * desc, int length) {
|
|||||||
break;
|
break;
|
||||||
case meta_RSD6VAG:
|
case meta_RSD6VAG:
|
||||||
snprintf(temp,TEMPSIZE,"RSD6/VAG Header");
|
snprintf(temp,TEMPSIZE,"RSD6/VAG Header");
|
||||||
|
break;
|
||||||
|
case meta_DC_ASD:
|
||||||
|
snprintf(temp,TEMPSIZE,"ASD Header");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
snprintf(temp,TEMPSIZE,"THEY SHOULD HAVE SENT A POET");
|
snprintf(temp,TEMPSIZE,"THEY SHOULD HAVE SENT A POET");
|
||||||
|
@ -241,7 +241,7 @@ typedef enum {
|
|||||||
meta_PSX_FAG, /* Jackie Chan - Stuntmaster */
|
meta_PSX_FAG, /* Jackie Chan - Stuntmaster */
|
||||||
meta_PS2_MIHB, /* Merged MIH+MIB */
|
meta_PS2_MIHB, /* Merged MIH+MIB */
|
||||||
meta_NGC_PDT, /* Mario Party 6 */
|
meta_NGC_PDT, /* Mario Party 6 */
|
||||||
|
meta_DC_ASD, /* Miss Moonligh */
|
||||||
meta_RSD2VAG, /* RSD2VAG */
|
meta_RSD2VAG, /* RSD2VAG */
|
||||||
meta_RSD2XADP, /* RSD2XADP */
|
meta_RSD2XADP, /* RSD2XADP */
|
||||||
meta_RSD4PCMB, /* RSD4PCMB */
|
meta_RSD4PCMB, /* RSD4PCMB */
|
||||||
|
@ -190,6 +190,7 @@ char * extension_list[] = {
|
|||||||
"fag\0FAG Audio File (*.FAG)\0",
|
"fag\0FAG Audio File (*.FAG)\0",
|
||||||
"mihb\0MIHB Audio File (*.MIHB)\0",
|
"mihb\0MIHB Audio File (*.MIHB)\0",
|
||||||
"pdt\0PDT Audio File (*.PDT)\0",
|
"pdt\0PDT Audio File (*.PDT)\0",
|
||||||
|
"asd\0ASD Audio File (*.ASD)\0",
|
||||||
};
|
};
|
||||||
|
|
||||||
void about(HWND hwndParent) {
|
void about(HWND hwndParent) {
|
||||||
|
Loading…
Reference in New Issue
Block a user