ZSD (UGLY!)

git-svn-id: https://vgmstream.svn.sourceforge.net/svnroot/vgmstream@600 51a99a44-fe44-0410-b1ba-c3e57ba2b86b
This commit is contained in:
halleyscometsw 2009-03-12 23:42:56 +00:00
parent bd06b59a7d
commit d2e943af3a
10 changed files with 84 additions and 7 deletions

View File

@ -126,6 +126,7 @@ GC/Wii DSP ADPCM:
- .ssm
- .stm/.dsp
- .str
- .str+.sth
- .sts
- .swd
- .thp, .dsp
@ -153,6 +154,7 @@ PCM:
- .str (16 bit)
- .wav, .lwav (unsigned 8 bit, 16 bit)
- .xss (16 bit)
- .zsd (8 bit)
Xbox IMA ADPCM:
- .matx

View File

@ -184,7 +184,8 @@ META_OBJS=meta/adx_header.o \
meta/nds_rrds.o \
meta/ps2_tk5.o \
meta/ads.o \
meta/wii_str.o
meta/wii_str.o \
meta/zsd.o
OBJECTS=vgmstream.o streamfile.o util.o $(CODING_OBJS) $(LAYOUT_OBJS) $(META_OBJS)

View File

@ -774,6 +774,10 @@
RelativePath=".\meta\ydsp.c"
>
</File>
<File
RelativePath=".\meta\zsd.c"
>
</File>
<File
RelativePath=".\meta\zwdsp.c"
>

View File

@ -145,5 +145,6 @@ libmeta_la_SOURCES += nds_rrds.c
libmeta_la_SOURCES += ps2_tk5.c
libmeta_la_SOURCES += ads.c
libmeta_la_SOURCES += wii_str.c
libmeta_la_SOURCES += zsd.c
EXTRA_DIST = meta.h

View File

@ -355,4 +355,6 @@ VGMSTREAM * init_vgmstream_ads(STREAMFILE *streamFile);
VGMSTREAM * init_vgmstream_wii_str(STREAMFILE *streamFile);
VGMSTREAM * init_vgmstream_zsd(STREAMFILE *streamFile);
#endif

60
src/meta/zsd.c Normal file
View File

@ -0,0 +1,60 @@
#include "meta.h"
#include "../util.h"
/* ZSD (Dragon Booster) */
VGMSTREAM * init_vgmstream_zsd(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("zsd",filename_extension(filename))) goto fail;
/* check header */
if (read_32bitBE(0x00,streamFile) != 0x5A534400) 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 = read_32bitLE(0x20,streamFile);
vgmstream->channels = channel_count;
vgmstream->sample_rate = read_32bitLE(0x10,streamFile);
vgmstream->coding_type = coding_PCM8;
vgmstream->num_samples = read_32bitLE(0x18,streamFile)/channel_count;
vgmstream->interleave_block_size=0x0;
vgmstream->layout_type = layout_none;
vgmstream->meta_type = meta_ZSD;
/* 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

@ -197,6 +197,7 @@ VGMSTREAM * (*init_vgmstream_fcns[])(STREAMFILE *streamFile) = {
init_vgmstream_ps2_vsf_tta,
init_vgmstream_ads,
init_vgmstream_wii_str,
init_vgmstream_zsd,
};
#define INIT_VGMSTREAM_FCNS (sizeof(init_vgmstream_fcns)/sizeof(init_vgmstream_fcns[0]))
@ -2089,21 +2090,24 @@ void describe_vgmstream(VGMSTREAM * vgmstream, char * desc, int length) {
snprintf(temp,TEMPSIZE,"Musashi: Samurai Legend VSF Header");
break;
case meta_NDS_RRDS:
snprintf(temp,TEMPSIZE,"Ridger Racer DS Header");
snprintf(temp,TEMPSIZE,"Ridger Racer DS Header");
break;
case meta_PS2_TK5:
snprintf(temp,TEMPSIZE,"Tekken 5 Stream Header");
break;
case meta_PS2_VSF_TTA:
snprintf(temp,TEMPSIZE,"VSF with SMSS Header");
snprintf(temp,TEMPSIZE,"VSF with SMSS Header");
break;
case meta_ADS:
snprintf(temp,TEMPSIZE,"dhSS Header");
snprintf(temp,TEMPSIZE,"dhSS Header");
break;
case meta_WII_STR:
case meta_WII_STR:
snprintf(temp,TEMPSIZE,"HOTD Overkill - STR+STH WII Header");
break;
default:
break;
case meta_ZSD:
snprintf(temp,TEMPSIZE,"ZSD Header");
break;
default:
snprintf(temp,TEMPSIZE,"THEY SHOULD HAVE SENT A POET");
}
concatn(length,desc,temp);

View File

@ -376,6 +376,7 @@ typedef enum {
meta_NGC_IADP, /* Gamecube Interleave DSP */
meta_PS2_TK5, /* Tekken 5 Stream Files */
meta_WII_STR, /* House of The Dead Overkill STR+STH */
meta_ZSD, /* Dragon Booster ZSD */
} meta_t;
typedef struct {

View File

@ -166,6 +166,7 @@ gchar *vgmstream_exts [] = {
"swav",
"rrds",
"tk5",
"zsd",
/* terminator */
NULL
};

View File

@ -229,6 +229,7 @@ char * extension_list[] = {
"vb\0VB Audio File (*.VB)\0",
"tk5\0TK5 Audio File (*.TK5)\0",
"rrds\0RRDS Audio File (*.RRDS)\0",
"zsd\0ZSD Audio File (*.ZSD)\0",
};
void about(HWND hwndParent) {