Pages: 1
Posted on 09-08-14, 09:53 pm
Death by cuteness

Karma: 6249
Posts: 129/598
Since: 05-01-13
So today we're going to restore the missing code needed to evolve some Pokémon by leveling them up in a specific location.
More specifically Eevee into Leafeon, Eevee into Glaceon, Magneton into Magnezone and Nosepass into Probopass.

As it is, there's currently no way to obtain those evolutions on a retail card without trading them to DPPt.

This is the code for the location-specific evolution (this comes from Platinum btw):
07 4B 00 22 19 88 88 42 04 D1 50 1C 41 00 04 48 40 5A 70 47 92 1C 1B 1D YY 2A F3 D3 00 20 70 47 XX XX XX XX


XX XX XX XX is the offset for the following data :
81 01 1A 00 CB 00 19 00 CF 00 18 00 D0 00 18 00 D1 00 18 00 D2 00 18 00 D3 00 18 00 D4 00 18 00 D5 00 18 00 D6 00 18 00 D7 00 18 00 D8 00 18 00 D9 00 18 00 DA 00 18 00 DB 00 18 00 DC 00 18 00 DD 00 18 00 FE 01 18 00 FF 01 18 00 48 02 18 00 49 02 18 00


Format is MM MM EE EE
MM MM is the map number
EE EE is the evolution method
For example the first 4 bytes are read like this:
_81 01 => 01 81 => map 385 which is Route 217 (oustide)
_1A 00 => 00 1A => evolution method 26 which is used to evolve Eevee into Glaceon
Ergo if you level up Eevee on Route 217, it will evolve into Glaceon.

YY is the total of map-related evolution, times 2.
Map-related evolutions are 4 bytes long each, the total is 84 bytes long.
84 / 4 = 21
Remember you have to multiply by 2.
21 × 2 = 42
42 is 2A in hex, thus in Platinum's code YY=2A.

This is what the routine looks like:




As surprising as it may be, the function still exists in HGSS, judge by yourself:

No wonder you can't trigger location-specific evos at all.



So how are we going to restore the code ?


Step 1:
Open Pokémon HG or SS with CrystalTile2.

Step 2:
Decompress the arm9.

Step 3:
We're going to search for a place to fit in the new code, a place with enough unused FF FF should do the trick.
Why not for example the address 0×11025C ?



Step 4:
Copy and paste this string:
07 4B 00 22 19 88 88 42 04 D1 50 1C 41 00 04 48 40 5A 70 47 92 1C 1B 1D 12 2A F3 D3 00 20 70 47 C8 02 11 02






Step 5:
We're going to need to past the new map-data too.
Wait, none of Leafeon, Glaceon, Magnezone or Probopass are listed in the Johto Dex.
To alleviate that issue, map-specific evolution are going to be Kanto-only.
_Eevee into Leafeon : Virdian Forest (that one is a given)
_Eevee into Glaceon : Seafoam Islands except the Gym part (again, a given)
_Magneton into Magnezone and Nosepass into Probopass : Route 10 and Power Plant (well Power Plant used to be home to Magnemite and Magneton )

That makes for 9 maps in total, thus 36 bytes in total:
Copy and paste this string at address 0×1102C8:
92 00 1A 00 C5 01 1A 00 C6 01 1A 00 C7 01 1A 00 C8 01 1A 00 93 00 19 00 12 00 18 00 84 01 18 00 D3 01 18 00



Step 6:
A problem arises, there are 3 routines who use a Branch linking to the map-evo function, thus we have to modify the pointers:

Go to address 0×3CE04 and change FEFC02FC into D3F02AFA.
Go to address 0×51E5C and change E9F7D6FB into BEF0FEF9.
Go to address 0×81E6E and change B9F7CDFB into 8EF0F5F9.

This is only for English versions for now.

Before


After


Step 7:
Save your modified arm9 and close the Hex editor.

Step 8:
Reinsert the arm9 into your ROM.

I might make a video to see the new code in action.
Of course this is no hoax, rest assured
Pages: 1