Fix some .cstr [Donkey Konga (GC)]

This commit is contained in:
bnnm 2020-04-04 23:54:31 +02:00
parent 115c6363b8
commit 9a09d2cf11

View File

@ -44,6 +44,7 @@ VGMSTREAM * init_vgmstream_cstr(STREAMFILE* sf) {
loop_flag = (loop_start >= 0);
start_offset = 0x20 + 0x60 * channels + first_skip;
#if 1
/* nonlooped tracks may not set first skip for no reason, but can be tested with initial p/s */
if (!loop_flag && channels == 2 && first_skip == 0) {
while (first_skip < 0x800) {
@ -55,10 +56,12 @@ VGMSTREAM * init_vgmstream_cstr(STREAMFILE* sf) {
/* not found */
if (first_skip == 0x800)
first_skip = 0;
else
start_offset += first_skip;
}
if (first_skip > 0 && loop_start >= (interleave - first_skip))
loop_start = loop_start - (interleave - first_skip);
#endif
loop_start = loop_start * 2;
/* Mr. Driller oddity, unreliable loop flag */
@ -94,7 +97,7 @@ VGMSTREAM * init_vgmstream_cstr(STREAMFILE* sf) {
vgmstream->interleave_first_block_size = interleave - first_skip;
vgmstream->interleave_first_skip = first_skip;
vgmstream->meta_type = meta_DSP_CSTR;
VGM_LOG("1=%x, =%x\n",vgmstream->interleave_first_block_size, vgmstream->interleave_first_skip);
dsp_read_coefs_be(vgmstream, sf, 0x3c, 0x60);
if (!vgmstream_open_stream(vgmstream, sf, start_offset))