Hi everyone!
I have been trying my hand at writing a little bit of code after reading through most of the "2600 programming for Newbies" but I ran in to a problem with the positioning for my sprites. In trying to test my knowledge I wanted to simply draw box (P0) on a predefined position on the screen. But my timing seemed off. I wrote some code to experiment with timing and RESP0 but it seems to contradict what I read. Can some one help me?
After the vertical sync I wrote this to set the player position
sta WSYNC
REPEAT 15
nop
REPEND
sta RESP0
Now from what I read this should take 15*2*3 = 90 colour cycles. Which should position the player at 90-68 = 22.But what gets drawn is this:
(The white lines are the most left and right pixel of the player. The rest is just playfield for help counting pixels)
So I'm off by what seems like 5 cpu cycles. Can anyone explain what goes wrong in my calculations?
Thanks in advance!