Home » CEEFAX disks » telesoftware11.adl » 16-12-88/NEWSCAN

16-12-88/NEWSCAN

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: 16-12-88/NEWSCAN
Read OK:
File size: 1E9C bytes
Load address: 0800
Exec address: 8023
File contents
   10REM> NEWSCAN
   20DIM mcode &200 :REM: machine code at mcode
   30savereg=&FC :REM: interrupt accumulator save register
   40irq1v=&204 :REM: primary interrupt vector
   50bytev=&20A :REM: Osbyte indirection vector
   60drb=&FE60 :REM: data register B
   70ddrb=&FE62 :REM: data direction register B
   80pcr=&FE6C :REM: peripheral control register
   90ifr=&FE6D :REM: interrupt flag register
  100ier=&FE6E :REM: interrupt enable register
  110osbyte=&FFF4
  120FOR pass=0 TO 2 STEP 2
  130P%=mcode
  140[OPT pass
  150LDX irq1v \ current primary interrupt vector, low byte
  160LDY irq1v+1 \ current primary interrupt vector, high byte
  170CPY #interrupt DIV 256 \ compare high byte
  180BEQ disable \ restore old vector if altered
  190STX oldirq1v \ save original irq1 vector, low byte
  200STY oldirq1v+1 \ save original irq1 vector, high byte
  210LDX bytev \ Osbyte indirection vector, low byte
  220LDY bytev+1 \ Osbyte indirection vector, high byte
  230STX oldbytev \ save original Osbyte vector, low byte
  240STY oldbytev+1 \ save original Osbyte vector, high byte
  250LDX #interrupt MOD 256 \ new irq1 vector, low byte
  260LDY #interrupt DIV 256 \ new irq1 vector, high byte
  270SEI \ set interrupt disable flag
  280STX irq1v \ alter irq1 vector, low byte
  290STY irq1v+1 \ alter irq1 vector, high byte
  300CLI \ clear interrupt disable flag
  310LDX #newscan MOD 256 \ new Osbyte vector, low byte
  320LDY #newscan DIV 256 \ new Osbyte vector, high byte
  330STX bytev \ alter Osbyte vector, low byte
  340STY bytev+1 \ alter Osbyte vector, high byte
  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 #&00 \ user port input
  420STA ddrb \ data direction register B
  430RTS \ return to BASIC
  440.disable
  450LDA #&18 \ %00011000 ready to clear bits 3 and 4 of ier
  460LDX oldirq1v \ original irq1 vector, low byte
  470LDY oldirq1v+1 \ original irq1 vector, high byte
  480SEI \ set interrupt disable flag
  490STA ier \ interrupt enable register
  500LDA pcr \ peripheral control register
  510AND #&0F \ clear bits 4-7
  520STA pcr \ peripheral control register
  530STX irq1v \ restore irq1 vector, low byte
  540STY irq1v+1 \ restore irq1 vector, high byte
  550CLI \ clear interrupt disable flag
  560LDX oldbytev \ original Osbyte vector, low byte
  570LDY oldbytev+1 \ original Osbyte vector, high byte
  580STX bytev \ restore Osbyte vector, low byte
  590STY bytev+1 \ restore Osbyte vector, high byte
  600RTS \ return to BASIC
  610.interrupt
  620LDA savereg \ interrupt accumulator save register
  630PHA \ and push it on the stack
  640LDA ifr \ interrupt flag register
  650BPL notuser \ bit 7 is set if VIA-B interrupt
  660AND #&18 \ AND with %00011000, ie. test bits 3 and 4
  670BEQ notuser \ exit if not CB1 or CB2
  680AND #&10 \ AND with %00010000, ie. test CB1
  690BNE xpulse \ bit 4 set for an X direction movement
  700LDA drb \ Y direction, load data register B
  710AND #&04 \ AND with %00000100, ie. test bit 2
  720BNE ydown \ if bit 2 is set then Y is going down
  730INC ycoord \ Y is going up so increment Y coordinate
  740BNE exit \ branch if in the range 1 to 255
  750BEQ decy \ if zero then alter to 255
  760.ydown
  770LDA ycoord \ load Y coordinate
  780BEQ exit \ branch if zero because it can't go any lower
  790.decy
  800DEC ycoord \ reduce Y coordinate by 1
  810JMP exit \ restore interrupt accumulator save register and RTI
  820.xpulse
  830LDA drb \ load data register B
  840ROR A \ bit 0 into carry
  850BCS xdown \ X is going down if bit 0 is set
  860INC xcoord \ X is going up if bit 0 is clear
  870BNE exit \ exit if X coordinate is in the range from 1 to 255
  880BEQ decx \ if X coordinate = 0 then make it 255
  890.xdown
  900LDA xcoord \ load X coordinate
  910BEQ exit \ if it is zero it can't go any lower
  920.decx
  930DEC xcoord \ decrease X coordinate by 1
  940.exit
  950PLA \ pull interrupt accumulator save register off the stack
  960STA savereg \ and restore zero page
  970RTI \ return from interrupt
  980.notuser
  990PLA \ pull the interrupt accumulator save register off the stack
 1000STA savereg \ restore the zero page address
 1010JMP (oldirq1v) \ exit via the original vector
 1020.newscan
 1030PHP \ push status register
 1040CMP #&79 \ is this Osbyte &79?
 1050BEQ scan \ if it is branch to new keyboard scan routine
 1060CMP #&7A \ is this Osbyte &7A?
 1070BEQ scan \ branch if Osbyte &7A
 1080.notscan
 1090PLP \ restore status register and return to BASIC
 1100.oldcode
 1110JMP (oldbytev) \ exit via original Osbyte vector
 1120.scan
 1130PHA \ push the Osbyte code (either &79 or &7A)
 1140JSR oldcode \ perform the original Osbyte call
 1150CPX #&FF \ key pressed if X <> &FF
 1160BEQ notpressed \ branch if key not pressed
 1170.pullout
 1180PLA \ pull Osbyte code (either &79 or &7A)
 1190PLP \ pull the status register
 1200RTS \ and return to BASIC
 1210.notpressed
 1220LDA drb \ load data register B
 1230ROL A \ bit 7 of register B into carry
 1240BCC rightpress \ carry clear if right button pressed
 1250ROL A \ bit 6 into carry
 1260BCC centrepress \ bit 6 clear if centre button pressed
 1270ROL A \ bit 5 into carry
 1280BCC leftpress \ bit 5 clear if left button pressed
 1290LDA xcoord \ X coordinate from mouse movement
 1300CMP #&88 \ is the X coordinate > &87?
 1310BCS rightarrow \ branch if X coordinate is high enough
 1320CMP #&78 \ is the X coordinate < &78?
 1330BCC leftarrow \ branch if Y coordinate is low enough
 1340LDA ycoord \ Y coordinate from mouse movement
 1350CMP #&88 \ is the Y coordinate > &87?
 1360BCS uparrow \ branch if Y coordinate is high enough
 1370CMP #&78 \ is the Y coordinate < &78?
 1380BCS pullout \ return to BASIC if it is not
 1390LDX down \ simulate a press on the cursor down key
 1400BNE resety \ unconditional branch to reset Y coordinate
 1410.uparrow
 1420LDX up \ simulate a press on the cursor up key
 1430.resety
 1440LDA #&80 \ reset the Y coordinate to &80
 1450STA ycoord
 1460BNE pullout \ unconditional branch to return to BASIC
 1470.rightarrow
 1480LDX right \ simulate a press on the cursor right key
 1490BNE resetx \ unconditional branch to reset X coordinate
 1500.leftarrow
 1510LDX left \ simulate a press on the cursor left key
 1520.resetx
 1530LDA #&80 \ reset Y coordinate to &80
 1540STA xcoord
 1550BNE pullout \ unconditional branch to return to BASIC
 1560.leftpress
 1570LDX leftbutton \ simulate a key press from left mouse button
 1580BNE pullout \ unconditional branch to return to BASIC
 1590.rightpress
 1600LDX rightbutton \ simulate a key press from right mouse button
 1610BNE pullout \ unconditional branch to return to BASIC
 1620.centrepress
 1630LDX centrebutton \ simulate a key press from centre mouse button
 1640BNE pullout \ unconditional branch to return to BASIC
 1650.rightbutton
 1660EQUB &59 \ delete internal key number
 1670.centrebutton
 1680EQUB &49 \ return internal key number
 1690.leftbutton
 1700EQUB &69 \ copy internal key number
 1710.up
 1720EQUB &39 \ cursor up internal key number
 1730.down
 1740EQUB &29 \ cursor down internal key number
 1750.left
 1760EQUB &19 \ cursor left internal key number
 1770.right
 1780EQUB &79 \ cursor right internal key number
 1790.oldirq1v
 1800EQUW &00 \ original irq1 vector
 1810.oldbytev
 1820EQUW &00 \ original Osbyte indirection vector
 1830.xcoord
 1840EQUB &80 \ mouse X coordinate 0-255
 1850.ycoord
 1860EQUB &80 \ mouse Y coordinate 0-255
 1870.lastbyte
 1880]
 1890NEXT
 1900CALL mcode :REM: enable new code
 1910MODE7
 1920mouse$=CHR$141+CHR$132+CHR$157+CHR$131+"Press keyboard or move the mouse  "+CHR$156
 1930PRINTTAB(0,1)mouse$
 1940PRINTTAB(0,2)mouse$
 1950PRINTTAB(10,6)"Bytes used = &";~(lastbyte-mcode)
 1960ON ERROR GOTO 2100
 1970VDU23,1,0;0;0;0;
 1980REPEAT
 1990PRINTTAB(10,10)"X = &";~?H%;" "
 2000PRINTTAB(20,10)"Y = &";~?V%;" "
 2010A%=&79
 2020X%=16
 2030answer=(USR(osbyte) AND &FF00)DIV &100
 2040PRINTTAB(9,15)"Osbyte &79, X = &";~answer;" "
 2050A%=&7A
 2060X%=0
 2070answer=(USR(osbyte) AND &FF00)DIV &100
 2080PRINTTAB(9,20)"Osbyte &7A, X = &";~answer;" "
 2090UNTIL FALSE
 2100CALL mcode :REM: disable new code
 2110VDU23,1,1;0;0;0;31,0,23
 2120END

