Module trace

Module trace 

Source
Expand description

The lockstep gate’s side of this add-on: how a traced SuperGrafx is built from a command line, and the save-state checks. Not a module of the reference: its counterparts there are scripts/sgx_ours.py (the modes and --vpc-option) and scripts/sgx_state.py.

The lines themselves are the base board’s (pcengine_rust::trace::frame_line: the CPU bus log, the mixed picture, the audio and the CPU state of a frame), and so is the command line (pcengine_rust::trace::Setup), to which this adds:

  • --mode sgx|compat|base: the add-on in native position (default), the back-panel switch in PC Engine position, or the fallback: the card on the plain base board with a row of 32 KiB and one VDC (the reference’s sgx_ours.py --mode base);
  • --vpc NAME=VALUE: a named switch by the reference’s attribute name (PRIORITY_LABELS=sgxtech, WINDOW_ORIGIN=48,48,48 for the dividers 4, 3 and 2, WINDOW_OFF_AT_OR_BELOW=N, ST_STEERS_IN_COMPAT=true);
  • --compat-at FRAME: the switch is moved to PC Engine position once FRAME frames have completed (U-SGX4 needs a $0E bit left over from native mode).

roundtrip and runahead are the base board’s trace::roundtrip and runahead over a machine built here (the base’s build its own boards from a Setup, so they could not be called).

Structs§

SgxSetup
How a traced machine is built: the base board’s Setup and this add-on’s own arguments.

Enums§

Mode

Constants§

BASE_MODE
The fallback’s machine row: the SuperGrafx’s RAM on a board with one VDC and no VPC.

Functions§

roundtrip
Save states, proven complete (the base board’s trace::roundtrip, the reference’s scripts/sgx_state.py): power on, run to frame at plus extra instructions, save, then load the state into a fresh system and into one that had run elsewhere, and run each to frame to: every frame after the save must be the same, by the gate’s own lines, and the loaded system saved at once must give the same bytes.
runahead
The snapshot pair in a run-ahead pass (the base board’s trace::runahead): every frame is run, a snapshot taken, ahead more frames run with other buttons held, and the snapshot put back. Each frame’s line, and the state at the end, must equal a run’s that never looked ahead.
set_vpc_switch
A named switch of the reference’s Vpc, by its attribute name. ST_STEERS_IN_COMPAT (the page’s) is answered with Ok(Some(value)).