Skip to content

Debugger disassembly + breakpoints: pure SM83 disasm with live-CPU length oracle, click-to-toggle bps (#53, third artifact) - #60

Merged
InauguralPhysicist merged 1 commit into
masterfrom
debugger-disasm
Aug 4, 2026
Merged

Debugger disassembly + breakpoints: pure SM83 disasm with live-CPU length oracle, click-to-toggle bps (#53, third artifact)#60
InauguralPhysicist merged 1 commit into
masterfrom
debugger-disasm

Conversation

@InauguralPhysicist

Copy link
Copy Markdown
Contributor

Third artifact of #53: the disassembly panel and breakpoints.

  • src/disasm.eigs: pure SM83 disassembler over a byte-reader callback (the hex_view contract) — algorithmic octal-field decode, computed CB page, headless-safe.
  • Length oracle with real teeth (in run_debug_equivalence.sh, CI on any pin): for every straight-line instruction the debug engine executes, PC must advance by exactly disasm_one's len — 172,451 live instructions on cpu_instrs, zero mismatches; a planted wrong-length fault is caught. Mnemonic text has no external oracle on this box, so tests/disasm_golden.txt is labeled what it is: a golden master (regression pin, not proof).
  • Panel + breakpoints: east item_list window forward from PC (> PC marker, * bp marker); click a line to toggle a bp (DBG_BP seam), --bp ADDR CLI presets. With bps armed, RUN runs the frame through the debug stepper and pauses with reason breakpoint; with none armed RUN stays on the hot loop.
  • Oracle legs added (green, real display + xvfb): a second glyph atlas at font_scale 2 (item_list renders at scale 2, unlike code_view's scale 1 — both atlases cut from real rendered output), disasm rows decoded from screenshots vs the freshly-regenerated DBG_DIS seam, --plant-dis-fault caught, and a full real-mouse breakpoint round-trip: arm at the paused PC → Run → traps at exactly that PC (reason asserted) → panels decode byte-identical at the bp → second click clears. The bp landed on WRAM-executed Blargg code (C003) — the bus-reader disassembler handled RAM code transparently.
  • The decode oracle caught a real render bug on first run: the 21-char CALL NZ,$078D line lost its final character to the 260px panel clip — east region widened to 280.

Remaining on #53: tile/VRAM/OAM viewers. Part of #53 — does not close it.

🤖 Generated with Claude Code

… CPU (#53)

src/disasm.eigs: pure reader-callback disassembler (octal-field decode,
computed CB page). Length-consistency gate: 172K+ straight-line
instructions executed by the debug engine, PC advance == disasm len,
0 mismatches; planted wrong-length fault caught; golden master pins
mnemonics (named as such). East panel: window from PC, click-to-toggle
breakpoints (DBG_BP seam), bp-armed RUN steps through the debug engine
and pauses reason=breakpoint. UI oracle: second atlas at font_scale 2,
DBG_DIS decode legs, real-mouse bp round-trip (arm at PC, trap, decode,
clear) — it caught a clipped final char at east_w=260 (now 280).
Also worked transparently on WRAM-executed Blargg code (bp at C003).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@InauguralPhysicist
InauguralPhysicist merged commit 5bdf284 into master Aug 4, 2026
1 check passed
@InauguralPhysicist
InauguralPhysicist deleted the debugger-disasm branch August 4, 2026 20:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant