Close. It is saving the R0 register in 'main_irq'. However, I completely missed R2. Fixed. Thanks!Chilly Willy wrote: ↑Sat Jan 15, 2022 11:31 pmIt's no wonder it has problems... you aren't saving r0 or r2.
That makes so much more sense now. I'm exclusively a Java developer in my profession, and in Java, part of the way in which a variable becomes "global" (actually class scope, but it's close) is by marking it "public static". I'm actually pretty rusty with C and C++ as I haven't actively used in in many years now. So I was *really* confused about why you insisted it wasn't global. But having thought on it some, I'm now on the same page. Another easy fix.Chilly Willy wrote: ↑Sat Jan 15, 2022 11:31 pmStatic is only for LOCAL variables. This MUST be a global variable.
"volatile unsigned int variable_name;" and this must not be inside a function, but in the main body of the code. I.e., a global variable.
And so with the two aforementioned fixed, it looks like the FPS counter is working now ...
Although it's oddly only settling on values like 15.0, 20.0, 30.0, etc. Maybe that's just a problem with my math/logic. I'll have to review that again. But I'm certain it's correctly updating the vblankCount value (middle one in the screen shot), and that's what I care about most at this point in time.
Thanks for your patience and help. And now I'm back to making the greatest thing since sliced bread (if sliced bread was for the 32X).