�> NEWSCAN
*� mcode &200 :�: machine code at mcode
7savereg=&FC :�: interrupt accumulator save register
(+irq1v=&204 :�: primary interrupt vector
2,bytev=&20A :�: Osbyte indirection vector
<!drb=&FE60 :�: data register B
F,ddrb=&FE62 :�: data direction register B
P-pcr=&FE6C :�: peripheral control register
Z)ifr=&FE6D :�: interrupt flag register
d+ier=&FE6E :�: interrupt enable register
nosbyte=&FFF4
x� pass=0 � 2 � 2
�P%=mcode
�
[OPT pass
�: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
�3LDX bytev \ Osbyte indirection vector, low byte
�6LDY bytev+1 \ Osbyte indirection vector, high byte
�8STX oldbytev \ save original Osbyte vector, low byte
�;STY oldbytev+1 \ save original Osbyte vector, high byte
�4LDX #interrupt � 256 \ new irq1 vector, low byte
5LDY #interrupt � 256 \ new irq1 vector, high byte
$SEI \ set interrupt disable flag
+STX irq1v \ alter irq1 vector, low byte
".STY irq1v+1 \ alter irq1 vector, high byte
,&CLI \ clear interrupt disable flag
64LDX #newscan � 256 \ new Osbyte vector, low byte
@5LDY #newscan � 256 \ new Osbyte vector, high byte
J-STX bytev \ alter Osbyte vector, low byte
T0STY bytev+1 \ alter Osbyte vector, high byte
^*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 #&00 \ user port input
�(STA ddrb \ data direction register B
�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
-STX irq1v \ restore irq1 vector, low byte
0STY irq1v+1 \ restore irq1 vector, high byte
&&CLI \ clear interrupt disable flag
03LDX oldbytev \ original Osbyte vector, low byte
:6LDY oldbytev+1 \ original Osbyte vector, high byte
D/STX bytev \ restore Osbyte vector, low byte
N2STY bytev+1 \ restore Osbyte vector, high byte
XRTS \ return to BASIC
b.interrupt
l5LDA savereg \ interrupt accumulator save register
v"PHA \ and push it on the stack
�%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 CB1
�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
4.xpulse
>"LDA drb \ load data register B
HROR A \ bit 0 into carry
R/BCS xdown \ X is going down if bit 0 is set
\0INC xcoord \ X is going up if bit 0 is clear
fABNE exit \ exit if X coordinate is in the range from 1 to 255
p3BEQ decx \ if X coordinate = 0 then make it 255
z
.xdown
�"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
�.newscan
PHP \ push status register
"CMP #&79 \ is this Osbyte &79?
;BEQ scan \ if it is branch to new keyboard scan routine
$"CMP #&7A \ is this Osbyte &7A?
.#BEQ scan \ branch if Osbyte &7A
8.notscan
B5PLP \ restore status register and return to BASIC
L.oldcode
V4JMP (oldbytev) \ exit via original Osbyte vector
`	.scan
j2PHA \ push the Osbyte code (either &79 or &7A)
t2JSR oldcode \ perform the original Osbyte call
~&CPX #&FF \ key pressed if X <> &FF
�.BEQ notpressed \ branch if key not pressed
�.pullout
�.PLA \ pull Osbyte code (either &79 or &7A)
�"PLP \ pull the status register
�RTS \ and return to BASIC
�.notpressed
�"LDA drb \ load data register B
�*ROL A \ bit 7 of register B into carry
�8BCC rightpress \ carry clear if right button pressed
�ROL A \ bit 6 into carry
�:BCC centrepress \ bit 6 clear if centre button pressed
�ROL A \ bit 5 into carry
6BCC leftpress \ bit 5 clear if left button pressed

1LDA xcoord \ X coordinate from mouse movement
)CMP #&88 \ is the X coordinate > &87?
:BCS rightarrow \ branch if X coordinate is high enough
()CMP #&78 \ is the X coordinate < &78?
28BCC leftarrow \ branch if Y coordinate is low enough
<1LDA ycoord \ Y coordinate from mouse movement
F)CMP #&88 \ is the Y coordinate > &87?
P7BCS uparrow \ branch if Y coordinate is high enough
Z)CMP #&78 \ is the Y coordinate < &78?
d.BCS pullout \ return to BASIC if it is not
n6LDX down \ simulate a press on the cursor down key
x;BNE resety \ unconditional branch to reset Y coordinate
�.uparrow
�2LDX up \ simulate a press on the cursor up key
�.resety
�,LDA #&80 \ reset the Y coordinate to &80
�STA ycoord
�9BNE pullout \ unconditional branch to return to BASIC
�.rightarrow
�8LDX right \ simulate a press on the cursor right key
�;BNE resetx \ unconditional branch to reset X coordinate
�.leftarrow
�6LDX left \ simulate a press on the cursor left key
�.resetx
�(LDA #&80 \ reset Y coordinate to &80
STA xcoord
9BNE pullout \ unconditional branch to return to BASIC
.leftpress
"@LDX leftbutton \ simulate a key press from left mouse button
,9BNE pullout \ unconditional branch to return to BASIC
6.rightpress
@BLDX rightbutton \ simulate a key press from right mouse button
J9BNE pullout \ unconditional branch to return to BASIC
T.centrepress
^DLDX centrebutton \ simulate a key press from centre mouse button
h9BNE pullout \ unconditional branch to return to BASIC
r.rightbutton
|)EQUB &59 \ delete internal key number
�.centrebutton
�)EQUB &49 \ return internal key number
�.leftbutton
�'EQUB &69 \ copy internal key number
�.up
�,EQUB &39 \ cursor up internal key number
�	.down
�.EQUB &29 \ cursor down internal key number
�	.left
�.EQUB &19 \ cursor left internal key number
�
.right
�/EQUB &79 \ cursor right internal key number
�
.oldirq1v
#EQUW &00 \ original irq1 vector

.oldbytev
1EQUW &00 \ original Osbyte indirection vector
&.xcoord
0'EQUB &80 \ mouse X coordinate 0-255
:.ycoord
D'EQUB &80 \ mouse Y coordinate 0-255
N
.lastbyte
X]
b�
l� mcode :�: enable new code
v�7
�Hmouse$=�141+�132+�157+�131+"Press keyboard or move the mouse  "+�156
��0,1)mouse$
��0,2)mouse$
�-�10,6)"Bytes used = &";~(lastbyte-mcode)
�� � � �TtH
��23,1,0;0;0;0;
��
��10,10)"X = &";~?H%;" "
��20,10)"Y = &";~?V%;" "
�
A%=&79
�	X%=16
�$answer=(�(osbyte) � &FF00)� &100
�*�9,15)"Osbyte &79, X = &";~answer;" "

A%=&7A
X%=0
$answer=(�(osbyte) � &FF00)� &100
 *�9,20)"Osbyte &7A, X = &";~answer;" "
*� �
4 � mcode :�: disable new code
>�23,1,1;0;0;0;31,0,23
H�
�
00000000  0d 00 0a 0e f4 3e 20 4e  45 57 53 43 41 4e 0d 00  |.....> NEWSCAN..|
00000010  14 2a de 20 6d 63 6f 64  65 20 26 32 30 30 20 3a  |.*. mcode &200 :|
00000020  f4 3a 20 6d 61 63 68 69  6e 65 20 63 6f 64 65 20  |.: machine code |
00000030  61 74 20 6d 63 6f 64 65  0d 00 1e 37 73 61 76 65  |at mcode...7save|
00000040  72 65 67 3d 26 46 43 20  3a f4 3a 20 69 6e 74 65  |reg=&FC :.: inte|
00000050  72 72 75 70 74 20 61 63  63 75 6d 75 6c 61 74 6f  |rrupt accumulato|
00000060  72 20 73 61 76 65 20 72  65 67 69 73 74 65 72 0d  |r save register.|
00000070  00 28 2b 69 72 71 31 76  3d 26 32 30 34 20 3a f4  |.(+irq1v=&204 :.|
00000080  3a 20 70 72 69 6d 61 72  79 20 69 6e 74 65 72 72  |: primary interr|
00000090  75 70 74 20 76 65 63 74  6f 72 0d 00 32 2c 62 79  |upt vector..2,by|
000000a0  74 65 76 3d 26 32 30 41  20 3a f4 3a 20 4f 73 62  |tev=&20A :.: Osb|
000000b0  79 74 65 20 69 6e 64 69  72 65 63 74 69 6f 6e 20  |yte indirection |
000000c0  76 65 63 74 6f 72 0d 00  3c 21 64 72 62 3d 26 46  |vector..<!drb=&F|
000000d0  45 36 30 20 3a f4 3a 20  64 61 74 61 20 72 65 67  |E60 :.: data reg|
000000e0  69 73 74 65 72 20 42 0d  00 46 2c 64 64 72 62 3d  |ister B..F,ddrb=|
000000f0  26 46 45 36 32 20 3a f4  3a 20 64 61 74 61 20 64  |&FE62 :.: data d|
00000100  69 72 65 63 74 69 6f 6e  20 72 65 67 69 73 74 65  |irection registe|
00000110  72 20 42 0d 00 50 2d 70  63 72 3d 26 46 45 36 43  |r B..P-pcr=&FE6C|
00000120  20 3a f4 3a 20 70 65 72  69 70 68 65 72 61 6c 20  | :.: peripheral |
00000130  63 6f 6e 74 72 6f 6c 20  72 65 67 69 73 74 65 72  |control register|
00000140  0d 00 5a 29 69 66 72 3d  26 46 45 36 44 20 3a f4  |..Z)ifr=&FE6D :.|
00000150  3a 20 69 6e 74 65 72 72  75 70 74 20 66 6c 61 67  |: interrupt flag|
00000160  20 72 65 67 69 73 74 65  72 0d 00 64 2b 69 65 72  | register..d+ier|
00000170  3d 26 46 45 36 45 20 3a  f4 3a 20 69 6e 74 65 72  |=&FE6E :.: inter|
00000180  72 75 70 74 20 65 6e 61  62 6c 65 20 72 65 67 69  |rupt enable regi|
00000190  73 74 65 72 0d 00 6e 10  6f 73 62 79 74 65 3d 26  |ster..n.osbyte=&|
000001a0  46 46 46 34 0d 00 78 14  e3 20 70 61 73 73 3d 30  |FFF4..x.. pass=0|
000001b0  20 b8 20 32 20 88 20 32  0d 00 82 0c 50 25 3d 6d  | . 2 . 2....P%=m|
000001c0  63 6f 64 65 0d 00 8c 0d  5b 4f 50 54 20 70 61 73  |code....[OPT pas|
000001d0  73 0d 00 96 3a 4c 44 58  20 69 72 71 31 76 20 5c  |s...:LDX irq1v \|
000001e0  20 63 75 72 72 65 6e 74  20 70 72 69 6d 61 72 79  | current primary|
000001f0  20 69 6e 74 65 72 72 75  70 74 20 76 65 63 74 6f  | interrupt vecto|
00000200  72 2c 20 6c 6f 77 20 62  79 74 65 0d 00 a0 3d 4c  |r, low byte...=L|
00000210  44 59 20 69 72 71 31 76  2b 31 20 5c 20 63 75 72  |DY irq1v+1 \ cur|
00000220  72 65 6e 74 20 70 72 69  6d 61 72 79 20 69 6e 74  |rent primary int|
00000230  65 72 72 75 70 74 20 76  65 63 74 6f 72 2c 20 68  |errupt vector, h|
00000240  69 67 68 20 62 79 74 65  0d 00 aa 2c 43 50 59 20  |igh byte...,CPY |
00000250  23 69 6e 74 65 72 72 75  70 74 20 81 20 32 35 36  |#interrupt . 256|
00000260  20 5c 20 63 6f 6d 70 61  72 65 20 68 69 67 68 20  | \ compare high |
00000270  62 79 74 65 0d 00 b4 2f  42 45 51 20 64 69 73 61  |byte.../BEQ disa|
00000280  62 6c 65 20 5c 20 72 65  73 74 6f 72 65 20 6f 6c  |ble \ restore ol|
00000290  64 20 76 65 63 74 6f 72  20 69 66 20 61 6c 74 65  |d vector if alte|
000002a0  72 65 64 0d 00 be 36 53  54 58 20 6f 6c 64 69 72  |red...6STX oldir|
000002b0  71 31 76 20 5c 20 73 61  76 65 20 6f 72 69 67 69  |q1v \ save origi|
000002c0  6e 61 6c 20 69 72 71 31  20 76 65 63 74 6f 72 2c  |nal irq1 vector,|
000002d0  20 6c 6f 77 20 62 79 74  65 0d 00 c8 39 53 54 59  | low byte...9STY|
000002e0  20 6f 6c 64 69 72 71 31  76 2b 31 20 5c 20 73 61  | oldirq1v+1 \ sa|
000002f0  76 65 20 6f 72 69 67 69  6e 61 6c 20 69 72 71 31  |ve original irq1|
00000300  20 76 65 63 74 6f 72 2c  20 68 69 67 68 20 62 79  | vector, high by|
00000310  74 65 0d 00 d2 33 4c 44  58 20 62 79 74 65 76 20  |te...3LDX bytev |
00000320  5c 20 4f 73 62 79 74 65  20 69 6e 64 69 72 65 63  |\ Osbyte indirec|
00000330  74 69 6f 6e 20 76 65 63  74 6f 72 2c 20 6c 6f 77  |tion vector, low|
00000340  20 62 79 74 65 0d 00 dc  36 4c 44 59 20 62 79 74  | byte...6LDY byt|
00000350  65 76 2b 31 20 5c 20 4f  73 62 79 74 65 20 69 6e  |ev+1 \ Osbyte in|
00000360  64 69 72 65 63 74 69 6f  6e 20 76 65 63 74 6f 72  |direction vector|
00000370  2c 20 68 69 67 68 20 62  79 74 65 0d 00 e6 38 53  |, high byte...8S|
00000380  54 58 20 6f 6c 64 62 79  74 65 76 20 5c 20 73 61  |TX oldbytev \ sa|
00000390  76 65 20 6f 72 69 67 69  6e 61 6c 20 4f 73 62 79  |ve original Osby|
000003a0  74 65 20 76 65 63 74 6f  72 2c 20 6c 6f 77 20 62  |te vector, low b|
000003b0  79 74 65 0d 00 f0 3b 53  54 59 20 6f 6c 64 62 79  |yte...;STY oldby|
000003c0  74 65 76 2b 31 20 5c 20  73 61 76 65 20 6f 72 69  |tev+1 \ save ori|
000003d0  67 69 6e 61 6c 20 4f 73  62 79 74 65 20 76 65 63  |ginal Osbyte vec|
000003e0  74 6f 72 2c 20 68 69 67  68 20 62 79 74 65 0d 00  |tor, high byte..|
000003f0  fa 34 4c 44 58 20 23 69  6e 74 65 72 72 75 70 74  |.4LDX #interrupt|
00000400  20 83 20 32 35 36 20 5c  20 6e 65 77 20 69 72 71  | . 256 \ new irq|
00000410  31 20 76 65 63 74 6f 72  2c 20 6c 6f 77 20 62 79  |1 vector, low by|
00000420  74 65 0d 01 04 35 4c 44  59 20 23 69 6e 74 65 72  |te...5LDY #inter|
00000430  72 75 70 74 20 81 20 32  35 36 20 5c 20 6e 65 77  |rupt . 256 \ new|
00000440  20 69 72 71 31 20 76 65  63 74 6f 72 2c 20 68 69  | irq1 vector, hi|
00000450  67 68 20 62 79 74 65 0d  01 0e 24 53 45 49 20 5c  |gh byte...$SEI \|
00000460  20 73 65 74 20 69 6e 74  65 72 72 75 70 74 20 64  | set interrupt d|
00000470  69 73 61 62 6c 65 20 66  6c 61 67 0d 01 18 2b 53  |isable flag...+S|
00000480  54 58 20 69 72 71 31 76  20 5c 20 61 6c 74 65 72  |TX irq1v \ alter|
00000490  20 69 72 71 31 20 76 65  63 74 6f 72 2c 20 6c 6f  | irq1 vector, lo|
000004a0  77 20 62 79 74 65 0d 01  22 2e 53 54 59 20 69 72  |w byte..".STY ir|
000004b0  71 31 76 2b 31 20 5c 20  61 6c 74 65 72 20 69 72  |q1v+1 \ alter ir|
000004c0  71 31 20 76 65 63 74 6f  72 2c 20 68 69 67 68 20  |q1 vector, high |
000004d0  62 79 74 65 0d 01 2c 26  43 4c 49 20 5c 20 63 6c  |byte..,&CLI \ cl|
000004e0  65 61 72 20 69 6e 74 65  72 72 75 70 74 20 64 69  |ear interrupt di|
000004f0  73 61 62 6c 65 20 66 6c  61 67 0d 01 36 34 4c 44  |sable flag..64LD|
00000500  58 20 23 6e 65 77 73 63  61 6e 20 83 20 32 35 36  |X #newscan . 256|
00000510  20 5c 20 6e 65 77 20 4f  73 62 79 74 65 20 76 65  | \ new Osbyte ve|
00000520  63 74 6f 72 2c 20 6c 6f  77 20 62 79 74 65 0d 01  |ctor, low byte..|
00000530  40 35 4c 44 59 20 23 6e  65 77 73 63 61 6e 20 81  |@5LDY #newscan .|
00000540  20 32 35 36 20 5c 20 6e  65 77 20 4f 73 62 79 74  | 256 \ new Osbyt|
00000550  65 20 76 65 63 74 6f 72  2c 20 68 69 67 68 20 62  |e vector, high b|
00000560  79 74 65 0d 01 4a 2d 53  54 58 20 62 79 74 65 76  |yte..J-STX bytev|
00000570  20 5c 20 61 6c 74 65 72  20 4f 73 62 79 74 65 20  | \ alter Osbyte |
00000580  76 65 63 74 6f 72 2c 20  6c 6f 77 20 62 79 74 65  |vector, low byte|
00000590  0d 01 54 30 53 54 59 20  62 79 74 65 76 2b 31 20  |..T0STY bytev+1 |
000005a0  5c 20 61 6c 74 65 72 20  4f 73 62 79 74 65 20 76  |\ alter Osbyte v|
000005b0  65 63 74 6f 72 2c 20 68  69 67 68 20 62 79 74 65  |ector, high byte|
000005c0  0d 01 5e 2a 4c 44 41 20  23 26 39 38 20 5c 20 25  |..^*LDA #&98 \ %|
000005d0  31 30 30 31 31 30 30 30  2c 20 69 65 2e 20 65 6e  |10011000, ie. en|
000005e0  61 62 6c 65 20 43 42 31  2f 32 0d 01 68 27 53 54  |able CB1/2..h'ST|
000005f0  41 20 69 65 72 20 5c 20  69 6e 74 65 72 72 75 70  |A ier \ interrup|
00000600  74 20 65 6e 61 62 6c 65  20 72 65 67 69 73 74 65  |t enable registe|
00000610  72 0d 01 72 29 4c 44 41  20 70 63 72 20 5c 20 70  |r..r)LDA pcr \ p|
00000620  65 72 69 70 68 65 72 61  6c 20 63 6f 6e 74 72 6f  |eripheral contro|
00000630  6c 20 72 65 67 69 73 74  65 72 0d 01 7c 30 80 20  |l register..|0. |
00000640  23 26 30 46 20 5c 20 80  20 77 69 74 68 20 25 30  |#&0F \ . with %0|
00000650  30 30 30 31 31 31 31 2c  20 69 65 20 63 6c 65 61  |0001111, ie clea|
00000660  72 20 62 69 74 73 20 34  2d 37 0d 01 86 34 84 41  |r bits 4-7...4.A|
00000670  20 23 26 35 30 20 5c 20  84 20 77 69 74 68 20 25  | #&50 \ . with %|
00000680  30 31 30 31 30 30 30 30  2c 20 69 65 2e 20 73 65  |01010000, ie. se|
00000690  74 20 62 69 74 73 20 34  20 61 6e 64 20 36 0d 01  |t bits 4 and 6..|
000006a0  90 42 53 54 41 20 70 63  72 20 5c 20 69 6e 74 65  |.BSTA pcr \ inte|
000006b0  72 72 75 70 74 20 6f 6e  20 2b 76 65 20 74 72 61  |rrupt on +ve tra|
000006c0  6e 73 69 74 69 6f 6e 2c  20 43 42 32 20 69 6e 70  |nsition, CB2 inp|
000006d0  75 74 2c 20 44 52 42 20  74 6f 20 63 6c 65 61 72  |ut, DRB to clear|
000006e0  0d 01 9a 1e 4c 44 41 20  23 26 30 30 20 5c 20 75  |....LDA #&00 \ u|
000006f0  73 65 72 20 70 6f 72 74  20 69 6e 70 75 74 0d 01  |ser port input..|
00000700  a4 28 53 54 41 20 64 64  72 62 20 5c 20 64 61 74  |.(STA ddrb \ dat|
00000710  61 20 64 69 72 65 63 74  69 6f 6e 20 72 65 67 69  |a direction regi|
00000720  73 74 65 72 20 42 0d 01  ae 19 52 54 53 20 5c 20  |ster B....RTS \ |
00000730  72 65 74 75 72 6e 20 74  6f 20 42 41 53 49 43 0d  |return to BASIC.|
00000740  01 b8 0c 2e 64 69 73 61  62 6c 65 0d 01 c2 3b 4c  |....disable...;L|
00000750  44 41 20 23 26 31 38 20  5c 20 25 30 30 30 31 31  |DA #&18 \ %00011|
00000760  30 30 30 20 72 65 61 64  79 20 74 6f 20 63 6c 65  |000 ready to cle|
00000770  61 72 20 62 69 74 73 20  33 20 61 6e 64 20 34 20  |ar bits 3 and 4 |
00000780  6f 66 20 69 65 72 0d 01  cc 31 4c 44 58 20 6f 6c  |of ier...1LDX ol|
00000790  64 69 72 71 31 76 20 5c  20 6f 72 69 67 69 6e 61  |dirq1v \ origina|
000007a0  6c 20 69 72 71 31 20 76  65 63 74 6f 72 2c 20 6c  |l irq1 vector, l|
000007b0  6f 77 20 62 79 74 65 0d  01 d6 34 4c 44 59 20 6f  |ow byte...4LDY o|
000007c0  6c 64 69 72 71 31 76 2b  31 20 5c 20 6f 72 69 67  |ldirq1v+1 \ orig|
000007d0  69 6e 61 6c 20 69 72 71  31 20 76 65 63 74 6f 72  |inal irq1 vector|
000007e0  2c 20 68 69 67 68 20 62  79 74 65 0d 01 e0 24 53  |, high byte...$S|
000007f0  45 49 20 5c 20 73 65 74  20 69 6e 74 65 72 72 75  |EI \ set interru|
00000800  70 74 20 64 69 73 61 62  6c 65 20 66 6c 61 67 0d  |pt disable flag.|
00000810  01 ea 27 53 54 41 20 69  65 72 20 5c 20 69 6e 74  |..'STA ier \ int|
00000820  65 72 72 75 70 74 20 65  6e 61 62 6c 65 20 72 65  |errupt enable re|
00000830  67 69 73 74 65 72 0d 01  f4 29 4c 44 41 20 70 63  |gister...)LDA pc|
00000840  72 20 5c 20 70 65 72 69  70 68 65 72 61 6c 20 63  |r \ peripheral c|
00000850  6f 6e 74 72 6f 6c 20 72  65 67 69 73 74 65 72 0d  |ontrol register.|
00000860  01 fe 1b 80 20 23 26 30  46 20 5c 20 63 6c 65 61  |.... #&0F \ clea|
00000870  72 20 62 69 74 73 20 34  2d 37 0d 02 08 29 53 54  |r bits 4-7...)ST|
00000880  41 20 70 63 72 20 5c 20  70 65 72 69 70 68 65 72  |A pcr \ peripher|
00000890  61 6c 20 63 6f 6e 74 72  6f 6c 20 72 65 67 69 73  |al control regis|
000008a0  74 65 72 0d 02 12 2d 53  54 58 20 69 72 71 31 76  |ter...-STX irq1v|
000008b0  20 5c 20 72 65 73 74 6f  72 65 20 69 72 71 31 20  | \ restore irq1 |
000008c0  76 65 63 74 6f 72 2c 20  6c 6f 77 20 62 79 74 65  |vector, low byte|
000008d0  0d 02 1c 30 53 54 59 20  69 72 71 31 76 2b 31 20  |...0STY irq1v+1 |
000008e0  5c 20 72 65 73 74 6f 72  65 20 69 72 71 31 20 76  |\ restore irq1 v|
000008f0  65 63 74 6f 72 2c 20 68  69 67 68 20 62 79 74 65  |ector, high byte|
00000900  0d 02 26 26 43 4c 49 20  5c 20 63 6c 65 61 72 20  |..&&CLI \ clear |
00000910  69 6e 74 65 72 72 75 70  74 20 64 69 73 61 62 6c  |interrupt disabl|
00000920  65 20 66 6c 61 67 0d 02  30 33 4c 44 58 20 6f 6c  |e flag..03LDX ol|
00000930  64 62 79 74 65 76 20 5c  20 6f 72 69 67 69 6e 61  |dbytev \ origina|
00000940  6c 20 4f 73 62 79 74 65  20 76 65 63 74 6f 72 2c  |l Osbyte vector,|
00000950  20 6c 6f 77 20 62 79 74  65 0d 02 3a 36 4c 44 59  | low byte..:6LDY|
00000960  20 6f 6c 64 62 79 74 65  76 2b 31 20 5c 20 6f 72  | oldbytev+1 \ or|
00000970  69 67 69 6e 61 6c 20 4f  73 62 79 74 65 20 76 65  |iginal Osbyte ve|
00000980  63 74 6f 72 2c 20 68 69  67 68 20 62 79 74 65 0d  |ctor, high byte.|
00000990  02 44 2f 53 54 58 20 62  79 74 65 76 20 5c 20 72  |.D/STX bytev \ r|
000009a0  65 73 74 6f 72 65 20 4f  73 62 79 74 65 20 76 65  |estore Osbyte ve|
000009b0  63 74 6f 72 2c 20 6c 6f  77 20 62 79 74 65 0d 02  |ctor, low byte..|
000009c0  4e 32 53 54 59 20 62 79  74 65 76 2b 31 20 5c 20  |N2STY bytev+1 \ |
000009d0  72 65 73 74 6f 72 65 20  4f 73 62 79 74 65 20 76  |restore Osbyte v|
000009e0  65 63 74 6f 72 2c 20 68  69 67 68 20 62 79 74 65  |ector, high byte|
000009f0  0d 02 58 19 52 54 53 20  5c 20 72 65 74 75 72 6e  |..X.RTS \ return|
00000a00  20 74 6f 20 42 41 53 49  43 0d 02 62 0e 2e 69 6e  | to BASIC..b..in|
00000a10  74 65 72 72 75 70 74 0d  02 6c 35 4c 44 41 20 73  |terrupt..l5LDA s|
00000a20  61 76 65 72 65 67 20 5c  20 69 6e 74 65 72 72 75  |avereg \ interru|
00000a30  70 74 20 61 63 63 75 6d  75 6c 61 74 6f 72 20 73  |pt accumulator s|
00000a40  61 76 65 20 72 65 67 69  73 74 65 72 0d 02 76 22  |ave register..v"|
00000a50  50 48 41 20 5c 20 61 6e  64 20 70 75 73 68 20 69  |PHA \ and push i|
00000a60  74 20 6f 6e 20 74 68 65  20 73 74 61 63 6b 0d 02  |t on the stack..|
00000a70  80 25 4c 44 41 20 69 66  72 20 5c 20 69 6e 74 65  |.%LDA ifr \ inte|
00000a80  72 72 75 70 74 20 66 6c  61 67 20 72 65 67 69 73  |rrupt flag regis|
00000a90  74 65 72 0d 02 8a 31 42  50 4c 20 6e 6f 74 75 73  |ter...1BPL notus|
00000aa0  65 72 20 5c 20 62 69 74  20 37 20 69 73 20 73 65  |er \ bit 7 is se|
00000ab0  74 20 69 66 20 56 49 41  2d 42 20 69 6e 74 65 72  |t if VIA-B inter|
00000ac0  72 75 70 74 0d 02 94 34  80 20 23 26 31 38 20 5c  |rupt...4. #&18 \|
00000ad0  20 80 20 77 69 74 68 20  25 30 30 30 31 31 30 30  | . with %0001100|
00000ae0  30 2c 20 69 65 2e 20 74  65 73 74 20 62 69 74 73  |0, ie. test bits|
00000af0  20 33 20 61 6e 64 20 34  0d 02 9e 28 42 45 51 20  | 3 and 4...(BEQ |
00000b00  6e 6f 74 75 73 65 72 20  5c 20 65 78 69 74 20 69  |notuser \ exit i|
00000b10  66 20 6e 6f 74 20 43 42  31 20 6f 72 20 43 42 32  |f not CB1 or CB2|
00000b20  0d 02 a8 2b 80 20 23 26  31 30 20 5c 20 80 20 77  |...+. #&10 \ . w|
00000b30  69 74 68 20 25 30 30 30  31 30 30 30 30 2c 20 69  |ith %00010000, i|
00000b40  65 2e 20 74 65 73 74 20  43 42 31 0d 02 b2 36 42  |e. test CB1...6B|
00000b50  4e 45 20 78 70 75 6c 73  65 20 5c 20 62 69 74 20  |NE xpulse \ bit |
00000b60  34 20 73 65 74 20 66 6f  72 20 61 6e 20 58 20 64  |4 set for an X d|
00000b70  69 72 65 63 74 69 6f 6e  20 6d 6f 76 65 6d 65 6e  |irection movemen|
00000b80  74 0d 02 bc 2f 4c 44 41  20 64 72 62 20 5c 20 59  |t.../LDA drb \ Y|
00000b90  20 64 69 72 65 63 74 69  6f 6e 2c 20 6c 6f 61 64  | direction, load|
00000ba0  20 64 61 74 61 20 72 65  67 69 73 74 65 72 20 42  | data register B|
00000bb0  0d 02 c6 2d 80 20 23 26  30 34 20 5c 20 80 20 77  |...-. #&04 \ . w|
00000bc0  69 74 68 20 25 30 30 30  30 30 31 30 30 2c 20 69  |ith %00000100, i|
00000bd0  65 2e 20 74 65 73 74 20  62 69 74 20 32 0d 02 d0  |e. test bit 2...|
00000be0  34 42 4e 45 20 79 64 6f  77 6e 20 5c 20 69 66 20  |4BNE ydown \ if |
00000bf0  62 69 74 20 32 20 69 73  20 73 65 74 20 74 68 65  |bit 2 is set the|
00000c00  6e 20 59 20 69 73 20 67  6f 69 6e 67 20 64 6f 77  |n Y is going dow|
00000c10  6e 0d 02 da 38 49 4e 43  20 79 63 6f 6f 72 64 20  |n...8INC ycoord |
00000c20  5c 20 59 20 69 73 20 67  6f 69 6e 67 20 75 70 20  |\ Y is going up |
00000c30  73 6f 20 69 6e 63 72 65  6d 65 6e 74 20 59 20 63  |so increment Y c|
00000c40  6f 6f 72 64 69 6e 61 74  65 0d 02 e4 2e 42 4e 45  |oordinate....BNE|
00000c50  20 65 78 69 74 20 5c 20  62 72 61 6e 63 68 20 69  | exit \ branch i|
00000c60  66 20 69 6e 20 74 68 65  20 72 61 6e 67 65 20 31  |f in the range 1|
00000c70  20 74 6f 20 32 35 35 0d  02 ee 28 42 45 51 20 64  | to 255...(BEQ d|
00000c80  65 63 79 20 5c 20 69 66  20 7a 65 72 6f 20 74 68  |ecy \ if zero th|
00000c90  65 6e 20 61 6c 74 65 72  20 74 6f 20 32 35 35 0d  |en alter to 255.|
00000ca0  02 f8 0a 2e 79 64 6f 77  6e 0d 03 02 22 4c 44 41  |....ydown..."LDA|
00000cb0  20 79 63 6f 6f 72 64 20  5c 20 6c 6f 61 64 20 59  | ycoord \ load Y|
00000cc0  20 63 6f 6f 72 64 69 6e  61 74 65 0d 03 0c 3b 42  | coordinate...;B|
00000cd0  45 51 20 65 78 69 74 20  5c 20 62 72 61 6e 63 68  |EQ exit \ branch|
00000ce0  20 69 66 20 7a 65 72 6f  20 62 65 63 61 75 73 65  | if zero because|
00000cf0  20 69 74 20 63 61 6e 27  74 20 67 6f 20 61 6e 79  | it can't go any|
00000d00  20 6c 6f 77 65 72 0d 03  16 09 2e 64 65 63 79 0d  | lower.....decy.|
00000d10  03 20 29 44 45 43 20 79  63 6f 6f 72 64 20 5c 20  |. )DEC ycoord \ |
00000d20  72 65 64 75 63 65 20 59  20 63 6f 6f 72 64 69 6e  |reduce Y coordin|
00000d30  61 74 65 20 62 79 20 31  0d 03 2a 42 4a 4d 50 20  |ate by 1..*BJMP |
00000d40  65 78 69 74 20 5c 20 72  65 73 74 6f 72 65 20 69  |exit \ restore i|
00000d50  6e 74 65 72 72 75 70 74  20 61 63 63 75 6d 75 6c  |nterrupt accumul|
00000d60  61 74 6f 72 20 73 61 76  65 20 72 65 67 69 73 74  |ator save regist|
00000d70  65 72 20 61 6e 64 20 52  54 49 0d 03 34 0b 2e 78  |er and RTI..4..x|
00000d80  70 75 6c 73 65 0d 03 3e  22 4c 44 41 20 64 72 62  |pulse..>"LDA drb|
00000d90  20 5c 20 6c 6f 61 64 20  64 61 74 61 20 72 65 67  | \ load data reg|
00000da0  69 73 74 65 72 20 42 0d  03 48 1c 52 4f 52 20 41  |ister B..H.ROR A|
00000db0  20 5c 20 62 69 74 20 30  20 69 6e 74 6f 20 63 61  | \ bit 0 into ca|
00000dc0  72 72 79 0d 03 52 2f 42  43 53 20 78 64 6f 77 6e  |rry..R/BCS xdown|
00000dd0  20 5c 20 58 20 69 73 20  67 6f 69 6e 67 20 64 6f  | \ X is going do|
00000de0  77 6e 20 69 66 20 62 69  74 20 30 20 69 73 20 73  |wn if bit 0 is s|
00000df0  65 74 0d 03 5c 30 49 4e  43 20 78 63 6f 6f 72 64  |et..\0INC xcoord|
00000e00  20 5c 20 58 20 69 73 20  67 6f 69 6e 67 20 75 70  | \ X is going up|
00000e10  20 69 66 20 62 69 74 20  30 20 69 73 20 63 6c 65  | if bit 0 is cle|
00000e20  61 72 0d 03 66 41 42 4e  45 20 65 78 69 74 20 5c  |ar..fABNE exit \|
00000e30  20 65 78 69 74 20 69 66  20 58 20 63 6f 6f 72 64  | exit if X coord|
00000e40  69 6e 61 74 65 20 69 73  20 69 6e 20 74 68 65 20  |inate is in the |
00000e50  72 61 6e 67 65 20 66 72  6f 6d 20 31 20 74 6f 20  |range from 1 to |
00000e60  32 35 35 0d 03 70 33 42  45 51 20 64 65 63 78 20  |255..p3BEQ decx |
00000e70  5c 20 69 66 20 58 20 63  6f 6f 72 64 69 6e 61 74  |\ if X coordinat|
00000e80  65 20 3d 20 30 20 74 68  65 6e 20 6d 61 6b 65 20  |e = 0 then make |
00000e90  69 74 20 32 35 35 0d 03  7a 0a 2e 78 64 6f 77 6e  |it 255..z..xdown|
00000ea0  0d 03 84 22 4c 44 41 20  78 63 6f 6f 72 64 20 5c  |..."LDA xcoord \|
00000eb0  20 6c 6f 61 64 20 58 20  63 6f 6f 72 64 69 6e 61  | load X coordina|
00000ec0  74 65 0d 03 8e 32 42 45  51 20 65 78 69 74 20 5c  |te...2BEQ exit \|
00000ed0  20 69 66 20 69 74 20 69  73 20 7a 65 72 6f 20 69  | if it is zero i|
00000ee0  74 20 63 61 6e 27 74 20  67 6f 20 61 6e 79 20 6c  |t can't go any l|
00000ef0  6f 77 65 72 0d 03 98 09  2e 64 65 63 78 0d 03 a2  |ower.....decx...|
00000f00  2b 44 45 43 20 78 63 6f  6f 72 64 20 5c 20 64 65  |+DEC xcoord \ de|
00000f10  63 72 65 61 73 65 20 58  20 63 6f 6f 72 64 69 6e  |crease X coordin|
00000f20  61 74 65 20 62 79 20 31  0d 03 ac 09 2e 65 78 69  |ate by 1.....exi|
00000f30  74 0d 03 b6 40 50 4c 41  20 5c 20 70 75 6c 6c 20  |t...@PLA \ pull |
00000f40  69 6e 74 65 72 72 75 70  74 20 61 63 63 75 6d 75  |interrupt accumu|
00000f50  6c 61 74 6f 72 20 73 61  76 65 20 72 65 67 69 73  |lator save regis|
00000f60  74 65 72 20 6f 66 66 20  74 68 65 20 73 74 61 63  |ter off the stac|
00000f70  6b 0d 03 c0 27 53 54 41  20 73 61 76 65 72 65 67  |k...'STA savereg|
00000f80  20 5c 20 61 6e 64 20 72  65 73 74 6f 72 65 20 7a  | \ and restore z|
00000f90  65 72 6f 20 70 61 67 65  0d 03 ca 1f 52 54 49 20  |ero page....RTI |
00000fa0  5c 20 72 65 74 75 72 6e  20 66 72 6f 6d 20 69 6e  |\ return from in|
00000fb0  74 65 72 72 75 70 74 0d  03 d4 0c 2e 6e 6f 74 75  |terrupt.....notu|
00000fc0  73 65 72 0d 03 de 44 50  4c 41 20 5c 20 70 75 6c  |ser...DPLA \ pul|
00000fd0  6c 20 74 68 65 20 69 6e  74 65 72 72 75 70 74 20  |l the interrupt |
00000fe0  61 63 63 75 6d 75 6c 61  74 6f 72 20 73 61 76 65  |accumulator save|
00000ff0  20 72 65 67 69 73 74 65  72 20 6f 66 66 20 74 68  | register off th|
00001000  65 20 73 74 61 63 6b 0d  03 e8 2f 53 54 41 20 73  |e stack.../STA s|
00001010  61 76 65 72 65 67 20 5c  20 72 65 73 74 6f 72 65  |avereg \ restore|
00001020  20 74 68 65 20 7a 65 72  6f 20 70 61 67 65 20 61  | the zero page a|
00001030  64 64 72 65 73 73 0d 03  f2 31 4a 4d 50 20 28 6f  |ddress...1JMP (o|
00001040  6c 64 69 72 71 31 76 29  20 5c 20 65 78 69 74 20  |ldirq1v) \ exit |
00001050  76 69 61 20 74 68 65 20  6f 72 69 67 69 6e 61 6c  |via the original|
00001060  20 76 65 63 74 6f 72 0d  03 fc 0c 2e 6e 65 77 73  | vector.....news|
00001070  63 61 6e 0d 04 06 1e 50  48 50 20 5c 20 70 75 73  |can....PHP \ pus|
00001080  68 20 73 74 61 74 75 73  20 72 65 67 69 73 74 65  |h status registe|
00001090  72 0d 04 10 22 43 4d 50  20 23 26 37 39 20 5c 20  |r..."CMP #&79 \ |
000010a0  69 73 20 74 68 69 73 20  4f 73 62 79 74 65 20 26  |is this Osbyte &|
000010b0  37 39 3f 0d 04 1a 3b 42  45 51 20 73 63 61 6e 20  |79?...;BEQ scan |
000010c0  5c 20 69 66 20 69 74 20  69 73 20 62 72 61 6e 63  |\ if it is branc|
000010d0  68 20 74 6f 20 6e 65 77  20 6b 65 79 62 6f 61 72  |h to new keyboar|
000010e0  64 20 73 63 61 6e 20 72  6f 75 74 69 6e 65 0d 04  |d scan routine..|
000010f0  24 22 43 4d 50 20 23 26  37 41 20 5c 20 69 73 20  |$"CMP #&7A \ is |
00001100  74 68 69 73 20 4f 73 62  79 74 65 20 26 37 41 3f  |this Osbyte &7A?|
00001110  0d 04 2e 23 42 45 51 20  73 63 61 6e 20 5c 20 62  |...#BEQ scan \ b|
00001120  72 61 6e 63 68 20 69 66  20 4f 73 62 79 74 65 20  |ranch if Osbyte |
00001130  26 37 41 0d 04 38 0c 2e  6e 6f 74 73 63 61 6e 0d  |&7A..8..notscan.|
00001140  04 42 35 50 4c 50 20 5c  20 72 65 73 74 6f 72 65  |.B5PLP \ restore|
00001150  20 73 74 61 74 75 73 20  72 65 67 69 73 74 65 72  | status register|
00001160  20 61 6e 64 20 72 65 74  75 72 6e 20 74 6f 20 42  | and return to B|
00001170  41 53 49 43 0d 04 4c 0c  2e 6f 6c 64 63 6f 64 65  |ASIC..L..oldcode|
00001180  0d 04 56 34 4a 4d 50 20  28 6f 6c 64 62 79 74 65  |..V4JMP (oldbyte|
00001190  76 29 20 5c 20 65 78 69  74 20 76 69 61 20 6f 72  |v) \ exit via or|
000011a0  69 67 69 6e 61 6c 20 4f  73 62 79 74 65 20 76 65  |iginal Osbyte ve|
000011b0  63 74 6f 72 0d 04 60 09  2e 73 63 61 6e 0d 04 6a  |ctor..`..scan..j|
000011c0  32 50 48 41 20 5c 20 70  75 73 68 20 74 68 65 20  |2PHA \ push the |
000011d0  4f 73 62 79 74 65 20 63  6f 64 65 20 28 65 69 74  |Osbyte code (eit|
000011e0  68 65 72 20 26 37 39 20  6f 72 20 26 37 41 29 0d  |her &79 or &7A).|
000011f0  04 74 32 4a 53 52 20 6f  6c 64 63 6f 64 65 20 5c  |.t2JSR oldcode \|
00001200  20 70 65 72 66 6f 72 6d  20 74 68 65 20 6f 72 69  | perform the ori|
00001210  67 69 6e 61 6c 20 4f 73  62 79 74 65 20 63 61 6c  |ginal Osbyte cal|
00001220  6c 0d 04 7e 26 43 50 58  20 23 26 46 46 20 5c 20  |l..~&CPX #&FF \ |
00001230  6b 65 79 20 70 72 65 73  73 65 64 20 69 66 20 58  |key pressed if X|
00001240  20 3c 3e 20 26 46 46 0d  04 88 2e 42 45 51 20 6e  | <> &FF....BEQ n|
00001250  6f 74 70 72 65 73 73 65  64 20 5c 20 62 72 61 6e  |otpressed \ bran|
00001260  63 68 20 69 66 20 6b 65  79 20 6e 6f 74 20 70 72  |ch if key not pr|
00001270  65 73 73 65 64 0d 04 92  0c 2e 70 75 6c 6c 6f 75  |essed.....pullou|
00001280  74 0d 04 9c 2e 50 4c 41  20 5c 20 70 75 6c 6c 20  |t....PLA \ pull |
00001290  4f 73 62 79 74 65 20 63  6f 64 65 20 28 65 69 74  |Osbyte code (eit|
000012a0  68 65 72 20 26 37 39 20  6f 72 20 26 37 41 29 0d  |her &79 or &7A).|
000012b0  04 a6 22 50 4c 50 20 5c  20 70 75 6c 6c 20 74 68  |.."PLP \ pull th|
000012c0  65 20 73 74 61 74 75 73  20 72 65 67 69 73 74 65  |e status registe|
000012d0  72 0d 04 b0 1d 52 54 53  20 5c 20 61 6e 64 20 72  |r....RTS \ and r|
000012e0  65 74 75 72 6e 20 74 6f  20 42 41 53 49 43 0d 04  |eturn to BASIC..|
000012f0  ba 0f 2e 6e 6f 74 70 72  65 73 73 65 64 0d 04 c4  |...notpressed...|
00001300  22 4c 44 41 20 64 72 62  20 5c 20 6c 6f 61 64 20  |"LDA drb \ load |
00001310  64 61 74 61 20 72 65 67  69 73 74 65 72 20 42 0d  |data register B.|
00001320  04 ce 2a 52 4f 4c 20 41  20 5c 20 62 69 74 20 37  |..*ROL A \ bit 7|
00001330  20 6f 66 20 72 65 67 69  73 74 65 72 20 42 20 69  | of register B i|
00001340  6e 74 6f 20 63 61 72 72  79 0d 04 d8 38 42 43 43  |nto carry...8BCC|
00001350  20 72 69 67 68 74 70 72  65 73 73 20 5c 20 63 61  | rightpress \ ca|
00001360  72 72 79 20 63 6c 65 61  72 20 69 66 20 72 69 67  |rry clear if rig|
00001370  68 74 20 62 75 74 74 6f  6e 20 70 72 65 73 73 65  |ht button presse|
00001380  64 0d 04 e2 1c 52 4f 4c  20 41 20 5c 20 62 69 74  |d....ROL A \ bit|
00001390  20 36 20 69 6e 74 6f 20  63 61 72 72 79 0d 04 ec  | 6 into carry...|
000013a0  3a 42 43 43 20 63 65 6e  74 72 65 70 72 65 73 73  |:BCC centrepress|
000013b0  20 5c 20 62 69 74 20 36  20 63 6c 65 61 72 20 69  | \ bit 6 clear i|
000013c0  66 20 63 65 6e 74 72 65  20 62 75 74 74 6f 6e 20  |f centre button |
000013d0  70 72 65 73 73 65 64 0d  04 f6 1c 52 4f 4c 20 41  |pressed....ROL A|
000013e0  20 5c 20 62 69 74 20 35  20 69 6e 74 6f 20 63 61  | \ bit 5 into ca|
000013f0  72 72 79 0d 05 00 36 42  43 43 20 6c 65 66 74 70  |rry...6BCC leftp|
00001400  72 65 73 73 20 5c 20 62  69 74 20 35 20 63 6c 65  |ress \ bit 5 cle|
00001410  61 72 20 69 66 20 6c 65  66 74 20 62 75 74 74 6f  |ar if left butto|
00001420  6e 20 70 72 65 73 73 65  64 0d 05 0a 31 4c 44 41  |n pressed...1LDA|
00001430  20 78 63 6f 6f 72 64 20  5c 20 58 20 63 6f 6f 72  | xcoord \ X coor|
00001440  64 69 6e 61 74 65 20 66  72 6f 6d 20 6d 6f 75 73  |dinate from mous|
00001450  65 20 6d 6f 76 65 6d 65  6e 74 0d 05 14 29 43 4d  |e movement...)CM|
00001460  50 20 23 26 38 38 20 5c  20 69 73 20 74 68 65 20  |P #&88 \ is the |
00001470  58 20 63 6f 6f 72 64 69  6e 61 74 65 20 3e 20 26  |X coordinate > &|
00001480  38 37 3f 0d 05 1e 3a 42  43 53 20 72 69 67 68 74  |87?...:BCS right|
00001490  61 72 72 6f 77 20 5c 20  62 72 61 6e 63 68 20 69  |arrow \ branch i|
000014a0  66 20 58 20 63 6f 6f 72  64 69 6e 61 74 65 20 69  |f X coordinate i|
000014b0  73 20 68 69 67 68 20 65  6e 6f 75 67 68 0d 05 28  |s high enough..(|
000014c0  29 43 4d 50 20 23 26 37  38 20 5c 20 69 73 20 74  |)CMP #&78 \ is t|
000014d0  68 65 20 58 20 63 6f 6f  72 64 69 6e 61 74 65 20  |he X coordinate |
000014e0  3c 20 26 37 38 3f 0d 05  32 38 42 43 43 20 6c 65  |< &78?..28BCC le|
000014f0  66 74 61 72 72 6f 77 20  5c 20 62 72 61 6e 63 68  |ftarrow \ branch|
00001500  20 69 66 20 59 20 63 6f  6f 72 64 69 6e 61 74 65  | if Y coordinate|
00001510  20 69 73 20 6c 6f 77 20  65 6e 6f 75 67 68 0d 05  | is low enough..|
00001520  3c 31 4c 44 41 20 79 63  6f 6f 72 64 20 5c 20 59  |<1LDA ycoord \ Y|
00001530  20 63 6f 6f 72 64 69 6e  61 74 65 20 66 72 6f 6d  | coordinate from|
00001540  20 6d 6f 75 73 65 20 6d  6f 76 65 6d 65 6e 74 0d  | mouse movement.|
00001550  05 46 29 43 4d 50 20 23  26 38 38 20 5c 20 69 73  |.F)CMP #&88 \ is|
00001560  20 74 68 65 20 59 20 63  6f 6f 72 64 69 6e 61 74  | the Y coordinat|
00001570  65 20 3e 20 26 38 37 3f  0d 05 50 37 42 43 53 20  |e > &87?..P7BCS |
00001580  75 70 61 72 72 6f 77 20  5c 20 62 72 61 6e 63 68  |uparrow \ branch|
00001590  20 69 66 20 59 20 63 6f  6f 72 64 69 6e 61 74 65  | if Y coordinate|
000015a0  20 69 73 20 68 69 67 68  20 65 6e 6f 75 67 68 0d  | is high enough.|
000015b0  05 5a 29 43 4d 50 20 23  26 37 38 20 5c 20 69 73  |.Z)CMP #&78 \ is|
000015c0  20 74 68 65 20 59 20 63  6f 6f 72 64 69 6e 61 74  | the Y coordinat|
000015d0  65 20 3c 20 26 37 38 3f  0d 05 64 2e 42 43 53 20  |e < &78?..d.BCS |
000015e0  70 75 6c 6c 6f 75 74 20  5c 20 72 65 74 75 72 6e  |pullout \ return|
000015f0  20 74 6f 20 42 41 53 49  43 20 69 66 20 69 74 20  | to BASIC if it |
00001600  69 73 20 6e 6f 74 0d 05  6e 36 4c 44 58 20 64 6f  |is not..n6LDX do|
00001610  77 6e 20 5c 20 73 69 6d  75 6c 61 74 65 20 61 20  |wn \ simulate a |
00001620  70 72 65 73 73 20 6f 6e  20 74 68 65 20 63 75 72  |press on the cur|
00001630  73 6f 72 20 64 6f 77 6e  20 6b 65 79 0d 05 78 3b  |sor down key..x;|
00001640  42 4e 45 20 72 65 73 65  74 79 20 5c 20 75 6e 63  |BNE resety \ unc|
00001650  6f 6e 64 69 74 69 6f 6e  61 6c 20 62 72 61 6e 63  |onditional branc|
00001660  68 20 74 6f 20 72 65 73  65 74 20 59 20 63 6f 6f  |h to reset Y coo|
00001670  72 64 69 6e 61 74 65 0d  05 82 0c 2e 75 70 61 72  |rdinate.....upar|
00001680  72 6f 77 0d 05 8c 32 4c  44 58 20 75 70 20 5c 20  |row...2LDX up \ |
00001690  73 69 6d 75 6c 61 74 65  20 61 20 70 72 65 73 73  |simulate a press|
000016a0  20 6f 6e 20 74 68 65 20  63 75 72 73 6f 72 20 75  | on the cursor u|
000016b0  70 20 6b 65 79 0d 05 96  0b 2e 72 65 73 65 74 79  |p key.....resety|
000016c0  0d 05 a0 2c 4c 44 41 20  23 26 38 30 20 5c 20 72  |...,LDA #&80 \ r|
000016d0  65 73 65 74 20 74 68 65  20 59 20 63 6f 6f 72 64  |eset the Y coord|
000016e0  69 6e 61 74 65 20 74 6f  20 26 38 30 0d 05 aa 0e  |inate to &80....|
000016f0  53 54 41 20 79 63 6f 6f  72 64 0d 05 b4 39 42 4e  |STA ycoord...9BN|
00001700  45 20 70 75 6c 6c 6f 75  74 20 5c 20 75 6e 63 6f  |E pullout \ unco|
00001710  6e 64 69 74 69 6f 6e 61  6c 20 62 72 61 6e 63 68  |nditional branch|
00001720  20 74 6f 20 72 65 74 75  72 6e 20 74 6f 20 42 41  | to return to BA|
00001730  53 49 43 0d 05 be 0f 2e  72 69 67 68 74 61 72 72  |SIC.....rightarr|
00001740  6f 77 0d 05 c8 38 4c 44  58 20 72 69 67 68 74 20  |ow...8LDX right |
00001750  5c 20 73 69 6d 75 6c 61  74 65 20 61 20 70 72 65  |\ simulate a pre|
00001760  73 73 20 6f 6e 20 74 68  65 20 63 75 72 73 6f 72  |ss on the cursor|
00001770  20 72 69 67 68 74 20 6b  65 79 0d 05 d2 3b 42 4e  | right key...;BN|
00001780  45 20 72 65 73 65 74 78  20 5c 20 75 6e 63 6f 6e  |E resetx \ uncon|
00001790  64 69 74 69 6f 6e 61 6c  20 62 72 61 6e 63 68 20  |ditional branch |
000017a0  74 6f 20 72 65 73 65 74  20 58 20 63 6f 6f 72 64  |to reset X coord|
000017b0  69 6e 61 74 65 0d 05 dc  0e 2e 6c 65 66 74 61 72  |inate.....leftar|
000017c0  72 6f 77 0d 05 e6 36 4c  44 58 20 6c 65 66 74 20  |row...6LDX left |
000017d0  5c 20 73 69 6d 75 6c 61  74 65 20 61 20 70 72 65  |\ simulate a pre|
000017e0  73 73 20 6f 6e 20 74 68  65 20 63 75 72 73 6f 72  |ss on the cursor|
000017f0  20 6c 65 66 74 20 6b 65  79 0d 05 f0 0b 2e 72 65  | left key.....re|
00001800  73 65 74 78 0d 05 fa 28  4c 44 41 20 23 26 38 30  |setx...(LDA #&80|
00001810  20 5c 20 72 65 73 65 74  20 59 20 63 6f 6f 72 64  | \ reset Y coord|
00001820  69 6e 61 74 65 20 74 6f  20 26 38 30 0d 06 04 0e  |inate to &80....|
00001830  53 54 41 20 78 63 6f 6f  72 64 0d 06 0e 39 42 4e  |STA xcoord...9BN|
00001840  45 20 70 75 6c 6c 6f 75  74 20 5c 20 75 6e 63 6f  |E pullout \ unco|
00001850  6e 64 69 74 69 6f 6e 61  6c 20 62 72 61 6e 63 68  |nditional branch|
00001860  20 74 6f 20 72 65 74 75  72 6e 20 74 6f 20 42 41  | to return to BA|
00001870  53 49 43 0d 06 18 0e 2e  6c 65 66 74 70 72 65 73  |SIC.....leftpres|
00001880  73 0d 06 22 40 4c 44 58  20 6c 65 66 74 62 75 74  |s.."@LDX leftbut|
00001890  74 6f 6e 20 5c 20 73 69  6d 75 6c 61 74 65 20 61  |ton \ simulate a|
000018a0  20 6b 65 79 20 70 72 65  73 73 20 66 72 6f 6d 20  | key press from |
000018b0  6c 65 66 74 20 6d 6f 75  73 65 20 62 75 74 74 6f  |left mouse butto|
000018c0  6e 0d 06 2c 39 42 4e 45  20 70 75 6c 6c 6f 75 74  |n..,9BNE pullout|
000018d0  20 5c 20 75 6e 63 6f 6e  64 69 74 69 6f 6e 61 6c  | \ unconditional|
000018e0  20 62 72 61 6e 63 68 20  74 6f 20 72 65 74 75 72  | branch to retur|
000018f0  6e 20 74 6f 20 42 41 53  49 43 0d 06 36 0f 2e 72  |n to BASIC..6..r|
00001900  69 67 68 74 70 72 65 73  73 0d 06 40 42 4c 44 58  |ightpress..@BLDX|
00001910  20 72 69 67 68 74 62 75  74 74 6f 6e 20 5c 20 73  | rightbutton \ s|
00001920  69 6d 75 6c 61 74 65 20  61 20 6b 65 79 20 70 72  |imulate a key pr|
00001930  65 73 73 20 66 72 6f 6d  20 72 69 67 68 74 20 6d  |ess from right m|
00001940  6f 75 73 65 20 62 75 74  74 6f 6e 0d 06 4a 39 42  |ouse button..J9B|
00001950  4e 45 20 70 75 6c 6c 6f  75 74 20 5c 20 75 6e 63  |NE pullout \ unc|
00001960  6f 6e 64 69 74 69 6f 6e  61 6c 20 62 72 61 6e 63  |onditional branc|
00001970  68 20 74 6f 20 72 65 74  75 72 6e 20 74 6f 20 42  |h to return to B|
00001980  41 53 49 43 0d 06 54 10  2e 63 65 6e 74 72 65 70  |ASIC..T..centrep|
00001990  72 65 73 73 0d 06 5e 44  4c 44 58 20 63 65 6e 74  |ress..^DLDX cent|
000019a0  72 65 62 75 74 74 6f 6e  20 5c 20 73 69 6d 75 6c  |rebutton \ simul|
000019b0  61 74 65 20 61 20 6b 65  79 20 70 72 65 73 73 20  |ate a key press |
000019c0  66 72 6f 6d 20 63 65 6e  74 72 65 20 6d 6f 75 73  |from centre mous|
000019d0  65 20 62 75 74 74 6f 6e  0d 06 68 39 42 4e 45 20  |e button..h9BNE |
000019e0  70 75 6c 6c 6f 75 74 20  5c 20 75 6e 63 6f 6e 64  |pullout \ uncond|
000019f0  69 74 69 6f 6e 61 6c 20  62 72 61 6e 63 68 20 74  |itional branch t|
00001a00  6f 20 72 65 74 75 72 6e  20 74 6f 20 42 41 53 49  |o return to BASI|
00001a10  43 0d 06 72 10 2e 72 69  67 68 74 62 75 74 74 6f  |C..r..rightbutto|
00001a20  6e 0d 06 7c 29 45 51 55  42 20 26 35 39 20 5c 20  |n..|)EQUB &59 \ |
00001a30  64 65 6c 65 74 65 20 69  6e 74 65 72 6e 61 6c 20  |delete internal |
00001a40  6b 65 79 20 6e 75 6d 62  65 72 0d 06 86 11 2e 63  |key number.....c|
00001a50  65 6e 74 72 65 62 75 74  74 6f 6e 0d 06 90 29 45  |entrebutton...)E|
00001a60  51 55 42 20 26 34 39 20  5c 20 72 65 74 75 72 6e  |QUB &49 \ return|
00001a70  20 69 6e 74 65 72 6e 61  6c 20 6b 65 79 20 6e 75  | internal key nu|
00001a80  6d 62 65 72 0d 06 9a 0f  2e 6c 65 66 74 62 75 74  |mber.....leftbut|
00001a90  74 6f 6e 0d 06 a4 27 45  51 55 42 20 26 36 39 20  |ton...'EQUB &69 |
00001aa0  5c 20 63 6f 70 79 20 69  6e 74 65 72 6e 61 6c 20  |\ copy internal |
00001ab0  6b 65 79 20 6e 75 6d 62  65 72 0d 06 ae 07 2e 75  |key number.....u|
00001ac0  70 0d 06 b8 2c 45 51 55  42 20 26 33 39 20 5c 20  |p...,EQUB &39 \ |
00001ad0  63 75 72 73 6f 72 20 75  70 20 69 6e 74 65 72 6e  |cursor up intern|
00001ae0  61 6c 20 6b 65 79 20 6e  75 6d 62 65 72 0d 06 c2  |al key number...|
00001af0  09 2e 64 6f 77 6e 0d 06  cc 2e 45 51 55 42 20 26  |..down....EQUB &|
00001b00  32 39 20 5c 20 63 75 72  73 6f 72 20 64 6f 77 6e  |29 \ cursor down|
00001b10  20 69 6e 74 65 72 6e 61  6c 20 6b 65 79 20 6e 75  | internal key nu|
00001b20  6d 62 65 72 0d 06 d6 09  2e 6c 65 66 74 0d 06 e0  |mber.....left...|
00001b30  2e 45 51 55 42 20 26 31  39 20 5c 20 63 75 72 73  |.EQUB &19 \ curs|
00001b40  6f 72 20 6c 65 66 74 20  69 6e 74 65 72 6e 61 6c  |or left internal|
00001b50  20 6b 65 79 20 6e 75 6d  62 65 72 0d 06 ea 0a 2e  | key number.....|
00001b60  72 69 67 68 74 0d 06 f4  2f 45 51 55 42 20 26 37  |right.../EQUB &7|
00001b70  39 20 5c 20 63 75 72 73  6f 72 20 72 69 67 68 74  |9 \ cursor right|
00001b80  20 69 6e 74 65 72 6e 61  6c 20 6b 65 79 20 6e 75  | internal key nu|
00001b90  6d 62 65 72 0d 06 fe 0d  2e 6f 6c 64 69 72 71 31  |mber.....oldirq1|
00001ba0  76 0d 07 08 23 45 51 55  57 20 26 30 30 20 5c 20  |v...#EQUW &00 \ |
00001bb0  6f 72 69 67 69 6e 61 6c  20 69 72 71 31 20 76 65  |original irq1 ve|
00001bc0  63 74 6f 72 0d 07 12 0d  2e 6f 6c 64 62 79 74 65  |ctor.....oldbyte|
00001bd0  76 0d 07 1c 31 45 51 55  57 20 26 30 30 20 5c 20  |v...1EQUW &00 \ |
00001be0  6f 72 69 67 69 6e 61 6c  20 4f 73 62 79 74 65 20  |original Osbyte |
00001bf0  69 6e 64 69 72 65 63 74  69 6f 6e 20 76 65 63 74  |indirection vect|
00001c00  6f 72 0d 07 26 0b 2e 78  63 6f 6f 72 64 0d 07 30  |or..&..xcoord..0|
00001c10  27 45 51 55 42 20 26 38  30 20 5c 20 6d 6f 75 73  |'EQUB &80 \ mous|
00001c20  65 20 58 20 63 6f 6f 72  64 69 6e 61 74 65 20 30  |e X coordinate 0|
00001c30  2d 32 35 35 0d 07 3a 0b  2e 79 63 6f 6f 72 64 0d  |-255..:..ycoord.|
00001c40  07 44 27 45 51 55 42 20  26 38 30 20 5c 20 6d 6f  |.D'EQUB &80 \ mo|
00001c50  75 73 65 20 59 20 63 6f  6f 72 64 69 6e 61 74 65  |use Y coordinate|
00001c60  20 30 2d 32 35 35 0d 07  4e 0d 2e 6c 61 73 74 62  | 0-255..N..lastb|
00001c70  79 74 65 0d 07 58 05 5d  0d 07 62 05 ed 0d 07 6c  |yte..X.]..b....l|
00001c80  1f d6 20 6d 63 6f 64 65  20 3a f4 3a 20 65 6e 61  |.. mcode :.: ena|
00001c90  62 6c 65 20 6e 65 77 20  63 6f 64 65 0d 07 76 06  |ble new code..v.|
00001ca0  eb 37 0d 07 80 48 6d 6f  75 73 65 24 3d bd 31 34  |.7...Hmouse$=.14|
00001cb0  31 2b bd 31 33 32 2b bd  31 35 37 2b bd 31 33 31  |1+.132+.157+.131|
00001cc0  2b 22 50 72 65 73 73 20  6b 65 79 62 6f 61 72 64  |+"Press keyboard|
00001cd0  20 6f 72 20 6d 6f 76 65  20 74 68 65 20 6d 6f 75  | or move the mou|
00001ce0  73 65 20 20 22 2b bd 31  35 36 0d 07 8a 10 f1 8a  |se  "+.156......|
00001cf0  30 2c 31 29 6d 6f 75 73  65 24 0d 07 94 10 f1 8a  |0,1)mouse$......|
00001d00  30 2c 32 29 6d 6f 75 73  65 24 0d 07 9e 2d f1 8a  |0,2)mouse$...-..|
00001d10  31 30 2c 36 29 22 42 79  74 65 73 20 75 73 65 64  |10,6)"Bytes used|
00001d20  20 3d 20 26 22 3b 7e 28  6c 61 73 74 62 79 74 65  | = &";~(lastbyte|
00001d30  2d 6d 63 6f 64 65 29 0d  07 a8 0e ee 20 85 20 e5  |-mcode)..... . .|
00001d40  20 8d 54 74 48 0d 07 b2  12 ef 32 33 2c 31 2c 30  | .TtH.....23,1,0|
00001d50  3b 30 3b 30 3b 30 3b 0d  07 bc 05 f5 0d 07 c6 1c  |;0;0;0;.........|
00001d60  f1 8a 31 30 2c 31 30 29  22 58 20 3d 20 26 22 3b  |..10,10)"X = &";|
00001d70  7e 3f 48 25 3b 22 20 22  0d 07 d0 1c f1 8a 32 30  |~?H%;" "......20|
00001d80  2c 31 30 29 22 59 20 3d  20 26 22 3b 7e 3f 56 25  |,10)"Y = &";~?V%|
00001d90  3b 22 20 22 0d 07 da 0a  41 25 3d 26 37 39 0d 07  |;" "....A%=&79..|
00001da0  e4 09 58 25 3d 31 36 0d  07 ee 24 61 6e 73 77 65  |..X%=16...$answe|
00001db0  72 3d 28 ba 28 6f 73 62  79 74 65 29 20 80 20 26  |r=(.(osbyte) . &|
00001dc0  46 46 30 30 29 81 20 26  31 30 30 0d 07 f8 2a f1  |FF00). &100...*.|
00001dd0  8a 39 2c 31 35 29 22 4f  73 62 79 74 65 20 26 37  |.9,15)"Osbyte &7|
00001de0  39 2c 20 58 20 3d 20 26  22 3b 7e 61 6e 73 77 65  |9, X = &";~answe|
00001df0  72 3b 22 20 22 0d 08 02  0a 41 25 3d 26 37 41 0d  |r;" "....A%=&7A.|
00001e00  08 0c 08 58 25 3d 30 0d  08 16 24 61 6e 73 77 65  |...X%=0...$answe|
00001e10  72 3d 28 ba 28 6f 73 62  79 74 65 29 20 80 20 26  |r=(.(osbyte) . &|
00001e20  46 46 30 30 29 81 20 26  31 30 30 0d 08 20 2a f1  |FF00). &100.. *.|
00001e30  8a 39 2c 32 30 29 22 4f  73 62 79 74 65 20 26 37  |.9,20)"Osbyte &7|
00001e40  41 2c 20 58 20 3d 20 26  22 3b 7e 61 6e 73 77 65  |A, X = &";~answe|
00001e50  72 3b 22 20 22 0d 08 2a  07 fd 20 a3 0d 08 34 20  |r;" "..*.. ...4 |
00001e60  d6 20 6d 63 6f 64 65 20  3a f4 3a 20 64 69 73 61  |. mcode :.: disa|
00001e70  62 6c 65 20 6e 65 77 20  63 6f 64 65 0d 08 3e 19  |ble new code..>.|
00001e80  ef 32 33 2c 31 2c 31 3b  30 3b 30 3b 30 3b 33 31  |.23,1,1;0;0;0;31|
00001e90  2c 30 2c 32 33 0d 08 48  05 e0 0d ff              |,0,23..H....|
00001e9c
16-12-88/NEWSCAN.m0
16-12-88/NEWSCAN.m1
16-12-88/NEWSCAN.m2
16-12-88/NEWSCAN.m4
16-12-88/NEWSCAN.m5