dm2-graphics: apply per-object cls3=0x0E remap LUTs during palette resolution #265

Closed
opened 2026-07-17 18:51:34 +02:00 by jqueuniet · 0 comments
jqueuniet commented 2026-07-17 18:51:34 +02:00 (Migrated from codeberg.org)

Context

The 0x0E LUT format is already understood — a 17-byte ASCII-hex remap, documented in docs/formats/graphics-dat.md § "Per-cls3 type taxonomy" → 0x0E. The A5 jump-table decode (entry = (disp - 0x22)/8, identical on Sega CD and Amiga) pinned the selector at entry 492 (cls4 = table[(byte4 >> 4) - 1], 0xFF when the nibble is 0), gated by the boolean GDAT(0x0B, 0, 0x0A, type) at entry 496. What is not implemented is the actual application step during palette resolution.

Why it's deferred

Nothing in the 16 staged fixtures needs the LUT applied to render correctly, and SKPROJECT's DM2GDED FindImagePalette is pure-virtual with no reference implementation to mirror (ROADMAP.md:1305–1316).

Scope

  • Wire the selector (entries 492/496) into find_image_palette_ctx behind the GDAT(0x0B,0,0x0A,type) gate.
  • Apply the resolved cls4 remap LUT to per-object image palettes.
  • Find a fixture/object that actually exercises the path, or document that none exists and the path stays test-only.

Acceptance

  • LUT application is exercised by at least one test (real or synthetic).
  • PC-family and existing console output remain byte-identical where the gate is not taken.
## Context The `0x0E` LUT format is already understood — a 17-byte ASCII-hex remap, documented in `docs/formats/graphics-dat.md` § "Per-cls3 type taxonomy" → `0x0E`. The A5 jump-table decode (`entry = (disp - 0x22)/8`, identical on Sega CD and Amiga) pinned the selector at **entry 492** (`cls4 = table[(byte4 >> 4) - 1]`, `0xFF` when the nibble is 0), gated by the boolean `GDAT(0x0B, 0, 0x0A, type)` at **entry 496**. What is *not* implemented is the actual **application** step during palette resolution. ## Why it's deferred Nothing in the 16 staged fixtures needs the LUT applied to render correctly, and SKPROJECT's DM2GDED `FindImagePalette` is pure-virtual with no reference implementation to mirror (ROADMAP.md:1305–1316). ## Scope - Wire the selector (entries 492/496) into `find_image_palette_ctx` behind the `GDAT(0x0B,0,0x0A,type)` gate. - Apply the resolved `cls4` remap LUT to per-object image palettes. - Find a fixture/object that actually exercises the path, or document that none exists and the path stays test-only. ## Acceptance - LUT application is exercised by at least one test (real or synthetic). - PC-family and existing console output remain byte-identical where the gate is not taken.
Sign in to join this conversation.
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#265
No description provided.