dm2-graphics: champion portraits decode with wrong codec on FM-Towns and skip overlay composition on console ports #188
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
Champion::parsedecodes portraits viadecode_portrait(crates/dm2-graphics/src/champion.rs~223), which callsImage::parsedirectly on the record payload. That bypasses both dispatch layers the archive-level image path has:Image::parseruns the format-5 4-bit RLE instead ofImage::parse_fm_towns's C4towns codec. FM-Towns has 32 champion portraits + 16 stats records; the format-5 RLE decodes C4towns streams to garbage without erroring (its EOF handling is lenient), soarchive.champion(h)on FM-Towns returns silently wrong portrait pixels.(0, 0, 0x08, 0)chain table. Decoding an overlay record with the underlay decoder misparses from the very first nibble (underlays read a 6-nibble sub-palette, overlays 5), so those portraits come out fully garbled — andidx == 5runs that should show the underlay through render as palette literals.champion_fixture.rsonly exercises DOS-EN and Mac US, which have neither overlays nor format-4, so the tests can't see it.Fix direction
Route portrait decoding through the archive: resolve the record's payload index and call
Archive::compose_image_at_dbidx(which already handles both the format-4 dispatch viadecode_image_payloadand the overlay chain).decode_portraitkeeps its error mapping; only the decode call changes.Fixed by #208 (merged into
main).