mirror of
https://github.com/vgmstream/vgmstream.git
synced 2025-01-30 20:03:44 +01:00
.svs
git-svn-id: https://vgmstream.svn.sourceforge.net/svnroot/vgmstream@291 51a99a44-fe44-0410-b1ba-c3e57ba2b86b
This commit is contained in:
parent
6f241eeeaa
commit
32f6286080
@ -99,6 +99,8 @@ File types supported by this version of vgmstream:
|
||||
- .aud (IMA ADPCM, WS DPCM)
|
||||
- .ahx (MPEG-2 Layer II)
|
||||
- .ivb (PS2 ADPCM)
|
||||
- .amts (GC DSP ADPCM)
|
||||
- .svs (PS2 ADPCM)
|
||||
|
||||
Enjoy!
|
||||
-hcs
|
||||
|
@ -66,7 +66,8 @@ META_OBJS=meta/adx_header.o \
|
||||
meta/str_snds.o \
|
||||
meta/ws_aud.o \
|
||||
meta/ahx.o \
|
||||
meta/ivb.o
|
||||
meta/ivb.o \
|
||||
meta/svs.o
|
||||
|
||||
OBJECTS=vgmstream.o streamfile.o util.o $(CODING_OBJS) $(LAYOUT_OBJS) $(META_OBJS)
|
||||
|
||||
|
@ -362,6 +362,10 @@
|
||||
RelativePath=".\meta\ivb.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\meta\svs.c"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
</Filter>
|
||||
<Filter
|
||||
|
@ -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
|
||||
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
|
||||
|
||||
EXTRA_DIST = meta.h
|
||||
|
@ -105,4 +105,6 @@ VGMSTREAM * init_vgmstream_ahx(STREAMFILE * streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_ivb(STREAMFILE * streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_svs(STREAMFILE * streamFile);
|
||||
|
||||
#endif
|
||||
|
66
src/meta/svs.c
Normal file
66
src/meta/svs.c
Normal file
@ -0,0 +1,66 @@
|
||||
#include "meta.h"
|
||||
#include "../util.h"
|
||||
|
||||
/* SVS (from Unlimited Saga) */
|
||||
/* probably Square Vag Stream */
|
||||
VGMSTREAM * init_vgmstream_svs(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("svs",filename_extension(filename))) goto fail;
|
||||
|
||||
/* check header */
|
||||
if (read_32bitBE(0x00,streamFile) != 0x53565300) /* "SVS\0" */
|
||||
goto fail;
|
||||
|
||||
loop_flag = (read_32bitLE(0x08,streamFile)!=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 = 0x40;
|
||||
vgmstream->channels = channel_count;
|
||||
vgmstream->sample_rate = 44100;
|
||||
vgmstream->coding_type = coding_PSX;
|
||||
vgmstream->num_samples = (get_streamfile_size(streamFile)-0x40)*28/16/channel_count;
|
||||
if (loop_flag) {
|
||||
vgmstream->loop_start_sample = (read_32bitLE(0x08,streamFile)-2)*28;
|
||||
vgmstream->loop_end_sample = (read_32bitLE(0x0c,streamFile)-2)*28;
|
||||
}
|
||||
|
||||
vgmstream->layout_type = layout_interleave;
|
||||
vgmstream->interleave_block_size = 0x10;
|
||||
vgmstream->meta_type = meta_PS2_SVS;
|
||||
|
||||
/* 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;
|
||||
}
|
@ -68,6 +68,7 @@ VGMSTREAM * (*init_vgmstream_fcns[])(STREAMFILE *streamFile) = {
|
||||
#endif
|
||||
init_vgmstream_ivb,
|
||||
init_vgmstream_amts,
|
||||
init_vgmstream_svs,
|
||||
};
|
||||
|
||||
#define INIT_VGMSTREAM_FCNS (sizeof(init_vgmstream_fcns)/sizeof(init_vgmstream_fcns[0]))
|
||||
@ -1034,6 +1035,9 @@ void describe_vgmstream(VGMSTREAM * vgmstream, char * desc, int length) {
|
||||
case meta_PS2_IVB:
|
||||
snprintf(temp,TEMPSIZE,"IVB/BVII header");
|
||||
break;
|
||||
case meta_PS2_SVS:
|
||||
snprintf(temp,TEMPSIZE,"Square SVS header");
|
||||
break;
|
||||
default:
|
||||
snprintf(temp,TEMPSIZE,"THEY SHOULD HAVE SENT A POET");
|
||||
}
|
||||
|
@ -143,7 +143,8 @@ typedef enum {
|
||||
meta_PS2_VAGs, /* VAG Stereo from Kingdom Hearts */
|
||||
meta_PS2_VPK, /* VPK Audio File */
|
||||
meta_PS2_BMDX, /* Beatmania thing */
|
||||
meta_PS2_IVB, /* Langrisser 3 PS2 */
|
||||
meta_PS2_IVB, /* Langrisser 3 IVB */
|
||||
meta_PS2_SVS, /* Square SVS */
|
||||
|
||||
meta_XBOX_WAVM, /* XBOX WAVM File */
|
||||
meta_XBOX_RIFF, /* XBOX RIFF/WAVE File */
|
||||
|
@ -65,6 +65,8 @@ gchar *vgmstream_exts [] = {
|
||||
"aud",
|
||||
"ahx",
|
||||
"ivb",
|
||||
"amts",
|
||||
"svs",
|
||||
/* terminator */
|
||||
NULL
|
||||
};
|
||||
|
@ -124,6 +124,7 @@ char * extension_list[] = {
|
||||
"ahx\0AHX Audio File (*.AHX)\0",
|
||||
"ivb\0IVB Audio File (*.IVB)\0",
|
||||
"amts\0AMTS Audio File (*.AMTS)\0",
|
||||
"svs\0SVS Audio File (*.SVS)\0",
|
||||
};
|
||||
|
||||
void about(HWND hwndParent) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user