Skip to content

highbyte/dotnet-6502

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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.

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

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

UI host apps that runs emulators

UI host apps for emulating the systems/computers above, using different I/O techniques (rendering, input, audio).

A ASP.NET Blazor WebAssembly UI.

  • Rendering: Highbyte.DotNet6502.Impl.Skia
  • Input: Highbyte.DotNet6502.Impl.AspNet
  • Audio: Highbyte.DotNet6502.Impl.AspNet

Live version: https://highbyte.se/dotnet-6502/app

A Silk.NET native UI.

  • Rendering: Highbyte.DotNet6502.Impl.Skia or Highbyte.DotNet6502.Impl.SilkNet
  • Input: Highbyte.DotNet6502.Impl.SilkNet
  • Audio: Highbyte.DotNet6502.Impl.NAudio

A SadConsole (a ascii/console/game engine) native UI.

  • Rendering: Highbyte.DotNet6502.Impl.SadConsole
  • Input: Highbyte.DotNet6502.Impl.SadConsole
  • Audio: Highbyte.DotNet6502.Impl.NAudio

A console application with a only UI being a machine code monitor.

  • Rendering: standard .NET console
  • Input: standard .NET console
  • Audio: none

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, disk/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.