Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Headless debugger environment reference

Copperline includes a headless debugger (src/debugger.rs) driven by COPPERLINE_DBG_* environment variables. It operates during normal execution as well as windowless --screenshot-after and --dump-frames runs.

Log output is emitted through the standard log crate. Set RUST_LOG=info or RUST_LOG=debug to view reports:

RUST_LOG=info \
COPPERLINE_DBG_BREAK=C033C2 \
COPPERLINE_DBG_DUMP=C09580:4 \
COPPERLINE_DBG_SHOT=/tmp/hit \
./target/release/copperline --config copperline.example.toml --noaudio \
  --screenshot-after 30 /tmp/out.png

Addresses are specified in hexadecimal (with or without 0x or $ prefixes).

Breakpoint and watchpoint variables

COPPERLINE_DBG_BREAK=PC[,PC...]
Program counter breakpoints. On each hit, logs emulated timestamp, frame number, beam position (v=, h=), registers, and any configured memory dumps.
COPPERLINE_DBG_WATCH=ADDR[:LEN][,...]
Memory watchpoints (length in bytes, default 2). Logs memory modifications from CPU, Copper, or Blitter DMA.
COPPERLINE_DBG_MEMW=ADDR
CPU-only write watchpoint on a single word. Logs the writing instruction PC, post-write value, and emulated timestamp.
COPPERLINE_DBG_FC=ADDR
Logs every change to the word at ADDR with emulated time and update counter. Useful for analyzing frame counters and polling loops.
COPPERLINE_DBG_DUMP=ADDR:WORDS[,...]
Memory regions to hex-dump when breakpoint or watchpoint reports fire.
COPPERLINE_DBG_TRACE=1
Emits disassembled per-instruction execution trace during the active debugger window.
COPPERLINE_DBG_TRACE_FULL=1
Fixed-width all-hex register dumps per instruction for differential trace comparison.
COPPERLINE_DBG_TRACE_LO=ADDR / COPPERLINE_DBG_TRACE_HI=ADDR
Restricts execution trace output to instructions within the address range [LO, HI].
COPPERLINE_DBG_CATCH=SPEC[,SPEC...]
Exception vector catchpoints (e.g., COPPERLINE_DBG_CATCH="3,4,irq 3").
COPPERLINE_DBG_CATCHALERT=1
Intercepts exec.library/Alert() calls and decodes the alert code (Guru Meditation).
COPPERLINE_DBG_IRQ=1
Logs serviced interrupt levels and pending interrupt request bits.
COPPERLINE_DBG_CIA=1
Logs INTENA and INTREQ writes touching the EXTER bit or master enable.
COPPERLINE_DBG_DSKLEN=1
Logs every DSKLEN write (disk DMA arming) and DSKBLK interrupt completion.
COPPERLINE_DBG_SPREN=1
Logs when a DMACON write clears the sprite-DMA enable bit, including the writing PC.
COPPERLINE_DBG_BLIT=LO:HI
Logs Blitter operations started between LO and HI emulated seconds.
COPPERLINE_DBG_RAMDUMP=ADDR:LEN:FILE
One-shot memory dump written to FILE the first time the debugger activates.
COPPERLINE_DBG_COPPER=auto | ADDR[:COUNT]
Dumps disassembled Copper list on first debugger activation (auto reads COP1LC).
COPPERLINE_DBG_LISTCHECK=HEAD[,HEAD...]
Walks Exec List linkage headers after every instruction to detect cycles or corruption.
COPPERLINE_DBG_EXPORT_PLANES=1
Exports per-line fetched bitplane data and composite index images for frames in the active window. Use COPPERLINE_DBG_EXPORT_PLANES_DIR=DIR to set the output directory.
COPPERLINE_DBG_FRAMESTATE=1
Logs display configuration, palette, DMA state, and Denise sprite shadow/hardware registers. COPPERLINE_DBG_FRAMESTATE_FULLPAL=1 extends palette logs to all 256 AGA entries.
COPPERLINE_DBG_AFTER=SECS / COPPERLINE_DBG_UNTIL=SECS
Restricts debugger evaluation to a specific emulated time window.
COPPERLINE_DBG_MAXHITS=N
Limits maximum logged report hits (default: 200).
COPPERLINE_DBG_SHOT=PREFIX
Saves a PNG screenshot on each breakpoint hit (PREFIX-0000.png, etc.).

