Circuit-level Game Boy emulation

Discussion of programming and development for the original Game Boy and Game Boy Color.
Post Reply
User avatar
tokumaru
Posts: 11440
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Circuit-level Game Boy emulation

Post by tokumaru » Tue Apr 23, 2019 10:56 pm

Have you guys heard about MetroBoy? I haven't tested it yet, but the concept is really cool. I really hope this sort of approach to emulation becomes practical for all kinds of classic systems.

calima
Posts: 1000
Joined: Tue Oct 06, 2015 10:16 am

Re: Circuit-level Game Boy emulation

Post by calima » Wed Apr 24, 2019 12:34 am

That's probably usable on a FPGA. Writing such code for computers is not very fast, and doesn't make much sense other than for verification.

User avatar
tokumaru
Posts: 11440
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Re: Circuit-level Game Boy emulation

Post by tokumaru » Wed Apr 24, 2019 7:32 am

I think that emulating retro consoles at the circuit level is a pretty big deal... Making a functional emulator that runs most commercial releases well may not be that hard, but emulator authors that are aiming for accuracy (something really important for developers trying to discover new tricks or just making sure they aren't doing anything wrong by accident) often struggle with edge cases and whatnot, so a perfectly accurate replica of the console would solve all these problems.

Pokun
Posts: 1235
Joined: Tue May 28, 2013 5:49 am
Location: Hokkaido, Japan

Re: Circuit-level Game Boy emulation

Post by Pokun » Wed Apr 24, 2019 10:18 am

I agree, white-box reproduction is needed to preserve the definition of old systems that are no longer manufactured. This is a great project.

This is also relevant though I guess.

lidnariq
Posts: 8696
Joined: Sun Apr 13, 2008 11:12 am
Location: Seattle

Re: Circuit-level Game Boy emulation

Post by lidnariq » Wed Apr 24, 2019 11:20 am

I see this as a mediocre alternative to Verilog, but it's a terrible way to actually run things on your computer. The way the code is structured is practically designed to pessimize performance (in his own words), so your CPU has to struggle extensively to get roughly-real-time performance. Now you're got a codebase that is slow (like higan) and hard to read (like zsnes)... it's basically the worst of both worlds. (Writing extremely non-idiomatic C++ means that other people can't really use it as reference). There's still no more guarantee that your emulation is guaranteed correct: if a transistor is connected wrong, that's really the same class as missing some test in understandable code.

The author acknowledges this:
Austin Appleby wrote:Testing Verilog designs is a huge pain, and the compile-run-debug cycle can be hours long. By writing and debugging a circuit in C and then translating it to Verilog, you can leverage your C skills and tools and still have something you know will synthesize in the end.

Also, running the C code directly is potentially thousands of times faster than running Verilog in a simulator.
I think the worst part about game boy emulation is that there are at least five different major silicon revisions, which are all measurably subtly incompatible with each other. (see gekkio's summary on his emulator)

It does imply that zeroone's question about the practicality of just using the Visual2xxx transistor definitions could be revisited...

Post Reply