Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simple GameShark ROM patch code does not work #2724

Closed
camthesaxman opened this issue Nov 17, 2022 · 3 comments
Closed

Simple GameShark ROM patch code does not work #2724

camthesaxman opened this issue Nov 17, 2022 · 3 comments
Labels
blocked:needs retest Needs a retest to confirm if it's fixed

Comments

@camthesaxman
Copy link

I am trying to create a cheat to always enable the National Dex on Pokemon Fire Red by patching the mov r0, #0 (0x2000) instruction at 0x0806E2A8 to mov r0, #1. Using this site https://gamehacking.org/system/gba I generated the code 600DC550 00002001 to accomplish this. Entering it into mGBA's cheats has no affect, and the instruction is not patched. However, by manually patching said instruction using the memory viewer, the National Dex does get enabled.

Steps to reproduce:

  1. Load a clean ROM of Pokemon Fire Red English v1.1 (sha1: dd5945db9b930750cb39d00c84da8571feebf417) into mGBA.
  2. Play the game up until obtaining the Pokedex (walk into grass, choose starter, go up to Viridian City PokeMart to obtain parcel, deliver parcel to Professor Oak in Palette Town lab, Oak gives Pokedex - takes less than 5 minutes).
  3. Save the game.
  4. Open the Tools -> Cheats dialog.
  5. Enter the code 600DC550 00002001, select GameShark for the code type, and click Add New Code. The code should be enabled (checked), and you may give it a name if you wish.
  6. Verify that the .cheats file created for the game matches the following:
!GSAv1
# National Dex
600DC550 00002001
  1. In the game, press start to open the menu, and press A on the Pokedex option.

Expected result:

The 16-bit value at address 0x0806E2A8 should be patched to 0x2001 and the National Pokedex should be unlocked (green bars and both "NUMERICAL MODE: KANTO" and "NUMERICAL MODE: NATIONAL" options).

Actual result:

The cheat has no effect, and only the Kanto Pokedex is unlocked (brown bars and only has the NUMERICAL MODE option under Pokemon List). As mentioned above, changing the byte at 0x0806E2A8 to 01 using the memory viewer does allow the National Pokedex to appear, but the cheat does nothing.

@flingrocks
Copy link

flingrocks commented Nov 22, 2022

Hmm... that GameShark code doesn't look right to me. For making a GameShark ROM Patch code, take the address and logical shift-right by 1 (0x0806E2A8 >>> 1 = 0x04037154), and then add 0x60000000.
Knowing this, I figure the code before encryption would be 64037154 00002001 and final code after encrypting 959DBC75 8499CE5F

What gamehacking.org converter spat out in the first part was 0x600DC550, so that site may be mistakenly performing a shift-left instead (0x6E2A8 << 1 = 0xDC550).

Try retesting mGBA with the new code to confirm whether or not any problems occur.

@endrift
Copy link
Member

endrift commented Dec 22, 2022

@camthesaxman Please try with the changes mentioned; the gamehacking.org converter does appear to be broken after all.

Use 60037154 00002001 though, since the patch code shouldn't include the base address of the ROM, and is in fact filtered out.

@endrift endrift added the blocked:needs retest Needs a retest to confirm if it's fixed label Dec 22, 2022
@autofire372
Copy link

Strangely enough, that code does not work on its own, but does work if it's encrypted first (D3C95F54 156F2ECC according to AR Crypt).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked:needs retest Needs a retest to confirm if it's fixed
Projects
None yet
Development

No branches or pull requests

4 participants