A 6502 CPU emulator for .NET
.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. Links below for details on each library/app.
Important
This is mainly a programming exercise, that may or may not turn into something more. See Limitations below.
| Avalonia WebAssembly app | Blazor WebAssembly app |
|---|---|
![]() |
![]() |
| Avalonia desktop app | SadConsole desktop app | SilkNet desktop app |
|---|---|---|
![]() |
![]() |
![]() |
See Desktop Apps for download links for pre-built executables and instructions for Windows, Linux, and macOS.
| Run 6502 machine code in your own .NET apps | Machine code monitor | C64 Basic AI code completion |
|---|---|---|
![]() |
![]() |
![]() |
Highbyte.DotNet6502- Core library for executing 6502 machine code, not bound to any specific emulated system/computer, and does not have any UI or I/O code.
Highbyte.DotNet6502.Monitor- Machine code monitor library used as a base for host apps using the
Highbyte.DotNet6502library.
- Machine code monitor library used as a base for host apps using the
Highbyte.DotNet6502.Systems- Library for common interfaces and implementations for running computers ("systems") that uses the
Highbyte.DotNet6502library.
- Library for common interfaces and implementations for running computers ("systems") that uses the
Contains core system/computer emulation logic, but with no UI or I/O dependencies.
Implements abstractions in Highbyte.DotNet6502.Systems.
-
Highbyte.DotNet6502.Systems.Commodore64- Logic for emulating a Commodore 64 (C64).
- Runs C64 ROMs (Kernal, Basic, Chargen).
- List of apps/games listed that's been tested to work here
-
Highbyte.DotNet6502.Systems.Generic- Logic for emulating a generic computer based on 6502 CPU.
Implements rendering, input handling, and audio using different technologies per emulated system/computer. Implements abstractions in Highbyte.DotNet6502.Systems. These libraries are used from relevant UI host apps (see below).
Highbyte.DotNet6502.Impl.AspNet- General system-specific input and audio code for AspNet Blazor
WASMapp.
- General system-specific input and audio code for AspNet Blazor
Highbyte.DotNet6502.Impl.Avalonia- General and system-specific render and input code for
Avalonia(browser and desktop) apps .
- General and system-specific render and input code for
Highbyte.DotNet6502.Impl.Browser- General JavaScript input code for
Avaloniabrowser app.
- General JavaScript input code for
Highbyte.DotNet6502.Impl.NAudio- General and system-specific audio code for
Avalonia(browser and desktop),SilkNetNativeandSadConsoleapps.
- General and system-specific audio code for
Highbyte.DotNet6502.Impl.SadConsole- General and system-specific rendering and input code for
SadConsoleapp.
- General and system-specific rendering and input code for
Highbyte.DotNet6502.Impl.SilkNet- General and system-specific rendering (OpenGL shaders) and input code for
SilkNetNativeapp.
- General and system-specific rendering (OpenGL shaders) and input code for
Highbyte.DotNet6502.Impl.SilkNet.SDL- General and system-specific input code for
Avaloniadesktop app.
- General and system-specific input code for
Highbyte.DotNet6502.Impl.Skia- General and system-specific rendering with SkiaSharp for
SilkNetNative, and BlazorWASMapps.
- General and system-specific rendering with SkiaSharp for
See here
Important
- Correct emulation of all aspects of computers such as Commodore 64 is not likely.
- Not the fastest emulator.
- A real Commodore 64 uses the 6510 CPU and not the 6502 CPU. But for the purpose of this emulator the 6502 CPU works fine as they are generally the same (same instruction set).
- Code coverage is currently limited to the core
Highbyte.DotNet6502library.
Missing features (but not limited to):
- 6502 CPU
- Support for unofficial opcodes.
- Systems
- Commodore 64: cycle-exact rendering, full disk drive support, tape drive support, accurate/stable audio, etc.
See here
See here.
- 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.








