The PokéCommunity Forums

The PokéCommunity Forums (https://www.pokecommunity.com/index.php)
-   Binary Hack Tutorials (https://www.pokecommunity.com/forumdisplay.php?f=66)
-   -   Expanding the Pokédex into Emerald (https://www.pokecommunity.com/showthread.php?t=324892)

Xencleamas April 26th, 2014 10:39 PM

Expanding the Pokédex into Emerald
 
1 Attachment(s)
For those who want a better expansion without any bugs, see this post and use this instead. All of what's left here will be a heap of information on how expansion works and is done.
This post though gave me cancer.

I would like to share a little bit wisdom to all:

"PLEASE CREDIT SBIRD. DO NOT CREDIT ME ALONE, YOU MUST CREDIT SBIRD AS WELL. I have noticed numerous hacks that only credit me for the expansion and that's very unfair to SBird, as he was the one who did it first. YOU MUST CREDIT SBIRD." -Chaos Rush

It is because SBird is the real mastermind and first person who achieved the expansion on Emerald however, thus on a German ROM. SBird was so kind to post his notes for documentation and guiding everyone, making it possible on any language Emerald ROM. Then, Chaos Rush is the guy who made it working into an English Emerald ROM. Chaos Rush formely handled this thread. I took over for the continuity and adding some improvements while he's away. To be fair on crediting, include SBird as well. Alright! Let's make the expansion into Emerald. This tutorial was formerly copied word-by-word from DoesntKnowHowToPlay’s FireRed Pokédex expansion tutorial. Now, I've cleared and cleaned some. If not, feel to judge. Alright, let's begin:

Prerequisites
List of tools needed:
  • An Emerald ROM (preferably the English/US one)
  • Any GameBoy Advance emulator (I'm using VBA-M)
  • Any Hex Editor (I'm using HxD)
  • Any calculator that can use hexadecimal (Calculator for Windows users and you should be in programmer mode)
  • Free Space Finder (optional, just for looking free spaces)
  • Advanced knowledge on Hex Editing (I won't be teaching you how to use a hex editor, or how to repoint things. If you're qualified to do this, odds are all you really need is the offsets, which is pretty much all this post is.)

Decide the number of new Pokemon
Before to get started, you need to think and decide of the new total number of Pokemon with the new ones which you will add later. The current number of slots are 440 (this includes the index 0 at the very beginning). So, you will have to pick a number which is more than 440. The answer can be really higher than 440. Here's a quick help for you to decide which new total number of Pokemon you want to use:

Spoiler:
The first thing you should plan is how much the new slots you should put for new Pokemon. Think of all possible Pokemon you will add, and also all possible forms, formes, and megas you will add too (to be realistic, forms are handled by changing slots with one another. Face it! That's maybe the only way to accommodate forms/mega in GBA). Again, the current slots as 440. At this point, you might come with four possible listings: 493, 649, 721, and custom.

Gen IV Style
You planned to have 493 Pokemon as of Generation IV (the total viewed in the Pokedex listing). Here's a planned list for those who will use the Gen IV style:

440 - Current vanilla slots
107 - Gen IV Single Formed Pokemon
032 - Forms and Formes (total for only until Gen IV Pokemon)
048 - Mega Evolutions (total for only until Gen IV Pokemon)
627 - Total number of every single formed Pokemon

Noted that I have included the Fairy-type Arceus in the Forms and Formes listing. I only cared is about the number of Pokemon, not the other mechanics of generations.

Gen V Style
You planned to have 493 Pokemon as of Generation V (the total viewed in the Pokedex listing). Here's a planned list for those who will use the Gen V style:

440 - Current vanilla slots
107 - Gen IV Single Formed Pokemon
156 - Gen V Single Formed Pokemon
051 - Forms and Formes (total for only until Gen V Pokemon)
049 - Mega Evolutions (total for only until Gen V Pokemon)
803 - Total number of every single formed Pokemon until Gen V

Gen VI Style
You planned to have 721 Pokemon as of Generation VI (the total viewed in the Pokedex listing). Here's a planned list for those who will use the Gen VI style:

440 - Current vanilla slots
107 - Gen IV Single Formed Pokemon
156 - Gen V Single Formed Pokemon
072 - Gen VI Single Formed Pokemon
055 - Forms and Formes (total as of Gen VI)
050 - Mega Evolutions (total as of Gen VI)
880 - Total number of every single formed Pokemon

Those are the quick list for you. If you care want to add extra slots, just also add the number of extra slots you want to add in case you might want to have gender forms and improving Deoxys' formes.

To conclude this part, here's a giant list of every forms, formes, and megas as reference:
Spoiler:
Burmy Sand
Burmy Trash
Wormadam Sand
Wormadam Trash
Cherrim Sunlight
Shellos East
Gastrodon East
Rotom Mow
Rotom Oven
Rotom Wash
Rotom Frost
Rotom Fan
Giratina Origin
Shaymin Sky
Arceus Fight
Arceus Flying
Arceus Poison
Arceus Ground
Arceus Rock
Arceus Bug
Arceus Ghost
Arceus Steel
Arceus ???
Arceus Fire
Arceus Water
Arceus Grass
Arceus Electric
Arceus Psychic
Arceus Ice
Arceus Dragon
Arceus Dark
Arceus Fairy
Basculin Blue
Darmanitan Zen
Deerling Summer
Deerling Autumn
Deerling Winter
Sawsbuck Summer
Sawsbuck Autumn
Sawsbuck Winter
Tornadus Therian
Thundurus Therian
Landorus Therian
Kyurem Black
Kyurem White
Keldeo Resolute
Meleotta Pirouette
Genesect Fire
Genesect Water
Genesect Electric
Genesect Ice
Aegislash Shield
Pumpkaboo Size 2
Pumpkaboo Size 3
Pumpkaboo Size 4
Gourgeist Size 2
Gourgeist Size 3
Gourgeist Size 4
Hoopa Unbound
Mega Venusaur
Mega Charizard X
Mega Charizard Y
Mega Blastoise
Mega Alakazam
Mega Gengar
Mega Kengaskhan
Mega Pinsir
Mega Gyarados
Mega Aerodactyl
Mega Mewtwo X
Mega Mewtwo Y
Mega Ampharos
Mega Scizor
Mega Heracross
Mega Houndoom
Mega Tyranitar
Mega Blaziken
Mega Gardevoir
Mega Mawile
Mega Aggron
Mega Medicham
Mega Manectric
Mega Banette
Mega Absol
Mega Garchomp
Mega Lucario
Mega Abomasnow
Mega Beedrill
Mega Pidgeot
Mega Slowbro
Mega Steelix
Mega Sceptile
Mega Swampert
Mega Sableye
Mega Sharpedo
Mega Camerupt
Mega Altaria
Mega Glalie
Mega Salamence
Mega Metagross
Mega Latias
Mega Latios
Primal Kyogre
Primal Groudon
Mega Rayquaza
Mega Lopunny
Mega Gallade
Mega Audino
Mega Diancie


Now, good luck for the rest.


Keep in mind that in the rest of tutorial will be Hex numbers. Advice on typing hex numbers on filters, do not type the "0x08". So, let's move on! Before to go any further, USE AT YOUR OWN RISK!!!

The Expansion
Step 1: Installing the Save Block Hack
Spoiler:
The first obstacle to expanding the Pokedex is the need for flags to store what new Pokemon the player has seen/caught. To do this, we need free memory.

First things first. Put this routine into free space. It is JPAN’s Save Block Hack, albeit modified so that it works on hardware:
Code:

21 68 FF 23 1B 01 5B 18 98 88 00 28 09 D0 04 28
0A D0 0D 28 0C D0 0D 2D 1C DD 01 20 08 BC 98 46
F0 BD C4 21 08 4A 06 E0 8E 21 89 00 07 4A 02 E0
BA 21 09 01 06 4A 04 3B 18 68 10 60 04 3A 04 39
00 29 F8 D1 E7 E7 C0 46 C0 D8 03 02 F8 DA 03 02
98 E6 03 02 00 48 00 47 2D 2E 15 08 FF FF FF FF
FF 27 3F 01 CF 19 F8 80 BE 88 00 2E 08 D0 04 2E
09 D0 0D 2E 0B D0 00 00 00 48 00 47 53 28 15 08
C4 23 08 4A 06 E0 8E 23 9B 00 07 4A 02 E0 BA 23
1B 01 06 4A 04 3F 10 68 38 60 04 3A 04 3B 00 2B
F8 D1 E9 E7 C0 D8 03 02 F8 DA 03 02 98 E6 03 02


Make sure you insert it at a 4-byte aligned offset (ending with 0, 4, 8, or C). As some of you know, JPAN never released a hardware-compatible save fix for Emerald, but diegoisawesome fixed it up for his Emerald hack, CrystalDust. Because I had trouble doing it on my own, I will be completely honest: I ripped this routine straight from CrystalDust as it was the only way I got things working properly. I hope you don’t mind me doing this, diegoisawesome.

Next we need to make some byte changes to get the routine working.
  • At 0x152E98,put 00 48 00 47 XX XX XX 08. For XX XX XX 08, it's the offset you put the save block routine +0x1.
  • At 0x15284E, put 38 47.
  • At 0x15288C, put YY YY YY 08. For YY YY YY 08, it's the offset you put the save block routine +0x61.
  • At 0x0D9CC6, put 38 47.
  • At 0x0D9D04, put YY YY YY 08.
  • At 0x0DA284, put 00 48 00 47 XX XX XX 08.

At 0x5CDC00 is the offset of the save size table. Paste this over the bytes there:
Code:

00 00 2C 0F 00 00 F0 0F F0 0F F0 0F E0 1F F0 0F
D0 2F B8 0D 00 00 F0 0F F0 0F F0 0F E0 1F F0 0F
D0 2F F0 0F C0 3F F0 0F B0 4F F0 0F A0 5F F0 0F
90 6F F0 0F 80 7F 50 04


Again, this was taken from CrystalDust, as it was the only way I could get everything working. So credit to diegoisawesome for this as well.


Step 2: Get free RAM for the dex flags
Spoiler:
Now, before doing anything else, you should decide how many Pokédex entries and how many Pokémon you want. These don't have to be the same- it's entirely possible to map multiple Pokémon to a single dex entry, or have unmapped Pokémon- vanilla does just this with the limbo slots between Celebi and Treecko. Consider the limbo slots and Unown sprite slots- while slots 252-275 are actually quite safe to use, slots 412-439 store the sprites for eggs and every Unown form bar A. As such, if you use Unown, you will probably want to leave those alone.

Once you've decided, figure out how many bits it will take to encode the number of dex entries. The solution for the answer is:

Code:

YY = (X / 8) + 1
X = divisible by 8.
X < if not divisible by 8, round it off to the highest nearest number that is divisble by 8.

Whereas, X is the number of Pokedex entries. YY is the answer.
YY must be converted to hexadecimal if not.

Example: You want to have 721 Pokedex Entries. But, 721 isn't divisible by 8.
Try to find the highest nearest number of it. That would be 728.
Then, divide 728 by 8 and you'll get 91. Add 1 to it so, you'll get 92.
That's your answer for YY and make sure it is in hexadecimal so, that makes it 0x5C.
I'm not sure this is how it works but this is how that way I imagined it. Correct me if not.



Using this, pick two locations in the RAM freed by JPAN/diegoisawesome's hack to be where Seen and Caught flags will go. Note that later steps will be easier if you put them next to each other.

In all honesty the only area I’m 100% sure of is safe to use for the new dex flags is 0x0203D800 so, we are going to use that area. If 0x0203D800 is the area for seen flags, then the area for caught flags is at 0x0203D8YY. Whereas, YY is the answer you got earlier.

Make these byte changes:
C06EC: 00 D8 03 02 (point to new seen flags)
C06AC: 00 00
C06AE: 00 00
This makes the game read using the new Seen flags.

C0744: YY D8 03 02 (point to new caught flags, YY is the answer you got earlier)
C06FE: 00 00
C0700: 00 00
C0702: 00 00
C0710: 15 E0
This makes the game read using the new Caught flags.

C0720: 0D E0
This makes both of the above bypass redundant SEEN flags.

C07C8: 00 D8 03 02 (point to new seen flags)
C079E: 00 00
C07A0: 00 00
C07AC: 1C E0
This makes the game write to the new Seen flags.

C07F0: YY D8 03 02 (point to new caught flags, YY is the answer you got earlier)
C07DA: 00 00
C07DC: 00 00
This makes the game write to the new Caught flags.

We also need to make the game clear these flags properly when the player selects New Game at the main menu. We can do this with the following edits:

843BC: 00 D8 03 02 (point to new seen flags)
8439A: 20 1C 00 00
843A0: YY 22 (YY is the answer you got earlier)
843A6: 20 1C
843A8: YY 30 (YY is the answer you got earlier. This maybe the number of bytes between the sets of flags. This is probably the same as the answer, but it doesn't have to be)
843AC: YY 22 (YY is the answer you got earlier)

Alternatively, instead of these byte changes, you can instead make an OW script that clears the dex with writebytetooffset, and make sure it runs before the player gets the Pokédex. Your choice.


Step 3: Repoint Everything
Spoiler:
Part 1: Pokemon Names
  • The current Pokemon Names table is at 0x083185C8.
  • The Pokemon Names table has 11 bytes (0xB bytes) each Pokemon (if changing the limit is possible, just change the multiplier).
  • Go to a free space to create a new Pokemon Names table.
  • Create a new Pokemon Names table there. Multiply your desired new slots of Pokémon by 11 (0xB).
  • Select blocks and the type the length with the number of the result. Then fill the selection with "AC AC AC AC AC AC AC AC AC AC FF". There you go! You got your new table.
  • Navigate to 0x083185C8 to the Pokemon Names table.
  • Select and copy 4532 bytes (0x11B4 bytes) of data.
  • Paste it to where your new Pokemon Names table starts.
  • Repoint all references of the Pokemon Names table to the new table. Replace all C8 85 31 08 to the pointer of your new table. Also check if it have done 132 occurences.
  • If you want to erase the old data to have new spaces, navigate back to 0x083185C8 to the Pokemon Names table. Select 4532 bytes (0x11B4 bytes) of data. Then, fill it with "FF".
  • At 0x0806B944, place 00 00 00 00 00 00 (that's six 00s). This will cause the repointed name table to actually get used.

Part 2: Pokemon Base Stats
  • The current Pokemon Base Stats table is at 0x083203CC.
  • The Pokemon Base Stats table has 28 bytes (0x1C bytes) each Pokemon.
  • Go to a free space to create a new Pokemon Base Stats table.
  • Create a new Pokemon Base Stats table there. Multiply your desired new slots of Pokémon by 28 (0x1C).
  • Select blocks and the type the length with the number of the result. Then fill the selection with "00". There you go! You got your new table.
  • Navigate to 0x083203CC to the Pokemon Base Stats table.
  • Select and copy 11536 bytes (0x2D10 bytes) of data.
  • Paste it to where your new Pokemon Base Stats table starts.
  • Repoint all references of the Pokemon Base Stats table to the new table. Replace all CC 03 32 08 to the pointer of your new table. Also check if it have done 74 occurences.
  • If you want to erase the old data to have new spaces, navigate back to 0x083203CC to the Pokemon Base Stats table. Select 11536 bytes (0x2D10 bytes) of data. Then, fill it with "FF".
  • To read the Egg Hatching Time data, it is the Base Stats table plus 17 (0x11) bytes. So, that is 0x083203DD. Replace all DD 03 32 08 to the pointer of your new table for making the Egg Hatching Time read the new table. Also check if it have done 2 occurences.
  • To read the Held Item data, it is the Base Stats table plus 12 (0xC) bytes. So, that is 0x083203D8. Replace all D8 03 32 08 to the pointer of your new table for making the Held Item read the new table. Also check if it have done 1 occurence (pointer is at 0x0806EB7C)
  • Another one to read the Held Item data, it is the Base Stats table plus 14 (0xE) bytes. So, that is 0x083203DA. Replace all DA 03 32 08 to the pointer of your new table for making the Held Item read the new table. Also check if it have done 2 occurences (pointers are at 0x0806EB28 and 0x0806EBA0).

Part 3: Pokemon Moveset
  • The current Pokemon Moveset table is at 0x0832937C.
  • The Pokemon Moveset table has 4 bytes each Pokemon (a table of pointers).
  • Go to a free space to create a new Pokemon Moveset table.
  • Create a new Pokemon Moveset table there. Multiply your desired new slots of Pokémon by 4.
  • Select blocks and the type the length with the number of the result. Then fill the selection with "DC 30 32 08". There you go! You got your new table.
  • Navigate to 0x0832937C to the Pokemon Moveset table.
  • Select and copy 1648 bytes (0x670 bytes) of data.
  • Paste it to where your new Pokemon Moveset table starts.
  • Repoint all references of the Pokemon Moveset table to the new table. Replace all 7C 93 32 08 to the pointer of your new table. Also check if it have done 8 occurences.
  • If you want to erase the old data to have new spaces, navigate back to 0x0832937C to the Pokemon Moveset table. Select 1648 bytes (0x670 bytes) of data. Then, fill it with "FF".

Part 4: Front Sprites
  • The current Front Sprites table is at 0x0830A18C.
  • The Front Sprites table has 8 bytes each Pokemon (a table of pointers with filler bytes). Noted that PGE lists this offset as "PokemonAnimations", and lists the unused single-frame R/S front sprite table as "PokemonFrontSprites". Don't get these mixed up, as the single-frame R/S front sprite table is never used in-game.
  • Go to a free space to create a new Front Sprites table.
  • Create a new Front Sprites table there. Multiply your desired new slots of Pokémon by 8.
  • Select blocks and the type the length with the number of the result (mine is 8640 in decimal or 0x21C0 hexadecimal). Then fill the selection with "00 00 B0 08 00 08 00 00". There you go! You got your new table.
  • Navigate to 0x0830A18C to the Front Sprites table.
  • Select and copy 3520 bytes (0xDC0 bytes) of data.
  • Paste it to where your new Front Sprites table starts.
  • Repoint all references of the Front Sprites table to the new table. Replace all 8C A1 30 08 to the pointer of your new table. Also check if it have done 42 occurences.
  • If you want to erase the old data to have new spaces, navigate back to 0x0830A18C to the Front Sprites table. Select 3520 bytes (0xDC0 bytes) of data. Then, fill it with "FF".

Part 5: Back Sprites
  • The current Back Sprites table is at 0x083028B8.
  • The Back Sprites table has 8 bytes each Pokemon (a table of pointers with filler bytes).
  • Go to a free space to create a new Back Sprites table.
  • Create a new Back Sprites table there. Multiply your desired new slots of Pokémon by 8.
  • Select blocks and the type the length with the number of the result (mine is 8640 in decimal or 0x21C0 hexadecimal). Then fill the selection with "98 09 C0 08 00 08 00 00". There you go! You got your new table.
  • Navigate to 0x083028B8 to the Back Sprites table.
  • Select and copy 3520 bytes (0xDC0 bytes) of data.
  • Paste it to where your new Back Sprites table starts.
  • Repoint all references of the Back Sprites table to the new table. Replace all B8 28 30 08 to the pointer of your new table. Also check if it have done 15 occurences.
  • If you want to erase the old data to have new spaces, navigate back to 0x083028B8 to the Back Sprites table. Select 3520 bytes (0xDC0 bytes) of data. Then, fill it with "FF".
  • At 0x080346D6, put 07 E0.
  • At 0x08034AC2, put 07 E0. These will break the limiters from preventing sprites for showing up,

Part 6: Normal Palette
  • The current Normal Palette table is at 0x08303678.
  • The Normal Palette table has 8 bytes each Pokemon (a table of pointers with filler bytes). Noted that the filler bytes are important in this, see the animation explanation on step .
  • Go to a free space to create a new Normal Palette table.
  • Create a new Normal Palette table there. Multiply your desired new slots of Pokémon by 8.
  • Select blocks and the type the length with the number of the result (mine is 8640 in decimal or 0x21C0 hexadecimal). Then fill the selection with "E0 0B C0 08 00 00 00 00". There you go! You got your new table.
  • Navigate to 0x08303678 to the Normal Palette table.
  • Select and copy 3520 bytes (0xDC0 bytes) of data.
  • Paste it to where your new Normal Palette table starts.
  • Repoint all references of the Normal Palette table to the new table. Replace all 78 36 30 08 to the pointer of your new table. Also check if it have done 5 occurences.
  • If you want to erase the old data to have new spaces, navigate back to 0x08303678 to the Normal Palette table. Select 3520 bytes (0xDC0 bytes) of data. Then, fill it with "FF".

Part 7: Shiny Palette
  • The current Shiny Palette table is at 0x08304438.
  • The Shiny Palette table has 8 bytes each Pokemon (a table of pointers with filler bytes). Noted that the filler bytes are important in this, see the animation explanation on step .
  • Go to a free space to create a new Shiny Palette table.
  • Create a new Shiny Palette table there. Multiply your desired new slots of Pokémon by 8.
  • Select blocks and the type the length with the number of the result. Then fill the selection with "F8 0B C0 08 F4 01 00 00". There you go! You got your new table.
  • Navigate to 0x08304438 to the Shiny Palette table.
  • Select and copy 3520 bytes (0xDC0 bytes) of data.
  • Paste it to where your new Shiny Palette table starts.
  • Repoint all references of the Shiny Palette table to the new table. Replace all 38 44 30 08 to the pointer of your new table. Also check if it have done 3 occurences.
  • If you want to erase the old data to have new spaces, navigate back to 0x08304438 to the Shiny Palette table. Select 3520 bytes (0xDC0 bytes) of data. Then, fill it with "FF".
  • At 0x0806E750, put 04 E0. This break the limiter on the palette table.

Part 8: Player Y
  • The current Player Y table is at 0x083021D8.
  • The Player Y table has 4 bytes each Pokemon.
  • Go to a free space to create a new Player Y table.
  • Create a new Player Y table there. Multiply your desired new slots of Pokémon by 8.
  • Select blocks and the type the length with the number of the result. Then fill the selection with "88 00 00 00". There you go! You got your new table.
  • Navigate to 0x083021D8 to the Player Y table.
  • Select and copy 1760 bytes (0x6E0 bytes) of data.
  • Paste it to where your new Player Y table starts.
  • Repoint all references of the Player Y table to the new table. Replace all D8 21 30 08 to the pointer of your new table. Also check if it have done 11 occurences.
  • If you want to erase the old data to have new spaces, navigate back to 0x083021D8 to the Player Y table. Select 1760 bytes (0x6E0 bytes) of data. Then, fill it with "FF".

Part 9: Enemy Y
  • The current Enemy Y table is at 0x08300D38.
  • The Enemy Y table has 4 bytes each Pokemon.
  • Go to a free space to create a new Enemy Y table.
  • Create a new Enemy Y table there. Multiply your desired new slots of Pokémon by 8.
  • Select blocks and the type the length with the number of the result. Then fill the selection with "88 00 00 00". There you go! You got your new table.
  • Navigate to 0x08300D38 to the Enemy Y table.
  • Select and copy 1760 bytes (0x6E0 bytes) of data.
  • Paste it to where your new Enemy Y table starts.
  • Repoint all references of the Enemy Y table to the new table. Replace all 38 0D 30 08 to the pointer of your new table. Also check if it have done 15 occurences.
  • If you want to erase the old data to have new spaces, navigate back to 0x08300D38 to the Enemy Y table. Select 1760 bytes (0x6E0 bytes) of data. Then, fill it with "FF".

Part 10: Altitude
  • The current Altitude table is at 0x08305DCC.
  • The Altitude table has 1 byte each Pokemon.
  • Go to a free space to create a new Altitude table.
  • Create a new Altitude table there. Multiply your desired new slots of Pokémon by 1.
  • Select blocks and the type the length with the number of the result. Then fill the selection with "00". There you go! You got your new table.
  • Navigate to 0x08305DCC to the Altitude table.
  • Select and copy 440 bytes (0x1B8 bytes) of data.
  • Paste it to where your new Altitude table starts.
  • Repoint all references of the Altitude table to the new table. Replace all CC 5D 30 08 to the pointer of your new table. Also check if it have done 4 occurences.
  • If you want to erase the old data to have new spaces, navigate back to 0x08305DCC to the Altitude table. Select 440 bytes (0x1B8 bytes) of data. Then, fill it with "FF".
  • At 0x080A5F82, put 03 E0.
  • At 0x080A5EB6, put 03 E0. These break limiters, allowing these tables to be read.

Part 11: Icons
  • The current Icons table is at 0x0857BCA8.
  • The Icons table has 4 bytes each Pokemon.
  • Go to a free space to create a new Icons table.
  • Create a new Icons table there. Multiply your desired new slots of Pokémon by 4.
  • Select blocks and the type the length with the number of the result. Then fill the selection with "A0 FF C2 08". There you go! You got your new table.
  • Navigate to 0x0857BCA8 to the Icons table.
  • Select and copy 1760 bytes (0x6E0 bytes) of data.
  • Paste it to where your new Icons table starts.
  • Repoint all references of the Icons table to the new table. Replace all A8 BC 57 08 to the pointer of your new table. Also check if it have done 2 occurences.
  • If you want to erase the old data to have new spaces, navigate back to 0x0857BCA8 to the Icons table. Select 1760 bytes (0x6E0 bytes) of data. Then, fill it with "FF".

Part 12: Icon Palette Control
  • The current Icon Palette Control table is at 0x0857C388.
  • The Icon Palette Control table has 1 byte each Pokemon. This one controls on which one of the three sets of palette that the icon sprite should use.
  • Go to a free space to create a new Icon Palette Control table.
  • Create a new Icon Palette Control table there. Multiply your desired new slots of Pokémon by 1.
  • Select blocks and the type the length with the number of the result. Then fill the selection with "00". There you go! You got your new table.
  • Navigate to 0x0857C388 to the Icon Palette Control table.
  • Select and copy 440 bytes (0x1B8 bytes) of data.
  • Paste it to where your new Icon Palette Control table starts.
  • Repoint all references of the Icon Palette Control table to the new table. Replace all 88 C3 57 08 to the pointer of your new table. Also check if it have done 12 occurences.
  • If you want to erase the old data to have new spaces, navigate back to 0x0857C388 to the Icon Palette Control table. Select 440 bytes (0x1B8 bytes) of data. Then, fill it with "FF".
  • At 0x080D2E3A, put 01 E0.
  • At 0x080D2D20, put 00 00 00 00. This should fix the icon palettes.

Part 13: TM Compatibility
  • The current TM Compatibility table is at 0x0831E898.
  • The TM Compatibility table has 8 bytes each Pokemon.
  • Go to a free space to create a new TM Compatibility table.
  • Create a new TM Compatibility table there. Multiply your desired new slots of Pokémon by 8.
  • Select blocks and the type the length with the number of the result. Then fill the selection with "00". There you go! You got your new table.
  • Navigate to 0x0831E898 to the TM Compatibility table.
  • Select and copy 3296 bytes (0xCE0 bytes) of data.
  • Paste it to where your new TM Compatibility table starts.
  • Repoint all references of the TM Compatibility table to the new table. Replace all 98 E8 31 08 to the pointer of your new table. Also check if it have done 4 occurences.
  • If you want to erase the old data to have new spaces, navigate back to 0x0831E898 to the TM Compatibility table. Select 3296 bytes (0xCE0 bytes) of data. Then, fill it with "FF".

Part 14: Tutor Compatibility
  • The current Tutor Compatibility table is at 0x08615048.
  • The Tutor Compatibility table has 4 bytes each Pokemon.
  • Go to a free space to create a new Tutor Compatibility table.
  • Create a new Tutor Compatibility table there. Multiply your desired new slots of Pokémon by 4.
  • Select blocks and the type the length with the number of the result. Then fill the selection with "00". There you go! You got your new table.
  • Navigate to 0x08615048 to the Tutor Compatibility table.
  • Select and copy 1648 bytes (0x670 bytes) of data.
  • Paste it to where your new Tutor Compatibility table starts.
  • Repoint all references of the Tutor Compatibility table to the new table. Replace all 48 50 61 08 to the pointer of your new table. Also check if it have done 1 occurence. The only pointer is at 0x081B2390.
  • If you want to erase the old data to have new spaces, navigate back to 0x08615048 to the Tutor Compatibility table. Select 1648 bytes (0x670 bytes) of data. Then, fill it with "FF".

Part 15: Evolutions
  • The current Evolutions table is at 0x0832531C.
  • The Evolutions table has 40 bytes (0x28 bytes) each Pokemon if you are having 5 evolutions per Pokemon. If you have 8, that would be 64 bytes (0x40 bytes). Since the default is 5, let's use 5.
  • Go to a free space to create a new Evolutions table.
  • Create a new Evolutions table there. Multiply your desired new slots of Pokémon by 40 (0x28). If you already had the evolutions by 8, multiply instead to 64 (0x40).
  • Select blocks and the type the length with the number of the result. Then fill the selection with "00". There you go! You got your new table.
  • Navigate to 0x0832531C to the Evolutions table.
  • Select and copy 16480 bytes (0x4060 bytes) of data.
  • Paste it to where your new Evolutions table starts.
  • Repoint all references of the Evolutions table to the new table. Replace all 1C 53 32 08 to the pointer of your new table. Also check if it have done 6 occurences.
  • If you want to erase the old data to have new spaces, navigate back to 0x0832531C to the Evolutions table. Select 16480 bytes (0x4060 bytes) of data. Then, fill it with "FF".

Part 16: Footprints
  • The current Footprints table is at 0x0856E694.
  • The Footprints table has 4 bytes each Pokemon. This is a table of pointers.
  • Go to a free space to create a new Footprints table.
  • Create a new Footprints table there. Multiply your desired new slots of Pokémon by 4.
  • Select blocks and the type the length with the number of the result. Then fill the selection with "A0 03 C3 08", or "F0 74 C3 08" if you want every footprint to be empty. There you go! You got your new table.
  • Navigate to 0x0856E694 to the Footprints table.
  • Select and copy 1652 bytes (0x674 bytes) of data.
  • Paste it to where your new Footprints table starts.
  • Repoint all references of the Footprints table to the new table. Replace all 94 E6 56 08 to the pointer of your new table. Also check if it have done 1 occurence.
  • If you want to erase the old data to have new spaces, navigate back to 0x0856E694 to the Footprints table. Select 1652 bytes (0x674 bytes) of data. Then, fill it with "FF".

Part 17: Cry Table
  • The first Cry Table is at 0x0869DCF4. This controls the normal cries like sent out in battle, summary, or the cry in Pokedex.
  • The first Cry Table has 12 bytes (0xC bytes) each Pokemon.
  • Go to a free space to create a new first Cry Table table.
  • Create a new first Cry Table there. Multiply your desired new slots of Pokémon by 12 (0xC).
  • Select blocks and the type the length with the number of the result. Then fill the selection with "20 3C 00 00 04 67 74 08 FF 00 FF 00". There you go! You got your new table.
  • Navigate to 0x0869DCF4 to the first Cry Table.
  • Select and copy 4656 bytes (0x1230 bytes) of data.
  • Paste it to where your new first Cry Table starts.
  • Repoint all references of the first Cry Table to the new table. Replace all F4 DC 69 08 to the pointer of your new table. Also check if it have done 1 occurrence (the only pointer is at 0x080A35EC)
  • If you want to erase the old data to have new spaces, navigate back to 0x0869DCF4 to the first Cry Table. Select 4656 bytes (0x1230 bytes) of data. Then, fill it with "FF".

Part 18: Cry Table 2 (used for moves like Growl/Roar)
  • The second Cry Table is at 0x0869EF24. This controls for moves like Growl and Roar.
  • The second Cry Table table has 12 bytes (0xC bytes) each Pokemon.
  • Go to a free space to create a new second Cry Table.
  • Create a new second Cry Table there. Multiply your desired new slots of Pokémon by 12 (0xC).
  • Select blocks and the type the length with the number of the result. Then fill the selection with "30 3C 00 00 04 67 74 08 FF 00 FF 00". There you go! You got your new table.
  • Navigate to 0x0869EF24 to the second Cry Table.
  • Select and copy 4656 bytes (0x1230 bytes) of data.
  • Paste it to where your new second Cry Table starts.
  • Repoint all references of the second Cry Table table to the new table. Replace all 24 EF 69 08 to the pointer of your new table. Also check if it have done 1 occurrence (the only pointer is at 0x080A35DC)
  • If you want to erase the old data to have new spaces, navigate back to 0x0869EF24 to the second Cry Table. Select 4656 bytes (0x1230 bytes) of data. Then, fill it with "FF".

Part 19: Auxillary Cry Table
  • The current Auxillary Cry table is at 0x0831F61C. This controls for moves like Growl and Roar.
  • The Auxillary Cry table has 2 bytes each Pokemon.
  • Go to a free space to create a new Auxillary Cry table.
  • Create a new Auxillary Cry table there. Multiply your desired new slots of Pokémon by 2.
  • Select blocks and the type the length with the number of the result. Then fill the selection with "00 00". There you go! You got your new table.
  • Navigate to 0x0831F61C to the Auxillary Cry table.
  • Select and copy 270 bytes (0x10E bytes) of data.
  • Paste it to where your new Auxillary Cry table starts.
  • Repoint all references of the Auxillary Cry table to the new table. Replace all 1C F6 31 08 to the pointer of your new table. Also check if it have done 1 occurrence (the only pointer is at 0x0806D534)
  • If you want to erase the old data to have new spaces, navigate back to 0x0831F61C to the Auxillary Cry table. Select 270 bytes (0x10E bytes) of data. Then, fill it with "FF".


An explanation on how the Cry tables work, especially the Auxillary Cry table:
Spoiler:
There are actually two cry tables: the first one is for the summary, sent-out-in-battle, and the cry tab in the Pokedex; the second is for moves like Growl, Roar, and other sound-based moves that plays the cry. Noted that the actual slot 0 isn't here.

The both tables have this format each slot:

XX 3C 00 00 YY YY YY 08 FF 00 FF 00

XX is which format of audio should play, if it is compressed, uncompressed, or sound-based moves. From what I have seen:
00: uncompressed, just normal
20: compressed, importing something like this isn't available at this moment
30: uncompressed, mostly used for the second table
I just don't know what these really are but apparently, someone would have understood it better.
YY YY YY 08 is the offset of the cry, inserted cry. A tutorial out there provides you a guide to insert cries:

For the new cries you will be inserting for new slots, it will be 4656 (0x1230) bytes away from the start of the table or at new added slots 388 (0x184) and higher. For XX-s, use 00 for the first table, and use 30 for the second table.

The Auxillary Cry table starts at the 277th slot which is Treecko and right after the limbo slots between Celebi and Treecko. The alignment of this table depends on the actual Pokemon slots starting from slot 277 (Treecko). If you set a 2-byte digit in a slot of the Auxillary Cry Table, it will read a certain slot back at the actual Cry tables. Example: If you have placed 0x0110 "11 01" at Treecko's slot at the Auxillary Cry Table, then it will read the 273rd (0x110th) slot at the actual Cry tables. For expanded Pokemon, most likely, you will start out for the 440th slot which is at the 164th slot of the Auxillary Cry table (146 (0xA3) * 2 = 326 (0x146) bytes away from the start of the table). Most likely, you would place 0x0184 "84 01" at that slot because again, the new slots of Cry tables are at the 389th slot of the Cry tables.



Step 4: Dealing with Dex Entries
Spoiler:
Part 1: National Dex
  • The current National Dex table is at 0x0831DC82.
  • The National Dex table has 2 bytes each Pokemon.
  • Go to a free space to create a new National Dex table.
  • Create a new National Dex table there. Multiply your desired new slots of Pokémon by 2.
  • Select blocks and the type the length with the number of the result. Then fill the selection with "E7 03" or "00". There you go! You got your new table.
  • Navigate to 0x0831DC82 to the National Dex table.
  • Select and copy 822 bytes (0x336 bytes) of data.
  • Paste it to where your new National Dex table starts.
  • Repoint all references of the National Dex table to the new table. Replace all 82 DC 31 08 to the pointer of your new table. Also check if it have done 2 occurences.
  • If you want to erase the old data to have new spaces, navigate back to 0x0831DC82 to the National Dex table. Select 822 bytes (0x336 bytes) of data. Then, fill it with "FF".

This is how the National Dex table works:
Spoiler:
The National Pokedex Table's slots depends on the number of slots of your Pokemon. Noted that this list doesn't include the slot 0 so, everytime you will look for a slot, it will be minus 1 then multiply by 2 (example: Luxray is at slot number 458 so, its National Pokedex slot is at on the 458th 2-byte slot of the table (that means 457 * 2 bytes from the start of the table)). Then, if you want to put Luxray at number 405 on the Pokedex listing, put 95 01 there.


Part 2: Hoenn Dex (Pokedex)
  • The current Hoenn Dex (Pokedex) table is at 0x0831DFB8.
  • The Hoenn Dex (Pokedex) table has 2 bytes each Pokemon.
  • Go to a free space to create a new Hoenn Dex (Pokedex) table.
  • Create a new Hoenn Dex (Pokedex) table there. Multiply your desired new slots of Pokémon by 2.
  • Select blocks and the type the length with the number of the result. Then fill the selection with "E7 03" or "00". There you go! You got your new table.
  • Navigate to 0x0831DFB8 to the Hoenn Dex (Pokedex) table.
  • Select and copy 822 bytes (0x336 bytes) of data.
  • Paste it to where your new Hoenn Dex (Pokedex) table starts.
  • Repoint all references of the Hoenn Dex (Pokedex) table to the new table. Replace all B8 DF 31 08 to the pointer of your new table. Also check if it have done 2 occurences.
  • If you want to erase the old data to have new spaces, navigate back to 0x0831DFB8 to the Hoenn Dex (Pokedex) table. Select 822 bytes (0x336 bytes) of data. Then, fill it with "FF".

This is how the Hoenn Dex (Pokedex) table works:
Spoiler:
The first Hoenn Pokedex Table (which is at 0x0831DFB8) controls the list of the regional Pokedex (Hoenn Dex mode). Unlike the National Pokedex Table which the order controls slot by slot, this one is ordered number by number (that means slot 1 and slot 2 are numbers 001 and 002 respectively in the dex number). The digit you will be putting on slots is the Pokedex number of the Pokemon (not the slot number this time). For example: you want to have Turtwig to be in regional Pokedex number 001. Only you need to do is to have its National Pokedex number which is 387 to be placed on the first slot so, put 83 01 on the first slot.

Another example: You want to have Giratina this time on 210. If its National Pokedex number is 487, then at slot 210 which is at 209 * 2 bytes from the start of the table, put E7 01 there.


Part 3: Hoenn Dex (Summary)
  • The current Hoenn Dex (Summary) table is at 0x0831D94C.
  • The Hoenn Dex (Summary) table has 2 bytes each Pokemon.
  • Go to a free space to create a new Hoenn Dex (Summary) table.
  • Create a new Hoenn Dex (Summary) table there. Multiply your desired new slots of Pokémon by 2.
  • Select blocks and the type the length with the number of the result. Then fill the selection with "E7 03" or "00". There you go! You got your new table.
  • Navigate to 0x0831D94C to the Hoenn Dex (Summary) table.
  • Select and copy 822 bytes (0x336 bytes) of data.
  • Paste it to where your new Hoenn Dex (Summary) table starts.
  • Repoint all references of the Hoenn Dex (Summary) table to the new table. Replace all 4C D9 31 08 to the pointer of your new table. Also check if it have done 2 occurences.
  • If you want to erase the old data to have new spaces, navigate back to 0x0831D94C to the Hoenn Dex (Summary) table. Select 822 bytes (0x336 bytes) of data. Then, fill it with "FF".

This is how the Hoenn Dex (Summary) table works:
Spoiler:
The second Hoenn Pokedex Table (which is at 0x0831D94C) controls the list of the regional Pokedex number to be displayed on Pokemon's summary prior obtaining the National Dex. This time, it is controlled slot by slot, minus 1 because the slot 0 is also never included here. To look for its slot, minus 1 then multiply by 2. For example: You want to have Giratina's regional number is 210 and its data is at slot 540. Look for the slot 540 in the table which is 539 * 2 from the start of the table then put D2 00 there (0x00D2 is 210 in hex).


Part 4: Pokedex Entries
  • The current Pokedex Entries table is at 0x0856B5B0.
  • The Pokedex Entries table has 32 (0x20) bytes each Pokemon. The table is aligned in the actual Pokedex order.
  • Go to a free space to create a new Pokedex Entries table.
  • Create a new Pokedex Entries table there. Multiply your desired new slots of Pokémon by 32 (0x20).
  • Select blocks and the type the length with the number of the result. Then fill the selection with "CF E2 DF E2 E3 EB E2 FF 00 00 00 00 00 00 00 00 0D D3 55 08 00 00 00 01 00 00 00 01 00 00 00 00". There you go! You got your new table.
  • Navigate to 0x0856B5B0 to the Pokedex Entries table.
  • Select and copy 12384 bytes (0x3060 bytes) of data.
  • Paste it to where your new Pokedex Entries table starts.
  • Repoint all references of the Pokedex Entries table to the new table. Replace all B0 B5 56 08 to the pointer of your new table. Also check if it have done 8 occurences.
  • If you want to erase the old data to have new spaces, navigate back to 0x0856B5B0 to the Pokedex Entries table. Select 12384 bytes (0x3060 bytes) of data. Then, fill it with "FF".

Now there’s a whole bunch of other things we need to do to get the dex working. We’ll get to that later.


Step 5: Explanation of how Pokémon animations work in Emerald
Spoiler:
As you all know, in Pokémon Emerald, every Pokémon has a two-frame animation that displays went sent out in-battle, and in the SUMMARY screen. Let me first explain how the table works.

First of all, each Pokémon has two frames in their animation (except Unown, Spinda, Castform, and Deoxys). Each Pokémon is also assigned an animation number, which is handled separately from how its frames are displayed. There is a table controlling how it switches between frames, and there is another table controlling how it animates (rotation/scaling, etc.).

Starting at 0x08309AAC and ending at 0x0830A18B is a table. This table is 4 bytes per mon. Each entry in the table is a pointer to part of another table, which starts at 0x08308CBC. At 0x08308CBC is ANOTHER table, this time its 8 bytes per mon (2 pointers per mon). I’m not 100% on how exactly it works, but these pointers point to the code that determines how the frames are switched during its animation.

As for the actual movement part of the animation, it is handled by a table at 0x083299EC, for the ront sprites. The table is one byte per mon. There is another table at 0x0860A8C8. This table is also one byte per mon. Both use the same set of animations, however, the indexes that reference the animations are used differently in the back sprite animation table.


A Choice Point!
At the point, you have read on how the animations work, right? Now, decide: you will disable it or not? It is up to you. Continue at Step 6A if you want to maintain the animations. Or, continue at Step 6B if you want to disable the animations. Either way, after these, you will continue at Step 7.

Step 6A: Expanding Pokémon animations
Spoiler:
Part 1: Front Animations
  • The current Front Animations table is at 0x083299EC.
  • The Front Animations table has 1 byte each Pokemon
  • Go to a free space to create a new Front Animations table.
  • Create a new Front Animations table there. Multiply your desired new slots of Pokémon by 1.
  • Select blocks and the type the length with the number of the result. Then fill the selection with "00". There you go! You got your new table.
  • Navigate to 0x083299EC to the Front Animations table.
  • Select and copy 440 bytes (0x1B8 bytes) of data.
  • Paste it to where your new Front Animations table starts.
  • Repoint all references of the Front Animations table to the new table. Replace all EC 99 32 08 to the pointer of your new table. Also check if it have done 4 occurences.
  • If you want to erase the old data to have new spaces, navigate Front to 0x083299EC to the Front Animations table. Select 440 bytes (0x1B8 bytes) of data. Then, fill it with "FF".

Part 2: Back Animations
  • The current Back Animations table is at 0x0860A8C8.
  • The Back Animations table has 1 byte each Pokemon
  • Go to a free space to create a new Back Animations table.
  • Create a new Back Animations table there. Multiply your desired new slots of Pokémon by 1.
  • Select blocks and the type the length with the number of the result. Then fill the selection with "00". There you go! You got your new table.
  • Navigate to 0x0860A8C8 to the Back Animations table.
  • Select and copy 440 bytes (0x1B8 bytes) of data.
  • Paste it to where your new Back Animations table starts.
  • Repoint all references of the Back Animations table to the new table. Replace all C8 A8 60 08 to the pointer of your new table. Also check if it have done 1 occurence.
  • If you want to erase the old data to have new spaces, navigate back to 0x0860A8C8 to the Back Animations table. Select 440 bytes (0x1B8 bytes) of data. Then, fill it with "FF".

Part 3: Frame Switching
  • The current Frame Switching table is at 0x08309AAC.
  • The Frame Switching table has 4 byte each Pokemon. This is a table of pointers.
  • Go to a free space to create a new Frame Switching table.
  • Create a new Frame Switching table there. Multiply your desired new slots of Pokémon by 4.
  • Select blocks and the type the length with the number of the result. Then fill the selection with "BC 8C 30 08". There you go! You got your new table.
  • Navigate to 0x08309AAC to the Frame Switching table.
  • Select and copy 1760 bytes (0x6E0 bytes) of data.
  • Paste it to where your new Frame Switching table starts.
  • Repoint all references of the Frame Switching table to the new table. Replace all AC 9A 30 08 to the pointer of your new table. Also check if it have done 5 occurences.
  • If you want to erase the old data to have new spaces, navigate Front to 0x08309AAC to the Frame Switching table. Select 1760 bytes (0x6E0 bytes) of data. Then, fill it with "FF".
  • Back at Normal Palette table, after every pointer, place "XX XX". XX XX is a digit ranging 0x0000 until 0x01B7. This also depends on how the frames switch during animation. You may not need to do this now. You may do this later when you will set animation indexes to Pokemon.
  • Back at Shiny Palette table, after every pointer, place "XX XX". XX XX is a digit ranging 0x01F4 until 0x03AB. This also depends on how the frames switch during animation for Shiny Pokemon. You may do this later when you will set animation indexes to Pokemon.

Part 4: Animation Timing
  • The current Animation Timing table is at 0x08329B87.
  • The Animation Timing table has 1 byte each Pokemon.
  • Go to a free space to create a new Animation Timing table.
  • Create a new Animation Timing table there. Multiply your desired new slots of Pokémon by 1.
  • Select blocks and the type the length with the number of the result. Then fill the selection with "00". There you go! You got your new table.
  • Navigate to 0x08329B87 to the Animation Timing table.
  • Select and copy 412 bytes (0x1B8 bytes) of data.
  • Paste it to where your new Animation Timing table starts.
  • Repoint all references of the Animation Timing table to the new table. Replace all 87 9B 32 08 to the pointer of your new table. Also check if it have done 2 occurences.
  • If you want to erase the old data to have new spaces, navigate Front to 0x08329B87 to the Animation Timing table. Select 412 bytes (0x1B8 bytes) of data. Then, fill it with "FF".
  • At 0x08034BFE, put 07 E0. This breaks the limiter for animating sprites.
  • At 0x080A5FEE, put 03 E0. This breaks another limiter .


Step 6B: Disabling Pokémon animations
Spoiler:
Let’s be real here. No one is going to sprite 2 frames for the 300+ Pokémon that make up Generations IV, V, and VI. If you want to disable animations to behave just like Ruby and FireRed, this will make disabling the animations a part of this tutorial.

18080C: 10 B5 02 48 E0 61 10 BC 01 BC 00 47 15 07 18 08 (this will overwrite animation #00 with a blank animation)

Starting at 0x083299EC and ending at 0x08329B87 is the front sprite animation table. Create a table at any free space available which size is your new number of slots (example: you have 880 slots so, you need to highlight 880 (0x370) bytes). Then, fill the selection with 00. Repoint all references of this table to the new table. Replace all EC 99 32 08 to the pointer of your new table. In case you want to delete old data, highlight 0x083299EC until 0x08329B87, and fill it with FF.

308CC0: 38 F5 2F 08

Starting at 0x08309AAC and ending at 0x0830A11B is the frame control table. Create a table at any free space available which size is your new number of slots times 4 (example: you have 880 slots so, you need to highlight 880 * 4 (0x370 * 4) = 3520 (0xDC0) bytes). Then, fill the selection with BC 8C 30 08. Repoint all references of this table to the new table. Replace all AC 9A 30 08 to the pointer of your new table. In case you want to delete old data, highlight 0x08309AAC until 0x0830A11B, and fill it with FF.

6EE38: 00 00
6ECC4: 01 28

Starting at 0x0860A8C8 and ending at 0x0860AA63 is the back sprite animation table. Create a table at any free space available which size is your new number of slots (example: you have 880 slots so, you need to highlight 880 (0x370) bytes). Then, fill the selection with 00. Repoint all references of this table to the new table. Replace all C8 A8 60 08 to the pointer of your new table. In case you want to delete old data, highlight 0x0860A8C8 until 0x0860AA63, and fill it with FF.

Starting at 0x0860ACE4 and ending at 0x0860AD2E is the index list of animations that back sprites may use. Change every byte here to 00. I think it should work fine if you just change the first two bytes, but it won’t hurt to just make it all 00. You do not have to repoint this, as this table is not related to how many Pokémon there are.

Test. The Pokémon sprites should not animate, and should behave exactly as they do in Ruby/Sapphire and FireRed/LeafGreen.


Step 7: Dex-related byte changes
Spoiler:
Make the following byte changes:
C06FC: 11 48
C06AA: 10 48
C06BE: 3E E0
C07D8: 05 49
C079C: 0A 49
BB6AC: 00 20
6D42C: 00 00 (dex limiter)

If you have more than 510 Pokémon:
BC91A: 5D 21 C9 00

If you have less than 510 Pokémon:
BC91A: XX (XX = dex length / 2)


Step 8: Changing lsl operations to make scrolling and other things work properly
Spoiler:
If you don't want to do this part, download the patch on the attachment below. It is a patch that will make Steps 8, 9, and 10 to be done easily. If you patched, then go immediately to Step 11. And make sure you back-up your ROM before using the patch for fail safe. But, I more recommend to do this manually instead of patching.

BB42C: 12 01
BD87C: 09 01
BD54C: 12 01
BD4B0: 09 01

BD5B8: 2D 01
BD082: 12 01
BD57E: 1B 01
BCF9E: 09 01

BCFBA: 09 01
BCFDC: 1B 01
BCFFE: 12 01
BD01A: 12 01
BB456: 12 01
BD3B8: 12 01

BD826: 09 01
BD844: 1B 01

BD02A: 12 01
BD044: 09 01
BD05E: 09 01

BBD8C: 12 01
BBDBA: 1B 01

BC42E: 1B 01

BB8CA: 09 01
BBABE: 12 01
BBBA8: 24 01
BBBD4: 12 01
BBF96: 09 01
BC140: 09 01
BC288: 1B 01
BC2B4: 12 01
BE892: 09 01

BC4CE: 1B 01
C1808: 12 01
C23F2: 1B 01

Note at this point the Pokédex should freeze the game upon opening, as there are still some things we need to take care of.


Back-up Point!
Also make sure you guys back up your ROM before doing the following steps. The very nature of how Step 9 is handled is almost sure to overwite a couple bytes or so that aren't actually constants. Eventually I plan on optimizing it so that we only overwrite bytes that are confirmed to be necessary. I mean, the current implementation of it works but the whole game hasn't been tested thoroughly, so we don't know for sure yet if this will overwrite something that's not actually related to the Pokédex routines. That is why I say use this at your own risk. The reason why I posted this tutorial at this stage is because the more people test this out, the faster we can find any problems that occur.

Step 9: Massive byte changes to make scrolling and other things work properly
Spoiler:
If you don't want to do this part, download the patch on the attachment below. It is a patch that will make Steps 8, 9, and 10 to be done easily. If you patched, then go immediately to Step 11. And make sure you back-up your ROM before using the patch for fail safe. But, I more recommend to do this manually instead of patching.

Open up your Emerald ROM in a hex editor with a Search & Replace function.
Go to offset 0x08000000. Using the search & replace function:
Search: 81 01 00 00
Replace: E7 02 00 00
Do this for the first 29 occurances in the ROM.

Now go back to offset 0x08000000.
Search: 9B 01 00 00
Replace: 0D 03 00 00
Do the for the first 10 occurances in the ROM.

Now we are going to replace well over 100 constants.
Go to offset 0x080BB6AC. Starting at 0x080BB6AC but ending before 0x080C5000:
Search: 06 00 00
Replace: 0D 00 00.
Make sure you stop replacing around the C5000 mark! Alternatively for that last part, you could just use this Python script instead (credit to karatekid552):
Code:

start = 0xBB6AC
end = 0xC5000
rom_path = "insert file path to GBA ROM here"
search = "\x06\x00\x00"
replace = "\x0D\x00\x00"
with open(rom_path, "r+b") as rom:
    rom.seek(start)
    read = rom.read(end-start)
    write = ""
    start_search = 0
    while True:
        find = read.find(search, start_search)
        if find == -1:
            write += read[start_search:]
            break
        else:
            write += read[start_search:find]+replace
            start_search = (3+find)
            print start_search, "|", find
    rom.seek(start)
    rom.write(write)




Step 10: Fix Castform, other glitches, and misc necessary byte changes
Spoiler:
If you don't want to do this part, download the patch on the attachment below. It is a patch that will make Steps 8, 9, and 10 to be done easily. If you patched, then go immediately to Step 11. And make sure you back-up your ROM before using the patch for fail safe. But, I more recommend to do this manually instead of patching.

The massive byte changes we did in Step 9 also corrupts Castform's weather forms, so we need to go back and fix those. Simply make these byte changes:
42730: 81 01
5DF10: 81 01
6F100: 81 01
A5EA4: 81 01

B1C30: 81 01 (this fixes the encounter music number 8 because 0x181 is the music number of the swimmer theme)

A35A2: 01 1C 11 E0

34A16: 07 E0

And now we're good to go!


Step 11: Fix this one glitch
Spoiler:
This one deals with a glitch where Ivysaur would appear where Luxray (I think) was supposed to be in the dex. Had something to do with some missing RAM calculation offset. To fix that, insert this routine into free space:
Code:

.text
.align 2
.thumb
.thumb_func
.global positionfix

main:
push {r0-r3}
ldr r0, .FirstCheck
ldrb r0, [r0]
mov r1, #0xFF
cmp r0, r1 /*compares .FirstCheck value to FF. If not, you're outside*/
bne Outside
b Inside

Inside:
ldr r0, .Counter1Inside
ldrb r0, [r0]
ldr r1, .Counter2Inside
ldrb r1, [r1]
cmp r0, r1
bne next1
b End

next1:
mov r2, #0x0
ldr r3, .FinalPosInside
strh r2, [r3]
b End

Outside:
ldr r0, .Counter1Outside
ldrb r0, [r0]
ldr r1, .Counter2Outside
ldrb r1, [r1]
cmp r0, r1
bne next2
b End

next2:
mov r2, #0x0
ldr r3, .FinalPosOutside
strh r2, [r3]
b End

End:
pop {r0-r3}
ldr r0, .NextRoutine
str r0, [r6]
pop {r4-r7}
pop {r0}
bx r0

.align
.FirstCheck: .word 0x02000D1C
.Counter1Inside: .word 0x02000F9E
.Counter2Inside: .word 0x02000FA0
.FinalPosInside: .word 0x02000F9A

.Counter1Outside: .word 0x02000D22
.Counter2Outside: .word 0x02000D24
.FinalPosOutside: .word 0x02000D1E

.NextRoutine: .word 0x080C1D39


Here's the compiled version of the ASM routine:
Code:

0F B4 11 48 00 78 FF 21 88 42 0B D1 FF E7 0F 48
00 78 0F 49 09 78 88 42 00 D1 0E E0 00 22 0D 4B
1A 80 0A E0 0C 48 00 78 0C 49 09 78 88 42 00 D1
03 E0 00 22 0A 4B 1A 80 FF E7 0F BC 09 48 30 60
F0 BC 01 BC 00 47 C0 46 1C 0D 00 02 9E 0F 00 02
A0 0F 00 02 9A 0F 00 02 22 0D 00 02 24 0D 00 02
1E 0D 00 02 39 1D 0C 08


Next, make these byte changes:
BBD94: 0E 4A
BBDD0: 9C 0F 00 02
C1808: 12 01
C1814: 00 48 00 47 XX XX XX 08 (XX XX XX is the offset of above routine +1)


Now test. If you did everything correctly, you should have a fully working Pokédex expansion on your Emerald ROM.

http://i.imgur.com/phHNWhE.png http://i.imgur.com/HhEzlEc.png

And, here a video tutorial made by LCCoolJ95 just in case you might want a visual aid on how anyone should be doing this:


This tutorial was just to get everything necessary for the Pokédex alone to work. The offsets for the tables that need to be expanded are listed here:
Spoiler:
Species Names = 3185C8
Front Sprite Table = 30A18C
Back Sprite Table = 3028B8
Front Palette Table = 303678
Shiny Palette Table = 304438
Base Stats = 3203CC
Moveset Pointers = 32937C
National Dex Order = 31DC82
Pokédex Data = 56B5B0
TM Compatibility = 31E898
Evolution Table = 32531C
Icon Sprite Table = 57BCA8
Icon Palette Table = 57C388
Main Cry Table = 69DCF4
Auxillary Cry Table = 31F61C
Footprint Table = 56E694
Move Tutor Compatib. = 615048
Animation Table = 3299EC
Frame Control Table = 309AAC
Back Animation Table = 60A8C8
EnemyY Table = 300D38
PlayerY Table = 3021D8
Enemy Altitude Table = 305DCC


Also one difference from FireRed is that there is no limiter to how high the Seen/Caught total is on the Save menu and on the Trainer Card.

Also some of my limiters for the altitude stuff may be wrong. If it is, and if there are any other problems, please report it. As I said earlier, use this at your own risk, as all this was discovered recently and there may be issues we don’t know about yet.

I would like to give a huuuuuuuuge thanks to SBird, who did it on a German Emerald ROM first. Without him, none of this would be possible. What I did was find the corresponding English ROM offsets, but as expected that didn’t work out perfectly, as there was a few operation codes I had to find on my own. Nonetheless, his advice helped a lot and pointed me in the right direction, so again, SBird deserves huuuuuuuuuuuge credit for this.

Also let me say this again, USE AT YOUR OWN RISK!!! I say this because during Step 8, there might be a few operation codes that I missed, and I alone can't test this out thoroughly. Karatekid552, if you're reading this, and if you're going to implement it into G3HS, I recommend you do it as a beta test type of thing. The main reason being, I only went up to 493 when I did this, so I don't know of any problems that may arise if one were to expand to 649 or 721.
(I believe 744 is the max that you can have in the Pokédex in Emerald, as it was the highest number that the Seen/Caught flags would register)

Credits:
  • SBird: for documenting it and just being awesome. For every credit you will make, you should add this guy on the credits. He is the real mastermind.
  • Chaos Rush: The former owner of this thread. He made almost everything to make the expansion working in an English Emerald ROM. I took over for the continuity and adding some improvements while he's away. The "fix this one glitch" ASM routine, and fixing Castform back.
  • diegoisawesome: I ripped the save block routine and the save table data from CrystalDust. Sorry :)
  • Doesn’tKnowHowToPlay: There was an inaccuracy in one of SBird’s notes and so I applied byte changes similarly to his FireRed implementation of it and got everything working. That and parts of this tutorial are copied word for word from his for the sake of continuity.
  • shinyquagsire: for documenting how Emerald animations work.
  • karatekid552: for his awesome G3HS tool, as well as for his Python script and just being an awesome dude.
  • LCCoolJ95: Finding the limiter for sprites during evolution, and for his wonderful video tutorial.
  • Artemis64: For giving his guide on how to expand the animations rather than disabling it.
  • Purple Orange: The Held Items fix to make it read the new base stat table to avoid expanded Pokemon from keep holding "????????" item when caught or received.

EDIT (2016/01/07): I've updated the patch that will make steps 8, 9, and 10 to be done. And, also make sure you backed-up your ROM before patching for failing purposes. But, I more recommend to do this manually instead of patching.

And now, Generation VII (and including Magearna) is now around. It will be yet to be revealed on how much Pokemon will add on. However, the current expansion only supports in a maximum number of 744. I've read notes of SBird and one of his notes says that it can be expanded to more than 744. I'll try and do some testing soon to make sure if still can go further. The bad news right now is the availability of PC Boxes/Storage in Gen III games (no idea how to expand it more but it will cause troublesome).

OronDF343 April 27th, 2014 7:01 AM

Great post! This is exactly what I needed, thanks!

Question:
Quote:

Originally Posted by Chaos Rush (Post 8218708)
Put YY 30 at x843A8, where YY is the number of bytes between the sets of flags. YY is probably the same as XX, but it doesn't have to be.

Do you mean the space between the sets of flags, in bytes? or the offset of the second set reative to the first?
I tried both, see no diff yet...

EDIT:
If you say there should be 40 pointers, and Search/Replace finds 132, is this ok? Am I doing it wrong?
I noticed you copied the numbers of pointers from the other guide.

EDIT2:
After preforming steps 1&2, I can't open the dex in game, and it displays the wrong number of either seen or caught.

HidoranBlaze April 27th, 2014 9:33 AM

Nice work Chaos!
I'll try to beta test this with 649 Pokemon. (cuz screw Kalos, I'm not inserting that many sprites)

Chaos Rush April 27th, 2014 9:45 AM

Quote:

Originally Posted by tURuI (Post 8219114)
EDIT2:
After preforming steps 1&2, I can't open the dex in game, and it displays the wrong number of either seen or caught.

That's exactly what's supposed to happen when you've only done those steps. That's why I removed some of Doesnt's text saying "Test and it should work" because it doesn't at that point on Emerald. You have to do the whole thing.

HidoranBlaze April 27th, 2014 11:34 AM

Quote:

Originally Posted by Chaos Rush (Post 8218708)
Be aware that I did not cover these fundamental changes:
*TM compatibility
*Move Tutor compatibility
*Evolution table
*Cry table
*Footprint table
I’m not covering these simply because karatekid552 already has these offsets for his tool, and one o the main reasons why I’m documenting this is so that karatekid552 can add Emerald Pokédex expansion support.

The cry conversion table isn't actually listed in Karatekid's ini (thehoenncryauxtable section) for Emerald. But it wasn't that hard to find. It's at 0x31F61C for BPEE.

EDIT: Looks like Gamer2020 found it a long time ago. I guess I just wasted 2 minutes of my time then :p

Chaos Rush April 27th, 2014 11:50 AM

Also make sure you guys back up your ROM before doing Step 9. The very nature of how Step 9 is handled is almost sure to overwite a couple bytes or so that aren't actually constants. Eventually I plan on optimizing it so that we only overwrite bytes that are confirmed to be necessary. I mean, the current implementation of it works but the whole game hasn't been tested thoroughly.

wael96 April 27th, 2014 12:33 PM

Thanks you for the work, a feature like expansion of pokedex is vey cool! BTW, how to find the RAM for the dex flags?

Chaos Rush April 27th, 2014 12:35 PM

Quote:

Originally Posted by wael96 (Post 8219598)
Thanks you for the work, a feature like expansion of pokedex is vey cool! BTW, how to find the RAM for the dex flags?

I used 0203D800 for the SEEN flags and 0203D860 for the CAUGHT flags.

I found a glitch: When viewing one of the search mode listings (A-Z, by type, smallest/largest, lightest/heaviest, color, etc.) and then going back to the main national listing, the list will appear blank. I'm 90% sure this can be fixed just by finding an lsl opcode that's related to it and adding +1 to it.
EDIT: To fix that, put 1B 01 at xBC42E. I have added it to the first post.

Chaos_Darkrai April 27th, 2014 1:47 PM

WOW! Just wanted to say, INCREDIBLE job on this, Chaos Rush! One question I have, though... How will the battle frontier work with the extended pokemon? Just a question, that, honestly, I am quite curious about!

SBird April 27th, 2014 2:07 PM

The reason why this only supports up to 744 Pokémon is actually this:

Search: 81 01 00 00
Replace: E7 02 00 00
Do this for the first 29 occurances in the ROM.

Now go back to offset x000000.
Search: 9B 01 00 00
Replace: 0D 03 00 00

I guess if you fiddle around with the numbers you should be able to add even more if you are crazy like that. The reason I chose 744 is because I ran into issues with higher numbers at first, but I guess those came from another set of global vars and would be easy to fix anyways. Keep in mind though if you really want to go further in terms of how many entries to place in the dex you also want to allocate more RAM via the malloc operation AND spare some space for the global variables, because neighter me nor chaos rush did calculate exactly how many places there are if you just add 0x700 or shift the bytes one more(which basically means a multiply of two so 0x600 becomes 0xC00)

So thats that, the first one controls how many entries are displayed by the way: 0x02E7 = 743(d), that makes 744 if you count entry zero.

~SBird

Chaos Rush April 27th, 2014 4:40 PM

Here are some offsets that may or may not be necessary (this would be part of Step 8 should it be confirmed that it's necessary):
080BB3BA: 12 01
080BB5AE: 1B 01
080BC42E: 1B 01 <--- fixes Search-related stuff
080BC4CE: 1B 01
080BF3BE: 1B 01
080BF59E: 1B 01
080BFB80: 09 01
080C17C6: 12 01
080C23F2: 1B 01

Chaos Rush April 27th, 2014 7:16 PM

I found and squashed another bug. The bug was that if you press START in the main Pokédex screen to make that small blue menu slide from the bottom (the one that says "BACK TO LIST/LIST TOP/LIST BOTTOM/CLOSE POKéDEX"), then Pokédex slot #405 (Luxray) would be overwritten with the last menu choice you had in that blue menu (basically it would show either Missingno, Bulbasaur, Ivysaur, or Venusaur where Luxray is supposed to be if you bring up the small blue menu by pressing START). This was because the RAM location of that menu variable conflicted with that of Luxray's slot on the Pokédex RAM. This is fixed by doing the following byte changes:
BB8CA: 09 01
BBABE: 12 01
BBBA8: 24 01
BBBD4: 12 01
BBF96: 09 01
BC140: 09 01
BC288: 1B 01
BC2B4: 12 01
BE892: 09 01
Again, added to the first post as well.

EDIT: Found and squashed yet ANOTHER bug. Make these byte changes in order to get the category listings to load correctly when highlighting "SHIFT" in the mode change menu:
BC4CE: 1B 01
C1808: 12 01
C23F2: 1B 01

EDIT: There is one last bug that I'm trying to squish. What happens is that the Pokédex doesn't remember the position you were at when you press SELECT to bring up the mode change menu, instead it will always bring you back to Bulbasaur (or Treecko if you're in Hoenn dex mode). The position you were at is held at 02000D1E (0200061E in a vanilla Emerald ROM). It should only be overwriting that offset with 0000 if you are switching between National and Hoenn, but for some reason it is always overwriting it with 0000 whether you switch or not. I don't know what's causing this, and I've tried looking into it but with little success. If someone can help me with this, I'd be very grateful, as this is the last final bug to squish before we have a seemingly perfect Pokédex expansion.

wael96 April 27th, 2014 10:54 PM

I am now facing the question which showed as pink color text... may you help me?

Put a pointer to whichever set of flags comes first at x843BC.(Does this mean" if I use the 0x0203D800, then I should type 00D80302 at 0x843BC?)
Put 20 1C 00 00 at x8439A.
Put XX 22 at x843A0, where XX is the number of bytes taken by your dex flags.[COLOR="rgb(255, 0, 255)"](sorry that I don't understand about the value "XX" Does this mean "number of dex entries- the answer is (number of dex entries)/8, rounded up." )[/COLOR]
Put 20 1C at x843A6.
Put YY 30 at x843A8, where YY is the number of bytes between the sets of flags. YY is probably the same as XX, but it doesn't have to be.
Put XX 22 at x843AC, where XX is the number of bytes taken by your dex flags.

Alternatively, instead of these byte changes, you can instead make an OW script that clears the dex with writebytetooffset, and make sure it runs before the player gets the Pokédex. Your choice.

Sniper April 27th, 2014 11:10 PM

Omg. This really awesome omg omg! :D I can finally put more x3

OronDF343 April 27th, 2014 11:24 PM

Quote:

Originally Posted by Chaos Rush (Post 8218708)
Starting at x309AAC and ending at x30A11B is a table. This table is 4 bytes per mon.

Are you sure this table ends at x30A11B? I found exactly 28 more pointers right after it, which means that they could be for slots 412-439 which are the alternate formes. The same could be true for the sprite animation tables. (It's not the same for the animation tables most likely)

EDIT1+2: Found Hoenn Dex Order. It's at x31DFB8. There are 2 pointers to it. It is 0x194 bytes long, just like the length of the Hoenn dex.
EDIT3: Heres what I found from analyzing the data: There are 411 entries in the Hoenn dex table, each one has the National dex ID of the pokemon that appears in that slot in the Hoenn Dex. My guess is that there is a limiter and/or a global variable somewhere. Another thing: I'm not sure if it has one more entry for Missingno or not (probably not)
tl;dr: The table is 0x336 bytes long, 2 bytes per entry, 411 entries total.

Dragonflye April 28th, 2014 12:56 PM

Thanks for the deleting the 2nd Frame Tut. ;) It work, but tURuI has right, the end Offsets are not correkt.^^

Chaos Rush April 28th, 2014 1:30 PM

Quote:

Originally Posted by tURuI (Post 8220462)
Are you sure this table ends at x30A11B? I found exactly 28 more pointers right after it, which means that they could be for slots 412-439 which are the alternate formes. The same could be true for the sprite animation tables. (It's not the same for the animation tables most likely)

EDIT1+2: Found Hoenn Dex Order. It's at x31DFB8. There are 2 pointers to it. It is 0x194 bytes long, just like the length of the Hoenn dex.
EDIT3: Heres what I found from analyzing the data: There are 411 entries in the Hoenn dex table, each one has the National dex ID of the pokemon that appears in that slot in the Hoenn Dex. My guess is that there is a limiter and/or a global variable somewhere. Another thing: I'm not sure if it has one more entry for Missingno or not (probably not)
tl;dr: The table is 0x336 bytes long, 2 bytes per entry, 411 entries total.

There are actually two Hoenn Dex tables, one at 0x31DFB8 that controls how the order that they appear in the Pokédex, and then there's another table at 0x31D94C that controls the Pokédex number that appears in the Summary screen when you haven't yet obtained the National Dex. But yeah, the former is the "main" one.

And yes, I fixed the frame table ending offsets, thanks for pointing that out :)

I am working on fixing the bug where the dex doesn't remember what position you were at when you press SELECT to bring up the mode change menu. Once that's done, then I can say that the Pokédex alone is perfect and will post offsets for all the other easier stuff so that karatekid can add it to his tool :)

EDIT: I have literally spent hours trying to fix that one final glitch to no avail (the dex doesn't remember your position when changing modes by pressing SELECT, thus always resetting to Bulbasaur/Treecko). Here is what I've found on it so far:
Branch to routine below: 080BBD4E
Routine that handles this: 080BBD7C
RAM offset of dex slot in SBird's expansion method: 02000D1E
RAM offset of dex slot in vanilla Emerald: 0200061E

If anyone can help me look into this, it would be greatly appreciated, as I've already worked out all the other bugs earlier. This is really the only thing that needs to be solved until we can call it a perfect Pokédex expansion.

SBird April 30th, 2014 1:22 AM

Something I figured out, I would apreciate confirmation of the english hackers, is: Castform(And its ability) seem to bug when using the expanded pokemon tables etc. I don't know if this is a general bug, which also exists if you do this for FR or if its emerald only. However the sprites, palettes etc. get messed up. Until now I only experienced this for castform(I thinks its the only pokémon of its kind, having a transformation ability)

~SBird

Deokishisu April 30th, 2014 9:44 PM

Quote:

Originally Posted by SBird (Post 8224160)
Something I figured out, I would apreciate confirmation of the english hackers, is: Castform(And its ability) seem to bug when using the expanded pokemon tables etc. I don't know if this is a general bug, which also exists if you do this for FR or if its emerald only. However the sprites, palettes etc. get messed up. Until now I only experienced this for castform(I thinks its the only pokémon of its kind, having a transformation ability)

~SBird

Could it have something to do with disabling the animations? Castform's sprite has more than one frame. Perhaps locking out all the second frames is the issue? If so, then Deoxys would also not work correctly.

SBird May 1st, 2014 9:48 AM

Quote:

Originally Posted by Deokishisu (Post 8225662)
Could it have something to do with disabling the animations? Castform's sprite has more than one frame. Perhaps locking out all the second frames is the issue? If so, then Deoxys would also not work correctly.

Hrn, that does not seem to be it. The animations are there but the ability does not work. It does not load the correct sprite / palette and it also does not change the type. I am almost certain it has something to do with the pokedex, but I can't figure out what the heck it is.

So a warning to everyone(unless something confirms that this is not an issue bound to the pokédex): Castform will be bugged due to the expansion.

~SBird

Edit: The bug exists due to the fact that castform(id 0x181) and the maximum amount of pokémon in the dex(0x181) interfer. To solve the issue you have to check in the search / replace process which 0x81010000 really refer to the pokédex. I'm sorry to have made that error in the first place, but that is also the reason castform does not work anymore ;)

LCCoolJ95 May 1st, 2014 3:02 PM

Quote:

Originally Posted by SBird (Post 8226355)
Castform will be due to the expansion.

A Pokémon that I rarely use...I'm okay with this.

I hope that the glitch CR stated above is fixed soon. Hopefully by tomorrow, since my birthday is tomorrow :3

Deokishisu May 1st, 2014 9:56 PM

Quote:

Originally Posted by LCCoolJ95 (Post 8226754)
A Pokémon that I rarely use...I'm okay with this.

I hope that the glitch CR stated above is fixed soon. Hopefully by tomorrow, since my birthday is tomorrow :3

It's probably better to have a system that doesn't break random Pokemon. Who knows? Castform might not be the only one unaffected. And, is it Castform, or is it the Forecast ability? More testing is needed to make sure there aren't random buggy Pokemon elsewhere, while someone narrows down what's eatin' Castform.

I won't be able to do even moderate hacking before the end of this month, but I'll see if I can test out other unique Pokemon. Kecleon might be another culprit, if it's Castform's type changing being the problem.

SBird May 2nd, 2014 12:38 PM

I already posted a fix and an explenation why it is castform that is affected, so yeah, it is castform, and non other, at least for this issue, since this is not essentially tested nobody can say what other kinds of issues will occur.

~SBird

Chaos Rush May 2nd, 2014 5:01 PM

Whenever I have time this weekend or next weekend, I'll try and find the offset for the Castform ID that got changed. It shouldn't be that hard to fix, since it's only one out of 29 offsets.

HidoranBlaze May 2nd, 2014 7:35 PM

So I experimented with the 29 offsets using an unmodified rom, and at the 5th occurrence, changing the offset there prevented the transformation from working. I think that might be related to the issue with Castform. I haven't completely expanded the pokedex yet, so I can't test it, but that might be the issue on hand.

Edwearth May 6th, 2014 7:45 AM

Hello!
I'm new here, and i tried to adapt this to a french version. But i have a problem with the step 1.
I found all the equivalent offset for my ROM exept the 0x0DA284. Do you have an idea of how can i do ?
Thank you for this tuto !

ShyRayq May 6th, 2014 10:48 PM

Quote:

Originally Posted by Edwearth (Post 8233735)
Hello!
I'm new here, and i tried to adapt this to a french version. But i have a problem with the step 1.
I found all the equivalent offset for my ROM exept the 0x0DA284. Do you have an idea of how can i do ?
Thank you for this tuto !

Well uh, you could go to 0xDA284 in an english rom, then copy a couple of bytes there. Then go to the french rom and search for those bytes. If you find a couple cases, just copy more bytes. If that's what you're doing already then well...keep searching?

LCCoolJ95 May 10th, 2014 6:56 PM

I hope that the glitches for this project are figured out soon...

EDIT: I'm lost on step 2. Where do I edit the RAM in HxD?

Chaos Rush May 11th, 2014 9:05 PM

Quote:

Originally Posted by LCCoolJ95 (Post 8243894)
I hope that the glitches for this project are figured out soon...

EDIT: I'm lost on step 2. Where do I edit the RAM in HxD?

You can't edit the RAM in a hex editor. Hex editors can only edit the ROM. However, I'm assuming what you meant was the offsets that point to the RAM, which you can do within the ROM. Whenever it says "point to new SEEN flags" or "point to new CAUGHT flags", you put in a pointer at that offset to the RAM offset that you're going to use. So let's say you want the SEEN flags to be stored at 0203D800, and the CAUGHT flags to be stored at 0203D860. To point to the SEEN flags, the bytes would be 00 D8 03 02. And to point to the CAUGHT flags, the bytes would be 60 D8 03 02.

And unfortunately I don't have time right now to check out the problems, since I have work and school almost every day, and I'm trying to get my sprite project finished in the little free time that I have. Whenever I finally have a freaking day off of both work and school, I'll check out the Castform problem. Unfortunately I have no idea when that will be.

LCCoolJ95 May 13th, 2014 9:01 AM

Quote:

Originally Posted by Chaos Rush (Post 8218708)
Now we are going to replace well over 100 constants.
Go to offset xBB6AC. Starting at xBB6AC but ending before xC5000:
Search: __ 06 00 00
Replace: __ 0D 00 00.

What bytes do I put in for the spaces? And I totally understand about you being busy. It's finals week here at my college, and a lot of people are panicking about them :P

SBird May 13th, 2014 1:23 PM

Quote:

Originally Posted by LCCoolJ95 (Post 8248616)
What bytes do I put in for the spaces? And I totally understand about you being busy. It's finals week here at my college, and a lot of people are panicking about them :P

You want to leave the blank ones as is.

Edwearth May 20th, 2014 1:26 PM

Hello,
Please, could you post an exemple of an entire code wich is modified.
Because i have an error and i don't know, where is the problem.
Thank you for this tutorial !

Edit : With the french version, i have not any problem to make the step one, But with an US version, the game froze after the screen "2005 nintendo..."

Chaos Rush May 20th, 2014 2:33 PM

Alright, I've finally fixed the Castform problem. Make these byte changes:
x42730: 81 01
x5DF10: 81 01
x6F100: 81 01
xA5EA4: 81 01

AtecainCorp. May 22nd, 2014 12:11 PM

Someone can port Expanding Emerald Pokedex to one tool? It was more easier for hackers than write an source code.

HidoranBlaze May 22nd, 2014 12:45 PM

Quote:

Originally Posted by Ksiazek Bartlomiej (Post 8263738)
Someone can port Expanding Emerald Pokedex to one tool? It was more easier for hackers than write an source code.

Karatekid552 will add this to G3HS once the bugs are completely squashed. You know, if you read the comments, you would've figured this out.

Chaos Rush May 22nd, 2014 8:50 PM

Quote:

Originally Posted by HidoranBlaze (Post 8263776)
Karatekid552 will add this to G3HS once the bugs are completely squashed. You know, if you read the comments, you would've figured this out.

There's only one bug left (with 493 anyways, I'll try to expand to 721 sometime) which is the position memory thing I mentioned in an earlier post in this thread. Though I'm thinking maybe I'll try writing a routine that will adjust the position correctly. It might seem tedious when you could achieve the same effect just by finding the error, but I can't figure out why it happens, even though I've found the routine that controls it (I posted offsets earlier).

However, I will test out 721 soon because I suspect there might be a cry table glitch that was also encountered on FireRed when gogojjtech expanded it. It's not a problem when you're going for 493 but it could potentially be a problem if you want 649 or 721.

mamamama May 23rd, 2014 9:47 PM

Quote:

Originally Posted by Chaos Rush (Post 8218708)
At 0x152E98, put 00 48 00 47 [XX XX XX 08]. For XX XX XX 08, it's the offset you put the save block routine +0x1.
At 0x15284E, put 38 47.
At 0x15288C, put [YY YY YY 08]. For YY YY YY 08, it's the offset you put the save block routine +0x61.
At 0x0D9CC6, put 38 47.
At 0x0D9D04, put [YY YY YY 08].
At 0x0DA284, put 00 48 00 47 [XX XX XX 08].

Put a pointer to whichever set of flags comes first at x843BC.
Put 20 1C 00 00 at x8439A.
Put XX 22 at x843A0, where XX is the number of bytes taken by your dex flags.
Put 20 1C at x843A6.
Put YY 30 at x843A8, where YY is the number of bytes between the sets of flags. YY is probably the same as XX, but it doesn't have to be.
Put XX 22 at x843AC, where XX is the number of bytes taken by your dex flags.

Sorry if this seems like a stupid question, but I'm a bit unsure about this part.

I've decided that I want to expand my Pokedex with 40 extra entries.

Does that mean that I take (439 + 40)/8 = 59.875 = 60? (or should I Take (386 + 40)/8 = 53.25 = 54)

That would be XX XX XX 08 = 00 D8 03 08 and YY YY YY 08 = 60 D8 03 08 (or 53 D8 03 08)

Further: The number of bytes taken by my dex flags. Would that be Seen AND caught? i.e. 60 + 60 = 120 (then convert it to hex), or do I convert 60 to hex, or do I just write 60 straight up?

I guess my YY will be the same as my XX since I want the same amount of Pokemon and Pokedex entries?

Chaos Rush May 24th, 2014 11:34 AM

Ok, I have FINALLY fixed the dex position glitch! My fix however, rather than finding the mistake, I just branch to a custom routine that undoes the mistake. To fix it, do these byte changes:

BBD94: 0E 4A
BBDD0: 9C 0F 00 02

Next, insert this routine into free space:
Code:

.text
.align 2
.thumb
.thumb_func
.global positionfix

main:
push {r0-r3}
ldr r0, .FirstCheck
ldrb r0, [r0]
mov r1, #0xFF
cmp r0, r1 /*compares .FirstCheck value to FF. If not, you're outside*/
bne Outside
b Inside

Inside:
ldr r0, .Counter1Inside
ldrb r0, [r0]
ldr r1, .Counter2Inside
ldrb r1, [r1]
cmp r0, r1
bne next1
b End

next1:
mov r2, #0x0
ldr r3, .FinalPosInside
strh r2, [r3]
b End

Outside:
ldr r0, .Counter1Outside
ldrb r0, [r0]
ldr r1, .Counter2Outside
ldrb r1, [r1]
cmp r0, r1
bne next2
b End

next2:
mov r2, #0x0
ldr r3, .FinalPosOutside
strh r2, [r3]
b End

End:
pop {r0-r3}
ldr r0, .NextRoutine
str r0, [r6]
pop {r4-r7}
pop {r0}
bx r0

.align
.FirstCheck: .word 0x02000D1C
.Counter1Inside: .word 0x02000F9E
.Counter2Inside: .word 0x02000FA0
.FinalPosInside: .word 0x02000F9A

.Counter1Outside: .word 0x02000D22
.Counter2Outside: .word 0x02000D24
.FinalPosOutside: .word 0x02000D1E

.NextRoutine: .word 0x080C1D39


And then make these byte changes:
C1808: 12 01
C1814: 00 48 00 47
C1818: XX XX XX 08 (offset of the routine +1)

This makes sure that the position is remembered if you're NOT switching dex modes. If you ARE switching dex modes (like from National to Hoenn, or vice-versa), then it will reset to Bulbasaur/Treecko (slot 0), which is intended as vanilla RSE behaves like this too.

(for those of you that didn't know, the problem I was having was that it was always resetting to Bulbasaur/Treecko even if I wasn't switching dex modes. But that has now been fixed)

I would like to say that we now have a perfect Emerald Pokédex expansion, but first I'm going to try out expanding to 721 to address any potential bugs that don't happen with just 493.

LCCoolJ95 May 25th, 2014 2:00 PM

Well, I went through the whole tutorial, adding in all of the 4th gen Pokémon (and Sylveon), and I have some good news and bad news. I can explain it through a picture:
http://i1218.photobucket.com/albums/dd410/LCCoolJ95/GoodandBad_zpse420bff4.png

I did a Word document, side by side with your tutorial, and I think there is one more offset you forgot to add in. The offset is not in the Gen 3 Hacking Suite ini, but it is in Pokémon Game Editor's, which I used to edit the names and order of all the Pokémon.

PokemonFrontSprites=&H301418

Chaos Rush May 25th, 2014 6:37 PM

Quote:

Originally Posted by LCCoolJ95 (Post 8268475)
Well, I went through the whole tutorial, adding in all of the 4th gen Pokémon (and Sylveon), and I have some good news and bad news. I can explain it through a picture:
http://i1218.photobucket.com/albums/dd410/LCCoolJ95/GoodandBad_zpse420bff4.png

I did a Word document, side by side with your tutorial, and I think there is one more offset you forgot to add in. The offset is not in the Gen 3 Hacking Suite ini, but it is in Pokémon Game Editor's, which I used to edit the names and order of all the Pokémon.

PokemonFrontSprites=&H301418

The reason why it's not in the Gen 3 Hacking Suit ini is because that table that PGE calls "PokemonFrontSprites" is unused by the game, as those are the single-frame Ruby/Sapphire sprites (you can confirm this by looking at Snorlax's sprite in the RS table and then Snorlax's sprite in the "PokemonAnimations" table. Snorlax actually received an entirely new front sprite in Emerald.) The table at x30A18C is the REAL front sprite table (it should have two frames per mon), and is the correct offset that both G3HS and Wichu's Tools lists as Emerald's front sprite table.

HidoranBlaze May 25th, 2014 6:47 PM

Quote:

Originally Posted by LCCoolJ95 (Post 8268475)
Well, I went through the whole tutorial, adding in all of the 4th gen Pokémon (and Sylveon), and I have some good news and bad news. I can explain it through a picture:
http://i1218.photobucket.com/albums/dd410/LCCoolJ95/GoodandBad_zpse420bff4.png

I did a Word document, side by side with your tutorial, and I think there is one more offset you forgot to add in. The offset is not in the Gen 3 Hacking Suite ini, but it is in Pokémon Game Editor's, which I used to edit the names and order of all the Pokémon.

PokemonFrontSprites=&H301418

I think the real issue is that Wichu's Sprite Editor assumes that 00 bytes are free space for Emerald: I actually confirmed this just now by putting the start offset as 0xDE4018. The 00 bytes were overwritten instead of the FF bytes. That probably screwed up your rom.

LCCoolJ95 May 26th, 2014 7:14 AM

Quote:

Originally Posted by Chaos Rush (Post 8268920)
The reason why it's not in the Gen 3 Hacking Suit ini is because that table that PGE calls "PokemonFrontSprites" is unused by the game, as those are the single-frame Ruby/Sapphire sprites (you can confirm this by looking at Snorlax's sprite in the RS table and then Snorlax's sprite in the "PokemonAnimations" table. Snorlax actually received an entirely new front sprite in Emerald.) The table at x30A18C is the REAL front sprite table (it should have two frames per mon), and is the correct offset that both G3HS and Wichu's Tools lists as Emerald's front sprite table.

Oh wow, really? I just checked that out. It's a small difference looking at the sprites, but they are different.

Quote:

Originally Posted by HidoranBlaze (Post 8268935)
I think the real issue is that Wichu's Sprite Editor assumes that 00 bytes are free space for Emerald: I actually confirmed this just now by putting the start offset as 0xDE4018. The 00 bytes were overwritten instead of the FF bytes. That probably screwed up your rom.

Ahh, okay.

Well, in all honesty, I just did this as a test, since this was my first time doing it. I'm just excited to see that it actually worked out. Not to the highest degree, but it worked. So...what happens now?

Salamence™ May 26th, 2014 12:29 PM

Thank you chaos now i dont need the Expand tool that krk552 made :D

Edwearth May 27th, 2014 5:35 AM

Could you post a patch please ?

Salamence™ May 28th, 2014 7:43 AM

Quote:

Originally Posted by Edwearth (Post 8271356)
Could you post a patch please ?

you dont need a patch
when you can do it by yourself....

Edwearth May 28th, 2014 1:15 PM

Quote:

when you can do it by yourself....
I have too many problems to make it. So i want to make a comparison. I think with the exemple, i can understand.

Chaos Rush May 28th, 2014 2:01 PM

I just want to say that I can confirm everything in the tutorial is correct and all you need, as I'm working on a 721 ROM base and got the Pokédex working solely from the information provided in this tutorial (proof at romhack.me). Also karatekid552 will eventually send me a test version of his tool with Emerald Pokédex expansion implemented, and will become official once it's been tested thoroughly.

mamamama May 28th, 2014 3:45 PM

So, I would just like to double confirm something before I move on and start to add sprites/movesets etc.

I have successfully manged to get all this done. I now have 40 extra slots after Chimeco and repointed every single table. Each table contains the amount of bytes written in the tutorial + (40 x needed bytes depending on table) at the end of each table.

I have made all this assuming that the amount of dex entries should be 387 + 40 = 427.

What about those Unown/Egg slots? Was I supposed to account for those when I repointed each table, that is The old table + the weird slots + my new extra slots making the total 68 ([439 - 411] + 40).

When I edit my mons in the Hacking Suite, should I write that I have 427 mons or 479 in the ini (and thus skip 412 - 439). If I changed sprite and edited some stats on 412, have I ruined the game and need to start over from my last backup or can I fix it?

Chaos Rush May 28th, 2014 5:54 PM

Quote:

Originally Posted by mamamama (Post 8273615)
So, I would just like to double confirm something before I move on and start to add sprites/movesets etc.

I have successfully manged to get all this done. I now have 40 extra slots after Chimeco and repointed every single table. Each table contains the amount of bytes written in the tutorial + (40 x needed bytes depending on table) at the end of each table.

I have made all this assuming that the amount of dex entries should be 387 + 40 = 427.

What about those Unown/Egg slots? Was I supposed to account for those when I repointed each table, that is The old table + the weird slots + my new extra slots making the total 68 ([439 - 411] + 40).

When I edit my mons in the Hacking Suite, should I write that I have 427 mons or 479 in the ini (and thus skip 412 - 439). If I changed sprite and edited some stats on 412, have I ruined the game and need to start over from my last backup or can I fix it?

In the Gen III games, there are 439 Pokémon slots, and 386 dex entries (387 if you count 0). Meaning that if you are adding Pokémon, the first one you add should be slot 440. If the first Pokémon you added is slot 412, then you did something wrong. HOWEVER, the base stat table, the moveset table, and the Pokémon names table only goes up to 411 (Chimecho), so you have to account for the Unown slots when expanding those. The sprite/palette tables go up to 439.

The dex slots alone, however, are separate from the index numbers. So in your case, you should have 479 index number slots, and 427 dex slots. You should put 479 in the ini.

If you edited slot 412, then that is a problem, because that's the Egg slot (or Unown A? I forgot, but it's one of those).

Chaos Rush June 18th, 2014 4:11 PM

This is minor, but for those of you that know about the cry table and expanded mon, any Pokémon that uses a cry ID of 0x200 or higher won't play. To fix it, simply put 01 1C 11 E0 at xA35A2.

Credit to DoesntKnowHowToPlay for the FireRed offset, which I used to find the Emerald offset.

mamamama June 22nd, 2014 1:51 PM

Quote:

Originally Posted by Chaos Rush (Post 8273477)
I just want to say that I can confirm everything in the tutorial is correct and all you need, as I'm working on a 721 ROM base and got the Pokédex working solely from the information provided in this tutorial (proof at romhack.me). Also karatekid552 will eventually send me a test version of his tool with Emerald Pokédex expansion implemented, and will become official once it's been tested thoroughly.

I did everything exactly as written in the tutorial and I have come across 2 issues.

1. When I placed an expanded Pokemon in the Wild, I would just battle against a black ring with a question mark in (the indicator that there is no sprite). I solved this by placing 07 E0 at 0x34BFE (a third sprite limiter which was not in the original guide. It seems like Fire Red only has two of these while Emerald has three).

2. This leads me to my current issue. While my expanded mons work in battle, they don't work in the Pokedex. Stuff like Pokedex descriptions and height shows up correctly but the Picture and name does not come up. The name does work in-battle and when looking at the Pokemon's status screem, but not in the Pokedex itself. The name just shows up as "?" and the picture as "??" (not the same as the circle with a ? in) leading me to believe that there is some kind of Pokedex limiter which you might have forgotten to add in this guide.

I have checked everything 4 or 5 times already and I have done exactly what you have written down.

Phenom2122 July 1st, 2014 4:48 AM

I've just gone through the whole tutorial and after going back and double checking and fixing a few mistakes it all seems to be working fine. I haven't tested out wild encounters yet though. I haven't added new sprites yet but what I have done with each repoint is copy the amount of necessary bytes from the beginning (eg. for now, after all the unowns it begins again with Bulbasaur, Ivysaur etc.). So everything lines up and everything works fine so far.
This brings me to a question about the optional step of disabling animations. I decided to repoint and keep the animations using my same method as before. It is still all working fine, I just have a question about two of the steps:
"Now at x308CC0, change the bytes there to 38 F5 2F 08."
"At x06EE38, put 00 00.
At x06ECC4, put 01."
Are these steps optional too or do I need to still make these changes even if I decided not to disable animations?

Phenom2122 July 4th, 2014 1:26 PM

Here is another double post, shoot me. Even though no one who has got this right seems interested in helping me with my simple question, I will post the offsets here of all the area of expansion that Chaos Rush did not cover. This can at least save other people the time of doing all the calculating for information that someone else already has. If I have it I might as well share it, this is not my property, it is Game Freak's property, so the idea of ownership of anything in this forum is completely idiotic and blind.
So, even though it seems like it is against the spirit of this community to actually help people, here are the offsets of other tables that need to be repointed. I forgot to save how many bytes per entry in my notes but at least here is a start:
Spoiler:
FootPrint Table - 0x56E694
Pokemon Evolutions - 0x32531C
TM/HM Compatibility - 0x31E898
Move Tutor Compatibility - 0x615048 (this table is twice as long as Fire Red's table. In Fire Red it is two bytes per Pokemon and in Emerald it is four)
Cries Table - 0x69DCF4
Second Cries Table - 0x69EF24 (In Fire Red there is another table for Hoenn Pokemon, I am not sure if this exists in Emerald, however, I am quite sure that repointing these two will be enough)

Also, I noticed in the Fire Red tutorial, there is a fix for evolution animations that Chaos Rush did not cover. In Emerald it is here:
Spoiler:
Code:

Put 07 E0 at x345FE


There are also Egg Moves that I should think need to be repointed, I will do this shortly. And if there is anything else that has been overlooked, I sincerely hope that someone will say.

I see many Rom hacks available, but if you ask for information, people are quiet. So if you don't feel like sharing, good luck with that and I hope it takes you far. Personally, if I ever feel like taking ownership of an idea or calling it original, I will make my own game and not mod someone else's. As far as modding Pokemon goes (someone else's game), any information I find or breakthroughs that I make, I will be glad to share.

P.S. I'm thinking about leaving this community and posting my Emerald progress elsewhere. For most people here I get the impression that this is a competition and I am not interested in sharing with people who look down on others, I would rather share and teach with those who do not know, like me once upon a time.

P.P.S. This is aimed at the state of the community in general, and is not aimed at you, Chaos Rush. In fact I bow down to you for doing all of this hard for us AND sharing it. Thank you.

LCCoolJ95 July 4th, 2014 4:52 PM

Well, I expanded almost everything except the cry table. Everything works, except for one thing. When the evolution animation occurs, the Pokémon is still the black question mark I replaced. It doesn't freeze or anything, and when I look at the status screen, it has the regular sprite I inserted. Why does this happen?

Phenom2122 July 4th, 2014 10:23 PM

Quote:

Originally Posted by LCCoolJ95 (Post 8330636)
Well, I expanded almost everything except the cry table. Everything works, except for one thing. When the evolution animation occurs, the Pokémon is still the black question mark I replaced. It doesn't freeze or anything, and when I look at the status screen, it has the regular sprite I inserted. Why does this happen?

Is it only during the evolution animation that it becomes a black question mark? Did you try that fix for the evolution animation I mentioned above? I think I've shot myself in the foot a bit with my own personal hack because I've expanded and done too much at once and can't really test any of it yet. And I haven't been keeping my ini files up to date either and I'm putting it off with dread.. :/
See, I think that we need to test this thoroughly, in all areas of expansion and gameplay before we can ever hope for it to be added to any tool. And sharing information about it helps us reach this goal. If you look at the Fire Red tutorial, there was so much interest that eventually the OP covered all areas of it and had it running to the tee. This thread seems to have just tapered off with everyone sitting back and waiting for it to be added to G3HS, which would make any bugs that still exist karatekid552's problem...
@LCCoolJ95 - May I ask how many entries you expanded your Pokedex with? I am interested in doing more then 744..

LCCoolJ95 July 5th, 2014 4:35 AM

Quote:

Originally Posted by Phenom2122 (Post 8330957)
Is it only during the evolution animation that it becomes a black question mark? Did you try that fix for the evolution animation I mentioned above? I think I've shot myself in the foot a bit with my own personal hack because I've expanded and done too much at once and can't really test any of it yet. And I haven't been keeping my ini files up to date either and I'm putting it off with dread.. :/
See, I think that we need to test this thoroughly, in all areas of expansion and gameplay before we can ever hope for it to be added to any tool. And sharing information about it helps us reach this goal. If you look at the Fire Red tutorial, there was so much interest that eventually the OP covered all areas of it and had it running to the tee. This thread seems to have just tapered off with everyone sitting back and waiting for it to be added to G3HS, which would make any bugs that still exist karatekid552's problem...
@LCCoolJ95 - May I ask how many entries you expanded your Pokedex with? I am interested in doing more then 744..

I used your fix and it didn't work. I'll try it again though. I expanded the Pokédex to have 495 Pokédex entries. To note, I am using an edited INI, to make it work with G3HS. So, I expanded the amount of evolutions with that tool and expanded the amount of Pokémon manually.

Phenom2122 July 5th, 2014 4:52 AM

Quote:

Originally Posted by LCCoolJ95 (Post 8331275)
I used your fix and it didn't work. I'll try it again though. I expanded the Pokédex to have 495 Pokédex entries. To note, I am using an edited INI, to make it work with G3HS. So, I expanded the amount of evolutions with that tool and expanded the amount of Pokémon manually.

I will test soon soon. I started all my repointing over again, I decided to take a different approach and save all my expanded tables as separate files, so that I can first clear out all the old tables and I know what extra space I have to work with. I don't know if the method of expanding evolutions would make a difference, I'm not sure, but I will do mine the manual way nonetheless and test to see if I get the same result as you. Is it only happening with your new additions or all Pokémon?

To avoid making another double post I will just edit this one, hope that you read it. Unfortunately I cannot test this out any time soon, I have got a bit carried away with 'deconstructing' my Rom. I want to remove all the known sections and start to map it out properly, I am tired of digging around in the dark with this game. I'm going to go through each location on the map, remove all scripts, then do a byte compare to find the exact address for each locations scripts. Then I hope to narrow it down to start finding other scripts and functions that cannot be reached from mapping. I have a new mission, sorry.

LCCoolJ95 July 6th, 2014 8:19 AM

Quote:

Originally Posted by Phenom2122 (Post 8331287)
I will test soon soon. I started all my repointing over again, I decided to take a different approach and save all my expanded tables as separate files, so that I can first clear out all the old tables and I know what extra space I have to work with. I don't know if the method of expanding evolutions would make a difference, I'm not sure, but I will do mine the manual way nonetheless and test to see if I get the same result as you. Is it only happening with your new additions or all Pokémon?

To avoid making another double post I will just edit this one, hope that you read it. Unfortunately I cannot test this out any time soon, I have got a bit carried away with 'deconstructing' my Rom. I want to remove all the known sections and start to map it out properly, I am tired of digging around in the dark with this game. I'm going to go through each location on the map, remove all scripts, then do a byte compare to find the exact address for each locations scripts. Then I hope to narrow it down to start finding other scripts and functions that cannot be reached from mapping. I have a new mission, sorry.

To anyone who has a problem with evolutions, if they went that far. Put 07 E0 at x34A16. This fixes the evolution animation.

karatekid552 July 13th, 2014 6:56 PM

I started coding this tutorial (thanks for your credit by the way.:P) and I can't really finish coding it without the missing steps like the evolution table.:/ This needs to be a full hack. I will code what you have here, but in the meantime, if someone could find the rest of the limiters for the other tables, that would be amazing.

Edit: Scrolling up, I see that @Phenom2122 has already got a head start on this. Please help him out guys if you have the skills.:)

@Chaos Rush, would you mind testing his stuff and adding it into the tutorial?

Chaos Rush July 14th, 2014 6:24 PM

Quote:

Originally Posted by karatekid552 (Post 8348020)
I started coding this tutorial (thanks for your credit by the way.:P) and I can't really finish coding it without the missing steps like the evolution table.:/ This needs to be a full hack. I will code what you have here, but in the meantime, if someone could find the rest of the limiters for the other tables, that would be amazing.

Edit: Scrolling up, I see that @Phenom2122 has already got a head start on this. Please help him out guys if you have the skills.:)

@Chaos Rush, would you mind testing his stuff and adding it into the tutorial?

But don't you already have the evolution table offsets for G3HS? Unless if you're talking specifically about limiters.

The thing is, I don't know what limiters are missing, because I have everything working in my ROM (icon sprites, palettes, battle sprite position, etc.), and most, if not, all limiters should be covered in Step 3 (except the evolution fix that LCCoolJ95 found that I added to Step 10).

Just tell me what limiters are missing/need labels and I'll get them. They should all be in the first post though, but I probably didn't label which ones are which and just said "change these bytes lol"

EDIT: As for the table offsets themselves, I didn't include the less-important ones (like footprints) because the offsets for those tables could all be found in either G3HS or PGE's ini. However, I can understand why that would be bothersome, but since I have then all written down on a notepad file, I'll add the offsets to the first post next time I'm on my PC

(I post from my phone a lot so I can't always update things immediately)

EDIT2: I added this under a spoiler tag in the first post:
Species Names = 3185C8
Front Sprite Table = 30A18C
Back Sprite Table = 3028B8
Front Palette Table = 303678
Shiny Palette Table = 304438
Base Stats = 3203CC
Moveset Pointers = 32937C
National Dex Order = 31DC82
Pokédex Data = 56B5B0
TM Compatibility = 31E898
Evolution Table = 32531C
Icon Sprite Table = 57BCA8
Icon Palette Table = 57C388
Main Cry Table = 69DCF4
Auxillary Cry Table = 31F61C
Footprint Table = 56E694
Move Tutor Compatib. = 615048
Animation Table = 3299EC
Frame Control Table = 309AAC
Back Animation Table = 60A8C8
EnemyY Table = 300D38
PlayerY Table = 3021D8
Enemy Altitude Table = 305DCC

karatekid552 July 15th, 2014 3:16 PM

Quote:

Originally Posted by Chaos Rush (Post 8350012)
But don't you already have the evolution table offsets for G3HS? Unless if you're talking specifically about limiters.

The thing is, I don't know what limiters are missing, because I have everything working in my ROM (icon sprites, palettes, battle sprite position, etc.), and most, if not, all limiters should be covered in Step 3 (except the evolution fix that LCCoolJ95 found that I added to Step 10).

Just tell me what limiters are missing/need labels and I'll get them. They should all be in the first post though, but I probably didn't label which ones are which and just said "change these bytes lol"

EDIT: As for the table offsets themselves, I didn't include the less-important ones (like footprints) because the offsets for those tables could all be found in either G3HS or PGE's ini. However, I can understand why that would be bothersome, but since I have then all written down on a notepad file, I'll add the offsets to the first post next time I'm on my PC

(I post from my phone a lot so I can't always update things immediately)

EDIT2: I added this under a spoiler tag in the first post:
Species Names = 3185C8
Front Sprite Table = 30A18C
Back Sprite Table = 3028B8
Front Palette Table = 303678
Shiny Palette Table = 304438
Base Stats = 3203CC
Moveset Pointers = 32937C
National Dex Order = 31DC82
Pokédex Data = 56B5B0
TM Compatibility = 31E898
Evolution Table = 32531C
Icon Sprite Table = 57BCA8
Icon Palette Table = 57C388
Main Cry Table = 69DCF4
Auxillary Cry Table = 31F61C
Footprint Table = 56E694
Move Tutor Compatib. = 615048
Animation Table = 3299EC
Frame Control Table = 309AAC
Back Animation Table = 60A8C8
EnemyY Table = 300D38
PlayerY Table = 3021D8
Enemy Altitude Table = 305DCC

Oh, okay, yeah I have all of the table offsets and stuff, I was more looking for the limiters. I guess I will code everything you have and then send it out as a beta, requesting all issues with expansion to be emailed to me. Then we will know haha.

Thanks man!

Artemis64 July 28th, 2014 11:10 PM

Just a question? How does Unown work in this expansion? Do Unown formes other than A show up as the added Pokemon, or is only Form A displayed? And will Pokemon in the Unown slots show up with the name Unown

mamamama July 29th, 2014 12:06 AM

Quote:

Originally Posted by Artemis64 (Post 8374472)
Just a question? How does Unown work in this expansion? Do Unown formes other than A show up as the added Pokemon, or is only Form A displayed? And will Pokemon in the Unown slots show up with the name Unown

You add the new mons after the bad eggs and unown slots, and then map your first added Pokemon to pokedex slot 387 etc.

I recommend doing the expansion in Fire Red with G3HS and compare with it while expanding Emerald as they are quite similar, so you know how to treat the Unown slots in the hex-editor.

Artemis64 August 1st, 2014 8:35 PM

Assuming I delete Unown (extremely useless), will the above happen? Or must the Unown forms be included? Because I notice Jambo51's FireRed 649 Patch seems to have only 650 Pokemon in the ini file, so I assume the Unown forms have been done away with.

ShyRayq August 1st, 2014 8:42 PM

Quote:

Originally Posted by Artemis64 (Post 8381019)
Assuming I delete Unown (extremely useless), will the above happen? Or must the Unown forms be included? Because I notice Jambo51's FireRed 649 Patch seems to have only 650 Pokemon in the ini file, so I assume the Unown forms have been done away with.

Wrong, The forms are still there. Jambo just implemented ASM that, if the pokemon was Unown, it would load the different sprites. This is the what happens with the egg as well.

mamamama August 6th, 2014 12:28 AM

Quote:

Originally Posted by Chaos Rush (Post 8350012)
But don't you already have the evolution table offsets for G3HS? Unless if you're talking specifically about limiters.

Just want to report a possible glitch:

Did you check if your Castform fix also fixed opponent's Castform? While your own Castform is fine, it seems like oppoising Castforms still have issues with animation.

Artemis64 August 6th, 2014 10:45 PM

How large are the cry, secondary cry, Move Tutor compatibility, animation and frame controls tables? And how do they work? Do they need to be repointed?

hackstar August 7th, 2014 3:45 AM

Is it okay that if i dont disable animation?

AkimotoBubble August 28th, 2014 4:59 AM

That's a good tutorial. While I was with redefine get crazy,I think if you are willing, I hope you make the data of redefining steps into repair share it,thank you

Artemis64 August 31st, 2014 5:07 AM

Humor me: what would happen if I deleted Unown altoegther from the game? Would slots 412 - 440 cause any problems?

AkimotoBubble August 31st, 2014 7:14 PM

About Move Tutor compatibility tables, my method is:
Each pokemon has 8 bytes, while each byte is like this:
Every 8 Move Tutor skill as a group, can learn set 1, unable to acquisition is 0, will convert hex is after he arranged his Move Tutor compatibility
If there are any errors please correct

Artemis64 September 5th, 2014 2:16 AM

So the move compatibility data of one Pokémon is 8 bytes, making the total size of the table CE0 bytes?

EricaHarper September 29th, 2014 1:44 PM

I've been having some trouble with the following instructions:

(At 0x152E98, put 00 48 00 47 [XX XX XX 08]. For XX XX XX 08, it's the offset you put the save block routine +0x1.
At 0x15284E, put 38 47.
At 0x15288C, put [YY YY YY 08]. For YY YY YY 08, it's the offset you put the save block routine +0x61.
At 0x0D9CC6, put 38 47.
At 0x0D9D04, put [YY YY YY 08].
At 0x0DA284, put 00 48 00 47 [XX XX XX 08].)

The very first "00 48 00 47 [XX XX XX 08]" causes my game to freeze with a black screen after the Game Freak screen with all the dates on it. I thought that maybe if I continued through the tut, the issue would resolve, since it was only the first step, yet even after getting past the part where I repoint everything, the game still freezes. Can anyone tell me what's up?

ShyRayq September 29th, 2014 4:57 PM

Quote:

Originally Posted by EricaHarper (Post 8453636)
I've been having some trouble with the following instructions:

(At 0x152E98, put 00 48 00 47 [XX XX XX 08]. For XX XX XX 08, it's the offset you put the save block routine +0x1.
At 0x15284E, put 38 47.
At 0x15288C, put [YY YY YY 08]. For YY YY YY 08, it's the offset you put the save block routine +0x61.
At 0x0D9CC6, put 38 47.
At 0x0D9D04, put [YY YY YY 08].
At 0x0DA284, put 00 48 00 47 [XX XX XX 08].)

The very first "00 48 00 47 [XX XX XX 08]" causes my game to freeze with a black screen after the Game Freak screen with all the dates on it. I thought that maybe if I continued through the tut, the issue would resolve, since it was only the first step, yet even after getting past the part where I repoint everything, the game still freezes. Can anyone tell me what's up?

Say you put the save block routine at 0xF00000. To get a pointer, split it into groups of 2.
F0 00 00, then reverse it and slap 08 on the end. 00 00 F0 08. That's your pointer.
Ok, so for the first pointer specified in the tut, XXXXXX08, it says add 0x01 to the pointer. Basically, add it to the original offset. 0xF00000 + 0x01 is 0xF00001. And using the same pointer method, the new pointer is 01 00 F0 08. Using he same method, the second pointer is 61 00 F0 08

EricaHarper September 30th, 2014 10:55 AM

Quote:

Originally Posted by ShyRayq (Post 8453848)
Say you put the save block routine at 0xF00000. To get a pointer, split it into groups of 2.
F0 00 00, then reverse it and slap 08 on the end. 00 00 F0 08. That's your pointer.
Ok, so for the first pointer specified in the tut, XXXXXX08, it says add 0x01 to the pointer. Basically, add it to the original offset. 0xF00000 + 0x01 is 0xF00001. And using the same pointer method, the new pointer is 01 00 F0 08. Using he same method, the second pointer is 61 00 F0 08

Thanks for taking the time to help me out. Though, I did figure out my first problem(was using my phone, which could not see the entire save block, nor the whole routine toward the halfway point of the tut. :( Don't I feel stupid..?). And thanks for the help with the pointers. I was a bit confused at first, but I think I can tackle it, now. No more mobile surfing for me!

EricaHarper October 1st, 2014 7:20 AM

I am really sorry for the double post, but I've just gone through the entire tut, and all of my sprites are buggy like I've run into a pissed off missingno. When I try to battle a wild poke, and use a move, or go to view my pokemon stats, the rom crashes. Also... my starter(torchic) knows thunderpunch instead of scratch as its first move. I know I've made a mistake somewhere; can someone point me in the right direction.

maddy-jazz November 16th, 2014 6:31 AM

Chaos Rush CAN U PLZ SHARE UR EXPANDED POKEMON ROM WITH ME
PLZ SIR

m0nstaLulz November 16th, 2014 9:00 AM

I'm confused on how to do this. What tools do I need?

Joexv November 18th, 2014 11:53 AM

Hey chaos do you think I could add this expansion hack to my new program?

mamamama November 18th, 2014 6:48 PM

One potential major problem with this Pokedex Expansion is that it messes up the Pokedex after Entering the Battle Factory. I've had a lot of people reporting this glitch to me in my hack which uses this Expanded Pokedex, and I'd say this is the most likely cause of it.

Exelis'20 January 3rd, 2015 1:50 AM

Hey guys can you help me?? I've got a problem in Step 2.. I really don't understand at all! also when i test the game, after the copyrights, it becomes black screen..

Can you explain this more detailed to me??

Once you've decided, figure out how many bits it will take to encode the number of dex entries- the answer is (number of dex entries)/8, rounded up. Using this, pick two locations in the RAM freed by JPAN/diegoisawesome's hack to be where Seen and Caught flags will go. Note that later steps will be easier if you put them next to each other.

In all honesty the only area I’m 100% sure of is safe to use for the new dex flags is 0203D800. So we are going to use that area.

Make these byte changes:
C06EC: point to new SEEN flags
C06AC: 00 00
C06AE: 00 00
This makes the game read using the new SEEN flags.

C0744: point to new CAUGHT flags
C06FE: 00 00
C0700: 00 00
C0702: 00 00
C0710: 15 E0
This makes the game read using the new CAUGHT flags.

C0720: 0D E0
This makes both of the above bypass redundant SEEN flags.

C07C8: point to new SEEN flags
C079E: 00 00
C07A0: 00 00
C07AC: 1C E0
This makes the game write to the new SEEN flags.

C07F0: point to new CAUGHT flags
C07DA: 00 00
C07DC: 00 00
This makes the game write to the new CAUGHT flags.

We also need to make the game clear these flags properly when the player selects New Game at the main menu. We can do this with the following edits:

Put a pointer to whichever set of flags comes first at x843BC.
Put 20 1C 00 00 at x8439A.
Put XX 22 at x843A0, where XX is the number of bytes taken by your dex flags.
Put 20 1C at x843A6.
Put YY 30 at x843A8, where YY is the number of bytes between the sets of flags. YY is probably the same as XX, but it doesn't have to be.
Put XX 22 at x843AC, where XX is the number of bytes taken by your dex flags.

Xencleamas January 14th, 2015 10:43 PM

Quote:

Originally Posted by ExdeAth20 (Post 8562702)
Hey guys can you help me?? I've got a problem in Step 2.. I really don't understand at all! also when i test the game, after the copyrights, it becomes black screen..

Can you explain this more detailed to me??

*snipped

Chaos has given the RAM is at 0203D800 right? You need to do is to type 00 D8 03 02 in the offset which is to point to new seen flags. For the divided by eight thingy... Example: you want to have 721 pokedex entries, you should do is to divide it by eight. If it isn't divisible by eight, you might want to find the number forwardly next to it which is divisible by eight... example: 728. Divide it by eight, you get 91 (dec) and convert it to hex which the results to 5B (hex). Then add +1... that makes 5C. Whichever results, add it by 3D800 so that makes 3D85C. Next to do is to type 5C D8 03 02 in the offset which is to point to new caught flags. Then you use that digit (ex: 5C) for XX and YY. Got it? I'm sure you get it.

----

Found a minor bug but it doesn't give threat a lot: After I caught a Pokemon which are from the expanded slots, it holds the ???????? (eight question mark) item. How to fix this?

Exelis'20 January 15th, 2015 4:41 PM

Yup! i've got it.. Thanks!

Scarex January 19th, 2015 5:06 PM

Frist things frist, sorry for my english and thank you very much for this tutorial n.n

Okay, I followed the steps of the tutorial and now I've a lot of new slots... Everything is okay except for... the Trainer battle and the Wild battle!

What's the problem? Well, the sprites of Pokémon are shown perfectly in the stats, in the evo, in the dex, in the contest... But when I put a over-440 pokémon in a trainer battle or I set it in a route, the game doesn't load the sprite, it loads the missigno ((?)) instead with the pallete of the sprite that should appear. In a wild battle, if I catch the pokémon, when the game asks me to put a name, the sprite loads perfectly, so I don't understand what's happening, maybe some limiter in trainer battles/wild battles? I dont know...

Someone help me >.<

Greetings!

Xencleamas February 24th, 2015 4:07 AM

Guys! One error needs to be fix: when you are going to talk and fight with a swimmer (or anyone with the 8 as encounter music), it doesn't play. It is really involved with the expansion. After the steps, just go to 0xB1C30 and type 81 01 00 00.

Xencleamas February 25th, 2015 1:57 AM

Quote:

Originally Posted by Artemis64 (Post 8632753)
[FONT="Calibri"][SIZE="3"]Finally, the limiter. In your hex editor, go to 0x34BFE and overwrite it with 07 E0. That's it!

Hmm... i have done the expansion with the animations expanded too before you posted that... but then I didn't know that limiter. What does the game appear if the limiter is unchanged? :/

Artemis64 February 25th, 2015 9:50 PM

It shows the ? sprite of Pokémon #0 (i.e. ??????) with the palette of the Pokémon that was supposed to be displayed

LCCoolJ95 February 27th, 2015 10:51 AM

Okay, after testing this with an expanded number of Pokemon Emerald ROM, with 8 evolutions per mon, and a regular Emerald ROM with just the number of evolutions changed, I can confirm that new evolution methods will NOT work if you expand the amount of Pokemon in the game. Has anyone looked into fixing this yet, or no?

Joexv February 27th, 2015 11:18 AM

Quote:

Originally Posted by LCCoolJ95 (Post 8635601)
Okay, after testing this with an expanded number of Pokemon Emerald ROM, with 8 evolutions per mon, and a regular Emerald ROM with just the number of evolutions changed, I can confirm that new evolution methods will NOT work if you expand the amount of Pokemon in the game. Has anyone looked into fixing this yet, or no?

Do you mean the custom evolutions from HERE? Cause if so you just have to change the pointer to where it trys to load the pokemon evolutions. So this pokemondata: .word 0x08(pointer to new pokemon location).

Xencleamas March 8th, 2015 5:04 PM

I think it should be always 440 or 0x1B8 while doing the expansion of pokedex. Let us all consider this since that is the overall total of slots in game. This shares too with non-Emerald pokedex expansion.

PurpleOrange March 11th, 2015 1:03 PM

i encountered a glitch when encountering expanded pokemon in the wild where their names only come up as ????????, i dunno why this is, i've checked all my pointers and they all seem to be correct

Percy March 11th, 2015 3:18 PM

Quote:

Originally Posted by PurpleOrange (Post 8651483)
i encountered a glitch when encountering expanded pokemon in the wild where their names only come up as ????????, i dunno why this is, i've checked all my pointers and they all seem to be correct

Have you done this:

Quote:

Place 00 00 00 00 00 00 (that's six 00s) at x6B944.
This will cause the repointed name table to actually get used.
If not, well, I'm stumped.

PurpleOrange March 12th, 2015 1:03 AM

Quote:

Originally Posted by Percy (Post 8651645)
Have you done this:

Quote:

Place 00 00 00 00 00 00 (that's six 00s) at x6B944.
This will cause the repointed name table to actually get used.
If not, well, I'm stumped.

yep that completely fixes the problem, thanks a lot, i must've accidentally skipped that step {XD}

PurpleOrange March 14th, 2015 1:32 PM

sorry for the double post but i found something that i thought i'd share.

in order to stop wild pokemon holding the ???????? item you need to put a pointer to the 13th byte of the repointed base stat table at 0x6EB7C and a pointer to the 15th byte of the repointed base stat table at 0x6EBA0 & 0x6EB28

in not 100% sure if this works fully but since those pointers all point to the old base stats i assume they'd need to change regardless

LCCoolJ95 March 17th, 2015 10:47 AM

Just to let everyone know, I will be doing a video tutorial of this whole process, just to make it more clear and that way people can see how the process is done through a visual way rather than reading and being completely confused.

Percy March 17th, 2015 3:30 PM

Quote:

Originally Posted by LCCoolJ95 (Post 8659877)
Just to let everyone know, I will be doing a video tutorial of this whole process, just to make it more clear and that way people can see how the process is done through a visual way rather than reading and being completely confused.

That's awesome! I'll be sure to check it out! And, please inform me if its up! Thanks!

Xencleamas March 19th, 2015 2:57 AM

Quote:

Originally Posted by Artemis64 (Post 8656233)
There appears to be some sort of glitch that causes Pokémon that are #495 and above to have any movements in in their animation to only be executed after the frame changing and color fading parts of their animation are complete. Can someone please look into this and help fix it?
http://i.imgur.com/ctfaQIh.gif

Hmm.... my Hydreigon slot moves fine (I can't screenshot you one 'cause I'm using my phone now). I think you should set animation indexes and animation pointers on expanded mons too (which I can't explain it dude but you might actually get what am I talking about).

LCCoolJ95 March 19th, 2015 6:50 AM

Well, here's a video tutorial of this whole tutorial, with minor things added, like some glitch fixes that are not listed in the first post.

https://www.youtube.com/watch?v=mjemZhVlZg4

Artemis64 March 20th, 2015 6:40 PM

I have changed the animation index to 00 and the animation timing pointer to 40 98 30 08, the same timing that Swalot uses. Pokémon in slots below #495 work perfectly fine in my repointed table with the changed index and animation timing pointers, so I have no idea what is the issue with Pokémon above #495.

PurpleOrange March 29th, 2015 6:20 AM

regarding the animations, there seems to be a table at 0x329B87, this seems to control how much time passes before it plays the pokemon animation on the summary screen.

Also it switches between the frames too many times on the summary screen for the expanded mon, i've tried finding out why, but i haven't been able to come up with anything


All times are GMT -8. The time now is 8:43 AM.


Like our Facebook Page Follow us on Twitter © 2002 - 2018 The PokéCommunity™, pokecommunity.com.
Pokémon characters and images belong to The Pokémon Company International and Nintendo. This website is in no way affiliated with or endorsed by Nintendo, Creatures, GAMEFREAK, The Pokémon Company or The Pokémon Company International. We just love Pokémon.
All forum styles, their images (unless noted otherwise) and site designs are © 2002 - 2016 The PokéCommunity / PokéCommunity.com.
PokéCommunity™ is a trademark of The PokéCommunity. All rights reserved. Sponsor advertisements do not imply our endorsement of that product or service. User generated content remains the property of its creator.

Acknowledgements
Use of PokéCommunity Assets
vB Optimise by DragonByte Technologies Ltd © 2023.