[FR] Expanding the Pokedex Page 3

Started by DoesntKnowHowToPlay January 31st, 2014 9:41 PM
  • 86926 views
  • 179 replies

GoGoJJTech

(☞゚ヮ゚)☞ http://GoGoJJTech.com ☜(゚ヮ゚☜)

Age 24
Female
Earth
Seen December 9th, 2016
Posted December 5th, 2016
2,475 posts
10.5 Years
Yes Sorry the tool is broken, but hex editing still works.
Hex editing will always work. No reason it won't. :D
I believe in Jesus Christ my Savior. If you do too, and aren't scared to admit it, then copy and paste this into your signature.
The HGSS Music Patch - The BW/2 Music Patch - ASM: Switch Music Based on Seasons
Romhack.me Profile - Pokecommunity Profile - Youtube Channel

Support me at my site!
Pokémon Platinum Red and Blue
Male
Seen February 22nd, 2023
Posted January 17th, 2023
91 posts
13.7 Years
Oh well, I ran into quite a few problems, first of all I'm trying to port this to emerald, so I guess that's just one reason why I have so many issues, anyways I thought you might be able to help me out(Since I can't directly contact the autor :T)

I repointed everything until I reached the Pokédex and allocated enough memory, I also relocated some globalVars which the dex is apparently using which would otherwise conflict with the new pkmn data, now after deoxys I have a few strange random entries, those are mainly unknowns(I mean entry 0); Those go up to 412, and then my entries start. I also don't know how exactly the ordering table works(Seriously, this thing confuses me); Here are the revelant entries of my list, I tried a few things so this might be far from correct, maybe you can help me out:

66 01 (Last entry in normal Dex) BE 05 BF 05 C0 05 C1 05 C2 05 C3 05 C4 05 C5 05 C6 05 C7 05 C8 05 C9 05 CA 05 CB 05 CC 05 CD 05 CE 05 CF 05 D0 05 D1 05 D2 05 D3 05 D4 05 D5 05 D6 05 D7 05 D8 05 D9 05(With those I tried to skip the strange thingies in my dex) B9 01 BA 01 BB 01 BC 01 BD 01 BE 01 BF 01 C0 01 C1 01 (My new entries beginning with 441d)

I don't know whats wrong, maybe its just that emerald has a completely different structure, that's what I noticed when reallocating the memory at least.

Thanks in advance!

~SBird
Male
France
Seen June 4th, 2014
Posted April 15th, 2014
22 posts
9.8 Years
Oh well, I ran into quite a few problems, first of all I'm trying to port this to emerald, so I guess that's just one reason why I have so many issues, anyways I thought you might be able to help me out(Since I can't directly contact the autor :T)

I repointed everything until I reached the Pokédex and allocated enough memory, I also relocated some globalVars which the dex is apparently using which would otherwise conflict with the new pkmn data, now after deoxys I have a few strange random entries, those are mainly unknowns(I mean entry 0); Those go up to 412, and then my entries start. I also don't know how exactly the ordering table works(Seriously, this thing confuses me); Here are the revelant entries of my list, I tried a few things so this might be far from correct, maybe you can help me out:

66 01 (Last entry in normal Dex) BE 05 BF 05 C0 05 C1 05 C2 05 C3 05 C4 05 C5 05 C6 05 C7 05 C8 05 C9 05 CA 05 CB 05 CC 05 CD 05 CE 05 CF 05 D0 05 D1 05 D2 05 D3 05 D4 05 D5 05 D6 05 D7 05 D8 05 D9 05(With those I tried to skip the strange thingies in my dex) B9 01 BA 01 BB 01 BC 01 BD 01 BE 01 BF 01 C0 01 C1 01 (My new entries beginning with 441d)

I don't know whats wrong, maybe its just that emerald has a completely different structure, that's what I noticed when reallocating the memory at least.

Thanks in advance!

~SBird
I'm working on Pokemon Fire Red (French) but I still think I can help you. I think you put "00 00" offset 0x6D3E0 (for Emerald English) instead of putting the offset 0x6D42C.
Male
France
Seen June 4th, 2014
Posted April 15th, 2014
22 posts
9.8 Years
Can you make an version of this Tutorial for Pokemon RSE?
Logically, the principle is the same view as FireRed and R/S/E have a common basis.
It just enough to find the different offsets.
After the question is whether one can easily adapt the JPAN Save Block on Emerald because there the RAMs these two versions are not very similar. Tomorrow, if I have time, maybe I will find offset the Emerald and the "JPAN Save Block Emerald".

EDIT : Oh, and I've forget the small changes by ASM.

GoGoJJTech

(☞゚ヮ゚)☞ http://GoGoJJTech.com ☜(゚ヮ゚☜)

Age 24
Female
Earth
Seen December 9th, 2016
Posted December 5th, 2016
2,475 posts
10.5 Years
Logically, the principle is the same view as FireRed and R/S/E have a common basis.
It just enough to find the different offsets.
After the question is whether one can easily adapt the JPAN Save Block on Emerald because there the RAMs these two versions are not very similar. Tomorrow, if I have time, maybe I will find offset the Emerald and the "JPAN Save Block Emerald".

EDIT : Oh, and I've forget the small changes by ASM.
Doing it for RS will be exceedingly difficult due to the lack of good asm for RS (Gamefreak wasn't used to the gba's code by the time)
It will require some extreme research, since RS and Em are in NO way the same
I believe in Jesus Christ my Savior. If you do too, and aren't scared to admit it, then copy and paste this into your signature.
The HGSS Music Patch - The BW/2 Music Patch - ASM: Switch Music Based on Seasons
Romhack.me Profile - Pokecommunity Profile - Youtube Channel

Support me at my site!
Pokémon Platinum Red and Blue

GoGoJJTech

(☞゚ヮ゚)☞ http://GoGoJJTech.com ☜(゚ヮ゚☜)

Age 24
Female
Earth
Seen December 9th, 2016
Posted December 5th, 2016
2,475 posts
10.5 Years
I'm just curious, would porting this to Emerald be easier or harder, assuming you did the same amount of research? The pokedex for Firered was different after all, with habitats and everything, whereas Emerald was just a straight list of Pokemon.
Emerald might be about 10% harder. Why? Cuz it's not as researched as FR. Even if it was, you'd have to debug all of the loading routines (sprites, icons, cries, everything you have to repoint) to remove limiters and find the malloc (assuming there is a malloc)
Then you'd have to research the dex, because its loading and storing is most likely 100% different from Fire Red's. Ruby would just take years because it's so unorganized.
I believe in Jesus Christ my Savior. If you do too, and aren't scared to admit it, then copy and paste this into your signature.
The HGSS Music Patch - The BW/2 Music Patch - ASM: Switch Music Based on Seasons
Romhack.me Profile - Pokecommunity Profile - Youtube Channel

Support me at my site!
Pokémon Platinum Red and Blue

karatekid552

What happens if I push it?....

Male
Do you really want to know? Really?
Seen January 12th, 2015
Posted December 14th, 2014
1,771 posts
10.5 Years
I just want to add that this took months to accomplish even with years of research to start on. So take that and go into an almost completely unresearched rom (in this area at least) and it will take a while, a long while.

Paired with Simba
Age 26
Male
Seen July 6th, 2019
Posted October 26th, 2016
252 posts
10.1 Years
I just want to add that this took months to accomplish even with years of research to start on. So take that and go into an almost completely unresearched rom (in this area at least) and it will take a while, a long while.
Yikes... Well I'm probably not going to be hacking for that long, so this is out of the boat then. Would it be possible to increase the size of the regional pokedex then without as much hassle as expanding the national pokedex?

GoGoJJTech

(☞゚ヮ゚)☞ http://GoGoJJTech.com ☜(゚ヮ゚☜)

Age 24
Female
Earth
Seen December 9th, 2016
Posted December 5th, 2016
2,475 posts
10.5 Years
Yikes... Well I'm probably not going to be hacking for that long, so this is out of the boat then. Would it be possible to increase the size of the regional pokedex then without as much hassle as expanding the national pokedex?
It could be a byte change like FR but, again, who knows? lol
I believe in Jesus Christ my Savior. If you do too, and aren't scared to admit it, then copy and paste this into your signature.
The HGSS Music Patch - The BW/2 Music Patch - ASM: Switch Music Based on Seasons
Romhack.me Profile - Pokecommunity Profile - Youtube Channel

Support me at my site!
Pokémon Platinum Red and Blue
Male
Seen February 22nd, 2023
Posted January 17th, 2023
91 posts
13.7 Years
Okay okay okay, I state this again: I did most of the research for emerald, I am also willing to post the data for it, actually I already posted my ported version of JPANs Save Block Recycle Hack somewhere in RD, for the german version of emerald I guess, it can be ported easily. I also repointed all of the required tables, for emerald you have to do some additional work, which would be: The second sprite table, containing all of the animated sprites(I don't know if the other one is even used, since there is only one pointer to it it could very well be deadcode); And the sprite animation table(The movements pokémon do when they are summoned) You can find the information in a common editors ini file or research them yourself. Also, there are several versions of malloc and free, whereas we are only interested in malloc. In emerald they use a version of it which instantly cleans up the memory space it provides you. It is locaded at: 0x08000b4c, I guess this is global for all of the roms, since those header adresses are compiled instantly. There is also an ldr instruction which is allocating the memory for emerald: 0x080BB65A (BPED, german), however afterwards follow a few routines which load global pokédex variables in a form of "ldr malloced_base + 0x6XX" and if you have too many Pokémon you will overwrite those and run into severe problems. Therefore you have to relocate them, as for me I wrote a quick tool to do that, just search for 4-aligned words in an area which I guess contains all of the routines and adding a static value to them. That for the memory in emerald...

There is also a very similar limiting thingie in emerald, a simple bhi instruction you can just bypass with 0x0000; It was posted for BPEE somewhere already, for BPED its 0x0806D430. Now for the interesting part, I have no clue what to do about the amount of pokémon that is loaded into the dex, there is something at 0x080BC94A, which loads a global variable onto the stack, using mov and lsl, if you do change that it will load more pokémon, you also have to change some statics like in Firered, but I don't know exactly which ones and as I said above between Deoxys and 412d there is weird data loaded into my dex... Thats the problem I am facing currently, concerning emerald, the rest can be done "fairly" easily.

Did someone look at my national order table and can tell me if it's correct or how it has to look like? I am kind of sure this is not the problem, but anyways, it is somehow strange, you know.

~SBird

Edit: The save block thingie: http://www.pokecommunity.com/showthread.php?t=306202 You can probably easily port it to BPEE, but you want to use different adresses, I recommend 0x0203d000 ff; Also if we discuss on emerald for longer(which I would be interested in, should'nt we go to RD? Just asking.

karatekid552

What happens if I push it?....

Male
Do you really want to know? Really?
Seen January 12th, 2015
Posted December 14th, 2014
1,771 posts
10.5 Years
Okay okay okay, I state this again: I did most of the research for emerald, I am also willing to post the data for it, actually I already posted my ported version of JPANs Save Block Recycle Hack somewhere in RD, for the german version of emerald I guess, it can be ported easily. I also repointed all of the required tables, for emerald you have to do some additional work, which would be: The second sprite table, containing all of the animated sprites(I don't know if the other one is even used, since there is only one pointer to it it could very well be deadcode); And the sprite animation table(The movements pokémon do when they are summoned) You can find the information in a common editors ini file or research them yourself. Also, there are several versions of malloc and free, whereas we are only interested in malloc. In emerald they use a version of it which instantly cleans up the memory space it provides you. It is locaded at: 0x08000b4c, I guess this is global for all of the roms, since those header adresses are compiled instantly. There is also an ldr instruction which is allocating the memory for emerald: 0x080BB65A (BPED, german), however afterwards follow a few routines which load global pokédex variables in a form of "ldr malloced_base + 0x6XX" and if you have too many Pokémon you will overwrite those and run into severe problems. Therefore you have to relocate them, as for me I wrote a quick tool to do that, just search for 4-aligned words in an area which I guess contains all of the routines and adding a static value to them. That for the memory in emerald...

There is also a very similar limiting thingie in emerald, a simple bhi instruction you can just bypass with 0x0000; It was posted for BPEE somewhere already, for BPED its 0x0806D430. Now for the interesting part, I have no clue what to do about the amount of pokémon that is loaded into the dex, there is something at 0x080BC94A, which loads a global variable onto the stack, using mov and lsl, if you do change that it will load more pokémon, you also have to change some statics like in Firered, but I don't know exactly which ones and as I said above between Deoxys and 412d there is weird data loaded into my dex... Thats the problem I am facing currently, concerning emerald, the rest can be done "fairly" easily.

Did someone look at my national order table and can tell me if it's correct or how it has to look like? I am kind of sure this is not the problem, but anyways, it is somehow strange, you know.

~SBird

Edit: The save block thingie: http://www.pokecommunity.com/showthread.php?t=306202 You can probably easily port it to BPEE, but you want to use different adresses, I recommend 0x0203d000 ff; Also if we discuss on emerald for longer(which I would be interested in, should'nt we go to RD? Just asking.
There is only one front sprite table that needs re-pointing and it is the one with the double framed 128x64 sprites. The other is actually a leftover from RSE. If you look closely at the images, they aren't the same as some sprites were changed for Emerald.

If you guys do manage to pull this off, I promise that I will code it.

Paired with Simba

GoGoJJTech

(☞゚ヮ゚)☞ http://GoGoJJTech.com ☜(゚ヮ゚☜)

Age 24
Female
Earth
Seen December 9th, 2016
Posted December 5th, 2016
2,475 posts
10.5 Years
There is only one front sprite table that needs re-pointing and it is the one with the double framed 128x64 sprites. The other is actually a leftover from RSE. If you look closely at the images, they aren't the same as some sprites were changed for Emerald.

If you guys do manage to pull this off, I promise that I will code it.
Emerald having leftover from rse lol
Aside from that typo, you'd have to test the JPAN save block hack on real hardware. I have a DSTWO, so maybe I can try it out for you.
I believe in Jesus Christ my Savior. If you do too, and aren't scared to admit it, then copy and paste this into your signature.
The HGSS Music Patch - The BW/2 Music Patch - ASM: Switch Music Based on Seasons
Romhack.me Profile - Pokecommunity Profile - Youtube Channel

Support me at my site!
Pokémon Platinum Red and Blue

karatekid552

What happens if I push it?....

Male
Do you really want to know? Really?
Seen January 12th, 2015
Posted December 14th, 2014
1,771 posts
10.5 Years
Emerald having leftover from rse lol
Aside from that typo, you'd have to test the JPAN save block hack on real hardware. I have a DSTWO, so maybe I can try it out for you.
Technically, the DSTWO uses an emulator on the NDS. It isn't actually real hardware.

When we say real hardware, specifically it is using a BIOS file, not actually hard, pushable buttons.:P

Paired with Simba

GoGoJJTech

(☞゚ヮ゚)☞ http://GoGoJJTech.com ☜(゚ヮ゚☜)

Age 24
Female
Earth
Seen December 9th, 2016
Posted December 5th, 2016
2,475 posts
10.5 Years
Technically, the DSTWO uses an emulator on the NDS. It isn't actually real hardware.
I can move it to an ezflash
I believe in Jesus Christ my Savior. If you do too, and aren't scared to admit it, then copy and paste this into your signature.
The HGSS Music Patch - The BW/2 Music Patch - ASM: Switch Music Based on Seasons
Romhack.me Profile - Pokecommunity Profile - Youtube Channel

Support me at my site!
Pokémon Platinum Red and Blue
Male
Seen October 24th, 2022
Posted September 19th, 2022
1,323 posts
16 Years
Emerald might be about 10% harder. Why? Cuz it's not as researched as FR. Even if it was, you'd have to debug all of the loading routines (sprites, icons, cries, everything you have to repoint) to remove limiters and find the malloc (assuming there is a malloc)
Then you'd have to research the dex, because its loading and storing is most likely 100% different from Fire Red's. Ruby would just take years because it's so unorganized.
Actually I've got some bad news, though I may be mistaken (and believe me, I hope I am):
I believe Jambo51 once said that Emerald's Pokédex is just as messed up as Ruby/Sapphire's, in the sense that it doesn't use the malloc system and that the pointers are hard coded and near-impossible to find. Jambo51 has tried expanding Ruby's Pokédex and he has stated that it is pretty much impossible because of how messy the coding is.

Not trying to be a party-pooper, as I would love to hack Ruby/Emerald as I have in the past, simply because I just like it more.
Male
Seen February 22nd, 2023
Posted January 17th, 2023
91 posts
13.7 Years
@Chaos Rush: Party hard:
Spoiler:

Emerald does use malloc, the thing is just that the global variables are linked in the form of "BASE_ADRESS + X" meaning you have to find A LOT of those and some are hard-hard-coded (or something^^) meaning that the compiler did not export the exact adress but only a mov-lsl instruction, which is good for saving space and bad for romhackers.

So yeah, it is possible, it is just some work but I am not willing to give up (by now)

~SBird

karatekid552

What happens if I push it?....

Male
Do you really want to know? Really?
Seen January 12th, 2015
Posted December 14th, 2014
1,771 posts
10.5 Years
@Chaos Rush: Party hard:
Spoiler:

Emerald does use malloc, the thing is just that the global variables are linked in the form of "BASE_ADRESS + X" meaning you have to find A LOT of those and some are hard-hard-coded (or something^^) meaning that the compiler did not export the exact adress but only a mov-lsl instruction, which is good for saving space and bad for romhackers.

So yeah, it is possible, it is just some work but I am not willing to give up (by now)

~SBird
In my own experience, I found pointers by writing a python script to do a little math. Meaning it would take a start and end offset, then search for every pointer for every offset in between and spit me back the results. You could do the same thing.

Paired with Simba
Male
Seen February 22nd, 2023
Posted January 17th, 2023
91 posts
13.7 Years
@Karatekid: Thats about what I did, what I did not so far is checking if those were the right ones, probably I am replacing a bit too much at the moment hehe... Also there are some I can't find just that way, because the offsets are even enough for the compiler to insert them via. mov/lsl. I guess I found all of them, because my dex is now working just fine, and I'll let you guys know if it really worked after some testing. If someone wants to do the same thing here is what I did so far:

-Repoint the national order table and moved the 25 slots between jotho and hoeen backwards, filling in 00 00 after the hoeen dex and creating the order for my new mons.
-Allocate 0x2000 bytes for the pokédex(You can probably do less)
-Kill the limiter which loads the dex data
-Add 0x700 to every 0x000006XX word I could find in the area that I think is the pokédex routines.
-Add 1 to each lsl rd, rm, #X instruction that I found out is responsible for the dex's global variables. I checked those with a debugger, so they are definitely it and I don't think there are more, since the dex is working just fine now.,

As ofr the 6XX stuff I wrote a quick program to do it, as karatekid already said. This was definitely easier, but I don't know if the stuff I changed really only affects the dex, and nothing else. I definitely chose a big area(0xbB6dc - 0xf0000)

So yeah, to conclude: Emerald is a lot harder, but it's not impossible!

~SBird

karatekid552

What happens if I push it?....

Male
Do you really want to know? Really?
Seen January 12th, 2015
Posted December 14th, 2014
1,771 posts
10.5 Years
@Karatekid: Thats about what I did, what I did not so far is checking if those were the right ones, probably I am replacing a bit too much at the moment hehe... Also there are some I can't find just that way, because the offsets are even enough for the compiler to insert them via. mov/lsl. I guess I found all of them, because my dex is now working just fine, and I'll let you guys know if it really worked after some testing. If someone wants to do the same thing here is what I did so far:

-Repoint the national order table and moved the 25 slots between jotho and hoeen backwards, filling in 00 00 after the hoeen dex and creating the order for my new mons.
-Allocate 0x2000 bytes for the pokédex(You can probably do less)
-Kill the limiter which loads the dex data
-Add 0x700 to every 0x000006XX word I could find in the area that I think is the pokédex routines.
-Add 1 to each lsl rd, rm, #X instruction that I found out is responsible for the dex's global variables. I checked those with a debugger, so they are definitely it and I don't think there are more, since the dex is working just fine now.,

As ofr the 6XX stuff I wrote a quick program to do it, as karatekid already said. This was definitely easier, but I don't know if the stuff I changed really only affects the dex, and nothing else. I definitely chose a big area(0xbB6dc - 0xf0000)

So yeah, to conclude: Emerald is a lot harder, but it's not impossible!

~SBird
Always check your offsets. If the offset%4 != 0, then skip it.

Also, I would make a list of changes (I'm sure you already did) and go through them slowly. You never want to replace too much. Check the surrounding areas for anything Pokedex related and then keep working. There shouldn't be more than about 10 changes (even that is a stretch) so yeah.

Edit: I just had a great idea! Keep a public Google doc and link to it here, so that we can follow your progress and then help you. don't allow the world to edit, just comment.

Paired with Simba

kearnseyboy6

Aussie's Toughest Mudder

Seen June 22nd, 2019
Posted November 19th, 2016
300 posts
14.4 Years
Hate to bump but here are some glitches I have noticed...

When you received an extended mon from a trade (eg Arceus for Giratina) then when you receive Giratina it has Arceus' (what's the plural form? haha) palette.

Also when I catch a wild Buizel, ONLY on the screen it displays say Ratatta, it then registers Buizel in the Pokedex and Ratatta does not get registered. It really doesn't bother me... just wondering if others experience this?
HOLIDAYING CURRENTLY!!

karatekid552

What happens if I push it?....

Male
Do you really want to know? Really?
Seen January 12th, 2015
Posted December 14th, 2014
1,771 posts
10.5 Years
Hate to bump but here are some glitches I have noticed...

When you received an extended mon from a trade (eg Arceus for Giratina) then when you receive Giratina it has Arceus' (what's the plural form? haha) palette.

Also when I catch a wild Buizel, ONLY on the screen it displays say Ratatta, it then registers Buizel in the Pokedex and Ratatta does not get registered. It really doesn't bother me... just wondering if others experience this?
The second is probably the result of not making the habitat table properly. The first.... well... none of us trade, lol.

Paired with Simba