[Tutorial] [DPPtHGSS] Gen4 Pal Park Migration Gen3 Region Unlock (Emu & Offical Cartridge)

Wokann

Member
OP
Newcomer
Joined
Feb 6, 2023
Messages
18
Trophies
0
Age
26
XP
354
Country
Hong Kong
As we all know, if you want to migrate pokemon from Ruby/Sapphire/FireRed/LeafGreen/Emerald to Gen4, you need to use Pal Park to migrate. You have to insert Diamon/Pearl/Platinum/HeartGold/SoulSilver into slot1 of NDS(L), and insert Gen3 cartridges into slot2. Then from the start menu of Gen4 game you can find an option to migrate pokemon from Gen3.
What needs to be noted is that:
1.For jap/eng/fra/ita/ger/spa Gen4 rom, Gen3 rom must have the same language as Gen4 rom to migrate.
2.For kor Gen4 rom, it can migrate both from jap Gen3 rom and eng Gen3 rom.

So is there anyway for Gen4 rom to migrate from any region of Gen3 rom? The following are several methods for Gen3 Region Unlock (Reading this Guide requires some basic knowledge of hexadecimal and RomHack experience):

Method 1: Hack GBA Rom header (Emu or GBA flashcart)
Principle: Changer the Language code of Romheader.
Practice: Take jap Gen4 & eng Gen3 as an example.
1.Open the eng Gen3 with a hex editor, you can see ‘POKEMON RUBYAXVE’ at address 0xA0. Below ‘AXVE’ you can see ‘0x41’ at address 0xBD。
1-1.png

2.Change language code: Since jap Gen4 is where we need to receive pokemon, we should make eng Gen3 rom like jap Gen3 rom. The ‘E’ of ‘AXVE’ is language code, so we change it to ‘J’-‘AXVJ’.
1-2.png

3.Change header checksum: While ‘E’ changed to ‘J’, it hex value also changed from ’0x45’ to ‘0x4A’, which 0x45 + 0x5 = 0x4A. So we need to change header checksum at address 0xBD, let ‘0x41’ minus 0x5, which 0x41 – 0x5 = 0x3C. So change checksum from ‘0x41’ to ‘0x3C’.
1-3.png

4.After that, this hacked eng Gen3 rom can be recognized by jap Gen4 rom through emulator or flashcart. Here are other language code (note capitalization): Japanese-J, English-E, French-F, Italian-I, German-D, Spanish-S.

Method 2: Hack NDS language value (Emu or NDS flashcart)

Principle: Let the language values which NDS use for checking GBA rom all change to the values matching NDS language.
Practice: Take jap Gen4 (Diamond) & eng Gen3 as an example.
1. Use CrystalTile2 to open Diamond rom, search for ‘AXVJ’, you can find several columns of similar characters, 5 Gen3 versions, and 6 languages.
Versions: Ruby-AXV, Sapphire-AXP, Fire Red-BPR, LeafGreen-BPG, Emerald-BPE.
Languages: Japanese-J, English-E, French-F, Italian-I, German-D, Spanish-S.

Combine a total of 30 corresponding Gen3 game codes.
2-1.png

The following analyzes the structure of this table, using ‘AXVJ’ as an example, every 8 bytes in groups:
‘41 58 56 4A 00 00 01 00’
The first 4 bytes are the Ascii code corresponding to ‘AXVJ’, and the second half only needs to pay attention to the 7th byte, ‘0x01’, here as the language value Japanese to judge.
The correspondence of language values: Japanese-0x01, English-0x02, French-0x03, Italian-0x04, German-0x05, Spanish-0x07。
When the Gen3 cartridge is inserted, the NDS side compares the first 4 bytes of the game code with gba haeder, and when it finds a value that matches, it returns the 7th byte (language value), and only when the language value matches the language value of the NDS game, the Migration option will be opened.

2. According to the above, you can know that as long as all the language values returned by 30 game codes are changed to the language values of nds, then Gen 3 games in all languages are compatible. In this ezample, the Jap Gen4 (Diamond) needs to change all 30 language values to 0x01 Japanese.
2-2.png

3. After saving edit, you can make this Jap Gen4 (Diamond) recognize the Gen 3 cartridge in all languages. It should be reminded that in the Rom of Diamond/Pearl/Platinum, these game code and language value are uncompressed, while in HeartGold/SoulSilver, this part of the content is compressed and cannot be directly searched to find, you need to decompress ‘overlay 9_0074.bin’ file (this file name is unpacked from CT2, the name may be different if you use other tools to unpack) to find the corresponding data, and after hacking, you also need to compress it.

