Romhacking.net

Romhacking => ROM Hacking Discussion => Topic started by: Vague Rant on August 02, 2013, 03:59:33 pm

Title: Patching Shantae to force GBA or GBC modes.
Post by: Vague Rant 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 (http://www.romhacking.net/forum/index.php/topic,16652.0.html). 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).

(http://i.imgur.com/mQawKD4.png) (http://i.imgur.com/AdefJCX.png)

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.
Title: Re: Patching Shantae to force GBA or GBC modes.
Post by: Satoshi_Matrix 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?
Title: Re: Patching Shantae to force GBA or GBC modes.
Post by: Vague Rant 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.
Title: Re: Patching Shantae to force GBA or GBC modes.
Post by: Satoshi_Matrix 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.
Title: Re: Patching Shantae to force GBA or GBC modes.
Post by: Vague Rant 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.
Title: Re: Patching Shantae to force GBA or GBC modes.
Post by: BRPXQZME on August 06, 2013, 04:25:40 am
FFTA has three color modes; they target GBA, SP, and Game Boy Player.
Title: Re: Patching Shantae to force GBA or GBC modes.
Post by: FAST6191 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.
Title: Re: Patching Shantae to force GBA or GBC modes.
Post by: KingMike on August 06, 2013, 08:50:13 am
No, the palette setting in FFTA is an option on the title screen.
Title: Re: Patching Shantae to force GBA or GBC modes.
Post by: Bregalad 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.
Title: Re: Patching Shantae to force GBA or GBC modes.
Post by: Vague Rant 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.
Title: Re: Patching Shantae to force GBA or GBC modes.
Post by: KingMike 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.
Title: Re: Patching Shantae to force GBA or GBC modes.
Post by: Drenn 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:
(http://i1021.photobucket.com/albums/af339/MrStewart950/Gameboy%20Stuff/bgb00002_zps5682cbea.png) (http://s1021.photobucket.com/user/MrStewart950/media/Gameboy%20Stuff/bgb00002_zps5682cbea.png.html)

GBC palette:
(http://i1021.photobucket.com/albums/af339/MrStewart950/Gameboy%20Stuff/bgb00001_zpsd857cc59.png) (http://s1021.photobucket.com/user/MrStewart950/media/Gameboy%20Stuff/bgb00001_zpsd857cc59.png.html)

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 (https://www.dropbox.com/s/k3oqn0ll2trb6wi/Shantae_gba.ips?dl=1). 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
Title: Re: Patching Shantae to force GBA or GBC modes.
Post by: Vague Rant 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:

(https://i.imgur.com/ycZ6ENG.gif)

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.
Title: Re: Patching Shantae to force GBA or GBC modes.
Post by: Asaki 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 >_<
Title: Re: Patching Shantae to force GBA or GBC modes.
Post by: Vague Rant 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:

(https://i.imgur.com/JTuDo43.gif)

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.

(https://i.imgur.com/Pr5GJSf.gif)

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:
Games that are Game Boy Player-enhanced, but do not adjust the palette automatically:
* 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:
Title: Re: Patching Shantae to force GBA or GBC modes.
Post by: Granville 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.
Title: Re: Patching Shantae to force GBA or GBC modes.
Post by: Asaki 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.
Title: Re: Patching Shantae to force GBA or GBC modes.
Post by: Vague Rant 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. ;)
Title: Re: Patching Shantae to force GBA or GBC modes.
Post by: KingMike 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"?)
Title: Re: Patching Shantae to force GBA or GBC modes.
Post by: FAST6191 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
Title: Re: Patching Shantae to force GBA or GBC modes.
Post by: Asaki on February 08, 2017, 10:01:36 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.

Right, that's why I was wondering. GBC does it with quite a few games (I used to have all the palettes at the PocketHaven forums, but they might be lost now?), and the Super Game Boy does it too, so I wouldn't be surprised if GBP did something like that too.

I didn't play around with too many different games when I had a GBPlayer. I might have to pick up another one.

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"?)

I would assume it would be in the BIOS itself, but you never know.
Title: Re: Patching Shantae to force GBA or GBC modes.
Post by: Vague Rant on February 08, 2017, 10:39:55 am
GBC does it with quite a few games (I used to have all the palettes at the PocketHaven forums, but they might be lost now?)

Fortunately, these at least are documented on TCRF's GBC bootROM article (https://tcrf.net/Game_Boy_Color_Bootstrap_ROM#Assigned_Palette_Configurations).

EDIT: Incidentally, I just managed to nop over the branch past the Game Boy Player palette switch in Super Mario Advance 4, so I've submitted a patch to RHDN for it. Fingers crossed. Obviously, the difference is minor, but I figure the palette is there, we might as well take advantage of it. EDIT2: Approved, link to patch (http://www.romhacking.net/hacks/3315/).

EDIT3: I finally got around to doing the same for Mario & Luigi. There's a cmp against 0x0F0 at 0x0801A4FA, followed by a bne at 0x0801A4FC. nop the branch to have the game run in GBP mode.

Lay users: with a hex editor, go to 0x0001A4FC in the (USA) Mario & Luigi ROM, where you'll find 0x18D1. Replace these two bytes with 0xC046. Should be easy enough to do for other regions, too, if it's not at the same address just search for a few nearby bytes.

I'm not going to bother submitting this one to RHDN because it's not a true palette that this enables; rather, the GBA version has the "true" palette and GBP-mode just dims it across the board—that is, anything that was white is now gray, etc. Any decent emulator can probably do a better job improving the picture than this lazy "fix".
Title: Re: Patching Shantae to force GBA or GBC modes.
Post by: Banjo on March 30, 2017, 07:16:58 am
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:
(http://i1021.photobucket.com/albums/af339/MrStewart950/Gameboy%20Stuff/bgb00002_zps5682cbea.png) (http://s1021.photobucket.com/user/MrStewart950/media/Gameboy%20Stuff/bgb00002_zps5682cbea.png.html)

GBC palette:
(http://i1021.photobucket.com/albums/af339/MrStewart950/Gameboy%20Stuff/bgb00001_zpsd857cc59.png) (http://s1021.photobucket.com/user/MrStewart950/media/Gameboy%20Stuff/bgb00001_zpsd857cc59.png.html)
I just found this and was excited to try it for my first-ever Shantae playthrough... but the link is broken. :(

Can someone please provide a working link or the patch file?

It doesn't seem to be in the Romhacks database either, which is a shame.

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 (https://dl.dropboxusercontent.com/u/100702766/gameboy/Shantae_gba.ips). 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
Title: Re: Patching Shantae to force GBA or GBC modes.
Post by: rainponcho on March 30, 2017, 09:57:29 am
Quote
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.

Temp backup
https://www.sendspace.com/file/a52g1d

Title: Re: Patching Shantae to force GBA or GBC modes.
Post by: Banjo on March 30, 2017, 11:51:36 am
Thanks so much!

This should be added to the proper database IMO, but at least it's not lost forever.
Title: Re: Patching Shantae to force GBA or GBC modes.
Post by: rainponcho on March 30, 2017, 03:31:07 pm
I thought about doing it, but wasn't sure whether to combine Vague Rant's "force GBA mode" patch with Drenn's "force GBC color" patch = combo. And release it under both their names.

And well I haven't tested the game myself either to make sure it works (1st time too).
Title: Re: Patching Shantae to force GBA or GBC modes.
Post by: Banjo on March 31, 2017, 12:55:41 am
I was under the impression that Drenn's patch was a more "refined" version of Vague Rant's hack (since Vague Rant states that they use Drenn's version personally in their later post)?

Drenn's IPS (I've been using it since tonight for my first-ever playthrough of Shantae!) forced the GBC colour palette even when played on a GBA emulation (and presumably on a real GBA too). That is, you can play the "enhanced" GBA version of the game on the newer hardware (or emulation setting) but get the original colours.

I haven't tried Vague Rant's hex edit yet, but it seems like if it could be made as an ips that did the "reverse" of Drenn's (i.e. forced the GBA palette on a GBC) it would be useful to have in the database too for those who preferred the brighter colours.

Note: when it first seemed like the ips was lost, I used Drenn's Game Genie codes (with VirtualBoy Advance-M) and they worked fine there too (set emulation to GBA, got "enhanced move" but with GBC colours).
Title: Re: Patching Shantae to force GBA or GBC modes.
Post by: rainponcho on March 31, 2017, 08:27:13 am
That's the way I understood it too - Drenn built and improved Vague Rant's work. Which could count as a "co-release"  (I did this with nesrocks' Dr. Mario NES - no punishment patch).

Good idea - some GBC users may want the GBA colors. And I suppose some real GBC handheld gamers will want the GBC colors with the GBA unlockables.

Will give them time to show up first and comment, before jumping too fast.
Title: Re: Patching Shantae to force GBA or GBC modes.
Post by: Chael on April 21, 2017, 10:03:05 am
And I suppose some real GBC handheld gamers will want the GBC colors with the GBA unlockables.

Will give them time to show up first and comment, before jumping too fast.

Yep that would be great...
Title: Re: Patching Shantae to force GBA or GBC modes.
Post by: Drenn on May 03, 2017, 11:07:58 pm
I didn't really think of submitting the hack since it seemed so trivial. And given the 3-year gap in replies, I didn't think anyone really cared. =P

I've updated my link, at least until the next time Dropbox deprecates its URLs.
Title: Re: Patching Shantae to force GBA or GBC modes.
Post by: Crisz Reyes on July 05, 2017, 09:04:52 am
Force GBA mode all the time, change the following after applying the patch that Drenn has posted.


ROM0:397E E6 03  change   ROM0:397E 3E 03


(https://s16.postimg.org/4n8ldd4sl/Shantae_GBC.jpg)

Title: Re: Patching Shantae to force GBA or GBC modes.
Post by: FCandChill on July 05, 2017, 02:51:03 pm
Why is the screen brightness increased when running in GBA mode? Is it due to the GBA not having a good screen or something..?
Title: Re: Patching Shantae to force GBA or GBC modes.
Post by: FAST6191 on July 05, 2017, 04:58:18 pm
The original GBA did not have a lit screen and this meant most things appeared quite dark on it. This meant a lot of devs cranked the brightness of their palettes up a few notches as a crude fix for this (and this included a lot of older SNES games which got ported, hence all the colour restoration hacks http://www.romhacking.net/?page=hacks&genre=&platform=10&game=&category=&perpage=20&Graphics=on&title=rest&author=&hacksearch=Go ). Later versions of the GBA, and the GB player, had various lit screens so some later GBA games had options for all of them.

GBC games had a simple trick to see if they were running on a GBA, though most only ever meet this and the Zelda Oracles bonuses. Here it seems the devs tied the GBA bonuses to the screen brightness tweak and thus we have this discussion for something which would otherwise have been answered in the first post.
Title: Re: Patching Shantae to force GBA or GBC modes.
Post by: SCD on July 06, 2017, 03:34:38 am
Is there a way to keep the original color palettes of all three games intact while they're all in GBA mode?
Title: Re: Patching Shantae to force GBA or GBC modes.
Post by: FAST6191 on July 06, 2017, 05:06:25 am
I don't think the Zelda oracles games have an altered palette, just the bonuses. In any case I doubt it would be terribly hard to alter any game to get bonuses but not palette changes (it is all going to be multiple if else loops you can force to take one path but not another, whether you force a game thinking it is in GBC mode to give you bonuses or a game in GBA mode to give you GBC colours probably depends on the game/hacker).

As for this then apparently there is to have the GBA bonuses and the GBC palettes, discussion was a bit further up in the thread http://www.romhacking.net/forum/index.php?topic=16827.msg252793#msg252793
Title: Re: Patching Shantae to force GBA or GBC modes.
Post by: Asaki on July 06, 2017, 08:44:45 am
The original GBA did not have a lit screen and this meant most things appeared quite dark on it.

This is true, but also, GB/C games are just generally much darker on a GBA than on a GBC. There's a technical explanation of it in one of the GBA tech manuals somewhere. If you play on a backlit SP, you'll see that GBC games are still really dark...except Shantae and the Oracle games, which will look a little nasty.
Title: Re: Patching Shantae to force GBA or GBC modes.
Post by: FAST6191 on July 06, 2017, 10:24:39 am
I recall the section.
http://problemkaputt.de/pandocs.htm#lcdcolorpalettescgbonly has it towards the end of that.

Do the oracles games have colour adjustments then? I did a token search before I posted that but saw no mention of a brightness tweak for them.
Title: Re: Patching Shantae to force GBA or GBC modes.
Post by: Drenn on July 06, 2017, 05:21:45 pm
I recall the section.
http://problemkaputt.de/pandocs.htm#lcdcolorpalettescgbonly has it towards the end of that.

Do the oracles games have colour adjustments then? I did a token search before I posted that but saw no mention of a brightness tweak for them.
They do indeed have colour adjustments. The post you linked earlier has a code to disable it.
Title: Re: Patching Shantae to force GBA or GBC modes.
Post by: suchrandomsohajile on July 15, 2018, 07:12:05 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:
(http://i1021.photobucket.com/albums/af339/MrStewart950/Gameboy%20Stuff/bgb00002_zps5682cbea.png) (http://s1021.photobucket.com/user/MrStewart950/media/Gameboy%20Stuff/bgb00002_zps5682cbea.png.html)

GBC palette:
(http://i1021.photobucket.com/albums/af339/MrStewart950/Gameboy%20Stuff/bgb00001_zpsd857cc59.png) (http://s1021.photobucket.com/user/MrStewart950/media/Gameboy%20Stuff/bgb00001_zpsd857cc59.png.html)

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 (https://www.dropbox.com/s/k3oqn0ll2trb6wi/Shantae_gba.ips?dl=1). 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

I'm curious about the difference between the IPS patch file in this post and the patch at https://www.romhacking.net/hacks/3567/.

The IPS patch changes only two values, one opcode and the check code. The check code in BGB says `;global check (okay)`. When just the second value is changed, the check code does not show OK, so I'm assuming that some things will care about this and the check code is some sort of hash on the ROM.

The IPS patch includes `001CB8 0001 18`, which translates to "insert `18` which is length `1` at position `001CB8`. This converts from `jr nz 1CC2` to `jr 1CC2`. I'm able to read these opcodes inside BGB as well as looking them up here http://pastraiser.com/cpu/gameboy/gameboy_opcodes.html.

As the quoted post describes, the replaced code does not check before skipping the next few operations while the original checks if a certain memory position FFFE is equal to `03`.

The patch on the upload page instead replaces the memory loading operation and just sets the A value to `03` so that the equality check is zero (the check sets the F flag).

The uploaded patch then does 12 other things which I'm not sure exactly what they are. In most of them, it's replacing something with the opcode `3E` which is `ld A, d8` or set A to the next value.

I've never done anything with opcodes / gameboy programming, 8080 / Z80, etc. It was fun to poke around and read how some of this works. I'm kind of curious why that second uploaded patch does so many more things.

I also have not played the games beyond the title screen where you can see the different colors as well as the "GBA Enhanced" indicator.