.rstm added

.aus fixed

git-svn-id: https://vgmstream.svn.sourceforge.net/svnroot/vgmstream@344 51a99a44-fe44-0410-b1ba-c3e57ba2b86b
This commit is contained in:
manakoAT 2008-07-19 08:48:49 +00:00
parent 4554044dc9
commit 4a62cc4fd5
8 changed files with 85 additions and 3 deletions

View File

@ -91,7 +91,8 @@ META_OBJS=meta/adx_header.o \
meta/ps2_sfs.o \
meta/sat_dvi.o \
meta/ps2_bg00.o \
meta/dc_kcey.o
meta/dc_kcey.o \
meta/ps2_rstm.o
OBJECTS=vgmstream.o streamfile.o util.o $(CODING_OBJS) $(LAYOUT_OBJS) $(META_OBJS)

View File

@ -354,6 +354,10 @@
RelativePath=".\meta\ps2_pnb.c"
>
</File>
<File
RelativePath=".\meta\ps2_rstm.c"
>
</File>
<File
RelativePath=".\meta\ps2_rws.c"
>

View File

@ -152,4 +152,7 @@ VGMSTREAM * init_vgmstream_dvi(STREAMFILE * streamFile);
VGMSTREAM * init_vgmstream_bg00(STREAMFILE * streamFile);
VGMSTREAM * init_vgmstream_kcey(STREAMFILE * streamFile);
VGMSTREAM * init_vgmstream_ps2_rstm(STREAMFILE * streamFile);
#endif

View File

@ -19,7 +19,7 @@ VGMSTREAM * init_vgmstream_aus(STREAMFILE *streamFile) {
goto fail;
loop_flag = (read_32bitLE(0x4,streamFile)!=0);
channel_count = 2;
channel_count = read_32bitLE(0xC,streamFile);
/* build the VGMSTREAM */
vgmstream = allocate_vgmstream(channel_count,loop_flag);

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

@ -0,0 +1,65 @@
#include "meta.h"
#include "../util.h"
/* RSTM (from Midnight Club 3, Bully - Canis Canim Edit) */
VGMSTREAM * init_vgmstream_ps2_rstm(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("rstm",filename_extension(filename))) goto fail;
/* check header */
if (read_32bitBE(0x00,streamFile) != 0x5253544D) /* "RSTM" */
goto fail;
loop_flag = (read_32bitLE(0x24,streamFile)!=0xFFFFFFFF);
channel_count = read_32bitLE(0x0C,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(0x08,streamFile);
vgmstream->coding_type = coding_PSX;
vgmstream->num_samples = read_32bitLE(0x20,streamFile)*28/16/channel_count;
if (loop_flag) {
vgmstream->loop_start_sample = read_32bitLE(0x24,streamFile)*28/16/channel_count;
vgmstream->loop_end_sample = read_32bitLE(0x20,streamFile)*28/16/channel_count;
}
vgmstream->layout_type = layout_interleave;
vgmstream->interleave_block_size = 0x10;
vgmstream->meta_type = meta_PS2_RSTM;
/* 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

@ -92,6 +92,7 @@ VGMSTREAM * (*init_vgmstream_fcns[])(STREAMFILE *streamFile) = {
init_vgmstream_bg00,
init_vgmstream_dvi,
init_vgmstream_kcey,
init_vgmstream_ps2_rstm,
};
#define INIT_VGMSTREAM_FCNS (sizeof(init_vgmstream_fcns)/sizeof(init_vgmstream_fcns[0]))
@ -1300,7 +1301,7 @@ void describe_vgmstream(VGMSTREAM * vgmstream, char * desc, int length) {
snprintf(temp,TEMPSIZE,"Bio Hazard - Gun Survivor FILp/GEMp Header");
break;
case meta_IKM:
snprintf(temp,TEMPSIZE,"Zwei! IKM Header");
snprintf(temp,TEMPSIZE,"Zwei!! IKM Header");
break;
case meta_SFS:
snprintf(temp,TEMPSIZE,"Baroque SFS Header");
@ -1310,6 +1311,12 @@ void describe_vgmstream(VGMSTREAM * vgmstream, char * desc, int length) {
break;
case meta_KCEY:
snprintf(temp,TEMPSIZE,"KCEYCOMP Header");
break;
case meta_BG00:
snprintf(temp,TEMPSIZE,"Falcom BG00 Header");
break;
case meta_PS2_RSTM:
snprintf(temp,TEMPSIZE,"Rockstar Games RSTM Header");
break;
default:
snprintf(temp,TEMPSIZE,"THEY SHOULD HAVE SENT A POET");

View File

@ -188,6 +188,7 @@ typedef enum {
meta_IKM, /* Zwei! */
meta_SFS, /* Baroque */
meta_BG00, /* Ibara, Mushihimesama */
meta_PS2_RSTM, /* Midnight Club 3 */
meta_XBOX_WAVM, /* XBOX WAVM File */
meta_XBOX_RIFF, /* XBOX RIFF/WAVE File */

View File

@ -148,6 +148,7 @@ char * extension_list[] = {
"bg00\0BG00 Audio File (*.BG00)\0",
"dvi\0DVI Audio File (*.DVI)\0",
"kcey\0KCEY Audio File (*.KCEY)\0",
"rstm\0RSTM Audio File (*.RSTM)\0",
};
void about(HWND hwndParent) {