Skip to content
Phosphoneowiki
Contents

Screenshots and memory dumps

A screenshot is a proof: compared with a reference image, it tells whether something changed. Images are PPM (uncompressed, readable by every tool); the console is a 53 × 30 character grid.

--screenshot

Syntax : --screenshot sortie.ppm

Saves the screen at the end of the run. The capture shows screen memory, without the mouse cursor, like the official emulator.

Example

$ phosphoneo --cycles 45000000 --screenshot out.ppm

--screenshot-at

Syntax : --screenshot-at CYCLES:FICHIER

Saves the screen after N cycles, during the run (64 captures at most, with the variants below). The cycle must be before the end: asking for the capture on the very last cycle produces nothing, hence the habit of leaving a 10,000-cycle margin.

Example

$ phosphoneo prog.neo --cycles 6000000 --screenshot-at 5900000:a.ppm

--screenshot-when

Syntax : --screenshot-when ADRESSE:VALEUR:FICHIER

Saves the screen when the 16-bit word stored in memory at ADDRESS (hexadecimal) equals VALUE (decimal). Handy with a program’s frame counter: “the capture at frame 300”, whatever the cycle count. Once per option.

Example

$ phosphoneo prog.neo --screenshot-when 0800:169:when.ppm

--screenshot-text

Syntax : --screenshot-text sortie.txt

Writes the console (the 53 × 30 text grid) to a file at the end. It is what you compare for a text program: lighter and more readable than an image, and easy to grep.

Example

$ phosphoneo mouse.neo6502@800 cold --cycles 4000000 --mouse-at 1000000:100,50,1 --screenshot-text m.txt
phosphoneo : console -> m.txt (cycle 4000002)

--screenshot-text-at

Syntax : --screenshot-text-at CYCLES:FICHIER

Like --screenshot-at, for the text console.

--screenshot-cursor

Syntax : --screenshot-cursor

Adds the mouse cursor to the screenshot, drawn as the board does (16 × 16, $FF transparent, nothing in monochrome). Without it, screenshots show screen memory alone.

--dump-ram-when

Syntax : --dump-ram-when ADRESSE:VALEUR:FICHIER

Copies the 64 KB of RAM to a file when RAM[ADDRESS] equals VALUE (hexadecimal; above FF it is the 16-bit word RAM[ADDRESS..ADDRESS+1]). Repeatable (8 at most); emulation goes on. The exit code is 2 if the condition never occurred.

Example

$ phosphoneo g.neo --cycles 2000000 --dump-ram-when 0800:A9:dump.bin
(dump.bin : 65 536 octets)

Sources in the repository : src/main.c, README.md.