The PokéCommunity Forums Fan Games ROM Hacking
ASM & Hex Table Reading Delay

ROM Hacking Need a helping hand? You can get help on any ROM Hacking-related problems or questions you have here.

Reply
 
Thread Tools
  #1    
Old June 4th, 2018 (5:18 PM). Edited June 4th, 2018 by Lance Koijer 2.0.
Lance Koijer 2.0 Lance Koijer 2.0 is offline
Lance Koijer
     
    Join Date: Apr 2018
    Location: Criscanto Town
    Gender: Male
    Nature: Adamant
    Posts: 58
    Hello huys, just a quick question.

    What is more convenient to use when reading a massive table of entries? ASM or Battle Script(I am using a jumpifbyte command which I think makes the reading too long)

    My idea is just to create a table of an 8-byte-long entry and make a table checking using ASM... Would it give long delays just like the byte-reading in battle script? 'cuz the table I will be creating is more or less 64 (in hex).
    Reply With Quote
      #2    
    Old June 4th, 2018 (7:03 PM).
    FBI's Avatar
    FBI FBI is offline
    Free supporter
     
    Join Date: Jan 2013
    Location: Unknown Island
    Gender: Male
    Posts: 1,866
    Quote:
    Originally Posted by Lance Koijer 2.0 View Post
    Hello huys, just a quick question.

    What is more convenient to use when reading a massive table of entries? ASM or Battle Script(I am using a jumpifbyte command which I think makes the reading too long)

    My idea is just to create a table of an 8-byte-long entry and make a table checking using ASM... Would it give long delays just like the byte-reading in battle script? 'cuz the table I will be creating is more or less 64 (in hex).
    rethink your algorithm to allow constant time. Tables are arrays, think of searching like:
    moves[pokemon][level]
    __________________
    ...
    Reply With Quote
      #3    
    Old June 4th, 2018 (10:01 PM). Edited June 4th, 2018 by Lance Koijer 2.0.
    Lance Koijer 2.0 Lance Koijer 2.0 is offline
    Lance Koijer
       
      Join Date: Apr 2018
      Location: Criscanto Town
      Gender: Male
      Nature: Adamant
      Posts: 58
      Quote:
      Originally Posted by FBI View Post
      rethink your algorithm to allow constant time. Tables are arrays, think of searching like:
      moves[pokemon][level]
      I know now what each entry would look like...

      It's
      [2 bytes for Move ID] [2 reserved bytes 0x00] [Pointer to script] terminated by 0xFFFFFFFF of course
      I mean in my question is, is doing this in ASM will not induce long delays because the table that I will be making is massive? (it will, more or less, occupy half an MB.)
      Because when I tried jumpifbyte in battle script and there are actually hundreds of jumps, the byte-checking causes a long delay.
      Reply With Quote
        #4    
      Old June 6th, 2018 (6:44 AM).
      FBI's Avatar
      FBI FBI is offline
      Free supporter
       
      Join Date: Jan 2013
      Location: Unknown Island
      Gender: Male
      Posts: 1,866
      Quote:
      Originally Posted by Lance Koijer 2.0 View Post
      I know now what each entry would look like...

      It's
      [2 bytes for Move ID] [2 reserved bytes 0x00] [Pointer to script] terminated by 0xFFFFFFFF of course
      I mean in my question is, is doing this in ASM will not induce long delays because the table that I will be making is massive? (it will, more or less, occupy half an MB.)
      Because when I tried jumpifbyte in battle script and there are actually hundreds of jumps, the byte-checking causes a long delay.
      ASM would be faster, yes. But it'll still be relatively slow to loop through the entire table in comparison to just a look up. Can you elaborate more on what it is this table is for, and what you're trying to implement?
      __________________
      ...
      Reply With Quote
        #5    
      Old June 6th, 2018 (11:07 PM). Edited June 6th, 2018 by Lance Koijer 2.0.
      Lance Koijer 2.0 Lance Koijer 2.0 is offline
      Lance Koijer
         
        Join Date: Apr 2018
        Location: Criscanto Town
        Gender: Male
        Nature: Adamant
        Posts: 58
        Quote:
        Originally Posted by FBI View Post
        ASM would be faster, yes. But it'll still be relatively slow to loop through the entire table in comparison to just a look up. Can you elaborate more on what it is this table is for, and what you're trying to implement?
        I've used the unused byte of Move Data and used it for checking.... once that byte is found and matches to the byte required for the process... it will go to another table of Battle Script (Which I found out now how to execute Battle Script in a routine)
        Reply With Quote
          #6    
        Old June 7th, 2018 (6:20 AM).
        FBI's Avatar
        FBI FBI is offline
        Free supporter
         
        Join Date: Jan 2013
        Location: Unknown Island
        Gender: Male
        Posts: 1,866
        Quote:
        Originally Posted by Lance Koijer 2.0 View Post
        I've used the unused byte of Move Data and used it for checking.... once that byte is found and matches to the byte required for the process... it will go to another table of Battle Script (Which I found out now how to execute Battle Script in a routine)
        Are you trying to make Z moves?

        Regardless, if your table is indexed in move id order, you can try to just do move_table[id] and zmove_behaviours[id] kind of thing.
        __________________
        ...
        Reply With Quote
          #7    
        Old June 7th, 2018 (9:46 AM).
        Lance Koijer 2.0 Lance Koijer 2.0 is offline
        Lance Koijer
           
          Join Date: Apr 2018
          Location: Criscanto Town
          Gender: Male
          Nature: Adamant
          Posts: 58
          Quote:
          Originally Posted by FBI View Post
          Are you trying to make Z moves?

          Regardless, if your table is indexed in move id order, you can try to just do move_table[id] and zmove_behaviours[id] kind of thing.
          Yes I am.. and I managed to make a Z-move-ish implementation... however, it's kind of not satisfyig me because it just uses a massive jumpifhalword commands which makes the execution a bit of delayed so what I explained before is kind of stupid.. I realized I just have to use the unused byte in Move Data and use it as a Battle Script ID to a table that contains the battle script of all moves and then execute it... I sent you a PM already. I've created an ASM and it makes something odd.
          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
          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 4:03 AM.