The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > Creative Discussions > Emulation & ROM Hacking > Research & Development
Register New Account FAQ/Rules Chat Blogs Mark Forums Read

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!
New threads in this forum are to be approved by a moderator before they are displayed. The thread revival limit does not apply here.



Reply
Thread Tools
  #1  
Unread March 25th, 2012, 07:29 PM
RicePigeonKKM's Avatar
RicePigeonKKM
Beginning Trainer
 
Join Date: Feb 2006
Nature: Rash
Send a message via AIM to RicePigeonKKM
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 26th, 2012 at 04:17 AM.
Reply With Quote
  #2  
Unread March 26th, 2012, 04:09 PM
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.
Reply With Quote
  #3  
Unread March 26th, 2012, 05:30 PM
Jambo51's Avatar
Jambo51
Thinking about quitting...
 
Join Date: Jun 2009
Location: Livingston, Scotland
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!
__________________


Guys, please don't send me question which belong in the Simple Questions or Scripting Help threads. I don't mind the occasional question about ASM or something, though. And definitely don't send me PMs or VMs asking for help with your hack or requesting custom ASM. I will not answer.
Reply With Quote
  #4  
Unread March 26th, 2012, 05:32 PM
sonic1's Avatar
sonic1
ASM is my life now...
 
Join Date: May 2008
Location: Portugal
Age: 18
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

Reply With Quote
  #5  
Unread March 27th, 2012, 12:01 AM
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.
Reply With Quote
Reply
Quick Reply

Sponsored Links


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

Forum Jump


All times are UTC. The time now is 10:17 AM.


Style by Perdition Haze, artwork by Sa-Dui.
Like our Facebook Page Follow us on TwitterMessage Board Statistics | © 2002 - 2013 The PokéCommunity™, pokecommunity.com.
Pokémon characters and images belong to Pokémon USA, Inc. and Nintendo. This website is in no way affiliated with or endorsed by Nintendo, Creatures, GAMEFREAK, The Pokémon Company, Pokémon USA, Inc., The Pokémon Company International, or Wizards of the Coast. We just love Pokémon.
All forum styles, their images (unless noted otherwise) and site designs are © 2002 - 2013 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 posts belong to the user.