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!

TrollandToad.com
Reply
 
Thread Tools
  #1    
Old March 25th, 2012 (11:29 AM). Edited March 25th, 2012 by RicePigeonKKM.
RicePigeonKKM's Avatar
RicePigeonKKM RicePigeonKKM is offline
     
    Join Date: Feb 2006
    Nature: Rash
    Posts: 30
    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.
    Reply With Quote

    Relevant Advertising!

      #2    
    Old March 26th, 2012 (8:09 AM).
    looper's Avatar
    looper looper is offline
    German Hacker
       
      Join Date: Aug 2010
      Location: Germany
      Gender: Male
      Nature: Lonely
      Posts: 53
      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    
      Old March 26th, 2012 (9:30 AM).
      Jambo51's Avatar
      Jambo51 Jambo51 is offline
      Glory To Arstotzka
         
        Join Date: Jun 2009
        Gender: Male
        Nature: Quiet
        Posts: 732
        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!
        Reply With Quote
          #4    
        Old March 26th, 2012 (9:32 AM).
        sonic1's Avatar
        sonic1 sonic1 is offline
        ASM is my life now...
           
          Join Date: May 2008
          Location: Portugal
          Age: 22
          Gender: Male
          Nature: Timid
          Posts: 79
          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
          __________________
          This signature has been disabled.
          over 350px high
          Please review and fix the issues by reading the signature rules.

          You must edit it to meet the limits set by the rules before you may remove the [sig-reason] code from your signature. Removing this tag will re-enable it.

          Do not remove the tag until you fix the issues in your signature. You may be infracted for removing this tag if you do not fix the specified issues. Do not use this tag for decoration purposes.
          Reply With Quote
            #5    
          Old March 26th, 2012 (4:01 PM).
          RicePigeonKKM's Avatar
          RicePigeonKKM RicePigeonKKM is offline
             
            Join Date: Feb 2006
            Nature: Rash
            Posts: 30
            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

            Join the conversation!

            Create an account to post a reply in this thread, participate in other discussions, and more!

            Create a PokéCommunity Account

            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 GMT -8. The time now is 2:16 AM.