mirror of
https://github.com/vgmstream/vgmstream.git
synced 2025-02-17 19:19:16 +01:00
.sfs added
.changes in musx git-svn-id: https://vgmstream.svn.sourceforge.net/svnroot/vgmstream@332 51a99a44-fe44-0410-b1ba-c3e57ba2b86b
This commit is contained in:
parent
1ace05276f
commit
dddf5701d1
@ -87,7 +87,8 @@ META_OBJS=meta/adx_header.o \
|
||||
meta/musx.o \
|
||||
meta/ps2_leg.o \
|
||||
meta/ps2_filp.o \
|
||||
meta/ps2_ikm.o
|
||||
meta/ps2_ikm.o \
|
||||
meta/ps2_sfs.o
|
||||
|
||||
OBJECTS=vgmstream.o streamfile.o util.o $(CODING_OBJS) $(LAYOUT_OBJS) $(META_OBJS)
|
||||
|
||||
|
@ -354,6 +354,10 @@
|
||||
RelativePath=".\meta\ps2_rxw.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\meta\ps2_sfs.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\meta\ps2_sl3.c"
|
||||
>
|
||||
|
@ -4,6 +4,6 @@ AM_CFLAGS = -Wall @CFLAGS@ -I$(top_builddir) -I$(top_srcdir)
|
||||
AM_MAKEFLAGS=-f Makefile.unix
|
||||
|
||||
libmeta_la_LDFLAGS =
|
||||
libmeta_la_SOURCES = Cstr.c adx_header.c afc_header.c agsc.c ast.c brstm.c ea_header.c gcsw.c halpst.c nds_strm.c ngc_adpdtk.c ngc_caf.c ngc_dsp_std.c ps2_ads.c ps2_exst.c ps2_ild.c ps2_int.c ps2_mib.c ps2_mic.c ps2_npsf.c ps2_pnb.c ps2_rxw.c ps2_str.c ps2_svag.c ps2_vag.c ps2_vpk.c psx_cdxa.c raw.c rs03.c rsf.c rwsd.c psx_gms.c xbox_xwav.c xbox_wavm.c genh.c ogg_vorbis_file.c ps2_bmdx.c aifc.c str_snds.c ws_aud.c ahx.c ivb.c svs.c riff.c pos.c nwa.c ps2_rws.c ps2_hgc1.c xss.c ps2_sl3.c ps2_aus.c fsb.c rsd.c rwx.c xwb.c ea_old.c ps2_xa30.c musc.c ps2_leg.c ps2_filp.c ps2_ikm.c musx.c
|
||||
libmeta_la_SOURCES = Cstr.c adx_header.c afc_header.c agsc.c ast.c brstm.c ea_header.c gcsw.c halpst.c nds_strm.c ngc_adpdtk.c ngc_caf.c ngc_dsp_std.c ps2_ads.c ps2_exst.c ps2_ild.c ps2_int.c ps2_mib.c ps2_mic.c ps2_npsf.c ps2_pnb.c ps2_rxw.c ps2_str.c ps2_svag.c ps2_vag.c ps2_vpk.c psx_cdxa.c raw.c rs03.c rsf.c rwsd.c psx_gms.c xbox_xwav.c xbox_wavm.c genh.c ogg_vorbis_file.c ps2_bmdx.c aifc.c str_snds.c ws_aud.c ahx.c ivb.c svs.c riff.c pos.c nwa.c ps2_rws.c ps2_hgc1.c xss.c ps2_sl3.c ps2_aus.c fsb.c rsd.c rwx.c xwb.c ea_old.c ps2_xa30.c musc.c ps2_leg.c ps2_filp.c ps2_ikm.c musx.c ps2_sfs.c
|
||||
|
||||
EXTRA_DIST = meta.h
|
||||
|
@ -145,4 +145,6 @@ VGMSTREAM * init_vgmstream_filp(STREAMFILE * streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_ikm(STREAMFILE * streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_sfs(STREAMFILE * streamFile);
|
||||
|
||||
#endif
|
||||
|
@ -1,57 +1,61 @@
|
||||
#include "meta.h"
|
||||
#include "../util.h"
|
||||
|
||||
/* MUSC/MUSX (near all Spyro games and many other using this) */
|
||||
/* SVS (from Unlimited Saga) */
|
||||
/* probably Square Vag Stream */
|
||||
VGMSTREAM * init_vgmstream_musx(STREAMFILE *streamFile) {
|
||||
VGMSTREAM * vgmstream = NULL;
|
||||
char filename[260];
|
||||
off_t start_offset;
|
||||
|
||||
int musc_version;
|
||||
int loop_flag = 0;
|
||||
int channel_count = 2;
|
||||
int musx_version; /* 0x08 provides a "version" byte??? */
|
||||
int musx_type;
|
||||
int loop_flag = 0;
|
||||
int channel_count;
|
||||
|
||||
/* check extension, case insensitive */
|
||||
streamFile->get_name(streamFile,filename,sizeof(filename));
|
||||
if (strcasecmp("musx",filename_extension(filename))) goto fail;
|
||||
|
||||
/* check header */
|
||||
if (read_32bitBE(0x0,streamFile) != 0x4D555343) /* MUSC */
|
||||
goto fail;
|
||||
if (read_32bitBE(0x00,streamFile) != 0x4D555358) /* "MUSX" */
|
||||
goto fail;
|
||||
|
||||
loop_flag = 0; /* (read_32bitLE(0x08,streamFile)!=0); */
|
||||
loop_flag = (read_32bitLE(0x840,streamFile)!=0xFFFFFFFF);
|
||||
channel_count = 2;
|
||||
|
||||
/* build the VGMSTREAM */
|
||||
vgmstream = allocate_vgmstream(channel_count,loop_flag);
|
||||
if (!vgmstream) goto fail;
|
||||
|
||||
/* fill in the vital statistics */
|
||||
musx_type=(read_32bitBE(0x10,streamFile));
|
||||
|
||||
musc_version=read_32bitLE(0x10,streamFile);
|
||||
switch (musc_version) {
|
||||
/* This handles the 'new' MUSC Version, which has only a 32 byte header
|
||||
and doesn't provide any loop info!
|
||||
Spyro - The Eternal Night, Spyro - A new Beginning, Ty - The Tsamanian Tiger */
|
||||
case 0x20:
|
||||
start_offset = 0x20;
|
||||
switch (musx_type) {
|
||||
case 0x5053325F: /* PS2_ */
|
||||
start_offset = read_32bitLE(0x28,streamFile);
|
||||
vgmstream->channels = channel_count;
|
||||
vgmstream->sample_rate = 32000;
|
||||
vgmstream->coding_type = coding_PSX;
|
||||
vgmstream->num_samples = (read_32bitLE(0x14,streamFile))*28/16/channel_count;
|
||||
vgmstream->num_samples = (read_32bitLE(0x0C,streamFile))*28/16/channel_count;;
|
||||
vgmstream->layout_type = layout_interleave;
|
||||
vgmstream->interleave_block_size = 0x80;
|
||||
vgmstream->meta_type = meta_MUSX;
|
||||
if (loop_flag) {
|
||||
vgmstream->loop_start_sample = 0; /*(read_32bitLE(0x08,streamFile)-1)*28; */
|
||||
vgmstream->loop_end_sample = (read_32bitLE(0x14,streamFile))*28/16/channel_count;
|
||||
}
|
||||
vgmstream->loop_start_sample = (read_32bitLE(0x890,streamFile))*28/16/channel_count;
|
||||
vgmstream->loop_end_sample = (read_32bitLE(0x89C,streamFile))*28/16/channel_count;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
break;
|
||||
default:
|
||||
goto fail;
|
||||
}
|
||||
vgmstream->channels = channel_count;
|
||||
vgmstream->sample_rate = read_32bitLE(0x06,streamFile);
|
||||
vgmstream->layout_type = layout_interleave;
|
||||
vgmstream->interleave_block_size = (read_32bitLE(0x18,streamFile))/2;
|
||||
vgmstream->meta_type = meta_MUSX;
|
||||
|
||||
|
||||
|
||||
/* open the file for reading */
|
||||
|
||||
}
|
||||
|
||||
/* open the file for reading */
|
||||
{
|
||||
int i;
|
||||
STREAMFILE * file;
|
||||
|
65
src/meta/ps2_sfs.c
Normal file
65
src/meta/ps2_sfs.c
Normal file
@ -0,0 +1,65 @@
|
||||
#include "meta.h"
|
||||
#include "../util.h"
|
||||
|
||||
/* SFS (from Baroque) */
|
||||
VGMSTREAM * init_vgmstream_sfs(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("sfs",filename_extension(filename))) goto fail;
|
||||
|
||||
/* check header */
|
||||
if (read_32bitBE(0x00,streamFile) != 0x53544552) /* "STER" */
|
||||
goto fail;
|
||||
|
||||
loop_flag = (read_32bitLE(0x08,streamFile)!=0xFFFFFFFF);
|
||||
channel_count = 2;
|
||||
|
||||
/* build the VGMSTREAM */
|
||||
vgmstream = allocate_vgmstream(channel_count,loop_flag);
|
||||
if (!vgmstream) goto fail;
|
||||
|
||||
/* fill in the vital statistics */
|
||||
start_offset = 0x30;
|
||||
vgmstream->channels = channel_count;
|
||||
vgmstream->sample_rate = read_32bitBE(0x10,streamFile);
|
||||
vgmstream->coding_type = coding_PSX;
|
||||
vgmstream->num_samples = (read_32bitLE(0x04,streamFile)*2)*28/16/channel_count;
|
||||
if (loop_flag) {
|
||||
vgmstream->loop_start_sample = (read_32bitLE(0x08,streamFile)*2)*28/16/channel_count;
|
||||
vgmstream->loop_end_sample = (read_32bitLE(0x04,streamFile)*2)*28/16/channel_count;
|
||||
}
|
||||
|
||||
vgmstream->layout_type = layout_interleave;
|
||||
vgmstream->interleave_block_size = 0x10;
|
||||
vgmstream->meta_type = meta_SFS;
|
||||
|
||||
/* 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;
|
||||
}
|
@ -88,6 +88,7 @@ VGMSTREAM * (*init_vgmstream_fcns[])(STREAMFILE *streamFile) = {
|
||||
init_vgmstream_leg,
|
||||
init_vgmstream_filp,
|
||||
init_vgmstream_ikm,
|
||||
init_vgmstream_sfs,
|
||||
};
|
||||
|
||||
#define INIT_VGMSTREAM_FCNS (sizeof(init_vgmstream_fcns)/sizeof(init_vgmstream_fcns[0]))
|
||||
@ -1283,6 +1284,9 @@ void describe_vgmstream(VGMSTREAM * vgmstream, char * desc, int length) {
|
||||
break;
|
||||
case meta_IKM:
|
||||
snprintf(temp,TEMPSIZE,"Zwei! IKM Header");
|
||||
break;
|
||||
case meta_SFS:
|
||||
snprintf(temp,TEMPSIZE,"Baroque SFS Header");
|
||||
break;
|
||||
default:
|
||||
snprintf(temp,TEMPSIZE,"THEY SHOULD HAVE SENT A POET");
|
||||
|
@ -184,6 +184,7 @@ typedef enum {
|
||||
meta_LEG, /* Legaia 2 */
|
||||
meta_FILP, /* Resident Evil - Dead Aim */
|
||||
meta_IKM, /* Zwei! */
|
||||
meta_SFS, /* Baroque */
|
||||
|
||||
meta_XBOX_WAVM, /* XBOX WAVM File */
|
||||
meta_XBOX_RIFF, /* XBOX RIFF/WAVE File */
|
||||
|
@ -144,6 +144,7 @@ char * extension_list[] = {
|
||||
"leg\0LEG Audio File (*.LEG)\0",
|
||||
"filp\0FILP Audio File (*.FILP)\0",
|
||||
"ikm\0IKM Audio File (*.IKM)\0",
|
||||
"sfs\0SFS Audio File (*.SFS)\0",
|
||||
};
|
||||
|
||||
void about(HWND hwndParent) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user