Thread: Development: More TMs/HMs
View Single Post
Old March 14th, 2010 (11:48 PM).
ZodiacDaGreat's Avatar
ZodiacDaGreat ZodiacDaGreat is offline
Working on a Mobile System
Join Date: Feb 2007
Location: South Pacific
Age: 24
Gender: Male
Nature: Relaxed
Posts: 429
Send a message via ICQ to ZodiacDaGreat
Let's try to implement the way the 4th generation games have more than 50 TMs. Please post your findings here :D On Ruby version, I provide this two routines (Commented roughly so may have mistakes lol - a bit lazy today)

@ Routine 1 - TM data [AXVE]
@ -----------------------------------------------
0806f7b8  b500 push {lr}
0806f7ba  0400 lsl r0, r0, #0x10
0806f7bc  0c02 lsr r2, r0, #0x10
0806f7be  2100 mov r1, #0x0
0806f7c0  4b04 ldr r3, [$0806f7d4] (=$08376504) @ Pointer to TM data
0806f7c2  1c08 add r0, r1, #0x0
0806f7c4  3032 add r0, #0x32 @ 0x32 = 50 (50 TMs)
0806f7c6  0040 lsl r0, r0, #0x01 @ r0 = 0x64
0806f7c8  18c0 add r0, r0, r3 @ r0 becomes pointer to HM data
0806f7ca  8800 ldrh r0, [r0, #0x0]
0806f7cc  4290 cmp r0, r2
0806f7ce  d103 bne $0806f7d8
0806f7d0  2001 mov r0, #0x1
0806f7d2  e007 b $0806f7e4

0806f7d4  6504 str r4, [r0, #0x50] @ Pointer bytes
0806f7d6  0837 lsr r7, r6, #0x00

0806f7d8  1c48 add r0, r1, #0x1
0806f7da  0600 lsl r0, r0, #0x18
0806f7dc  0e01 lsr r1, r0, #0x18
0806f7de  2907 cmp r1, #0x7
0806f7e0  d9ef bls $0806f7c2
0806f7e2  2000 mov r0, #0x0
0806f7e4  bc02 pop {r1}
0806f7e6  4708 bx r1

@ Routine 2 - TM/HM Routine [AXVE]
@ -----------------------------------------------
080c9e90  b510 push {r4,lr}
080c9e92  0600 lsl r0, r0, #0x18
080c9e94  0e04 lsr r4, r0, #0x18
080c9e96  2000 mov r0, #0x0
080c9e98  210d mov r1, #0xd
080c9e9a  220d mov r2, #0xd
080c9e9c  2314 mov r3, #0x14
080c9e9e  f7a7 bl $08071e84 @ Message Box function?
080c9ea2  4806 ldr r0, [$080c9ebc] (=$0203855e) @ Contains TM/HM data
080c9ea4  8801 ldrh r1, [r0, #0x0] @ Loads TM/HM index number
080c9ea6  20a9 mov r0, #0xa9
080c9ea8  0040 lsl r0, r0, #0x01 @ r0 = 0x152 (TM 50 Index Number)*
080c9eaa  4281 cmp r1, r0
080c9eac  d90c bls $080c9ec8 @ if less or equal call TM branch

HM Branch
080c9eae  4904 ldr r1, [$080c9ec0] (=$0840ea16) @ Pointer to HM Message
080c9eb0  4a04 ldr r2, [$080c9ec4] (=$080c9ee5)
080c9eb2  1c20 add r0, r4, #0x0
080c9eb4  2301 mov r3, #0x1
080c9eb6  f02f bl $080f90b8
080c9eba  e00b b $080c9ed4
080c9ebc  855e strh r6, [r3, #0x2a]
080c9ebe  0203 lsl r3, r0, #0x08
080c9ec0  ea16 [ ??? ]
080c9ec2  0840 lsr r0, r0, #0x01
080c9ec4  9ee5 ldr r6, [sp, #0x394]
080c9ec6  080c lsr r4, r1, #0x00

TM Branch
080c9ec8  4904 ldr r1, [$080c9edc] (=$0840ea06) @ Pointer to TM Message
080c9eca  4a05 ldr r2, [$080c9ee0] (=$080c9ee5)
080c9ecc  1c20 add r0, r4, #0x0
080c9ece  2301 mov r3, #0x1
080c9ed0  f02f bl $080f90b8
080c9ed4  bc10 pop {r4}
080c9ed6  bc01 pop {r0}
080c9ed8  4700 bx r0
The first routine is the one that calls the TM/HM move data (The moves that it contain) The second routine is the Field Usage routine for TMs/HMs in the Item Structure - all TMs/HMs use this to calculate which TM/HM is which.

Basically what I've done so far

I tried to create more TMs - as you can see in the Item editor image but they turned out to be HMs in the game what's more, its seems like only the first 8 HMs can be used to teach the moves while the other two when used will show that the Pokemon aren't able to learn it like in the image above. To sum it up, the two TMs I made became HMs and the two old HMs got shifted down and cannot be used.

So, I think there are more routines that limit the TM/HM amount and so on. Any thoughts or discoveries? Hehe, I'm a bit lazy this time XD
Reply With Quote