News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: Patching Shantae to force GBA or GBC modes.  (Read 26148 times)

Vague Rant

  • Jr. Member
  • **
  • Posts: 47
  • Deceptively cute
    • View Profile
    • Vague Rant
Patching Shantae to force GBA or GBC modes.
« on: August 02, 2013, 03:59:33 pm »
Shantae is one of those GBC games that detects if it's running on a GBA, brightens the palette some and gives the player a small bonus, similar to the Oracle games. That earlier thread mentions patches to force those two into GBA mode, but a quick search didn't find similar for Shantae, so I quickly worked one up.

My solution may be a little inelegant, but my hacking ability could charitably be described as amateurish, so be happy it works at all. Since the GBA sets register B to 01, I just stepped through code in BGB until it got its first mention:

Code: [Select]
ROM0:397B CB 20        sla b
On the GBC, this does nothing (B is 00, 2*B is also 00), but on the GBA, register B is now set to 02. Let's make these more uniform:

Code: [Select]
ROM0:397B 06 02        ld b,02
Now, that line just stores 02 to register B, so from there on in, you're in GBA mode, regardless of what hardware you're running.

But maybe you want the alternative: the richer, darker GBC mode on your fancy GBA. Keeping in mind that this will make the bonus impossible to obtain, it's just as simple:

Code: [Select]
ROM0:397B 06 00        ld b,00
For comparison, here's GBA mode "on a GBC" (left) and GBC mode "on a GBA" (right).


If none of this means anything to you, all you need to do is go to 397B in your Shantae ROM with a hex editor and replace "CB 20" with either "06 02" (force GBA mode) or "06 00" (force GBC mode).

Hopefully, this is of use to someone.
I've got nothing to say, but it's OK.
Vague Rant

Satoshi_Matrix

  • Full Member
  • ***
  • Posts: 239
  • Retro & Contemporary Gamer
    • View Profile
    • Retro & Contemporary Gaming Archives
Re: Patching Shantae to force GBA or GBC modes.
« Reply #1 on: August 05, 2013, 02:41:22 am »
I'm a huge Shantae fan. Have been since the game came out over a decade ago.

I'm curious - what is the point of this? Why would you ever want to force GBC or GBA mode? Is this for emulators that don't support auto-detection?

Vague Rant

  • Jr. Member
  • **
  • Posts: 47
  • Deceptively cute
    • View Profile
    • Vague Rant
Re: Patching Shantae to force GBA or GBC modes.
« Reply #2 on: August 05, 2013, 04:00:57 am »
Modern emulators tend to run games in GBC mode by default, with a toggle somewhere to use GBA mode instead. If you're using one of those, there's basically no need for these patches; the emulator options do exactly the same thing without any need for modifying the ROM. As you suspected, the use cases are a) emulators without a GBA mode option and b) real hardware.

If you're playing Shantae from a flash cart on a GBC, you can't access the bonus transformation which players on GBA have--sure, you could find a GBA, or play it on an emulator then switch back to hardware, but that's kind of a hassle and presumably goes against your desire to play on a GBC. This way, you can just play the normal ROM until you reach the place where the bonus is obtained, switch over to the GBA-mode ROM, then switch back to the standard ROM once you've saved.

If you're running the game from a flash cart on GBA, you'll get the bonus transformation, but the palette is quite washed out if you're playing on the GBA SP. To avoid that, you can run the patched GBC-mode ROM to get the richer color the game was designed with, then switch to the standard ROM to get the bonus. After that, you can switch back to the GBC-mode ROM.

Between the two ROMs, you can basically have "the full experience" on any platform. In general, nobody should need both patched versions, just the clean version and one patched for the opposite platform to the one they're playing on. The ideal solution would probably be a hack which enables the bonus GBA content without triggering the brightened GBA palette, but that's outside my skillset, so switching ROMs is the best solution I can manage.
I've got nothing to say, but it's OK.
Vague Rant

Satoshi_Matrix

  • Full Member
  • ***
  • Posts: 239
  • Retro & Contemporary Gamer
    • View Profile
    • Retro & Contemporary Gaming Archives
