Rune: Viking Warlord .vgv (ps2) added

git-svn-id: https://vgmstream.svn.sourceforge.net/svnroot/vgmstream@666 51a99a44-fe44-0410-b1ba-c3e57ba2b86b
This commit is contained in:
manakoAT 2009-07-11 11:28:36 +00:00
parent ce7dd88f50
commit d01ddac99b
8 changed files with 81 additions and 3 deletions

View File

@ -199,7 +199,8 @@ META_OBJS=meta/adx_header.o \
meta/naomi_adpcm.o \
meta/sd9.o \
meta/2dx.o \
meta/ngc_dsp_ygo.o
meta/ngc_dsp_ygo.o \
meta/ps2_vgv.o
OBJECTS=vgmstream.o streamfile.o util.o $(CODING_OBJS) $(LAYOUT_OBJS) $(META_OBJS)

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Version="9,00"
Name="libvgmstream"
ProjectGUID="{54A6AD11-5369-4895-A06F-E255ABB99B11}"
RootNamespace="libvgmstream"
@ -638,6 +638,10 @@
RelativePath=".\meta\ps2_vgs.c"
>
</File>
<File
RelativePath=".\meta\ps2_vgv.c"
>
</File>
<File
RelativePath=".\meta\ps2_vpk.c"
>

View File

@ -159,5 +159,6 @@ libmeta_la_SOURCES += naomi_adpcm.c
libmeta_la_SOURCES += sd9.c
libmeta_la_SOURCES += 2dx.c
libmeta_la_SOURCES += ngc_dsp_ygo.c
libmeta_la_SOURCES += ps2_vgv.c
EXTRA_DIST = meta.h

View File

@ -395,4 +395,6 @@ VGMSTREAM * init_vgmstream_2dx(STREAMFILE * streamFile);
VGMSTREAM * init_vgmstream_dsp_ygo(STREAMFILE * streamFile);
VGMSTREAM * init_vgmstream_ps2_vgv(STREAMFILE * streamFile);
#endif

64
src/meta/ps2_vgv.c Normal file
View File

@ -0,0 +1,64 @@
#include "meta.h"
#include "../util.h"
/* VGV (from Rune: Viking Warlord) */
VGMSTREAM * init_vgmstream_ps2_vgv(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("vgv",filename_extension(filename))) goto fail;
/* check header */
if (read_32bitBE(0x08,streamFile) != 0x0)
goto fail;
if (read_32bitBE(0x0C,streamFile) != 0x0)
goto fail;
loop_flag = 0;
channel_count = 1;
/* build the VGMSTREAM */
vgmstream = allocate_vgmstream(channel_count,loop_flag);
if (!vgmstream) goto fail;
/* fill in the vital statistics */
start_offset = 0x10;
vgmstream->channels = channel_count;
vgmstream->sample_rate = read_32bitLE(0x0,streamFile);
vgmstream->coding_type = coding_PSX;
vgmstream->num_samples = (get_streamfile_size(streamFile))*28/16/channel_count;
if (loop_flag) {
vgmstream->loop_start_sample = 0;
vgmstream->loop_end_sample = (get_streamfile_size(streamFile)-start_offset)*28/16/channel_count;
}
vgmstream->layout_type = layout_none;
vgmstream->meta_type = meta_PS2_VGV;
/* 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;
}

View File

@ -217,6 +217,7 @@ VGMSTREAM * (*init_vgmstream_fcns[])(STREAMFILE *streamFile) = {
init_vgmstream_sd9,
init_vgmstream_2dx,
init_vgmstream_dsp_ygo,
init_vgmstream_ps2_vgv,
};
#define INIT_VGMSTREAM_FCNS (sizeof(init_vgmstream_fcns)/sizeof(init_vgmstream_fcns[0]))
@ -2211,7 +2212,10 @@ void describe_vgmstream(VGMSTREAM * vgmstream, char * desc, int length) {
snprintf(temp,TEMPSIZE,"beatmaniaIIDX 2DX9 header");
break;
case meta_DSP_YGO:
snprintf(temp,TEMPSIZE," Yu-Gi-Oh! The Falsebound Kingdom DSP Header");
snprintf(temp,TEMPSIZE,"Yu-Gi-Oh! The Falsebound Kingdom DSP Header");
break;
case meta_PS2_VGV:
snprintf(temp,TEMPSIZE,"Rune: Viking Warlord VGV Header");
break;
default:
snprintf(temp,TEMPSIZE,"THEY SHOULD HAVE SENT A POET");

View File

@ -399,6 +399,7 @@ typedef enum {
meta_NAOMI_ADPCM, /* NAOMI/NAOMI2 ARcade games */
meta_SD9, /* beatmaniaIIDX16 - EMPRESS (Arcade) */
meta_2DX, /* beatmaniaIIDX16 - EMPRESS (Arcade) */
meta_PS2_VGV, /* Rune: Viking Warlord */
} meta_t;
typedef struct {

View File

@ -247,6 +247,7 @@ char * extension_list[] = {
"vpk\0VPK Audio File (*.VPK)\0",
"vs\0VS Audio File (*.VS)\0",
"vsf\0VSF Audio File (*.VSF)\0",
"vgv\0VGV Audio File (*.VGV)\0",
"waa\0WAA Audio File (*.WAA)\0",
"wac\0WAC Audio File (*.WAC)\0",