mirror of
https://github.com/vgmstream/vgmstream.git
synced 2024-11-28 00:20:47 +01:00
Added .sps support from Ape Escape 2
git-svn-id: https://vgmstream.svn.sourceforge.net/svnroot/vgmstream@623 51a99a44-fe44-0410-b1ba-c3e57ba2b86b
This commit is contained in:
parent
20f2c84dc3
commit
50f092b971
@ -191,7 +191,8 @@ META_OBJS=meta/adx_header.o \
|
||||
meta/redspark.o \
|
||||
meta/ps2_vgs.o \
|
||||
meta/ivaud.o \
|
||||
meta/wii_ndp.o
|
||||
meta/wii_ndp.o \
|
||||
meta/ps2_sps.o
|
||||
|
||||
OBJECTS=vgmstream.o streamfile.o util.o $(CODING_OBJS) $(LAYOUT_OBJS) $(META_OBJS)
|
||||
|
||||
|
@ -582,6 +582,10 @@
|
||||
RelativePath=".\meta\ps2_sl3.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\meta\ps2_sps.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\meta\ps2_str.c"
|
||||
>
|
||||
|
@ -151,5 +151,6 @@ libmeta_la_SOURCES += redspark.c
|
||||
libmeta_la_SOURCES += ivaud.c
|
||||
libmeta_la_SOURCES += ps2_vgs.c
|
||||
libmeta_la_SOURCES += wii_ndp.c
|
||||
libmeta_la_SOURCES += ps2_sps.c
|
||||
|
||||
EXTRA_DIST = meta.h
|
||||
|
@ -369,4 +369,6 @@ VGMSTREAM * init_vgmstream_wii_wsd(STREAMFILE *streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_wii_ndp(STREAMFILE *streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_ps2_sps(STREAMFILE *streamFile);
|
||||
|
||||
#endif
|
||||
|
60
src/meta/ps2_sps.c
Normal file
60
src/meta/ps2_sps.c
Normal file
@ -0,0 +1,60 @@
|
||||
#include "meta.h"
|
||||
#include "../util.h"
|
||||
|
||||
/* SPS (from Ape Escape 2) */
|
||||
VGMSTREAM * init_vgmstream_ps2_sps(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("sps",filename_extension(filename))) goto fail;
|
||||
|
||||
/* check header */
|
||||
if (read_32bitBE(0x10,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 = 0x800;
|
||||
vgmstream->channels = channel_count;
|
||||
vgmstream->sample_rate = read_32bitLE(0x1C,streamFile);
|
||||
vgmstream->coding_type = coding_PCM16LE;
|
||||
vgmstream->num_samples = (read_32bitLE(0x18,streamFile)-0x800)/2/channel_count;
|
||||
vgmstream->layout_type = layout_interleave;
|
||||
vgmstream->interleave_block_size = 0x200;
|
||||
vgmstream->meta_type = meta_PS2_SPS;
|
||||
|
||||
/* 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;
|
||||
}
|
@ -204,6 +204,7 @@ VGMSTREAM * (*init_vgmstream_fcns[])(STREAMFILE *streamFile) = {
|
||||
init_vgmstream_ivaud,
|
||||
init_vgmstream_wii_wsd,
|
||||
init_vgmstream_wii_ndp,
|
||||
init_vgmstream_ps2_sps,
|
||||
};
|
||||
|
||||
#define INIT_VGMSTREAM_FCNS (sizeof(init_vgmstream_fcns)/sizeof(init_vgmstream_fcns[0]))
|
||||
@ -1940,7 +1941,7 @@ void describe_vgmstream(VGMSTREAM * vgmstream, char * desc, int length) {
|
||||
snprintf(temp,TEMPSIZE,"assumed TMNT file by .xvas extension");
|
||||
break;
|
||||
case meta_PS2_XA2:
|
||||
snprintf(temp,TEMPSIZE,"assumed XA2 file by .xa2 extension");
|
||||
snprintf(temp,TEMPSIZE,"XG3 & RC Revenge Pro XA2 Header");
|
||||
break;
|
||||
case meta_DC_IDVI:
|
||||
snprintf(temp,TEMPSIZE,"IDVI Header");
|
||||
@ -2132,7 +2133,9 @@ void describe_vgmstream(VGMSTREAM * vgmstream, char * desc, int length) {
|
||||
case meta_WII_NDP:
|
||||
snprintf(temp,TEMPSIZE,"Vertigo NDP Header");
|
||||
break;
|
||||
default:
|
||||
case meta_PS2_SPS:
|
||||
snprintf(temp,TEMPSIZE,"Ape Escape 2 SPS Header");
|
||||
break;
|
||||
snprintf(temp,TEMPSIZE,"THEY SHOULD HAVE SENT A POET");
|
||||
break;
|
||||
}
|
||||
|
@ -266,7 +266,7 @@ typedef enum {
|
||||
meta_DC_IDVI, /* Eldorado Gate */
|
||||
meta_KRAW, /* Geometry Wars - Galaxies */
|
||||
meta_PS2_OMU, /* PS2 Int file with Header */
|
||||
meta_PS2_XA2, /* XA2 XG3 file */
|
||||
meta_PS2_XA2, /* XG3 & RC Revenge Pro */
|
||||
meta_IDSP, /* Chronicles of Narnia */
|
||||
meta_IDSP2, /* Soul Calibur */
|
||||
meta_IDSP3, /* Mario Strikers Charged */
|
||||
@ -318,6 +318,7 @@ typedef enum {
|
||||
meta_PS2_VSF, /* Musashi: Samurai Legend */
|
||||
meta_PS2_VSF_TTA, /* Tiny Toon Adventures: Defenders of the Universe */
|
||||
meta_ADS, /* Gauntlet Dark Legends (GC) */
|
||||
meta_PS2_SPS, /* Ape Escape 2 */
|
||||
|
||||
meta_XBOX_WAVM, /* XBOX WAVM File */
|
||||
meta_XBOX_RIFF, /* XBOX RIFF/WAVE File */
|
||||
|
@ -235,6 +235,7 @@ char * extension_list[] = {
|
||||
"ivaud\0IVAUD Audio File (*.IVAUD)\0",
|
||||
"wsd\0WSD Audio File (*.WSD)\0",
|
||||
"ndp\0NDP Audio File (*.NDP)\0",
|
||||
"sps\0SPS Audio File (*.SPS)\0",
|
||||
};
|
||||
|
||||
void about(HWND hwndParent) {
|
||||
|
Loading…
Reference in New Issue
Block a user