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)
-   -   [FR] Expanding the Pokedex (https://www.pokecommunity.com/showthread.php?t=318569)

DoesntKnowHowToPlay January 31st, 2014 9:41 PM

[FR] Expanding the Pokedex
 
In this thread, I will explain how to expand the pokedex. You will need the following:

-A GBA emulator (or flashcart if you're crazy)
-An FR 1.0 English ROM
-JPAN's save block hack
-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.


Step 1: Get free RAM for the dex flags
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, install JPAN's save block hack to your ROM. It can be found here: http://www.pokecommunity.com/showpost.php?p=6993092&postcount=206

You will need to also disable the LR Help menu- otherwise, if the player opens it, they will corrupt all the newly saved memory. Do this by placing 1D E0 at x13b8c2.

Now, before doing anything else, you should decide how many pokedex entries and how many pokemon you want. These don't have to be the same- it's entirely possible to map multiple pokemon to a single dex entry, or have unmapped pokemon- 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'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. Now:

Change x104B10 to point to new SEEN flags.
Change x104B00 to 00 00.
Change x104B02 to 00 00.
This makes the game read using the new SEEN flags.

Change x104B5C to point to new CAUGHT flags.
Change x104B16 to 00 00.
Change x104B18 to 00 00.
Change x104B1A to 00 00.
Change x104B26 to 16 E0.
This makes the game read using the new CAUGHT flags.

Change x104B34 to 0F E0.
This makes both of the above bypass redundant SEEN flags.

Test. At this point, if you start a new file, your pokedex should refuse to open- this is because the game is writing to the old flags but reading the new flags.

Change x104B94 to point to new SEEN flags.
Change x104B6A to 01 1C.
Change x104B6C to 00 00.
Change x104B78 to 1A E0.
This makes the game write to the new SEEN flags.

Change x104BB8 to point to new CAUGHT flags.
Change x104BA2 to 01 1C.
Change x104BA4 to 00 00.
This makes the game write to the new CAUGHT flags.

Again, test. Your dex should work normally now, but it works on the new memory. If you fiddle with Memory Viewer you should be able to watch the flags get set, and set them yourself.

It's worth noting that normally, there are 3 sets of Seen flags. Why there are three sets is a mystery, but if you don't want to use JPAN's save hack for this, you can rewrite the method the game uses to access the flags and repurpose the redundant ones. I won't be explaining how to do that, though- you'll have to figure it out and write the routine yourself.

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 x549D0.
Put 20 1C 00 00 at x549b0.
Put XX 22 at x549b6, where XX is the number of bytes taken by your dex flags.
Put 20 1C at x549bc.
Put YY 30 at x549be, 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 x549c2, 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 pokedex. Your choice.


Step 2: Repoint goddamn everything
Spoiler:

Fire up Notepad and get ready to write out some offsets, we'll be here a while.

Repoint and expand the Pokemon name table.
This begins at x245EE0 and is 11 bytes per entry.
In vanilla, it is x11B4 bytes long.
There should be 40 pointers to it.

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

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

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

Test. If you put valid filler data in these tables, you should be able to get legit mons from the expanded slots and battle with them:

http://i.imgur.com/v5oV2zT.png

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

Repoint and expand the front sprite table.
This begins at x2350AC and is 8 bytes per entry.
To my knowledge, the latter four bytes are not used.
In vanilla, it is xDC0 bytes long.
There should be 28 pointers to it.

Repoint and expand the back sprite table.
This begins at x23654C 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 10 pointers to it.

Put 07 E0 at xed72.
Put 07 E0 at xf1b6.
These will break the limiters preventing sprites from showing up.

Test. You should get valid sprites, but with broken palettes and position data:

http://i.imgur.com/FUBZ8VZ.pnghttp://i.imgur.com/gTpVX4d.png

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

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

Put 04 E0 at x44104.
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 x235E6C, and is four bytes per mon.
Despite what Wichu's readme may have you believe, it's x6E0 bytes long.
There should be 8 pointers to it.

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

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

Put 03 E0 at x7472e.
Put 03 E0 at x7465e.
Put 06 E0 at x74788.
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 x3D37A0.
Four bytes per mon. 6E0 bytes long.

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

Put 00 00 at x96f90.
This should make the icon show up, but with the wrong palette.
Put 00 00 00 00 at x96e7a.
This fixes the palette reads for extended mons in the party menu.
Put 00 00 at x971da.
This will fix the palette reads for extended mons in the dex once we get there.

Once again, test.


Step 3: Dealing with dex entries
Spoiler:

Repoint and extend the national pokedex order.
This is a list at x251fee 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.
You don't have to worry about Kanto dex order- that's just the first 151 things in nat dex.
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 pokedex entries.
These is at x44E850.
Each entry is 36 (x24) bytes long.
The table has 387 entries (one for 00, oddly enough), or x366C bytes.
Unlike most other data, this is in actual pokedex order.

Test, make sure your dex functions normally.
You shouldn't be able to view entries past the regular ones though.

At x1025ec, you'll find a byte. This byte times eight is the amount of memory allocated for the pokedex.
If you have less than 510 mons, replace the byte with 1/2 your dex length.
If you have less than 1020 mons, set it to 1/4 your dex length and put 40 01 at x1025EE.
If you have more than 1020 mons, you should probably rethink what you're doing since 4-digit numbers aren't going to get along with the FR interface unless you do adjustments outside the scope of this tutorial.

At x103920, put the number of dex entries you have minus one.
If this is more than what got malloc'd, the game will crash.

At x43220, put 00 00.
Your dex should now load the full length:

http://i.imgur.com/1xpWQ4d.png

If it locks up, make sure every entry maps to something in dex ordering!


Step 4: Misc. repointing
Spoiler:

Change x88ea4 to the number of dex entries minus one.
This fixes the dex count on the title screen & trainer card.

Change x104c28 to the number of dex entries minus one.
This fixes the dex count on the pokedex menu.

Repoint the TM compatability table.
This is at x252bc8. Each entry is 8 bytes.
The table as a whole is xCE0 bytes long.

Repoint the tutor compatability table.
This is at x459B80. Each entry is two bytes.
The table as a whole is x338 bytes long.

Repoint the evolution table.
This is at x259754. Each entry is 40 (x28) bytes.
The table as a whole is x4060 bytes.

Repoint the item animation table.
This is at x45FD50.
Each entry is 5 bytes long. Entire thing is x811 bytes.

Put 07 E0 at xec9a.
This fixes the evolution animation.

Put E0 at x97011.
This fixes the stamps on the back of the trainer card.

At your own leisure, add the new entries to the habitats list.
This list is at x452c4c. More information can be found here: http://www.pokecommunity.com/showpost.php?p=6263014&postcount=75

Add cries for the new mons. As you may know, cries after Celebi are handled unusually- the limbo slots are all hard-wired to Unown's cry (doubt this is hard to fix but lazy), while slots starting from Treecko use an auxilary table to find their cry. This table is at x2539D4- repoint and extend it. Note that you don't need to repoint the cry table itself- immediately after it is a second, unused copy of the cry table.

You do need to repoint the cry table. You also need to repoint the secondary cry table, which is right after it and contains the same pointers with different accompanying data- this is used by the move Growl and possibly others.

Put 01 1C 11 E0 at x720CA. This will enable cries past #511 to function.

Repoint the footprint table. It can be found at x43FAB0, and is on a per-mon basis instead of a per-entry basis.
As such, it is x674 bytes long.

To fix breeding, write the ID of your last slot with meaningful evolution data at x459EC (pick an odd number; it's okay to go higher as long as it's not past the number of mons you actually have)
Then, write half of one less than that at x459CC.
If that requires more than one byte, write a quarter of one less than that instead, and change the x40 at x459CE to an x80.
If you are also expanding the number of evolutions, change the x28s at x4598A and x4598E to the new size of the evolution struct.

Given how many things need to be fixed, I probably missed something! Please let me know if you stumble upon anything not mentioned here.

GoGoJJTech February 1st, 2014 2:41 PM

Tested and works on another ROM, great. Thanks for the help Doesnt, really :D
Just that cries above 512 refuse to load up. It's a limit by the pointer to the cry conversion table.

karatekid552 February 1st, 2014 2:42 PM

Just putting this out there, I am going to add this entire thing to my hacking suite. I was planning to release this month, but with this new development, I may need to push back the release date. I hope nobody minds.:D

Shadowraze February 1st, 2014 3:06 PM

Quote:

Originally Posted by karatekid552 (Post 8072261)
Just putting this out there, I am going to add this entire thing to my hacking suite. I was planning to release this month, but with this new development, I may need to push back the release date. I hope nobody minds.:D

I don't mind at all. <:o

Well it's great to see awesome developments in hacking while I was gone. Would definitely try this out later to see if it works.

MrDollSteak February 1st, 2014 6:38 PM

Fantastic work Doesn't!

Good to see you've made the tutorial :)

Undeniably useful entry into the hacking world.

Kakarot1212 February 1st, 2014 7:45 PM

Nice! Will this be still okay with hacks that already worked on?

GoGoJJTech February 1st, 2014 7:52 PM

Quote:

Originally Posted by Hiroshi Kaede (Post 8072643)
Nice! Will this be still okay with hacks that already worked on?

It works on any FR v1.0, from fresh to done

ShyRayq February 1st, 2014 8:25 PM

God dammit Doesn't! Now I have to restart my hack..again, now that this tutorial has been made!

But seriously, great stuff right here. Great contributions to the hacking community.
I expect hacks with expanded dexs in a few months....

GoGoJJTech February 1st, 2014 9:37 PM

Quote:

Originally Posted by ShyRayq (Post 8072721)
God dammit Doesn't! Now I have to restart my hack..again, now that this tutorial has been made!

But seriously, great stuff right here. Great contributions to the hacking community.
I expect hacks with expanded dexs in a few months....

No need to restart at all. Just follow this with enough free space and you're good

kearnseyboy6 February 2nd, 2014 12:04 AM

I'm having real trouble understanding this step:
Spoiler:
Repoint and extend the national pokedex order.
This is a list at x251fee that denotes what dex entries mons get.
The main use of this is to give the scattered Hoenn mons proper order.
It is x4CA byte long, 2 per entry
Note that the limbo slots between Celebi and Treecko have entries on this table.
You don't have to worry about Kanto dex order- that's just the first 151 things in nat dex.
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.


0x4CA is 1226 or 613 bytes. Isn't there only 412 dex entries? I have simply added to the repointed table from entry no.387 (83 01) and gone up accordingly (84 01 85 01 86 01 87 01 88 01 etc..) Is this correct?

ShyRayq February 2nd, 2014 1:43 AM

Okay, I'm actually not sure about this so..

So, I followed the tut up to the repointing of Names,Data and Movesets.
As I was testing, I discovered that after I had caught and seen some Pokemon, then started a new game and got the Pokedex again, the data from the last save still existed. The Save-block didn't reset after starting a new game. So the only solution I can see is to delete the actual .sav file, or JPAN's hack has to be altered. Or, the solution is actually in a later part of the tutorial.

Sniper February 2nd, 2014 4:30 AM

Aaaah. My FireRed version.. I need to restart all over again D: Good work anyways.

GoGoJJTech February 2nd, 2014 5:00 AM

Quote:

Originally Posted by Saturnus (Post 8073302)
Aaaah. My FireRed version.. I need to restart all over again D: Good work anyways.

Ya don't need to start over guys. Why would you? K did this half through my hack and it's done fine now.

Quote:

Originally Posted by kearnseyboy6 (Post 8073027)
I'm having real trouble understanding this step:
Spoiler:
Repoint and extend the national pokedex order.
This is a list at x251fee that denotes what dex entries mons get.
The main use of this is to give the scattered Hoenn mons proper order.
It is x4CA byte long, 2 per entry
Note that the limbo slots between Celebi and Treecko have entries on this table.
You don't have to worry about Kanto dex order- that's just the first 151 things in nat dex.
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.


0x4CA is 1226 or 613 bytes. Isn't there only 412 dex entries? I have simply added to the repointed table from entry no.387 (83 01) and gone up accordingly (84 01 85 01 86 01 87 01 88 01 etc..) Is this correct?

You have to go up after 440. Up to 440 is already used in the game, so adding will occupy slots 441 and up.

Quote:

Originally Posted by ShyRayq (Post 8073121)
Okay, I'm actually not sure about this so..

So, I followed the tut up to the repointing of Names,Data and Movesets.
As I was testing, I discovered that after I had caught and seen some Pokemon, then started a new game and got the Pokedex again, the data from the last save still existed. The Save-block didn't reset after starting a new game. So the only solution I can see is to delete the actual .sav file, or JPAN's hack has to be altered. Or, the solution is actually in a later part of the tutorial.

Either delete the. Sav or your ram areas are not right.

DoesntKnowHowToPlay February 2nd, 2014 6:38 AM

Quote:

Originally Posted by kearnseyboy6 (Post 8073027)
I'm having real trouble understanding this step:
Spoiler:
Repoint and extend the national pokedex order.
This is a list at x251fee that denotes what dex entries mons get.
The main use of this is to give the scattered Hoenn mons proper order.
It is x4CA byte long, 2 per entry
Note that the limbo slots between Celebi and Treecko have entries on this table.
You don't have to worry about Kanto dex order- that's just the first 151 things in nat dex.
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.


0x4CA is 1226 or 613 bytes. Isn't there only 412 dex entries? I have simply added to the repointed table from entry no.387 (83 01) and gone up accordingly (84 01 85 01 86 01 87 01 88 01 etc..) Is this correct?

I messed up- it's x336 bytes. Thanks. Whatever you're grabbing should end with 82 01 66 01, the dex numbers of Deoxys and Chimecho.

That said, when you put it in the ROM you should take care to leave the next 28 entries blank unless you want to deal with the Egg and secondary Unown slots.


Quote:

As I was testing, I discovered that after I had caught and seen some Pokemon, then started a new game and got the Pokedex again, the data from the last save still existed. The Save-block didn't reset after starting a new game. So the only solution I can see is to delete the actual .sav file, or JPAN's hack has to be altered. Or, the solution is actually in a later part of the tutorial.
I'll look into this. It's happening on my cart too, probably because the game loads the save at the main menu so it can display your pokedex total but doesn't clear that area when you select New Game because...well why would it clear the LR menu's buffer?

karatekid552 February 2nd, 2014 7:12 AM

Quote:

Originally Posted by DoesntKnowHowToPlay (Post 8073441)
I messed up- it's x336 bytes. Thanks. Whatever you're grabbing should end with 82 01 66 01, the dex numbers of Deoxys and Chimecho.

That said, when you put it in the ROM you should take care to leave the next 28 entries blank unless you want to deal with the Egg and secondary Unown slots.


I'll look into this. It's happening on my cart too, probably because the game loads the save at the main menu so it can display your pokedex total but doesn't clear that area when you select New Game because...well why would it clear the LR menu's buffer?

I'm fairly certain that in the function that clears the ram, there is an offset & number of 00s to fill with. If we could add just one more offset and number, it would work.

DoesntKnowHowToPlay February 2nd, 2014 7:59 AM

So it turns out the dex actually doesn't get wiped until after Oak finishes his rant at the start of the game. There's a few solutions to this problem- the laziest one would be to just make a level script in the first room that uses writebytetooffset to clear out the dex flags, but we can also just repurpose existing code instead by doing the following:

(note that this requires your Seen and Caught flags to be within xFF bytes of each other)

Put a pointer to whichever set of flags comes first at x549D0.
Put 02 1C 20 1C 00 00 at x549b0.
Put XX 22 at x549b6, where XX is the number of bytes taken by your dex flags.
Put 20 1C at x549bc.
Put YY 30 at x549be, 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 x549c2, where XX is the number of bytes taken by your dex flags.

ShyRayq February 2nd, 2014 11:22 PM

Okay, more stuff coming from me.

So, I did the changes that would reset the save block, but when I edited the bytes, lots of...strange things started happening.
When I press "Start", my player's name is invisible, whenever I talk to anything, I get a bunch of blank text and gibberish, when I initiate the Oak script, the text blanks out halfway through the text and I get more gibberish.
And I know that this is the changes, because if I reset those changes to the hex, everything goes back to normal.

Just in case anyone can figure out what is wrong with my save block, here's some basic info:
SEEN FLAG: 0203C000, CAUGHT FLAG: 0203C04B
XX: either 4B or 96
YY: either 4B or 96 > (your wording was a tiny bit confusing to understand so I'm not sure which one it is)

DoesntKnowHowToPlay February 3rd, 2014 7:28 AM

I typo'd the value at x549B0- it's supposed to be 20 1C, not 02 1C. Testing seems to indicate it's what's causing your problems. Sorry about that.

~Ɓαitøt~ February 3rd, 2014 7:48 AM

Thank you for this tutorial.... Finally, the flags views / captured ^^

Kawaii Shoujo Duskull February 3rd, 2014 12:39 PM

This is amazing. Nice tutorial! ^^
If I ever start on my own hack, I'll definitely try this out. :D

karatekid552 February 5th, 2014 6:06 PM

I am coding this into my program right now. I have finished step 2, but when I went to go test, OAK's intro kept crashing. I went through my code and found that the issue was caused by filling the old palette table for sprites with FF. There is a pointer at 0x130fa4 that points to an index 232 bytes in on the table. You only need to change this pointer if you fill the old table with FF.

kearnseyboy6 February 6th, 2014 3:55 AM

Quote:

Originally Posted by karatekid552 (Post 8079593)
I am coding this into my program right now. I have finished step 2, but when I went to go test, OAK's intro kept crashing. I went through my code and found that the issue was caused by filling the old palette table for sprites with FF. There is a pointer at 0x130fa4 that points to an index 232 bytes in on the table. You only need to change this pointer if you fill the old table with FF.

Thanks! That's very handy to know for myself, but doesn't this also mean there are potentially more sprites that use the palette table as well, or is Oak the only one?

Also I found the Item animation table is at 0x45FD54 instead, and the tutor compatibility is at 0x459B7E. No rush as I'm sure people will find it anyway! :)

EDIT: Sorry KK552, it was referencing the nidoranF palette, so this means when you fill your Front sprites you need to repoint the Nidoran sprite right before the palette which is at 0x130FA0 :)

Tetra February 19th, 2014 2:55 PM

Hmm... I've tried this countless of times, but it seems that I keep repointing something wrong. And I've even gotten help from GoGo (thanks) but for some reason it just doesn't want to work! It would be great if someone could make a patch so that there are 493 slots, thanks. c:

karatekid552 February 19th, 2014 9:28 PM

Quote:

Originally Posted by Zeratul (Post 8103910)
Hmm... I've tried this countless of times, but it seems that I keep repointing something wrong. And I've even gotten help from GoGo (thanks) but for some reason it just doesn't want to work! It would be great if someone could make a patch so that there are 493 slots, thanks. c:

Thanks for that super descriptive description of your issue. What isn't working?


BTW, my newest program supports this. So a patch won't be needed. I'm planning a release in a few days.

Tetra February 20th, 2014 7:57 AM

Quote:

Originally Posted by karatekid552 (Post 8104463)
Thanks for that super descriptive description of your issue. What isn't working?


BTW, my newest program supports this. So a patch won't be needed. I'm planning a release in a few days.

Hehe, no problem. I found out I was doing something very wrong, so I've corrected that. c:

Ah, sweet! I can't wait to test it out, been hearing a lot about it :3

Anaximandro February 20th, 2014 2:03 PM

I know you said you wouldn't explain the hex editing basics but can you post a link to some where i could learn hex editing, also how do you install JPAN's hack?

GoGoJJTech February 20th, 2014 2:04 PM

Quote:

Originally Posted by Anaximandro (Post 8105534)
I know you said you wouldn't explain the hex editing basics but can you post a link to some where i could learn hex editing, also how do you install JPAN's hack?

Hex editing is as easy as typing numbers.. :D
And JPAN's hacked engine is as easy as applying the patch then using the tool to customize.

Anaximandro February 20th, 2014 2:11 PM

How do i know what numbers to type and where to type them, also i downloaded goldfinger but what hex editor would you recommend?
Thanks

GoGoJJTech February 20th, 2014 2:12 PM

Quote:

Originally Posted by Anaximandro (Post 8105558)
How do i know what numbers to type and where to type them, also i downloaded goldfinger but what hex editor would you recommend?
Thanks

I'd recommend HxD. Plus it's free so.. ;)

Anaximandro February 20th, 2014 2:15 PM

Sorry for being annoying but how do i patch the hack onto fire red?
oh, and thank you for all the help.

karatekid552 February 20th, 2014 2:38 PM

Quote:

Originally Posted by gogojjtech (Post 8105538)
Hex editing is as easy as typing numbers.. :D
And JPAN's hacked engine is as easy as applying the patch then using the tool to customize.

gogo, the tool is for installing his engine on roms that have already been hacked and that you don't want to lose. It is either the patch or the tool. Using both can get weird.

Anaximandro February 20th, 2014 3:41 PM

so i only need to patch it?

You were doing the 649 patch right, how do i download it to try it out?

Kawaii Shoujo Duskull February 20th, 2014 3:43 PM

Quote:

Originally Posted by Anaximandro (Post 8105573)
Sorry for being annoying but how do i patch the hack onto fire red?
oh, and thank you for all the help.



To patch the hacked engine onto FireRed, download a patching tool like LunarIPS or SmartIPS, then use them to apply the patch to the rom. (the method of applying the patch using a program like that might vary, I'm not sure really.)
Or download JPAN's hack applier tool and use it to apply all the hacks (or whatever ones you want to apply) onto a rom.
I hope that helps. ^^

karatekid552 February 20th, 2014 4:46 PM

Quote:

Originally Posted by Anaximandro (Post 8105720)
so i only need to patch it?

You were doing the 649 patch right, how do i download it to try it out?

You don't want to. The patch is beyond repair, but it's features are being broken up and put into different projects.

Kikispoke February 23rd, 2014 3:35 AM

Good tutorial but how to you install the save_block_recycle hack to fire red?
I did hex work before and programming but i don't get it.
Im using Hex Workshop as a hex editor.
EDIT:
Ok i read the above posts but i cant find JPAN's hack applier tool and Lunar and smart IPS need a ips file to work!
EDIT AGAIN:
Ok i found JPAN's applier tool but when i apply the patches my maps are messed up!!
Is there An other way of doing this? And sorry that im kind of annoying right now.

karatekid552 February 23rd, 2014 10:44 AM

Quote:

Originally Posted by Kikispoke (Post 8110391)
Good tutorial but how to you install the save_block_recycle hack to fire red?
I did hex work before and programming but i don't get it.
Im using Hex Workshop as a hex editor.
EDIT:
Ok i read the above posts but i cant find JPAN's hack applier tool and Lunar and smart IPS need a ips file to work!
EDIT AGAIN:
Ok i found JPAN's applier tool but when i apply the patches my maps are messed up!!
Is there An other way of doing this? And sorry that im kind of annoying right now.

JPAN has a save block hack and then a hacked engine. He has two hacks. You need the save block hack.

GoGoJJTech February 23rd, 2014 12:38 PM

Quote:

Originally Posted by Kikispoke (Post 8110391)
Good tutorial but how to you install the save_block_recycle hack to fire red?
I did hex work before and programming but i don't get it.
Im using Hex Workshop as a hex editor.
EDIT:
Ok i read the above posts but i cant find JPAN's hack applier tool and Lunar and smart IPS need a ips file to work!
EDIT AGAIN:
Ok i found JPAN's applier tool but when i apply the patches my maps are messed up!!
Is there An other way of doing this? And sorry that im kind of annoying right now.

http://www.romhackersonline.com/social/downloads/view/jpan-039-s-save-block-patch/
A link is better for those who want to download it ;D

GOLDstandard February 23rd, 2014 4:23 PM

Jpan's save block hack for the expanded seen/caught flags doesn't break GBA flashcart compatibility right?

Oh, and congrats Doesn't! I'm very happy to see that the expanded pokedex will be a reality. :)

GoGoJJTech February 23rd, 2014 4:24 PM

Quote:

Originally Posted by GOLDstandard (Post 8111419)
Jpan's save block hack for the expanded seen/caught flags doesn't break GBA flashcart compatibility right?

Oh, and congrats Doesn't! I'm very happy to see that the expanded pokedex will be a reality. :)

