Tools, Tutorials & Resources Various tools to help you develop your hacks can be found here.

Thread Tools
Old 2 Weeks Ago (11:02 AM).
TheLeafFan28's Avatar
TheLeafFan28 TheLeafFan28 is offline
Ultimate Leaf Fan!
    Join Date: May 2017
    Location: Kanto Region
    Gender: Male
    Nature: Adamant
    Posts: 5
    Hello, I'm TheLeafFan28, and I'm going to share a tutorial with you on how to force the player character to be of a certain gender in Pokémon Fire Red version.

    Why would anyone want to do this? Simple - it could be useful for story-heavy games focusing on a single character of a certain gender.

    Before everything else, I should specify that you need a few tools for this:
    • IDA Pro 6.6 or higher (necessary to find the offsets - though you can just follow my tutorial)
    • Notepad++
    • (Optional) A notebook to write down the assets, though that will be unneccesary here
    • A hex editor - I personally used HxD in this tutorial

    Step 1: Finding the correct offset
    Open IDA, then press CTRL + G and navigate down to Offset 0812FFA4, wherein you will find this line of code:

    ROM:0812FFA4 task_tutorial_oak_boy_girl: @ DATA XREF: task_tutorial_boy_girl+F2o
    ROM:0812FFA4 @ ROM:off_812FFA0o
    ROM:0812FFA4 PUSH {R4,LR}
    ROM:0812FFA6 LSLS R0, R0, #0x18
    ROM:0812FFA8 LSRS R4, R0, #0x18
    ROM:0812FFAA BL choice_update_from_keypad__only_sound_on_change //Here it checks for the position of the cursor
    ROM:0812FFAE LSLS R0, R0, #0x18
    ROM:0812FFB0 ASRS R1, R0, #0x18
    ROM:0812FFB2 CMP R1, #0 //Here it compares the information stored in R1...
    ROM:0812FFB4 BEQ loc_812FFC8 //And if the cursor's position equals "zero" - aka Red, the default position - it will then skip to the next part, where we name him.
    ROM:0812FFB6 CMP R1, #0 //Same happens here
    ROM:0812FFB8 BGT loc_812FFC4 // Only this time if the cursor's position is greater than zero - aka. 1, which is the position of Leaf, it will skip to the part where we have to name her.
    ROM:0812FFBA MOVS R0, #2
    ROM:0812FFBC NEGS R0, R0
    ROM:0812FFBE CMP R1, R0
    ROM:0812FFC0 BLT loc_812FFCE

    Note that my comments are signified by a "//" and were written only for the sake of this tutorial.

    Now, what does this tell us? Simply, it tells us the location of the function. This information will also prove to be useful for later on, when we have to hex edit.

    Step 2: Writing the ASM code
    Now, let's say that for the purpose of my hack, I wanted a game where only Leaf was playable.

    We would need to write the following ASM code. The way I did it was to open Notepad++ and create a new document. Then write the following code:

    push {r4, lr}
    lsl r0, r0, #0x18
    lsr r0, r0, #0x18
    mov r1, #0x1
    ldr r0, =(0x0812FFC8 + 1)
    bx r0

    Save with an .asm extension at the end, and compile.

    You will end up with the following output:

    01 21 01 48 00 47 00 00 C9 FF 12 08

    Paste-write that to offset 0812FFAA.

    Alternatively, if I wanted a game with only Red playable, the ASM code would be similar, but with one notable difference:


    push {r4, lr}
    lsl r0, r0, #0x18
    lsr r0, r0, #0x18
    mov r1, #0x0
    ldr r0, =(0x0812FFC8 + 1)
    bx r0

    Which would yield the output:


    00 21 01 48 00 47 00 00 C9 FF 12 08

    Again, paste-write to 0812FFAA.

    Step 3: Making sure things go smoothly
    As it is, using the code will only freeze the game as it will cause it to be stuck in an infinite loop. From here on, there is no difference between whether or not you force Red or Leaf.

    The first thing we want to do is to go to offset 0812FDBC and overwrite the bytes there with the following:


    A5 FF 12 08

    Then we need to go to 0812FFB4 and write:


    C9 FF 12 08

    Next, we want to go to offsets 0813000C, 08130006, 0812FD98 and 0812FDA0 and write:


    00 00 00 00

    In all of them. This should make a functional fade in for the protagonist character you chose.

    Now, at this point, our modifications should work perfectly (test it out, if you want to).
    However, there is one small problem - the platform under the protagonist is missing.

    To solve this, we need to go to offset 08131592 and write 00. This should make the platform appear.

    Step 4: Test it out
    If you followed the tutorial, the game should run without issues and you would be limited to a single gender.

    Credit to Blah on Discord for patiently guiding me through the process for hours and helping me figure out what I was doing wrong.
    Thanks a lot!
    Reply With Quote

    Relevant Advertising!

    Quick Reply

    Sponsored Links
    Thread Tools

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

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

    Forum Jump

    All times are GMT -8. The time now is 6:23 AM.