• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Expanding the Pokédex into Emerald

Status
Not open for further replies.
457
Posts
10
Years
  • Age 28
  • Seen Apr 9, 2024
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:


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:


Step 2: Get free RAM for the dex flags
Spoiler:


Step 3: Repoint Everything
Spoiler:


Step 4: Dealing with Dex Entries
Spoiler:


Step 5: Explanation of how Pokémon animations work in Emerald
Spoiler:


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:

Step 6B: Disabling Pokémon animations
Spoiler:


Step 7: Dex-related byte changes
Spoiler:


Step 8: Changing lsl operations to make scrolling and other things work properly
Spoiler:


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:

Step 10: Fix Castform, other glitches, and misc necessary byte changes
Spoiler:


Step 11: Fix this one glitch
Spoiler:


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

phHNWhE.png
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:


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).
 

Attachments

  • The Lazy Patch - Steps 8, 9, and 10.ips
    1.6 KB · Views: 218
Last edited:
7
Posts
12
Years
Great post! This is exactly what I needed, thanks!

Question:
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.
 
Last edited:
252
Posts
10
Years
  • Age 27
  • Seen Jul 6, 2019
Nice work Chaos!
I'll try to beta test this with 649 Pokemon. (cuz screw Kalos, I'm not inserting that many sprites)
 
1,323
Posts
16
Years
  • Seen Dec 9, 2023
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.
 
252
Posts
10
Years
  • Age 27
  • Seen Jul 6, 2019
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
 
Last edited:
1,323
Posts
16
Years
  • Seen Dec 9, 2023
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.
 
Last edited:
1,323
Posts
16
Years
  • Seen Dec 9, 2023
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.
 
Last edited:
173
Posts
11
Years
  • Seen Jan 2, 2015
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!
 
91
Posts
14
Years
  • Seen Feb 22, 2023
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
 
1,323
Posts
16
Years
  • Seen Dec 9, 2023
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
 
1,323
Posts
16
Years
  • Seen Dec 9, 2023
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.
 
Last edited:
38
Posts
10
Years
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.(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." )
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.
 
7
Posts
12
Years
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.
 
Last edited:

Dragonflye

Author of Pokémon Sovereign of the Skies
107
Posts
14
Years
  • Age 28
  • Seen Oct 9, 2023
Thanks for the deleting the 2nd Frame Tut. ;) It work, but tURuI has right, the end Offsets are not correkt.^^
 
1,323
Posts
16
Years
  • Seen Dec 9, 2023
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.
 
Last edited:
91
Posts
14
Years
  • Seen Feb 22, 2023
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
 
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.
 
91
Posts
14
Years
  • Seen Feb 22, 2023
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 ;)
 
Last edited:
Status
Not open for further replies.
Back
Top