mirror of
https://github.com/vgmstream/vgmstream.git
synced 2024-11-24 15:00:11 +01:00
.xa30 added
git-svn-id: https://vgmstream.svn.sourceforge.net/svnroot/vgmstream@325 51a99a44-fe44-0410-b1ba-c3e57ba2b86b
This commit is contained in:
parent
39015ff43a
commit
b554e6ec45
@ -354,6 +354,10 @@
|
|||||||
RelativePath=".\meta\ps2_vpk.c"
|
RelativePath=".\meta\ps2_vpk.c"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\meta\ps2_xa30.c"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\meta\psx_cdxa.c"
|
RelativePath=".\meta\psx_cdxa.c"
|
||||||
>
|
>
|
||||||
|
@ -42,33 +42,33 @@ VGMSTREAM * init_vgmstream_fsb(STREAMFILE *streamFile) {
|
|||||||
vgmstream->interleave_block_size = 0x10;
|
vgmstream->interleave_block_size = 0x10;
|
||||||
vgmstream->num_samples = (read_32bitLE(0x0C,streamFile))*28/16/channel_count;
|
vgmstream->num_samples = (read_32bitLE(0x0C,streamFile))*28/16/channel_count;
|
||||||
if (loop_flag) {
|
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;
|
vgmstream->loop_end_sample = (read_32bitLE(0x0C,streamFile))*28/16/channel_count;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 0x02000806: /* WII (Metroid Prime 3) */
|
case 0x02000806: /* WII (Metroid Prime 3) */
|
||||||
case 0x01000806: /* WII (Metroid Prime 3) */
|
case 0x01000806: /* WII (Metroid Prime 3) */
|
||||||
case 0x40000802: /* WII (WWE Smackdown Vs. Raw 2008) */
|
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->coding_type = coding_NGC_DSP;
|
||||||
vgmstream->layout_type = layout_interleave_byte;
|
vgmstream->layout_type = layout_interleave_byte;
|
||||||
vgmstream->interleave_block_size = 2;
|
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;
|
break;
|
||||||
case 0x40004020: /* WII (Guitar Hero III), uses Xbox-ish IMA */
|
case 0x40004020: /* WII (Guitar Hero III), uses Xbox-ish IMA */
|
||||||
case 0x400040A0: /* WII (Guitar Hero III), uses Xbox-ish IMA */
|
case 0x400040A0: /* WII (Guitar Hero III), uses Xbox-ish IMA */
|
||||||
case 0x41004800: /* XBOX (FlatOut) */
|
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->coding_type = coding_XBOX;
|
||||||
vgmstream->layout_type = layout_interleave;
|
vgmstream->layout_type = layout_interleave;
|
||||||
vgmstream->interleave_block_size = 36;
|
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;
|
break;
|
||||||
default:
|
default:
|
||||||
goto fail;
|
goto fail;
|
||||||
|
@ -133,4 +133,6 @@ VGMSTREAM * init_vgmstream_rwx(STREAMFILE * streamFile);
|
|||||||
|
|
||||||
VGMSTREAM * init_vgmstream_xwb(STREAMFILE * streamFile);
|
VGMSTREAM * init_vgmstream_xwb(STREAMFILE * streamFile);
|
||||||
|
|
||||||
|
VGMSTREAM * init_vgmstream_xa30(STREAMFILE * streamFile);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
65
src/meta/ps2_xa30.c
Normal file
65
src/meta/ps2_xa30.c
Normal 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;
|
||||||
|
}
|
@ -82,6 +82,7 @@ VGMSTREAM * (*init_vgmstream_fcns[])(STREAMFILE *streamFile) = {
|
|||||||
init_vgmstream_fsb,
|
init_vgmstream_fsb,
|
||||||
init_vgmstream_rwx,
|
init_vgmstream_rwx,
|
||||||
init_vgmstream_xwb,
|
init_vgmstream_xwb,
|
||||||
|
init_vgmstream_xa30,
|
||||||
};
|
};
|
||||||
|
|
||||||
#define INIT_VGMSTREAM_FCNS (sizeof(init_vgmstream_fcns)/sizeof(init_vgmstream_fcns[0]))
|
#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;
|
break;
|
||||||
case meta_XWB:
|
case meta_XWB:
|
||||||
snprintf(temp,TEMPSIZE,"XWB WBND Header");
|
snprintf(temp,TEMPSIZE,"XWB WBND Header");
|
||||||
|
break;
|
||||||
|
case meta_XA30:
|
||||||
|
snprintf(temp,TEMPSIZE,"XA30 Header");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
snprintf(temp,TEMPSIZE,"THEY SHOULD HAVE SENT A POET");
|
snprintf(temp,TEMPSIZE,"THEY SHOULD HAVE SENT A POET");
|
||||||
|
@ -178,6 +178,7 @@ typedef enum {
|
|||||||
meta_FSB3, /* FMOD Sample Bank, version 3 */
|
meta_FSB3, /* FMOD Sample Bank, version 3 */
|
||||||
meta_RWX, /* Air Force Delta Storm (XBOX) */
|
meta_RWX, /* Air Force Delta Storm (XBOX) */
|
||||||
meta_XWB, /* King of Fighters (XBOX) */
|
meta_XWB, /* King of Fighters (XBOX) */
|
||||||
|
meta_XA30, /* Driver - Parallel Lines (PS2) */
|
||||||
|
|
||||||
meta_XBOX_WAVM, /* XBOX WAVM File */
|
meta_XBOX_WAVM, /* XBOX WAVM File */
|
||||||
meta_XBOX_RIFF, /* XBOX RIFF/WAVE File */
|
meta_XBOX_RIFF, /* XBOX RIFF/WAVE File */
|
||||||
|
@ -138,6 +138,7 @@ char * extension_list[] = {
|
|||||||
"fsb\0FSB Audio File (*.FSB)\0",
|
"fsb\0FSB Audio File (*.FSB)\0",
|
||||||
"rwx\0RWX Audio File (*.RWX)\0",
|
"rwx\0RWX Audio File (*.RWX)\0",
|
||||||
"xwb\0XWB Audio File (*.XWB)\0",
|
"xwb\0XWB Audio File (*.XWB)\0",
|
||||||
|
"xa30\0XA30 Audio File (*.XA30)\0",
|
||||||
};
|
};
|
||||||
|
|
||||||
void about(HWND hwndParent) {
|
void about(HWND hwndParent) {
|
||||||
|
Loading…
Reference in New Issue
Block a user