TM/HM Expansion
I'm a Japanese hacker. Because English is very bad, so it may be difficult to read sentences.
Last update: 30/9/2019
When I ported the code from BPRJ, deleted TM check by mistake, so I corrected it.
There are several threads and posts related to the TM/HM expansion in this forum, but there are some flaws and it will not behave exactly like the vanilla FR's TM. (Disk image and animation of TM after 51st are wrong)
In addition, as a specification from vanilla FR, the item ID used for TM/HM had to be continuous.
So, I changed the TM/HM related routines considerably, I worked like a vanilla FR and created an expanded TM/HM that can freely assign item IDs.
Because many routines have changed, code cant be written directly to threads because of readability issues, but the source code is included in the attachment.
This thread explains how to expand TM/HM using the attached patch.
I'm quoting part of the thread of ghoulslash's.
Step 1 : Patch "TM.ips" to Fire Red
Download the attached file, decompress it, patch the included "TM.ips" to Fire Red.
This patch doesn't use free space.
Step 2 : Create a table for linking the TM/HM index and item ID
Please create a table in free space, Put the pointer at 0x114100.
The attached "Table_example.bin" is the same setting as that of vanilla FR.
Table structure
Table example
Step 3 : TM/HM compatibility and move table
For expanded TM, the new comparability requires 0x10 bytes per entry.
Please create a new comparability table in free space of (Pokemon number * 0x10) bytes.
You also need to extend the move ID table.(In vanilla FR, the table is at 0x45a80c.)
Create a table in free space of (Total number of TM/HM * 2) bytes.
Step 4 : Bag expansion
If you are already expanding the bag, this step is not necessary.
Assemble this code and insert it into 0x99e44.
Rewrite the values of the following addresses.
Credits
usigusom - Information related to TM related routines
() - Information related to Bag related routines
I'm a Japanese hacker. Because English is very bad, so it may be difficult to read sentences.
Last update: 30/9/2019
When I ported the code from BPRJ, deleted TM check by mistake, so I corrected it.
There are several threads and posts related to the TM/HM expansion in this forum, but there are some flaws and it will not behave exactly like the vanilla FR's TM. (Disk image and animation of TM after 51st are wrong)
In addition, as a specification from vanilla FR, the item ID used for TM/HM had to be continuous.
So, I changed the TM/HM related routines considerably, I worked like a vanilla FR and created an expanded TM/HM that can freely assign item IDs.
Because many routines have changed, code cant be written directly to threads because of readability issues, but the source code is included in the attachment.
![[PokeCommunity.com] [FR] Better TM/HM expansion [PokeCommunity.com] [FR] Better TM/HM expansion](https://i.imgur.com/cDZzxpL.png)
This thread explains how to expand TM/HM using the attached patch.
I'm quoting part of the thread of ghoulslash's.
Step 1 : Patch "TM.ips" to Fire Red
Download the attached file, decompress it, patch the included "TM.ips" to Fire Red.
This patch doesn't use free space.
Step 2 : Create a table for linking the TM/HM index and item ID
Please create a table in free space, Put the pointer at 0x114100.
The attached "Table_example.bin" is the same setting as that of vanilla FR.
Table structure
Code:
[TM and HM threshold (2bytes)][Item ID (2bytes)] ~ [Item ID (2bytes)] FF FF
Table example
Code:
32 00 21 01 22 01 23 01 24 01 25 01 26 01 27 01
28 01 29 01 2A 01 2B 01 2C 01 2D 01 2E 01 2F 01
30 01 31 01 32 01 33 01 34 01 35 01 36 01 37 01
38 01 39 01 3A 01 3B 01 3C 01 3D 01 3E 01 3F 01
40 01 41 01 42 01 43 01 44 01 45 01 46 01 47 01
48 01 49 01 4A 01 4B 01 4C 01 4D 01 4E 01 4F 01
50 01 51 01 52 01 53 01 54 01 55 01 56 01 57 01
58 01 59 01 5A 01 FF FF
Step 3 : TM/HM compatibility and move table
For expanded TM, the new comparability requires 0x10 bytes per entry.
Please create a new comparability table in free space of (Pokemon number * 0x10) bytes.
You also need to extend the move ID table.(In vanilla FR, the table is at 0x45a80c.)
Create a table in free space of (Total number of TM/HM * 2) bytes.
Step 4 : Bag expansion
If you are already expanding the bag, this step is not necessary.
Assemble this code and insert it into 0x99e44.
Code:
.text
.align 2
.thumb
.thumb_func
.global pocket_size_limiters
.equ freeRAM, 0x0203cXXX
.equ NumMainPocketItems, XX
.equ NumKeyItems, XX
.equ NumPokeballs, XX
.equ NumTMs, XX
.equ NumBerries, XX
Main:
ldr r1, =0x0203988c
ldr r0, =freeRAM
ldr r2, =Numlist+0x08099e44
Loop:
ldrb r3, [r2]
cmp r3, #0x0
beq End
str r0, [r1]
strb r3, [r1, #0x4]
add r1, #0x8
add r2, #0x1
lsl r3, #0x2
add r0, r3
b Loop
End:
bx lr
.ltorg
.align 2
Numlist:
.byte NumMainPocketItems, NumKeyItems, NumPokeballs, NumTMs, NumBerries
.byte 0x00
Rewrite the values of the following addresses.
Code:
0x108420: (NumMainPocketItems + 1) * 8
0x108428: (NumMainPocketItems + 1) * 19
Credits
usigusom - Information related to TM related routines
() - Information related to Bag related routines
Attachments
Last edited: