Community

The PokéCommunity

We are still working on a better slogan!

Visit Index



Advertise here

Go Back   The PokéCommunity Forums > ROM Hacking > Research & Development
Notices

Research & Development Got a well-founded knack with ROM hacking? Love reverse-engineering the Pokémon games? Or perhaps you love your assembly language. This is the spot for polling and gathering your ideas, and then implementing them! Share your hypothesis, get ideas from others, and collaborate to create!
Research & Development programs in this forum are subject to moderator approval before they are displayed.

Post Reply
 
Thread Tools
  #1    
Old March 14th, 2010, 11:48 PM
ZodiacDaGreat's Avatar
ZodiacDaGreat
Working on a Mobile System
 
Join Date: Feb 2007
Location: South Pacific
Age: 22
Gender: Male
Nature: Relaxed
Send a message via ICQ to ZodiacDaGreat

Advertise here
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)

Code:
@ 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
  #2    
Old March 15th, 2010, 12:08 PM
Gamer2020's Avatar
Gamer2020
This love is a sickness...
 
Join Date: Jun 2008
Location: Violet city!
Gender: Male
Nature: Bold
Send a message via AIM to Gamer2020 Send a message via Windows Live Messenger to Gamer2020 Send a message via Yahoo to Gamer2020 Send a message via Skype™ to Gamer2020
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.
Pokemon Game Editor Download!
Pokemon TCG Assistant!
  #3    
Old March 15th, 2010, 12:25 PM
ZodiacDaGreat's Avatar
ZodiacDaGreat
Working on a Mobile System
 
Join Date: Feb 2007
Location: South Pacific
Age: 22
Gender: Male
Nature: Relaxed
Send a message via ICQ to ZodiacDaGreat
Quote:
Originally Posted by Gamer2020
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.
  #4    
Old March 15th, 2010, 01:23 PM
Prof. Briar
Beginning Trainer
 
Join Date: Apr 2008
Gender:
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.
Support RPG Toolkit, the best free engine ever!

Waitwhat?
  #5    
Old March 15th, 2010, 01:43 PM
Gamer2020's Avatar
Gamer2020
This love is a sickness...
 
Join Date: Jun 2008
Location: Violet city!
Gender: Male
Nature: Bold
Send a message via AIM to Gamer2020 Send a message via Windows Live Messenger to Gamer2020 Send a message via Yahoo to Gamer2020 Send a message via Skype™ to Gamer2020
Quote:
Originally Posted by ZodiacDaGreat View Post
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.
Pokemon Game Editor Download!
Pokemon TCG Assistant!
  #6    
Old March 15th, 2010, 02:25 PM
ZodiacDaGreat's Avatar
ZodiacDaGreat
Working on a Mobile System
 
Join Date: Feb 2007
Location: South Pacific
Age: 22
Gender: Male
Nature: Relaxed
Send a message via ICQ to ZodiacDaGreat
Quote:
Originally Posted by Prof. Briar
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.
Post Reply
Quick Reply

Sponsored Links


Advertise here
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
Minimum Characters Per Post: 25



All times are UTC -8. The time now is 03:23 PM.

About Us
© 2002 - 2014 The PokéCommunity™, pokecommunity.com. Pokémon characters and images belong to The Pokémon Company International and Nintendo. This website is in no way affiliated with or endorsed by Nintendo, Creatures, GAMEFREAK, The Pokémon Company or The Pokémon Company International. We just love Pokémon.

Copyright
All forum styles, their images (unless noted otherwise) and site designs are © 2002 - 2014 The PokéCommunity / PokéCommunity.com. PokéCommunity™ is a trademark of The PokéCommunity. All rights reserved. Sponsor advertisements do not imply our endorsement of that product or service. User generated content remains the property of its creator. Header artwork by Jordanice of deviantART.

Social Media
If you would like to stay up-to-date with us on the go, when we're down, or other such things, follow us on social media sites--most notibly Twitter, Facebook, and Google Plus--by clicking on the links provided.

Design presented by Peitharchia. Special thanks to Hiroshi Sotomura and Ausaudriel.