Atari ST series Technical Reference Manual page 170

Hide thumbs Also See for ST series:
Table of Contents

Advertisement

*** Change mouse pointer to cross shape
move.l
#mdata,INTIN(a5)
dc.w
MHide
dc.w
MTrans
move.l
#mdata+
d c .w
MShow
*** determine x and
move.w
#304,d6
m o v e .w
#184,d7
m o v e .w
(a5),d0
do
cmp.w
#4,
beg
narrow
6
6
add
d
,d
narrow:
0
cmp
#l,d
bne
short
add
d7,d7
short:
*** set up sprite move
6
0
m o v e .w
d
,d
0
asr.w
#l,d
m o v e .w
d0,a3
m o v e .w
#l,d4
m o v e .w
d4,d5
m o v e .w
d4,a4
sprite:
3
do
m o v e .w
a
,
m o v e .w
a4,dl
add.w
d 4 , dO
beq
xchange
6
0
cmp
d
,d
bcs
no_xchange
xchange:
eori.w
#$FFFE,d4
no_xchange:
d5,dl
add.w
beq
ychange
cmp
d7,dl
bcs
no_ychange
ychange:
eori.w
#$FFFE,d5
no_ychange:
m o v e .w
d0,a3
dl,a4
m o v e .w
mo v e .w
#37,-(sp)
trap
#14
. 1
#2
,
ad d q
sp
lea
savebuf,a
dc.w
Undraw
savebuf,a
lea
lea
ssave,aO
mo v e .w
a3 ,d0
a4 ,dl
mo v e .w
dc.w
Draw
*** wait for mouse button press
move.w
M0USE_BT(a5),d3
btst
#1,d3
beg
sprite
*** When right mouse button is pressed,
*** restore mouse pointer to original shape
move.l
#psave,INTIN(a5)
dc.w
MHide
d c .w
MTrans
d c .w
MShow
162
CHAPTER 7
* address of mouse data block to INTIN
* hide the pointer
* change its shape
6
,INTIN(a 5)
* make mouse show unconditional
* and show the mouse pointer
screen limits
* right edge - pointer width
* bottom edge - pointer height
* find number of bit planes in display
* is it low-res?
* yes, keep right limit
* no, double screen width
* is it high res?
*
no, keep bottom limit
* yes, double screen height
initial x position = right limit
divided by
save x position
initial x increment = l
initial y increment = l
initial y position =
get x position
get y position
increment x position
if at left, change directions
at right edge?
no, keep going
yes, change direction
increment y position
if at top, change directions
at bottom?
no, keep going
yes, change direction
save x position
save y position
wait for end of vertical blank
2
* use save buffer pointer,
* erase the current sprite
2
* use save buffer pointer,
* use the old mouse pointer shape
* get x position
* y position
* and draw sprite in new position
* check button status
* is right button down?
* no, move sprite
* address of saved mouse data to INTIN
2
.
1

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents