Wire the validated console palette model into the decoders #260
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?
The palette model for the console/Amiga ports is fully validated (#214, PR #259): the dungeon-viewport palette is
with
bank= the six 96-entry records atcls = (0x08, 0x00..0x05, 0x09, 0x00),map_graphics_style= dungeon.dat per-mapw14bits 7:4,light_stripe= the engine's 6-state light level (higher = darker), andconv= the high 3 bits of each channel byte. Background:docs/formats/palette-lut.md§ "The lighting-stripe hypothesis" and § "VALIDATED".Goal: wire the model into the decoders
dm2-graphicsimage decoding on the ports without a 256-colour master (Sega CD US/JP, Amiga EU, FM-Towns) should resolve viewport colours from static data given a(map_graphics_style, light_level)context — e.g. a palette-selection API that returns the 16-entry stripe for a(style, light)pair, used byiter_image_with_palette/render paths and the CLI convert flow (sensible default: stripe 1, the common in-game "good light" state). Banks 1 and 5 are byte-identical in the Sega CD US archive; selection must go through the style index, not content.For per-object ornament recolouring, the
cls3 = 0x0ELUT choice is per drawn object: an id-taking boolean gate (GDAT(0x0B, 0x00, 0x0A, object_type) == 1, jump-table entry 496) followed by the pointer-taking selectorcls4 = table[record->byte4 >> 4](entry 492, 0xFF = none) on the Actuator path, andcls4 = (word2 >> 3) & 0xFFon the simplified-sensor Text path — seedocs/formats/palette-lut.md§ "A5 jump-table decode and the cls4 selector". Full fidelity here needs dungeon context, so a first pass can reasonably stop at the viewport palette.Known residues (minor, non-blocking)
-0x1aa4(a5)gate global in the policy function is unidentified.-0x264e/-0x2646/-0x2642/-0x2640(a5)).