The emulator will firstly break at the ROM entry point 0x0100 in debug mode, which is the entry point of the game program.
That start address is the same as in CP/M, and subsequently DOS 16-bit COM-format binaries. I wonder if Nintendo was inspired by that.
This simple security mechanism was extremely effective, and lead to the DMG BIOS being undumped until relatively recently, when it was dumped by imaging the ROM directly and via fault injection to skip the last instruction.
So they didn’t exploit flaws, they just tried to work around the protection.
Even though the Gameboy is relatively slow (~4.7 Mhz processor IIRC) it’s still not going to be easy to hit exactly at the right time to be able to perform your fault injection.
The protection is simple enough to be effective. If you did it with a modern manufacturing process it’d probably be quite difficult to be able to image the bits directly...
Nowadays, for say Nintendo Switch, you are more likely to see keys and firmware data dumped via early boot exploits or privilege escalation.
Fault injection is a method to cause microprocessors to execute instructions "incorrectly" by manipulating external factors (clock frequency, input power, etc). Getting the CPU to fail to write to a memory address, or flipping the truth of a comparison instruction, and other "glitches" can influence execution of security-sensitive code and ultimately undermine security mechanisms.
The original Gameboy ROM was dumped by physically de-capping the chip and reading out the bits: https://dot-matrix-game.blogspot.com/2014/01/boot-roms.html
tl;dr For the SGB, they quadrupled the clock speed briefly to glitch over the one instruction responsible for mapping out the ROM.
For the CGB, they halted the clock, drained the voltage to randomize the instruction counter, then used a NOP slide that led to their payload.
https://en.wikipedia.org/wiki/Cloud_gaming
... given the "client" in this case was just telnet and the game was "running" on another machine "in the cloud" [1]?
1. like literally on alibaba, amirite?!
% grep 1989 /etc/services
tr-rsrb-p3 1989/tcp # cisco RSRB Priority 3 port
tr-rsrb-p3 1989/udp # cisco RSRB Priority 3 port
#mshnet 1989/tcp # MHSnet system
#mshnet 1989/udp # MHSnet systemhttps://bennvenn.myshopify.com/products/reader-writer-gen2
The popular titles (especially Pokemon) can be hard to track down at a fair price, but lesser known gameboy games can be found easily on Amazon and from other used sellers for a few dollars each. Even stuff like Tetris is easy to get ahold of because so many copies were produced. Bad games still make great test cases. :D
If you're after homebrew there's a whole bunch of sites that host it. One site that I pulled my early test ROMs from was:
https://pdroms.de/news/gameboy
But there are of course countless others. The demo scene is quite lively, and once your emulator is working at a basic level, demos can be good test cases since they often use the hardware in surprising and unusual ways. Finally, once you're serious about accuracy, check out this list of test ROMs:
http://tasvideos.org/EmulatorResources/GBAccuracyTests.html
Especially the tests by blargg; these are designed with a simple pass/fail result but go seriously in depth checking out hardware edge cases, and the source code is available which makes debugging them a breeze. Finally passing his CPU test was a major milestone.
The rabbit hole is very deep, but it's a fun dive!
How come?
> You'll just need a Micro-USB or USB-C cable depending on the connector type you choose. Please note the USB-C connector only has the USB 2.0 lines attached so it may not work with devices expecting a USB-C capable device; you might need a USB-C to USB-A adapter and then a USB-A to USB-C cable.
Do you know if there are plans for a future revision of the hardware which will allow for the greater speed that USB-C can provide to be utilized?
Not sure. It dumps the cart over serial and there were some problems with higher speeds at one point.
> Do you know if there are plans for a future revision of the hardware which will allow for the greater speed that USB-C can provide to be utilized?
I don't think the carts themselves are that fast, there wouldn't be a huge amount of benefit. At least when I tried it it wasn't even coming close to using full USB 2 speed.
I can't imagine that telnet versions of gameboy games are really going to take off in any capacity. That said, if you do choose to self host, make sure you protect the access in some way, or only distribute freely licensed homebrew, etc etc.
Nintendo has even used existing open source emulators themselves in commercial products.
Source? I'd love to read more about that.
https://waxy.org/2004/07/jaleco_borrows/
Nintendo has written or contracted a lot of emulators themselves. The grandparent may be thinking of the pervasive use of the iNES header format, which originated with an unofficial (though not open source) emulator:
One of the best projects from recent years that was handed out as inspiration was someone that built a game boy emulator, with the ultimate aim of being able to run Pokemon Red.
This dissertation was public on the CS site for about 5 years, with source code to run it, and although this was pre-GitHub Nintendo were still very litigious back then. No ROM's were provided, so I assume Nintendo either missed it, or didn't care.
forking is just a gesture, especially for obviously hot repos. a takedown of 1 can takedown all the forks
Even as a "backup", it's pointless, because it's all Copy-on-Write, there's no backup.
As if they never learned to use the "Star" button to bookmark...
Personally, I don't fork any repos unless I'm working on a derived program, or working for a patch, even so, I'll delete my forked repos as soon as the patches are accepted (if it's a one-time contribution), so these forked repos won't spam my own list.
If you like puzzle games, Tetris, if you like adventure games, Link’s Awakening. If you like platforming, I’d recommend any of the Super Mario Land or Donkey Kong Land games!
In fact, I'd say one of the things that helped the Gameboy succeed was that it had so very many good games.