Added .PAST support for Bakugan Battle Brawlers (PS3)

Added a few things to fb2k stuff

git-svn-id: https://vgmstream.svn.sourceforge.net/svnroot/vgmstream@865 51a99a44-fe44-0410-b1ba-c3e57ba2b86b
This commit is contained in:
bxaimc 2010-10-12 00:16:49 +00:00
parent 27f2f1fcf4
commit bbb6d6fc3c
10 changed files with 89 additions and 2 deletions

View File

@ -363,6 +363,7 @@ bool input_vgmstream::g_is_our_path(const char * p_path,const char * p_extension
if(!stricmp_utf8(p_extension,"mpdsp")) return 1; if(!stricmp_utf8(p_extension,"mpdsp")) return 1;
if(!stricmp_utf8(p_extension,"mpds")) return 1; if(!stricmp_utf8(p_extension,"mpds")) return 1;
if(!stricmp_utf8(p_extension,"msa")) return 1; if(!stricmp_utf8(p_extension,"msa")) return 1;
if(!stricmp_utf8(p_extension,"msf")) return 1;
if(!stricmp_utf8(p_extension,"mss")) return 1; if(!stricmp_utf8(p_extension,"mss")) return 1;
if(!stricmp_utf8(p_extension,"msvp")) return 1; if(!stricmp_utf8(p_extension,"msvp")) return 1;
if(!stricmp_utf8(p_extension,"mus")) return 1; if(!stricmp_utf8(p_extension,"mus")) return 1;
@ -380,6 +381,7 @@ bool input_vgmstream::g_is_our_path(const char * p_path,const char * p_extension
if(!stricmp_utf8(p_extension,"p2bt")) return 1; if(!stricmp_utf8(p_extension,"p2bt")) return 1;
if(!stricmp_utf8(p_extension,"p3d")) return 1; if(!stricmp_utf8(p_extension,"p3d")) return 1;
if(!stricmp_utf8(p_extension,"past")) return 1;
if(!stricmp_utf8(p_extension,"pcm")) return 1; if(!stricmp_utf8(p_extension,"pcm")) return 1;
if(!stricmp_utf8(p_extension,"pdt")) return 1; if(!stricmp_utf8(p_extension,"pdt")) return 1;
if(!stricmp_utf8(p_extension,"pnb")) return 1; if(!stricmp_utf8(p_extension,"pnb")) return 1;
@ -646,6 +648,7 @@ DECLARE_MULTIPLE_FILE_TYPE("MIHB Audio File (*.MIHB)", mihb);
DECLARE_MULTIPLE_FILE_TYPE("MPDSP Audio File (*.MPDSP)", mpdsp); DECLARE_MULTIPLE_FILE_TYPE("MPDSP Audio File (*.MPDSP)", mpdsp);
DECLARE_MULTIPLE_FILE_TYPE("MPDS Audio File (*.MPDS)", mpds); DECLARE_MULTIPLE_FILE_TYPE("MPDS Audio File (*.MPDS)", mpds);
DECLARE_MULTIPLE_FILE_TYPE("MSA Audio File (*.MSA)", msa); DECLARE_MULTIPLE_FILE_TYPE("MSA Audio File (*.MSA)", msa);
DECLARE_MULTIPLE_FILE_TYPE("MSF Audio File (*.MSF)", msf);
DECLARE_MULTIPLE_FILE_TYPE("MSS Audio File (*.MSS)", mss); DECLARE_MULTIPLE_FILE_TYPE("MSS Audio File (*.MSS)", mss);
DECLARE_MULTIPLE_FILE_TYPE("MSVP Audio File (*.MSVP)", msvp); DECLARE_MULTIPLE_FILE_TYPE("MSVP Audio File (*.MSVP)", msvp);
DECLARE_MULTIPLE_FILE_TYPE("MUS Playlist File (*.MUS)", mus); DECLARE_MULTIPLE_FILE_TYPE("MUS Playlist File (*.MUS)", mus);
@ -663,6 +666,7 @@ DECLARE_MULTIPLE_FILE_TYPE("OMU Audio File (*.OMU)", omu);
DECLARE_MULTIPLE_FILE_TYPE("P2BT Audio File (*.P2BT)", p2bt); DECLARE_MULTIPLE_FILE_TYPE("P2BT Audio File (*.P2BT)", p2bt);
DECLARE_MULTIPLE_FILE_TYPE("P3D Audio File (*.P3D)", p3d); DECLARE_MULTIPLE_FILE_TYPE("P3D Audio File (*.P3D)", p3d);
DECLARE_MULTIPLE_FILE_TYPE("PAST Audio File (*.PAST)", past);
DECLARE_MULTIPLE_FILE_TYPE("PCM Audio File (*.PCM)", pcm); DECLARE_MULTIPLE_FILE_TYPE("PCM Audio File (*.PCM)", pcm);
DECLARE_MULTIPLE_FILE_TYPE("PDT Audio File (*.PDT)", pdt); DECLARE_MULTIPLE_FILE_TYPE("PDT Audio File (*.PDT)", pdt);
DECLARE_MULTIPLE_FILE_TYPE("PNB Audio File (*.PNB)", pnb); DECLARE_MULTIPLE_FILE_TYPE("PNB Audio File (*.PNB)", pnb);

View File

@ -257,7 +257,8 @@ META_OBJS=meta/adx_header.o \
meta/ngc_nst_dsp.o \ meta/ngc_nst_dsp.o \
meta/baf.o \ meta/baf.o \
meta/ps3_msf.o \ meta/ps3_msf.o \
meta/nub.o meta/nub.o \
meta/ps3_past.o
OBJECTS=vgmstream.o streamfile.o util.o $(CODING_OBJS) $(LAYOUT_OBJS) $(META_OBJS) OBJECTS=vgmstream.o streamfile.o util.o $(CODING_OBJS) $(LAYOUT_OBJS) $(META_OBJS)

View File

@ -826,6 +826,10 @@
RelativePath=".\meta\ps3_msf.c" RelativePath=".\meta\ps3_msf.c"
> >
</File> </File>
<File
RelativePath=".\meta\ps3_past.c"
>
</File>
<File <File
RelativePath=".\meta\ps3_xvag.c" RelativePath=".\meta\ps3_xvag.c"
> >

View File

@ -210,5 +210,6 @@ libmeta_la_SOURCES += ngc_nst_dsp.c
libmeta_la_SOURCES += baf.c libmeta_la_SOURCES += baf.c
libmeta_la_SOURCES += ps3_msf.c libmeta_la_SOURCES += ps3_msf.c
libmeta_la_SOURCES += nub.c libmeta_la_SOURCES += nub.c
libmeta_la_SOURCES += ps3_past.c
EXTRA_DIST = meta.h EXTRA_DIST = meta.h

View File

@ -535,4 +535,7 @@ VGMSTREAM * init_vgmstream_ngc_dsp_iadp(STREAMFILE* streamFile);
VGMSTREAM * init_vgmstream_nub_vag(STREAMFILE* streamFile); VGMSTREAM * init_vgmstream_nub_vag(STREAMFILE* streamFile);
VGMSTREAM * init_vgmstream_ps3_past(STREAMFILE* streamFile);
#endif #endif

66
src/meta/ps3_past.c Normal file
View File

@ -0,0 +1,66 @@
#include "meta.h"
#include "../util.h"
/* .PAST (Bakugan Battle Brawlers */
VGMSTREAM * init_vgmstream_ps3_past(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("past",filename_extension(filename))) goto fail;
/* check header */
if (read_32bitBE(0x0,streamFile) != 0x534E4450) /* SNDP */
goto fail;
loop_flag = read_32bitLE(0x1C,streamFile);
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_PCM16LE;
vgmstream->num_samples = (read_32bitBE(0x14,streamFile))/2/channel_count;
if (loop_flag) {
vgmstream->loop_start_sample = read_32bitBE(0x18,streamFile)/2/channel_count;
vgmstream->loop_end_sample = vgmstream->num_samples;
}
vgmstream->layout_type = layout_interleave;
vgmstream->interleave_block_size = 0x2;
vgmstream->meta_type = meta_PS3_PAST;
/* 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;
fail:
/* clean up anything we may have opened */
if (vgmstream) close_vgmstream(vgmstream);
return NULL;
}

View File

@ -289,6 +289,7 @@ VGMSTREAM * (*init_vgmstream_fcns[])(STREAMFILE *streamFile) = {
init_vgmstream_ps3_msf, init_vgmstream_ps3_msf,
init_vgmstream_fsb_mpeg, init_vgmstream_fsb_mpeg,
init_vgmstream_nub_vag, init_vgmstream_nub_vag,
init_vgmstream_ps3_past,
}; };
@ -2703,6 +2704,9 @@ void describe_vgmstream(VGMSTREAM * vgmstream, char * desc, int length) {
break; break;
case meta_NUB_VAG: case meta_NUB_VAG:
snprintf(temp,TEMPSIZE,"VAG (NUB) header"); snprintf(temp,TEMPSIZE,"VAG (NUB) header");
break;
case meta_PS3_PAST:
snprintf(temp,TEMPSIZE,"SNDP header");
break; break;
default: default:
snprintf(temp,TEMPSIZE,"THEY SHOULD HAVE SENT A POET"); snprintf(temp,TEMPSIZE,"THEY SHOULD HAVE SENT A POET");

View File

@ -492,7 +492,8 @@ typedef enum {
meta_PS2_MTAF, /* Metal Gear 3 MTAF */ meta_PS2_MTAF, /* Metal Gear 3 MTAF */
meta_PS3_CPS, /* Eternal Sonata (PS3) */ meta_PS3_CPS, /* Eternal Sonata (PS3) */
meta_PS3_MSF, /* MSF header */ meta_PS3_MSF, /* MSF header */
meta_NUB_VAG /* VAG from Nub archives */ meta_NUB_VAG, /* VAG from Nub archives */
meta_PS3_PAST, /* Bakugan Battle Brawlers (PS3) */
} meta_t; } meta_t;
typedef struct { typedef struct {

View File

@ -125,6 +125,7 @@ gchar *vgmstream_exts [] = {
"mpdsp", "mpdsp",
"mpds", "mpds",
"msa", "msa",
"msf",
"mss", "mss",
"msvp", "msvp",
"mus", "mus",
@ -142,6 +143,7 @@ gchar *vgmstream_exts [] = {
"p2bt", "p2bt",
"p3d", "p3d",
"past",
"pcm", "pcm",
"pdt", "pdt",
"pnb", "pnb",

View File

@ -209,6 +209,7 @@ char * extension_list[] = {
"p2bt\0P2BT Audio File (*.P2BT)\0", "p2bt\0P2BT Audio File (*.P2BT)\0",
"p3d\0P3D Audio File (*.P3D)\0", "p3d\0P3D Audio File (*.P3D)\0",
"past\0PAST Audio File (*.PAST)\0",
"pcm\0PCM Audio File (*.PCM)\0", "pcm\0PCM Audio File (*.PCM)\0",
"pdt\0PDT Audio File (*.PDT)\0", "pdt\0PDT Audio File (*.PDT)\0",
"pnb\0PNB Audio File (*.PNB)\0", "pnb\0PNB Audio File (*.PNB)\0",