Yes, it has been tested on real hardware. :D

LanceD February 25th, 2014 2:23 AM

Very nice tutorial. Might give it a try someday when I work up the courage! LOL

I'm surprised someone hasn't created a tool for this yet though, that does all this for us, as well as a tool fort adding extra Pokémon and types to the games so we don't have to go through and fiddle with all the hex code manually ourselves.

Would be nice to have a tool where we can just import an image for the new type, define a name, type weaknesses and strengths, and everything else a type needs, and then the tool to auto-find free space in the rom and add the newly made type(s) in.

Same for adding Pokémon and expanding the Pokédex.

Or would such tools be too difficult to make?

Don't pay any attention to me LOL I'm just dreaming aloud {XD}

GoGoJJTech February 25th, 2014 12:33 PM

Quote:

Originally Posted by LanceD (Post 8113948)
Very nice tutorial. Might give it a try someday when I work up the courage! LOL

I'm surprised someone hasn't created a tool for this yet though, that does all this for us, as well as a tool fort adding extra Pokémon and types to the games so we don't have to go through and fiddle with all the hex code manually ourselves.

Would be nice to have a tool where we can just import an image for the new type, define a name, type weaknesses and strengths, and everything else a type needs, and then the tool to auto-find free space in the rom and add the newly made type(s) in.