Re: Patching Shantae to force GBA or GBC modes.
« Reply #3 on: August 05, 2013, 04:43:55 pm »
I don't understand why people prefer the GBC pallet. Colors are all darker with more contrast, making them sort of difficult to look at. When you say "washed out" I would call brighter and more defined.

The most obvious difference is to play through the intro stage burning town in GBC mode and then directly compare it to the GBA mode.

The lack of the GBA mode is why even though I love this game I will not be supporting it a second time on the 3DS. My original cart works just fine and I can use it on the GameBoy Player.

Vague Rant

  • Jr. Member
  • **
  • Posts: 47
  • Deceptively cute
    • View Profile
    • Vague Rant
Re: Patching Shantae to force GBA or GBC modes.
« Reply #4 on: August 06, 2013, 12:04:30 am »
You're welcome to your preference, but I don't think that's the way the game was meant to look. The brighter palette in some GBC and GBA games was specifically implemented to counteract the dim screen on the original, unlit GBA. When being played in an emulator or any other platform with a front/backlit screen like a GBA SP (or even on TV via the Game Boy Player), the brighter palette is no longer working to solve any limitation of the screen.

In fact, IIRC, some GBA games switch to a darker palette when running on the Game Boy Player, again because the brighter palette isn't a stylistic choice but a necessity of catering to the original model's screen. Games like Link to the Past (or was it Minish Cap?) even put the palette selection in the hands of the player. Ultimately, that's probably for the best: if you prefer the "GBA-corrected" colors to the intended ones, you can use them; same goes for Shantae.
I've got nothing to say, but it's OK.
Vague Rant

BRPXQZME

  • Hero Member
  • *****
  • Posts: 4572
  • じー
    • View Profile
    • The BRPXQZME Network
Re: Patching Shantae to force GBA or GBC modes.
« Reply #5 on: August 06, 2013, 04:25:40 am »
FFTA has three color modes; they target GBA, SP, and Game Boy Player.
we are in a horrible and deadly danger

FAST6191

  • Hero Member
  • *****
  • Posts: 2559
    • View Profile
Re: Patching Shantae to force GBA or GBC modes.
« Reply #6 on: August 06, 2013, 08:34:28 am »
FFTA has three color modes; they target GBA, SP, and Game Boy Player.

Does it do the GBP automatically? I have had a few games where you could change in options somewhere (they make a nice example for dynamic palette hacking, summon night 2 if others want an example) and though you can not detect an SP as far as I know you can do the GBplayer (it is how the GB videos are locked out*). That would however be the first example I have seen of it being used for an actual/"positive" reason.

* http://www.caitsith2.com/gba_video_arv3.htm for the curious/those in need of a workaround.

Back to the thread as it were, nice work. On the bonus without the washed out front I imagine it is probably a set variable somewhere as hashing the BIOS every time would be a pointless waste of time and the Shantae people seemed to know what they were doing. To that end you might even be able to get away with a one instruction patch for the palette stuff, similar to the language patches work for the likes of Advance wars on the DS.

KingMike

  • Forum Moderator
  • Hero Member
  • *****
  • Posts: 6882
  • *sigh* A changed avatar. Big deal.
    • View Profile
Re: Patching Shantae to force GBA or GBC modes.
« Reply #7 on: August 06, 2013, 08:50:13 am »
No, the palette setting in FFTA is an option on the title screen.
"My watch says 30 chickens" Google, 2018

Bregalad

  • Hero Member
  • *****
  • Posts: 2632
    • View Profile
Re: Patching Shantae to force GBA or GBC modes.
« Reply #8 on: August 06, 2013, 08:54:26 am »
The problem is that "LCDA" "LCDB" and "TV" are not very explicit.

Now that this is mentionned I understood that "TV" is meant for the Game Boy Player, but as for which is LCDA and LCDB, good luck to understand.

Vague Rant

  • Jr. Member
  • **
  • Posts: 47
  • Deceptively cute
    • View Profile
    • Vague Rant
