• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Which Pokémon Masters protagonist do you like most? Let us know by casting a vote in our Masters favorite protagonist poll here!
  • Red, Hilda, Paxton, or Kellyn - which Pokémon protagonist is your favorite? Let us know by voting in our poll!
  • 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

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:
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.
 
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.
 
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