Home » CEEFAX disks » telesoftware12.adl » 27-01-89/IOinter

27-01-89/IOinter

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 » telesoftware12.adl
Filename: 27-01-89/IOinter
Read OK:
File size: 1651 bytes
Load address: 0800
Exec address: 802B
File contents
   10REM> IOINTER
   20A%=&EA
   30X%=0
   40Y%=&FF
   50IF ((USR(&FFF4)AND&FF00)DIV&100)<>0 END
   60mcode=&A00
   70xcoord=&70
   80ycoord=&71
   90!xcoord=0
  100PROCmcode
  110ONERROR CALL mcode:VDU23,1,1;0;0;0;:END
  120mode=4
  130paper=6
  140ink=4
  150MODE mode
  160PROCnewmode
  170REPEAT
  180IF INKEY(-58) PROCup:MODE mode:PROCnewmode
  190IF INKEY(-42) PROCdown:MODE mode:PROCnewmode
  200IF INKEY(-56) PROCpaper
  210IF INKEY(-38) PROCink
  220IF INKEY(-26) PROCleft
  230IF INKEY(-122) PROCright
  240PRINTTAB(13,2);?xcoord;" "TAB(13,3);?ycoord;" "
  250IF FNswitch VDU31,?xcoord,?ycoord,42
  260UNTIL FALSE
  270:
  280DEFPROCup
  290mode=mode+1
  300IF mode>7 mode=7
  310ENDPROC
  320:
  330DEFPROCdown
  340mode=mode-1
  350IF mode<0 mode=0
  360ENDPROC
  370:
  380DEFPROCleft
  390IF offsetlow?mode=12 ENDPROC
  400offsetlow?mode=offsetlow?mode+1
  410PROCdelay
  420ENDPROC
  430:
  440DEFPROCright
  450IF offsetlow?mode=0 ENDPROC
  460offsetlow?mode=offsetlow?mode-1
  470PROCdelay
  480ENDPROC
  490:
  500DEFPROCnewmode
  510VDU23,1,0;0;0;0;
  520IF mode=7 PROCseven:ENDPROC
  530VDU19,0,paper;0;
  540VDU19,1,ink;0;
  550COLOUR1
  560PROCdelay
  570ENDPROC
  580:
  590DEFPROCdelay
  600PRINTTAB(3,1)"Mode ";mode
  610PRINTTAB(3,2)"X coord = ";?xcoord
  620PRINTTAB(3,3)"Y coord = ";?ycoord
  630PRINTTAB(3,4)"offsetlow = ";offsetlow?mode
  640time=TIME+20
  650REPEAT UNTIL time<TIME
  660ENDPROC
  670:
  680DEFPROCink
  690ink=ink+1
  700IF ink=paper ink=ink+1
  710IF ink>7 ink=0
  720VDU19,1,ink;0;
  730IF mode=7 PROCseven
  740PROCdelay
  750ENDPROC
  760:
  770DEFPROCpaper
  780paper=paper+1
  790IF paper=ink paper=paper+1
  800IF paper>7 paper=1
  810VDU19,0,paper;0;
  820IF mode=7 PROCseven
  830PROCdelay
  840ENDPROC
  850:
  860DEFPROCseven
  870IF ink=0 ink=1
  880FOR line=0 TO 24
  890IF paper=0 VDU31,0,line,128+ink,32,32 ELSE VDU31,0,line,128+paper,157,128+ink
  900NEXT
  910PROCdelay
  920ENDPROC
  930:
  940DEFPROCmcode
  950fire=&72 :REM: fire button status
  960irq2v=&206 :REM: secondary interrupt vector
  970screen=&355 :REM: screen mode OS 1.2
  980sheila=&FE00
  990drb=&FE40 :REM: system 6522 input/output register B
 1000ifr=&FE4D :REM: system 6522 interrupt flag register
 1010ier=&FE4E :REM: system 6522 interrupt enable register
 1020osword=&FFF1
 1030osbyte=&FFF4
 1040FOR pass=0 TO 2 STEP 2
 1050P%=mcode
 1060[OPT pass
 1070LDX irq2v \ secondary interrupt vector, low byte
 1080LDY irq2v+1 \ secondary interrupt vector, high byte
 1090CPY #interrupt DIV 256 \ has the high byte been altered?
 1100BEQ disable \ restore original vector if altered
 1110STX oldirq2v \ store original vector, low byte
 1120STY oldirq2v+1 \ store original vector, high byte
 1130LDX #interrupt MOD 256 \ new interrupt code, low byte
 1140LDY #interrupt DIV 256 \ new interrupt code, high byte
 1150SEI \ set interrupt disable flag
 1160STX irq2v \ alter vector, low byte
 1170STY irq2v+1 \ alter vector, high byte
 1180CLI \ clear interrupt disable flag
 1190LDA #&88 \ %10001000
 1200STA ier \ enable light pen interrupts
 1210\LDA #&E9 \ write system VIA IRQ bit mask
 1220\LDX #&F7 \ %11110111
 1230\LDY #&00
 1240\JSR osbyte \ bit mask = %11110111
 1250RTS
 1260.disable
 1270LDA #&08 \ %00001000 ready to disable light pen interrupts
 1280LDX oldirq2v \ original irq2 vector, low byte
 1290LDY oldirq2v+1 \ original irq2 vector, high byte
 1300SEI \ set interrupt disable flag
 1310STA ier \ disable light pen interrupt
 1320STX irq2v \ restore original vector, low byte
 1330STY irq2v+1 \ restore original vector, high byte
 1340CLI \ clear interrupt disable flag
 1350\LDA #&E9 \ write system VIA IRQ bit mask
 1360\LDX #&FF \ %11111111
 1370\LDY #&00
 1380\JSR osbyte \ bit mask = default
 1390RTS
 1400.exit
 1410PLA \ pull interrupt accumulator save register
 1420STA &FC \ restore interrupt accumulator save register
 1430JMP (oldirq2v) \ exit via original vector
 1440.interrupt
 1450LDA &FC \ load interrupt accumulator save register
 1460PHA \ and push it on the stack
 1470LDA ifr \ load system VIA interrupt status
 1480BPL exit \ exit if bit 7 clear
 1490AND #&08 \ AND with %00001000
 1500BEQ exit \ exit if not light pen interrupt
 1510TXA
 1520PHA
 1530TYA
 1540PHA
 1550LDA drb \ clear interrupt
 1560PHA \ push data register B
 1570LDY screen \ screen mode into Y register
 1580LDX #&11 \ light pen register, low byte
 1590STX sheila \ 6845 address register
 1600LDA sheila+1 \ 6845 data register
 1610CLD \ clear decimal flag
 1620SEC \ prepare for subtraction
 1630SBC offsetlow,Y \ subtract screen mode offset
 1640STA ycoord \ low byte - offset
 1650DEX \ X = &10, light pen register, high byte
 1660STX sheila \ 6845 address register
 1670LDA sheila+1 \ 6845 data register
 1680SBC offsethigh,Y \ subtract screen mode offset
 1690STA ycoord+1 \ high byte - offset
 1700LDA #&00 \ prepare for 16 bit division
 1710STA xcoord \ clear low partial dividend
 1720.next
 1730ASL ycoord \ shift dividend/quotient left
 1740ROL ycoord+1 \ shift dividend/quotient left
 1750ROL xcoord \ shift bits into partial dividend
 1760LDA xcoord \ load partial dividend
 1770SEC \ prepare for subtraction
 1780SBC width,Y \ subtract divisor
 1790BCC done \ branch if dividend < divisor
 1800INC ycoord \ increment quotient
 1810STA xcoord \ save new partial dividend
 1820.done
 1830DEX \ decrement bit counter
 1840BNE next \ branch for 16 bits
 1850LDA scale,Y \ screen mode scale
 1860BEQ pullout \ branch if modes 0, 3, 4, 6 or 7
 1870TAX \ in mode1 and mode5 X=1, in mode2 X=2
 1880LDA xcoord
 1890.reduce
 1900LSR A \ horizontal position / 2
 1910DEX
 1920BNE reduce
 1930STA xcoord
 1940.pullout
 1950PLA \ pull data register B
 1960AND #&20 \ %00100000
 1970STA fire \ store fire button status
 1980PLA
 1990TAY
 2000PLA
 2010TAX
 2020PLA
 2030STA &FC
 2040RTI \ return from interrupt
 2050.oldirq2v
 2060EQUW &00 \ original irq2 vector
 2070.offsetlow
 2080EQUB &04 \ mode0, untrimmed = &06
 2090EQUB &04 \ mode1, untrimmed = &06
 2100EQUB &04 \ mode2, untrimmed = &06
 2110EQUB &04 \ mode3, untrimmed = &06
 2120EQUB &03 \ mode4, untrimmed = &04
 2130EQUB &03 \ mode5, untrimmed = &04
 2140EQUB &03 \ mode6, untrimmed = &04
 2150EQUB &06 \ mode7, untrimmed = &08
 2160.offsethigh
 2170EQUD &08060606 \ modes 3-0
 2180EQUD &280C0B0B \ modes 7-4
 2190.scale
 2200EQUD &00020100 \ modes 3-0
 2210EQUD &00000100 \ modes 7-4
 2220.width
 2230EQUD &50505050 \ modes 3-0
 2240EQUD &28282828 \ modes 7-4
 2250.lastbyte
 2260]
 2270NEXT
 2280CALL mcode
 2290ENDPROC
 2300:
 2310DEFFNswitch
 2320IF (ADVAL(0)AND3)=0 =TRUE ELSE =FALSE

