Static palette-pairing findings: stripe-aware oracle + cross-port docs #213

Merged
jqueuniet merged 0 commits from refs/pull/213/head into main 2026-07-07 16:40:54 +02:00
jqueuniet commented 2026-07-07 14:58:51 +02:00 (Migrated from codeberg.org)

Static research pass on the console/Amiga/FM-Towns image-colour pairing (the Phase 7 colour-resolution item), preparing the next emulation/capture session. One code commit, one docs commit.

Code — stripe-aware palette oracle

palette_oracle_match previously fed whole PalIrgb records to predict(), which samples indices 0..15 — so the six 96-entry per-environment banks only ever contributed their base stripe, and the five lighting-gradient stripes were never candidates. The unresolved per-scene CRAM line 1 near-misses (small ±1-level residuals) have exactly the wrong-stripe signature. Candidates are now keyed (ent1_index, Option<stripe>); 96-entry banks yield six labeled stripe candidates, 16-/256-entry palettes are unchanged. Sega CD US fixture pins the shape: 156 LUTs, 11 whole sub-palettes + 6 banks × 6 stripes. 8/8 tests, clippy/fmt clean.

Docs — findings from the static session

  • dungeon-dat.mdmap_graphics_style (w14 bits 7:4) is the palette-environment selector, used verbatim as the category-0x08 sub-index (engine-verified via [SKPROJECT]: sklodlvl.cpp:720-726, skdungn.cpp:822, skbltgfx.cpp:359-361). DOS-EN 44-map distribution {0:1, 1:9, 2:10, 3:20, 4:1, 5:3}.
  • graphics-dat.md — the pairing model restated as static-data + enumerable runtime state (bank = per-map field; stripe = 6-state light level; per-image Palette16; per-object LUT-cls4 residue).
  • palette-lut.md — the lighting-stripe hypothesis for CRAM line 1 (test target: CRAM line 1 == conv(bank[map_graphics_style][light_stripe])); Amiga cross-port corroboration (VDEO palette loader fully read: PalIrgb quadruples in, high-nibble conv, copper+shadow+$DFF180 out; SKUL policy sites match the Sega CD ABI instruction-for-instruction — same C codebase; the LUT cls4 selector is computed per drawn object from its record); FM-Towns SKULL.EXP identified as a "P3" flat-386 RUN386 executable.
  • dos-en-beta.md — new "Palette architecture" section: the Beta is the only LE/PC witness of the console bank model — the six 96-entry banks at the console tuples, 3,357 standalone Palette16 records pairing statically (exact tuple else cls4=0xfe family default, 100% family coverage), and zero 0x0E LUTs (pins the LUT layer as console-hardware-specific). Also corrects the stale sfx=0 row (39 console-family dtSnd since #187).
  • amiga-eu.md — engine palette-pipeline section (module hardware roles from the chip-register scan).
  • ROADMAP.md — Phase 7 colour item narrowed to the actual residue: (a) stripe confirmation against one fresh capture set with known (map, light); (b) per-object cls4 helper decode; (c) wiring the model into the decoders.
Static research pass on the console/Amiga/FM-Towns image-colour pairing (the Phase 7 colour-resolution item), preparing the next emulation/capture session. One code commit, one docs commit. ## Code — stripe-aware palette oracle `palette_oracle_match` previously fed whole PalIrgb records to `predict()`, which samples indices 0..15 — so the six 96-entry per-environment banks only ever contributed their base stripe, and the five lighting-gradient stripes were **never candidates**. The unresolved per-scene CRAM line 1 near-misses (small ±1-level residuals) have exactly the wrong-stripe signature. Candidates are now keyed `(ent1_index, Option<stripe>)`; 96-entry banks yield six labeled stripe candidates, 16-/256-entry palettes are unchanged. Sega CD US fixture pins the shape: 156 LUTs, 11 whole sub-palettes + 6 banks × 6 stripes. 8/8 tests, clippy/fmt clean. ## Docs — findings from the static session - **`dungeon-dat.md`** — `map_graphics_style` (w14 bits 7:4) is the palette-environment selector, used verbatim as the category-0x08 sub-index (engine-verified via [SKPROJECT]: `sklodlvl.cpp:720-726`, `skdungn.cpp:822`, `skbltgfx.cpp:359-361`). DOS-EN 44-map distribution {0:1, 1:9, 2:10, 3:20, 4:1, 5:3}. - **`graphics-dat.md`** — the pairing model restated as static-data + enumerable runtime state (bank = per-map field; stripe = 6-state light level; per-image Palette16; per-object LUT-cls4 residue). - **`palette-lut.md`** — the lighting-stripe hypothesis for CRAM line 1 (test target: `CRAM line 1 == conv(bank[map_graphics_style][light_stripe])`); Amiga cross-port corroboration (VDEO palette loader fully read: PalIrgb quadruples in, high-nibble conv, copper+shadow+$DFF180 out; SKUL policy sites match the Sega CD ABI instruction-for-instruction — same C codebase; the LUT cls4 selector is computed per drawn object from its record); FM-Towns `SKULL.EXP` identified as a "P3" flat-386 RUN386 executable. - **`dos-en-beta.md`** — new "Palette architecture" section: the Beta is the only LE/PC witness of the console bank model — the six 96-entry banks at the console tuples, 3,357 standalone Palette16 records pairing statically (exact tuple else `cls4=0xfe` family default, 100% family coverage), and **zero 0x0E LUTs** (pins the LUT layer as console-hardware-specific). Also corrects the stale `sfx=0` row (39 console-family dtSnd since #187). - **`amiga-eu.md`** — engine palette-pipeline section (module hardware roles from the chip-register scan). - **`ROADMAP.md`** — Phase 7 colour item narrowed to the actual residue: (a) stripe confirmation against one fresh capture set with known (map, light); (b) per-object cls4 helper decode; (c) wiring the model into the decoders.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
jqueuniet/dm2-tools!213
No description provided.