Go Back   The PokéCommunity Forums > ROM Hacking > Tools, Tutorials & Resources
Reload this Page [Tutorial] [Emerald] Expanding the Pokédex

Notices
For all updates, view the main page.

Tools, Tutorials & Resources Various tools to help you develop your hacks can be found here.
New threads in this forum are to be approved by a moderator before they are displayed.



Reply
 
Thread Tools
  #1    
Old April 26th, 2014 (10:39 PM). Edited July 14th, 2014 by Chaos Rush.
Chaos Rush's Avatar
Chaos Rush Chaos Rush is offline
im sexy and i know it
 
Join Date: May 2007
Location: Taylor Swift
Gender: Male
Nature: Adamant
1,286 post
Ever since SBird achieved Pokédex expansion on a German Emerald ROM, I always thought, well then it’s definitely possible on any language Emerald ROM. Since SBird was kind enough to post his notes on it, I wanted to port it over to an English Emerald ROM, and so here are the results!
Note that I will be structuring this tutorial very similar to DoesntKnowHowToPlay’s FireRed Pokédex expansion tutorial or the sake of continuity. DoesntKnowHowToPlay has given me permission to do this (some parts of this tutorial will be copied word-or-word).

You will need the following:
-A GBA emulator
-An Emerald English ROM
-A hex editor
-A solid understanding of hacking concepts. 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.

Before I go any further, let me say: USE AT YOUR OWN RISK!!!

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

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:
Fire up Notepad and get ready to write out some offsets, we'll be here a while.

Repoint and expand the Pokémon name table.
This begins at x3185C8 and is 11 bytes per entry.
In vanilla, it is x11B4 bytes long.
There should be about 40 pointers to it.
Apparently there are 128. Since parts of this tutorial was copied from the FireRed one, it's reasonable to assume that the amount of pointers to these tables are similar, so don't be surprised if they actually differ significantly.

Repoint and expand the base stat table.
This begins at x3203CC and is 28 (x1C) bytes per entry.
In vanilla, it is x2D10 bytes long.
There should be about 57 pointers to it.

There are two pointers to egg hatching time in the ROM that will need repointing.
They are to x3203DD, and should point to the 18th byte of base stat data.

Repoint and expand the level-up movepool table.
This begins at x32937C and is 4 bytes per entry.
In vanilla, it is x670 bytes long.
There should be 6 pointers to it.

