Wire the validated console palette model into the decoders #261
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "refs/pull/261/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?
Closes #260.
Wires the validated console palette model (#214 / PR #259) into the decoders: the dungeon-viewport palette
conv(bank[map_graphics_style][light_stripe])becomes the resolution path for console-family images, with(style, light)as an explicit, defaultable rendering context.Library (
dm2-graphics)LightingContext { style, light }— default{3, 1}(the most common map style; the validated in-game "good light" stripe).Archive::lighting_stripe(style, light)— the 16-entry stripe slice of the 96-entry bank atcls = (0x08, style, 0x09, 0x00);Noneon out-of-range input, missing banks (PC retail archives), or malformed payloads.find_image_palette_ctx— the existing chain extended with three evidence-backed steps: graphics-set images (cls1 = 0x08) use their owncls2as the bank (engine-verified pairing), UI-side categories (cls1 < 0x08) fall back to the engine-verified CRAM line-0 palette at(0x01, 0x00, 0x09, 0x00), and the remaining viewport categories use the context bank. Existing signatures unchanged (delegating with the default context); PC-family resolution short-circuits at the master exactly as before, byte-identical.iter_image_with_palette_ctxthreads the context through the image iterator.CLI
dm2 extract --style <0-5> --light <0-5>(defaults 3/1, range-validated; console-family only — PC archives resolve through the master and ignore them).Effect
Sega CD US extraction goes from 2 to 4,338 correctly-paletted image PNGs (previously only the two title banners resolved any palette); Amiga similarly (4,758). A
--light 5run visibly darkens 4,022 of the Sega CD PNGs. Yield counts are pinned in three independent tests so a silent resolution regression fails loudly; a four-port smoke pins the banks on Sega CD US/JP, Amiga EU, and FM-Towns JP (surfacing that Sega CD JP's bank 0 is flat).Remaining residues (line-2 torch-glow palette, the never-observed stripe 0, the
-0x1aa4(a5)gate global, the cls4 table record) stay tracked in ROADMAP Phase 7.