Same for adding Pokémon and expanding the Pokédex.

Or would such tools be too difficult to make?

Don't pay any attention to me LOL I'm just dreaming aloud {XD}

Under our influence, Karatekid552's gen 3 hacking suite does this now. Also, adding a type is so easy, just import the image and edit the type effectiveness chart. But Eggs will use the type as of now so..

karatekid552 February 25th, 2014 3:20 PM

Quote:

Originally Posted by gogojjtech (Post 8114698)
Under our influence, Karatekid552's gen 3 hacking suite does this now. Also, adding a type is so easy, just import the image and edit the type effectiveness chart. But Eggs will use the type as of now so..

Under your influence??? Well, I guess so:P As soon as I saw this tut, I just had to start coding, lol.

I do like the idea of expanding types in my tool also. Only, if I am going to do it, I need a clean way to do it on RSE without breaking contests.

LanceD February 26th, 2014 3:40 AM

What a gem of a program that is :)

I like the fact that the program searches for free space, so one doesn't have to do so manually.

Anaximandro February 26th, 2014 3:52 AM

Can i add fairy type after useing your III GEN tool to add more pokemon?

GoGoJJTech February 26th, 2014 12:26 PM

Quote:

Originally Posted by Anaximandro (Post 8115821)
Can i add fairy type after useing your III GEN tool to add more pokemon?

