Home » CEEFAX disks » telesoftware11.adl » 02-12-88/SPMOUSE

02-12-88/SPMOUSE

This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.

Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.

Tape/disk: Home » CEEFAX disks » telesoftware11.adl
Filename: 02-12-88/SPMOUSE
Read OK:
File size: 13CF bytes
Load address: 0800
Exec address: 8023
File contents
   10REM> SPMOUSE
   20DIM param &10 :REM: Osword parameter block
   30DIM mcode &100 :REM: assemble at mcode
   40ioaddr=&A00 :REM: address for machine code
   50xcoord=&80 :REM: x coordinate, range 0-255
   60ycoord=&81 :REM: y coordinate, range 0-255
   70savereg=&FC :REM: interrupt accumulator save register
   80userv=&200 :REM: user vector
   90irq1v=&204 :REM: primary interrupt vector
  100drb=&FE60 :REM: data register B
  110ddrb=&FE62 :REM: data direction register B
  120pcr=&FE6C :REM: peripheral control register
  130ifr=&FE6D :REM: interrupt flag register
  140ier=&FE6E :REM: interrupt enable register
  150osword=&FFF1
  160osbyte=&FFF4
  170FOR pass=4 TO 6 STEP 2
  180O%=mcode
  190P%=ioaddr
  200[OPT pass
  210CMP #&00 \ is this *CODE?
  220BNE return \ return if not *CODE
  230LDX irq1v \ current primary interrupt vector, low byte
  240LDY irq1v+1 \ current primary interrupt vector, high byte
  250CPY #interrupt DIV 256 \ compare high byte
  260BEQ disable \ restore old vector if altered
  270STX oldirq1v \ save original irq1 vector, low byte
  280STY oldirq1v+1 \ save original irq1 vector, high byte
  290LDX #interrupt MOD 256 \ new irq1 vector, low byte
  300LDY #interrupt DIV 256 \ new irq1 vector, high byte
  310SEI \ set interrupt disable flag
  320STX irq1v \ alter irq1 vector, low byte
  330STY irq1v+1 \ alter irq1 vector, high byte
  340CLI \ clear interrupt disable flag
  350LDA #&98 \ %10011000, ie. enable CB1/2
  360STA ier \ interrupt enable register
  370LDA pcr \ peripheral control register
  380AND #&0F \ AND with %00001111, ie clear bits 4-7
  390ORA #&50 \ OR with %01010000, ie. set bits 4 and 6
  400STA pcr \ interrupt on +ve transition, CB2 input, DRB to clear
  410LDA #0 \ user port input
  420STA ddrb \ data direction register B
  430STA xcoord \ initial value for x coordinate
  440STA ycoord \ initial value for y coordinate
  450.return
  460RTS \ return to BASIC
  470.disable
  480LDA #&18 \ %00011000 ready to clear bits 3 and 4 of ier
  490LDX oldirq1v \ original irq1 vector, low byte
  500LDY oldirq1v+1 \ original irq1 vector, high byte
  510SEI \ set interrupt disable flag
  520STA ier \ interrupt enable register
  530LDA pcr \ peripheral control register
  540AND #&0F \ clear bits 4-7
  550STA pcr \ peripheral control register
  560STX irq1v \ restore the original irq1 vector, low byte
  570STY irq1v+1 \ restore the original irq1 vector, high byte
  580CLI \ clear interrupt disable flag
  590RTS \ return to BASIC
  600.interrupt
  610LDA savereg \ interrupt accumulator save register
  620PHA \ and push it on the stack
  630LDA ifr \ interrupt flag register
  640BPL notuser \ bit 7 is set if VIA-B interrupt
  650AND #&18 \ AND with %00011000, ie. test bits 3 and 4
  660BEQ notuser \ exit if not CB1 or CB2
  670AND #&10 \ AND with %00010000, ie. test bit 4
  680BNE xpulse \ bit 4 set for an X direction movement
  690LDA drb \ Y direction, load data register B
  700AND #&04 \ AND with %00000100, ie. test bit 2
  710BNE ydown \ if bit 2 is set then Y is going down
  720INC ycoord \ Y is going up so increment Y coordinate
  730BNE exit \ branch if in the range 1 to 255
  740BEQ decy \ if zero then alter to 255
  750.ydown
  760LDA ycoord \ load Y coordinate
  770BEQ exit \ branch if zero because it can't go any lower
  780.decy
  790DEC ycoord \ reduce Y coordinate by 1
  800JMP exit \ restore interrupt accumulator save register and RTI
  810.xpulse
  820LDA drb \ load data register B
  830ROR A \ bit 0 into carry
  840BCS xdown \ X is going down if bit 0 is set
  850INC xcoord \ X is going up if bit 0 is clear
  860BNE exit \ exit if X coordinate is in the range from 1 to 255
  870BEQ decx \ if X coordinate = 0 then make it 255
  880.xdown
  890LDA xcoord \ load X coordinate
  900BEQ exit \ if it is zero it can't go any lower
  910.decx
  920DEC xcoord \ decrease X coordinate by 1
  930.exit
  940PLA \ pull interrupt accumulator save register off the stack
  950STA savereg \ and restore zero page
  960RTI \ return from interrupt
  970.notuser
  980PLA \ pull the interrupt accumulator save register off the stack
  990STA savereg \ restore the zero page address
 1000JMP (oldirq1v) \ exit via the original vector
 1010.oldirq1v
 1020EQUW &00 \ original irq1 vector
 1030.lastbyte
 1040]
 1050NEXT
 1060end=mcode+(lastbyte-ioaddr)
 1070addr=ioaddr
 1080FOR byte=mcode TO end
 1090PROCwrite(?byte,addr)
 1100addr=addr+1
 1110NEXT
 1120PROCwrite((ioaddr MOD 256),userv)
 1130PROCwrite((ioaddr DIV 256),userv+1)
 1140*CODE
 1150MODE7
 1160mouse$=CHR$141+CHR$132+CHR$157+CHR$131+"Mouse coordinates, range &00-&FF  "+CHR$156
 1170PRINTTAB(0,1)mouse$
 1180PRINTTAB(0,2)mouse$
 1190ONERROR GOTO 1290
 1200VDU23,1,0;0;0;0;
 1210PRINTTAB(10,7)"Bytes used = &";~(lastbyte-ioaddr)
 1220REPEAT
 1230PRINTTAB(10,12)"X = &";~FNread(&80);" "
 1240PRINTTAB(20,12)"Y = &";~FNread(&81);" "
 1250IF FNright PRINTTAB(22,17)"Right" ELSE PRINTTAB(22,17)"     "
 1260IF FNcentre PRINTTAB(15,17)"Centre" ELSE PRINTTAB(15,17)"      "
 1270IF FNleft PRINTTAB(10,17)"Left" ELSE PRINTTAB(10,17)"    "
 1280UNTIL FALSE
 1290*CODE
 1300VDU23,1,1;0;0;0;31,0,23
 1310END
 1320DEFPROCwrite(data,addr)
 1330!param=addr OR &FFFF0000
 1340param?4=data
 1350A%=6
 1360X%=param MOD 256
 1370Y%=param DIV 256
 1380CALL osword
 1390ENDPROC
 1400DEFFNread(addr)
 1410!param=addr OR &FFFF0000
 1420A%=5
 1430X%=param MOD 256
 1440Y%=param DIV 256
 1450CALL osword
 1460=param?4
 1470DEFFNbutton
 1480A%=&96
 1490X%=&60
 1500=(USR(osbyte) AND &FF0000)DIV&10000
 1510DEFFNright
 1520=((FNbutton AND &80)=0)
 1530DEFFNcentre
 1540=((FNbutton AND &40)=0)
 1550DEFFNleft
 1560=((FNbutton AND &20)=0)

