.xa30 added

git-svn-id: https://vgmstream.svn.sourceforge.net/svnroot/vgmstream@325 51a99a44-fe44-0410-b1ba-c3e57ba2b86b
This commit is contained in:
manakoAT 2008-07-15 03:39:20 +00:00
parent 39015ff43a
commit b554e6ec45
7 changed files with 88 additions and 11 deletions

View File

@ -354,6 +354,10 @@
RelativePath=".\meta\ps2_vpk.c"
>
</File>
<File
RelativePath=".\meta\ps2_xa30.c"
>
</File>
<File
RelativePath=".\meta\psx_cdxa.c"
>

View File

@ -42,33 +42,33 @@ VGMSTREAM * init_vgmstream_fsb(STREAMFILE *streamFile) {
vgmstream->interleave_block_size = 0x10;
vgmstream->num_samples = (read_32bitLE(0x0C,streamFile))*28/16/channel_count;
if (loop_flag) {
vgmstream->loop_start_sample = 0;
vgmstream->loop_start_sample = read_32bitLE(0x40,streamFile);
vgmstream->loop_end_sample = (read_32bitLE(0x0C,streamFile))*28/16/channel_count;
}
break;
case 0x02000806: /* WII (Metroid Prime 3) */
case 0x01000806: /* WII (Metroid Prime 3) */
case 0x40000802: /* WII (WWE Smackdown Vs. Raw 2008) */
vgmstream->num_samples = (read_32bitLE(0x0C,streamFile))*14/8/channel_count;
if (loop_flag) {
vgmstream->loop_start_sample = read_32bitLE(0x40,streamFile);
vgmstream->loop_end_sample = read_32bitLE(0x44,streamFile);
}
vgmstream->coding_type = coding_NGC_DSP;
vgmstream->layout_type = layout_interleave_byte;
vgmstream->interleave_block_size = 2;
vgmstream->num_samples = (read_32bitLE(0x0C,streamFile))*14/8/channel_count;
if (loop_flag) {
vgmstream->loop_start_sample = read_32bitLE(0x40,streamFile);
vgmstream->loop_end_sample = (read_32bitLE(0x0C,streamFile))*14/8/channel_count;
}
break;
case 0x40004020: /* WII (Guitar Hero III), uses Xbox-ish IMA */
case 0x400040A0: /* WII (Guitar Hero III), uses Xbox-ish IMA */
case 0x41004800: /* XBOX (FlatOut) */
vgmstream->num_samples = read_32bitLE(0x44,streamFile);
if (loop_flag) {
vgmstream->loop_start_sample = read_32bitLE(0x40,streamFile)*64/36/channel_count;
vgmstream->loop_end_sample = read_32bitLE(0x44,streamFile);
}
vgmstream->coding_type = coding_XBOX;
vgmstream->layout_type = layout_interleave;
vgmstream->interleave_block_size = 36;
vgmstream->num_samples = read_32bitLE(0x0C,streamFile)*64/36/channel_count;
if (loop_flag) {
vgmstream->loop_start_sample = read_32bitLE(0x40,streamFile);
vgmstream->loop_end_sample = read_32bitLE(0x0C,streamFile)*64/36/channel_count;
}
break;
default:
goto fail;

View File

@ -133,4 +133,6 @@ VGMSTREAM * init_vgmstream_rwx(STREAMFILE * streamFile);
VGMSTREAM * init_vgmstream_xwb(STREAMFILE * streamFile);
VGMSTREAM * init_vgmstream_xa30(STREAMFILE * streamFile);
#endif

65
src/meta/ps2_xa30.c Normal file
View File

@ -0,0 +1,65 @@
#include "meta.h"
#include "../util.h"
/* XA30 (found in Driver - Parallel Lines) */
VGMSTREAM * init_vgmstream_xa30(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("xa30",filename_extension(filename))) goto fail;
/* check header */
if (read_32bitBE(0x00,streamFile) != 0x58413330) /* "XA30 */
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 = read_32bitLE(0x0C,streamFile);
vgmstream->channels = channel_count;
vgmstream->sample_rate = 22050;
vgmstream->coding_type = coding_PSX;
vgmstream->num_samples = read_32bitLE(0x14,streamFile)*28/16/channel_count;
if (loop_flag) {
vgmstream->loop_start_sample = 0;
vgmstream->loop_end_sample = read_32bitLE(0x14,streamFile)*28/16/channel_count;
}
vgmstream->layout_type = layout_none;
/* vgmstream->interleave_block_size = 0x10; */
vgmstream->meta_type = meta_XA30;
/* 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

@ -82,6 +82,7 @@ VGMSTREAM * (*init_vgmstream_fcns[])(STREAMFILE *streamFile) = {
init_vgmstream_fsb,
init_vgmstream_rwx,
init_vgmstream_xwb,
init_vgmstream_xa30,
};
#define INIT_VGMSTREAM_FCNS (sizeof(init_vgmstream_fcns)/sizeof(init_vgmstream_fcns[0]))
@ -1256,6 +1257,9 @@ void describe_vgmstream(VGMSTREAM * vgmstream, char * desc, int length) {
break;
case meta_XWB:
snprintf(temp,TEMPSIZE,"XWB WBND Header");
break;
case meta_XA30:
snprintf(temp,TEMPSIZE,"XA30 Header");
break;
default:
snprintf(temp,TEMPSIZE,"THEY SHOULD HAVE SENT A POET");

View File

@ -178,6 +178,7 @@ typedef enum {
meta_FSB3, /* FMOD Sample Bank, version 3 */
meta_RWX, /* Air Force Delta Storm (XBOX) */
meta_XWB, /* King of Fighters (XBOX) */
meta_XA30, /* Driver - Parallel Lines (PS2) */
meta_XBOX_WAVM, /* XBOX WAVM File */
meta_XBOX_RIFF, /* XBOX RIFF/WAVE File */

View File

@ -138,6 +138,7 @@ char * extension_list[] = {
"fsb\0FSB Audio File (*.FSB)\0",
"rwx\0RWX Audio File (*.RWX)\0",
"xwb\0XWB Audio File (*.XWB)\0",
"xa30\0XA30 Audio File (*.XA30)\0",
};
void about(HWND hwndParent) {