mirror of
https://github.com/vgmstream/vgmstream.git
synced 2025-01-18 07:44:43 +01:00
commit
f70327d7b3
@ -239,7 +239,7 @@ static int ps_find_loop_offsets_internal(STREAMFILE *streamFile, off_t start_off
|
||||
int detect_full_loops = config & 1;
|
||||
|
||||
|
||||
if (data_size == 0 || channels == 0 || (channels > 0 && interleave == 0))
|
||||
if (data_size == 0 || channels == 0 || (channels > 1 && interleave == 0))
|
||||
return 0;
|
||||
|
||||
while (offset < max_offset) {
|
||||
|
@ -358,7 +358,10 @@ static int parse_musx(STREAMFILE *streamFile, musx_header *musx) {
|
||||
/* 0x1c: null */
|
||||
/* 0x20: hash */
|
||||
musx->tables_offset = 0; /* no tables */
|
||||
musx->big_endian = (musx->platform == 0x5749495F || musx->platform == 0x5053335F); /* "GC__" / "PS3_" (only after header) */
|
||||
musx->big_endian = (musx->platform == 0x47435F5F || /* "GC__" */
|
||||
musx->platform == 0x58455F5F || /* "XE__" */
|
||||
musx->platform == 0x5053335F || /* "PS3_" */
|
||||
musx->platform == 0x5749495F); /* "WII_" */
|
||||
break;
|
||||
|
||||
default:
|
||||
@ -444,6 +447,7 @@ static int parse_musx(STREAMFILE *streamFile, musx_header *musx) {
|
||||
uint32_t miniheader = read_32bitBE(0x40, streamFile);
|
||||
switch(miniheader) {
|
||||
case 0x44415434: /* "DAT4" */
|
||||
case 0x44415435: /* "DAT5" */
|
||||
case 0x44415438: /* "DAT8" */
|
||||
/* found on PS3/Wii (but not always?) */
|
||||
musx->stream_size = read_32bitLE(0x44, streamFile);
|
||||
@ -452,7 +456,14 @@ static int parse_musx(STREAMFILE *streamFile, musx_header *musx) {
|
||||
musx->loops_offset = 0x50;
|
||||
break;
|
||||
default:
|
||||
musx->loops_offset = 0x30;
|
||||
if (read_32bitBE(0x30, streamFile) == 0x00 &&
|
||||
read_32bitBE(0x34, streamFile) == 0x00) {
|
||||
/* no subheader [Spider-Man 4 (Wii)] */
|
||||
musx->loops_offset = 0x00;
|
||||
} else {
|
||||
/* loop info only [G-Force (PS3)] */
|
||||
musx->loops_offset = 0x30;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -535,9 +546,6 @@ static int parse_musx(STREAMFILE *streamFile, musx_header *musx) {
|
||||
musx->channels = 1;
|
||||
}
|
||||
|
||||
|
||||
VGM_LOG("to=%lx, %lx, %x\n", target_offset, musx->stream_offset, musx->stream_size);
|
||||
|
||||
if (coef_size == 0)
|
||||
musx->coefs_offset = 0; /* disable for later detection */
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user