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

Author Topic: Help with Celebi Event in Pokémon Crystal  (Read 1554 times)

shinichi999

  • Jr. Member
  • **
  • Posts: 23
    • View Profile
Help with Celebi Event in Pokémon Crystal
« on: November 01, 2019, 05:49:30 pm »
I found an IPS patch to activate the Celebi event in Pokémon Crystal. The problem is that my hackrom uses the Spanish version of the game and the patch is not working for that language (only in English). I analyzed the changes with a Hex Editor and I discovered that the patch only changes 3 values to trigger the event:

UP= Original value
DOWN= Modified value (to activate the event)

First value:



Second value:



Third value:



However, when I look into the Spanish ROM for those values in the same address, they aren't there:


First value? (Spanish ROM):




Second value? (Spanish ROM)




Third value? (Spanish ROM)




So I'm wondering if it's possible to "port" that patch or values to the Spanish ROM in order to activate the hack. And if so, which values should I change?

This is the patch for the English ROM:
https://www.mediafire.com/file/72eorib3kherztb/Pokemon_-_Crystal_Version_%28USA%2C_Europe%29_%28Celebi_Event%29.ips/file

I'll really appreciate any help!  :thumbsup:


EDIT:

I realized that using the next Gameshark in an emulator I can trigger the event when exiting from the Pokémon Center in Goldenrod city in the Spanish ROM (as in the others):

010B3CBE

How can I "port" or "transform" this Gameshark into an IPS Patch to use it with the Spanish ROM?
« Last Edit: November 01, 2019, 07:47:32 pm by shinichi999 »

Jorpho

  • Hero Member
  • *****
  • Posts: 4210
  • The cat screams with the voice of a man.
    • View Profile
Re: Help with Celebi Event in Pokémon Crystal
« Reply #1 on: November 02, 2019, 12:18:18 am »
So, it looks like in the English version, the patch changes
94 4F 00 00 00 07 04 00 D9 4F 00 00 00 05 37 05
into
9E 4F 00 00 00 07 04 00 E3 4F 00 00 00 05 37 05

Do you not recognize a similar string in the Spanish ROM, near the bottom of the image?  It's
95 4F 00 00 00 07 04 00 DA 4F 00 00 00 05 37 05

You can try making the same change to that string, though it might not be that easy.
This signature is an illusion and is a trap devised by Satan. Go ahead dauntlessly! Make rapid progres!

tc

  • Hero Member
  • *****
  • Posts: 1144
  • Lum Fan
    • View Profile
    • Eon Blog
Re: Help with Celebi Event in Pokémon Crystal
« Reply #2 on: November 02, 2019, 05:00:23 am »
Nintendo released the game in Spanish for 3DS Virtual Console. Maybe you can determine what values they changed.

shinichi999

  • Jr. Member
  • **
  • Posts: 23
    • View Profile
Re: Help with Celebi Event in Pokémon Crystal
« Reply #3 on: November 02, 2019, 09:28:48 am »
So, it looks like in the English version, the patch changes
94 4F 00 00 00 07 04 00 D9 4F 00 00 00 05 37 05
into
9E 4F 00 00 00 07 04 00 E3 4F 00 00 00 05 37 05

Do you not recognize a similar string in the Spanish ROM, near the bottom of the image?  It's
95 4F 00 00 00 07 04 00 DA 4F 00 00 00 05 37 05

You can try making the same change to that string, though it might not be that easy.

I did just after posting this thread but it didn't work  :(


Nintendo released the game in Spanish for 3DS Virtual Console. Maybe you can determine what values they changed.

They didn't touch the ROM itself, but just activated a patch (which of course, it's not compatible with the Gameboy ROM).

So for now my only chance it's "translating" the Gameshark code (010B3CBE) into a compatible IPS patch or something like that. Is it possible? Any other piece of advice?  :(

Jorpho

  • Hero Member
  • *****
  • Posts: 4210
  • The cat screams with the voice of a man.
    • View Profile
Re: Help with Celebi Event in Pokémon Crystal
« Reply #4 on: November 02, 2019, 11:05:07 am »
I did just after posting this thread but it didn't work  :(
You included the first change as well, right?

When you say "it didn't work", what exactly happened?  How were you testing it?

Quote
So for now my only chance it's "translating" the Gameshark code (010B3CBE) into a compatible IPS patch or something like that. Is it possible? Any other piece of advice?
Most things are "possible".

Gameshark codes change values that have been loaded into memory.  To make corresponding changes to a ROM, you generally have to use a debugger to find out how the Game Boy loads that particular value into memory and where it reads that value from the ROM.
This signature is an illusion and is a trap devised by Satan. Go ahead dauntlessly! Make rapid progres!

shinichi999

  • Jr. Member
  • **
  • Posts: 23
    • View Profile
Re: Help with Celebi Event in Pokémon Crystal
« Reply #5 on: November 02, 2019, 11:58:53 am »
You included the first change as well, right?

When you say "it didn't work", what exactly happened?  How were you testing it?
Most things are "possible".

