Zafiro.Nes.Debug.Core 0.0.13

dotnet add package Zafiro.Nes.Debug.Core --version 0.0.13
                    
NuGet\Install-Package Zafiro.Nes.Debug.Core -Version 0.0.13
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Zafiro.Nes.Debug.Core" Version="0.0.13" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Zafiro.Nes.Debug.Core" Version="0.0.13" />
                    
Directory.Packages.props
<PackageReference Include="Zafiro.Nes.Debug.Core" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Zafiro.Nes.Debug.Core --version 0.0.13
                    
#r "nuget: Zafiro.Nes.Debug.Core, 0.0.13"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Zafiro.Nes.Debug.Core@0.0.13
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Zafiro.Nes.Debug.Core&version=0.0.13
                    
Install as a Cake Addin
#tool nuget:?package=Zafiro.Nes.Debug.Core&version=0.0.13
                    
Install as a Cake Tool

Zafiro.Nes.Debug

Zafiro.Nes.Debug.Mcp is a cross-platform .NET MCP server for inspecting and controlling NES ROMs in iNES format.

The MCP server exposes CPU stepping, frame execution, deterministic controller input timelines, breakpoints/watchpoints, CPU memory reads/writes, authoritative PPU/OAM inspection, continuous PPU-register tracing, correlated screen/RAM/PPU observation, symbols, lightweight disassembly, savestates, screen-region probes, and PNG screen capture.

Zafiro.Nes.Debug.Mcp directly uses the vendored AprNes backend for every supported ROM. AprNes implements the complete MCP debug workflow, including continuous PPU-register tracing and correlated execution observation for mappers 0-3 and the broader supported mapper set.

Build

Requirements:

  • .NET 10 SDK

From the repo root:

dotnet build Zafiro.Nes.Debug.slnx

Run

From the repo root:

dotnet run --project src/Zafiro.Nes.Debug.Mcp/Zafiro.Nes.Debug.Mcp.csproj

Connect An MCP Client

Use stdio transport. For development against this local checkout:

{
  "mcpServers": {
    "nes_debug": {
      "command": "dotnet",
      "args": [
        "run",
        "--no-restore",
        "--project",
        "/absolute/path/to/Zafiro.Nes.Debug/src/Zafiro.Nes.Debug.Mcp/Zafiro.Nes.Debug.Mcp.csproj"
      ],
      "startup_timeout_sec": 60,
      "tool_timeout_sec": 60
    }
  }
}

After changing or updating the local checkout, restart the MCP client so it terminates and relaunches the stdio server. The dnx form uses the published NuGet package; use the local dotnet run form when validating source changes that have not been released as a package yet.

Once the tool is packed and published, the path-independent form should be:

{
  "mcpServers": {
    "nes_debug": {
      "command": "dnx",
      "args": ["Zafiro.Nes.Debug.Mcp", "--yes"]
    }
  }
}

Tools

Implemented tools:

  • load_rom
  • save_state
  • load_state
  • reset
  • step_instruction
  • step_over
  • step_out
  • run_frame
  • set_controller
  • set_joypad
  • press_buttons
  • run_input_timeline
  • continue_until_break
  • run_until_condition
  • set_breakpoint
  • clear_breakpoint
  • list_breakpoints
  • set_watchpoint
  • set_watchpoint_range
  • clear_watchpoint
  • list_watchpoints
  • get_state
  • read_registers
  • read_memory
  • write_memory
  • disassemble
  • load_symbols
  • resolve_symbol
  • read_symbol
  • dump_oam
  • read_ppu_state
  • capture_screen
  • find_last_writer
  • find_last_writers
  • trace_until_write
  • trace_until_write_range
  • trace_ppu_register_writes
  • read_screen_region
  • observe_screen
  • observe_execution
  • dump_nametables
  • dump_tilemap
  • dump_tileset

See docs/mcp-tools.md for schemas and examples.

Current Limitations

  • Debug stepping, conditional breakpoints, and watchpoints are implemented by the AprNes debug session.
  • Disassembly is intentionally small and currently covers the opcodes most useful for first smoke/debug work; unknown opcodes are returned as .db.
  • Symbol parsing is intentionally simple: BANK:ADDR Name and ADDR Name lines with ; or # comments.
  • Savestates are debugger snapshots, not a stable long-term archival format. They should be treated as version-bound to the current backend implementation.

Validate

dotnet test Zafiro.Nes.Debug.slnx -m:1
git diff --check

Libraries

Besides the MCP tool, the libraries it is built on are published to NuGet for programs that drive the emulator directly:

Package Contents
Zafiro.Nes.Debug.Emulator the managed emulator (vendored AprNes) and its debug session
Zafiro.Nes.Debug.Core debug session contracts and models
Zafiro.Nes.Debug.Symbols symbol files

Zafiro.Nes.Debug.Emulator carries the AprNes licenses (MIT AND WTFPL AND GPL-3.0-or-later); see the third-party notices.

Third-Party Code

See THIRD-PARTY-NOTICES.md for attribution, license notes, and acknowledgements for vendored emulator code and credited emulator reference work.

The main local license files are:

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • No dependencies.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on Zafiro.Nes.Debug.Core:

Package Downloads
Zafiro.Nes.Debug.Symbols

Symbol file loading and resolution for Zafiro.Nes.Debug.

Zafiro.Nes.Debug.Emulator

Managed NES / Famicom emulator (vendored AprNes core) with a debug session: stepping, breakpoints, memory and register observers, savestates. No native dependencies.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.0.13 61 10/26/2026

# Changelog 0.0.13

## Changes (initial history)

- Publish the emulator libraries to NuGet (#19) (`75ec51e`)
- Rename to Zafiro.Nes.Debug (#18) (`27b6624`)
- fix: set ContentRootPath to AppContext.BaseDirectory to avoid recursive inotify watches (`22bfb0b`)
- Replace ADNES with AprNes as the sole NES backend (#17) (`68b7e41`)
- test: certify AprNes NROM conformance (#16) (`2d09c49`)
- Fix MMC3 frame runs through OAM DMA (#7) (`43f559b`)
- Add deterministic PPU observability (#5) (`8e09f30`)
- fix(mcp): resolve DI circular dependency that hung every NES tool call (#4) (`c67ee43`)
- docs: add emulator license notices (`2d162e5`)
- feat: complete AprNes debug workflows (`ab902d0`)
- feat: add AprNes backend for mapper support (`21b956e`)
- feat: support four-screen nametable VRAM (`24f1a67`)
- feat: align NES MCP debug workflows with Game Boy (`9283f4c`)
- feat: align NES MCP debug tools with Game Boy (`460708f`)
- feat: add NES debug MCP server (`e9ffa71`)