Scott Hanselman

CoreBoy is a cross platform GameBoy Emulator written in C# that even does ASCII

April 23, '20 Comments [11] Posted in DotNetCore | Gaming | Open Source
Sponsored By

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

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:

CoreBoy - Zelda Link's Awakening

image

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!

GameBoy Emulator in C# running on Ubuntu using MonoGame

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.

Zelda in a GameBoy Emulator as ASCII Art

Which is kind of awesome. Why would you do this? BECAUSE YOU CAN

Zelda in a GameBoy Emulator as ASCII Art

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!


Sponsor: Couchbase gives developers the power of SQL with the flexibility of JSON. Start using it today for free with technologies including Kubernetes, Java, .NET, JavaScript, Go, and Python.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb
Monday, April 27, 2020 6:01:14 AM UTC
How good is its sound quality? Is it on par with No$GBA? Or does it get as good as VirtualBoyAdvance?
Monday, April 27, 2020 10:37:26 AM UTC
Good to know about this platform. I hope that it will help developers like us.
Monday, April 27, 2020 12:03:43 PM UTC
Good project! Will definitely take a look at it. Wondering if it is possible to compile this into WebAssembly and run it in the browser?
Monday, April 27, 2020 1:46:17 PM UTC
Amazing project! It would be really amazing to follow this more closely. I will definitely keep an eye out for it. Thank you for sharing Scott!
Monday, April 27, 2020 6:23:25 PM UTC
Thanks for sharing this. I love emulators and moreso emulators written in .NET :D
Wednesday, April 29, 2020 8:32:15 AM UTC
Amazing emulator Thanks so Much. I share That
Wednesday, April 29, 2020 1:37:26 PM UTC
Credit where credit is due, emulator code is nearly certainly from a C language based emulator from the 1990s.

Greg
Thursday, April 30, 2020 3:27:01 PM UTC
Very cool project. I briefly looked into code. I expected much more code to accomplish this!
Monday, May 04, 2020 10:30:58 AM UTC
Thank you for your sharing.
Monday, May 04, 2020 4:37:58 PM UTC
I'd also include a@https://github.com/ArjunNair/Zero-Emulator@Zero - a really good spectrum emulator written in C#! Spectrums rock!
Andrew Potts
Monday, May 04, 2020 4:39:52 PM UTC
I'd also include Zero - a really good spectrum emulator written in C#! Spectrums rock!
Andrew Potts
Comments are closed.

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.