# ramdiff

> **Tool `tools/verify/ramdiff.py`** (program, Verify). Compare the game's memory frame by frame, from the original and from the port, and report the first frame and the first addresses that differ.

Run it with `./gameframe run ramdiff ARGS` or `python3 tools/verify/ramdiff.py`. [Source on GitHub](https://github.com/tanepiper/game-frame/blob/main/tools/verify/ramdiff.py).

## Its own help

This is the help text in the tool itself, as `./gameframe tool ramdiff` prints it.

```text
Compare the game's memory frame by frame, from the original and from the port, and report the
first frame and the first addresses that differ.

Usage: ramdiff.py A B [--size N] [--base 0xADDR] [--map FILE] [--ignore 0xSTART-0xEND ...]
                      [--frames N] [--all]

A and B are each a folder of snapshots, one file per frame in name order (frame_0001.bin,
frame_0002.bin ...), or one file of snapshots one after another, each --size bytes. An
emulator's script can write the original's memory after each frame of an input recording. The
port writes its own copy of the same state, in the original's layout, after each frame of the
same inputs. The first frame where they differ is where the port went wrong. Later frames only
show the difference spreading.

--base is the address of the first byte (0x0000 for the NES's 2 KB, 0x7E0000 for the SNES's work
RAM). --map names the addresses: a text file of lines "ADDRESS SIZE NAME", such as
"0x0075 1 player_x". Community RAM maps (Data Crystal, TASVideos) are written in this form.
--ignore leaves out ranges that legitimately differ: the stack, a frame counter the port keeps
elsewhere, buffers the port does not use. --all lists every differing frame, not only the
first. Standard library only.
```

## Named by

Skills: [re-observe](/skills/re-observe), [re-verify](/skills/re-verify).

Agents: [re-observer](/agents/re-observer), [re-verifier](/agents/re-verifier).
