Where do I start there? I hope you can follow this...klonoa wrote:What should I do with the A,X,Y registers? and why?
You have a NMI handler (the function that gets called automatically on vblank) in your program. And that function changes A,X,Y (and it doesn't restore the old values when it returns).
In your program that can be a problem for the code between address C390h (enable NMI) and C3B0h (endless loop). The opcodes between those addresses use the A register, but (if you are unlucky) the NMI handler could change the value in A.
"Push/pop" or "push/pull" were meant to mean the "PHA and PLA" instructions (for saving/restoring A on stack). You need that in the NMI handler, too. Otherwise unexpected things could happen.
Well, and saving X and Y is a bit more difficult... but your code is already doing that in some places... so I guess you know how to do that : )