Place 00 00 00 00 00 00 (that's six 00s) at x6B944.
This will cause the repointed name table to actually get used.

Repoint and expand the front sprite table.
This begins at x30A18C and is 8 bytes per entry. Note: 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.
To my knowledge, the latter four bytes are not used.
In vanilla, it is xDC0 bytes long.
There should be about 28 pointers to it.

Repoint and expand the back sprite table.
This begins at x3028B8 and is 8 bytes per entry
To my knowledge, the latter four bytes are not used.
In vanilla, it is xDC0 bytes long.
tl;dr same as above.
There should be about 10 pointers to it.

Put 07 E0 at x346D6.
Put 07 E0 at x34AC2.
These will break the limiters preventing sprites from showing up.

Repoint and expand the Pokémon palette table.
This begins at x303678 and is 8 bytes per entry.
Same as above, last four bytes unused, xDC0 total.
There should be about 5 pointers to it.

Repoint and expand the shiny palette table.
This begins at x304438 and is the same as the above.
There should be about 3 pointers to it.

Put 04 E0 at x6E750.
This breaks the limiter on the palette tables.

Test. You should have a reasonably colored extended mon now.
In fact, with a spare .ini, you can now add sprites using A-Series.

Repoint and expand the Player Y table.
This is at x3021D8, and is four bytes per mon.
Despite what Wichu's readme may have you believe, it's x6E0 bytes long.
There should be about 8 pointers to it.

Repoint and expand the Enemy Y table.
This is at x300D38, and is four bytes per mon.
It's also x6E0 bytes long.
There are about 16 pointers to it, oddly enough.

Repoint and expand the Altitude table.
This is at x305DCC, and is one byte per mon.
This time it's only x19C bytes long. Alt-Unowns don't have altitude.

Put 03 E0 at xA5F82.
Put 03 E0 at xA5EB6.
These break limiters, allowing these tables to be read.

Test. I advise playing with A-Series again.

Repoint and expand the icon pointer table at x57BCA8.
Four bytes per mon. About 6E0 bytes long.

Each icon uses one of three palettes.
This is controlled by the table at x57C388.
It's x1B8 bytes long. One byte per mon.

Put 01 E0 at xD2E3A.
Put 00 00 00 00 at xD2D20.
This should fix the icon palettes.

Once again, test.


Step 4: Dealing with dex entries
Spoiler:
Repoint and extend the National Pokédex order.
This is a list at x31DC82 that denotes what dex entries mons get.
The main use of this is to give the scattered Hoenn mons proper order.
It is x336 bytes long, 2 per entry.
Note that the limbo slots between Celebi and Treecko have entries on this table.
It'd be a good idea to fill this table out now instead of later. Make sure every dex page is tied to some mon.

Repoint and extend the Pokédex entries.
These is at x56B5B0.
Each entry is 32 (x20) bytes long.
The table has 387 entries (one for 00, oddly enough), or x3060 bytes.
Unlike most other data, this is in actual Pokédex order.

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 x309AAC and ending at x30A18B 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 x308CBC. At x308CBC 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 x3299EC, for the ront sprites. The table is one byte per mon. There is another table at x60A8C8. 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.


Step 6: Disabling Pokémon animations (optional, but recommended)
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. So for the sake of convenience, I will make disabling the animations a part of this tutorial.

Put this at x18080C:
Code:
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 x3299EC and ending at x329B87 is the front sprite animation table. Repoint it to free space, and make sure you replace all pointers to it. Now replace every byte of the table with 00. Also, make sure you add 00’s at the end of the table to account or the new Pokémon.

Now at x308CC0, change the bytes there to 38 F5 2F 08.

Starting at x309AAC and ending at x30A11B is the frame control table. Change every pointer in this table to BC 8C 30 08. Now repoint this table to free space, and make sure you replace all pointers to it. Now add more pointers at the end of the table to account for the new Pokémon, since we want the new Pokémon to not have an animation as well. Make sure every single pointer in this table is BC 8C 30 08.

At x06EE38, put 00 00.
At x06ECC4, put 01.

Starting at x60A8C8 and ending at x60AA63 is the back sprite animation table. Make every byte in this table 00. Repoint it to free space, and add more 00’s at the end of it to account for the new Pokémon.

Starting at x60ACE4 and ending at x60AD2E 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 510ish Pokémon:
BC91A: 5D 21 C9 00

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


Step 8: Changing lsl operations to make scrolling and other things work properly
Spoiler:
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.


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:
Open up your Emerald ROM in a hex editor with a Search & Replace function.
Go to offset x000000. 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 x000000.
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 xBB6AC. Starting at xBB6AC but ending before xC5000:
Search: __ 06 00 00
Replace: __ 0D 00 00.
Make sure you stop replacing around the C4000 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 & misc necessary byte changes
Spoiler:
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:
x42730: 81 01
x5DF10: 81 01
x6F100: 81 01
xA5EA4: 81 01

xA35A2: 01 1C 11 E0

x34A16: 07 E0

And now we're good to go!


Step 11: Fix this one glitch
Spoiler:
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
Next, make these byte changes:
BBD94: 0E 4A
BBDD0: 9C 0F 00 02
C1808: 12 01
C1814: 00 48 00 47
C1818: XX XX XX 08 (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.



This tutorial was just to get everything necessary for the Pokédex alone to work. With Pokémon expansion, there are many other tables that need to be covered (but aren't necessary for the Pokédex to show all of the Pokémon). The offsets for the tables that need to be expanded are listed here. Note that some of these I'm listing are already covered in the tutorial.
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
*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
__________________
Reply With Quote
  #2    
Old April 27th, 2014 (07:01 AM). Edited April 27th, 2014 by OronDF343.
OronDF343's Avatar
OronDF343 OronDF343 is offline
 
Join Date: Apr 2012
Gender: Male
Nature: Modest
7 posts
Great post! This is exactly what I needed, thanks!

Question:
Quote originally posted by Chaos Rush:
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.
Reply With Quote
  #3    
Old April 27th, 2014 (09:33 AM).
HidoranBlaze's Avatar
HidoranBlaze HidoranBlaze is offline
 
Join Date: Apr 2013
Age: 19
Gender: Male
251 posts
Nice work Chaos!
I'll try to beta test this with 649 Pokemon. (cuz screw Kalos, I'm not inserting that many sprites)
Reply With Quote
  #4    
Old April 27th, 2014 (09:45 AM).
Chaos Rush's Avatar
Chaos Rush Chaos Rush is offline
im sexy and i know it
 
Join Date: May 2007
Location: Taylor Swift
Gender: Male
Nature: Adamant
1,286 post
Quote originally posted by tURuI:
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.
__________________
Reply With Quote
  #5    
Old April 27th, 2014 (11:34 AM). Edited April 27th, 2014 by HidoranBlaze.
HidoranBlaze's Avatar
HidoranBlaze HidoranBlaze is offline
 
Join Date: Apr 2013
Age: 19
Gender: Male
251 posts
Quote originally posted by Chaos Rush:
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
Reply With Quote
  #6    
Old April 27th, 2014 (11:50 AM). Edited April 27th, 2014 by Chaos Rush.
Chaos Rush's Avatar
Chaos Rush Chaos Rush is offline
im sexy and i know it
 
Join Date: May 2007
Location: Taylor Swift
Gender: Male
Nature: Adamant
1,286 post
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.
__________________
Reply With Quote
  #7    
Old April 27th, 2014 (12:33 PM).
wael96 wael96 is offline
 
Join Date: Jul 2013
Location: Beijing,China
Gender: Male
38 posts
Thanks you for the work, a feature like expansion of pokedex is vey cool! BTW, how to find the RAM for the dex flags?
Reply With Quote
  #8    
Old April 27th, 2014 (12:35 PM). Edited April 27th, 2014 by Chaos Rush.
Chaos Rush's Avatar
Chaos Rush Chaos Rush is offline
im sexy and i know it
 
Join Date: May 2007
Location: Taylor Swift
Gender: Male
Nature: Adamant
1,286 post
Quote originally posted by wael96:
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.
__________________
Reply With Quote
  #9    
Old April 27th, 2014 (01:47 PM).
Chaos_Darkrai's Avatar
Chaos_Darkrai Chaos_Darkrai is offline
 
Join Date: Apr 2012
Gender: Male
284 posts
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!
__________________
░░░░░███████ ]▄▄▄▄▄▄▄▄
▂▄▅█████████▅▄▃▂
Il███████████████████].
◥⊙▲⊙▲⊙▲⊙▲⊙▲⊙▲⊙◤..

