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 / purpose

.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.

Web apps

Avalonia WebAssembly app Blazor WebAssembly app

Desktop apps

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.

Other features

Run 6502 machine code in your own .NET apps Machine code monitor C64 Basic AI code completion
Code integration SilkNet native app, C64 monitor C64 Basic AI code completion

Common libraries

  • 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.DotNet6502 library.
  • Highbyte.DotNet6502.Systems
    • Library for common interfaces and implementations for running computers ("systems") that uses the Highbyte.DotNet6502 library.

System/computer-specific libraries

Contains core system/computer emulation logic, but with no UI or I/O dependencies. Implements abstractions in Highbyte.DotNet6502.Systems.

System-specific libraries for I/O

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).

Other apps

C64 Basic AI code completion

See here

Limitations

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.DotNet6502 library.

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.

How to develop

See here

References

See here.

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.

Packages

 
 
 

Contributors 3

  •  
  •  
  •