�> IOINTER

A%=&EA
X%=0
(
Y%=&FF
2"� ((�(&FFF4)�&FF00)�&100)<>0 �
<mcode=&A00
Fxcoord=&70
Pycoord=&71
Z
!xcoord=0
d
�mcode
n� � mcode:�23,1,1;0;0;0;:�
x
mode=4
�paper=6
�	ink=4
�
� mode
��newmode
��
� � �(-58) �up:� mode:�newmode
�"� �(-42) �down:� mode:�newmode
�� �(-56) �paper
�� �(-38) �ink
�� �(-26) �left
�� �(-122) �right
�)�13,2);?xcoord;" "�13,3);?ycoord;" "
�$� �switch �31,?xcoord,?ycoord,42
� �
:
��up
"mode=mode+1
,� mode>7 mode=7
6�
@:
J
��down
Tmode=mode-1
^� mode<0 mode=0
h�
r:
|
��left
�� offsetlow?mode=12 �
�#offsetlow?mode=offsetlow?mode+1
�
�delay
��
�:
���right
�� offsetlow?mode=0 �
�#offsetlow?mode=offsetlow?mode-1
�
�delay
��
�:
�
��newmode
��23,1,0;0;0;0;
� mode=7 �seven:�
�19,0,paper;0;
�19,1,ink;0;
&�1
0
�delay
:�
D:
N��delay
X�3,1)"Mode ";mode
b�3,2)"X coord = ";?xcoord
l�3,3)"Y coord = ";?ycoord
v'�3,4)"offsetlow = ";offsetlow?mode
�
time=�+20
�� � time<�
��
�:
�	��ink
�
ink=ink+1
�� ink=paper ink=ink+1
�� ink>7 ink=0
��19,1,ink;0;
�� mode=7 �seven
�
�delay
��
�:
��paper
paper=paper+1
� paper=ink paper=paper+1
 � paper>7 paper=1