I looked for the 3 corresponding values and changed the three of them. Then I started a New Game, but the event is not triggering when arriving to the Goldenroad's Pokémon Center. So it's very likely that in the Spanish version I need to change other values (I don't know which ones, of course).

Gameshark codes change values that have been loaded into memory.  To make corresponding changes to a ROM, you generally have to use a debugger to find out how the Game Boy loads that particular value into memory and where it reads that value from the ROM.

Could you please elaborate on this? What debugger do I need exactly and which steps must I follow?

Jorpho

  • Hero Member
  • *****
  • Posts: 4210
  • The cat screams with the voice of a man.
    • View Profile
Re: Help with Celebi Event in Pokémon Crystal
« Reply #6 on: November 02, 2019, 06:16:53 pm »
There is no step-by-step guide for this kind of thing because every program is different.  It is a tedious business involving a considerable amount of trial-and-error and requiring some knowledge of assembly language.

But considering the extreme popularity of Pokemon, someone out there has surely done something at least a little similar already.
This signature is an illusion and is a trap devised by Satan. Go ahead dauntlessly! Make rapid progres!

KingMike

  • Forum Moderator
  • Hero Member
  • *****
  • Posts: 6932
  • *sigh* A changed avatar. Big deal.
    • View Profile
Re: Help with Celebi Event in Pokémon Crystal
« Reply #7 on: November 02, 2019, 07:17:09 pm »
There are full disassemblies of Gen 1 and 2 English versions.

Use breakpoints to figure out what part of the game that data is changing and it should be easy to look up.
"My watch says 30 chickens" Google, 2018

shinichi999

  • Jr. Member
  • **
  • Posts: 23
    • View Profile
Re: Help with Celebi Event in Pokémon Crystal
« Reply #8 on: November 02, 2019, 07:43:09 pm »
There is no step-by-step guide for this kind of thing because every program is different.  It is a tedious business involving a considerable amount of trial-and-error and requiring some knowledge of assembly language.

But considering the extreme popularity of Pokemon, someone out there has surely done something at least a little similar already.

What a pity. I couldn't contact the creator of the patch yet, but he said that he only expent 2 hours working on the patch. I have been analyzing the code for 3 days and trying multiple variables but it's still not working. I'm not having any luck with this  :'(



There are full disassemblies of Gen 1 and 2 English versions.

Use breakpoints to figure out what part of the game that data is changing and it should be easy to look up.

I think you mean what I already tried: looking and comparing the same strings and values, and changing them in the same order; however, this is not working with the Spanish version. It would be much easier if the full disassembly were in Spanish, but it's not the case.

I don't really know what you mean exactly with using breakpoints, if you can explain it I will really appreciate it.

KingMike

  • Forum Moderator
  • Hero Member
  • *****
  • Posts: 6932
  • *sigh* A changed avatar. Big deal.
    • View Profile
Re: Help with Celebi Event in Pokémon Crystal
« Reply #9 on: November 03, 2019, 12:30:40 pm »
A breakpoint is to make the debugger stop when the data in question is executed or read/written to.

For BGB, you would have to open the Debugger, find the option for Breakpoint (for checking if the data is ASM code) or Access Breakpoints (for checking when it is read).

To get the PC (the address), you would get the CPU address (for the English patch, since that is the one known working). Convert the ROM address to a CPU address. (if you don't know, divide the address by 0x4000 and take the remainder, which would be 0x2580, then add 0x4000 to get $6580).

Now play the game until the debugger pops up while playing, and you will when in the game the data is accessed.
"My watch says 30 chickens" Google, 2018

Jorpho

  • Hero Member
  • *****
  • Posts: 4210
  • The cat screams with the voice of a man.
    • View Profile
Re: Help with Celebi Event in Pokémon Crystal
« Reply #10 on: November 03, 2019, 02:13:15 pm »
I should add that since you know what addresses in the ROM the game should be reading in order to trigger the Celibi event, you could conceivably set up some sort of breakpoint for when the program reads those addresses and see which values it compares them to.  But it might not be that simple.

Alternatively, since there is apparently a disassembly for the game, you could try to look at that and see how the game triggers the Celibi event.

Just to rule out simple possibilities, have you tried changing
95 4F 00 00 00 07 04 00 DA 4F 00 00 00 05 37 05
into
9F 4F 00 00 00 07 04 00 E4 4F 00 00 00 05 37 05

Since the starting values are all off by 1 compared to the English version, perhaps the values that need to be changed also need to be off by 1.  The first value would be trickier, but you can try changing it to 08. (E6-D2=14h and F4+14h=108.)
This signature is an illusion and is a trap devised by Satan. Go ahead dauntlessly! Make rapid progres!

shinichi999

  • Jr. Member
  • **
  • Posts: 23
    • View Profile
Re: Help with Celebi Event in Pokémon Crystal
« Reply #11 on: November 03, 2019, 04:41:12 pm »
I should add that since you know what addresses in the ROM the game should be reading in order to trigger the Celibi event, you could conceivably set up some sort of breakpoint for when the program reads those addresses and see which values it compares them to.  But it might not be that simple.

Alternatively, since there is apparently a disassembly for the game, you could try to look at that and see how the game triggers the Celibi event.

Just to rule out simple possibilities, have you tried changing
95 4F 00 00 00 07 04 00 DA 4F 00 00 00 05 37 05
into
9F 4F 00 00 00 07 04 00 E4 4F 00 00 00 05 37 05

Since the starting values are all off by 1 compared to the English version, perhaps the values that need to be changed also need to be off by 1.  The first value would be trickier, but you can try changing it to 08. (E6-D2=14h and F4+14h=108.)

Man... you are awesome! I managed to trigger the event by only changing 95 for 9F and DA for E4.




I changed the F4 for 08 as you suggested, but I don't see any difference. The event works flawlessy only with the first change. Would you recommend me leaving it that way?
« Last Edit: November 03, 2019, 07:33:14 pm by shinichi999 »

Jorpho

  • Hero Member
  • *****
  • Posts: 4210
  • The cat screams with the voice of a man.
    • View Profile
Re: Help with Celebi Event in Pokémon Crystal
« Reply #12 on: November 04, 2019, 01:17:52 am »
Oh! I guessed something correctly for once. Yay! :woot!:

Considering the first value is near the start of the ROM, I would expect that it is some kind of checksum that depends on the value of every other byte in the ROM – but it would be unusual if the checksum is only a single byte.

There's got to be more information about the function of that byte out there somewhere.  I tried doing Google searches for "PM_crystal.byte" and "PM_crystal.byts" but nothing obvious came up.
This signature is an illusion and is a trap devised by Satan. Go ahead dauntlessly! Make rapid progres!

shinichi999

  • Jr. Member
  • **
  • Posts: 23
    • View Profile
Re: Help with Celebi Event in Pokémon Crystal
« Reply #13 on: November 05, 2019, 02:21:32 pm »
Oh! I guessed something correctly for once. Yay! :woot!:

Considering the first value is near the start of the ROM, I would expect that it is some kind of checksum that depends on the value of every other byte in the ROM – but it would be unusual if the checksum is only a single byte.

There's got to be more information about the function of that byte out there somewhere.  I tried doing Google searches for "PM_crystal.byte" and "PM_crystal.byts" but nothing obvious came up.

I tested the whole ROM and everything works fine. Thanks a bunch, dude!  :laugh:

Jorpho

  • Hero Member
  • *****
  • Posts: 4210
  • The cat screams with the voice of a man.
    • View Profile
Re: Help with Celebi Event in Pokémon Crystal
« Reply #14 on: November 05, 2019, 10:37:26 pm »
FYI, I'm not sure what sort of testing you did, but when it comes to checksums, often emulators are much more tolerant than real hardware.  But if you're never going to run this on a flashcart, I don't suppose it matters.
This signature is an illusion and is a trap devised by Satan. Go ahead dauntlessly! Make rapid progres!

shinichi999

  • Jr. Member
  • **
  • Posts: 23
    • View Profile
Re: Help with Celebi Event in Pokémon Crystal
« Reply #15 on: November 05, 2019, 11:29:00 pm »
FYI, I'm not sure what sort of testing you did, but when it comes to checksums, often emulators are much more tolerant than real hardware.  But if you're never going to run this on a flashcart, I don't suppose it matters.

I didn't change the checksums values, just the ones I told you. As for the game, I'm testing it on both emulator and real cartridge (I like to have my hackroms stored on real cartridges), and everything works fine  :laugh:


RealGaea

  • Full Member
  • ***
  • Posts: 158
    • View Profile
Re: Help with Celebi Event in Pokémon Crystal
« Reply #16 on: November 06, 2019, 08:37:59 pm »
Then you will release the patch? I can wait to complete my old Pokedex Save with that missing event!

Jorpho

  • Hero Member
  • *****
  • Posts: 4210
  • The cat screams with the voice of a man.
    • View Profile
Re: Help with Celebi Event in Pokémon Crystal
« Reply #17 on: November 06, 2019, 10:37:27 pm »
Then you will release the patch?
Why not patch it yourself..?  It's literally two bytes.  Also, the patch will evidently be different depending on what version of the game you are using.

And furthermore, it's been possible to hatch Celibi from an egg for a long time now with the right glitch.
This signature is an illusion and is a trap devised by Satan. Go ahead dauntlessly! Make rapid progres!

shinichi999

  • Jr. Member
  • **
  • Posts: 23
    • View Profile
Re: Help with Celebi Event in Pokémon Crystal
« Reply #18 on: November 07, 2019, 12:28:15 pm »
Then you will release the patch? I can wait to complete my old Pokedex Save with that missing event!

I don't get it... as I said in my main post, the patch already exists (for the English ROM), and if you want it for the Spanish version, you can change the values by yourself, it's all explained right here.

RealGaea

  • Full Member
  • ***
  • Posts: 158
    • View Profile
Re: Help with Celebi Event in Pokémon Crystal
« Reply #19 on: November 14, 2019, 09:14:23 pm »
Ok, I'll try. It's been a while since I did... something.