.FSB added (not complete)

git-svn-id: https://vgmstream.svn.sourceforge.net/svnroot/vgmstream@314 51a99a44-fe44-0410-b1ba-c3e57ba2b86b
This commit is contained in:
manakoAT 2008-07-14 12:31:19 +00:00
parent 284e2ec763
commit 2c522acc32
2 changed files with 43 additions and 15 deletions

View File

@ -27,24 +27,52 @@ VGMSTREAM * init_vgmstream_fsb(STREAMFILE *streamFile) {
vgmstream = allocate_vgmstream(channel_count,loop_flag);
if (!vgmstream) goto fail;
/* This will be tricky ;o) */
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->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) */
vgmstream->coding_type = coding_PSX;
vgmstream->layout_type = layout_interleave;
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;
}
switch (fsb3_format) (
case 0:
break;
break;
case 0x02000806: /* WII (Metroid Prime) */
vgmstream->coding_type = coding_NGC_DSP;
vgmstream->layout_type = layout_interleave_byte;
break;
case 0x40000802: /* WII () */
vgmstream->coding_type = coding_NGC_DSP;
vgmstream->layout_type = layout_interleave;
vgmstream->num_samples = (read_32bitLE(0x0C,streamFile));
if (loop_flag) {
vgmstream->loop_start_sample = 0;
vgmstream->loop_end_sample = (read_32bitLE(0x0C,streamFile));
}
break;
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->coding_type = coding_PSX;
vgmstream->num_samples = (read_32bitLE(0x0C,streamFile))*28/16/channel_count;
if (loop_flag) {
vgmstream->loop_start_sample = 0; /* (read_32bitLE(0x08,streamFile)-1)*28; */
vgmstream->loop_end_sample = (read_32bitLE(0x0C,streamFile))*28/16/channel_count;
}
vgmstream->layout_type = layout_interleave;
vgmstream->interleave_block_size = 0x10;
vgmstream->meta_type = meta_FSB;

View File

@ -69,9 +69,9 @@ typedef enum {
/* interleave */
layout_interleave, /* equal interleave throughout the stream */
layout_interleave_shortblock, /* interleave with a short last block */
#if 0
layout_interleave_byte, /* full byte interleave */
#endif
layout_interleave_byte, /* full byte interleave */
/* headered blocks */
layout_ast_blocked, /* .ast STRM with BLCK blocks*/
layout_halpst_blocked, /* blocks with HALPST-format header */