dm2-graphics: low-severity batch (feature-flags word, LZW mode 1, odd-width remainder quirk, dropped-record superset, Sfx byte-order footgun) #194
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?
Low-severity batch from the dm2-graphics fidelity review. None of these change fixture-decoding behaviour today; they are latent divergences vs the reference engine (
[SKPROJECT] SKWINSPX/src/v5) or API/doc polish.(0, 0, 0x0b, 0)inline word is a per-archive feature-flags word — decoded bits so far:0x01= 4-bit records carry a trailing per-image Palette16 (see the trailing-palette issue),0x20= dtSnd payloads have 6-byte rate headers (see the console-SFX issue),0x40= 8-bit image dialect +is_pc_family(already used,v5/bgdat.cpp:1118-1132). Observed values: DOS0x7b, Mac US0x7b, Amiga0x2b, Mac JP / PC-98x1 / IBM PS/V0x0b, Sega CD / FM-Towns0x0a. Worth a typed accessor (e.g.Archive::feature_flags()) instead of three ad-hoc bit reads, and a table indocs/formats/graphics-dat.md. Note Amiga sets 0x20 but not 0x40 — "PC-family" is per-subsystem, and the current docs use the term for both axes.v5/gfxdec.cpp::dec9_1, line 547) and rejected by the crate asModeUnsupported(1). Fine whiletests/lzw_mode_1_unused.rsholds across fixtures; the engine source is the port target if a mode-1 record ever surfaces.pixels1(rest-of-row) pixels while advancing bypixels2(v5/gfxdec.cpp:216-221,:422-427,:450-455); the crate fills exactly the run count. Identical output for well-formed streams (the overshoot is overwritten); differs only when a stream ends immediately after such a run, where the crate zero-fills and the engine leaves spilled pixels. Comment-level note infill_run/spill_pixelsso a future bit-exactness comparison isn't surprised.Ent1::parseaccepts records the engine drops: entries withcls1 > 0x1corcls3 > 0x0eare excluded from the engine's runtime table (v5/bgdat.cpp:700). The crate keeps them (superset — fine), worth one docstring line onEnt1::entries.Sfx::parsebyte-order footgun is pinned but easy to hit: the flag quartet is byte-order-invariant so a wrongByteOrdersilently swaps the rate (testparse_does_not_validate_byte_order). Once SFX keys on ENT1 records (console-SFX issue),iter_sfxcovers all callers and the rawparsecould be de-emphasised.Fixed by #208 (merged into
main).