�> SPMOUSE
*� param &10 :�: Osword parameter block
&� mcode &100 :�: assemble at mcode
(,ioaddr=&A00 :�: address for machine code
2,xcoord=&80 :�: x coordinate, range 0-255
<,ycoord=&81 :�: y coordinate, range 0-255
F7savereg=&FC :�: interrupt accumulator save register
Puserv=&200 :�: user vector
Z+irq1v=&204 :�: primary interrupt vector
d!drb=&FE60 :�: data register B
n,ddrb=&FE62 :�: data direction register B
x-pcr=&FE6C :�: peripheral control register
�)ifr=&FE6D :�: interrupt flag register
�+ier=&FE6E :�: interrupt enable register
�osword=&FFF1
�osbyte=&FFF4
�� pass=4 � 6 � 2
�O%=mcode
�
P%=ioaddr
�
[OPT pass
�CMP #&00 \ is this *CODE?
�$BNE return \ return if not *CODE
�:LDX irq1v \ current primary interrupt vector, low byte
�=LDY irq1v+1 \ current primary interrupt vector, high byte
�,CPY #interrupt � 256 \ compare high byte
/BEQ disable \ restore old vector if altered
6STX oldirq1v \ save original irq1 vector, low byte
9STY oldirq1v+1 \ save original irq1 vector, high byte
"4LDX #interrupt � 256 \ new irq1 vector, low byte
,5LDY #interrupt � 256 \ new irq1 vector, high byte
6$SEI \ set interrupt disable flag
@+STX irq1v \ alter irq1 vector, low byte
J.STY irq1v+1 \ alter irq1 vector, high byte
T&CLI \ clear interrupt disable flag
^*LDA #&98 \ %10011000, ie. enable CB1/2
h'STA ier \ interrupt enable register
r)LDA pcr \ peripheral control register
|0� #&0F \ � with %00001111, ie clear bits 4-7
�4�A #&50 \ � with %01010000, ie. set bits 4 and 6
�BSTA pcr \ interrupt on +ve transition, CB2 input, DRB to clear
�LDA #0 \ user port input
�(STA ddrb \ data direction register B
�/STA xcoord \ initial value for x coordinate
�/STA ycoord \ initial value for y coordinate
�.return
�RTS \ return to BASIC
�.disable
�;LDA #&18 \ %00011000 ready to clear bits 3 and 4 of ier
�1LDX oldirq1v \ original irq1 vector, low byte
�4LDY oldirq1v+1 \ original irq1 vector, high byte
�$SEI \ set interrupt disable flag
'STA ier \ interrupt enable register
)LDA pcr \ peripheral control register
� #&0F \ clear bits 4-7
&)STA pcr \ peripheral control register
0:STX irq1v \ restore the original irq1 vector, low byte
:=STY irq1v+1 \ restore the original irq1 vector, high byte
D&CLI \ clear interrupt disable flag
NRTS \ return to BASIC
X.interrupt
b5LDA savereg \ interrupt accumulator save register
l"PHA \ and push it on the stack
v%LDA ifr \ interrupt flag register
�1BPL notuser \ bit 7 is set if VIA-B interrupt
�4� #&18 \ � with %00011000, ie. test bits 3 and 4
�(BEQ notuser \ exit if not CB1 or CB2
�-� #&10 \ � with %00010000, ie. test bit 4
�6BNE xpulse \ bit 4 set for an X direction movement
�/LDA drb \ Y direction, load data register B
�-� #&04 \ � with %00000100, ie. test bit 2
�4BNE ydown \ if bit 2 is set then Y is going down
�8INC ycoord \ Y is going up so increment Y coordinate
�.BNE exit \ branch if in the range 1 to 255
�(BEQ decy \ if zero then alter to 255
�
.ydown
�"LDA ycoord \ load Y coordinate
;BEQ exit \ branch if zero because it can't go any lower
	.decy
)DEC ycoord \ reduce Y coordinate by 1
 BJMP exit \ restore interrupt accumulator save register and RTI
*.xpulse
4"LDA drb \ load data register B
>ROR A \ bit 0 into carry
H/BCS xdown \ X is going down if bit 0 is set
R0INC xcoord \ X is going up if bit 0 is clear
\ABNE exit \ exit if X coordinate is in the range from 1 to 255
f3BEQ decx \ if X coordinate = 0 then make it 255
p
.xdown
z"LDA xcoord \ load X coordinate
�2BEQ exit \ if it is zero it can't go any lower
�	.decx
�+DEC xcoord \ decrease X coordinate by 1
�	.exit
�@PLA \ pull interrupt accumulator save register off the stack
�'STA savereg \ and restore zero page
�RTI \ return from interrupt
�.notuser
�DPLA \ pull the interrupt accumulator save register off the stack
�/STA savereg \ restore the zero page address
�1JMP (oldirq1v) \ exit via the original vector
�
.oldirq1v
�#EQUW &00 \ original irq1 vector

.lastbyte
]
�
$end=mcode+(lastbyte-ioaddr)
.addr=ioaddr
8� byte=mcode � end
B�write(?byte,addr)
Laddr=addr+1
V�
` �write((ioaddr � 256),userv)
j"�write((ioaddr � 256),userv+1)
t	*CODE
~�7
�Hmouse$=�141+�132+�157+�131+"Mouse coordinates, range &00-&FF  "+�156
��0,1)mouse$
��0,2)mouse$
�
� � �TJE
��23,1,0;0;0;0;
�.�10,7)"Bytes used = &";~(lastbyte-ioaddr)
��
�#�10,12)"X = &";~�read(&80);" "
�#�20,12)"Y = &";~�read(&81);" "
�.� �right �22,17)"Right" � �22,17)"     "
�1� �centre �15,17)"Centre" � �15,17)"      "
�+� �left �10,17)"Left" � �10,17)"    "
� �

	*CODE
�23,1,1;0;0;0;31,0,23
�
(��write(data,addr)
2!param=addr � &FFFF0000
<param?4=data
FA%=6
PX%=param � 256
ZY%=param � 256
d� osword
n�
xݤread(addr)
�!param=addr � &FFFF0000
�A%=5
�X%=param � 256
�Y%=param � 256
�� osword
�=param?4
�ݤbutton
�
A%=&96
�
X%=&60
�!=(�(osbyte) � &FF0000)�&10000
�ݤright
�=((�button � &80)=0)
�ݤcentre
=((�button � &40)=0)

ݤleft
=((�button � &20)=0)
�
00000000  0d 00 0a 0e f4 3e 20 53  50 4d 4f 55 53 45 0d 00  |.....> SPMOUSE..|
00000010  14 2a de 20 70 61 72 61  6d 20 26 31 30 20 3a f4  |.*. param &10 :.|
00000020  3a 20 4f 73 77 6f 72 64  20 70 61 72 61 6d 65 74  |: Osword paramet|
00000030  65 72 20 62 6c 6f 63 6b  0d 00 1e 26 de 20 6d 63  |er block...&. mc|
00000040  6f 64 65 20 26 31 30 30  20 3a f4 3a 20 61 73 73  |ode &100 :.: ass|
00000050  65 6d 62 6c 65 20 61 74  20 6d 63 6f 64 65 0d 00  |emble at mcode..|
00000060  28 2c 69 6f 61 64 64 72  3d 26 41 30 30 20 3a f4  |(,ioaddr=&A00 :.|
00000070  3a 20 61 64 64 72 65 73  73 20 66 6f 72 20 6d 61  |: address for ma|
00000080  63 68 69 6e 65 20 63 6f  64 65 0d 00 32 2c 78 63  |chine code..2,xc|
00000090  6f 6f 72 64 3d 26 38 30  20 3a f4 3a 20 78 20 63  |oord=&80 :.: x c|
000000a0  6f 6f 72 64 69 6e 61 74  65 2c 20 72 61 6e 67 65  |oordinate, range|
000000b0  20 30 2d 32 35 35 0d 00  3c 2c 79 63 6f 6f 72 64  | 0-255..<,ycoord|
000000c0  3d 26 38 31 20 3a f4 3a  20 79 20 63 6f 6f 72 64  |=&81 :.: y coord|
000000d0  69 6e 61 74 65 2c 20 72  61 6e 67 65 20 30 2d 32  |inate, range 0-2|
000000e0  35 35 0d 00 46 37 73 61  76 65 72 65 67 3d 26 46  |55..F7savereg=&F|
000000f0  43 20 3a f4 3a 20 69 6e  74 65 72 72 75 70 74 20  |C :.: interrupt |
00000100  61 63 63 75 6d 75 6c 61  74 6f 72 20 73 61 76 65  |accumulator save|
00000110  20 72 65 67 69 73 74 65  72 0d 00 50 1e 75 73 65  | register..P.use|
00000120  72 76 3d 26 32 30 30 20  3a f4 3a 20 75 73 65 72  |rv=&200 :.: user|
00000130  20 76 65 63 74 6f 72 0d  00 5a 2b 69 72 71 31 76  | vector..Z+irq1v|
00000140  3d 26 32 30 34 20 3a f4  3a 20 70 72 69 6d 61 72  |=&204 :.: primar|
00000150  79 20 69 6e 74 65 72 72  75 70 74 20 76 65 63 74  |y interrupt vect|
00000160  6f 72 0d 00 64 21 64 72  62 3d 26 46 45 36 30 20  |or..d!drb=&FE60 |
00000170  3a f4 3a 20 64 61 74 61  20 72 65 67 69 73 74 65  |:.: data registe|
00000180  72 20 42 0d 00 6e 2c 64  64 72 62 3d 26 46 45 36  |r B..n,ddrb=&FE6|
00000190  32 20 3a f4 3a 20 64 61  74 61 20 64 69 72 65 63  |2 :.: data direc|
000001a0  74 69 6f 6e 20 72 65 67  69 73 74 65 72 20 42 0d  |tion register B.|
000001b0  00 78 2d 70 63 72 3d 26  46 45 36 43 20 3a f4 3a  |.x-pcr=&FE6C :.:|
000001c0  20 70 65 72 69 70 68 65  72 61 6c 20 63 6f 6e 74  | peripheral cont|
000001d0  72 6f 6c 20 72 65 67 69  73 74 65 72 0d 00 82 29  |rol register...)|
000001e0  69 66 72 3d 26 46 45 36  44 20 3a f4 3a 20 69 6e  |ifr=&FE6D :.: in|
000001f0  74 65 72 72 75 70 74 20  66 6c 61 67 20 72 65 67  |terrupt flag reg|
00000200  69 73 74 65 72 0d 00 8c  2b 69 65 72 3d 26 46 45  |ister...+ier=&FE|
00000210  36 45 20 3a f4 3a 20 69  6e 74 65 72 72 75 70 74  |6E :.: interrupt|
00000220  20 65 6e 61 62 6c 65 20  72 65 67 69 73 74 65 72  | enable register|
00000230  0d 00 96 10 6f 73 77 6f  72 64 3d 26 46 46 46 31  |....osword=&FFF1|
00000240  0d 00 a0 10 6f 73 62 79  74 65 3d 26 46 46 46 34  |....osbyte=&FFF4|
00000250  0d 00 aa 14 e3 20 70 61  73 73 3d 34 20 b8 20 36  |..... pass=4 . 6|
00000260  20 88 20 32 0d 00 b4 0c  4f 25 3d 6d 63 6f 64 65  | . 2....O%=mcode|
00000270  0d 00 be 0d 50 25 3d 69  6f 61 64 64 72 0d 00 c8  |....P%=ioaddr...|
00000280  0d 5b 4f 50 54 20 70 61  73 73 0d 00 d2 1d 43 4d  |.[OPT pass....CM|
00000290  50 20 23 26 30 30 20 5c  20 69 73 20 74 68 69 73  |P #&00 \ is this|
000002a0  20 2a 43 4f 44 45 3f 0d  00 dc 24 42 4e 45 20 72  | *CODE?...$BNE r|
000002b0  65 74 75 72 6e 20 5c 20  72 65 74 75 72 6e 20 69  |eturn \ return i|
000002c0  66 20 6e 6f 74 20 2a 43  4f 44 45 0d 00 e6 3a 4c  |f not *CODE...:L|
000002d0  44 58 20 69 72 71 31 76  20 5c 20 63 75 72 72 65  |DX irq1v \ curre|
000002e0  6e 74 20 70 72 69 6d 61  72 79 20 69 6e 74 65 72  |nt primary inter|
000002f0  72 75 70 74 20 76 65 63  74 6f 72 2c 20 6c 6f 77  |rupt vector, low|
00000300  20 62 79 74 65 0d 00 f0  3d 4c 44 59 20 69 72 71  | byte...=LDY irq|
00000310  31 76 2b 31 20 5c 20 63  75 72 72 65 6e 74 20 70  |1v+1 \ current p|
00000320  72 69 6d 61 72 79 20 69  6e 74 65 72 72 75 70 74  |rimary interrupt|
00000330  20 76 65 63 74 6f 72 2c  20 68 69 67 68 20 62 79  | vector, high by|
00000340  74 65 0d 00 fa 2c 43 50  59 20 23 69 6e 74 65 72  |te...,CPY #inter|
00000350  72 75 70 74 20 81 20 32  35 36 20 5c 20 63 6f 6d  |rupt . 256 \ com|
00000360  70 61 72 65 20 68 69 67  68 20 62 79 74 65 0d 01  |pare high byte..|
00000370  04 2f 42 45 51 20 64 69  73 61 62 6c 65 20 5c 20  |./BEQ disable \ |
00000380  72 65 73 74 6f 72 65 20  6f 6c 64 20 76 65 63 74  |restore old vect|
00000390  6f 72 20 69 66 20 61 6c  74 65 72 65 64 0d 01 0e  |or if altered...|
000003a0  36 53 54 58 20 6f 6c 64  69 72 71 31 76 20 5c 20  |6STX oldirq1v \ |
000003b0  73 61 76 65 20 6f 72 69  67 69 6e 61 6c 20 69 72  |save original ir|
000003c0  71 31 20 76 65 63 74 6f  72 2c 20 6c 6f 77 20 62  |q1 vector, low b|
000003d0  79 74 65 0d 01 18 39 53  54 59 20 6f 6c 64 69 72  |yte...9STY oldir|
000003e0  71 31 76 2b 31 20 5c 20  73 61 76 65 20 6f 72 69  |q1v+1 \ save ori|
000003f0  67 69 6e 61 6c 20 69 72  71 31 20 76 65 63 74 6f  |ginal irq1 vecto|
00000400  72 2c 20 68 69 67 68 20  62 79 74 65 0d 01 22 34  |r, high byte.."4|
00000410  4c 44 58 20 23 69 6e 74  65 72 72 75 70 74 20 83  |LDX #interrupt .|
00000420  20 32 35 36 20 5c 20 6e  65 77 20 69 72 71 31 20  | 256 \ new irq1 |
00000430  76 65 63 74 6f 72 2c 20  6c 6f 77 20 62 79 74 65  |vector, low byte|
00000440  0d 01 2c 35 4c 44 59 20  23 69 6e 74 65 72 72 75  |..,5LDY #interru|
00000450  70 74 20 81 20 32 35 36  20 5c 20 6e 65 77 20 69  |pt . 256 \ new i|
00000460  72 71 31 20 76 65 63 74  6f 72 2c 20 68 69 67 68  |rq1 vector, high|
00000470  20 62 79 74 65 0d 01 36  24 53 45 49 20 5c 20 73  | byte..6$SEI \ s|
00000480  65 74 20 69 6e 74 65 72  72 75 70 74 20 64 69 73  |et interrupt dis|
00000490  61 62 6c 65 20 66 6c 61  67 0d 01 40 2b 53 54 58  |able flag..@+STX|
000004a0  20 69 72 71 31 76 20 5c  20 61 6c 74 65 72 20 69  | irq1v \ alter i|
000004b0  72 71 31 20 76 65 63 74  6f 72 2c 20 6c 6f 77 20  |rq1 vector, low |
000004c0  62 79 74 65 0d 01 4a 2e  53 54 59 20 69 72 71 31  |byte..J.STY irq1|
000004d0  76 2b 31 20 5c 20 61 6c  74 65 72 20 69 72 71 31  |v+1 \ alter irq1|
000004e0  20 76 65 63 74 6f 72 2c  20 68 69 67 68 20 62 79  | vector, high by|
000004f0  74 65 0d 01 54 26 43 4c  49 20 5c 20 63 6c 65 61  |te..T&CLI \ clea|
00000500  72 20 69 6e 74 65 72 72  75 70 74 20 64 69 73 61  |r interrupt disa|
00000510  62 6c 65 20 66 6c 61 67  0d 01 5e 2a 4c 44 41 20  |ble flag..^*LDA |
00000520  23 26 39 38 20 5c 20 25  31 30 30 31 31 30 30 30  |#&98 \ %10011000|
00000530  2c 20 69 65 2e 20 65 6e  61 62 6c 65 20 43 42 31  |, ie. enable CB1|
00000540  2f 32 0d 01 68 27 53 54  41 20 69 65 72 20 5c 20  |/2..h'STA ier \ |
00000550  69 6e 74 65 72 72 75 70  74 20 65 6e 61 62 6c 65  |interrupt enable|
00000560  20 72 65 67 69 73 74 65  72 0d 01 72 29 4c 44 41  | register..r)LDA|
00000570  20 70 63 72 20 5c 20 70  65 72 69 70 68 65 72 61  | pcr \ periphera|
00000580  6c 20 63 6f 6e 74 72 6f  6c 20 72 65 67 69 73 74  |l control regist|
00000590  65 72 0d 01 7c 30 80 20  23 26 30 46 20 5c 20 80  |er..|0. #&0F \ .|
000005a0  20 77 69 74 68 20 25 30  30 30 30 31 31 31 31 2c  | with %00001111,|
000005b0  20 69 65 20 63 6c 65 61  72 20 62 69 74 73 20 34  | ie clear bits 4|
000005c0  2d 37 0d 01 86 34 84 41  20 23 26 35 30 20 5c 20  |-7...4.A #&50 \ |
000005d0  84 20 77 69 74 68 20 25  30 31 30 31 30 30 30 30  |. with %01010000|
000005e0  2c 20 69 65 2e 20 73 65  74 20 62 69 74 73 20 34  |, ie. set bits 4|
000005f0  20 61 6e 64 20 36 0d 01  90 42 53 54 41 20 70 63  | and 6...BSTA pc|
00000600  72 20 5c 20 69 6e 74 65  72 72 75 70 74 20 6f 6e  |r \ interrupt on|
00000610  20 2b 76 65 20 74 72 61  6e 73 69 74 69 6f 6e 2c  | +ve transition,|
00000620  20 43 42 32 20 69 6e 70  75 74 2c 20 44 52 42 20  | CB2 input, DRB |
00000630  74 6f 20 63 6c 65 61 72  0d 01 9a 1c 4c 44 41 20  |to clear....LDA |
00000640  23 30 20 5c 20 75 73 65  72 20 70 6f 72 74 20 69  |#0 \ user port i|
00000650  6e 70 75 74 0d 01 a4 28  53 54 41 20 64 64 72 62  |nput...(STA ddrb|
00000660  20 5c 20 64 61 74 61 20  64 69 72 65 63 74 69 6f  | \ data directio|
00000670  6e 20 72 65 67 69 73 74  65 72 20 42 0d 01 ae 2f  |n register B.../|
00000680  53 54 41 20 78 63 6f 6f  72 64 20 5c 20 69 6e 69  |STA xcoord \ ini|
00000690  74 69 61 6c 20 76 61 6c  75 65 20 66 6f 72 20 78  |tial value for x|
000006a0  20 63 6f 6f 72 64 69 6e  61 74 65 0d 01 b8 2f 53  | coordinate.../S|
000006b0  54 41 20 79 63 6f 6f 72  64 20 5c 20 69 6e 69 74  |TA ycoord \ init|
000006c0  69 61 6c 20 76 61 6c 75  65 20 66 6f 72 20 79 20  |ial value for y |
000006d0  63 6f 6f 72 64 69 6e 61  74 65 0d 01 c2 0b 2e 72  |coordinate.....r|
000006e0  65 74 75 72 6e 0d 01 cc  19 52 54 53 20 5c 20 72  |eturn....RTS \ r|
000006f0  65 74 75 72 6e 20 74 6f  20 42 41 53 49 43 0d 01  |eturn to BASIC..|
00000700  d6 0c 2e 64 69 73 61 62  6c 65 0d 01 e0 3b 4c 44  |...disable...;LD|
00000710  41 20 23 26 31 38 20 5c  20 25 30 30 30 31 31 30  |A #&18 \ %000110|
00000720  30 30 20 72 65 61 64 79  20 74 6f 20 63 6c 65 61  |00 ready to clea|
00000730  72 20 62 69 74 73 20 33  20 61 6e 64 20 34 20 6f  |r bits 3 and 4 o|
00000740  66 20 69 65 72 0d 01 ea  31 4c 44 58 20 6f 6c 64  |f ier...1LDX old|
00000750  69 72 71 31 76 20 5c 20  6f 72 69 67 69 6e 61 6c  |irq1v \ original|
00000760  20 69 72 71 31 20 76 65  63 74 6f 72 2c 20 6c 6f  | irq1 vector, lo|
00000770  77 20 62 79 74 65 0d 01  f4 34 4c 44 59 20 6f 6c  |w byte...4LDY ol|
00000780  64 69 72 71 31 76 2b 31  20 5c 20 6f 72 69 67 69  |dirq1v+1 \ origi|
00000790  6e 61 6c 20 69 72 71 31  20 76 65 63 74 6f 72 2c  |nal irq1 vector,|
000007a0  20 68 69 67 68 20 62 79  74 65 0d 01 fe 24 53 45  | high byte...$SE|
000007b0  49 20 5c 20 73 65 74 20  69 6e 74 65 72 72 75 70  |I \ set interrup|
000007c0  74 20 64 69 73 61 62 6c  65 20 66 6c 61 67 0d 02  |t disable flag..|
000007d0  08 27 53 54 41 20 69 65  72 20 5c 20 69 6e 74 65  |.'STA ier \ inte|
000007e0  72 72 75 70 74 20 65 6e  61 62 6c 65 20 72 65 67  |rrupt enable reg|
000007f0  69 73 74 65 72 0d 02 12  29 4c 44 41 20 70 63 72  |ister...)LDA pcr|
00000800  20 5c 20 70 65 72 69 70  68 65 72 61 6c 20 63 6f  | \ peripheral co|
00000810  6e 74 72 6f 6c 20 72 65  67 69 73 74 65 72 0d 02  |ntrol register..|
00000820  1c 1b 80 20 23 26 30 46  20 5c 20 63 6c 65 61 72  |... #&0F \ clear|
00000830  20 62 69 74 73 20 34 2d  37 0d 02 26 29 53 54 41  | bits 4-7..&)STA|
00000840  20 70 63 72 20 5c 20 70  65 72 69 70 68 65 72 61  | pcr \ periphera|
00000850  6c 20 63 6f 6e 74 72 6f  6c 20 72 65 67 69 73 74  |l control regist|
00000860  65 72 0d 02 30 3a 53 54  58 20 69 72 71 31 76 20  |er..0:STX irq1v |
00000870  5c 20 72 65 73 74 6f 72  65 20 74 68 65 20 6f 72  |\ restore the or|
00000880  69 67 69 6e 61 6c 20 69  72 71 31 20 76 65 63 74  |iginal irq1 vect|
00000890  6f 72 2c 20 6c 6f 77 20  62 79 74 65 0d 02 3a 3d  |or, low byte..:=|
000008a0  53 54 59 20 69 72 71 31  76 2b 31 20 5c 20 72 65  |STY irq1v+1 \ re|
000008b0  73 74 6f 72 65 20 74 68  65 20 6f 72 69 67 69 6e  |store the origin|
000008c0  61 6c 20 69 72 71 31 20  76 65 63 74 6f 72 2c 20  |al irq1 vector, |
000008d0  68 69 67 68 20 62 79 74  65 0d 02 44 26 43 4c 49  |high byte..D&CLI|
000008e0  20 5c 20 63 6c 65 61 72  20 69 6e 74 65 72 72 75  | \ clear interru|
000008f0  70 74 20 64 69 73 61 62  6c 65 20 66 6c 61 67 0d  |pt disable flag.|
00000900  02 4e 19 52 54 53 20 5c  20 72 65 74 75 72 6e 20  |.N.RTS \ return |
00000910  74 6f 20 42 41 53 49 43  0d 02 58 0e 2e 69 6e 74  |to BASIC..X..int|
00000920  65 72 72 75 70 74 0d 02  62 35 4c 44 41 20 73 61  |errupt..b5LDA sa|
00000930  76 65 72 65 67 20 5c 20  69 6e 74 65 72 72 75 70  |vereg \ interrup|
00000940  74 20 61 63 63 75 6d 75  6c 61 74 6f 72 20 73 61  |t accumulator sa|
00000950  76 65 20 72 65 67 69 73  74 65 72 0d 02 6c 22 50  |ve register..l"P|
00000960  48 41 20 5c 20 61 6e 64  20 70 75 73 68 20 69 74  |HA \ and push it|
00000970  20 6f 6e 20 74 68 65 20  73 74 61 63 6b 0d 02 76  | on the stack..v|
00000980  25 4c 44 41 20 69 66 72  20 5c 20 69 6e 74 65 72  |%LDA ifr \ inter|
00000990  72 75 70 74 20 66 6c 61  67 20 72 65 67 69 73 74  |rupt flag regist|
000009a0  65 72 0d 02 80 31 42 50  4c 20 6e 6f 74 75 73 65  |er...1BPL notuse|
000009b0  72 20 5c 20 62 69 74 20  37 20 69 73 20 73 65 74  |r \ bit 7 is set|
000009c0  20 69 66 20 56 49 41 2d  42 20 69 6e 74 65 72 72  | if VIA-B interr|
000009d0  75 70 74 0d 02 8a 34 80  20 23 26 31 38 20 5c 20  |upt...4. #&18 \ |
000009e0  80 20 77 69 74 68 20 25  30 30 30 31 31 30 30 30  |. with %00011000|
000009f0  2c 20 69 65 2e 20 74 65  73 74 20 62 69 74 73 20  |, ie. test bits |
00000a00  33 20 61 6e 64 20 34 0d  02 94 28 42 45 51 20 6e  |3 and 4...(BEQ n|
00000a10  6f 74 75 73 65 72 20 5c  20 65 78 69 74 20 69 66  |otuser \ exit if|
00000a20  20 6e 6f 74 20 43 42 31  20 6f 72 20 43 42 32 0d  | not CB1 or CB2.|
00000a30  02 9e 2d 80 20 23 26 31  30 20 5c 20 80 20 77 69  |..-. #&10 \ . wi|
00000a40  74 68 20 25 30 30 30 31  30 30 30 30 2c 20 69 65  |th %00010000, ie|
00000a50  2e 20 74 65 73 74 20 62  69 74 20 34 0d 02 a8 36  |. test bit 4...6|
00000a60  42 4e 45 20 78 70 75 6c  73 65 20 5c 20 62 69 74  |BNE xpulse \ bit|
00000a70  20 34 20 73 65 74 20 66  6f 72 20 61 6e 20 58 20  | 4 set for an X |
00000a80  64 69 72 65 63 74 69 6f  6e 20 6d 6f 76 65 6d 65  |direction moveme|
00000a90  6e 74 0d 02 b2 2f 4c 44  41 20 64 72 62 20 5c 20  |nt.../LDA drb \ |
00000aa0  59 20 64 69 72 65 63 74  69 6f 6e 2c 20 6c 6f 61  |Y direction, loa|
00000ab0  64 20 64 61 74 61 20 72  65 67 69 73 74 65 72 20  |d data register |
00000ac0  42 0d 02 bc 2d 80 20 23  26 30 34 20 5c 20 80 20  |B...-. #&04 \ . |
00000ad0  77 69 74 68 20 25 30 30  30 30 30 31 30 30 2c 20  |with %00000100, |
00000ae0  69 65 2e 20 74 65 73 74  20 62 69 74 20 32 0d 02  |ie. test bit 2..|
00000af0  c6 34 42 4e 45 20 79 64  6f 77 6e 20 5c 20 69 66  |.4BNE ydown \ if|
00000b00  20 62 69 74 20 32 20 69  73 20 73 65 74 20 74 68  | bit 2 is set th|
00000b10  65 6e 20 59 20 69 73 20  67 6f 69 6e 67 20 64 6f  |en Y is going do|
00000b20  77 6e 0d 02 d0 38 49 4e  43 20 79 63 6f 6f 72 64  |wn...8INC ycoord|
00000b30  20 5c 20 59 20 69 73 20  67 6f 69 6e 67 20 75 70  | \ Y is going up|
00000b40  20 73 6f 20 69 6e 63 72  65 6d 65 6e 74 20 59 20  | so increment Y |
00000b50  63 6f 6f 72 64 69 6e 61  74 65 0d 02 da 2e 42 4e  |coordinate....BN|
00000b60  45 20 65 78 69 74 20 5c  20 62 72 61 6e 63 68 20  |E exit \ branch |
00000b70  69 66 20 69 6e 20 74 68  65 20 72 61 6e 67 65 20  |if in the range |
00000b80  31 20 74 6f 20 32 35 35  0d 02 e4 28 42 45 51 20  |1 to 255...(BEQ |
00000b90  64 65 63 79 20 5c 20 69  66 20 7a 65 72 6f 20 74  |decy \ if zero t|
00000ba0  68 65 6e 20 61 6c 74 65  72 20 74 6f 20 32 35 35  |hen alter to 255|
00000bb0  0d 02 ee 0a 2e 79 64 6f  77 6e 0d 02 f8 22 4c 44  |.....ydown..."LD|
00000bc0  41 20 79 63 6f 6f 72 64  20 5c 20 6c 6f 61 64 20  |A ycoord \ load |
00000bd0  59 20 63 6f 6f 72 64 69  6e 61 74 65 0d 03 02 3b  |Y coordinate...;|
00000be0  42 45 51 20 65 78 69 74  20 5c 20 62 72 61 6e 63  |BEQ exit \ branc|
00000bf0  68 20 69 66 20 7a 65 72  6f 20 62 65 63 61 75 73  |h if zero becaus|
00000c00  65 20 69 74 20 63 61 6e  27 74 20 67 6f 20 61 6e  |e it can't go an|
00000c10  79 20 6c 6f 77 65 72 0d  03 0c 09 2e 64 65 63 79  |y lower.....decy|
00000c20  0d 03 16 29 44 45 43 20  79 63 6f 6f 72 64 20 5c  |...)DEC ycoord \|
00000c30  20 72 65 64 75 63 65 20  59 20 63 6f 6f 72 64 69  | reduce Y coordi|
00000c40  6e 61 74 65 20 62 79 20  31 0d 03 20 42 4a 4d 50  |nate by 1.. BJMP|
00000c50  20 65 78 69 74 20 5c 20  72 65 73 74 6f 72 65 20  | exit \ restore |
00000c60  69 6e 74 65 72 72 75 70  74 20 61 63 63 75 6d 75  |interrupt accumu|
00000c70  6c 61 74 6f 72 20 73 61  76 65 20 72 65 67 69 73  |lator save regis|
00000c80  74 65 72 20 61 6e 64 20  52 54 49 0d 03 2a 0b 2e  |ter and RTI..*..|
00000c90  78 70 75 6c 73 65 0d 03  34 22 4c 44 41 20 64 72  |xpulse..4"LDA dr|
00000ca0  62 20 5c 20 6c 6f 61 64  20 64 61 74 61 20 72 65  |b \ load data re|
00000cb0  67 69 73 74 65 72 20 42  0d 03 3e 1c 52 4f 52 20  |gister B..>.ROR |
00000cc0  41 20 5c 20 62 69 74 20  30 20 69 6e 74 6f 20 63  |A \ bit 0 into c|
00000cd0  61 72 72 79 0d 03 48 2f  42 43 53 20 78 64 6f 77  |arry..H/BCS xdow|
00000ce0  6e 20 5c 20 58 20 69 73  20 67 6f 69 6e 67 20 64  |n \ X is going d|
00000cf0  6f 77 6e 20 69 66 20 62  69 74 20 30 20 69 73 20  |own if bit 0 is |
00000d00  73 65 74 0d 03 52 30 49  4e 43 20 78 63 6f 6f 72  |set..R0INC xcoor|
00000d10  64 20 5c 20 58 20 69 73  20 67 6f 69 6e 67 20 75  |d \ X is going u|
00000d20  70 20 69 66 20 62 69 74  20 30 20 69 73 20 63 6c  |p if bit 0 is cl|
00000d30  65 61 72 0d 03 5c 41 42  4e 45 20 65 78 69 74 20  |ear..\ABNE exit |
00000d40  5c 20 65 78 69 74 20 69  66 20 58 20 63 6f 6f 72  |\ exit if X coor|
00000d50  64 69 6e 61 74 65 20 69  73 20 69 6e 20 74 68 65  |dinate is in the|
00000d60  20 72 61 6e 67 65 20 66  72 6f 6d 20 31 20 74 6f  | range from 1 to|
00000d70  20 32 35 35 0d 03 66 33  42 45 51 20 64 65 63 78  | 255..f3BEQ decx|
00000d80  20 5c 20 69 66 20 58 20  63 6f 6f 72 64 69 6e 61  | \ if X coordina|
00000d90  74 65 20 3d 20 30 20 74  68 65 6e 20 6d 61 6b 65  |te = 0 then make|
00000da0  20 69 74 20 32 35 35 0d  03 70 0a 2e 78 64 6f 77  | it 255..p..xdow|
00000db0  6e 0d 03 7a 22 4c 44 41  20 78 63 6f 6f 72 64 20  |n..z"LDA xcoord |
00000dc0  5c 20 6c 6f 61 64 20 58  20 63 6f 6f 72 64 69 6e  |\ load X coordin|
00000dd0  61 74 65 0d 03 84 32 42  45 51 20 65 78 69 74 20  |ate...2BEQ exit |
00000de0  5c 20 69 66 20 69 74 20  69 73 20 7a 65 72 6f 20  |\ if it is zero |
00000df0  69 74 20 63 61 6e 27 74  20 67 6f 20 61 6e 79 20  |it can't go any |
00000e00  6c 6f 77 65 72 0d 03 8e  09 2e 64 65 63 78 0d 03  |lower.....decx..|
00000e10  98 2b 44 45 43 20 78 63  6f 6f 72 64 20 5c 20 64  |.+DEC xcoord \ d|
00000e20  65 63 72 65 61 73 65 20  58 20 63 6f 6f 72 64 69  |ecrease X coordi|
00000e30  6e 61 74 65 20 62 79 20  31 0d 03 a2 09 2e 65 78  |nate by 1.....ex|
00000e40  69 74 0d 03 ac 40 50 4c  41 20 5c 20 70 75 6c 6c  |it...@PLA \ pull|
00000e50  20 69 6e 74 65 72 72 75  70 74 20 61 63 63 75 6d  | interrupt accum|
00000e60  75 6c 61 74 6f 72 20 73  61 76 65 20 72 65 67 69  |ulator save regi|
00000e70  73 74 65 72 20 6f 66 66  20 74 68 65 20 73 74 61  |ster off the sta|
00000e80  63 6b 0d 03 b6 27 53 54  41 20 73 61 76 65 72 65  |ck...'STA savere|
00000e90  67 20 5c 20 61 6e 64 20  72 65 73 74 6f 72 65 20  |g \ and restore |
00000ea0  7a 65 72 6f 20 70 61 67  65 0d 03 c0 1f 52 54 49  |zero page....RTI|
00000eb0  20 5c 20 72 65 74 75 72  6e 20 66 72 6f 6d 20 69  | \ return from i|
00000ec0  6e 74 65 72 72 75 70 74  0d 03 ca 0c 2e 6e 6f 74  |nterrupt.....not|
00000ed0  75 73 65 72 0d 03 d4 44  50 4c 41 20 5c 20 70 75  |user...DPLA \ pu|
00000ee0  6c 6c 20 74 68 65 20 69  6e 74 65 72 72 75 70 74  |ll the interrupt|
00000ef0  20 61 63 63 75 6d 75 6c  61 74 6f 72 20 73 61 76  | accumulator sav|
00000f00  65 20 72 65 67 69 73 74  65 72 20 6f 66 66 20 74  |e register off t|
00000f10  68 65 20 73 74 61 63 6b  0d 03 de 2f 53 54 41 20  |he stack.../STA |
00000f20  73 61 76 65 72 65 67 20  5c 20 72 65 73 74 6f 72  |savereg \ restor|
00000f30  65 20 74 68 65 20 7a 65  72 6f 20 70 61 67 65 20  |e the zero page |
00000f40  61 64 64 72 65 73 73 0d  03 e8 31 4a 4d 50 20 28  |address...1JMP (|
00000f50  6f 6c 64 69 72 71 31 76  29 20 5c 20 65 78 69 74  |oldirq1v) \ exit|
00000f60  20 76 69 61 20 74 68 65  20 6f 72 69 67 69 6e 61  | via the origina|
00000f70  6c 20 76 65 63 74 6f 72  0d 03 f2 0d 2e 6f 6c 64  |l vector.....old|
00000f80  69 72 71 31 76 0d 03 fc  23 45 51 55 57 20 26 30  |irq1v...#EQUW &0|
00000f90  30 20 5c 20 6f 72 69 67  69 6e 61 6c 20 69 72 71  |0 \ original irq|
00000fa0  31 20 76 65 63 74 6f 72  0d 04 06 0d 2e 6c 61 73  |1 vector.....las|
00000fb0  74 62 79 74 65 0d 04 10  05 5d 0d 04 1a 05 ed 0d  |tbyte....]......|
00000fc0  04 24 1f 65 6e 64 3d 6d  63 6f 64 65 2b 28 6c 61  |.$.end=mcode+(la|
00000fd0  73 74 62 79 74 65 2d 69  6f 61 64 64 72 29 0d 04  |stbyte-ioaddr)..|
00000fe0  2e 0f 61 64 64 72 3d 69  6f 61 64 64 72 0d 04 38  |..addr=ioaddr..8|
00000ff0  16 e3 20 62 79 74 65 3d  6d 63 6f 64 65 20 b8 20  |.. byte=mcode . |
00001000  65 6e 64 0d 04 42 16 f2  77 72 69 74 65 28 3f 62  |end..B..write(?b|
00001010  79 74 65 2c 61 64 64 72  29 0d 04 4c 0f 61 64 64  |yte,addr)..L.add|
00001020  72 3d 61 64 64 72 2b 31  0d 04 56 05 ed 0d 04 60  |r=addr+1..V....`|
00001030  20 f2 77 72 69 74 65 28  28 69 6f 61 64 64 72 20  | .write((ioaddr |
00001040  83 20 32 35 36 29 2c 75  73 65 72 76 29 0d 04 6a  |. 256),userv)..j|
00001050  22 f2 77 72 69 74 65 28  28 69 6f 61 64 64 72 20  |".write((ioaddr |
00001060  81 20 32 35 36 29 2c 75  73 65 72 76 2b 31 29 0d  |. 256),userv+1).|
00001070  04 74 09 2a 43 4f 44 45  0d 04 7e 06 eb 37 0d 04  |.t.*CODE..~..7..|
00001080  88 48 6d 6f 75 73 65 24  3d bd 31 34 31 2b bd 31  |.Hmouse$=.141+.1|
00001090  33 32 2b bd 31 35 37 2b  bd 31 33 31 2b 22 4d 6f  |32+.157+.131+"Mo|
000010a0  75 73 65 20 63 6f 6f 72  64 69 6e 61 74 65 73 2c  |use coordinates,|
000010b0  20 72 61 6e 67 65 20 26  30 30 2d 26 46 46 20 20  | range &00-&FF  |
000010c0  22 2b bd 31 35 36 0d 04  92 10 f1 8a 30 2c 31 29  |"+.156......0,1)|
000010d0  6d 6f 75 73 65 24 0d 04  9c 10 f1 8a 30 2c 32 29  |mouse$......0,2)|
000010e0  6d 6f 75 73 65 24 0d 04  a6 0d ee 85 20 e5 20 8d  |mouse$...... . .|
000010f0  54 4a 45 0d 04 b0 12 ef  32 33 2c 31 2c 30 3b 30  |TJE.....23,1,0;0|
00001100  3b 30 3b 30 3b 0d 04 ba  2e f1 8a 31 30 2c 37 29  |;0;0;......10,7)|
00001110  22 42 79 74 65 73 20 75  73 65 64 20 3d 20 26 22  |"Bytes used = &"|
00001120  3b 7e 28 6c 61 73 74 62  79 74 65 2d 69 6f 61 64  |;~(lastbyte-ioad|
00001130  64 72 29 0d 04 c4 05 f5  0d 04 ce 23 f1 8a 31 30  |dr)........#..10|
00001140  2c 31 32 29 22 58 20 3d  20 26 22 3b 7e a4 72 65  |,12)"X = &";~.re|
00001150  61 64 28 26 38 30 29 3b  22 20 22 0d 04 d8 23 f1  |ad(&80);" "...#.|
00001160  8a 32 30 2c 31 32 29 22  59 20 3d 20 26 22 3b 7e  |.20,12)"Y = &";~|
00001170  a4 72 65 61 64 28 26 38  31 29 3b 22 20 22 0d 04  |.read(&81);" "..|
00001180  e2 2e e7 20 a4 72 69 67  68 74 20 f1 8a 32 32 2c  |... .right ..22,|
00001190  31 37 29 22 52 69 67 68  74 22 20 8b 20 f1 8a 32  |17)"Right" . ..2|
000011a0  32 2c 31 37 29 22 20 20  20 20 20 22 0d 04 ec 31  |2,17)"     "...1|
000011b0  e7 20 a4 63 65 6e 74 72  65 20 f1 8a 31 35 2c 31  |. .centre ..15,1|
000011c0  37 29 22 43 65 6e 74 72  65 22 20 8b 20 f1 8a 31  |7)"Centre" . ..1|
000011d0  35 2c 31 37 29 22 20 20  20 20 20 20 22 0d 04 f6  |5,17)"      "...|
000011e0  2b e7 20 a4 6c 65 66 74  20 f1 8a 31 30 2c 31 37  |+. .left ..10,17|
000011f0  29 22 4c 65 66 74 22 20  8b 20 f1 8a 31 30 2c 31  |)"Left" . ..10,1|
00001200  37 29 22 20 20 20 20 22  0d 05 00 07 fd 20 a3 0d  |7)"    "..... ..|
00001210  05 0a 09 2a 43 4f 44 45  0d 05 14 19 ef 32 33 2c  |...*CODE.....23,|
00001220  31 2c 31 3b 30 3b 30 3b  30 3b 33 31 2c 30 2c 32  |1,1;0;0;0;31,0,2|
00001230  33 0d 05 1e 05 e0 0d 05  28 16 dd f2 77 72 69 74  |3.......(...writ|
00001240  65 28 64 61 74 61 2c 61  64 64 72 29 0d 05 32 1b  |e(data,addr)..2.|
00001250  21 70 61 72 61 6d 3d 61  64 64 72 20 84 20 26 46  |!param=addr . &F|
00001260  46 46 46 30 30 30 30 0d  05 3c 10 70 61 72 61 6d  |FFF0000..<.param|
00001270  3f 34 3d 64 61 74 61 0d  05 46 08 41 25 3d 36 0d  |?4=data..F.A%=6.|
00001280  05 50 12 58 25 3d 70 61  72 61 6d 20 83 20 32 35  |.P.X%=param . 25|
00001290  36 0d 05 5a 12 59 25 3d  70 61 72 61 6d 20 81 20  |6..Z.Y%=param . |
000012a0  32 35 36 0d 05 64 0c d6  20 6f 73 77 6f 72 64 0d  |256..d.. osword.|
000012b0  05 6e 05 e1 0d 05 78 10  dd a4 72 65 61 64 28 61  |.n....x...read(a|
000012c0  64 64 72 29 0d 05 82 1b  21 70 61 72 61 6d 3d 61  |ddr)....!param=a|
000012d0  64 64 72 20 84 20 26 46  46 46 46 30 30 30 30 0d  |ddr . &FFFF0000.|
000012e0  05 8c 08 41 25 3d 35 0d  05 96 12 58 25 3d 70 61  |...A%=5....X%=pa|
000012f0  72 61 6d 20 83 20 32 35  36 0d 05 a0 12 59 25 3d  |ram . 256....Y%=|
00001300  70 61 72 61 6d 20 81 20  32 35 36 0d 05 aa 0c d6  |param . 256.....|
00001310  20 6f 73 77 6f 72 64 0d  05 b4 0c 3d 70 61 72 61  | osword....=para|
00001320  6d 3f 34 0d 05 be 0c dd  a4 62 75 74 74 6f 6e 0d  |m?4......button.|
00001330  05 c8 0a 41 25 3d 26 39  36 0d 05 d2 0a 58 25 3d  |...A%=&96....X%=|
00001340  26 36 30 0d 05 dc 21 3d  28 ba 28 6f 73 62 79 74  |&60...!=(.(osbyt|
00001350  65 29 20 80 20 26 46 46  30 30 30 30 29 81 26 31  |e) . &FF0000).&1|
00001360  30 30 30 30 0d 05 e6 0b  dd a4 72 69 67 68 74 0d  |0000......right.|
00001370  05 f0 18 3d 28 28 a4 62  75 74 74 6f 6e 20 80 20  |...=((.button . |
00001380  26 38 30 29 3d 30 29 0d  05 fa 0c dd a4 63 65 6e  |&80)=0)......cen|
00001390  74 72 65 0d 06 04 18 3d  28 28 a4 62 75 74 74 6f  |tre....=((.butto|
000013a0  6e 20 80 20 26 34 30 29  3d 30 29 0d 06 0e 0a dd  |n . &40)=0).....|
000013b0  a4 6c 65 66 74 0d 06 18  18 3d 28 28 a4 62 75 74  |.left....=((.but|
000013c0  74 6f 6e 20 80 20 26 32  30 29 3d 30 29 0d ff     |ton . &20)=0)..|
000013cf
02-12-88/SPMOUSE.m0
02-12-88/SPMOUSE.m1
02-12-88/SPMOUSE.m2
02-12-88/SPMOUSE.m4
02-12-88/SPMOUSE.m5