CosmicRLe 04/05/2025 à 21:48
Thats a nice idea! i was thinking about how that part of my code could be sped up but was drawing blanks
BTW I changed all my ints to shorts. Which seemed to speed the whole program up by 4 display lines. (I have a little routine that counts the display lines).
Then i rewrote one of the sprite functions to see if it would accept shorts directly but it didn't work properly. I looked at the disassembly and it seems that the compiler converts all shorts (words) to ints (long words) automatically before it puts them on the stack ready for the function to use. The overhead for doing this conversion is about 16 CPU cycles per variable sent to the fucnction. So I guess I lose a little time there - but I gained overall. I don't know if there is a way to tell the compiler to do it differently.
Now that I have seen some disassembly of some parts of my program. I think even I could make it more efficient! The compiler seems to make some odd choices on how to do things. It could be I am misunderstanding though given I don't know much about assembly.
I don't think I can update the version of my compiler. I tried but there didn't seem any obvious way to do it.