mirror of
https://github.com/vgmstream/vgmstream.git
synced 2024-11-24 15:00:11 +01:00
.tydsp added
git-svn-id: https://vgmstream.svn.sourceforge.net/svnroot/vgmstream@387 51a99a44-fe44-0410-b1ba-c3e57ba2b86b
This commit is contained in:
parent
713c586e78
commit
e4bd73b542
@ -110,7 +110,8 @@ META_OBJS=meta/adx_header.o \
|
||||
meta/ps2_tec.o \
|
||||
meta/ps2_enth.o \
|
||||
meta/sdt.o \
|
||||
meta/aix.o
|
||||
meta/aix.o \
|
||||
meta/ngc_tydsp.o
|
||||
|
||||
OBJECTS=vgmstream.o streamfile.o util.o $(CODING_OBJS) $(LAYOUT_OBJS) $(META_OBJS)
|
||||
|
||||
|
@ -294,6 +294,10 @@
|
||||
RelativePath=".\meta\ngc_dsp_std.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\meta\ngc_tydsp.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\meta\nwa.c"
|
||||
>
|
||||
|
@ -86,5 +86,6 @@ libmeta_la_SOURCES += ps2_tec.c
|
||||
libmeta_la_SOURCES += ps2_enth.c
|
||||
libmeta_la_SOURCES += sdt.c
|
||||
libmeta_la_SOURCES += aix.c
|
||||
libmeta_la_SOURCES += ngc_tydsp.c
|
||||
|
||||
EXTRA_DIST = meta.h
|
||||
|
@ -185,4 +185,6 @@ VGMSTREAM * init_vgmstream_sdt(STREAMFILE * streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_aix(STREAMFILE * streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_ngc_tydsp(STREAMFILE * streamFile);
|
||||
|
||||
#endif
|
||||
|
78
src/meta/ngc_tydsp.c
Normal file
78
src/meta/ngc_tydsp.c
Normal file
@ -0,0 +1,78 @@
|
||||
#include "meta.h"
|
||||
#include "../util.h"
|
||||
|
||||
/* TYDSP (Ty - The Tasmanian Tiger) */
|
||||
VGMSTREAM * init_vgmstream_ngc_tydsp(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("tydsp",filename_extension(filename))) goto fail;
|
||||
|
||||
/* check header */
|
||||
/* if (read_32bitBE(0x00,streamFile) != 0x53565300) /* "SVS\0" */
|
||||
/* goto fail; */
|
||||
|
||||
loop_flag = 1;
|
||||
channel_count = 2;
|
||||
|
||||
/* build the VGMSTREAM */
|
||||
vgmstream = allocate_vgmstream(channel_count,loop_flag);
|
||||
if (!vgmstream) goto fail;
|
||||
|
||||
/* fill in the vital statistics */
|
||||
start_offset = read_32bitBE(0x08,streamFile);
|
||||
vgmstream->channels = channel_count;
|
||||
vgmstream->sample_rate = (uint16_t)(read_16bitBE(0x6C,streamFile));
|
||||
vgmstream->coding_type = coding_NGC_DSP;
|
||||
vgmstream->num_samples = read_32bitBE(0x00,streamFile);
|
||||
if (loop_flag) {
|
||||
vgmstream->loop_start_sample = 0;
|
||||
vgmstream->loop_end_sample = read_32bitBE(0x00,streamFile);
|
||||
}
|
||||
|
||||
vgmstream->layout_type = layout_interleave;
|
||||
vgmstream->interleave_block_size = read_32bitBE(0x04,streamFile);
|
||||
vgmstream->meta_type = meta_NGC_TYDSP;
|
||||
|
||||
|
||||
if (vgmstream->coding_type == coding_NGC_DSP) {
|
||||
int i;
|
||||
for (i=0;i<16;i++) {
|
||||
vgmstream->ch[0].adpcm_coef[i] = read_16bitBE(0x10+i*2,streamFile);
|
||||
}
|
||||
if (vgmstream->channels) {
|
||||
for (i=0;i<16;i++) {
|
||||
vgmstream->ch[1].adpcm_coef[i] = read_16bitBE(0x3E+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;
|
||||
}
|
@ -7,7 +7,7 @@ VGMSTREAM * init_vgmstream_sdt(STREAMFILE *streamFile) {
|
||||
char filename[260];
|
||||
off_t start_offset;
|
||||
|
||||
int loop_flag = 0;
|
||||
int loop_flag;
|
||||
int channel_count;
|
||||
|
||||
/* check extension, case insensitive */
|
||||
@ -18,7 +18,7 @@ VGMSTREAM * init_vgmstream_sdt(STREAMFILE *streamFile) {
|
||||
/* if (read_32bitBE(0x00,streamFile) != 0x53565300) /* "SVS\0" */
|
||||
/* goto fail; */
|
||||
|
||||
loop_flag = 0; /* (read_32bitLE(0x08,streamFile)!=0); */
|
||||
loop_flag = (read_32bitBE(0x04,streamFile)!=0);
|
||||
channel_count = 2;
|
||||
|
||||
/* build the VGMSTREAM */
|
||||
@ -27,30 +27,32 @@ VGMSTREAM * init_vgmstream_sdt(STREAMFILE *streamFile) {
|
||||
|
||||
/* fill in the vital statistics */
|
||||
start_offset = 0xA0;
|
||||
vgmstream->channels = channel_count;
|
||||
vgmstream->sample_rate = 48000;
|
||||
vgmstream->channels = read_32bitBE(0x00,streamFile);
|
||||
vgmstream->sample_rate = read_32bitBE(0x08,streamFile);
|
||||
vgmstream->coding_type = coding_NGC_DSP;
|
||||
vgmstream->num_samples = read_32bitBE(0x10,streamFile);
|
||||
vgmstream->num_samples = read_32bitBE(0x10,streamFile)/8*14/channel_count;
|
||||
if (loop_flag) {
|
||||
vgmstream->loop_start_sample = 0; /* (read_32bitLE(0x08,streamFile)-1)*28; */
|
||||
vgmstream->loop_end_sample = read_32bitBE(0x10,streamFile);
|
||||
vgmstream->loop_end_sample = read_32bitBE(0x10,streamFile)/8*14/channel_count;
|
||||
}
|
||||
|
||||
vgmstream->layout_type = layout_interleave;
|
||||
vgmstream->interleave_block_size = 0x8000;
|
||||
vgmstream->meta_type = meta_SDT;
|
||||
|
||||
if (vgmstream->coding_type == coding_NGC_DSP) {
|
||||
int i;
|
||||
for (i=0;i<16;i++) {
|
||||
|
||||
if (vgmstream->coding_type == coding_NGC_DSP) {
|
||||
int i;
|
||||
for (i=0;i<16;i++) {
|
||||
vgmstream->ch[0].adpcm_coef[i] = read_16bitBE(0x3C+i*2,streamFile);
|
||||
}
|
||||
if (vgmstream->channels) {
|
||||
for (i=0;i<16;i++) {
|
||||
vgmstream->ch[1].adpcm_coef[i] = read_16bitBE(0x6A+i*2,streamFile);
|
||||
}
|
||||
}
|
||||
if (vgmstream->channels) {
|
||||
for (i=0;i<16;i++) {
|
||||
vgmstream->ch[1].adpcm_coef[i] = read_16bitBE(0x6A+i*2,streamFile);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* open the file for reading */
|
||||
{
|
||||
int i;
|
||||
|
@ -108,6 +108,7 @@ VGMSTREAM * (*init_vgmstream_fcns[])(STREAMFILE *streamFile) = {
|
||||
init_vgmstream_ps2_enth,
|
||||
init_vgmstream_sdt,
|
||||
init_vgmstream_aix,
|
||||
init_vgmstream_ngc_tydsp,
|
||||
};
|
||||
|
||||
#define INIT_VGMSTREAM_FCNS (sizeof(init_vgmstream_fcns)/sizeof(init_vgmstream_fcns[0]))
|
||||
|
@ -208,7 +208,8 @@ typedef enum {
|
||||
meta_PS2_VAS, /* Pro Baseball Spirits 5 */
|
||||
meta_PS2_TEC, /* TECMO badflagged stream */
|
||||
meta_PS2_ENTH, /* Enthusia */
|
||||
meta_SDT, /* Enthusia */
|
||||
meta_SDT, /* Baldur's Gate - Dark Alliance */
|
||||
meta_NGC_TYDSP, /* Ty - The Tasmanian Tiger */
|
||||
|
||||
meta_XBOX_WAVM, /* XBOX WAVM File */
|
||||
meta_XBOX_RIFF, /* XBOX RIFF/WAVE File */
|
||||
|
@ -167,6 +167,7 @@ char * extension_list[] = {
|
||||
"enth\0ENTH Audio File (*.ENTH)\0",
|
||||
"sdt\0SDT Audio File (*.SDT)\0",
|
||||
"aix\0AIX Audio File (*.AIX)\0",
|
||||
"tydsp\0TYDSP Audio File (*.TYDSP)\0",
|
||||
};
|
||||
|
||||
void about(HWND hwndParent) {
|
||||
|
Loading…
Reference in New Issue
Block a user