Added .LPS from Rave Master (Groove Adventure Rave)(GC)

git-svn-id: https://vgmstream.svn.sourceforge.net/svnroot/vgmstream@640 51a99a44-fe44-0410-b1ba-c3e57ba2b86b
This commit is contained in:
bxaimc 2009-04-29 20:24:39 +00:00
parent 5a7e89be6a
commit e27b380369
9 changed files with 88 additions and 3 deletions

View File

@ -193,7 +193,8 @@ META_OBJS=meta/adx_header.o \
meta/ivaud.o \
meta/wii_ndp.o \
meta/ps2_sps.o \
meta/nds_hwas.o
meta/nds_hwas.o \
meta/ngc_lps.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"
@ -410,6 +410,10 @@
RelativePath=".\meta\ngc_ffcc_str.c"
>
</File>
<File
RelativePath=".\meta\ngc_lps.c"
>
</File>
<File
RelativePath=".\meta\ngc_pdt.c"
>

View File

@ -153,5 +153,6 @@ libmeta_la_SOURCES += ps2_vgs.c
libmeta_la_SOURCES += wii_ndp.c
libmeta_la_SOURCES += ps2_sps.c
libmeta_la_SOURCES += nds_hwas.c
libmeta_la_SOURCES += ngc_lps.c
EXTRA_DIST = meta.h

View File

@ -377,4 +377,6 @@ VGMSTREAM * init_vgmstream_nds_hwas(STREAMFILE *streamFile);
VGMSTREAM * init_vgmstream_rsd3vag(STREAMFILE * streamFile);
VGMSTREAM * init_vgmstream_ngc_lps(STREAMFILE * streamFile);
#endif

69
src/meta/ngc_lps.c Normal file
View File

@ -0,0 +1,69 @@
#include "meta.h"
#include "../util.h"
/* LPS (found in Rave Master (Groove Adventure Rave)(GC) */
VGMSTREAM * init_vgmstream_ngc_lps(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("lps",filename_extension(filename))) goto fail;
/* check header */
if (read_32bitBE(0x8,streamFile) != 0x10000000)
goto fail;
loop_flag = read_32bitBE(0x30,streamFile);
channel_count = 1;
/* build the VGMSTREAM */
vgmstream = allocate_vgmstream(channel_count,loop_flag);
if (!vgmstream) goto fail;
/* fill in the vital statistics */
start_offset = 0x60;
vgmstream->channels = channel_count;
vgmstream->sample_rate = read_32bitBE(0x28,streamFile);
vgmstream->coding_type = coding_NGC_DSP;
vgmstream->num_samples = (read_32bitBE(0x34,streamFile))/16*14;
if (loop_flag) {
vgmstream->loop_start_sample = (read_32bitBE(0x30,streamFile))/16*14;
vgmstream->loop_end_sample = vgmstream->num_samples;
}
vgmstream->layout_type = layout_none;
vgmstream->meta_type = meta_NGC_LPS;
if (vgmstream->coding_type == coding_NGC_DSP) {
int i;
for (i=0;i<16;i++) {
vgmstream->ch[0].adpcm_coef[i] = read_16bitBE(0x3C+i*2,streamFile);
}
}
/* 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

@ -208,6 +208,7 @@ VGMSTREAM * (*init_vgmstream_fcns[])(STREAMFILE *streamFile) = {
init_vgmstream_ps2_sps,
init_vgmstream_ps2_xa2_rrp,
init_vgmstream_nds_hwas,
init_vgmstream_ngc_lps,
};
#define INIT_VGMSTREAM_FCNS (sizeof(init_vgmstream_fcns)/sizeof(init_vgmstream_fcns[0]))
@ -238,7 +239,8 @@ VGMSTREAM * init_vgmstream_internal(STREAMFILE *streamFile, int do_dfs) {
(vgmstream->meta_type == meta_PS2_VAGp) ||
(vgmstream->meta_type == meta_GENH) ||
(vgmstream->meta_type == meta_KRAW) ||
(vgmstream->meta_type == meta_PS2_MIB)
(vgmstream->meta_type == meta_PS2_MIB) ||
(vgmstream->meta_type == meta_NGC_LPS)
) && vgmstream->channels == 1) {
try_dual_file_stereo(vgmstream, streamFile);
}
@ -2159,6 +2161,9 @@ void describe_vgmstream(VGMSTREAM * vgmstream, char * desc, int length) {
break;
case meta_NDS_HWAS:
snprintf(temp,TEMPSIZE,"NDS 'HWAS' Header");
break;
case meta_NGC_LPS:
snprintf(temp,TEMPSIZE,"Rave Master LPS Header");
break;
snprintf(temp,TEMPSIZE,"THEY SHOULD HAVE SENT A POET");
break;

View File

@ -388,6 +388,7 @@ typedef enum {
meta_RedSpark, /* "RedSpark" RSD (MadWorld) */
meta_PC_IVAUD, /* .ivaud GTA IV */
meta_NDS_HWAS, /* Spider-Man 3, Tony Hawk's Downhill Jam, possibly more... */
meta_NGC_LPS, /* Rave Master (Groove Adventure Rave)(GC) */
} meta_t;
typedef struct {

View File

@ -171,6 +171,7 @@ gchar *vgmstream_exts [] = {
"wsd",
"ndp",
"sps",
"lps",
/* terminator */
NULL
};

View File

@ -143,6 +143,7 @@ char * extension_list[] = {
"ikm\0IKM Audio File (*.IKM)\0",
"ild\0ILD Audio File (*.ILD)\0",
"int\0PS2 RAW Interleaved PCM (*.INT)\0",
"lps\0LPS Audio File (*.LPS)\0",
"isd\0ISD Audio File (*.ISD)\0",
"ivaud\0IVAUD Audio File (*.IVAUD)\0",
"ivb\0IVB Audio File (*.IVB)\0",