• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

[ASM & Hex✓] Fire Red: What is wrong with this ASM code

48
Posts
7
Years
  • Hi folks!
    Can someone tell me what is wrong with the following ASM code? The thumb batch compiler is not compiling it for some reason.
    The code:
    Spoiler:


    This is just one part of another huge ASM and so far the other parts of the code doesn't seem to have any problems.

    Additional question:
    Where is the play time stored in Fire Red RAM?
    And is there any in game function that calculates how many days it has been since the start of the game?
     
    Last edited:
    1,403
    Posts
    10
    Years
    • Seen Apr 29, 2024
    Sorry, I was mistaken about your code, I'm not sure why it doesn't work :(

    But it's probably possible to work it out by looking through GBAtek's Thumb documentation.
     
    71
    Posts
    7
    Years
    • Seen Jul 11, 2022
    It's not compiling because line 4 in the function should be mov r1, #0xFF (your forgot the #). Additionally, even if you call this function from another function, the return value will be incorrect, as you discard the computed value at the end by popping r0. I recommend removing the line push {r0-r2, lr}, and replacing the last line in the function with bx lr.
     
    48
    Posts
    7
    Years
  • It's not compiling because line 4 in the function should be mov r1, #0xFF (your forgot the #). Additionally, even if you call this function from another function, the return value will be incorrect, as you discard the computed value at the end by popping r0. I recommend removing the line push {r0-r2, lr}, and replacing the last line in the function with bx lr.

    My bad.. did not notice the missing #.. thanks a lot!

    And this routine isn't complete yet. I'll put the final answers of my result in some variables before popping the registers! But I will keep bx lr in mind for future functions! Thank you! :D
     
    Back
    Top