mirror of
https://github.com/vgmstream/vgmstream.git
synced 2024-11-24 06:50:20 +01:00
.joe added (Disney/Pixar games)
fixed ass (ps2) added 2 more rsd formats git-svn-id: https://vgmstream.svn.sourceforge.net/svnroot/vgmstream@496 51a99a44-fe44-0410-b1ba-c3e57ba2b86b
This commit is contained in:
parent
0de3e95209
commit
f39fbb03f0
@ -155,7 +155,8 @@ META_OBJS=meta/adx_header.o \
|
||||
meta/ydsp.o \
|
||||
meta/gsp_gsb.o \
|
||||
meta/ngc_ssm.o \
|
||||
meta/msvp.o
|
||||
meta/msvp.o \
|
||||
meta/ps2_joe.o
|
||||
|
||||
OBJECTS=vgmstream.o streamfile.o util.o $(CODING_OBJS) $(LAYOUT_OBJS) $(META_OBJS)
|
||||
|
||||
|
@ -465,6 +465,10 @@
|
||||
RelativePath=".\meta\ps2_int.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\meta\ps2_joe.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\meta\ps2_kces.c"
|
||||
>
|
||||
|
@ -122,6 +122,7 @@ libmeta_la_SOURCES += ish_isd.c
|
||||
libmeta_la_SOURCES += spt_spd.c
|
||||
libmeta_la_SOURCES += ydsp.c
|
||||
libmeta_la_SOURCES += gsp_gsb.c
|
||||
libmeta_la_SOURCES += msvp.c
|
||||
libmeta_la_SOURCES += ngc_ssm.c
|
||||
libmeta_la_SOURCES += msvp.c
|
||||
libmeta_la_SOURCES += ps2_joe.c
|
||||
EXTRA_DIST = meta.h
|
||||
|
@ -251,8 +251,12 @@ VGMSTREAM * init_vgmstream_wii_mus(STREAMFILE * streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_rsd2vag(STREAMFILE * streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_rsd2pcmb(STREAMFILE * streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_rsd2xadp(STREAMFILE * streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_rsd3pcm(STREAMFILE * streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_rsd4pcmb(STREAMFILE * streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_rsd4pcm(STREAMFILE * streamFile);
|
||||
@ -299,4 +303,6 @@ VGMSTREAM * init_vgmstream_msvp(STREAMFILE * streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_ngc_ssm(STREAMFILE * streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_ps2_joe(STREAMFILE * streamFile);
|
||||
|
||||
#endif
|
||||
|
@ -5,10 +5,15 @@
|
||||
|
||||
VGMSTREAM * init_vgmstream_ps2_ass(STREAMFILE *streamFile) {
|
||||
VGMSTREAM * vgmstream = NULL;
|
||||
char filename[260];
|
||||
off_t start_offset;
|
||||
|
||||
int loop_flag;
|
||||
|
||||
char filename[260];
|
||||
off_t start_offset;
|
||||
uint8_t testBuffer[0x10];
|
||||
off_t loopStart = 0;
|
||||
off_t loopEnd = 0;
|
||||
off_t readOffset = 0;
|
||||
size_t fileLength;
|
||||
int loop_flag;
|
||||
int channel_count;
|
||||
|
||||
/* check extension, case insensitive */
|
||||
@ -33,10 +38,46 @@ VGMSTREAM * init_vgmstream_ps2_ass(STREAMFILE *streamFile) {
|
||||
vgmstream->coding_type = coding_PSX;
|
||||
vgmstream->num_samples = (read_32bitLE(0x08,streamFile)*2)*28/16/channel_count;
|
||||
|
||||
if(loop_flag) {
|
||||
vgmstream->loop_start_sample = 0;
|
||||
vgmstream->loop_end_sample=(read_32bitLE(0x08,streamFile)*2)*28/16/channel_count;
|
||||
}
|
||||
|
||||
|
||||
fileLength = get_streamfile_size(streamFile);
|
||||
|
||||
do {
|
||||
|
||||
readOffset+=(off_t)read_streamfile(testBuffer,readOffset,0x10,streamFile);
|
||||
|
||||
/* Loop Start */
|
||||
if(testBuffer[0x01]==0x06) {
|
||||
if(loopStart == 0) loopStart = readOffset-0x10;
|
||||
/* break; */
|
||||
}
|
||||
/* Loop End */
|
||||
if(testBuffer[0x01]==0x03) {
|
||||
if(loopEnd == 0) loopEnd = readOffset-0x10;
|
||||
/* break; */
|
||||
}
|
||||
|
||||
} while (streamFile->get_offset(streamFile)<(int32_t)fileLength);
|
||||
|
||||
|
||||
|
||||
if(loopStart == 0) {
|
||||
loop_flag = 0;
|
||||
vgmstream->num_samples = read_32bitLE(0x4,streamFile)*28/16/channel_count;
|
||||
} else {
|
||||
loop_flag = 1;
|
||||
vgmstream->loop_start_sample = (loopStart-start_offset)*28/16/channel_count;
|
||||
vgmstream->loop_end_sample = (loopEnd-start_offset)*28/16/channel_count;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
vgmstream->layout_type = layout_interleave;
|
||||
vgmstream->interleave_block_size = read_32bitLE(0x0C,streamFile);
|
||||
|
107
src/meta/ps2_joe.c
Normal file
107
src/meta/ps2_joe.c
Normal file
@ -0,0 +1,107 @@
|
||||
#include "meta.h"
|
||||
#include "../util.h"
|
||||
|
||||
/*
|
||||
|
||||
JOE (found in Wall-E and some more Pixar games)
|
||||
|
||||
... 2008-12-03 misses loop searching for now...
|
||||
|
||||
*/
|
||||
|
||||
|
||||
VGMSTREAM * init_vgmstream_ps2_joe(STREAMFILE *streamFile) {
|
||||
VGMSTREAM * vgmstream = NULL;
|
||||
char filename[260];
|
||||
off_t start_offset;
|
||||
uint8_t testBuffer[0x10];
|
||||
off_t loopStart = 0;
|
||||
off_t loopEnd = 0;
|
||||
off_t readOffset = 0;
|
||||
size_t fileLength;
|
||||
|
||||
int loop_flag;
|
||||
int channel_count;
|
||||
|
||||
/* check extension, case insensitive */
|
||||
streamFile->get_name(streamFile,filename,sizeof(filename));
|
||||
if (strcasecmp("joe",filename_extension(filename))) goto fail;
|
||||
|
||||
/* check header */
|
||||
if (read_32bitBE(0x0C,streamFile) != 0xCCCCCCCC)
|
||||
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 = 0x4020;
|
||||
vgmstream->channels = channel_count;
|
||||
vgmstream->sample_rate = read_32bitLE(0x0,streamFile);
|
||||
vgmstream->coding_type = coding_PSX;
|
||||
vgmstream->num_samples = (get_streamfile_size(streamFile)-start_offset)*28/16/channel_count;
|
||||
|
||||
|
||||
fileLength = get_streamfile_size(streamFile);
|
||||
|
||||
do {
|
||||
|
||||
readOffset+=(off_t)read_streamfile(testBuffer,readOffset,0x10,streamFile);
|
||||
|
||||
/* Loop Start */
|
||||
if(testBuffer[0x01]==0x06) {
|
||||
if(loopStart == 0) loopStart = readOffset-0x10;
|
||||
/* break; */
|
||||
}
|
||||
/* Loop End */
|
||||
if(testBuffer[0x01]==0x03) {
|
||||
if(loopEnd == 0) loopEnd = readOffset-0x10;
|
||||
/* break; */
|
||||
}
|
||||
|
||||
} while (streamFile->get_offset(streamFile)<(int32_t)fileLength);
|
||||
|
||||
|
||||
|
||||
if(loopStart == 0) {
|
||||
loop_flag = 0;
|
||||
vgmstream->num_samples = read_32bitLE(0x4,streamFile)*28/16/channel_count;
|
||||
} else {
|
||||
loop_flag = 1;
|
||||
vgmstream->loop_start_sample = (loopStart-start_offset-0x20)*28/16/channel_count;
|
||||
vgmstream->loop_end_sample = (loopEnd-start_offset+0x20)*28/16/channel_count;
|
||||
}
|
||||
|
||||
|
||||
|
||||
vgmstream->layout_type = layout_interleave;
|
||||
vgmstream->interleave_block_size = 0x10;
|
||||
vgmstream->meta_type = meta_PS2_JOE;
|
||||
|
||||
/* 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;
|
||||
}
|
147
src/meta/rsd.c
147
src/meta/rsd.c
@ -68,6 +68,80 @@ fail:
|
||||
}
|
||||
|
||||
|
||||
/* RSD2PCMB - Big Endian */
|
||||
VGMSTREAM * init_vgmstream_rsd2pcmb(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("rsd",filename_extension(filename))) goto fail;
|
||||
|
||||
/* check header */
|
||||
if (read_32bitBE(0x0,streamFile) != 0x52534432) /* RSD2 */
|
||||
goto fail;
|
||||
if (read_32bitBE(0x4,streamFile) != 0x50434D42) /* PCMB */
|
||||
goto fail;
|
||||
|
||||
loop_flag = 0;
|
||||
channel_count = read_32bitLE(0x8,streamFile);
|
||||
|
||||
/* build the VGMSTREAM */
|
||||
vgmstream = allocate_vgmstream(channel_count,loop_flag);
|
||||
if (!vgmstream) goto fail;
|
||||
|
||||
/* fill in the vital statistics */
|
||||
start_offset = read_32bitLE(0x18,streamFile);
|
||||
vgmstream->channels = channel_count;
|
||||
vgmstream->sample_rate = read_32bitLE(0x10,streamFile);
|
||||
vgmstream->coding_type = coding_PCM16BE;
|
||||
vgmstream->num_samples = (get_streamfile_size(streamFile)-start_offset)/2/channel_count;
|
||||
if (loop_flag) {
|
||||
vgmstream->loop_start_sample = loop_flag;
|
||||
vgmstream->loop_end_sample = (get_streamfile_size(streamFile)-start_offset)/2/channel_count;
|
||||
}
|
||||
|
||||
|
||||
if (channel_count == 1) {
|
||||
vgmstream->layout_type = layout_none;
|
||||
} else if (channel_count == 2) {
|
||||
vgmstream->layout_type = layout_interleave;
|
||||
vgmstream->interleave_block_size = 0x2;
|
||||
}
|
||||
|
||||
|
||||
vgmstream->meta_type = meta_RSD2PCMB;
|
||||
|
||||
/* 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;
|
||||
|
||||
fail:
|
||||
/* clean up anything we may have opened */
|
||||
if (vgmstream) close_vgmstream(vgmstream);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* RSD2XADP */
|
||||
VGMSTREAM * init_vgmstream_rsd2xadp(STREAMFILE *streamFile) {
|
||||
VGMSTREAM * vgmstream = NULL;
|
||||
@ -140,6 +214,79 @@ fail:
|
||||
}
|
||||
|
||||
|
||||
/* RSD3PCM - Little Endian */
|
||||
VGMSTREAM * init_vgmstream_rsd3pcm(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("rsd",filename_extension(filename))) goto fail;
|
||||
|
||||
/* check header */
|
||||
if (read_32bitBE(0x0,streamFile) != 0x52534433) /* RSD3 */
|
||||
goto fail;
|
||||
if (read_32bitBE(0x4,streamFile) != 0x50434D20) /* PCM\0x20 */
|
||||
goto fail;
|
||||
|
||||
loop_flag = 0;
|
||||
channel_count = read_32bitLE(0x8,streamFile);
|
||||
|
||||
/* build the VGMSTREAM */
|
||||
vgmstream = allocate_vgmstream(channel_count,loop_flag);
|
||||
if (!vgmstream) goto fail;
|
||||
|
||||
/* fill in the vital statistics */
|
||||
start_offset = read_32bitLE(0x18,streamFile);
|
||||
vgmstream->channels = channel_count;
|
||||
vgmstream->sample_rate = read_32bitLE(0x10,streamFile);
|
||||
vgmstream->coding_type = coding_PCM16LE;
|
||||
vgmstream->num_samples = (get_streamfile_size(streamFile)-start_offset)/2/channel_count;
|
||||
if (loop_flag) {
|
||||
vgmstream->loop_start_sample = loop_flag;
|
||||
vgmstream->loop_end_sample = (get_streamfile_size(streamFile)-start_offset)/2/channel_count;
|
||||
}
|
||||
|
||||
|
||||
if (channel_count == 1) {
|
||||
vgmstream->layout_type = layout_none;
|
||||
} else if (channel_count == 2) {
|
||||
vgmstream->layout_type = layout_interleave;
|
||||
vgmstream->interleave_block_size = 0x2;
|
||||
}
|
||||
|
||||
vgmstream->meta_type = meta_RSD3PCM;
|
||||
|
||||
|
||||
/* 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;
|
||||
|
||||
fail:
|
||||
/* clean up anything we may have opened */
|
||||
if (vgmstream) close_vgmstream(vgmstream);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* RSD4VAG */
|
||||
VGMSTREAM * init_vgmstream_rsd4vag(STREAMFILE *streamFile) {
|
||||
|
@ -144,7 +144,9 @@ VGMSTREAM * (*init_vgmstream_fcns[])(STREAMFILE *streamFile) = {
|
||||
init_vgmstream_naomi_spsd,
|
||||
|
||||
init_vgmstream_rsd2vag,
|
||||
init_vgmstream_rsd2pcmb,
|
||||
init_vgmstream_rsd2xadp,
|
||||
init_vgmstream_rsd3pcm,
|
||||
init_vgmstream_rsd4pcmb,
|
||||
init_vgmstream_rsd4pcm,
|
||||
init_vgmstream_rsd4vag,
|
||||
@ -166,6 +168,7 @@ VGMSTREAM * (*init_vgmstream_fcns[])(STREAMFILE *streamFile) = {
|
||||
init_vgmstream_ydsp,
|
||||
init_vgmstream_msvp,
|
||||
init_vgmstream_ngc_ssm,
|
||||
init_vgmstream_ps2_joe,
|
||||
};
|
||||
|
||||
#define INIT_VGMSTREAM_FCNS (sizeof(init_vgmstream_fcns)/sizeof(init_vgmstream_fcns[0]))
|
||||
@ -1785,9 +1788,15 @@ void describe_vgmstream(VGMSTREAM * vgmstream, char * desc, int length) {
|
||||
break;
|
||||
case meta_RSD2VAG:
|
||||
snprintf(temp,TEMPSIZE,"RSD2/VAG Header");
|
||||
break;
|
||||
case meta_RSD2PCMB:
|
||||
snprintf(temp,TEMPSIZE,"RSD2/PCMB Header");
|
||||
break;
|
||||
case meta_RSD2XADP:
|
||||
snprintf(temp,TEMPSIZE,"RSD2/XADP Header");
|
||||
break;
|
||||
case meta_RSD3PCM:
|
||||
snprintf(temp,TEMPSIZE,"RSD3/PCM Header");
|
||||
break;
|
||||
case meta_RSD4PCMB:
|
||||
snprintf(temp,TEMPSIZE,"RSD4/PCMB Header");
|
||||
@ -1860,6 +1869,9 @@ void describe_vgmstream(VGMSTREAM * vgmstream, char * desc, int length) {
|
||||
break;
|
||||
case meta_NGC_SSM:
|
||||
snprintf(temp,TEMPSIZE,"SSM DSP Header");
|
||||
break;
|
||||
case meta_PS2_JOE:
|
||||
snprintf(temp,TEMPSIZE,"Disney/Pixar JOE Header");
|
||||
break;
|
||||
default:
|
||||
snprintf(temp,TEMPSIZE,"THEY SHOULD HAVE SENT A POET");
|
||||
|
@ -254,6 +254,7 @@ typedef enum {
|
||||
meta_GCA, /* Metal Slug Anthology */
|
||||
meta_MSVP, /* Popcap Hits */
|
||||
meta_NGC_SSM, /* Golden Gashbell Full Power */
|
||||
meta_PS2_JOE, /* Wall-E / Pixar games */
|
||||
|
||||
meta_NGC_YMF, /* WWE WrestleMania X8 */
|
||||
meta_SADL, /* .sad */
|
||||
@ -262,10 +263,12 @@ typedef enum {
|
||||
meta_PS2_MIHB, /* Merged MIH+MIB */
|
||||
meta_NGC_PDT, /* Mario Party 6 */
|
||||
meta_DC_ASD, /* Miss Moonligh */
|
||||
meta_NAOMI_SPSD, /* Guilty Gear X */
|
||||
meta_NAOMI_SPSD, /* Guilty Gear X */
|
||||
|
||||
meta_RSD2VAG, /* RSD2VAG */
|
||||
meta_RSD2PCMB, /* RSD2PCMB */
|
||||
meta_RSD2XADP, /* RSD2XADP */
|
||||
meta_RSD3PCM, /* RSD3PCM */
|
||||
meta_RSD4PCMB, /* RSD4PCMB */
|
||||
meta_RSD4PCM, /* RSD4PCM */
|
||||
meta_RSD4VAG, /* RSD4VAG */
|
||||
|
@ -209,6 +209,7 @@ char * extension_list[] = {
|
||||
"gsb\0GSB Audio File (*.GSB)\0",
|
||||
"msvp\0MSVP Audio File (*.MSVP)\0",
|
||||
"ssm\0SSM Audio File (*.SSM)\0",
|
||||
"joe\0JOE Audio File (*.JOE)\0",
|
||||
};
|
||||
|
||||
void about(HWND hwndParent) {
|
||||
|
Loading…
Reference in New Issue
Block a user