The tool itself can't add types yet, but if you add it by hand (not hard) then you can make Pokemon that use it.

karatekid552 February 26th, 2014 3:48 PM

So, I think we should stop discussing my tool on this thread. This thread is for this tutorial, which my tool directly followed, so that was the only reason I brought it up. Now we should get back on topic. Okay guys?

LanceD February 27th, 2014 9:59 AM

I'm not really looking to expand the total amount of Pokémon in the game in general, though, but rather to raise the number of entries in the Kanto Pokédex to something above 151.

Is there a tool that does this?

GoGoJJTech February 27th, 2014 2:25 PM

Quote:

Originally Posted by LanceD (Post 8117973)
I'm not really looking to expand the total amount of Pokémon in the game in general, though, but rather to raise the number of entries in the Kanto Pokédex to something above 151.

Is there a tool that does this?

There's no tool, but it's a simple byte edit. I forget where, but if you search on the forums you'll find it.

kearnseyboy6 February 28th, 2014 4:10 PM

Just curious... Anyone who has expanded these entries have a broken 'Trader ADvanced'? I would like to edit this trades but since the expansion, all my back ups have this tool broken.

GoGoJJTech February 28th, 2014 4:48 PM

Quote:

Originally Posted by kearnseyboy6 (Post 8120315)
Just curious... Anyone who has expanded these entries have a broken 'Trader ADvanced'? I would like to edit this trades but since the expansion, all my back ups have this tool broken.

I've never used it, but I think by what you said that the tool limits at chimecho.

kearnseyboy6 March 1st, 2014 4:46 AM

Quote:

Originally Posted by gogojjtech (Post 8120376)
I've never used it, but I think by what you said that the tool limits at chimecho.

Yes Sorry the tool is broken, but hex editing still works.

GoGoJJTech March 1st, 2014 9:31 AM

Quote:

Originally Posted by kearnseyboy6 (Post 8121218)
Yes Sorry the tool is broken, but hex editing still works.

Hex editing will always work. No reason it won't. :D

SBird March 6th, 2014 1:28 PM

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

~Ɓαitøt~ March 7th, 2014 4:40 AM

Quote:

Originally Posted by SBird (Post 8130736)
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.

AtecainCorp. March 7th, 2014 11:39 AM

Can you make an version of this Tutorial for Pokemon RSE?

~Ɓαitøt~ March 7th, 2014 11:46 AM

Quote:

Originally Posted by Ksiazek Bartlomiej (Post 8132085)
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 March 7th, 2014 4:18 PM

Quote:

Originally Posted by ~Ɓαitøt~ (Post 8132096)
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

HidoranBlaze March 7th, 2014 4:23 PM

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.

GoGoJJTech March 7th, 2014 4:36 PM

Quote:

