[Coco] real-time mouse cursor

Roger Taylor operator at coco3.com
Sat Jan 26 23:51:50 EST 2008


At 09:54 PM 1/26/2008, you wrote:

>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.)


Doesn't this SYNC to any interrupt, though?

Btw, it just dawned on me after all the years... why do sprite calcs like this:

LDD     ,X      screen data
ANDA    ,U      mask data
ANDB    1,U
ORA     128,U   sprite data
ORB     129,U
STD     ,X

when this is the same:

LDD     ,X      screen data
ANDA    ,U      mask data
ANDB    1,U
ADDD    128,U   sprite data
STD     ,X

No reg.a/b OR'ing is needed. You can do a 16-bit simulated OR with 
the ADDD instruction.
And the speed increase is very noticeable over 64 sprites!  Actually, 
65 now... for the mouse cursor.

I'm using direct offsets into the sprite and screen data instead of 
auto incs ( ,r++) because an entire sprite is plotted with precalced 
byte offsets like the above.  Spaghetti and meatballs, anybody?

With the 6309, "ANDD" is even possible for the masking.

LDD     ,X      screen data
ANDD    ,U      mask data
ADDD    128,U   sprite data
STD     ,X






More information about the Coco mailing list