Atari ST series Technical Reference Manual page 169

Hide thumbs Also See for ST series:
Table of Contents

Advertisement

nal value afterwards). The current x and y positions of the
mouse pointer are stored in GCURX (offset — 602) and
GCURY (offset —600). The mouse button status is contained
in MOUSE__BT (-5 9 6 ). Bit 0 covers the left button status,
while bit one covers the right button. A 1 bit indicates that
the button is currently pressed.
Program 7-5 demonstrates the use of both sprites and
the mouse pointer. It copies the pointer arrow shape to a
sprite, and bounces the sprite around the screen until you
press the right mouse button. It also changes the shape of
the mouse pointer to a cross and changes it back when you
press the button.
Program 7-5. MOUSPRIT.S
*
*
MOUSPRIT.S —
*
*
*** Variable table offsets
MOUSE_BT = -596
M_POS_HX = -856
INTIN
= $08
*** Function Equates
Init
= $a000
MShow
= $a009
00
MHide
= $a
a
00
MTrans
= $a
b
Undraw
= $aOOc
Draw
= $a00d
*** Program starts here
.text
dc.w
Init
move.l
a0,a5
*
*** save old mouse
*** both in sprite
*** (pointers use separate data planes, sprites interleave them)
m o v e .w
#4,dO
lea
M_POS_HX(a5),al
lea
psave,a
lea
ssave,a4
savhead:
m o v e .w
(al), (a4)+
m o v e .w
(al)+,(a
dbra
d o ,savhead
move.w
#15,dO
lea
psave+42,a3
savdata:
move
(al),(a4)+
move.w
(al)+,(a
move.w
(al),(a4)+
move.w
(al)+,(a3)+
d O ,savdata
dbra
Line A Routines
Demonstrates use of the line A
mouse pointer and sprite calls.
* offset for mouse button status variable
* offset for start of mouse pointer sprite data
* get base address of variable table
* save base address,
* in case other calls destroy AO
pointer sprite data
format, and pointer format
* save 5 words of mouse data
* get starting address to save
2
* start address of pointer save area
* & start address of sprite save area
* move 5 word header to both buffers
*
2
)+
(header is same for sprites & pointers)
* save 32 words of mouse data
* even words in sprite format
2
)+
* even words in pointer format
* odd words in sprite format
* odd words in pointer format
*
*
*
*
*
161

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents