This chapter illustrates common debugging workflows combining the debugger window, Debugger console, Frame Analyzer, reverse execution, headless options, and GDB remote stub.
Diagnosing sprite rendering issues¶
If an on-screen sprite disappears, flickers, or displays incorrect graphics:
Pause before the failure point: Reverse-step if necessary (
RFRAMEin the console steps backward by one frame).Inspect the Video tab: The sprite viewer decodes positions (
SPRxPOS,SPRxCTL), DMA line counts, and fetched graphics.If a sprite is armed but fetches zero DMA lines, check whether sprite DMA is disabled in
DMACON.If the sprite contains valid graphics data but renders at the wrong coordinates, inspect the Copper list positioning instructions.
Trace register writes: In the console, execute
RWATCH DMACONto verify when and where sprite DMA was modified.Isolate layers: In the Video tab, toggle individual sprite channels or bitplane layers to verify which subsystem is drawing specific screen elements.
Investigating Copper list corruption and visual artifacts¶
If the display exhibits raster splits at incorrect scanlines or corrupted palettes:
Open the Frame Analyzer: Press
Uto enable the rendered video underlay beneath the chip-bus slot heatmap.Inspect scanline writes: Hover over the affected scanline to decode custom register writes (
COLORxx,BPLxPTH) executed near that beam position.Set a beam trap: Set a trap at the problem scanline (e.g.
BTRAP 145in the console or To slot in the Frame Analyzer). Execution halts when the raster beam reaches that line.Single-step the Copper: Switch to the Copper tab and use
CStep(C) to execute Copper instructions sequentially acrossWAITboundaries.Trace memory modifications: Use
WRITER ADDRto scan execution history and identify the last CPU or Blitter instruction that wrote to the Copper list address.
Identifying memory corruption¶
When tracking down overwritten data buffers or corrupted OS structures:
Set a memory watchpoint: In the console, execute
WATCH ADDR(orWATCH ADDR BLITTERif isolating Blitter writes).Reverse lookup: If memory has already been corrupted, execute
WRITER ADDRto query the snapshot ring and find the instruction responsible for the write.Bisection with save states: Use
--save-state-afterand--load-stateto narrow down the exact timeframe when corruption occurred.
Diagnosing Guru Meditation crashes and unhandled exceptions¶
Catch system alerts: In the console, enter
CATCHALERT. Emulation halts immediately whenexec.library/Alert()is called before the alert screen renders.Decode alert codes: Run
GURUto translate the alert code in registerD7into a descriptive error message.Inspect the call stack: Use
STACKandHISTORYin the console to inspect recent subroutine calls and retired program counters. Step backward usingRSTEPto inspect state prior to the crash.Inspect Exec tasks: Run
TASKSto view scheduled and waiting task queues, orTASK <name>to inspect task stack pointers and signal allocations.
Locating in-game variables (Memory search / Trainer workflow)¶
Initialize search: In the console, enter
HUNT START(orHUNT START Bfor byte search).Filter by value: If searching for a lives counter starting at 3, run
HUNT EQ 3.Update and narrow: Change the in-game value (e.g. lose a life) and run
HUNT EQ 2.Review candidates: Run
HUNT LISTto view matching memory addresses.Set watchpoints or modify: Attach a watchpoint (
WATCH ADDR) or modify the value (POKE ADDR 9).
Logic analyzer waveform capture¶
When investigating fine-grained DMA and bus arbitration timing issues:
WAVE START glitch.vcd beam=100 2fThis arms a capture triggering at scanline 100 and records two frames of chip-bus
activity. The resulting .vcd file can be opened in GTKWave to inspect exact
cycle-by-cycle interleaving between CPU, Copper, Blitter, and DMA channels.