Co-simulation and latencies
These options only apply if Phosphoneo was built with co-simulation (COSIM=1, which links the RP2040 emulator used by Phosphoric and LOCI); otherwise --neo-emu says a COSIM build is needed. This page follows the header of main.c: not every option was replayed for this wiki.
--neo-emu
Syntax : --neo-emu firmware.elf
Instead of the linked behaviour (the API code compiled into Phosphoneo), runs the firmware’s real ELF file on the RP2040 emulator: the PIO program that serves the bus serves the 65C02’s, as on the board. Reference cases are replayed in both backends and must agree.
--api-latency
Syntax : --api-latency table.txt
Freezes the 65C02 during each API call for the number of cycles in the table (per function), instead of 0 by default. The table is calibrated in co-simulation: about 31 cycles to write a character, 1,200 for a line, up to 30,000 (5 ms) for a large filled rectangle.
Good to know. These are per-function averages, in a constructed unit (24.4 ARM steps per cycle) and not measured on the board: the measurement protocol exists but has not been run yet.
--api-latency-out
Syntax : --api-latency-out table.txt
In co-simulation, writes the measured latency table at the end of the run (this is how tools/apilat_table.py builds the table for --api-latency).
--cdc-tty
Syntax : --cdc-tty /dev/pts/N (ou NEO_CDC_TTY=…)
Connects the firmware’s USB serial port (group 14) to a host terminal or pseudo-terminal: the program thinks it talks to a USB modem. With tools/fake_modem.py you get a software modem (Hayes, ESP-AT, real TCP connections) without a Pico W.
Example
$ python3 tools/fake_modem.py /tmp/pty.txt &
NEO_CDC_TTY=$(cat /tmp/pty.txt) phosphoneo --sdl prog.neo
--multiboot --slot-bin --slot-elf
Syntax : --multiboot neoboot.elf --slot-bin 1:fw.bin --slot-elf 2:reload.elf
The firmware’s multi-boot selector: --multiboot starts from neoboot.elf, --slot-bin N:FILE puts a binary in slot N of the emulated flash (repeatable), --slot-elf N:ELF names the “reload” firmware of slot N (BBC Micro, Oric), which takes the bus in bit-bang mode after call 1,14 and draws in MODE 7.
--bb-disc --type-keys-bb --shots-bb
Syntax : --bb-disc disque.ssd --type-keys-bb CYCLES:TEXTE --shots-bb CYCLES
For reload firmwares: --bb-disc presents a floppy image (.ssd/.dsd for the BBC) as the USB stick; --type-keys-bb types text N cycles after the switch to the bit-bang bus; --shots-bb sets the capture delay after that switch (default 4,000,000 cycles, stop at +2,000,000). tools/mkssd.py makes an .ssd image.