mirror of
https://github.com/vgmstream/vgmstream.git
synced 2025-01-30 11:57:27 +01:00
Fix some MCA v4 and relax looping checks [MH3U (3DS)]
This commit is contained in:
parent
9c06c103e2
commit
84cac5e934
@ -32,6 +32,9 @@ VGMSTREAM * init_vgmstream_mca(STREAMFILE *streamFile) {
|
|||||||
vgmstream->loop_start_sample = read_32bitLE(0x14, streamFile);
|
vgmstream->loop_start_sample = read_32bitLE(0x14, streamFile);
|
||||||
vgmstream->loop_end_sample = read_32bitLE(0x18, streamFile);
|
vgmstream->loop_end_sample = read_32bitLE(0x18, streamFile);
|
||||||
|
|
||||||
|
if (vgmstream->loop_end_sample > vgmstream->num_samples) /* some MH3U songs, somehow */
|
||||||
|
vgmstream->loop_end_sample = vgmstream->num_samples;
|
||||||
|
|
||||||
vgmstream->coding_type = coding_NGC_DSP;
|
vgmstream->coding_type = coding_NGC_DSP;
|
||||||
vgmstream->layout_type = channel_count == 1 ? layout_none : layout_interleave;
|
vgmstream->layout_type = channel_count == 1 ? layout_none : layout_interleave;
|
||||||
vgmstream->meta_type = meta_MCA;
|
vgmstream->meta_type = meta_MCA;
|
||||||
@ -55,7 +58,7 @@ VGMSTREAM * init_vgmstream_mca(STREAMFILE *streamFile) {
|
|||||||
coef_shift = read_16bitLE(0x28, streamFile);
|
coef_shift = read_16bitLE(0x28, streamFile);
|
||||||
coef_start = head_size - coef_spacing * channel_count;
|
coef_start = head_size - coef_spacing * channel_count;
|
||||||
|
|
||||||
start_offset = head_size;
|
start_offset = get_streamfile_size(streamFile) - data_size; /* usually head_size but not for some MH3U songs */
|
||||||
coef_offset = coef_start + coef_shift * 0x14;
|
coef_offset = coef_start + coef_shift * 0x14;
|
||||||
|
|
||||||
} else { /* v5: Ace Attourney 6, Monster Hunter Generations, v6+? */
|
} else { /* v5: Ace Attourney 6, Monster Hunter Generations, v6+? */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user