PDA

View Full Version : More TMs/HMs


ZodiacDaGreat
March 14th, 2010, 11:48 PM
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
http://i39.tinypic.com/j8jink.png http://i39.tinypic.com/nwyg74.png http://i42.tinypic.com/epkt47.png
http://i40.tinypic.com/70w9he.png

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

Gamer2020
March 15th, 2010, 12:08 PM
If I remember correctly there is a place in the ROM where you have to edit which Pokemon learn what TM/HM.
It's similar to the move tutors but longer.
Perhaps that is why the Pokemon won't learn the other moves.

ZodiacDaGreat
March 15th, 2010, 12:25 PM
If I remember correctly there is a place in the ROM where you have to edit which Pokemon learn what TM/HM.
It's similar to the move tutors but longer.
Perhaps that is why the Pokemon won't learn the other moves.
If you read what I typed and see the images, you'll know that most of the HMs are compatible with the Pokemon in the party. So, what you said is out of the question.

Prof. Briar
March 15th, 2010, 01:23 PM
Well, simple logic dictates that something must be declaring the number of TM/HMs. They seem to be stored in the same list, judging by the bleed over. Even so, the combined number doesn't add up to the maximum number of variables (forgive me for stating the obvious, I'm building a foundation for my hypothesis). It would seem from your test that there are two missing factors. One must define the highest numbered object that is a "TM", this being why anything beyond that value is automatically classed as a "HM". I think it likely that the other missing factor must relate to which badge is needed for which HM move to be taught in some way. Since you can only have eight badges, any "extra" HM would have no "badge check" to activate it. I don't know if that helps, and it's only a theory until tested, but it might give you an idea of what to be looking for.

Gamer2020
March 15th, 2010, 01:43 PM
If you read what I typed and see the images, you'll know that most of the HMs are compatible with the Pokemon in the party. So, what you said is out of the question.
"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"

Maybe I misread.
But still, the area would have to be edited still? To include the new TMs/HMs.

ZodiacDaGreat
March 15th, 2010, 02:25 PM
Well, simple logic dictates that something must be declaring the number of TM/HMs. They seem to be stored in the same list, judging by the bleed over. Even so, the combined number doesn't add up to the maximum number of variables (forgive me for stating the obvious, I'm building a foundation for my hypothesis). It would seem from your test that there are two missing factors. One must define the highest numbered object that is a "TM", this being why anything beyond that value is automatically classed as a "HM". I think it likely that the other missing factor must relate to which badge is needed for which HM move to be taught in some way. Since you can only have eight badges, any "extra" HM would have no "badge check" to activate it. I don't know if that helps, and it's only a theory until tested, but it might give you an idea of what to be looking for.
Exactly. That's the missing routines.