[Coco] real-time mouse cursor
darccml at hotmail.com
Sun Jan 27 03:30:52 EST 2008
>> I mostly use the following VSYNC subroutine in all of my screen updating
>> VSYNC TST $FF02
>> a@ TST $FF03
>> BPL a@
> That's the way to use the PIA interrupt but as time is crucial, I'd
> suggest in-line code rather than a subroutine. That will remove the
> cycles needed to BSR or JSR and RTS.
When possible, I would also recommend avoiding the TST instruction in time-critical code. If either A or B do not need to be preserved, its faster to use an LD:
a@ LDA $FF03
And if X or U don't need to be preserved, you can save one more cycle within the loop at the expense of a one-time penalty of 3 cycles on entry:
a@ LDA ,U
Shed those extra pounds with MSN and The Biggest Loser!
More information about the Coco