Add TXTP frame_size + interleave for MS_IMA [Manhunt (PC)]

This commit is contained in:
bnnm 2024-06-07 13:23:57 +02:00
parent 6b0b357bb8
commit 6d0eaab28c
2 changed files with 15 additions and 4 deletions

View File

@ -125,6 +125,7 @@ as explained below, but often will use default values. Accepted codec strings:
# - MS_IMA Microsoft IMA ADPCM # - MS_IMA Microsoft IMA ADPCM
# * For some PC games # * For some PC games
# * frame_size (or interleave) varies, often multiple of 0x100 [required] # * frame_size (or interleave) varies, often multiple of 0x100 [required]
# * frame_size + interleave forces mono mode
# - APPLE_IMA4 Apple Quicktime IMA ADPCM # - APPLE_IMA4 Apple Quicktime IMA ADPCM
# * For some Mac/iOS games # * For some Mac/iOS games
# - IMA_HV High Voltage's IMA ADPCM # - IMA_HV High Voltage's IMA ADPCM

View File

@ -461,14 +461,24 @@ VGMSTREAM* init_vgmstream_txth(STREAMFILE* sf) {
break; break;
case coding_MS_IMA: case coding_MS_IMA:
vgmstream->interleave_block_size = txth.frame_size ? txth.frame_size : txth.interleave; if (txth.interleave && txth.frame_size) {
vgmstream->layout_type = layout_none; coding = coding_MS_IMA_mono;
vgmstream->frame_size = txth.frame_size;
vgmstream->interleave_block_size = txth.interleave;
vgmstream->layout_type = layout_interleave;
}
else {
vgmstream->frame_size = txth.frame_size ? txth.frame_size : txth.interleave;
vgmstream->layout_type = layout_none;
}
vgmstream->allow_dual_stereo = 1; //??? //TO-DO: needs to force MS_IMA_mono first if ch = 1, since dual_stereo + MS_IMA = assumes MS_IMA_stereo
// (or better do it after init / during setup stream)
//vgmstream->allow_dual_stereo = 1;
break; break;
case coding_MSADPCM: case coding_MSADPCM:
if (vgmstream->channels > 2) goto fail; //can't handle if (vgmstream->channels > 2) goto fail; //can't handle (to-do: only non-mono?)
if (txth.interleave && txth.frame_size) { if (txth.interleave && txth.frame_size) {
coding = coding_MSADPCM_int; coding = coding_MSADPCM_int;
vgmstream->frame_size = txth.frame_size; vgmstream->frame_size = txth.frame_size;