Palette pairing session 2: validate the lighting-stripe hypothesis via emulator captures #214
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?
Continuation of the static research merged in #213 (stripe-aware
palette_oracle_match+ cross-port docs). This issue carries the handoff so the next session can run on any machine with the fixtures staged — the working scratch directory from session 1 is machine-local and its artifacts are all re-derivable (commands below).Goal
Confirm or refute, against fresh Sega CD CRAM captures:
where
bank= the six 96-entry records atcls=(0x08, 0x00..0x05, 0x09, 0x00),map_graphics_style=dungeon.datper-mapw14bits 7:4 (static; seedocs/formats/dungeon-dat.md), andlight_stripe= the engine's 6-state light level. Background and evidence:docs/formats/palette-lut.md§ "The lighting-stripe hypothesis".Protocol (Sega CD / BlastEm — harness in
tooling/palette-oracle/, Phase-0 gate already passed)tooling/palette-oracle/blastem.nix; debugger commands are written up intooling/palette-oracle/blastem-debugger.md.save/w <path>/cram_<scene>.bin vdp:cram 64— and note per capture: the party's current map and the torch/light state. Map → environment viadm2 dump fixtures/dos-en/dungeon.dat(mapGraphicsStylefield; the console dungeons differ but carry the same field — dump the Sega CD dungeon for exact values).cargo run -p dm2-graphics --example palette_oracle_match -- fixtures/sega-cd-us/graphics.dat <capture-dir>Expect line-1 hits labeled
#idx stripe swithstracking the light state andidxtrackingmap_graphics_style.ADDR_PALSELtrace — resolver0x1e78e, policy sites0x147d4/0xf6aa(CODE-hunk-relative; jump-table anchored), runtime entry previously seen at0x375a0(bias-relative, re-verify per boot). All documented indocs/formats/palette-lut.md.Secondary target (either outcome): the per-object LUT selector
Static RE showed the
cls3=0x0ELUTcls4selector is computed per drawn object:cls4 = helper(record)via A5 jump-table slot 186 (Amiga offsets; seedocs/formats/palette-lut.md§ "Amiga cross-port corroboration" — the Amiga and Sega CDSKUL.FTLare the same C codebase, so either port works). Options:dm2-ftlparses BSS) to reconstruct the merged A5 table (merge order unconfirmed; slot 186 / the resolver at slot 337 likely land inGRF1.FTL), then read the helper's body.(object record, cls4, chosen LUT)triples; a handful of samples should pin the function.On Amiga (single CPU — easiest correlation): breakpoint the
VDEOpalette loader (CODE0x4ed6+ hunk bias) or watch the staging global-0xc3c(a5)in WinUAE/fs-uae.FM-Towns:
SKULL.EXPis a "P3" flat-386 RUN386 executable (decompilable with rz-ghidra x86); cold byte-scans hit only data tables, so start from MAME watchpoints on the Towns palette I/O and walk back.Re-deriving the session-1 scratch artifacts
dm2 extract fixtures/amiga-eu/DM2/<MOD>.FTL -o <dir>(alsotooling/palette-oracle/extract_code_hunk.shfor Sega CDSKUL).cat fixtures/dos-en-beta/DATA/GRAPHICS.DAT fixtures/dos-en-beta/DATA/GRAPHIC2.DAT > beta.dat; thendm2 extract beta.dat -o <dir> --all-binsreproduces the six banks (08_0?_09_00__*.gpl, 384 B) and the 3,357cls3=0x0DPalette16 population analysed indocs/sources/dos-en-beta.md§ "Palette architecture".rizin -N -a m68k -b 32 -e cfg.bigendian=true <hunk>— key offsets indocs/formats/palette-lut.md.References
docs/formats/palette-lut.md— RE hub: hypothesis, offsets, capture architecture, Amiga/FM-Towns sections.docs/formats/dungeon-dat.md—map_graphics_stylesemantics + engine citations.docs/sources/dos-en-beta.md§ "Palette architecture" — the static-pairing Rosetta stone.