Subsystem diagnostic variables

VariableDescription
COPPERLINE_DIAG_SLOTMAPDumps per-colour-clock chip-bus allocation map for a frame
COPPERLINE_DIAG_BLT_SLOTSDetailed Blitter pipeline slot and bus ownership trace
COPPERLINE_DIAG_IPLCPU cycle consumption breakdown per interrupt level
COPPERLINE_DIAG_PCSAMPLESampled PC histogram every 50 frames to locate CPU hotspots
COPPERLINE_DIAG_PCHISTRecords recent PC execution history
COPPERLINE_DIAG_COPLENMeasures Copper list length
COPPERLINE_DIAG_COP_WRITESLogs exact landing colour-clock cycle for every Copper MOVE
COPPERLINE_DIAG_CPU_BUSLogs CPU chip-bus request, grant, and cycle wait states
COPPERLINE_DIAG_CPU_READSLogs CPU custom-register reads with bus slot and return value
COPPERLINE_DIAG_CPU_SYNCCPU internal cycle trace at synchronization points
COPPERLINE_DIAG_CPU_WRITESLogs CPU custom-register writes with bus slot and beam coordinates
COPPERLINE_DIAG_DISPLAYDisplay register change log
COPPERLINE_DIAG_CAPROWPer-line bitplane capture state at DDF start
COPPERLINE_DIAG_PALETTE_ROWLogs beam-timed COLOR writes for selected scanlines
COPPERLINE_DIAG_PALSTORELogs COLOR and BPLCON3 writes at register store application
COPPERLINE_DIAG_HAM_PIXELSSamples DMA playfield HAM pixels on a specified beam line
COPPERLINE_DIAG_MANUAL_BPL_PIXELSSamples CPU/Copper BPLDAT replay pixels on a beam line
COPPERLINE_DIAG_FRAME_PIXELSSamples final framebuffer pixels after rendering pipeline
COPPERLINE_DIAG_SPRITESSprite DMA fetch and render log
COPPERLINE_DIAG_SPRCAPLogs captured sprite DMA lines
COPPERLINE_DIAG_MANUAL_SPRITESLogs manually replayed sprite intervals and register writes
COPPERLINE_DIAG_SPRITE_PIXELSSamples non-transparent sprite pixels on a beam line
COPPERLINE_DIAG_BLITREGSLogs full Blitter register set at blit starts
COPPERLINE_TRACE_BLITTERGenerates JSON trace of Blitter starts, polls, and IRQ latches
COPPERLINE_DIAG_POLLSTATSReports most-read CIA and custom registers on screenshots/dumps
COPPERLINE_DIAG_DISKDisk DMA state transitions and DSKLEN writes
COPPERLINE_DIAG_FLUXBRIDGEDetailed physical floppy drive head stepping and MFM sector metrics
COPPERLINE_DIAG_AUDIO_NOTESLogs Paula channel note on/off transitions
COPPERLINE_DIAG_CRASHCPU empty-RAM execution and low-memory write context
COPPERLINE_DIAG_GAYLE / CDTVGayle IDE and CDTV controller traffic
COPPERLINE_DIAG_A2091A2091 SCSI DMAC and WD33C93 register access trace
COPPERLINE_DIAG_A4091A4091 NCR53C710 SCRIPTS instruction trace
COPPERLINE_DIAG_CURSORHost cursor mapping diagnostics
COPPERLINE_DUMP_BLITMEMDumps chip RAM on BLTSIZE writes
COPPERLINE_DUMP_BUS_ACCOUNTINGPer-frame chip-bus slot accounting summary
COPPERLINE_SHOT_RAW=1Exports unscaled 716x570 native raster framebuffer dumps