capture_leaf_io
Capture a leaf function's input-output behavior by injecting test inputs into its memory word and recording output, registers, and condition flags for differential verification.
Instructions
Golden-vector capture for a pure leaf that transforms one memory word/byte in place (RNG/counter/accumulator). Injects inputs via taps, records output + regs + CCR. Independent oracle for the transpiler differential harness.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | No | MAME working directory. Defaults to MAME_CWD or current directory. | |
| regs | No | Register names to capture at write-back (e.g. ["D7"]). | |
| pcLow | No | Low PC bound identifying 'inside this function' (default entryPc-2). | |
| width | No | Operand width in bytes: 1 or 2. | |
| inputs | Yes | Test input values to inject (integers). | |
| pcHigh | No | High PC bound (default entryPc+0x40). | |
| system | No | MAME machine short name. Defaults to MAME_SYSTEM. | |
| entryPc | Yes | Function entry address (e.g. 0x412). | |
| logPath | No | Optional output log path. | |
| mameExe | No | MAME executable. Defaults to MAME_EXE or `mame`. | |
| rompath | No | ROM search path. Defaults to MAME_ROMPATH. | |
| workdir | No | Generated-script/log directory. Defaults to MAME_WORKDIR or <cwd>/.mame_mcp. | |
| frameCap | No | Max frames to run before giving up. | |
| timeoutSec | No | Process timeout in seconds. | |
| varAddress | Yes | Absolute address of the in/out word the leaf reads then writes (e.g. 0xF0170E). |