I've run into a few issues while playing around with asm on an emulated C64 machine.
What I want to do is to check if the key "N" on the keyboard is being pressed, then the program should wait for a change to appear on address $D012. Now what I don't understand is how I can "wait" for a change to appear? Can anybody tell me what it's all about?
Checking if N button on the keyboard is pressed down is simple - just use the subroutines FFE4 (input) and FFD2 (output).
I don't really ask for anything to be done for me, but if I can get some quick info on how the D012 works and how I can "wait" for a change, I would be really thankful.
Thanks in advance!
$d012
contains the current raster line.If you only need to wait until the the register changes, that is wait until the next raster line, you can do simple busy-waiting:
edit:
If you want to wait for several rasterlines, for example 3: