some more NatM fsb

git-svn-id: https://vgmstream.svn.sourceforge.net/svnroot/vgmstream@647 51a99a44-fe44-0410-b1ba-c3e57ba2b86b
This commit is contained in:
halleyscometsw 2009-05-12 22:15:22 +00:00
parent 4bfa2b3450
commit a433aa12c3

View File

@ -260,14 +260,19 @@ VGMSTREAM * init_vgmstream_fsb4(STREAMFILE *streamFile) {
if (read_32bitBE(0x60,streamFile) == 0x40008800 || if (read_32bitBE(0x60,streamFile) == 0x40008800 ||
read_32bitBE(0x60,streamFile) == 0x40000802) { read_32bitBE(0x60,streamFile) == 0x40000802 ||
read_32bitBE(0x60,streamFile) == 0x40100802) {
loop_flag = 1; loop_flag = 1;
} else { } else {
loop_flag = 0; loop_flag = 0;
} }
channel_count = 2; if (read_32bitBE(0x60,streamFile) != 0x20000882 &&
read_32bitBE(0x60,streamFile) != 0x20100002) {
channel_count = 2;
} else {
channel_count = 1;
}
/* build the VGMSTREAM */ /* build the VGMSTREAM */
vgmstream = allocate_vgmstream(channel_count,loop_flag); vgmstream = allocate_vgmstream(channel_count,loop_flag);
@ -292,6 +297,7 @@ VGMSTREAM * init_vgmstream_fsb4(STREAMFILE *streamFile) {
break; break;
/* WII (de Blob, Night at the Museum) */ /* WII (de Blob, Night at the Museum) */
case 0x40000802: case 0x40000802:
case 0x40100802:
if (read_32bitLE(0x14,streamFile)==0x20) if (read_32bitLE(0x14,streamFile)==0x20)
{ {
/* Night at the Museum */ /* Night at the Museum */
@ -299,9 +305,10 @@ VGMSTREAM * init_vgmstream_fsb4(STREAMFILE *streamFile) {
vgmstream->layout_type = layout_interleave_byte; vgmstream->layout_type = layout_interleave_byte;
vgmstream->interleave_block_size = 2; vgmstream->interleave_block_size = 2;
} }
else if (read_32bitLE(0x14,streamFile)==0x10) else if (read_32bitLE(0x14,streamFile)==0x10 ||
read_32bitLE(0x14,streamFile)==0x30)
{ {
/* de Blob */ /* de Blob, NatM sfx */
vgmstream->coding_type = coding_NGC_DSP; vgmstream->coding_type = coding_NGC_DSP;
vgmstream->layout_type = layout_none; vgmstream->layout_type = layout_none;
vgmstream->interleave_block_size = read_32bitLE(0x54,streamFile)/channel_count; vgmstream->interleave_block_size = read_32bitLE(0x54,streamFile)/channel_count;
@ -313,6 +320,17 @@ VGMSTREAM * init_vgmstream_fsb4(STREAMFILE *streamFile) {
vgmstream->loop_end_sample = read_32bitLE(0x50,streamFile); vgmstream->loop_end_sample = read_32bitLE(0x50,streamFile);
} }
break; break;
/* Night at the Museum */
case 0x20000882:
case 0x20100002:
vgmstream->coding_type = coding_NGC_DSP;
vgmstream->layout_type = layout_none;
vgmstream->num_samples = (read_32bitLE(0x54,streamFile)/8/channel_count*14);
if (loop_flag) {
vgmstream->loop_start_sample = 0;
vgmstream->loop_end_sample = read_32bitLE(0x50,streamFile);
}
break;
default: default:
goto fail; goto fail;