Thread: Research: FireRed Pokédex Hacking
View Single Post
  #228    
Old March 8th, 2013, 02:29 PM
GoGoJJTech's Avatar
GoGoJJTech
アルファ近く
 
Join Date: Nov 2012
Location: Earth
Age: 15
Gender: Male
Nature: Quiet
Quote:
Originally Posted by Jambo51 View Post
There's a Malloc (Memory Allocation) in the lead up to the Pokédex routine. If you don't hack this to have the correct length of memory, the ROM will simply crash when it attempts to load the NATIONAL dex (The Kanto Dex is loaded separately, but uses the same Malloc as the National Dex).

The Pokédex's Malloc is specifically designed to support a maximum of 386 Pokémon, and you need to raise that limit to 411 to support the Unown remnants. (Among other complicated things too!).

The length of the malloc is determined at 0x1025EC, with a mov r0, #0xC1.

The safest way (and the way I did it personally) was to insert a small routine at this location which branches off to a custom routine.
This is the routine I would have used if I simply wanted the Unown Remnants to be included:

Code:
.text
.align 2
.thumb
.thumb_func
.global dexmemorylengthen
main:
 ldr r0, length
 bl there
 ldr r1, return
 bx r1
there: ldr r1, there2
 bx r1
.align
length: .word 0x00000CD8
return: .word 0x081025F5
there2: .word 0x08002B9D
To insert this routine, navigate to 0x1025EC, and change the code there to:

Code:
00 48 00 47 XX XX XX 08
Where the XXXXXX08 stands for your pointer to the routine plus 1 for thumb.

This should help, as everything else is more obvious, and this is the one thing which is truly quite well hidden.

EDIT: I should have said that the "length" is the number of Pokémon in your Pokédex multiplied by 8. So for an unexpanded Pokédex it would be:
(0x182 * 0x8) = 0xC10
For including the Unown remnants, it would be:
(0x19B * 0x8) = 0xCD8
For having 649 Pokémon, it would be:
(0x289 * 0x8) = 0x1448.
So what youre saying is if I put f68 (1ed *8) I can get 493 pokemon just like that after repointing the tables? The game doesnt freeze when i insert the asm, so it must have worked, but theres no way of making sure, because theres no way for me to record the last pokemon to the pokedex, and so i cant see the last pokemon (arceus) in the pokedex.
__________________

Last edited by GoGoJJTech; March 13th, 2013 at 04:59 PM.
Reply With Quote