.CCC added -> Tokyo Xtreme Racer DRIFT 2 (PS2)

.FAG added -> Jackie Chan - Stuntmaster (PSX)

git-svn-id: https://vgmstream.svn.sourceforge.net/svnroot/vgmstream@440 51a99a44-fe44-0410-b1ba-c3e57ba2b86b
This commit is contained in:
manakoAT 2008-09-24 05:56:25 +00:00
parent 74b150ad8b
commit da5f3a7376
9 changed files with 165 additions and 1 deletions

View File

@ -135,7 +135,9 @@ META_OBJS=meta/adx_header.o \
meta/ps2_xa2.o \
meta/idsp.o \
meta/ngc_ymf.o \
meta/nds_sad.o
meta/nds_sad.o \
meta/ps2_ccc.o \
meta/psx_fag.o
OBJECTS=vgmstream.o streamfile.o util.o $(CODING_OBJS) $(LAYOUT_OBJS) $(META_OBJS)

View File

@ -385,6 +385,10 @@
RelativePath=".\meta\ps2_bmdx.c"
>
</File>
<File
RelativePath=".\meta\ps2_ccc.c"
>
</File>
<File
RelativePath=".\meta\ps2_dxh.c"
>
@ -513,6 +517,10 @@
RelativePath=".\meta\psx_cdxa.c"
>
</File>
<File
RelativePath=".\meta\psx_fag.c"
>
</File>
<File
RelativePath=".\meta\psx_gms.c"
>

View File

@ -104,4 +104,6 @@ libmeta_la_SOURCES += ps2_xa2.c
libmeta_la_SOURCES += idsp.c
libmeta_la_SOURCES += ngc_ymf.c
libmeta_la_SOURCES += nds_sad.c
libmeta_la_SOURCES += ps2_ccc.c
libmeta_la_SOURCES += psx_fag.c
EXTRA_DIST = meta.h

View File

@ -229,4 +229,8 @@ VGMSTREAM * init_vgmstream_ngc_ymf(STREAMFILE * streamFile);
VGMSTREAM * init_vgmstream_sadl(STREAMFILE * streamFile);
VGMSTREAM * init_vgmstream_ps2_ccc(STREAMFILE * streamFile);
VGMSTREAM * init_vgmstream_psx_fag(STREAMFILE * streamFile);
#endif

69
src/meta/ps2_ccc.c Normal file
View File

@ -0,0 +1,69 @@
#include "meta.h"
#include "../util.h"
/* CCC (from Unlimited Saga) */
VGMSTREAM * init_vgmstream_ps2_ccc(STREAMFILE *streamFile) {
VGMSTREAM * vgmstream = NULL;
char filename[260];
off_t start_offset;
int loop_flag = 0;
int channel_count;
/* check extension, case insensitive */
streamFile->get_name(streamFile,filename,sizeof(filename));
if (strcasecmp("ccc",filename_extension(filename))) goto fail;
/* check header */
if (read_32bitBE(0x00,streamFile) != 0x01000000)
goto fail;
/* check file size */
if (read_32bitLE(0x0C,streamFile)+0x50 != get_streamfile_size(streamFile))
goto fail;
loop_flag = 0;
channel_count = 2;
/* build the VGMSTREAM */
vgmstream = allocate_vgmstream(channel_count,loop_flag);
if (!vgmstream) goto fail;
/* fill in the vital statistics */
start_offset = 0x50;
vgmstream->channels = channel_count;
vgmstream->sample_rate = read_32bitLE(0x04,streamFile);
vgmstream->coding_type = coding_PSX;
vgmstream->num_samples = (read_32bitLE(0x08,streamFile))/channel_count/32*28;
if (loop_flag) {
vgmstream->loop_start_sample = 0;
vgmstream->loop_end_sample = (read_32bitLE(0x08,streamFile))/channel_count/32*28;
}
vgmstream->layout_type = layout_interleave;
vgmstream->interleave_block_size = 0x2000;
vgmstream->meta_type = meta_PS2_CCC;
/* 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;
}

65
src/meta/psx_fag.c Normal file
View File

@ -0,0 +1,65 @@
#include "meta.h"
#include "../util.h"
/* FAG (Jackie Chan - Stuntmaster) */
VGMSTREAM * init_vgmstream_psx_fag(STREAMFILE *streamFile) {
VGMSTREAM * vgmstream = NULL;
char filename[260];
off_t start_offset;
int loop_flag = 0;
int channel_count;
/* check extension, case insensitive */
streamFile->get_name(streamFile,filename,sizeof(filename));
if (strcasecmp("fag",filename_extension(filename))) goto fail;
/* check header */
if (read_32bitBE(0x00,streamFile) != 0x01000000)
goto fail;
loop_flag = 0;
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_32bitLE(0x04,streamFile);
vgmstream->channels = channel_count;
vgmstream->sample_rate = 24000;
vgmstream->coding_type = coding_PSX;
vgmstream->num_samples = (read_32bitLE(0x08,streamFile))/channel_count/32*28;
if (loop_flag) {
vgmstream->loop_start_sample = 0;
vgmstream->loop_end_sample = (read_32bitLE(0x08,streamFile))/channel_count/32*28;
}
vgmstream->layout_type = layout_interleave;
vgmstream->interleave_block_size = 0x8000;
vgmstream->meta_type = meta_PSX_FAG;
/* 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

@ -130,6 +130,8 @@ VGMSTREAM * (*init_vgmstream_fcns[])(STREAMFILE *streamFile) = {
init_vgmstream_idsp,
init_vgmstream_ngc_ymf,
init_vgmstream_sadl,
init_vgmstream_ps2_ccc,
init_vgmstream_psx_fag,
};
#define INIT_VGMSTREAM_FCNS (sizeof(init_vgmstream_fcns)/sizeof(init_vgmstream_fcns[0]))
@ -1695,6 +1697,12 @@ void describe_vgmstream(VGMSTREAM * vgmstream, char * desc, int length) {
break;
case meta_NGC_YMF:
snprintf(temp,TEMPSIZE,"YMF DSP Header");
break;
case meta_PS2_CCC:
snprintf(temp,TEMPSIZE,"CCC Header");
break;
case meta_PSX_FAG:
snprintf(temp,TEMPSIZE,"FAG Header");
break;
default:
snprintf(temp,TEMPSIZE,"THEY SHOULD HAVE SENT A POET");

View File

@ -237,6 +237,8 @@ typedef enum {
meta_IDSP, /* Chronicles of Narnia */
meta_NGC_YMF, /* WWE WrestleMania X8 */
meta_SADL, /* .sad */
meta_PS2_CCC, /* Tokyo Xtreme Racer DRIFT 2 */
meta_PSX_FAG, /* Jackie Chan - Stuntmaster */
meta_XBOX_WAVM, /* XBOX WAVM File */
meta_XBOX_RIFF, /* XBOX RIFF/WAVE File */

View File

@ -183,7 +183,11 @@ char * extension_list[] = {
"kraw\0KRAW Audio File (*.KRAW)\0",
"omu\0OMU Audio File (*.OMU)\0",
"xa2\0XA2 Audio File (*.XA2)\0",
"idsp\0IDSP Audio File (*.IDSP)\0",
"xsf\0XSF Audio File (*.XSF)\0",
"ymf\0YMF Audio File (*.YMF)\0",
"ccc\0CCC Audio File (*.CCC)\0",
"fag\0FAG Audio File (*.FAG)\0",
};
void about(HWND hwndParent) {