# Geargrafx standard validation environment Official project: [drhelius/Geargrafx](https://github.com/drhelius/Geargrafx). Tested pin: `b49ae82a012eade566d72e9d61c9d95a5caa4da3` (2026-10-08, upstream describes itself as 1.8.2 plus subsequent commits). We reviewed its README, MCP documentation, Linux/libretro Makefiles and loader/debug source. The archive checksum and GPL-3.0 license are recorded in [`tools/dependencies.json`](../tools/dependencies.json). Bundled libraries retain their individual licenses. No emulator source is copied into this repository or firmware; all builds take place in the external tool cache. ## Build the standard automated-test core ```sh make setup # Or prepare only Geargrafx: bash scripts/setup-geargrafx.sh make integration ``` The official `platforms/libretro/Makefile` builds `geargrafx_libretro.so` using GCC/G++, Make and bundled codec dependencies; SDL3, a display and an installed RetroArch frontend are not required. The repository's original Python frontend uses this core's documented libretro interface directly. This is real HuC6280 execution, not an interpreter mock. The pin is embedded as the reported core version and asserted by the test. The local source build and HuCARD smoke passed; repeatability and a mutated-ROM failure also passed. Actual checks and their evidence fields are documented in [testing.md](testing.md). No CD fixture or System Card artifact is generated by the current build. ## Optional standalone GUI / MCP build Upstream Linux desktop requires SDL3 and OpenGL development support. On Ubuntu 24.04 SDL3 must be built from source according to the upstream README. The local bootstrap host lacks SDL3 development files and CMake: **desktop/MCP build and runtime are BLOCKED/NOT_RUN here**. The libretro tests remain fully executable. Review prerequisites yourself; these commands are provided, not automatically run: ```sh sudo apt-get update sudo apt-get install build-essential cmake git pkg-config \ libasound2-dev libpulse-dev libx11-dev libxext-dev libxrandr-dev \ libxcursor-dev libxfixes-dev libxi-dev libxss-dev libwayland-dev \ libxkbcommon-dev libdrm-dev libgbm-dev libgl1-mesa-dev libegl1-mesa-dev \ libdbus-1-dev libudev-dev libxtst-dev ``` Use a fixed SDL3 release rather than the README's mutable latest-release lookup: ```sh git clone --branch release-3.2.28 --depth 1 https://github.com/libsdl-org/SDL.git /tmp/pce-sdl3 git -C /tmp/pce-sdl3 rev-parse HEAD # Expected: 7f3ae3d57459e59943a4ecfefc8f6277ec6bf540 test "$(git -C /tmp/pce-sdl3 rev-parse HEAD)" = 7f3ae3d57459e59943a4ecfefc8f6277ec6bf540 cmake -S /tmp/pce-sdl3 -B /tmp/pce-sdl3/build \ -DCMAKE_INSTALL_PREFIX=/tmp/pce-sdl3-install -DSDL_TESTS=OFF -DSDL_EXAMPLES=OFF cmake --build /tmp/pce-sdl3/build -j2 cmake --install /tmp/pce-sdl3/build export PKG_CONFIG_PATH=/tmp/pce-sdl3-install/lib/pkgconfig:/tmp/pce-sdl3-install/lib64/pkgconfig export LD_LIBRARY_PATH=/tmp/pce-sdl3-install/lib:/tmp/pce-sdl3-install/lib64 bash scripts/setup-geargrafx.sh --desktop ``` SDL3's [official source](https://github.com/libsdl-org/SDL/tree/7f3ae3d57459e59943a4ecfefc8f6277ec6bf540) uses the [zlib license](https://github.com/libsdl-org/SDL/blob/7f3ae3d57459e59943a4ecfefc8f6277ec6bf540/LICENSE.txt). These desktop commands have not been run end-to-end on this host. Platform dependencies may require adjustment; any missing dependency must remain explicit. The script uses a separate `geargrafx--desktop` source tree, because desktop and libretro builds share upstream object paths but use different compile defines. It fails nonzero when SDL3 is absent and never installs packages using sudo. ## Capability research at the pin | Question | Source-supported capability / limit | | --- | --- | | CD-ROM² / SUPER CD-ROM² | README lists CD-ROM², Super CD-ROM² and Arcade CD-ROM²; source implements CD/SCSI/ADPCM and Card RAM. Not tested by our HuCARD fixture. | | System Card loading | Desktop MCP `load_bios` accepts absolute `file_path` and `type: syscard`; libretro selects `syscard1.pce`, `syscard2.pce` or `syscard3.pce` in frontend system directory, with System Card 3 as default. | | BIOS format acceptance | `Media::LoadBiosData` expects 256 KiB for syscard, optionally removes a 512-byte header, then marks bytes loaded. Acceptance is size/loading evidence, not valid reset/API/game compatibility. Our 8 KiB fixture is loaded as HuCARD, never as BIOS. | | CPU / memory / I/O debug | Standalone has logical/physical-memory execute/read/write breakpoints, HuC6280 registers/MPR/timer/IRQ state, memory editor, VDC/VCE/PSG/CD inspectors and disassembler. | | BIOS API call tracking | Execute breakpoints at candidate `$E000+3*slot`, CPU instruction traces, call stack and MPR observations can locate calls. Always qualify bank state. There is no verified semantic API decoding in this project's harness. | | Logs / traces | MCP `set_trace_log` / `get_trace_log` expose memory/disk traces with CPU, IRQ, system.mpr, CD control, SCSI and ADPCM filters and sequence pagination. The libretro build disables the disassembler and exposes no public PC/trace tools. | | CLI automation | Standalone documents `--headless --mcp-stdio`, or local HTTP MCP, plus `--portable`, `--version`, game path. Bounded MCP lifecycle/checkpoints remain #103. Current automation uses bounded libretro worker subprocesses, unload/deinit and no GUI. | Sources: [README / build and CLI](https://github.com/drhelius/Geargrafx/blob/b49ae82a012eade566d72e9d61c9d95a5caa4da3/README.md), [MCP catalog](https://github.com/drhelius/Geargrafx/blob/b49ae82a012eade566d72e9d61c9d95a5caa4da3/MCP_README.md), [BIOS loader](https://github.com/drhelius/Geargrafx/blob/b49ae82a012eade566d72e9d61c9d95a5caa4da3/src/media.cpp), [libretro frontend](https://github.com/drhelius/Geargrafx/blob/b49ae82a012eade566d72e9d61c9d95a5caa4da3/platforms/libretro/libretro.cpp), [MCP schemas](https://github.com/drhelius/Geargrafx/blob/b49ae82a012eade566d72e9d61c9d95a5caa4da3/platforms/shared/desktop/mcp/mcp_server.cpp). ## Manual debug procedure (not executed locally) After a successful desktop setup, find the executable at `/geargrafx--desktop/platforms/linux/geargrafx`. Copy the executable into a dedicated writable temporary session directory and use `--portable` so configuration, saves and logs do not share the user's profile. 1. Run `make build`; open **the HuCARD** `build/debug/smoke-test-not-bios.pce`. 2. Pause in the debugger; add an execute breakpoint at logical `$E030`. 3. Reset and continue to the breakpoint; inspect PC and MPR1 (`$F8`). 4. Inspect CPU RAM `$2200-$2205`: expect `50 43 45 21 F8 5A`. 5. Enable CPU and MPR trace, reset and repeat; save logs with source/core SHA and ROM hash, and report observations rather than merely a ROM accepted dialog. 6. Exit the session process and remove only its temporary profile when finished. For headless MCP, launch the dedicated session binary with `--headless --mcp-stdio --portable`; discover `tools/list` at this exact pin. Use `debug_pause`, `load_media`, `set_breakpoint` (address `E030`, memory_area `cpu_addr`, execute true), `debug_reset`, bounded execution/polling, `get_huc6280_status`, `read_memory` and the trace tools. Discover argument schemas rather than assuming synchronous execution; use synchronous stepping where supported. Terminate the child process on timeout and verify shutdown. `tools/mcp_checkpoint.py --binary --rom build/debug/smoke-test-not-bios.pce` implements this as a bounded stdio client (private `--portable` profile copy, per-request deadlines, kill and verify on timeout, cold then warm reset with RAM cleared, PC/MPR1/RAM and non-empty trace assertions). Exit 0 PASS, 1 FAIL/TIMEOUT, 3 BLOCKED (binary absent). Tool names come from the pin's MCP_README; arguments missing from the discovered `inputSchema` fail as `schema_mismatch`. UNKNOWN until a real run: exact argument names (`address`, `size`, `data`, `action`), status/trace JSON field names, and whether `set_breakpoint` defaults to an execute breakpoint on the CPU address space; the synthetic server encodes these as guesses. Tests: `python3 -m unittest tests.host.test_mcp_checkpoint` (fake server only). The current host does not prove these GUI/MCP steps. The follow-up [#103](https://github.com/mao2009/oss-pce-cd-bios/issues/103) tracks adding PC/MPR and trace evidence to the existing RAM smoke gate under parent #6. No upstream patch is presently justified: standalone already has the missing libretro facilities. Geargrafx is one implementation, not a normative hardware specification. Its reset mapping and loader behavior are useful experimental context. Keep actual BIOS code independent of emulator-specific HLE or special hooks, and corroborate hardware/API contracts with independent evidence before implementation (#1/#7). ## Headless System Card development diagnostics (#101) `make dev-integration` can observe PC/X/MPR without SDL/MCP by linking an original C++ probe to the official pinned core's existing objects. It loads the original DEV ROM as System Card BIOS and a generated zero-filled synthetic disc, steps the actual CPU and checks reset/slot checkpoints. No emulator code is copied or patched. The GPL-linked executable stays local and is excluded from artifacts. This does not complete the standalone MCP/CD harness (#6/#103) or prove hardware ABI compatibility. Exact assertions and limits: [API scaffold](api-stub-scaffold.md). ## Instruction debugger and contract probes `make setup` additionally builds a separate debugger-enabled Geargrafx tree from the same verified source archive; no SDL installation or source patch is needed. The normal HuCARD core stays separate. `make dev-test` now verifies actual one-instruction stepping, registers/stack/RAM, guest bank switches, IRQ1/IRQ2, loader edge cases and additional negative procedures. [Exact conditions and API limitations](geargrafx-contract-evidence.md).