Module trace

Module trace 

Source
Expand description

Boundary traces in the reference’s version 1 JSON Lines schema (trace.py and the parts of debug.py a trace needs; 6502-python docs/trace-schema.md).

One JSON object per boundary: kind one of BoundaryKind’s values, before and after every field of CpuState, instruction.address the 16-bit logical PC and instruction.data the instruction’s bytes (no mnemonic: the reference disassembles the bytes itself), and accesses [kind, address, value] with kinds "r", "w", "d" (a dummy read, value 0) and "i" (an internal cycle, recorded at address 0, value 0) and 21-bit physical addresses, one per cycle. The reference’s reader, read_trace, and first_trace_divergence compare a trace written here with one its HuC6280Session wrote. Only writing is transcribed; comparing is the reference’s job.

Structs§

StepRecord
One processor boundary.

Enums§

Access
One cycle as the trace records it.
BoundaryKind
Kind of work performed by one HuC6280::step() call.

Constants§

TRACE_SCHEMA_VERSION

Functions§

instruction_length
How many bytes the instruction with this opcode occupies (the reference’s FORM_BYTES by its form).
next_boundary
What the next step() will do, decided as the reference’s debug.next_boundary decides it from a state.