Results 1 to 9 of 9

Thread: [ASM] Town Cleaner code

Hybrid View

  1. #1

    Default

    You could compare to immediate values (up to two digits in thumb):

    Before:
    Code:
    ReviveFlowers:
    ldrh r2,[r0,r1]
    mov r3, #0x6F
    cmp r2,r3
    ble WaterFlowers
    mov r3, #0x89
    cmp r2,r3
    bge WaterFlowers
    sub r2,#0x6E
    After:
    Code:
    ReviveFlowers:
    ldrh r2,[r0,r1]
    cmp r2, #0x6F
    ble WaterFlowers
    cmp r2, #0x89
    bge WaterFlowers
    sub r2, #0x6E
    There's really no need to mov r3 by a byte and then compare. ^_^

    Edit: You should load the map with a 32-bit load XD
    Last edited by Demonic722; 07-12-2011 at 02:00 PM.
    3DS Friend Code: 4699-6293-3106

  2. The Following User Says Thank You to Demonic722 For This Useful Post:


  3. #2
    J.P. (Global Moderator) Maniac's Avatar
    Join Date
    Sep 2007
    Location
    Ohio, USA
    Posts
    2,083
    Blog Entries
    5

    Default

    Code:
     mov r3, #0x6F  #Wilted Red Tulips start at 6E
    I'll read the rest later.
    Last edited by Maniac; 07-12-2011 at 06:07 PM.

    Say what you mean, mean what you say, and let your actions speak for you.


  4. The Following User Says Thank You to Maniac For This Useful Post:


  5. #3

    Default

    Thanks for your advices.

    I've fixed the ASM source:



    Edit: The AR codes in the first post are fixed (2 lines shorter).
    Last edited by MisterNobody; 07-13-2011 at 03:05 PM.

  6. #4

    Default

    It looks like the code posted was compiled with a different source XD. Not only because of the limitation of
    only 1 "ldrh r0-r5, LabelHere" rule in thumb, but no where in the code 0xFFF1, or 0x1FFE is seen. o.o
    3DS Friend Code: 4699-6293-3106

  7. #5

    Default

    I've just changed 2-3 things because it doesn't want to compile with this source. But don't worry, the code seems to work, I've tested it myself. :P

  8. #6

    Default

    Quote Originally Posted by MisterNobody View Post
    I've just changed 2-3 things because it doesn't want to compile with this source. But don't worry, the code seems to work, I've tested it myself. :P
    It doesn't compile because you have two "ldrh r0-r5, LabelHere" things XD :P
    3DS Friend Code: 4699-6293-3106

  9. The Following User Says Thank You to Demonic722 For This Useful Post:


  10. #7

    Default

    Oh that's it ! Thank you I'm going to fix the source again. xD

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •