Thread: Research: FireRed Pokédex Hacking
View Single Post
Old September 6th, 2011 (4:11 AM).
tinix's Avatar
tinix tinix is offline
PearlShipper & C Programmer
    Join Date: Feb 2010
    Location: Bratislava, Slovakia
    Age: 20
    Gender: Male
    Posts: 86
    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:

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

    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.
    Thank you very much I will try it ASAP
    Pokémon games I own:
    Pokémon Diamond
    Pokémon Platinum
    Pokémon Ranger: Shadows of Almia
    Pokémon HeartGold Version
    Reply With Quote