Probably will be better for you to store your bar y position in a memory location and then "build" your copper wait with code
Then you can write beam wait positions, colour changes, and the PAL wait ($ffdf,$fffe) in the right order depending on the exact position of the bar... eg bar is above the line 255, bar is ON line 255 and bar is below line 255 (all cases would have the PAL wait copper command in a different place in relation to the other waits)
|