If you're looking for a good time, or just want to chat, come over to Weloxux and I's channel at:
http://mibbit.com/?server=irc.mibbit.net&channel=%23Dragons_Den

Reply With Quote
  #10    
Old April 27th, 2014 (02:07 PM).
SBird SBird is offline
 
Join Date: Aug 2009
Gender: Male
70 posts
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
Reply With Quote
  #11    
Old April 27th, 2014 (04:40 PM).
Chaos Rush's Avatar
Chaos Rush Chaos Rush is offline
im sexy and i know it
 
Join Date: May 2007
Location: Taylor Swift
Gender: Male
Nature: Adamant
1,286 post
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
__________________
Reply With Quote
  #12    
Old April 27th, 2014 (07:16 PM). Edited April 27th, 2014 by Chaos Rush.
Chaos Rush's Avatar
Chaos Rush Chaos Rush is offline
im sexy and i know it
 
Join Date: May 2007
Location: Taylor Swift
Gender: Male
Nature: Adamant
1,286 post
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.
__________________
Reply With Quote
  #13    
Old April 27th, 2014 (10:54 PM).
wael96 wael96 is offline
 
Join Date: Jul 2013
Location: Beijing,China
Gender: Male
38 posts
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.
Reply With Quote
  #14    
Old April 27th, 2014 (11:10 PM).
Sniper's Avatar
Sniper Sniper is offline
ふゆかい
 
