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 25th, 2012, 11:29 AM
RicePigeonKKM's Avatar
RicePigeonKKM
Beginning Trainer
 
Join Date: Feb 2006
Nature: Rash
Send a message via AIM to RicePigeonKKM

Advertise here
As anyone who's played Black/White knows, TMs now act like HMs in that they are now infinite use. I was wondering if such is possible in the Gen III games. Because the items use a routine that defines how many to remove after consumption, the amount must be defined somewhere in the ROM for the TMs. Anyone have any ideas about this?

EDIT: In Fire Red, after disassembling the routine at 809a1f8, it seems that the value of 1 is subtracted from the item amount in r0. Changing this to 0 will cause the TM to not be consumed, but it will do the same for all items as well. Perhaps if the routine were copied and modified as I described, or if a similar routine that is used by the HMs were called in the TM routine, we could generate TMs that act like they do in Gen 5? The only issue I'm having is trying to find the TM/HM routine used by the game.

Last edited by RicePigeonKKM; March 25th, 2012 at 08:17 PM.
  #2    
Old March 26th, 2012, 08:09 AM
looper's Avatar
looper
German Hacker
 
Join Date: Aug 2010
Location: Germany
Gender: Male
Nature: Lonely
Send a message via Skype™ to looper
Can't we just change a TM to a HM? Or is there any difference between TMs and HMs, except that your loose TMs?
I'm not a god. But Chuck Norris isn't, too.
  #3    
Old March 26th, 2012, 09:30 AM
Jambo51's Avatar
Jambo51
Glory To Arstotzka
 
Join Date: Jun 2009
Gender: Male
Nature: Quiet
I've actually achieved this on the 649 Patch. The only discernable difference between TMs and HMs is built into the code. It reads the item ID and any item ID above a certain value is treated as a HM. How I did it was that I simply removed this check and made it always use the HM routine.

Sadly, I don't have anything noted down, so I can't help there, but it's not exactly that difficult to achieve once you find the relevant checks. Good Luck!
Hey guys, please check out my recreations of the gen 1 and 2 music on my custom engine at my SoundCloud! - Here!
  #4    
Old March 26th, 2012, 09:32 AM
sonic1's Avatar
sonic1
ASM is my life now...
 
Join Date: May 2008
Location: Portugal
Age: 19
Gender: Male
Nature: Timid
Quote:
Originally Posted by RicePigeonKKM View Post

EDIT: In Fire Red, after disassembling the routine at 809a1f8, it seems that the value of 1 is subtracted from the item amount in r0. Changing this to 0 will cause the TM to not be consumed, but it will do the same for all items as well...
Well, to put it blunt, item index is passed through r4. Make a branch at that offset you mentioned and check if r4 is between tm01 and tm50 item values:
Code:
0x121≤r4≤0x152
If yes, then don't subtract anything. If not, subtract 1 like normal items.

~Sonic1

My Site (UNDER CONSTRUCTION):

(mage by Xryo)

PORTUGUESE USER
Sou o Dark rayquaza da antiga myutsu.net


My Laptop SPECS:


Credits to Eagledelt for the wonderfull sign :D

  #5    
Old March 26th, 2012, 04:01 PM
RicePigeonKKM's Avatar
RicePigeonKKM
Beginning Trainer
 
Join Date: Feb 2006
Nature: Rash
Send a message via AIM to RicePigeonKKM
Quote:
Originally Posted by Jambo51 View Post
I've actually achieved this on the 649 Patch. The only discernable difference between TMs and HMs is built into the code. It reads the item ID and any item ID above a certain value is treated as a HM. How I did it was that I simply removed this check and made it always use the HM routine.

Sadly, I don't have anything noted down, so I can't help there, but it's not exactly that difficult to achieve once you find the relevant checks. :) Good Luck!
Based on what you said, I tried to swap to item IDs for HM 1 (Cut) and TM 50 (Overheat) just to see if it worked. It didn't.

However, I then looked at the disassembled code. For 809a1f1 there was some byteshifting involved. Changing the value (from 0x18 to 0x14) seemed to do the trick at first; the TMs were acting like the HMs, and the other use items were being consumed on use. The only drawback to this was that this would also affect the items in the Balls pocket (essentially giving infinite Masterballs if one had it).

Sorry for sounding noobish, I only started looking into ASM hacking. Also I did notice a routine at 0809a202 (specifically, add r0, r0, r1) which seems to add the contents on r1 into r0. If I'm reading the routine correctly, there was a previous check at 0809a1f8 which subtracts 1 from register r0 (which is whats defining how many items to consume). There are a few calls there in between which become confusing to me (such as the ldr instruction at 0809a1fe).

Also, though unrelated, there also seems to be a check against the item ID against a value 0x176 (which appears to be the maximum item index) and setting this value any lower will cause any item with an ID over that value to become unknown items (name changes to ??????????). I thought this was the value I was looking for at first until I realized that HMs started at ID of 0x153.
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 02:45 AM.

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.