mirror of
https://github.com/vgmstream/vgmstream.git
synced 2025-02-27 07:10:41 +01:00
Fix nus3bank with varying header [Super Smash Bros (Wii U)]
This commit is contained in:
parent
1888990b75
commit
883e018aab
@ -629,19 +629,26 @@ VGMSTREAM * init_vgmstream_3ds_idsp(STREAMFILE *streamFile) {
|
|||||||
|
|
||||||
/* try NUS3BANK container */
|
/* try NUS3BANK container */
|
||||||
if (read_32bitBE(0x00,streamFile) == 0x4E555333) { /* "NUS3" */
|
if (read_32bitBE(0x00,streamFile) == 0x4E555333) { /* "NUS3" */
|
||||||
offset = 0x14 + read_32bitLE(0x10, streamFile); /* header size */
|
int i, chunk_count;
|
||||||
offset += read_32bitLE(0x1C, streamFile) + 0x08;
|
|
||||||
offset += read_32bitLE(0x24, streamFile) + 0x08;
|
offset = 0x14 + read_32bitLE(0x10, streamFile); /* TOC size */
|
||||||
offset += read_32bitLE(0x2C, streamFile) + 0x08;
|
chunk_count = read_32bitLE(0x14, streamFile); /* rarely not 7 (ex. SMB U's snd_bgm_CRS12_Simple_Result_Final) */
|
||||||
offset += read_32bitLE(0x34, streamFile) + 0x08;
|
|
||||||
offset += read_32bitLE(0x3C, streamFile) + 0x08;
|
for (i = 0; i < chunk_count; i++) {
|
||||||
offset += read_32bitLE(0x44, streamFile) + 0x08;
|
if (read_32bitBE(0x18 + i*0x08 + 0x00, streamFile) == 0x5041434B) { /* "PACK" */
|
||||||
offset += 0x08;
|
offset += 0x08;
|
||||||
|
break; /* contains "IDSP", should appear last anyway */
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
offset += 0x08 + read_32bitLE(0x18 + i*0x08 + 0x04, streamFile);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
offset = 0x00;
|
offset = 0x00;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (read_32bitBE(offset,streamFile) != 0x49445350) /* "IDSP" */
|
if (read_32bitBE(offset,streamFile) != 0x49445350) /* "IDSP" */
|
||||||
goto fail;
|
goto fail;
|
||||||
/* 0x0c: sample rate, 0x10: num_samples, 0x14: loop_start_sample, 0x18: loop_start_sample */
|
/* 0x0c: sample rate, 0x10: num_samples, 0x14: loop_start_sample, 0x18: loop_start_sample */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user