*�19,0,paper;0;
4� mode=7 �seven
>
�delay
H�
R:
\��seven
f� ink=0 ink=1
p� line=0 � 24
zI� paper=0 �31,0,line,128+ink,32,32 � �31,0,line,128+paper,157,128+ink
��
�
�delay
��
�:
���mcode
�#fire=&72 :�: fire button status
�-irq2v=&206 :�: secondary interrupt vector
�&screen=&355 :�: screen mode OS 1.2
�sheila=&FE00
�5drb=&FE40 :�: system 6522 input/output register B
�5ifr=&FE4D :�: system 6522 interrupt flag register
�7ier=&FE4E :�: system 6522 interrupt enable register
�osword=&FFF1
osbyte=&FFF4
� pass=0 � 2 � 2
P%=mcode
$
[OPT pass
.4LDX irq2v \ secondary interrupt vector, low byte
87LDY irq2v+1 \ secondary interrupt vector, high byte
B:CPY #interrupt � 256 \ has the high byte been altered?
L4BEQ disable \ restore original vector if altered
V2STX oldirq2v \ store original vector, low byte
`5STY oldirq2v+1 \ store original vector, high byte
j7LDX #interrupt � 256 \ new interrupt code, low byte
t8LDY #interrupt � 256 \ new interrupt code, high byte
~$SEI \ set interrupt disable flag
�&STX irq2v \ alter vector, low byte
�)STY irq2v+1 \ alter vector, high byte
�&CLI \ clear interrupt disable flag
�LDA #&88 \ %10001000
�)STA ier \ enable light pen interrupts
�-\LDA #&E9 \ write system VIA IRQ bit mask
�\LDX #&F7 \ %11110111
�
\LDY #&00
�&\JSR osbyte \ bit mask = %11110111
�RTS
�.disable
�>LDA #&08 \ %00001000 ready to disable light pen interrupts
1LDX oldirq2v \ original irq2 vector, low byte

4LDY oldirq2v+1 \ original irq2 vector, high byte
$SEI \ set interrupt disable flag
)STA ier \ disable light pen interrupt
(1STX irq2v \ restore original vector, low byte
24STY irq2v+1 \ restore original vector, high byte
<&CLI \ clear interrupt disable flag
F-\LDA #&E9 \ write system VIA IRQ bit mask
P\LDX #&FF \ %11111111
Z
\LDY #&00
d$\JSR osbyte \ bit mask = default
nRTS
x	.exit
�2PLA \ pull interrupt accumulator save register
�9STA &FC \ restore interrupt accumulator save register
�-JMP (oldirq2v) \ exit via original vector
�.interrupt
�6LDA &FC \ load interrupt accumulator save register
�"PHA \ and push it on the stack
�.LDA ifr \ load system VIA interrupt status
�"BPL exit \ exit if bit 7 clear
�� #&08 \ � with %00001000
�.BEQ exit \ exit if not light pen interrupt
�TXA
�PHA
�TYA
PHA
LDA drb \ clear interrupt
PHA \ push data register B
",LDY screen \ screen mode into Y register
,+LDX #&11 \ light pen register, low byte
6&STX sheila \ 6845 address register
@%LDA sheila+1 \ 6845 data register
JCLD \ clear decimal flag
T!SEC \ prepare for subtraction
^1SBC offsetlow,Y \ subtract screen mode offset
h"STA ycoord \ low byte - offset
r0DEX \ X = &10, light pen register, high byte
|&STX sheila \ 6845 address register
�%LDA sheila+1 \ 6845 data register
�2SBC offsethigh,Y \ subtract screen mode offset
�%STA ycoord+1 \ high byte - offset
�*LDA #&00 \ prepare for 16 bit division
�+STA xcoord \ clear low partial dividend
�	.next
�-ASL ycoord \ shift dividend/quotient left
�/ROL ycoord+1 \ shift dividend/quotient left
�1ROL xcoord \ shift bits into partial dividend
�&LDA xcoord \ load partial dividend
�!SEC \ prepare for subtraction
�"SBC width,Y \ subtract divisor
�+BCC done \ branch if dividend < divisor
#INC ycoord \ increment quotient
*STA xcoord \ save new partial dividend
	.done
&DEX \ decrement bit counter
0!BNE next \ branch for 16 bits
:#LDA scale,Y \ screen mode scale
D1BEQ pullout \ branch if modes 0, 3, 4, 6 or 7
N.TAX \ in mode1 and mode5 X=1, in mode2 X=2
XLDA xcoord
b.reduce
l#LSR A \ horizontal position / 2
vDEX
�BNE reduce
�STA xcoord
�.pullout
�PLA \ pull data register B
�� #&20 \ %00100000
�'STA fire \ store fire button status
�PLA
�TAY
�PLA
�TAX
�PLA
�STA &FC
�RTI \ return from interrupt

.oldirq2v
#EQUW &00 \ original irq2 vector
.offsetlow
 %EQUB &04 \ mode0, untrimmed = &06
*%EQUB &04 \ mode1, untrimmed = &06
4%EQUB &04 \ mode2, untrimmed = &06
>%EQUB &04 \ mode3, untrimmed = &06
H%EQUB &03 \ mode4, untrimmed = &04
R%EQUB &03 \ mode5, untrimmed = &04
\%EQUB &03 \ mode6, untrimmed = &04
f%EQUB &06 \ mode7, untrimmed = &08
p.offsethigh
zEQUD &08060606 \ modes 3-0
�EQUD &280C0B0B \ modes 7-4
�
.scale
�EQUD &00020100 \ modes 3-0
�EQUD &00000100 \ modes 7-4
�
.width
�EQUD &50505050 \ modes 3-0
�EQUD &28282828 \ modes 7-4
�
.lastbyte
�]
��
�� mcode
��
�:
	ݤswitch
	� (�(0)�3)=0 =� � =�
�
00000000  0d 00 0a 0e f4 3e 20 49  4f 49 4e 54 45 52 0d 00  |.....> IOINTER..|
00000010  14 0a 41 25 3d 26 45 41  0d 00 1e 08 58 25 3d 30  |..A%=&EA....X%=0|
00000020  0d 00 28 0a 59 25 3d 26  46 46 0d 00 32 22 e7 20  |..(.Y%=&FF..2". |
00000030  28 28 ba 28 26 46 46 46  34 29 80 26 46 46 30 30  |((.(&FFF4).&FF00|
00000040  29 81 26 31 30 30 29 3c  3e 30 20 e0 0d 00 3c 0e  |).&100)<>0 ...<.|
00000050  6d 63 6f 64 65 3d 26 41  30 30 0d 00 46 0e 78 63  |mcode=&A00..F.xc|
00000060  6f 6f 72 64 3d 26 37 30  0d 00 50 0e 79 63 6f 6f  |oord=&70..P.ycoo|
00000070  72 64 3d 26 37 31 0d 00  5a 0d 21 78 63 6f 6f 72  |rd=&71..Z.!xcoor|
00000080  64 3d 30 0d 00 64 0a f2  6d 63 6f 64 65 0d 00 6e  |d=0..d..mcode..n|
00000090  1f ee 85 20 d6 20 6d 63  6f 64 65 3a ef 32 33 2c  |... . mcode:.23,|
000000a0  31 2c 31 3b 30 3b 30 3b  30 3b 3a e0 0d 00 78 0a  |1,1;0;0;0;:...x.|
000000b0  6d 6f 64 65 3d 34 0d 00  82 0b 70 61 70 65 72 3d  |mode=4....paper=|
000000c0  36 0d 00 8c 09 69 6e 6b  3d 34 0d 00 96 0a eb 20  |6....ink=4..... |
000000d0  6d 6f 64 65 0d 00 a0 0c  f2 6e 65 77 6d 6f 64 65  |mode.....newmode|
000000e0  0d 00 aa 05 f5 0d 00 b4  20 e7 20 a6 28 2d 35 38  |........ . .(-58|
000000f0  29 20 f2 75 70 3a eb 20  6d 6f 64 65 3a f2 6e 65  |) .up:. mode:.ne|
00000100  77 6d 6f 64 65 0d 00 be  22 e7 20 a6 28 2d 34 32  |wmode...". .(-42|
00000110  29 20 f2 64 6f 77 6e 3a  eb 20 6d 6f 64 65 3a f2  |) .down:. mode:.|
00000120  6e 65 77 6d 6f 64 65 0d  00 c8 13 e7 20 a6 28 2d  |newmode..... .(-|
00000130  35 36 29 20 f2 70 61 70  65 72 0d 00 d2 11 e7 20  |56) .paper..... |
00000140  a6 28 2d 33 38 29 20 f2  69 6e 6b 0d 00 dc 12 e7  |.(-38) .ink.....|
00000150  20 a6 28 2d 32 36 29 20  f2 6c 65 66 74 0d 00 e6  | .(-26) .left...|
00000160  14 e7 20 a6 28 2d 31 32  32 29 20 f2 72 69 67 68  |.. .(-122) .righ|
00000170  74 0d 00 f0 29 f1 8a 31  33 2c 32 29 3b 3f 78 63  |t...)..13,2);?xc|
00000180  6f 6f 72 64 3b 22 20 22  8a 31 33 2c 33 29 3b 3f  |oord;" ".13,3);?|
00000190  79 63 6f 6f 72 64 3b 22  20 22 0d 00 fa 24 e7 20  |ycoord;" "...$. |
000001a0  a4 73 77 69 74 63 68 20  ef 33 31 2c 3f 78 63 6f  |.switch .31,?xco|
000001b0  6f 72 64 2c 3f 79 63 6f  6f 72 64 2c 34 32 0d 01  |ord,?ycoord,42..|
000001c0  04 07 fd 20 a3 0d 01 0e  05 3a 0d 01 18 08 dd f2  |... .....:......|
000001d0  75 70 0d 01 22 0f 6d 6f  64 65 3d 6d 6f 64 65 2b  |up..".mode=mode+|
000001e0  31 0d 01 2c 13 e7 20 6d  6f 64 65 3e 37 20 6d 6f  |1..,.. mode>7 mo|
000001f0  64 65 3d 37 0d 01 36 05  e1 0d 01 40 05 3a 0d 01  |de=7..6....@.:..|
00000200  4a 0a dd f2 64 6f 77 6e  0d 01 54 0f 6d 6f 64 65  |J...down..T.mode|
00000210  3d 6d 6f 64 65 2d 31 0d  01 5e 13 e7 20 6d 6f 64  |=mode-1..^.. mod|
00000220  65 3c 30 20 6d 6f 64 65  3d 30 0d 01 68 05 e1 0d  |e<0 mode=0..h...|
00000230  01 72 05 3a 0d 01 7c 0a  dd f2 6c 65 66 74 0d 01  |.r.:..|...left..|
00000240  86 19 e7 20 6f 66 66 73  65 74 6c 6f 77 3f 6d 6f  |... offsetlow?mo|
00000250  64 65 3d 31 32 20 e1 0d  01 90 23 6f 66 66 73 65  |de=12 ....#offse|
00000260  74 6c 6f 77 3f 6d 6f 64  65 3d 6f 66 66 73 65 74  |tlow?mode=offset|
00000270  6c 6f 77 3f 6d 6f 64 65  2b 31 0d 01 9a 0a f2 64  |low?mode+1.....d|
00000280  65 6c 61 79 0d 01 a4 05  e1 0d 01 ae 05 3a 0d 01  |elay.........:..|
00000290  b8 0b dd f2 72 69 67 68  74 0d 01 c2 18 e7 20 6f  |....right..... o|
000002a0  66 66 73 65 74 6c 6f 77  3f 6d 6f 64 65 3d 30 20  |ffsetlow?mode=0 |
000002b0  e1 0d 01 cc 23 6f 66 66  73 65 74 6c 6f 77 3f 6d  |....#offsetlow?m|
000002c0  6f 64 65 3d 6f 66 66 73  65 74 6c 6f 77 3f 6d 6f  |ode=offsetlow?mo|
000002d0  64 65 2d 31 0d 01 d6 0a  f2 64 65 6c 61 79 0d 01  |de-1.....delay..|
000002e0  e0 05 e1 0d 01 ea 05 3a  0d 01 f4 0d dd f2 6e 65  |.......:......ne|
000002f0  77 6d 6f 64 65 0d 01 fe  12 ef 32 33 2c 31 2c 30  |wmode.....23,1,0|
00000300  3b 30 3b 30 3b 30 3b 0d  02 08 15 e7 20 6d 6f 64  |;0;0;0;..... mod|
00000310  65 3d 37 20 f2 73 65 76  65 6e 3a e1 0d 02 12 12  |e=7 .seven:.....|
00000320  ef 31 39 2c 30 2c 70 61  70 65 72 3b 30 3b 0d 02  |.19,0,paper;0;..|
00000330  1c 10 ef 31 39 2c 31 2c  69 6e 6b 3b 30 3b 0d 02  |...19,1,ink;0;..|
00000340  26 06 fb 31 0d 02 30 0a  f2 64 65 6c 61 79 0d 02  |&..1..0..delay..|
00000350  3a 05 e1 0d 02 44 05 3a  0d 02 4e 0b dd f2 64 65  |:....D.:..N...de|
00000360  6c 61 79 0d 02 58 16 f1  8a 33 2c 31 29 22 4d 6f  |lay..X...3,1)"Mo|
00000370  64 65 20 22 3b 6d 6f 64  65 0d 02 62 1e f1 8a 33  |de ";mode..b...3|
00000380  2c 32 29 22 58 20 63 6f  6f 72 64 20 3d 20 22 3b  |,2)"X coord = ";|
00000390  3f 78 63 6f 6f 72 64 0d  02 6c 1e f1 8a 33 2c 33  |?xcoord..l...3,3|
000003a0  29 22 59 20 63 6f 6f 72  64 20 3d 20 22 3b 3f 79  |)"Y coord = ";?y|
000003b0  63 6f 6f 72 64 0d 02 76  27 f1 8a 33 2c 34 29 22  |coord..v'..3,4)"|
000003c0  6f 66 66 73 65 74 6c 6f  77 20 3d 20 22 3b 6f 66  |offsetlow = ";of|
000003d0  66 73 65 74 6c 6f 77 3f  6d 6f 64 65 0d 02 80 0d  |fsetlow?mode....|
000003e0  74 69 6d 65 3d 91 2b 32  30 0d 02 8a 0e f5 20 fd  |time=.+20..... .|
000003f0  20 74 69 6d 65 3c 91 0d  02 94 05 e1 0d 02 9e 05  | time<..........|
00000400  3a 0d 02 a8 09 dd f2 69  6e 6b 0d 02 b2 0d 69 6e  |:......ink....in|
00000410  6b 3d 69 6e 6b 2b 31 0d  02 bc 19 e7 20 69 6e 6b  |k=ink+1..... ink|
00000420  3d 70 61 70 65 72 20 69  6e 6b 3d 69 6e 6b 2b 31  |=paper ink=ink+1|
00000430  0d 02 c6 11 e7 20 69 6e  6b 3e 37 20 69 6e 6b 3d  |..... ink>7 ink=|
00000440  30 0d 02 d0 10 ef 31 39  2c 31 2c 69 6e 6b 3b 30  |0.....19,1,ink;0|
00000450  3b 0d 02 da 13 e7 20 6d  6f 64 65 3d 37 20 f2 73  |;..... mode=7 .s|
00000460  65 76 65 6e 0d 02 e4 0a  f2 64 65 6c 61 79 0d 02  |even.....delay..|
00000470  ee 05 e1 0d 02 f8 05 3a  0d 03 02 0b dd f2 70 61  |.......:......pa|
00000480  70 65 72 0d 03 0c 11 70  61 70 65 72 3d 70 61 70  |per....paper=pap|
00000490  65 72 2b 31 0d 03 16 1d  e7 20 70 61 70 65 72 3d  |er+1..... paper=|
000004a0  69 6e 6b 20 70 61 70 65  72 3d 70 61 70 65 72 2b  |ink paper=paper+|
000004b0  31 0d 03 20 15 e7 20 70  61 70 65 72 3e 37 20 70  |1.. .. paper>7 p|
000004c0  61 70 65 72 3d 31 0d 03  2a 12 ef 31 39 2c 30 2c  |aper=1..*..19,0,|
000004d0  70 61 70 65 72 3b 30 3b  0d 03 34 13 e7 20 6d 6f  |paper;0;..4.. mo|
000004e0  64 65 3d 37 20 f2 73 65  76 65 6e 0d 03 3e 0a f2  |de=7 .seven..>..|
000004f0  64 65 6c 61 79 0d 03 48  05 e1 0d 03 52 05 3a 0d  |delay..H....R.:.|
00000500  03 5c 0b dd f2 73 65 76  65 6e 0d 03 66 11 e7 20  |.\...seven..f.. |
00000510  69 6e 6b 3d 30 20 69 6e  6b 3d 31 0d 03 70 11 e3  |ink=0 ink=1..p..|
00000520  20 6c 69 6e 65 3d 30 20  b8 20 32 34 0d 03 7a 49  | line=0 . 24..zI|
00000530  e7 20 70 61 70 65 72 3d  30 20 ef 33 31 2c 30 2c  |. paper=0 .31,0,|
00000540  6c 69 6e 65 2c 31 32 38  2b 69 6e 6b 2c 33 32 2c  |line,128+ink,32,|
00000550  33 32 20 8b 20 ef 33 31  2c 30 2c 6c 69 6e 65 2c  |32 . .31,0,line,|
00000560  31 32 38 2b 70 61 70 65  72 2c 31 35 37 2c 31 32  |128+paper,157,12|
00000570  38 2b 69 6e 6b 0d 03 84  05 ed 0d 03 8e 0a f2 64  |8+ink..........d|
00000580  65 6c 61 79 0d 03 98 05  e1 0d 03 a2 05 3a 0d 03  |elay.........:..|
00000590  ac 0b dd f2 6d 63 6f 64  65 0d 03 b6 23 66 69 72  |....mcode...#fir|
000005a0  65 3d 26 37 32 20 3a f4  3a 20 66 69 72 65 20 62  |e=&72 :.: fire b|
000005b0  75 74 74 6f 6e 20 73 74  61 74 75 73 0d 03 c0 2d  |utton status...-|
000005c0  69 72 71 32 76 3d 26 32  30 36 20 3a f4 3a 20 73  |irq2v=&206 :.: s|
000005d0  65 63 6f 6e 64 61 72 79  20 69 6e 74 65 72 72 75  |econdary interru|
000005e0  70 74 20 76 65 63 74 6f  72 0d 03 ca 26 73 63 72  |pt vector...&scr|
000005f0  65 65 6e 3d 26 33 35 35  20 3a f4 3a 20 73 63 72  |een=&355 :.: scr|
00000600  65 65 6e 20 6d 6f 64 65  20 4f 53 20 31 2e 32 0d  |een mode OS 1.2.|
00000610  03 d4 10 73 68 65 69 6c  61 3d 26 46 45 30 30 0d  |...sheila=&FE00.|
00000620  03 de 35 64 72 62 3d 26  46 45 34 30 20 3a f4 3a  |..5drb=&FE40 :.:|
00000630  20 73 79 73 74 65 6d 20  36 35 32 32 20 69 6e 70  | system 6522 inp|
00000640  75 74 2f 6f 75 74 70 75  74 20 72 65 67 69 73 74  |ut/output regist|
00000650  65 72 20 42 0d 03 e8 35  69 66 72 3d 26 46 45 34  |er B...5ifr=&FE4|
00000660  44 20 3a f4 3a 20 73 79  73 74 65 6d 20 36 35 32  |D :.: system 652|
00000670  32 20 69 6e 74 65 72 72  75 70 74 20 66 6c 61 67  |2 interrupt flag|
00000680  20 72 65 67 69 73 74 65  72 0d 03 f2 37 69 65 72  | register...7ier|
00000690  3d 26 46 45 34 45 20 3a  f4 3a 20 73 79 73 74 65  |=&FE4E :.: syste|
000006a0  6d 20 36 35 32 32 20 69  6e 74 65 72 72 75 70 74  |m 6522 interrupt|
000006b0  20 65 6e 61 62 6c 65 20  72 65 67 69 73 74 65 72  | enable register|
000006c0  0d 03 fc 10 6f 73 77 6f  72 64 3d 26 46 46 46 31  |....osword=&FFF1|
000006d0  0d 04 06 10 6f 73 62 79  74 65 3d 26 46 46 46 34  |....osbyte=&FFF4|
000006e0  0d 04 10 14 e3 20 70 61  73 73 3d 30 20 b8 20 32  |..... pass=0 . 2|
000006f0  20 88 20 32 0d 04 1a 0c  50 25 3d 6d 63 6f 64 65  | . 2....P%=mcode|
00000700  0d 04 24 0d 5b 4f 50 54  20 70 61 73 73 0d 04 2e  |..$.[OPT pass...|
00000710  34 4c 44 58 20 69 72 71  32 76 20 5c 20 73 65 63  |4LDX irq2v \ sec|
00000720  6f 6e 64 61 72 79 20 69  6e 74 65 72 72 75 70 74  |ondary interrupt|
00000730  20 76 65 63 74 6f 72 2c  20 6c 6f 77 20 62 79 74  | vector, low byt|
00000740  65 0d 04 38 37 4c 44 59  20 69 72 71 32 76 2b 31  |e..87LDY irq2v+1|
00000750  20 5c 20 73 65 63 6f 6e  64 61 72 79 20 69 6e 74  | \ secondary int|
00000760  65 72 72 75 70 74 20 76  65 63 74 6f 72 2c 20 68  |errupt vector, h|
00000770  69 67 68 20 62 79 74 65  0d 04 42 3a 43 50 59 20  |igh byte..B:CPY |
00000780  23 69 6e 74 65 72 72 75  70 74 20 81 20 32 35 36  |#interrupt . 256|
00000790  20 5c 20 68 61 73 20 74  68 65 20 68 69 67 68 20  | \ has the high |
000007a0  62 79 74 65 20 62 65 65  6e 20 61 6c 74 65 72 65  |byte been altere|
000007b0  64 3f 0d 04 4c 34 42 45  51 20 64 69 73 61 62 6c  |d?..L4BEQ disabl|
000007c0  65 20 5c 20 72 65 73 74  6f 72 65 20 6f 72 69 67  |e \ restore orig|
000007d0  69 6e 61 6c 20 76 65 63  74 6f 72 20 69 66 20 61  |inal vector if a|
000007e0  6c 74 65 72 65 64 0d 04  56 32 53 54 58 20 6f 6c  |ltered..V2STX ol|
000007f0  64 69 72 71 32 76 20 5c  20 73 74 6f 72 65 20 6f  |dirq2v \ store o|
00000800  72 69 67 69 6e 61 6c 20  76 65 63 74 6f 72 2c 20  |riginal vector, |
00000810  6c 6f 77 20 62 79 74 65  0d 04 60 35 53 54 59 20  |low byte..`5STY |
00000820  6f 6c 64 69 72 71 32 76  2b 31 20 5c 20 73 74 6f  |oldirq2v+1 \ sto|
00000830  72 65 20 6f 72 69 67 69  6e 61 6c 20 76 65 63 74  |re original vect|
00000840  6f 72 2c 20 68 69 67 68  20 62 79 74 65 0d 04 6a  |or, high byte..j|
00000850  37 4c 44 58 20 23 69 6e  74 65 72 72 75 70 74 20  |7LDX #interrupt |
00000860  83 20 32 35 36 20 5c 20  6e 65 77 20 69 6e 74 65  |. 256 \ new inte|
00000870  72 72 75 70 74 20 63 6f  64 65 2c 20 6c 6f 77 20  |rrupt code, low |
00000880  62 79 74 65 0d 04 74 38  4c 44 59 20 23 69 6e 74  |byte..t8LDY #int|
00000890  65 72 72 75 70 74 20 81  20 32 35 36 20 5c 20 6e  |errupt . 256 \ n|
000008a0  65 77 20 69 6e 74 65 72  72 75 70 74 20 63 6f 64  |ew interrupt cod|
000008b0  65 2c 20 68 69 67 68 20  62 79 74 65 0d 04 7e 24  |e, high byte..~$|
000008c0  53 45 49 20 5c 20 73 65  74 20 69 6e 74 65 72 72  |SEI \ set interr|
000008d0  75 70 74 20 64 69 73 61  62 6c 65 20 66 6c 61 67  |upt disable flag|
000008e0  0d 04 88 26 53 54 58 20  69 72 71 32 76 20 5c 20  |...&STX irq2v \ |
000008f0  61 6c 74 65 72 20 76 65  63 74 6f 72 2c 20 6c 6f  |alter vector, lo|
00000900  77 20 62 79 74 65 0d 04  92 29 53 54 59 20 69 72  |w byte...)STY ir|
00000910  71 32 76 2b 31 20 5c 20  61 6c 74 65 72 20 76 65  |q2v+1 \ alter ve|
00000920  63 74 6f 72 2c 20 68 69  67 68 20 62 79 74 65 0d  |ctor, high byte.|
00000930  04 9c 26 43 4c 49 20 5c  20 63 6c 65 61 72 20 69  |..&CLI \ clear i|
00000940  6e 74 65 72 72 75 70 74  20 64 69 73 61 62 6c 65  |nterrupt disable|
00000950  20 66 6c 61 67 0d 04 a6  18 4c 44 41 20 23 26 38  | flag....LDA #&8|
00000960  38 20 5c 20 25 31 30 30  30 31 30 30 30 0d 04 b0  |8 \ %10001000...|
00000970  29 53 54 41 20 69 65 72  20 5c 20 65 6e 61 62 6c  |)STA ier \ enabl|
00000980  65 20 6c 69 67 68 74 20  70 65 6e 20 69 6e 74 65  |e light pen inte|
00000990  72 72 75 70 74 73 0d 04  ba 2d 5c 4c 44 41 20 23  |rrupts...-\LDA #|
000009a0  26 45 39 20 5c 20 77 72  69 74 65 20 73 79 73 74  |&E9 \ write syst|
000009b0  65 6d 20 56 49 41 20 49  52 51 20 62 69 74 20 6d  |em VIA IRQ bit m|
000009c0  61 73 6b 0d 04 c4 19 5c  4c 44 58 20 23 26 46 37  |ask....\LDX #&F7|
000009d0  20 5c 20 25 31 31 31 31  30 31 31 31 0d 04 ce 0d  | \ %11110111....|
000009e0  5c 4c 44 59 20 23 26 30  30 0d 04 d8 26 5c 4a 53  |\LDY #&00...&\JS|
000009f0  52 20 6f 73 62 79 74 65  20 5c 20 62 69 74 20 6d  |R osbyte \ bit m|
00000a00  61 73 6b 20 3d 20 25 31  31 31 31 30 31 31 31 0d  |ask = %11110111.|
00000a10  04 e2 07 52 54 53 0d 04  ec 0c 2e 64 69 73 61 62  |...RTS.....disab|
00000a20  6c 65 0d 04 f6 3e 4c 44  41 20 23 26 30 38 20 5c  |le...>LDA #&08 \|
00000a30  20 25 30 30 30 30 31 30  30 30 20 72 65 61 64 79  | %00001000 ready|
00000a40  20 74 6f 20 64 69 73 61  62 6c 65 20 6c 69 67 68  | to disable ligh|
00000a50  74 20 70 65 6e 20 69 6e  74 65 72 72 75 70 74 73  |t pen interrupts|
00000a60  0d 05 00 31 4c 44 58 20  6f 6c 64 69 72 71 32 76  |...1LDX oldirq2v|
00000a70  20 5c 20 6f 72 69 67 69  6e 61 6c 20 69 72 71 32  | \ original irq2|
00000a80  20 76 65 63 74 6f 72 2c  20 6c 6f 77 20 62 79 74  | vector, low byt|
00000a90  65 0d 05 0a 34 4c 44 59  20 6f 6c 64 69 72 71 32  |e...4LDY oldirq2|
00000aa0  76 2b 31 20 5c 20 6f 72  69 67 69 6e 61 6c 20 69  |v+1 \ original i|
00000ab0  72 71 32 20 76 65 63 74  6f 72 2c 20 68 69 67 68  |rq2 vector, high|
00000ac0  20 62 79 74 65 0d 05 14  24 53 45 49 20 5c 20 73  | byte...$SEI \ s|
00000ad0  65 74 20 69 6e 74 65 72  72 75 70 74 20 64 69 73  |et interrupt dis|
00000ae0  61 62 6c 65 20 66 6c 61  67 0d 05 1e 29 53 54 41  |able flag...)STA|
00000af0  20 69 65 72 20 5c 20 64  69 73 61 62 6c 65 20 6c  | ier \ disable l|
00000b00  69 67 68 74 20 70 65 6e  20 69 6e 74 65 72 72 75  |ight pen interru|
00000b10  70 74 0d 05 28 31 53 54  58 20 69 72 71 32 76 20  |pt..(1STX irq2v |
00000b20  5c 20 72 65 73 74 6f 72  65 20 6f 72 69 67 69 6e  |\ restore origin|
00000b30  61 6c 20 76 65 63 74 6f  72 2c 20 6c 6f 77 20 62  |al vector, low b|
00000b40  79 74 65 0d 05 32 34 53  54 59 20 69 72 71 32 76  |yte..24STY irq2v|
00000b50  2b 31 20 5c 20 72 65 73  74 6f 72 65 20 6f 72 69  |+1 \ restore ori|
00000b60  67 69 6e 61 6c 20 76 65  63 74 6f 72 2c 20 68 69  |ginal vector, hi|
00000b70  67 68 20 62 79 74 65 0d  05 3c 26 43 4c 49 20 5c  |gh byte..<&CLI \|
00000b80  20 63 6c 65 61 72 20 69  6e 74 65 72 72 75 70 74  | clear interrupt|
00000b90  20 64 69 73 61 62 6c 65  20 66 6c 61 67 0d 05 46  | disable flag..F|
00000ba0  2d 5c 4c 44 41 20 23 26  45 39 20 5c 20 77 72 69  |-\LDA #&E9 \ wri|
00000bb0  74 65 20 73 79 73 74 65  6d 20 56 49 41 20 49 52  |te system VIA IR|
00000bc0  51 20 62 69 74 20 6d 61  73 6b 0d 05 50 19 5c 4c  |Q bit mask..P.\L|
00000bd0  44 58 20 23 26 46 46 20  5c 20 25 31 31 31 31 31  |DX #&FF \ %11111|
00000be0  31 31 31 0d 05 5a 0d 5c  4c 44 59 20 23 26 30 30  |111..Z.\LDY #&00|
00000bf0  0d 05 64 24 5c 4a 53 52  20 6f 73 62 79 74 65 20  |..d$\JSR osbyte |
00000c00  5c 20 62 69 74 20 6d 61  73 6b 20 3d 20 64 65 66  |\ bit mask = def|
00000c10  61 75 6c 74 0d 05 6e 07  52 54 53 0d 05 78 09 2e  |ault..n.RTS..x..|
00000c20  65 78 69 74 0d 05 82 32  50 4c 41 20 5c 20 70 75  |exit...2PLA \ pu|
00000c30  6c 6c 20 69 6e 74 65 72  72 75 70 74 20 61 63 63  |ll interrupt acc|
00000c40  75 6d 75 6c 61 74 6f 72  20 73 61 76 65 20 72 65  |umulator save re|
00000c50  67 69 73 74 65 72 0d 05  8c 39 53 54 41 20 26 46  |gister...9STA &F|
00000c60  43 20 5c 20 72 65 73 74  6f 72 65 20 69 6e 74 65  |C \ restore inte|
00000c70  72 72 75 70 74 20 61 63  63 75 6d 75 6c 61 74 6f  |rrupt accumulato|
00000c80  72 20 73 61 76 65 20 72  65 67 69 73 74 65 72 0d  |r save register.|
00000c90  05 96 2d 4a 4d 50 20 28  6f 6c 64 69 72 71 32 76  |..-JMP (oldirq2v|
00000ca0  29 20 5c 20 65 78 69 74  20 76 69 61 20 6f 72 69  |) \ exit via ori|
00000cb0  67 69 6e 61 6c 20 76 65  63 74 6f 72 0d 05 a0 0e  |ginal vector....|
00000cc0  2e 69 6e 74 65 72 72 75  70 74 0d 05 aa 36 4c 44  |.interrupt...6LD|
00000cd0  41 20 26 46 43 20 5c 20  6c 6f 61 64 20 69 6e 74  |A &FC \ load int|
00000ce0  65 72 72 75 70 74 20 61  63 63 75 6d 75 6c 61 74  |errupt accumulat|
00000cf0  6f 72 20 73 61 76 65 20  72 65 67 69 73 74 65 72  |or save register|
00000d00  0d 05 b4 22 50 48 41 20  5c 20 61 6e 64 20 70 75  |..."PHA \ and pu|
00000d10  73 68 20 69 74 20 6f 6e  20 74 68 65 20 73 74 61  |sh it on the sta|
00000d20  63 6b 0d 05 be 2e 4c 44  41 20 69 66 72 20 5c 20  |ck....LDA ifr \ |
00000d30  6c 6f 61 64 20 73 79 73  74 65 6d 20 56 49 41 20  |load system VIA |
00000d40  69 6e 74 65 72 72 75 70  74 20 73 74 61 74 75 73  |interrupt status|
00000d50  0d 05 c8 22 42 50 4c 20  65 78 69 74 20 5c 20 65  |..."BPL exit \ e|
00000d60  78 69 74 20 69 66 20 62  69 74 20 37 20 63 6c 65  |xit if bit 7 cle|
00000d70  61 72 0d 05 d2 1d 80 20  23 26 30 38 20 5c 20 80  |ar..... #&08 \ .|
00000d80  20 77 69 74 68 20 25 30  30 30 30 31 30 30 30 0d  | with %00001000.|
00000d90  05 dc 2e 42 45 51 20 65  78 69 74 20 5c 20 65 78  |...BEQ exit \ ex|
00000da0  69 74 20 69 66 20 6e 6f  74 20 6c 69 67 68 74 20  |it if not light |
00000db0  70 65 6e 20 69 6e 74 65  72 72 75 70 74 0d 05 e6  |pen interrupt...|
00000dc0  07 54 58 41 0d 05 f0 07  50 48 41 0d 05 fa 07 54  |.TXA....PHA....T|
00000dd0  59 41 0d 06 04 07 50 48  41 0d 06 0e 1d 4c 44 41  |YA....PHA....LDA|
00000de0  20 64 72 62 20 5c 20 63  6c 65 61 72 20 69 6e 74  | drb \ clear int|
00000df0  65 72 72 75 70 74 0d 06  18 1e 50 48 41 20 5c 20  |errupt....PHA \ |
00000e00  70 75 73 68 20 64 61 74  61 20 72 65 67 69 73 74  |push data regist|
00000e10  65 72 20 42 0d 06 22 2c  4c 44 59 20 73 63 72 65  |er B..",LDY scre|
00000e20  65 6e 20 5c 20 73 63 72  65 65 6e 20 6d 6f 64 65  |en \ screen mode|
00000e30  20 69 6e 74 6f 20 59 20  72 65 67 69 73 74 65 72  | into Y register|
00000e40  0d 06 2c 2b 4c 44 58 20  23 26 31 31 20 5c 20 6c  |..,+LDX #&11 \ l|
00000e50  69 67 68 74 20 70 65 6e  20 72 65 67 69 73 74 65  |ight pen registe|
00000e60  72 2c 20 6c 6f 77 20 62  79 74 65 0d 06 36 26 53  |r, low byte..6&S|
00000e70  54 58 20 73 68 65 69 6c  61 20 5c 20 36 38 34 35  |TX sheila \ 6845|
00000e80  20 61 64 64 72 65 73 73  20 72 65 67 69 73 74 65  | address registe|
00000e90  72 0d 06 40 25 4c 44 41  20 73 68 65 69 6c 61 2b  |r..@%LDA sheila+|
00000ea0  31 20 5c 20 36 38 34 35  20 64 61 74 61 20 72 65  |1 \ 6845 data re|
00000eb0  67 69 73 74 65 72 0d 06  4a 1c 43 4c 44 20 5c 20  |gister..J.CLD \ |
00000ec0  63 6c 65 61 72 20 64 65  63 69 6d 61 6c 20 66 6c  |clear decimal fl|
00000ed0  61 67 0d 06 54 21 53 45  43 20 5c 20 70 72 65 70  |ag..T!SEC \ prep|
00000ee0  61 72 65 20 66 6f 72 20  73 75 62 74 72 61 63 74  |are for subtract|
00000ef0  69 6f 6e 0d 06 5e 31 53  42 43 20 6f 66 66 73 65  |ion..^1SBC offse|
00000f00  74 6c 6f 77 2c 59 20 5c  20 73 75 62 74 72 61 63  |tlow,Y \ subtrac|
00000f10  74 20 73 63 72 65 65 6e  20 6d 6f 64 65 20 6f 66  |t screen mode of|
00000f20  66 73 65 74 0d 06 68 22  53 54 41 20 79 63 6f 6f  |fset..h"STA ycoo|
00000f30  72 64 20 5c 20 6c 6f 77  20 62 79 74 65 20 2d 20  |rd \ low byte - |
00000f40  6f 66 66 73 65 74 0d 06  72 30 44 45 58 20 5c 20  |offset..r0DEX \ |
00000f50  58 20 3d 20 26 31 30 2c  20 6c 69 67 68 74 20 70  |X = &10, light p|
00000f60  65 6e 20 72 65 67 69 73  74 65 72 2c 20 68 69 67  |en register, hig|
00000f70  68 20 62 79 74 65 0d 06  7c 26 53 54 58 20 73 68  |h byte..|&STX sh|
00000f80  65 69 6c 61 20 5c 20 36  38 34 35 20 61 64 64 72  |eila \ 6845 addr|
00000f90  65 73 73 20 72 65 67 69  73 74 65 72 0d 06 86 25  |ess register...%|
00000fa0  4c 44 41 20 73 68 65 69  6c 61 2b 31 20 5c 20 36  |LDA sheila+1 \ 6|
00000fb0  38 34 35 20 64 61 74 61  20 72 65 67 69 73 74 65  |845 data registe|
00000fc0  72 0d 06 90 32 53 42 43  20 6f 66 66 73 65 74 68  |r...2SBC offseth|
00000fd0  69 67 68 2c 59 20 5c 20  73 75 62 74 72 61 63 74  |igh,Y \ subtract|
00000fe0  20 73 63 72 65 65 6e 20  6d 6f 64 65 20 6f 66 66  | screen mode off|
00000ff0  73 65 74 0d 06 9a 25 53  54 41 20 79 63 6f 6f 72  |set...%STA ycoor|
00001000  64 2b 31 20 5c 20 68 69  67 68 20 62 79 74 65 20  |d+1 \ high byte |
00001010  2d 20 6f 66 66 73 65 74  0d 06 a4 2a 4c 44 41 20  |- offset...*LDA |
00001020  23 26 30 30 20 5c 20 70  72 65 70 61 72 65 20 66  |#&00 \ prepare f|
00001030  6f 72 20 31 36 20 62 69  74 20 64 69 76 69 73 69  |or 16 bit divisi|
00001040  6f 6e 0d 06 ae 2b 53 54  41 20 78 63 6f 6f 72 64  |on...+STA xcoord|
00001050  20 5c 20 63 6c 65 61 72  20 6c 6f 77 20 70 61 72  | \ clear low par|
00001060  74 69 61 6c 20 64 69 76  69 64 65 6e 64 0d 06 b8  |tial dividend...|
00001070  09 2e 6e 65 78 74 0d 06  c2 2d 41 53 4c 20 79 63  |..next...-ASL yc|
00001080  6f 6f 72 64 20 5c 20 73  68 69 66 74 20 64 69 76  |oord \ shift div|
00001090  69 64 65 6e 64 2f 71 75  6f 74 69 65 6e 74 20 6c  |idend/quotient l|
000010a0  65 66 74 0d 06 cc 2f 52  4f 4c 20 79 63 6f 6f 72  |eft.../ROL ycoor|
000010b0  64 2b 31 20 5c 20 73 68  69 66 74 20 64 69 76 69  |d+1 \ shift divi|
000010c0  64 65 6e 64 2f 71 75 6f  74 69 65 6e 74 20 6c 65  |dend/quotient le|
000010d0  66 74 0d 06 d6 31 52 4f  4c 20 78 63 6f 6f 72 64  |ft...1ROL xcoord|
000010e0  20 5c 20 73 68 69 66 74  20 62 69 74 73 20 69 6e  | \ shift bits in|
000010f0  74 6f 20 70 61 72 74 69  61 6c 20 64 69 76 69 64  |to partial divid|
00001100  65 6e 64 0d 06 e0 26 4c  44 41 20 78 63 6f 6f 72  |end...&LDA xcoor|
00001110  64 20 5c 20 6c 6f 61 64  20 70 61 72 74 69 61 6c  |d \ load partial|
00001120  20 64 69 76 69 64 65 6e  64 0d 06 ea 21 53 45 43  | dividend...!SEC|
00001130  20 5c 20 70 72 65 70 61  72 65 20 66 6f 72 20 73  | \ prepare for s|
00001140  75 62 74 72 61 63 74 69  6f 6e 0d 06 f4 22 53 42  |ubtraction..."SB|
00001150  43 20 77 69 64 74 68 2c  59 20 5c 20 73 75 62 74  |C width,Y \ subt|
00001160  72 61 63 74 20 64 69 76  69 73 6f 72 0d 06 fe 2b  |ract divisor...+|
00001170  42 43 43 20 64 6f 6e 65  20 5c 20 62 72 61 6e 63  |BCC done \ branc|
00001180  68 20 69 66 20 64 69 76  69 64 65 6e 64 20 3c 20  |h if dividend < |
00001190  64 69 76 69 73 6f 72 0d  07 08 23 49 4e 43 20 79  |divisor...#INC y|
000011a0  63 6f 6f 72 64 20 5c 20  69 6e 63 72 65 6d 65 6e  |coord \ incremen|
000011b0  74 20 71 75 6f 74 69 65  6e 74 0d 07 12 2a 53 54  |t quotient...*ST|
000011c0  41 20 78 63 6f 6f 72 64  20 5c 20 73 61 76 65 20  |A xcoord \ save |
000011d0  6e 65 77 20 70 61 72 74  69 61 6c 20 64 69 76 69  |new partial divi|
000011e0  64 65 6e 64 0d 07 1c 09  2e 64 6f 6e 65 0d 07 26  |dend.....done..&|
000011f0  1f 44 45 58 20 5c 20 64  65 63 72 65 6d 65 6e 74  |.DEX \ decrement|
00001200  20 62 69 74 20 63 6f 75  6e 74 65 72 0d 07 30 21  | bit counter..0!|
00001210  42 4e 45 20 6e 65 78 74  20 5c 20 62 72 61 6e 63  |BNE next \ branc|
00001220  68 20 66 6f 72 20 31 36  20 62 69 74 73 0d 07 3a  |h for 16 bits..:|
00001230  23 4c 44 41 20 73 63 61  6c 65 2c 59 20 5c 20 73  |#LDA scale,Y \ s|
00001240  63 72 65 65 6e 20 6d 6f  64 65 20 73 63 61 6c 65  |creen mode scale|
00001250  0d 07 44 31 42 45 51 20  70 75 6c 6c 6f 75 74 20  |..D1BEQ pullout |
00001260  5c 20 62 72 61 6e 63 68  20 69 66 20 6d 6f 64 65  |\ branch if mode|
00001270  73 20 30 2c 20 33 2c 20  34 2c 20 36 20 6f 72 20  |s 0, 3, 4, 6 or |
00001280  37 0d 07 4e 2e 54 41 58  20 5c 20 69 6e 20 6d 6f  |7..N.TAX \ in mo|
00001290  64 65 31 20 61 6e 64 20  6d 6f 64 65 35 20 58 3d  |de1 and mode5 X=|
000012a0  31 2c 20 69 6e 20 6d 6f  64 65 32 20 58 3d 32 0d  |1, in mode2 X=2.|
000012b0  07 58 0e 4c 44 41 20 78  63 6f 6f 72 64 0d 07 62  |.X.LDA xcoord..b|
000012c0  0b 2e 72 65 64 75 63 65  0d 07 6c 23 4c 53 52 20  |..reduce..l#LSR |
000012d0  41 20 5c 20 68 6f 72 69  7a 6f 6e 74 61 6c 20 70  |A \ horizontal p|
000012e0  6f 73 69 74 69 6f 6e 20  2f 20 32 0d 07 76 07 44  |osition / 2..v.D|
000012f0  45 58 0d 07 80 0e 42 4e  45 20 72 65 64 75 63 65  |EX....BNE reduce|
00001300  0d 07 8a 0e 53 54 41 20  78 63 6f 6f 72 64 0d 07  |....STA xcoord..|
00001310  94 0c 2e 70 75 6c 6c 6f  75 74 0d 07 9e 1e 50 4c  |...pullout....PL|
00001320  41 20 5c 20 70 75 6c 6c  20 64 61 74 61 20 72 65  |A \ pull data re|
00001330  67 69 73 74 65 72 20 42  0d 07 a8 16 80 20 23 26  |gister B..... #&|
00001340  32 30 20 5c 20 25 30 30  31 30 30 30 30 30 0d 07  |20 \ %00100000..|
00001350  b2 27 53 54 41 20 66 69  72 65 20 5c 20 73 74 6f  |.'STA fire \ sto|
00001360  72 65 20 66 69 72 65 20  62 75 74 74 6f 6e 20 73  |re fire button s|
00001370  74 61 74 75 73 0d 07 bc  07 50 4c 41 0d 07 c6 07  |tatus....PLA....|
00001380  54 41 59 0d 07 d0 07 50  4c 41 0d 07 da 07 54 41  |TAY....PLA....TA|
00001390  58 0d 07 e4 07 50 4c 41  0d 07 ee 0b 53 54 41 20  |X....PLA....STA |
000013a0  26 46 43 0d 07 f8 1f 52  54 49 20 5c 20 72 65 74  |&FC....RTI \ ret|
000013b0  75 72 6e 20 66 72 6f 6d  20 69 6e 74 65 72 72 75  |urn from interru|
000013c0  70 74 0d 08 02 0d 2e 6f  6c 64 69 72 71 32 76 0d  |pt.....oldirq2v.|
000013d0  08 0c 23 45 51 55 57 20  26 30 30 20 5c 20 6f 72  |..#EQUW &00 \ or|
000013e0  69 67 69 6e 61 6c 20 69  72 71 32 20 76 65 63 74  |iginal irq2 vect|
000013f0  6f 72 0d 08 16 0e 2e 6f  66 66 73 65 74 6c 6f 77  |or.....offsetlow|
00001400  0d 08 20 25 45 51 55 42  20 26 30 34 20 5c 20 6d  |.. %EQUB &04 \ m|
00001410  6f 64 65 30 2c 20 75 6e  74 72 69 6d 6d 65 64 20  |ode0, untrimmed |
00001420  3d 20 26 30 36 0d 08 2a  25 45 51 55 42 20 26 30  |= &06..*%EQUB &0|
00001430  34 20 5c 20 6d 6f 64 65  31 2c 20 75 6e 74 72 69  |4 \ mode1, untri|
00001440  6d 6d 65 64 20 3d 20 26  30 36 0d 08 34 25 45 51  |mmed = &06..4%EQ|
00001450  55 42 20 26 30 34 20 5c  20 6d 6f 64 65 32 2c 20  |UB &04 \ mode2, |
00001460  75 6e 74 72 69 6d 6d 65  64 20 3d 20 26 30 36 0d  |untrimmed = &06.|
00001470  08 3e 25 45 51 55 42 20  26 30 34 20 5c 20 6d 6f  |.>%EQUB &04 \ mo|
00001480  64 65 33 2c 20 75 6e 74  72 69 6d 6d 65 64 20 3d  |de3, untrimmed =|
00001490  20 26 30 36 0d 08 48 25  45 51 55 42 20 26 30 33  | &06..H%EQUB &03|
000014a0  20 5c 20 6d 6f 64 65 34  2c 20 75 6e 74 72 69 6d  | \ mode4, untrim|
000014b0  6d 65 64 20 3d 20 26 30  34 0d 08 52 25 45 51 55  |med = &04..R%EQU|
000014c0  42 20 26 30 33 20 5c 20  6d 6f 64 65 35 2c 20 75  |B &03 \ mode5, u|
000014d0  6e 74 72 69 6d 6d 65 64  20 3d 20 26 30 34 0d 08  |ntrimmed = &04..|
000014e0  5c 25 45 51 55 42 20 26  30 33 20 5c 20 6d 6f 64  |\%EQUB &03 \ mod|
000014f0  65 36 2c 20 75 6e 74 72  69 6d 6d 65 64 20 3d 20  |e6, untrimmed = |
00001500  26 30 34 0d 08 66 25 45  51 55 42 20 26 30 36 20  |&04..f%EQUB &06 |
00001510  5c 20 6d 6f 64 65 37 2c  20 75 6e 74 72 69 6d 6d  |\ mode7, untrimm|
00001520  65 64 20 3d 20 26 30 38  0d 08 70 0f 2e 6f 66 66  |ed = &08..p..off|
00001530  73 65 74 68 69 67 68 0d  08 7a 1e 45 51 55 44 20  |sethigh..z.EQUD |
00001540  26 30 38 30 36 30 36 30  36 20 5c 20 6d 6f 64 65  |&08060606 \ mode|
00001550  73 20 33 2d 30 0d 08 84  1e 45 51 55 44 20 26 32  |s 3-0....EQUD &2|
00001560  38 30 43 30 42 30 42 20  5c 20 6d 6f 64 65 73 20  |80C0B0B \ modes |
00001570  37 2d 34 0d 08 8e 0a 2e  73 63 61 6c 65 0d 08 98  |7-4.....scale...|
00001580  1e 45 51 55 44 20 26 30  30 30 32 30 31 30 30 20  |.EQUD &00020100 |
00001590  5c 20 6d 6f 64 65 73 20  33 2d 30 0d 08 a2 1e 45  |\ modes 3-0....E|
000015a0  51 55 44 20 26 30 30 30  30 30 31 30 30 20 5c 20  |QUD &00000100 \ |
000015b0  6d 6f 64 65 73 20 37 2d  34 0d 08 ac 0a 2e 77 69  |modes 7-4.....wi|
000015c0  64 74 68 0d 08 b6 1e 45  51 55 44 20 26 35 30 35  |dth....EQUD &505|
000015d0  30 35 30 35 30 20 5c 20  6d 6f 64 65 73 20 33 2d  |05050 \ modes 3-|
000015e0  30 0d 08 c0 1e 45 51 55  44 20 26 32 38 32 38 32  |0....EQUD &28282|
000015f0  38 32 38 20 5c 20 6d 6f  64 65 73 20 37 2d 34 0d  |828 \ modes 7-4.|
00001600  08 ca 0d 2e 6c 61 73 74  62 79 74 65 0d 08 d4 05  |....lastbyte....|
00001610  5d 0d 08 de 05 ed 0d 08  e8 0b d6 20 6d 63 6f 64  |].......... mcod|
00001620  65 0d 08 f2 05 e1 0d 08  fc 05 3a 0d 09 06 0c dd  |e.........:.....|
00001630  a4 73 77 69 74 63 68 0d  09 10 18 e7 20 28 96 28  |.switch..... (.(|
00001640  30 29 80 33 29 3d 30 20  3d b9 20 8b 20 3d a3 0d  |0).3)=0 =. . =..|
00001650  ff                                                |.|
00001651
27-01-89/IOinter.m0
27-01-89/IOinter.m1
27-01-89/IOinter.m2
27-01-89/IOinter.m4
27-01-89/IOinter.m5