Skip to content

highbyte/dotnet-6502

Repository files navigation

A 6502 CPU emulator for .NET

.NET language OS WebAssembly SonarCloud Quality Gate SonarCloud Security Rating SonarCloud Vulnerabilities SonarCloud Reliability Rating SonarCloud Bugs SonarCloud Coverage .NET CodeQL NuGet Version GitHub Release GitHub Release Date GitHub last commit GitHub License

Overview

.NET cross-platform libraries and applications for executing 6502 CPU machine code, and emulating specific computer systems (such as Commodore 64) in different UI contexts — browser, desktop, and headless.

Important

This is mainly a programming exercise that may or may not turn into something more. See Limitations below.

📖 Documentation

Full documentation lives at https://highbyte.github.io/dotnet-6502/docs/ — apps, libraries, tools, systems, and development guides.

Try it in your browser

Avalonia WebAssembly Blazor WebAssembly

Other apps and features

  • Desktop apps for Windows, Linux, and macOS — Avalonia, SadConsole, and SilkNet variants. See Desktop apps.
  • Headless app for automation, scripting, and CI workflows — no UI, controlled via CLI and Lua. See Headless.
  • VS Code debugger extension for source and disassembly debugging of 6502 code. See VSCode debugger.
  • Lua scripting for driving the emulator — selecting systems, controlling emulation, reading/writing memory, injecting input. See Scripting.
  • TCP remote control lets external processes inspect and drive a running emulator over a newline-delimited JSON protocol. See Remote control.
  • C64 Basic AI code completion in the Blazor browser app. See AI code completion.

Libraries

Published as NuGet packages under Highbyte.DotNet6502.* — a core CPU library, system emulation libraries (Commodore 64, Generic), and per-host I/O implementations (Avalonia, Blazor, SadConsole, SilkNet, etc.). See Libraries for the full catalog and architecture.

Limitations

Important

  • Correct emulation of all aspects of computers such as the Commodore 64 is not likely.
  • Not the fastest emulator.
  • A real Commodore 64 uses the 6510 CPU; for the purpose of this emulator the 6502 is treated as equivalent (same instruction set).
  • Code coverage is currently limited to the core Highbyte.DotNet6502 library.

For the full list of missing features and constraints, see Limitations.

Development & references

Credits

  • Kristoffer Strube for the original Blazor WASM async interop code for WebAudio, DOM, and IDL that was the basis for a synchronous implementation in this repo. Copyright notice here.