[Coco] real-time mouse cursor

Arthur Flexser flexser at fiu.edu
Sat Jan 26 22:54:55 EST 2008


On Sat, 26 Jan 2008, Robert Gault wrote:

> Roger Taylor wrote:
> 
> > Hopefully others are paying attention to your tutes so they might can 
> > dive into something graphics intensive.  I've known for ages most of 
> > what you're saying but the part about letting IRQ decide when to switch 
> > the screen and having the main code not accidentally get mixed up with 
> > the current state is something that carries a little bit of worry since 
> > IRQ can happen at any time during the main code execution, even if 
> > predictable at 60hz.
> > 
> > I mostly use the following VSYNC subroutine in all of my screen updating 
> > stuff.
> > 
> > VSYNC   TST     $FF02
> > a@      TST     $FF03
> >         BPL     a@
> >         RTS
> > 
> 
> 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.

Or better yet, replace the TST $FF03, BPL a@ with a SYNC instruction.
(Of course, time isn't really crucial if you're spending the bulk of it doing
nothing while waiting for the next interrupt.)

Art




More information about the Coco mailing list