Join Date: Nov 2013
Location: Philippines
Gender: Male
Nature: Quiet
1,410 post
Omg. This really awesome omg omg! :D I can finally put more x3
__________________
Reply With Quote
  #15    
Old April 27th, 2014 (11:24 PM). Edited April 28th, 2014 by OronDF343.
OronDF343's Avatar
OronDF343 OronDF343 is offline
 
Join Date: Apr 2012
Gender: Male
Nature: Modest
7 posts
Quote originally posted by Chaos Rush:
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.
Reply With Quote
  #16    
Old April 28th, 2014 (12:56 PM).
Dragonflye's Avatar
Dragonflye Dragonflye is offline
 
Join Date: Dec 2009
Gender: Male
74 posts
Thanks for the deleting the 2nd Frame Tut. It work, but tURuI has right, the end Offsets are not correkt.
__________________



Reply With Quote
  #17    
Old April 28th, 2014 (01:30 PM). Edited April 28th, 2014 by Chaos Rush.
Chaos Rush's Avatar
Chaos Rush Chaos Rush is offline
im sexy and i know it
 
Join Date: May 2007
Location: Taylor Swift
Gender: Male
Nature: Adamant
1,286 post
Quote originally posted by tURuI:
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.
__________________
Reply With Quote
  #18    
Old April 30th, 2014 (01:22 AM).
SBird SBird is offline
 
Join Date: Aug 2009
Gender: Male
70 posts
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
Reply With Quote
  #19    
Old April 30th, 2014 (09:44 PM).
Deokishisu's Avatar
Deokishisu Deokishisu is offline
Mr. Magius
 
Join Date: Feb 2006
Location: If I'm online, it's a safe bet I'm at a computer.
Gender: Male
Nature: Relaxed
506 posts
Quote originally posted by 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.
Reply With Quote
  #20    
Old May 1st, 2014 (09:48 AM). Edited May 1st, 2014 by SBird.
SBird SBird is offline
 
Join Date: Aug 2009
Gender: Male
70 posts
Quote originally posted by Deokishisu:
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
Reply With Quote
  #21    
Old May 1st, 2014 (03:02 PM).
LCCoolJ95's Avatar
LCCoolJ95 LCCoolJ95 is offline
Limited Capacity
 
Join Date: May 2009
Location: The World That Never Was
Age: 20
Gender: Male
Nature: Naive
271 posts
Quote originally posted by SBird:
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
__________________
"The greatest obstacle in life is Yourself. Overcome it, and you will achieve the greatest accomplishment of all." -Art Beins, 1982

Pokémon Emerald 650 (Resource Patch): http://www.pokecommunity.com/showthread.php?t=346694
Pokémon Theta Emerald: http://www.pokecommunity.com/showthread.php?t=349258
Reply With Quote
  #22    
Old May 1st, 2014 (09:56 PM).
Deokishisu's Avatar
Deokishisu Deokishisu is offline
Mr. Magius
 
Join Date: Feb 2006
Location: If I'm online, it's a safe bet I'm at a computer.
Gender: Male
Nature: Relaxed
506 posts
Quote originally posted by LCCoolJ95:
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.
Reply With Quote
  #23    
Old May 2nd, 2014 (12:38 PM).
SBird SBird is offline
 
Join Date: Aug 2009
Gender: Male
70 posts
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
Reply With Quote
  #24    
Old May 2nd, 2014 (05:01 PM).
Chaos Rush's Avatar
Chaos Rush Chaos Rush is offline
im sexy and i know it
 
Join Date: May 2007
Location: Taylor Swift
Gender: Male
Nature: Adamant
1,286 post
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.
__________________
Reply With Quote
  #25    
Old May 2nd, 2014 (07:35 PM).
HidoranBlaze's Avatar
HidoranBlaze HidoranBlaze is offline
 
Join Date: Apr 2013
Age: 19
Gender: Male
251 posts
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.
Reply With Quote
Reply
Quick Reply

Sponsored Links

You may also like.. (Beta)
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are UTC -8. The time now is 01:15 AM.