Matthew Stanley
Show HN: I used AI to built static recompilers for 5 retro game systems SITE_META_DESC: (empty) SITE_BODY_TEXT: Matthew Stanley Home About Support Me Sign in Subscribe NES, SNES, Genesis, VirtualBoy, and PSX | A journey with AI and Recompilation Matthew Stanley 21 May 2026 • 11 min read
Last verified:
What is Matthew Stanley?
Matthew Stanley - This is a collection of static recompiler tools that convert retro console ROMs into native C code, which is then compiled into PC executables. Unlike traditional emulators that interpret instructions at runtime, these tools translate 6502 (NES), 68000 (Genesis), MIPS (PSX), and other console architectures into C at build time, enabling native x64 execution on modern computers.
The framework includes multiple specialized recompilers: NESRecomp for 6502-based NES games, SegaGenesisRecomp for Genesis/Mega Drive, PSXRecomp for PlayStation, and VirtualBoyRecomp for Virtual Boy. Key features include TOML-based game configuration, mapper/PPU/APU simulation in the runner library, text override systems for localization, configurable keyboard bindings, debugger TCP servers, and AI-assisted development using Claude Code for static analysis.
NESRecomp currently supports 10 games including Super Mario Bros., The Legend of Zelda, Faxanadu, Dr. Mario, Metroid, Yoshi, and Mega Man 3, covering mappers 0, 1, 4, and 66 (approximately 78% of the licensed NES library). The tools are designed for retro gaming enthusiasts, reverse engineers, game preservationists, and developers interested in static recompilation techniques. The project is open source under PolyForm Noncommercial 1.0.0 license.
Matthew Stanley pricing
Pricing model: Freemium
Free and open source under PolyForm Noncommercial 1.0.0 license. All source code available on GitHub at github.com/mstan/nesrecomp, github.com/mstan/psxrecomp, github.com/mstan/segagenesisrecomp. No paid tiers or commercial licensing available. Users must provide their own legally acquired ROMs.
Matthew Stanley pros
- Native x64 execution without runtime interpretation overhead
- Supports 10 commercial NES games with full playability
- Covers 78% of licensed NES library via mapper support
- TOML configuration format for game-specific settings
- Text override system enables localization without ROM hacking
- Hot-reload text overrides while game is running
- Configurable keyboard bindings via keybinds.ini
- TCP debug server with ring buffer for state tracking
- AI-assisted development with Claude Code integration
- Dual-execution mode for validation against interpreter
- Undocumented 6502 opcodes fully recognized and emulated
- Function discovery via BFS and pointer table scanning
- SRAM execution support for games like Zelda
- Deterministic timing with save states for debugging
- Open source with active development and 72 GitHub stars
Matthew Stanley cons
- Genesis recompilation has persistent audio timing issues
- Jumping mechanic broken in SegaGenesisRecomp Sonic demo
- Ghidra disassembly less reliable for 68000 code structure
- Native runner timing differs from hardware VBlank behavior
- Some sprite glitches remain in Genesis port
- PSXRecomp still work in progress with limited titles
- VirtualBoy Recomp only has one title (Mario Tennis)
- Requires Visual Studio 2022 and CMake 3.20+ to build
- Noncommercial license prohibits commercial use
- Some undocumented opcodes emitted as NOPs without side effects
Frequently asked questions about Matthew Stanley
How is this different from a traditional emulator?
This is NOT an emulator. Each console instruction is translated to equivalent C code at build time, then compiled to native x64. JSR becomes a direct C function call, branches become gotos. Traditional emulators interpret instructions at runtime, while this approach produces native executables with no runtime interpretation overhead.
Which NES games are currently supported?
NESRecomp supports 10 commercial games: Super Mario Bros., Duck Hunt, Dr. Mario, The Legend of Zelda, Metroid, Faxanadu, Yoshi, Yoshi's Cookie, Mega Man 3, and Gumshoe. Status ranges from fully playable to work in progress, with Zelda believed 100% playable and Megaman3 at title/menu/early stages playable.
What mappers does NESRecomp support?
Mappers 0 (NROM), 1 (MMC1/SxROM), 4 (MMC3/TxROM), and 66 (GxROM) are supported, covering approximately 78% of the licensed NES library. Mappers 2 (UxROM), 3 (CNROM), 7 (AxROM), and 9 (MMC2/PxROM) are not yet supported.
Can I modify game text without hacking the ROM?
Yes. NESRecomp includes a runtime text replacement system. FaxanaduRecomp implements a JSON-driven override system with multiple encoding registries, PRG ROM patching for all rendering paths, and hot-reload support—edit text_overrides.json while running and changes apply within ~1 second.
What are the system requirements to build?
Requires Visual Studio 2022 and CMake 3.20+. The recompiler is built with CMake for x64 Windows. Game executables link against the runner library and SDL2. Keyboard bindings are configured via auto-generated keybinds.ini on first run.
How does function discovery work?
Function discovery uses two phases: BFS from RESET/NMI/IRQ vectors following JSR/JMP to find statically reachable functions, plus a pointer table scanner finding 4+ consecutive 16-bit LE values where targets pass deep-decode validation (7+ valid 65002 instructions). This catches dispatch patterns static analysis alone misses.
What is the current status of SegaGenesisRecomp?
Game boots, SEGA logo works, title screen renders, Green Hill loads, basic movement/enemies/rings/HUD work. Known issues: jumping is broken, audio timing issues (Z80 not advancing), some sprite glitches, missing functions for picking up fallen rings after damage. Audio distortion persists.
Can I add my own game to the framework?
Yes. See CLAUDE.md for instructions: copy FaxanaduRecomp as boilerplate, create game.toml with mapper/bank switch/dispatch configuration, create extras.c implementing game_extras.h hook interface, run NESRecomp.exe with ROM and config, then build with CMake linking against runner library and SDL2.
What undocumented 6502 opcodes are supported?
LAX (Load A+X), SAX (Store A&X), and DOP/TOP (2-/3-byte NOP-with-read) are emitted with full semantics. DCP, ISC, SLO, RLA, SRE, RRA, ANC, ALR, ARR, AXS, KIL, plus SHX/SHY/SHA/TAS/LAS family are recognized but emitted as sized NOPs losing side effects. Decoder recognizes all 105 undocumented opcodes.
Is this project commercial or free?
Free and open source under PolyForm Noncommercial 1.0.0 license, which prohibits commercial use. All source code is on GitHub under mstan organization. The project has 72 stars, 3 watchers, and 3 forks as of the latest update.