.RWX added

.XWB added

git-svn-id: https://vgmstream.svn.sourceforge.net/svnroot/vgmstream@315 51a99a44-fe44-0410-b1ba-c3e57ba2b86b
This commit is contained in:
manakoAT 2008-07-14 13:08:01 +00:00
parent 2c522acc32
commit 149b7a1bab
7 changed files with 156 additions and 0 deletions

View File

@ -382,6 +382,10 @@
RelativePath=".\meta\rwsd.c"
>
</File>
<File
RelativePath=".\meta\rwx.c"
>
</File>
<File
RelativePath=".\meta\str_snds.c"
>
@ -406,6 +410,10 @@
RelativePath=".\meta\xss.c"
>
</File>
<File
RelativePath=".\meta\xwb.c"
>
</File>
</Filter>
</Filter>
<Filter

View File

@ -127,4 +127,8 @@ VGMSTREAM * init_vgmstream_rsd(STREAMFILE * streamFile);
VGMSTREAM * init_vgmstream_fsb(STREAMFILE * streamFile);
VGMSTREAM * init_vgmstream_rwx(STREAMFILE * streamFile);
VGMSTREAM * init_vgmstream_xwb(STREAMFILE * streamFile);
#endif

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

@ -0,0 +1,66 @@
#include "meta.h"
#include "../util.h"
/* RWX (found in Air Force Delta Storm (XBOX)) */
VGMSTREAM * init_vgmstream_rwx(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("rwx",filename_extension(filename))) goto fail;
/* check header */
if (read_32bitBE(0x00,streamFile) != 0x52415758)
goto fail;
loop_flag = read_32bitLE(0x0C,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 = read_32bitLE(0x04,streamFile);
vgmstream->channels = channel_count;
vgmstream->sample_rate = read_32bitLE(0x08,streamFile);
vgmstream->coding_type = coding_PCM16LE;
vgmstream->num_samples = read_32bitLE(0x10,streamFile);
if (loop_flag) {
vgmstream->loop_start_sample = read_32bitLE(0x0C,streamFile);
vgmstream->loop_end_sample = read_32bitLE(0x10,streamFile);
}
vgmstream->layout_type = layout_interleave;
vgmstream->interleave_block_size = 0x2;
vgmstream->meta_type = meta_RWX;
/* 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;
}

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

@ -0,0 +1,66 @@
#include "meta.h"
#include "../util.h"
/* XWB (found in King of Fighters 2003 (XBOX)) */
VGMSTREAM * init_vgmstream_xwb(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("xwb",filename_extension(filename))) goto fail;
/* check header */
if (read_32bitBE(0x00,streamFile) != 0x57424E44) /* WBND */
goto fail;
loop_flag = read_32bitLE(0x60,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 = read_32bitLE(0x20,streamFile);
vgmstream->channels = channel_count;
vgmstream->sample_rate = 44100; /* read_32bitLE(0x08,streamFile); */
vgmstream->coding_type = coding_PCM16LE;
vgmstream->num_samples = read_32bitLE(0x24,streamFile)/2/channel_count;
if (loop_flag) {
vgmstream->loop_start_sample = read_32bitLE(0x60,streamFile)/2/channel_count;
vgmstream->loop_end_sample = read_32bitLE(0x5C,streamFile)/2/channel_count;
}
vgmstream->layout_type = layout_interleave;
vgmstream->interleave_block_size = 0x2;
vgmstream->meta_type = meta_XWB;
/* 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

@ -79,6 +79,8 @@ VGMSTREAM * (*init_vgmstream_fcns[])(STREAMFILE *streamFile) = {
init_vgmstream_rws,
init_vgmstream_rsd,
init_vgmstream_fsb,
init_vgmstream_rwx,
init_vgmstream_xwb,
};
#define INIT_VGMSTREAM_FCNS (sizeof(init_vgmstream_fcns)/sizeof(init_vgmstream_fcns[0]))
@ -1148,6 +1150,12 @@ void describe_vgmstream(VGMSTREAM * vgmstream, char * desc, int length) {
break;
case meta_FSB:
snprintf(temp,TEMPSIZE,"FSB Header");
break;
case meta_RWX:
snprintf(temp,TEMPSIZE,"RWX Header");
break;
case meta_XWB:
snprintf(temp,TEMPSIZE,"XWB WBND Header");
break;
default:
snprintf(temp,TEMPSIZE,"THEY SHOULD HAVE SENT A POET");

View File

@ -163,6 +163,8 @@ typedef enum {
meta_RWS, /* Variuos Konami Games */
meta_RSD, /* Crash Bandicoot Games */
meta_FSB, /* FSB File (Various Games) */
meta_RWX, /* Air Force Delta Storm (XBOX) */
meta_XWB, /* King of Fighters (XBOX) */
meta_XBOX_WAVM, /* XBOX WAVM File */
meta_XBOX_RIFF, /* XBOX RIFF/WAVE File */

View File

@ -134,6 +134,8 @@ char * extension_list[] = {
"rws\0RWS Audio File (*.RWS)\0",
"rsd\0RSD Audio File (*.RSD)\0",
"fsb\0FSB Audio File (*.FSB)\0",
"rwx\0RWX Audio File (*.RWX)\0",
"xwb\0XWB Audio File (*.XWB)\0",
};
void about(HWND hwndParent) {