mirror of
https://github.com/vgmstream/vgmstream.git
synced 2024-11-12 01:30:49 +01:00
.fsb (xbox) added
git-svn-id: https://vgmstream.svn.sourceforge.net/svnroot/vgmstream@318 51a99a44-fe44-0410-b1ba-c3e57ba2b86b
This commit is contained in:
parent
7dabdc48f8
commit
bf6734372a
@ -8,7 +8,7 @@ VGMSTREAM * init_vgmstream_fsb(STREAMFILE *streamFile) {
|
||||
off_t start_offset;
|
||||
|
||||
int fsb3_headerlen = 0x18;
|
||||
int fsb3_format;
|
||||
int fsb3_format;
|
||||
int loop_flag = 0;
|
||||
int channel_count;
|
||||
|
||||
@ -17,7 +17,7 @@ VGMSTREAM * init_vgmstream_fsb(STREAMFILE *streamFile) {
|
||||
if (strcasecmp("fsb",filename_extension(filename))) goto fail;
|
||||
|
||||
/* check header */
|
||||
if (read_32bitBE(0x00,streamFile) != 0x46534233) /* "FSB3\0" */
|
||||
if (read_32bitBE(0x00,streamFile) != 0x46534233) /* "FSB3" */
|
||||
goto fail;
|
||||
|
||||
if (read_32bitBE(0x48,streamFile) == 0x02000806) {
|
||||
@ -35,28 +35,21 @@ VGMSTREAM * init_vgmstream_fsb(STREAMFILE *streamFile) {
|
||||
fsb3_format = read_32bitBE(0x48,streamFile);
|
||||
switch (fsb3_format) {
|
||||
case 0x40008800: /* PS2 (Agent Hugo, Flat Out 2) */
|
||||
vgmstream->coding_type = coding_PSX;
|
||||
vgmstream->layout_type = layout_interleave;
|
||||
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_end_sample = (read_32bitLE(0x0C,streamFile))*28/16/channel_count;
|
||||
}
|
||||
break;
|
||||
case 0x41008800: /* PS2 (Flat Out) */
|
||||
case 0x42008800: /* PS2 (Jackass - The Game) */
|
||||
vgmstream->coding_type = coding_PSX;
|
||||
vgmstream->layout_type = layout_interleave;
|
||||
vgmstream->interleave_block_size = 0x10;
|
||||
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_end_sample = (read_32bitLE(0x0C,streamFile))*28/16/channel_count;
|
||||
}
|
||||
|
||||
break;
|
||||
case 0x02000806: /* WII (Metroid Prime) */
|
||||
case 0x01000806: /* WII (Metroid Prime) */
|
||||
case 0x02000806: /* WII (Metroid Prime 3) */
|
||||
case 0x01000806: /* WII (Metroid Prime 3) */
|
||||
case 0x40000802: /* WII (WWE Smackdown Vs. Raw 2008) */
|
||||
case 0x40004020: /* WII (Guitar Hero III) */
|
||||
vgmstream->num_samples = (read_32bitLE(0x0C,streamFile))*14/8/channel_count;
|
||||
if (loop_flag) {
|
||||
vgmstream->loop_start_sample = read_32bitLE(0x40,streamFile);
|
||||
@ -65,26 +58,24 @@ VGMSTREAM * init_vgmstream_fsb(STREAMFILE *streamFile) {
|
||||
vgmstream->coding_type = coding_NGC_DSP;
|
||||
vgmstream->layout_type = layout_interleave_byte;
|
||||
vgmstream->interleave_block_size = 2;
|
||||
|
||||
break;
|
||||
case 0x40000802: /* WII () */
|
||||
vgmstream->coding_type = coding_NGC_DSP;
|
||||
vgmstream->layout_type = layout_interleave;
|
||||
vgmstream->interleave_block_size = 0x10;
|
||||
vgmstream->num_samples = (read_32bitLE(0x0C,streamFile));
|
||||
case 0x41004800: /* XBOX (FlatOut) */
|
||||
vgmstream->num_samples = read_32bitLE(0x44,streamFile);
|
||||
if (loop_flag) {
|
||||
vgmstream->loop_start_sample = read_32bitLE(0x40,streamFile);
|
||||
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;
|
||||
break;
|
||||
default:
|
||||
default:
|
||||
goto fail;
|
||||
}
|
||||
/* fill in the vital statistics */
|
||||
start_offset = (read_32bitLE(0x08,streamFile))+fsb3_headerlen;
|
||||
vgmstream->channels = read_16bitLE(0x56,streamFile);
|
||||
vgmstream->sample_rate = read_32bitLE(0x4C,streamFile);
|
||||
|
||||
vgmstream->meta_type = meta_FSB;
|
||||
|
||||
if (vgmstream->coding_type == coding_NGC_DSP) {
|
||||
|
Loading…
Reference in New Issue
Block a user