Are there any games that use the MGB bootrom handoff value?

Discussion of programming and development for the original Game Boy and Game Boy Color.
Post Reply
maij
Posts: 4
Joined: Thu Jan 26, 2023 4:46 pm

Are there any games that use the MGB bootrom handoff value?

Post by maij »

The only difference between the DMG bootrom and the MGB bootrom (AFAIK) is that the latter writes 0xFF to the bank register (0xFF50) while the former writes 0x01.

Are there any games that do anything differently based on these values?
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Are there any games that use the MGB bootrom handoff value?

Post by tepples »

Tetris DX loads different borders for Super Game Boy (which return $01 like DMG) and the Japan-only Super Game Boy 2 (which returns $FF like MGB).

144p Test Suite displays one of four strings in the lower right corner of the main menu depending on which pre-GBC model is in use: "GB", "pocket", "SGB", or "SGB2". (It's mostly a tool; the "Timing and reflex test" makes it a game.)
maij
Posts: 4
Joined: Thu Jan 26, 2023 4:46 pm

Re: Are there any games that use the MGB bootrom handoff value?

Post by maij »

Thanks for the response!

So there are no licensed games that would have a material difference when played on a Pocket (i.e. no easter eggs or anything)?
But some unlicensed games may have added variations based on the system.

Is there an easy way to find out if anyone is doing this, other than messaging developers directly?
User avatar
Dwedit
Posts: 4924
Joined: Fri Nov 19, 2004 7:35 pm
Contact:

Re: Are there any games that use the MGB bootrom handoff value?

Post by Dwedit »

On the other hand, games do detect a GBA, because that system will put different values into the CPU registers at boot time. It's used to unlock features in games, or make the screen sickeningly bright to compensate for the GBA's screen being so bad.
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!
maij
Posts: 4
Joined: Thu Jan 26, 2023 4:46 pm

Re: Are there any games that use the MGB bootrom handoff value?

Post by maij »

Yeah, I am aware of the two Zelda Oracle games, Shantae and Wendy: Every Witch Way having bonus content when run on a GBA. I was hoping the same would be true for games run on the Pocket, but I can't see any that do! I guess it wasn't a big enough change to warrant it.
calima
Posts: 1745
Joined: Tue Oct 06, 2015 10:16 am

Re: Are there any games that use the MGB bootrom handoff value?

Post by calima »

If it's not widely known, it could be some small easter eggs that never got popularized. You'd have to disassemble the entire catalog to check.
maij
Posts: 4
Joined: Thu Jan 26, 2023 4:46 pm

Re: Are there any games that use the MGB bootrom handoff value?

Post by maij »

I have started crawling through the .gb library that I have on hand with mgbdis...
Most games clobber the value of a quite quickly, so that makes it easy enough to move onto the next one, but it's also common to see roms that start by going 3-4 functions deep, which is not fun to wade through each time.

I have collected a short-list of games that might use the value of a to do something different.
Many of them aren't even games, i.e. the data logger, oscilloscope and the bible lol.
They are:
1 ; "Chou Mashin Eiyuu Den Wataru - Mazekko Monster 2 (Japan) (SGB Enhanced).gb"
2 ; "Game Boy Datenlogger 1 (Germany) (v1.0) (GBD1) (Unl).gb"
3 ; "Game Boy Digital Sampling Oscilloscope (Europe) (v3.6) (GBDSO) (Unl).gb"
4 ; "Gekitou Power Modeller (Japan) (SGB Enhanced).gb"
5 ; "Goukaku Boy GOLD - Shikakui Atama o Maruku Suru - Joushiki no Sho (Japan).gb"
6 ; "Itsudemo! Nyan to Wonderful (Japan) (SGB Enhanced).gb"
7 ; "King James Bible (USA) (Unl).gb" -- maybe?
8 ; "Lolo no Daibouken (Japan).gb"
9 ; "Meitantei Conan - Giwaku no Gouka Ressha (Japan) (SGB Enhanced).gb"
10 ; "Nihon Daihyou Team France de Ganbare! - J.League Supporter Soccer (Japan) (SGB Enhanced).gb"
12 ; "Nintama Rantarou GB - Eawase Challenge Puzzle (Japan) (SGB Enhanced).gb"
13 ; "NIV Bible & the 20 Lost Levels of Joshua (USA) (Unl).gb"


Some of these Japanese games in particular write the a value to a place in memory, then they may or may not read it back at some point. For some of the games I think I didn't see where they actually used the value.

The #1 game Chou Mashin Eiyuu Den Wataru - Mazekko Monster 2 (Japan) (SGB Enhanced).gb actually does have a comparison of a with 0xFF and 0x01, however I haven't looked in detail to what it actually does. I don't know Japanese either, so I can't really progress in the game to observe differences.
I am currently up to games starting with N, but it may be worth primarily focussing on SGB enhanced games. Then it will be onto *.gbc games...
nitro2k01
Posts: 252
Joined: Sat Aug 28, 2010 9:01 am

Re: Are there any games that use the MGB bootrom handoff value?

Post by nitro2k01 »

Nice work. I analyzed a couple of them manually and so far only false positives.

"Lolo no Daibouken (Japan).gb"
Has a bug: Writes to LCDC when it meant to read from it to check if LCDC is disabled or enabled. No intentional differences, and likely no material differences between modes.

"Goukaku Boy GOLD - Shikakui Atama o Maruku Suru - Kanji no Tatsujin (Japan) (Special Edition).gb"
Writes A to FF9F on startup. This value is soon overwritten in a HRAM clear loop. No other accesses to the address nwere found using BGB's access breakpoints. A quick search for FF9F in BGB's disassembly also showed nothing. No different behavior when using sel+start+B+A for soft reset.

"King James Bible (USA) (Unl).gb"/"NIV Bible & the 20 Lost Levels of Joshua (USA) (Unl).gb"
Those are using a special single 74hc chip (!) memory mapper which is using the address to specify the bank selection (!) and the whole 32k ROM space is switched (!) instead of only 4000-7FFF. Since the cartridge can't guarantee the initial state of the memory mapper, a simple initialization code is mirrored across all banks. This code is using ld [BC],A to write to the MBC, but only the value of C matters, and A is discarded. A is then quickly clobbered.
Post Reply