Download Print this page

Atari CX70 Operator's Manual page 59

Light pen

Advertisement

ATARI Light Pen Operator's Manual
APPENDIX E - PENBUF ASSEMBLY LANQUAQE LISTINQ
OOCB
1000
TBLPTR
s
♦CB
OOCD
1010
FRAMES
ss
♦CD
OOCE
1020
XCOORD
85
♦CE
OOCF
1030
YCOORD
85
♦CF
OODO
1040
COL
85
♦DO
OODl
1050
ROW
85
♦D1
0000
1060
3KS
♦600
0600
68
1070
PLA
pop off "USR"'s N value
0601
A200
1080
LDX
♦ 0
init counter
0603 A006
1090
LDY
#6
store table hi byte in pointer
0605
84CC
1100
STY
TBLPTR+1
b^te
0607 AD0CD4
060A C90A
060C 9003
060E
38
060F E9E^
0611
18
0612 699A
061^
A075
0616 8^CB
0618 205606
061B A5CB
061D
18
061E 65CD
0620
85CB
0622
ADODD^I
0625
38
0626 E910
0628
205606
062B E8
062C E-^CD
062E
F009
0630
A51'l
0632
051-^
063^
FOFC
1110
1120
1130
11^0
1150
1160
1170
1180
1190
1200
1210
1220
1230
12^0
1250
1260
1270
1280
1290
1300
1310
1320
1330
1340
1350
1360
1370
1380
1390
1400
1410
1420
1430
1440
1450
1460
1470
1480
1490
1500
>loa6 X value & convert
LOAD
get light pen X coord
LDA
$D40C
CMP
♦$A
BCC
HERE
fX>10»
so subtract 228
SEC
SBC
*$E4
HERE
CLC
»add 154 to pen value
ADC
«$9A
fCall
sort routine
LDY
♦TABLES-$600 lo byte of X table address
STY
TBLPTR
JSR
SORT
t
Jfind and store address of YTABLE
LDA
TBLPTR
CLC
ADC
FRAMES
add table size to XTABLE address to find
STA
TBLPTR
YTABLE
address
«
#load y value & convert
f
LDA
♦D40D
get light pen Y coord
SEC
SBC
#$10
subtract
16
Jcall
sort routine
JSR
SORT
*
f
^repeat no#
tines specified in "FRAMES"
WAIT
INX
CPX
BEQ
LDA
CMP
BEQ
FRAMES
FINISH
♦ 14
♦ 14
WAIT
load
in which frane
conpare org frane with current frane
loop until new frane
PENBUF Assembly Language Listing - 55

Advertisement

loading