git-svn-id: https://vgmstream.svn.sourceforge.net/svnroot/vgmstream@289 51a99a44-fe44-0410-b1ba-c3e57ba2b86b
This commit is contained in:
halleyscometsw 2008-07-06 08:59:14 +00:00
parent bd732207d1
commit ab635fda19
10 changed files with 77 additions and 2 deletions

View File

@ -98,6 +98,7 @@ File types supported by this version of vgmstream:
- .str (SDX2 DPCM)
- .aud (IMA ADPCM, WS DPCM)
- .ahx (MPEG-2 Layer II)
- .ivb (PS2 ADPCM)
Enjoy!
-hcs

View File

@ -65,7 +65,8 @@ META_OBJS=meta/adx_header.o \
meta/aifc.o \
meta/str_snds.o \
meta/ws_aud.o \
meta/ahx.o
meta/ahx.o \
meta/ivb.o
OBJECTS=vgmstream.o streamfile.o util.o $(CODING_OBJS) $(LAYOUT_OBJS) $(META_OBJS)

View File

@ -358,6 +358,10 @@
RelativePath=".\meta\ahx.c"
>
</File>
<File
RelativePath=".\meta\ivb.c"
>
</File>
</Filter>
</Filter>
<Filter

View File

@ -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
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
EXTRA_DIST = meta.h

60
src/meta/ivb.c Normal file
View File

@ -0,0 +1,60 @@
#include "meta.h"
#include "../util.h"
/* a simple PS2 ADPCM format seen in Langrisser 3 */
VGMSTREAM * init_vgmstream_ivb(STREAMFILE *streamFile) {
VGMSTREAM * vgmstream = NULL;
char filename[260];
off_t start_offset;
off_t stream_length;
int loop_flag = 0;
int channel_count;
/* check extension, case insensitive */
streamFile->get_name(streamFile,filename,sizeof(filename));
if (strcasecmp("ivb",filename_extension(filename))) goto fail;
/* check header */
if (read_32bitBE(0x00,streamFile) != 0x42564949) /* "BVII", probably */
goto fail; /* supposed to be "IIVB"*/
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 */
vgmstream->channels = channel_count;
vgmstream->sample_rate = read_32bitBE(0x8,streamFile); /* big endian? */
vgmstream->coding_type = coding_PSX;
stream_length = read_32bitLE(0x04,streamFile);
start_offset = 0x10;
vgmstream->num_samples = stream_length*28/16;
vgmstream->layout_type = layout_none;
vgmstream->meta_type = meta_PS2_IVB;
/* open the file for reading */
{
int i;
for (i=0;i<channel_count;i++) {
vgmstream->ch[i].streamfile = streamFile->open(streamFile,filename,STREAMFILE_DEFAULT_BUFFER_SIZE);
if (!vgmstream->ch[i].streamfile) goto fail;
vgmstream->ch[i].channel_start_offset=
vgmstream->ch[i].offset=start_offset+stream_length*i;
}
}
return vgmstream;
/* clean up anything we may have opened */
fail:
if (vgmstream) close_vgmstream(vgmstream);
return NULL;
}

View File

@ -101,4 +101,6 @@ VGMSTREAM * init_vgmstream_ws_aud(STREAMFILE * streamFile);
VGMSTREAM * init_vgmstream_ahx(STREAMFILE * streamFile);
#endif
VGMSTREAM * init_vgmstream_ivb(STREAMFILE * streamFile);
#endif

View File

@ -66,6 +66,7 @@ VGMSTREAM * (*init_vgmstream_fcns[])(STREAMFILE *streamFile) = {
#ifdef VGM_USE_MPEG
init_vgmstream_ahx,
#endif
init_vgmstream_ivb,
};
#define INIT_VGMSTREAM_FCNS (sizeof(init_vgmstream_fcns)/sizeof(init_vgmstream_fcns[0]))
@ -1029,6 +1030,9 @@ void describe_vgmstream(VGMSTREAM * vgmstream, char * desc, int length) {
snprintf(temp,TEMPSIZE,"CRI AHX header");
break;
#endif
case meta_PS2_IVB:
snprintf(temp,TEMPSIZE,"IVB/BVII header");
break;
default:
snprintf(temp,TEMPSIZE,"THEY SHOULD HAVE SENT A POET");
}

View File

@ -142,6 +142,7 @@ 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_XBOX_WAVM, /* XBOX WAVM File */
meta_XBOX_RIFF, /* XBOX RIFF/WAVE File */

View File

@ -64,6 +64,7 @@ gchar *vgmstream_exts [] = {
"aifc",
"aud",
"ahx",
"ivb",
/* terminator */
NULL
};

View File

@ -122,6 +122,7 @@ char * extension_list[] = {
"aifc\0AIFC Audio File (*.AIFC)\0",
"aud\0AUD Audio File (*.AUD)\0",
"ahx\0AHX Audio File (*.AHX)\0",
"ivb\0IVB Audio File (*.IVB)\0",
};
void about(HWND hwndParent) {