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

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

Asaki

  • RHDN Patreon Supporter!
  • Full Member
  • *****
  • Posts: 169
    • View Profile
Re: Patching Shantae to force GBA or GBC modes.
« Reply #20 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.

Vague Rant

  • Jr. Member
  • **
  • Posts: 47
  • Deceptively cute
    • View Profile
    • Vague Rant
Re: Patching Shantae to force GBA or GBC modes.
« Reply #21 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.

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.

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".
« Last Edit: February 14, 2017, 07:06:43 am by Vague Rant »
I've got nothing to say, but it's OK.
Vague Rant

Banjo

  • Jr. Member
  • **
  • Posts: 6
    • View Profile
Re: Patching Shantae to force GBA or GBC modes.
« Reply #22 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:


GBC palette:

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. 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

rainponcho

  • Sr. Member
  • ****
  • Posts: 275
    • View Profile
Re: Patching Shantae to force GBA or GBC modes.
« Reply #23 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


Banjo

  • Jr. Member
  • **
  • Posts: 6
    • View Profile
Re: Patching Shantae to force GBA or GBC modes.
« Reply #24 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.

rainponcho

  • Sr. Member
  • ****
  • Posts: 275
    • View Profile
Re: Patching Shantae to force GBA or GBC modes.
« Reply #25 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).

Banjo

  • Jr. Member
  • **
  • Posts: 6
    • View Profile
Re: Patching Shantae to force GBA or GBC modes.
« Reply #26 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).

rainponcho

  • Sr. Member
  • ****
  • Posts: 275
    • View Profile
Re: Patching Shantae to force GBA or GBC modes.
« Reply #27 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.

Chael

  • Jr. Member
  • **
  • Posts: 10
    • View Profile
Re: Patching Shantae to force GBA or GBC modes.
« Reply #28 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...

Drenn

  • Jr. Member
  • **
  • Posts: 94
    • View Profile
Re: Patching Shantae to force GBA or GBC modes.
« Reply #29 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.
Zeldahacking.net: The hub for Zelda: Oracle of Ages and Seasons hacking. We have a discord!

Crisz Reyes

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Patching Shantae to force GBA or GBC modes.
« Reply #30 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




« Last Edit: July 06, 2017, 01:33:14 am by Crisz Reyes »

FCandChill

  • Hero Member
  • *****
  • Posts: 528
    • View Profile
Re: Patching Shantae to force GBA or GBC modes.
« Reply #31 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..?

FAST6191

  • Hero Member
  • *****
  • Posts: 2593
    • View Profile
Re: Patching Shantae to force GBA or GBC modes.
« Reply #32 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.

SCD

  • RHDN Patreon Supporter!
  • Hero Member
  • *****
  • Posts: 620
  • SPOOOOON!
    • View Profile
Re: Patching Shantae to force GBA or GBC modes.
« Reply #33 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?

FAST6191

  • Hero Member
  • *****
  • Posts: 2593
    • View Profile
Re: Patching Shantae to force GBA or GBC modes.
« Reply #34 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

Asaki

  • RHDN Patreon Supporter!
  • Full Member
  • *****
  • Posts: 169
    • View Profile
Re: Patching Shantae to force GBA or GBC modes.
« Reply #35 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.

FAST6191

  • Hero Member
  • *****
  • Posts: 2593
    • View Profile
Re: Patching Shantae to force GBA or GBC modes.
« Reply #36 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.

Drenn

  • Jr. Member
  • **
  • Posts: 94
    • View Profile
Re: Patching Shantae to force GBA or GBC modes.
« Reply #37 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.
Zeldahacking.net: The hub for Zelda: Oracle of Ages and Seasons hacking. We have a discord!

suchrandomsohajile

  • Newbie
  • *
  • Posts: 1
    • View Profile
Re: Patching Shantae to force GBA or GBC modes.
« Reply #38 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:


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

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.