Re: Patching Shantae to force GBA or GBC modes.
« Reply #9 on: August 07, 2013, 06:22:36 am »
Does it do the GBP automatically? [...] That would however be the first example I have seen of it being used for an actual/"positive" reason.

Has anyone ever assembled an exhaustive list of games that show the GBP logo on startup? I know Super Mario Advance 4, Mario & Luigi, Pokemon Pinball: Ruby and Sapphire and Drill Dozer all do and use it for rumble; do they actually bother to detect the Player, or is the rumble code actually active on all platforms, but without any outlet? There's also Mother 3, which shows the GBP logo, but I never noticed any rumble feature at all; perhaps it'd be worth checking if it actually does anything different on the Player.
I've got nothing to say, but it's OK.
Vague Rant

KingMike

  • Forum Moderator
  • Hero Member
  • *****
  • Posts: 6882
  • *sigh* A changed avatar. Big deal.
    • View Profile
Re: Patching Shantae to force GBA or GBC modes.
« Reply #10 on: August 07, 2013, 10:13:54 am »
I'm surprised Yoshi's Touch & Go and WarioWare Twisted don't refuse to run on the GBP.
"My watch says 30 chickens" Google, 2018

Drenn

  • Jr. Member
  • **
  • Posts: 94
    • View Profile
Re: Patching Shantae to force GBA or GBC modes.
« Reply #11 on: November 27, 2013, 06:55:25 pm »
I made a quick hack to play Shantae in GBA enhanced mode with the GBC palettes. Took about 5 minutes. I also prefer the original, darker palettes, but why not have the other GBA enhancements?

GBA palette:


GBC palette:


It's also fairly simple to do: from where Vague Rant left off, note that the value of "B | A" is stored into [0xfffe]. Using bgb, set a read breakpoint on 0xfffe. Every time the palettes change, this breakpoint is triggered, and you see code relating to the palettes. The conditional jump next to the breakpoint must be changed to an unconditional jump. This way, it doesn't affect the other GBA enhancement features, but it always skips over the GBA's different palette code.

Ips file. It doesn't force gba mode, the emulator has to be set to do that. Or follow the instructions in the first post.

Edit: Made some game genie codes to force GBC palettes.
Shantae:
01C-B5E-191
3EC-B4E-2A9
Zelda Ages/Seasons:
010-3CB-B30
3E0-3BB-2A9
« Last Edit: May 03, 2017, 11:02:57 pm by Drenn »
Zeldahacking.net: The hub for Zelda: Oracle of Ages and Seasons hacking. We have a discord!

Vague Rant

  • Jr. Member
  • **
  • Posts: 47
  • Deceptively cute
    • View Profile
    • Vague Rant
Re: Patching Shantae to force GBA or GBC modes.
« Reply #12 on: February 04, 2017, 12:54:55 pm »
Does it do the GBP automatically? I have had a few games where you could change in options somewhere (they make a nice example for dynamic palette hacking, summon night 2 if others want an example) and though you can not detect an SP as far as I know you can do the GBplayer (it is how the GB videos are locked out*). That would however be the first example I have seen of it being used for an actual/"positive" reason.

With apologies for the three-odd-year bump, I was just informed today that Super Mario Advance 4: Super Mario Bros. 3 does in fact adjust the palette without user intervention when it runs on the Game Boy Player. I went and confirmed it in mGBA, which supports running in a "Game Boy Player" mode:


I did try to go in and hack this to always run with the Game Boy Player palette, but as I established three years ago, I'm really bad at this. ;)

Regardless, this makes me wonder which/if any other Game Boy Player-"enhanced" games perform the same function. I was never able to tell what change the Game Boy Player was doing to Mother 3, since it didn't seem to do rumble, so perhaps it's another palette correction case?

P.S. I should also add that your hack there was fantastic, Drenn, I never run Shantae without it. Great work.
I've got nothing to say, but it's OK.
Vague Rant

Asaki

  • RHDN Patreon Supporter!
  • Full Member
  • *****
  • Posts: 167
    • View Profile