Originally Posted by HidoranBlaze (Post 8132408)
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.

karatekid552 March 7th, 2014 4:58 PM

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.

HidoranBlaze March 7th, 2014 5:47 PM

Quote:

Originally Posted by karatekid552 (Post 8132459)
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 March 7th, 2014 6:23 PM

Quote:

Originally Posted by HidoranBlaze (Post 8132530)
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

~Ɓαitøt~ March 8th, 2014 1:42 AM

In fact, I've never worked on Ruby or Sapphire, but I was convinced that the construction of the game had great common with Emerald. Excuse me x).

SBird March 8th, 2014 3:03 AM

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 March 8th, 2014 5:55 AM

Quote:

Originally Posted by SBird (Post 8133106)
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.

GoGoJJTech March 8th, 2014 8:17 AM

Quote:

Originally Posted by karatekid552 (Post 8133265)
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.

karatekid552 March 8th, 2014 9:09 AM

Quote:

Originally Posted by gogojjtech (Post 8133407)
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

GoGoJJTech March 8th, 2014 9:10 AM

Quote:

Originally Posted by karatekid552 (Post 8133469)
Technically, the DSTWO uses an emulator on the NDS. It isn't actually real hardware.

I can move it to an ezflash

Chaos Rush March 8th, 2014 11:54 AM

Quote:

Originally Posted by gogojjtech (Post 8132427)
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.

SBird March 8th, 2014 2:17 PM

@Chaos Rush: Party hard:

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 March 8th, 2014 5:09 PM

Quote:

Originally Posted by SBird (Post 8133791)
@Chaos Rush: Party hard:

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.

SBird March 9th, 2014 6:06 AM

@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 March 9th, 2014 8:17 AM

Quote:

Originally Posted by SBird (Post 8134825)
@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.

kearnseyboy6 March 25th, 2014 5:22 AM

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?

karatekid552 March 25th, 2014 2:53 PM

Quote:

Originally Posted by kearnseyboy6 (Post 8165118)
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.

MrDollSteak March 25th, 2014 4:36 PM

Quote:

Originally Posted by karatekid552 (Post 8166065)
The second is probably the result of not making the habitat table properly. The first.... well... none of us trade, lol.

