Skip to content

highbyte/dotnet-6502

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dotnet-6502

SonarCloud: Highbyte.DotNet6502 library SonarCloud Quality Gate SonarCloud Security Rating SonarCloud Vulnerabilities SonarCloud Reliability Rating SonarCloud Bugs SonarCloud Coverage
Overall/CodeQL: .NET CodeQL

A 6502 CPU emulator for .NET

Overview / purpose

  • A collection of .NET cross platform libraries and applications for executing 6502 CPU machine code in different contexts. Links below for details on each library/app.

  • A programming exercise, that may or may not turn into something more

  • A main library Highbyte.DotNet6502 for executing 6502 machine code, not bound to any specific computer, and does not have any UI code.

  • A machine code monitor library Highbyte.DotNet6502.Monitor used as a base for specific UI implementations.

  • A library Highbyte.DotNet6502.Systems containing implementations of specific computers ("Systems") that runs on a 6502 CPU.

  • Several libraries Highbyte.DotNet6502.Impl.* that implements rendering, input handling, and audio using different technologies (such as Skia, Blazor, SadConsole) per emulated System.

  • Several UI applications Highbyte.DotNet6502.Apps.* that are the hosts for emulating the Systems above and their different rendering techniques.

What's currently missing

Missing features (but not limited to):

  • 6502 CPU
    • Support for unofficial opcodes
  • Systems
    • C64: cycle-exact rendering, bitmap graphics mode renderer in Blazor WASM, etc.

What this isn't (and probably never will be)

  • An emulation of all aspects of computers such as Apple II or Commodore 64.
  • The fastest emulator.

How to develop

For requirements and local development setup, see here

Inspiration, references & resources

6502 CPU Emulator in C++ video

6502 CPU references

C64 specific references

WebAudio

Test programs

Assemblers

Was used during development to compile actual 6502 source code to a binary, and then run it through the emulator.

Monitors / Emulators

Was used during development to test how certain instructions worked when in doubt.

VICE

Monitor commands: https://vice-emu.sourceforge.io/vice_12.html

How to load and step through a program in the VICE monitor

l "C:\Source\Repos\dotnet-6502\samples\Assembler\Generic\Build\testprogram.prg" 0 1000
d 1000
r PC=1000
z
r

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.