Method 3: Hack NDS asm code (Emu or NDS flashcart)
Principle: Hack the function mechanism of Migration judgment.
Practice:
1. At the beginning of the guide, it was mentioned that jap/eng/fra/ita/ger/spa Gen4 rom can only receive the same language of Gen3 rom, but Kor Gen4 can receive jap&eng of Gen3 rom. Therefore, there are essentially two Migration judgment mechanisms in Gen4 game.
In Gen4 ROM, the file where the Migration judgment function is located is:
Diamond/Pearl: overlay9_0083
Platinum: overlay9_0097
Heart Gold/Soul Silver: overlay9_0074

(1) Codes for Jap/Eng/Fra/Ita/Ger/Spa version (taking the pret project Eng HeartGold as an example): see this file and line number ‘/asm/overlay_74_thumb.s #L832’ (the following is the assembly code, If you don't understand it, you can skip it directly, see the description below).
Code:
———————————————————————————————————————
_0222767E:
0x0222767E    1C20          add r0, r4, #0
0x02227680    FF16F5F2      bl sub_0201A4B0
0x02227684    68A8          ldr r0, [r5, #8]
0x02227686    FF69F602      bl Pokedex_GetNatDexFlag
0x0222768A    2800          cmp r0, #0
0x0222768C    D00B          beq _022276A6
0x0222768E    F99BF00C      bl PmAgbCartridge_GetLanguage
0x02227692    4905          ldr r1, _022276A8 ; =gGameLanguage
0x02227694    7809          ldrb r1, [r1]
0x02227696    4281          cmp r1, r0
0x02227698    D105          bne _022276A6
0x0222769C    FF98FF00C     bl PmAgbCartridge_GetVersionInternal
0x0222769E    1C40          add r0, r0, #1
0x022276A0    6268          str r0, [r5, #0x24]
0x022276A2    FCE7F00E      bl ov74_02236074

_022276A6:
0x022276A6    BD38          pop {r3, r4, r5, pc}
                            .balign 4, 0

_022276A8:
0x022276A8    020F5670      .word gGameLanguage
———————————————————————————————————————
The code here roughly means about migration:
1) whether to obtain the national pokedex, if passed, go to 2, and if do not pass, ends;
2) Check whether the GBA Rom language value is equal and compare with the NDS Rom language value, if it is equal, go to 3, and if not equal, ends;
3) Check the GBA Rom version, which is displayed in the menu when migrate.

(2) Codes for Kor version (taking the Kor HeartGold as an example, some function naming is modeled on the naming of the pret project) : (the following content is assembly code, if you can't understand it, you can skip it directly, see the description below).
Code:
———————————————————————————————————————
_0222807E:
0x0222807E    1C20         add r0, r4, #0
0x02228080    F9E2F5F2     bl #0x201a448
0x02228084    68A8         ldr r0, [r5, #8]
0x02228086    FBB3F602     bl #0x202a7f0      ;Pokedex_GetNatDexFlag
0x0222808A    2800         cmp r0, #0
0x0222808C    D00D         beq _022280AA
0x0222808E    F9A1F00C     bl #0x22343d4     ;PmAgbCartridge_GetLanguage
0x02228092    2801         cmp r0, #1
0x02228094    D003         beq _0222809E
0x02228096    F99DF00C     bl #0x22343d4     ;PmAgbCartridge_GetLanguage
0x02228098    2802         cmp r0, #2
0x0222809C    D105         bne _022280AA

_0222809E:
0x0222809E    F993F00C     bl #0x22343c8     ;PmAgbCartridge_GetVersionInternal
0x022280A2    1C40         adds r0, r0, #1
0x022280A4    6268         str r0, [r5, #0x24]
0x022280A6    FCDFF00E     bl #0x2236a68

_022280AA:
0x022280AA    BD38         pop {r3, r4, r5, pc}
———————————————————————————————————————
The code here roughly means about migration:
1) whether to obtain the national pokedex, if passed, go to 2, and if do not pass, ends;
2) Check whether the GBA Rom language value is 1 (i.e. Japanese), go to 4 if it is equal, and go to 3 if not equal;
3) Continue to check whether the GBA language value is 2 (i.e. English), if it is equal, go to 4, and if not equal, ends;
4) Check the GBA Rom version, which is displayed in the menu when migrate.