Actually I fear the second may be something else entirely.
When I messed around with habitat data myself before your tool came out,
I noticed that no matter what Pokemon I caught, it'd display the first page
of the first habitat.
I think that's why it's showing Rattata, because Rattata'd be the first pokemon
in the grassland.
My worry is that there's some sort of byte somewhere in the midst of the
habitat data that when expanded, repointed or rearranged leads to catching
problems.
(This was actually one of the glitches that got me started on ASM, I just
haven't looked into it since.)

Deokishisu March 25th, 2014 8:50 PM

Even if nobody trades with each other, it's going to be an important issue for ingame trades, and should be fixed if you leave in the possibility for the player to trade at all.

Artemis64 March 26th, 2014 12:48 AM

Is it possible to port this to another ROM, say, Ruby?
Also, can you please post the methods you used to obtain your offsets (like the offset containing the amount of memory assigned for the Pokédex, I certainly haven't found that in any INIs) so that others can try porting this to other ROMs?

GoGoJJTech March 26th, 2014 2:26 PM

Quote:

Originally Posted by Artemis64 (Post 8167012)
Is it possible to port this to another ROM, say, Ruby?
Also, can you please post the methods you used to obtain your offsets (like the offset containing the amount of memory assigned for the Pokédex, I certainly haven't found that in any INIs) so that others can try porting this to other ROMs?

Ruby doesn't have a malloc system to store the dex info, so no, it's almost impossible on Ruby. The code is so messy you'll get lost in it.

AtecainCorp. April 13th, 2014 3:11 AM

But why do not take an courage and start changing system from messy code to Maloc system. For example exported from Emerald.

karatekid552 April 13th, 2014 8:44 AM

Quote:

Originally Posted by Ksiazek Bartlomiej (Post 8196202)
But why do not take an courage and start changing system from messy code to Maloc system. For example exported from Emerald.

Says the guy with no programming experience...... and whom refuses to get any.


No, it is not that easy. That would be removing and porting about 1000 lines of code or more in raw ASM to another game in a way where it might not even work. It would be easier to write a completely new Pokedex in C and insert it.

LCCoolJ95 April 14th, 2014 7:36 AM

Quote:

Originally Posted by karatekid552 (Post 8196514)
Says the guy with no programming experience...... and whom refuses to get any.


No, it is not that easy. That would be removing and porting about 1000 lines of code or more in raw ASM to another game in a way where it might not even work. It would be easier to write a completely new Pokedex in C and insert it.

It requires C, or C++? Or is it the same thing? Sorry if that's a dumb question.

The truth is, I've been busy with school, karate, family, and I have been trying to learn how to program in my free time because...I'm going to try and port this, over to Emerald...well, not really port, but give Emerald its own version. SBird has it working for a German Emerald ROM, so why can't it work for an English Emerald ROM? So, I've been learning how to ASM program and a little bit of C++.

@Ksiazek Bartlomiej, I'm not trying to flame you or anything, I'm just saying, you should really look into ASM programming. I looked at it for a brief few minutes. It looks hard at first, but it's pretty simple if you get a handle on it

karatekid552 April 14th, 2014 4:26 PM

Quote:

Originally Posted by LCCoolJ95 (Post 8197902)
It requires C, or C++? Or is it the same thing? Sorry if that's a dumb question.

The truth is, I've been busy with school, karate, family, and I have been trying to learn how to program in my free time because...I'm going to try and port this, over to Emerald...well, not really port, but give Emerald its own version. SBird has it working for a German Emerald ROM, so why can't it work for an English Emerald ROM? So, I've been learning how to ASM program and a little bit of C++.

@Ksiazek Bartlomiej, I'm not trying to flame you or anything, I'm just saying, you should really look into ASM programming. I looked at it for a brief few minutes. It looks hard at first, but it's pretty simple if you get a handle on it

C++ is C with object orientated programming tacked on (that is why the syntax is a bit more awkward when compared to other object orientated languages). The compiler for GBA, as far as I know, is only C, but you can apply most of C++, just skip the objects.

kearnseyboy6 April 22nd, 2014 3:41 AM

This could be a huge bug if other are getting this, but Eggs won't hatch when given to the player.

DoesntKnowHowToPlay April 23rd, 2014 6:54 PM

It turns out there are two pointers to x254795 in the ROM, which is the 18th byte of the first entry of the base stat table. This is what's causing the eggs to not hatch- they're actually working fine, they just have a nonsensically high number of cycles needed to hatch. I'll add this to the OP real quick. (existing rock eggs won't be fixed because cycle count is determined at egg gen)

karatekid552 April 23rd, 2014 8:16 PM

Quote:

Originally Posted by DoesntKnowHowToPlay (Post 8213051)
It turns out there are two pointers to x254795 in the ROM, which is the 17th byte of the first entry of the base stat table. This is what's causing the eggs to not hatch- they're actually working fine, they just have a nonsensically high number of cycles needed to hatch. I'll add this to the OP real quick. (existing rock eggs won't be fixed because cycle count is determined at egg gen)

You guys are lucky I keep tabs on this thread.:P In the first post, you said 18th byte. In this one you said 17th. Ummm... The math says 17 to me, but I just need to make sure. I'm adding this to G3HS right now.

DoesntKnowHowToPlay April 23rd, 2014 9:12 PM

It's the 18th byte, or byte #17 if you start counting from zero. Sorry about that.

karatekid552 April 24th, 2014 7:27 AM

Quote:

Originally Posted by DoesntKnowHowToPlay (Post 8213317)
It's the 18th byte, or byte #17 if you start counting from zero. Sorry about that.

I coded it as statsoffset + 17, so that should work. Don't worry about it and keep me posted if anything else comes up.:)

ThomasWinwood April 24th, 2014 3:26 PM

Quote:

Originally Posted by DoesntKnowHowToPlay (Post 8071173)
Add cries for the new mons. As you may know, cries after Celebi are handled unusually- the limbo slots are all hard-wired to Unown's cry (doubt this is hard to fix but lazy), while slots starting from Treecko use an auxilary table to find their cry. This table is at x2539D4- repoint and extend it. Note that you don't need to repoint the cry table itself- immediately after it is a second, unused copy of the cry table.

Something about this seems wrong. I don't see any second copies of the table in the disassembly, used or otherwise.

This is the routine that handles converting the internal ID into the cry ID, taken from knizz' disassembly and commented by me:

Code:

speciesid_conv:
    push {lr}
    lsl r0, r0, #0x10  @ typecasting
    lsr r0, r0, #0x10
    movs r1, r0
    cmp r0, #250        @ slots up to 250 have the same cry ID as the internal ID
    bls loc_8043332
    ldr r0, dword_8043324
    cmp r1, r0          @ is this slot 275 or below?
    bls loc_8043330    @ if so, branch
    ldr r0, off_8043328 @ otherwise, use the table
    ldr r2, dword_804332C
    add r1, r1, r2      @ subtract 276 from ID
    lsl r1, r1, #1      @ and multiply by two, since it's a table of 16-bit values
    add r1, r1, r0      @ then index into the table
    ldrh r0, [r1]      @ retrieve the value
    b loc_8043332      @ and leave
@ ---------------------------------------------------------------------------
dword_8043324:  .long 275
off_8043328:    .long 0x082539D4
dword_804332C:  .long -276
@ ---------------------------------------------------------------------------

loc_8043330:
    mov r0, #200        @ limbo slots use Unown's cry

loc_8043332:
    pop {r1}
    bx r1
@ End of function speciesid_conv


The table at x2539D4 is followed by the first experience curve table - there is no secondary cry table.

Editing this routine to remove the hardcoded cry for the limbo slots is easy: write 00 00 00 00 00 00 00 00 00 00 (that's ten bytes) to x4330C and 00 00 00 00 (four) to x43318, then repoint the table at x4539D4 and expand it - it's now a table with one word for every ID. (You can test to make sure that it worked without repointing the table - you'll know it worked if the title screen makes Blaziken's cry.)

Danny0317 May 9th, 2014 8:36 PM

Yeah well I have a question about this, if anyone could answer it then great.
I made a thread about it in the beginner's lounge, so here it is.

http://www.pokecommunity.com/showthread.php?t=325967

or

Spoiler:
Now I know that the tool Advanced IntroEd exists, but I wanna make it a Pokemon from the expanded dex, but seeing that Advanced IntroEd doesn't have an ini.. I can't. I assumed it would be maximum about 4 byte changes, since it's just the Pokemon, I'm gonna do the cry later, but that wasn't what happened. So I tried this in a clean rom: (1D is Nidoran F, 1E is Nidorina and the things in yellow are the changes)


Now, say for my hack I want to add Turtwig, whose index number is 1B8 or 440. How would I do that? Thanks.

Zepkhan May 23rd, 2014 4:42 PM

I'm new to this, how do I use the JPAN block changer?

GoGoJJTech May 23rd, 2014 7:48 PM

Quote:

Originally Posted by Zepkhan (Post 8265538)
I'm new to this, how do I use the JPAN block changer?

It's called the save block patch, and I have it right here: https://www.dropbox.com/s/4l91qcr9xgbx8y2/JPAN%20save_block_recycle.ips

Zepkhan June 4th, 2014 4:57 PM

Got 1 more question: what value do I make the SEEN/CAUGHT pointers?

Spherical Ice June 5th, 2014 12:56 AM

I'm unsure if I should post this in G3HS' thread, but I myself have tried to go backwards from what the tool has done and nothing appears to be amiss.

The extended Pokémon in my ROM have broken altitudes, basically. If I change the value to be > 0, the shadow displays, but the sprite stays where it is. If I set it to 0, the shadow disappears, so that is working. However, regardless of the value, the sprites remain "stuck" to the ground. I've tried re-repointing the altitude table, the 03 E0 byte changes on the OP have been done successfully, and it's obviously registering that there is an altitude value, it just isn't using it.

http://i.imgur.com/hn7STuM.png

I've also tried editing the altitude using Advanced Series and simply using a hex editor, so the value is definitely changing. I feel like I'm missing a limiting byte or something, but I can't seem to find what it is exactly.

This only happens to the extended Pokémon in my ROM: with Chimecho, it's fine, but with Turtwig, it doesn't work.

DoesntKnowHowToPlay June 5th, 2014 5:09 AM

Try putting 06 E0 at x74788.

Spherical Ice June 5th, 2014 7:39 AM

Quote:

Originally Posted by DoesntKnowHowToPlay (Post 8286657)
Try putting 06 E0 at x74788.

That fixed it! Thanks Doesnt!

GoGoJJTech June 5th, 2014 11:27 AM

Quote:

Originally Posted by Zepkhan (Post 8286112)
Got 1 more question: what value do I make the SEEN/CAUGHT pointers?

All you gotta do is point them to the seen/caught flags. Nothing hard

bimbimthiensu June 13th, 2014 2:14 AM

my english is not good, and I can not understand the steps. you can make a video tutorial for me? thanks

Chaos Rush June 18th, 2014 4:04 PM

Doesnt himself told me this so I'm just going to post it here so I don't have to save it somewhere:

For FireRed, to fix cries on expanded mons that use a cry index of higher than 0x200, put 01 1C 11 E0 at x720CA.

GoGoJJTech June 18th, 2014 4:51 PM

Quote:

Originally Posted by Chaos Rush (Post 8307276)
Doesnt himself told me this so I'm just going to post it here so I don't have to save it somewhere:

For FireRed, to fix cries on expanded mons that use a cry index of higher than 0x200, put 01 1C 11 E0 at x720CA.

isn't this in the first post somewhere


All times are GMT -8. The time now is 8:12 PM.


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.