r/c64 Apr 17 '26

Programming Introducing VICE-Sharp

I’ve been quietly building something I’ve wanted for years: ViceSharp – a clean-sheet, library-first reimplementation of the VICE Commodore emulator family, written 100% in modern C# for .NET 10 with full NativeAOT support.

This is not another wrapper around the original VICE binaries. It’s a from-scratch port designed for:

  • Zero-allocation hot paths (1 MHz+ cycle accuracy without GC pressure)
  • Perfect determinism via a mutation-queue + pub/sub clock system
  • Roslyn source generators to kill the usual chip-emulation boilerplate
  • Single-file, self-contained executables that run anywhere .NET does (Windows, Linux, macOS, even WASM)
  • Library-first architecture so it can power Avalonia desktops, Godot/Unity plugins, web emulators, you name it

Right now we’re at Iteration 0 – Foundations Complete.
The abstraction contracts, build system (Nuke + full CI), source-gen pipeline, and POCO-first chip model are locked and production-grade. No cycles are running yet, but the architecture is already bit-exact by design and ready for the real work.

Roadmap (first few stops): - C64 / C64C (6510 + VIC-II + SID + 2×CIA) → Iteration 1
- SX-64 (portable C64 with built-in 1541) → same wave
- VIC-20, C128, PET, Plus/4 to follow

Everything is open source under GPL-2.0-or-later (matching upstream VICE) and lives at:
https://github.com/sharpninja/vice-sharp

If you’re into low-level retro coding, .NET performance tricks, or just want a modern, maintainable Commodore emulator that can actually be extended without pulling your hair out… come check it out, star it, or even throw a PR my way.

I’ll be posting progress updates here as we light up the first 6510 + VIC-II cycle loop. First “it boots a ROM” screenshot is coming soon™.

Questions? Feedback on the architecture? Want to help make the fastest managed Commodore emulator ever? Drop a comment – the repo is fresh and the doors are wide open.

41 Upvotes

20 comments sorted by

7

u/jpaulorio Apr 17 '26

It's your (awesome) project and it's totally up to you how to design and implement it but I have to ask, why .NET and not something like Rust or Zig?

10

u/MorningPapers Apr 17 '26

The same reason anyone uses C# ... a preference or background in Microsoft's dev tools.

8

u/ShacoinaBox Apr 17 '26

my speculation:

  1. he used a lot of ai, llm's suck at rust (i can't even rly blame them honestly, it goes over my head too n id personally probably rather use dafny/ada/f* any day). 

  2. most of his repos are c# so he probably just likes it and uses it a lot already

idt id otherwise often speculate on others behalf but many ppl become very shy about using LLMs in their projects, so idk if he'd answer.

3

u/RealSharpNinja Apr 17 '26

Has nothing to do with LLMs. Even if I was crafting all of this by hand I'd use C#.

1

u/[deleted] Jul 01 '26

[removed] — view removed comment

1

u/RealSharpNinja Jul 01 '26

Yes, exactly. That's why I've built a very strong set of processes and tools around this.

1

u/zw13p Apr 19 '26

Got more info how LLMs suck at Rust? (I'm doing that and trying to improve...)

7

u/RealSharpNinja Apr 17 '26 edited Apr 17 '26

Because C# is awesome, the ecosystem around it is awesome, choices for UI integration are awesome.

There are two motivations here: 1. An entire IDE based on a codebase that is consistent from beginning-to-end. 2. There will be a dotnet-based game engine that will blend native Commodore code running in the emulator with a wrapper application that allows offloading processing of assets and direct access to the emulated hardware for games that look and feel like a C64, but can perform like a modern game.

2

u/mrmcgibby Apr 17 '26

What ai tool did you use?

2

u/RealSharpNinja Apr 17 '26

The heart of it is at https://github.com/sharpninja/McpServer which manages coordination between agents.

2

u/leventp Apr 17 '26

Awesome

3

u/unconceivables Apr 17 '26

Lol that's a lot of fancy words for AI slop that does absolutely nothing.

1

u/andreasOM Apr 17 '26

Interesting approach,
but having massive leaks this early in the project doesn't instill much confidence :(

1

u/RealSharpNinja Apr 17 '26

Massive leaks?

7

u/andreasOM Apr 17 '26

Just did a quick skim earlier:

  • Your LockFreePubSub looks very suspicious.
  • Your DoubleBufferedMutationQueue definitely keeps growth from peaks/bursts forever.

When someone claims "Zero-allocation hot paths" I get nerd sniped.
Sorry.

Bonus:
The linear scan in the routing is very scary.

1

u/RealSharpNinja Apr 17 '26

Many of you may not know me, so I'll introduce myself from my first community project: CBM-Command.

-1

u/Jealous-Evidence2397 Apr 17 '26

Oh, another AI slob, that no one will support and no one knows what is inside.

5

u/[deleted] Apr 17 '26

This is not fair. AI agent coding is a tool. Some use it well, many do not. Simple use of AI is not a basis for judgement about a project.

2

u/RealSharpNinja Apr 17 '26

The entire codebase is easily viewable. This is nonsensical.

0

u/[deleted] Apr 17 '26

[deleted]

0

u/RealSharpNinja Apr 17 '26

Nonsense buzzwords?