2. So what we need to do is to change ‘if not equal, ends’ to ‘if not equal ,continue’ . In two cases above, you only need to change 0xD105 to 0xD1FF, that is, you only need to change one byte 0x05→0xFF. After that the region restriction will be unlocked.

The following is a list of the addresses where 0x05 needs to be changed to 0xFF in each language version of Gen4 rom:
VersionlanguageROM addressRAM addressAssisted search code
Diamond/PearlJap0x0030169A0x0223083AE0 04 24 00 E0 03
Diamond/PearlEng0x002F17180x0222D6D8(ibid)
Diamond/PearlFra0x002F19180x0222D8D8(ibid)
Diamond/PearlIta0x002F19180x0222D838(ibid)
Diamond/PearlGer0x002F19180x0222D898(ibid)
Diamond/PearlSpa0x002F19180x0222D8F8(ibid)
Diamond/PearlKor0x002F2D1C0x0222D83C(ibid)
PlatinumJap0x0038D9180x0222A378(ibid)
PlatinumEng0x0038F5180x0222AF78(ibid)
PlatinumFra0x0038F3180x0222B158(ibid)
PlatinumIta0x0038F3180x0222B0D8(ibid)
PlatinumGer0x0038F3180x0222B118(ibid)
PlatinumSpa0x0038F5180x0222B178(ibid)
PlatinumKor0x0039051C0x0222BE7C(ibid)
HeartGold/SoulSilverJap0x00235D090x02226BD8(ibid)
HeartGold/SoulSilverEng0x00236B0E0x02227698(ibid)
HeartGold/SoulSilverFra0x00236B100x022276B8(ibid)
HeartGold/SoulSilverIta0x0023670E0x0222763800 04 24 00 E0 03
HeartGold/SoulSilverGer0x002369100x02227678E0 04 24 00 00 E0
HeartGold/SoulSilverSpa0x00236B0F0x022276B8E0 04 24 00 E0 03
HeartGold/SoulSilverKor0x002371130x0222809CE0 04 24 00 E0 00
* Assisted search code is used in fan translated ROM which the address may changes to help find the location of the migration function and 0x05 more quickly.

Method 4: Cheat code hack NDS asm code (Can use for Cartridge)
Principle: Same as Method 3, but don’t need to change the ROM while this method change the RAM.
Practice:
1. For codes of migration function will be loaded to RAM, so we can use cheat codes to edit RAM without edit ROM. It means we can apply this region unlock hack on Real Gen4 cartridges by using tools like Aciton Replay, NitroHax etc.
(see video link Jap HeartGold migrate from Eng Emerald Pal Park region unlock () )
I’ve made the region unlock codes written in Action Replay format for NitroHax and can also be used for emulator. You can download this file ‘cheats.xml’.

4-1.png

4-2.png

4-3.png

4-4.png



Pal Park region unlock code:
Diamond/Pearl:
Japan:
52230838 D1054281
2223083A 000000FF

English:
5222D6D8 F009D105
2222D6D8 000000FF

France:
5222D8D8 F009D105
2222D8D8 000000FF

Italy:
5222D838 F009D105
2222D838 000000FF

Germany:
5222D898 F009D105
2222D898 000000FF

Spain:
5222D8F8 F009D105
2222D8F8 000000FF

Korean:
5222D83C F009D105
2222D83C 000000FF

Platinum:
Japan:
5222A378 F00AD105
2222A378 000000FF

English:
5222AF78 F00AD105
2222AF78 000000FF

France:
5222B158 F00AD105
2222B158 000000FF

Italy:
5222B0D8 F00AD105
2222B0D8 000000FF

Germany:
5222B118 F00AD105
2222B118 000000FF

Spain:
5222B178 F00AD105
2222B178 000000FF

Korean:
5222BE7C F00AD105
2222BE7C 000000FF

HeartGold/SoulSilver:
Japan:
52226BD8 F00CD105
22226BD8 000000FF

English:
52227698 F00CD105
22227698 000000FF

France:
522276B8 F00CD105
222276B8 000000FF

Italy:
52227638 F00CD105
22227638 000000FF

Germany:
52227678 F00CD105
22227678 000000FF

Spain:
522276B8 F00CD105
222276B8 000000FF

Korean:
5222809C F00CD105
2222809C 000000FF
 

Attachments

  • cheats.zip
    1 KB · Views: 78
Last edited by Wokann,
  • Like
Reactions: DSoryu and cearp

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    Xdqwerty @ Xdqwerty: good night