I am getting some really weird behavior when trying to wait for a specific raster line.
I'm using code based on what I found here:
http://videopac.nl/forum/index.php?topic=1756.15So it looks like this:
; wait for scanline to arrive at next Y (r6) position
mov r0,#vdc_scanline ; pointer to VDC scanline register
mov r1,#vdc_scanrow ; pointer to VDC scanrow register
chky:
movx a,@r1 ; read scanrow
movx a,@r0 ; read scanline
add a,r6 ; add R6 (compare to -R6)
jnc chky
I am assuming that the line should feed it is the negative line number, so to wait for line 64, you feed it -64 = 0xc0, then when the raster counter reaches 64, the addition will overflow, the carry will be set and it will exit the loop.
The thing is, it doesn't seem to work as expected!
For one, what is the behavior of the scanline counter, since there are more than 256 lines, does it go 0-255, then 0-57 on a PAL system? And in that case, how do you make sure you are on the "right" count
I did a "call waitvsync" first, in an attempt to be in a stable state, but still nothing works.
Even when feeding it values that should only be found once, like 128, it seems like the code doesn't work, but then if you add a couple of more waits a line 132 or something then it finally "zones" in correctly.
Can someone provide a very, very basic example, like:
wait vsync
set background to black
wait for line 32
set color to blue
wait for line 128
set color to white
That works?
It should be noted that I do all my testing in o2emwin, my flash cart didn't work at all, and I haven't heard back from the seller yet.