Re: Patching Shantae to force GBA or GBC modes.
« Reply #13 on: February 05, 2017, 12:06:03 am »
With apologies for the three-odd-year bump, I was just informed today that Super Mario Advance 4: Super Mario Bros. 3 does in fact adjust the palette without user intervention when it runs on the Game Boy Player.

Glad I never wasted my time trying to hack that one B) It's honestly not that bad in GBA mode, though.

One of these days I'll get around to finishing SMB2 >_<

Vague Rant

  • Jr. Member
  • **
  • Posts: 47
  • Deceptively cute
    • View Profile
    • Vague Rant
Re: Patching Shantae to force GBA or GBC modes.
« Reply #14 on: February 05, 2017, 03:02:55 am »
Yeah, Mario Advance 4 isn't too bad, those late-period games mostly look pretty reasonable. I hope you do get a chance to get back to Mario Advance 1, that game was really hit hard.

Anyway, since discovering the GBP palette for Mario 3, I figured I'd try the other Game Boy Player logo games and see if there's anything else there.

First up, I tried Mother 3, since I've never understood why it has the Game Boy Player logo at all. But apparently it's not for palettes, because they're not changed. *shrug*

Next up, Mario & Luigi: Superstar Saga:


Success! I must say, the GBP palette for this game looks really nice.

EDIT: Testing out a few more games. Neither Drill Dozer nor Pokémon Pinball: Ruby & Sapphire have a GBP palette.

Shikakui Atama o Maruku Suru. Advance - Kanji, Keisan does have a GBP palette, and there's also a Kokugo, Sansuu, Shakai, Rika version, which probably teaches something else. I think these are just educational games of some kind, not terribly exciting.


EDIT2: Summon Night: Swordcraft Story 2 was already mentioned earlier in this thread, but I thought I'd check it anyway. It does display the Game Boy Player logo on startup, but the GBP palette is not set automatically. It has to be set in the in-game Options menu. The same thing is true for Summon Night: Craft Sword Monogatari: Hajimari no Ishi, the third entry in the series, released only in Japan. The logo appears on startup, but palette is just a menu setting under Options. These two might just be using it for rumble, like Pokémon Pinball and Drill Dozer.

Is anybody aware of any more Game Boy Advance titles which display the Game Boy Player logo on startup (besides the GBA Videos, I mean). I'd be interested to check if any more games have this feature.

To summarize, the games currently known to adjust the palette automatically:
  • Mario & Luigi: Superstar Saga
  • Shikakui Atama o Maruku Suru. Advance: Kanji, Keisan
  • Shikakui Atama o Maruku Suru. Advance: Kokugo, Sansuu, Shakai, Rika
  • Super Mario Advance 4: Super Mario Bros. 3
Games that are Game Boy Player-enhanced, but do not adjust the palette automatically:
  • Drill Dozer (supports GameCube pad rumble)
  • Mother 3 (does nothing?)
  • Pokémon Pinball: Ruby & Sapphire (supports GameCube pad rumble)
  • Summon Night: Swordcraft Story 2 (supports GameCube pad rumble?)*
  • Summon Night: Craft Sword Monogatari: Hajimari no Ishi (supports GameCube pad rumble)*
* Has palette settings under Options, Color: GBA, GBA SP [frontlit], TV [Game Boy Player, other backlit screens]

Games that are not Game Boy Player-enhanced, but have in-game palette settings:
  • Doom (Brightness: 1-6)
  • Doom II (Gamma: 1-6)
  • Final Fantasy Tactics Advance (Color Mode: LCD A [unlit GBA], LCD B [frontlit GBA SP], TV [Game Boy Player, other backlit screens]
  • The Legend of Spyro: A New Beginning (Display: GBA, GBA SP, Game Boy Player)
  • The Legend of Spyro: The Eternal Night (Gamma Level: Normal, Enhanced, Bright)
  • The Legend of Zelda: A Link to the Past & Four Swords (Adjust Brightness: Dark [SNES], Normal, Bright)
  • The Legend of Zelda: The Minish Cap (Adjust Brightness: Dark, Normal, Bright)
  • Sonic Advance 3 (press R at title screen: GBA Color Setting, GBA SP Color Setting, Game Boy Player Color Setting)
« Last Edit: February 05, 2017, 11:35:56 am by Vague Rant »
I've got nothing to say, but it's OK.
Vague Rant

Granville

  • Jr. Member
  • **
  • Posts: 92
    • View Profile
Re: Patching Shantae to force GBA or GBC modes.
« Reply #15 on: February 05, 2017, 01:45:44 pm »
Never knew about Sonic Advance 3 having a palette setting, thanks!

I'll mention a few more with palette options-
Gunstar Super Heroes
Aladdin
The Magical Quest 2: Great Circus Mystery
The Magical Quest 3
Kingdom Hearts: Chain of Memories
Mario vs Donkey Kong (haven't tested this extensively)

Probably missed some others, but those are what I recall offhand.

Asaki

  • RHDN Patreon Supporter!
  • Full Member
  • *****
  • Posts: 167
    • View Profile
Re: Patching Shantae to force GBA or GBC modes.
« Reply #16 on: February 06, 2017, 08:17:45 am »
In fact, IIRC, some GBA games switch to a darker palette when running on the Game Boy Player...

So do you know if there are any older GBA games that do this?

Obviously it wouldn't work in an emulator, unless there's one that uses an actual GBP BIOS, since it would be using checksums, like how GBC adds color to certain older DMG games.

Vague Rant

  • Jr. Member
  • **
  • Posts: 47
  • Deceptively cute
    • View Profile
    • Vague Rant
Re: Patching Shantae to force GBA or GBC modes.
« Reply #17 on: February 06, 2017, 11:55:41 am »
Huh, interesting question. I'm not aware of any that do that, or even whether that's something the Game Boy Player is capable of. With the handful of Game Boy Player-enhanced games I mentioned above, the "enhancements" are really coming from the game itself, not the GBP. It's more akin to the way Game Boy Color games can be "enhanced" on GBA (like Shantae, Wendy: Every Witch Way or the Zelda: Oracle games). The game checks whether it's running on the Game Boy Player, and branches to a few different behaviors if it is.

The only thing the Game Boy Player is doing differently is that it checks for the GBP logo to be displayed, and if it sees it, it triggers all four d-pad directions at once. The game checks the input values, and if it detects all four d-pad directions are pressed during the GBP logo, a value is set somewhere in memory that the game can check from there on before deciding which palettes to use, etc.

That's why what I wanted to do was to hack Mario Advance and Mario & Luigi to "run in Game Boy Player mode" at all times, so that I could play them on, e.g. a Nintendo DS with the Game Boy Player palette. But I'm terrible at this, so it didn't work out. ;)
I've got nothing to say, but it's OK.
Vague Rant

KingMike

  • Forum Moderator
  • Hero Member
  • *****
  • Posts: 6882
  • *sigh* A changed avatar. Big deal.
    • View Profile
Re: Patching Shantae to force GBA or GBC modes.
« Reply #18 on: February 07, 2017, 01:19:17 pm »
So do you know if there are any older GBA games that do this?

Obviously it wouldn't work in an emulator, unless there's one that uses an actual GBP BIOS, since it would be using checksums, like how GBC adds color to certain older DMG games.

Has anyone dumped the GBP GBA BIOS to see if it's different (though changes could be part of the Startup Disc code, if that's what you meant by "BIOS"?)
"My watch says 30 chickens" Google, 2018

FAST6191

  • Hero Member
  • *****
  • Posts: 2559
    • View Profile
Re: Patching Shantae to force GBA or GBC modes.
« Reply #19 on: February 07, 2017, 01:48:36 pm »
http://problemkaputt.de/gbatek.htm#gbagameboyplayer covers the detection method and some other curios.

Also might be of interest to some, alt boot methods for the GBP which get some nice stuff going on with regards to low latency and configuring it to do other things
http://www.gc-forever.com/forums/viewtopic.php?t=2782