CoreBoy is a cross platform GameBoy Emulator written in C# that even does ASCII
.NET and C# are great languages for programming emulators. Specifically retrogaming and retroarcade emulators. In fact, there's a long history of emulators written in C#. Here's just a few.
- Emulating a PlayStation 1 (PSX) entirely with C# and .NET
- Virtu, an Apple Emulator in C# for Silverlight, WPF and XNA
- A multi-player server-side GameBoy Emulator written in .NET Core and Angular
- Commodore 64 Emulator
Today, David Whitney is deep into writing CoreBoy, a GameBoy Emulator written in C# and .NET Core, using WinForms, and I also spy the Avalonia cross-platform open source WPF-like framework. Head over to https://github.com/davidwhitney/CoreBoy and give the gent a STAR. It even has a headless mode and you could use it as a Library in your own software. Who doesn't want a GameBoy library in their app?
I cloned and built it with http://dot.net Core in just a few minutes. Lovely. I enjoy a clean codebase. Assuming you have a backup of one of the many physical GameBoy games you own like me, you can load a binary dump in CoreBoy as a *.gb or *.gbc file and you'll get something this:
Sweet! Sure it's a little buggy and slow but figuring these things out is the fun of it all! I love that David Whitney is taking us on this journey with him.
There's even already a MonoGame-based graphics surface using DesktopGL and "nilllzz" has it running on Ubuntu!
Emulators are always fun projects to read and learn from. Here, David has a clear separation of concerns between the emulator (handling the CPU, loading instructions, etc.) and the graphics surface that is ultimately responsible for putting pixels on screen.
It looks like he hasn't got it working yet (some issues with command line parsing), but in a few minutes with a little hard-coding I was able to switch to ASCII mode with David's SillyAsciiArtCreator that takes a Pixel and RGB value and maps it to ASCII art that looks awesome in the Windows Terminal.
Which is kind of awesome. Why would you do this? BECAUSE YOU CAN
I look forward to seeing what comes of this cool new emulator and I'll be reading its code in more detail in the weeks to come! Great stuff, David!