dm2-graphics fidelity batch: fixes for #186–#194 #208
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "refs/pull/208/head"
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?
Implements all nine open
dm2-graphicsissues, one commit per issue (dependency-ordered — a shared feature-flags word underpins several fixes, andcls3=0x02SFX keying is shared by #187/#190).Fixes
Archive::feature_flags()foundation ((0,0,0x0b,0)word);is_pc_familydelegates to it. Plus low-severity divergence notes (LZW mode 1, odd-width remainder, dropped-record superset).Palette16on console 4-bit images (gated on feature bit0x01, notpc_family); Mac JP / PC-9821 / IBM PS/V now render colour-correct.iter_sfxoncls3=0x02dtSndrecords with a 2-byte / 5500 Hz header form. Ports that reported zero SFX now surface 67/52/48/17;dm2 info/extractfollow automatically.(0x16,htype,0x02,0x82)is the voice SFX, not a palette (Champion::palette→voice: Option<Sfx>).compose_image_at_dbidxso FM-Towns format-4 dispatch and console overlay composition apply.Archive::sprite_offset); 8-bit header bytes surfaced onImage::eight_bit_offset.find_in_language) mirroring the engine'scls5 & 0xf0 ∈ {0, tag}admission rule; disambiguates the 545 duplicate tuplesfindresolved arbitrarily.dtTextat the first NUL like the engine; drops the trailingU+0000on JP even-padded payloads.(field letter, byte width)descriptors, not per-type counts (TypeHeader::count→width) + a canonical-layout guard.Verification
Full workspace: 103/103 test binaries pass, zero clippy warnings. Each behavioral fix adds fixture-backed regression tests (including ports the suite never exercised — FM-Towns, Mac JP, PC-9821),
dm2-cliwas propagated where a fix changed tool output, anddocs/formats/graphics-dat.mdwas corrected for every refuted claim.Closes #186, #187, #188, #189, #190, #191, #192, #193, #194.
Code review
Found 1 issue:
Champion::palettefield survive the #190 rename. The format doc's "Deferred follow-ups from category 0x16" section still says "Champion::palettereturnsOption<EntryRef>" and frames palette resolution as blocked on that field, and theChampionstruct's doc comment still describes the record as "2 portraits + optional palette reference" — both contradict this PR's own change of the field topub voice: Option<Sfx<'a>>and the updated "Voice samples" prose elsewhere in the same doc.codeberg.org/jqueuniet/dm2-tools@659e3d432c/docs/formats/graphics-dat.md (L1694-L1700)codeberg.org/jqueuniet/dm2-tools@659e3d432c/crates/dm2-graphics/src/champion.rs (L152-L156)Checked for bugs, doc/code consistency, historical regressions, and prior review feedback; no functional issues found in the parsing or decode paths.