Home » Personal collection » Commodore disks » disk44a_mandelbrot.d64 » mandelcode16
mandelcode16
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 » Personal collection » Commodore disks » disk44a_mandelbrot.d64 |
Filename: | mandelcode16 |
Read OK: | ✔ |
File size: | 4D08 bytes |
Load address: | 0801 |
Exec address: | 0000 |
File contents
10 ;MANDELPLOT 20 ;SOURCE CODE 30 ;22/10/95 40 ; 100 *=$0E00 105 ; VARIABLES 110 XPIXEL=$4103 120 YPIXEL=$4104 130 COLOUR=$4105 140 YPIB=$4106 150 MAXCOL=$4107 160 XP=$4108 170 YP=$4109 180 XPB=$410A 190 CLICK=$410B 200 HOUR=$410C 210 XPIB=$410D 220 XPBIB=$410E 280 ; ROM ROUTINES 290 OUTDO =$AB47 291 SCNCLRLFS=$FFBA 292 SCNCLRNAM=$FFBD 293 SSHAPEROM=$FFD8 300 ; SPRITE DATA 305 ; 310 TXT 224,000,000,176,000,000,152,000 320 TXT 000,140,000,000,134,000,000,131 330 TXT 000,000,129,128,000,128,192,000 340 TXT 128,064,000,147,192,000,185,000 350 TXT 000,233,000,000,009,128,000,012 360 TXT 128,000,004,128,000,004,128,000 370 TXT 007,128,000,000,000,000,000,000 380 TXT 000,000,000,000,000,000,000,153 385 ; 390 TXT 000,000,000,064,000,000,096,000 400 TXT 000,112,000,000,120,000,000,124 410 TXT 000,000,126,000,000,127,000,000 420 TXT 127,128,000,108,000,000,070,000 430 TXT 000,006,000,000,006,000,000,003 440 TXT 000,000,003,000,000,003,000,000 450 TXT 000,000,000,000,000,000,000,000 460 TXT 000,000,000,000,000,000,000,153 465 ; 470 TXT 255,192,000,129,064,000,128,064 480 TXT 000,129,064,000,066,128,000,064 490 TXT 128,000,051,000,000,012,000,000 500 TXT 055,000,000,065,128,000,066,128 510 TXT 000,129,064,000,130,192,000,133 520 TXT 064,000,255,192,000,000,000,000 530 TXT 000,000,000,000,000,000,000,000 540 TXT 000,000,000,000,000,000,000,197 545 ; 550 TXT 255,192,000,255,192,000,255,192 560 TXT 000,255,192,000,127,128,000,127 570 TXT 128,000,063,000,000,012,000,000 580 TXT 063,000,000,127,128,000,127,128 590 TXT 000,255,192,000,255,192,000,255 600 TXT 192,000,255,192,000,000,000,000 610 TXT 000,000,000,000,000,000,000,000 620 TXT 000,000,000,000,000,000,000,197 625 ; 630 TXT 168,000,000,000,000,000,128,000 640 TXT 000,000,000,000,128,000,000,000 650 TXT 000,000,000,000,000,000,000,000 660 TXT 000,000,000,000,000,000,000,000 670 TXT 000,000,000,000,000,000,000,000 680 TXT 000,000,000,000,000,000,000,000 690 TXT 000,000,000,000,000,000,000,000 700 TXT 000,000,000,000,000,000,000,197 705 ; 710 TXT 000,000,021,000,000,000,000,000 720 TXT 001,000,000,000,000,000,001,000 730 TXT 000,000,000,000,000,000,000,000 740 TXT 000,000,000,000,000,000,000,000 750 TXT 000,000,000,000,000,000,000,000 760 TXT 000,000,000,000,000,000,000,000 770 TXT 000,000,000,000,000,000,000,000 780 TXT 000,000,000,000,000,000,000,000 785 ; 790 TXT 000,000,000,000,000,000,000,000 800 TXT 000,000,000,000,000,000,000,000 810 TXT 000,000,000,000,000,000,000,000 820 TXT 000,000,000,000,000,000,000,000 830 TXT 000,000,000,000,000,000,000,000 840 TXT 000,000,000,000,000,000,000,000 850 TXT 128,000,000,000,000,000,128,000 860 TXT 000,000,000,000,168,000,000,000 865 ; 870 TXT 000,000,000,000,000,000,000,000 880 TXT 000,000,000,000,000,000,000,000 890 TXT 000,000,000,000,000,000,000,000 900 TXT 000,000,000,000,000,000,000,000 910 TXT 000,000,000,000,000,000,000,000 920 TXT 000,000,000,000,000,000,000,000 930 TXT 000,000,001,000,000,000,000,000 940 TXT 001,000,000,000,000,000,021,000 945 ; 10000 ; MAIN CONTROL ROUTINES 10010 JSR INIT 10020 COMEBACK JSR HIRESON 10030 CONTROLOP LDA CLICK 10040 BNE CONTROLOP 10050 CONTLOPB LDA CLICK 10060 BEQ CONTLOPB 10070 LDA XP 10080 CMP #$58 10090 BCC CONTCONT 10100 JMP BOX 10110 CONTCONT LDA YP 10120 SEC 10130 SBC #$5A 10140 LSR A 10150 LSR A 10160 AND #$FE 10170 TAX 10180 LDA VECTORS,X 10190 STA $FB 10200 INX 10210 LDA VECTORS,X 10220 STA $FC 10230 JMP ($00FB) 10240 VECTORS TXT <ZOOMOUT,>ZOOMOUT,<CONTROLOP,>CONTROLOP,<ZOOMIN,>ZOOMIN 10250 TXT <CONTROLOP,>CONTROLOP,<POSITION,>POSITION,<CONTROLOP,>CONTROLOP 10260 TXT <CONTROLOP,>CONTROLOP,<COLS,>COLS,<CONTROLOP,>CONTROLOP 10270 TXT <COLCYCLE,>COLCYCLE,<CONTROLOP,>CONTROLOP,<MANDPLOT,>MANDPLOT 10280 TXT <CONTROLOP,>CONTROLOP,<CONTROLOP,>CONTROLOP,<EXIT,>EXIT 10290 TXT <CONTROLOP,>CONTROLOP,<BOX,>BOX,<CONTROLOP,>CONTROLOP,<SSHAPE,>SSHAPE 10300 TXT <CONTROLOP,>CONTROLOP,<CONTROLOP,>CONTROLOP,<CONTROLOP,>CONTROLOP 10500 EXIT JSR HIRESOFF 10510 LDA #$93 10520 JSR OUTDO 10530 LDA #$05 10540 JSR OUTDO 10550 RTS 12000 ; WIMP ROUTINES 12020 ; WIMP - MOUSE 12030 IRQ LDA #$00 12040 STA CLICK 12050 LDA $C5 12060 CMP #$01 12070 BNE CONCHECK 12080 STA CLICK 12090 CONCHECK CMP #$0C 12100 BEQ LEFTK 12110 LKC CMP #$17 12120 BEQ RIGHTK 12130 RKC CMP #$32 12140 BEQ UPK 12150 UPKC CMP #$37 12160 BEQ DOWNK 12170 DKC LDA $DC00 12190 AND #$01 12200 BEQ UPJ 12210 UJC LDA $DC00 12220 AND #$02 12230 BEQ DOWNJ 12240 DJC LDA $DC00 12250 AND #$04 12260 BEQ LEFTJ 12270 LJC LDA $DC00 12280 AND #$08 12290 BEQ RIGHTJ 12300 RJC LDA $DC00 12310 AND #$10 12320 EOR #$10 12330 BEQ CJCH 12340 STA CLICK 12350 CJCH JMP BOXFLASH 12360 LEFTK JSR LEFT 12370 JMP LKC 12380 RIGHTK JSR RIGHT 12390 JMP RKC 12400 UPK JSR UP 12410 JMP UPKC 12420 DOWNK JSR DOWN 12430 JMP DKC 12440 UPJ JSR UP 12450 JMP UJC 12460 DOWNJ JSR DOWN 12470 JMP DJC 12480 LEFTJ JSR LEFT 12490 JMP LJC 12500 RIGHTJ JSR RIGHT 12510 JMP RJC 12520 LEFT DEC XP 12530 LDA XP 12540 CMP #$FF 12550 BNE NOTFF 12560 LDY #$00 12570 STY XPB 12580 NOTFF LDY XPB 12590 BNE FIN 12600 CMP #$18 12610 BNE FIN 12620 INC XP 12630 FIN JMP CONTROL 12640 RIGHT INC XP 12650 LDA XP 12660 BNE NOT00 12670 LDY #$01 12680 STY XPB 12690 NOT00 LDY XPB 12700 BEQ FIN 12710 CMP #$58 12720 BNE FIN 12730 DEC XP 12740 JMP CONTROL 12750 UP DEC YP 12760 LDA YP 12770 CMP #$32 12780 BNE FIN 12790 INC YP 12800 JMP CONTROL 12810 DOWN INC YP 12820 LDA YP 12830 CMP #$F8 12840 BNE FIN 12850 DEC YP 12860 JMP CONTROL 12870 ; WIMP - POINTER 12880 CONTROL LDA HOUR 12890 BEQ NHGLASS 13210 LDX #$3A 13220 STX $07F8 13230 INX 13240 STX $07F9 13250 NHGLASS LDA XP 13260 STA $D000 13270 STA $D002 13280 LDA YP 13290 STA $D001 13300 STA $D003 13310 LDA $D010 13320 AND #$FC 13330 LSR A 13340 CLC 13350 ADC XPB 13360 ASL A 13370 CLC 13380 ADC XPB 13390 STA $D010 13400 LDA #$00 13410 STA $D027 13420 LDA #$01 13430 STA $D028 13440 LDA $D015 13450 ORA #$03 13460 STA $D015 13470 LDA HOUR 13480 BNE QTRO 13490 LDX #$38 13500 STX $07F8 13510 INX 13520 STX $07F9 13530 QTRO RTS 13540 ; STARTUP ROUTINES 13550 INIT LDA #$00 13560 STA $D020 13570 STA $D021 13580 STA XP 13590 STA HOUR 13600 STA $D015 13610 LDA #$01 13620 STA XPB 13630 LDA #$80 13640 STA YP 13650 HIRESON LDA #$3B 13660 STA $D011 13670 LDA #$D8 13680 STA $D016 13690 LDA #$00 13700 STA $FB 13710 TAY 13720 LDA #$04 13730 STA $FC 13740 LDA #$7E 13750 FLOP STA ($FB),Y 13760 INY 13770 BEQ FLOPINC 13780 CPY #$F8 13790 BNE FLOP 13800 LDX $FC 13810 CPX #$07 13820 BNE FLOP 13830 JSR LEFT 13840 SEI 13850 LDA #<IRQ 13860 STA $0314 13870 LDA #>IRQ 13880 STA $0315 13890 CLI 13900 LDA #$D8 13910 STA $FC 13920 LDA #$02 13930 LDY #$00 13940 FLOPB STA ($FB),Y 13950 INY 13960 BNE FLOPB 13970 INC $FC 13980 LDX $FC 13990 CPX #$DC 14000 BNE FLOPB 14010 LDA #$18 14020 STA $D018 14900 RTS 14910 FLOPINC INC $FC 14920 JMP FLOP 14930 HIRESOFF SEI 14940 LDA #$31 14950 STA $0314 14960 LDA #$EA 14970 STA $0315 14980 CLI 14990 LDA #$00 15000 STA $D015 15010 LDA #$9B 15020 STA $D011 15030 LDA #$C8 15040 STA $D016 15043 LDA #$15 15046 STA $D018 15050 RTS 20000 BOX JSR HIRESOFF 20010 LDA #$1C 20020 JSR OUTDO 20030 LDA #$93 20040 JSR OUTDO 20050 LDA #$00 20060 BOXLOOP PHA 20070 ASL A 20080 ASL A 20090 CLC 20100 ADC #$42 20110 STA $FC 20120 LDY #$00 20130 STY $FB 20140 STY $FD 20150 LDA #$04 20160 STA $FE 20170 BOXLOOPB LDA ($FB),Y 20180 STA ($FD),Y 20190 INY 20200 BNE BOXLOOPB 20210 INC $FC 20220 INC $FE 20230 LDA $FE 20240 CMP #$08 20250 BNE BOXLOOPB 20260 BOXAUTO LDA $C5 20270 CMP #$40 20280 BNE BOXAUTO 20290 BOXAUTOB LDA $C5 20300 CMP #$40 20310 BEQ BOXAUTOB 20320 TAX 20330 PLA 20340 CPX #$01 20350 BEQ HNOMORE 20360 CPX #$28 20370 BEQ NEXT 20380 CPX #$2B 20390 BEQ PREV 20400 BOXRET PHA 20410 JMP BOXAUTOB 20420 HNOMORE JMP COMEBACK 20430 NEXT CMP #$04 20440 BEQ BOXRET 20450 CLC 20460 ADC #$01 20470 JMP BOXLOOP 20480 PREV CMP #$00 20490 BEQ BOXRET 20500 SEC 20510 SBC #$01 20520 JMP BOXLOOP 25000 ; SAVE ROUTINES 25010 FNAME TXT 147,5 25020 TXT "FILENAME:",0 25030 TORD TXT 13,13,"(T)APE OR (D)ISK",0 25040 POST TXT 13,13,"POSITION TAPE <SPACE>",13,0 25050 INSD TXT 13,13,"INSERT DISK <SPACE>",13,0 25060 PSTRING LDY #$00 25070 PSTRLOP LDA ($FB),Y 25080 BEQ PSTRQUIT 25090 JSR OUTDO 25095 INY 25100 JMP PSTRLOP 25110 PSTRQUIT RTS 25120 ONOFF LDA $040A,Y 25130 EOR #$80 25140 STA $040A,Y 25150 RTS 25160 GETAUTO LDA $C5 25170 CMP #$40 25180 BNE GETAUTO 25190 GETAUTOB LDA $C5 25200 CMP #$40 25210 BEQ GETAUTOB 25220 TAX 25230 LDA AUTOINSTR,X 25240 BEQ GETAUTO 25250 RTS 25260 SSHAPE JSR HIRESOFF 25270 LDX #$00 25280 LDA #$20 25290 FNAMECLR STA $41F0,X 25300 INX 25310 CPX #$10 25320 BNE FNAMECLR 25330 LDA #<FNAME 25340 STA $FB 25350 LDA #>FNAME 25360 STA $FC 25370 JSR PSTRING 25380 LDA #$00 25390 PHA 25400 SSHAPELOOP TAY 25405 JSR ONOFF 25410 JSR GETAUTO 25415 PHA 25420 JSR ONOFF 25425 PLA 25430 CMP #$80 25440 BCS DECODE 25450 TAY 25460 PLA 25470 TAX 25480 TYA 25490 STA $040A,X 25500 CMP #$20 25510 BCS NOSPC 25520 CLC 25530 ADC #$40 25540 NOSPC STA $41F0,X 25550 INCPOS CPX #$0F 25560 BEQ SSHAPERELOP 25570 INX 25580 SSHAPERELOP TXA 25585 PHA 25590 JMP SSHAPELOOP 25600 DECODE CMP #$80 25610 BEQ SSHAPECONT 25620 CMP #$81 25630 BEQ DEC 25640 CMP #$82 25650 BNE SSHAPELOOP 25660 PLA 25670 TAX 25680 LDA $0283 25690 AND #$01 25700 BEQ INCPOS 25710 DECPOS CPX #$00 25720 BEQ SSHAPERELOP 25730 DEX 25740 JMP SSHAPERELOP 25750 DEC PLA 25760 TAX 25770 LDA #$20 25780 STA $040A,X 25790 STA $41F0,X 25800 JMP DECPOS 25810 SSHAPECONT PLA 25815 LDA #<TORD 25820 STA $FB 25830 LDA #>TORD 25840 STA $FC 25850 JSR PSTRING 25860 GSHAPE JSR GETAUTO 25870 CMP #$14 25880 BEQ TAPESSHAPE 25890 CMP #$04 25900 BEQ DISKSSHAPE 25910 JMP GSHAPE 25920 TAPESSHAPE LDA #<POST 25930 STA $FB 25940 LDA #>POST 25950 STA $FC 25960 JSR PSTRING 25970 LDX #$01 25980 JMP TAPECONT 25990 DISKSSHAPE LDA #<INSD 26000 STA $FB 26010 LDA #>INSD 26020 STA $FC 26030 JSR PSTRING 26040 LDX #$08 26050 TAPECONT LDA $C5 26060 CMP #$3C 26070 BNE TAPECONT 26080 LDA #$01 26090 TAY 26100 JSR SCNCLRLFS 26110 LDX #$0F 26120 FNAMELEN LDA $41F0,X 26130 CMP #$20 26140 BNE FNAMEGOT 26150 DEX 26160 BEQ FNAMEGOT 26170 JMP FNAMELEN 26180 FNAMEGOT TXA 26200 LDX #$F0 26210 LDY #$41 26220 JSR SCNCLRNAM 26230 LDA #$20 26240 STA $FC 26250 LDX #$00 26260 STA $FB 26270 LDY #$40 26280 LDA #$FB 26290 JSR SSHAPEROM 26300 JMP COMEBACK 27000 ; KEYBOARD DECODE TABLE 27010 ; 27020 AUTOINSTR TXT $81,$80,$82 27030 TXT 0,0,0,0,$83,51,23,1,52,26 27040 TXT 19,5,0,53,18,4,54,3,6,20,24 27050 TXT 55,25,7,56,2,8,21,22,57,9,10 27060 TXT 48,13,11,15,14,43,16,12,45,46 27070 TXT 0,0,44,0,0,0,0,0,0,30,47,49 27080 TXT 31,0,50,32,0,17,0,0 30000 ; MANDLEBROT SET PLOTTER 30010 MANDLE SEI 30015 LDA #$00 30020 STA YPIXEL 30030 LDA #$03 30040 STA $4100 30050 LDA #$06 30060 STA $4102 30070 JSR EQUAL 30080 MMAINL LDA #$00 30090 STA XPIXEL 30100 LDA #$01 30110 STA $4100 30120 LDA #$05 30130 STA $4102 30140 JSR EQUAL 30150 MMAINLB LDA #$05 30160 STA $4100 30170 LDA #$07 30180 STA $4102 30190 JSR EQUAL 30200 INC $4100 30210 INC $4102 30220 JSR EQUAL 30230 LDA #$00 30240 STA COLOUR 30250 LOOP LDA #$07 30260 STA $4100 30270 STA $4101 30280 LDA #$10 30290 STA $4102 30300 JSR MULTIPLY 30310 LDA #$08 30320 STA $4100 30330 STA $4101 30340 LDA #$11 30350 STA $4102 30360 JSR MULTIPLY 30370 LDX #$10 30380 STX $4100 30390 INX 30400 STX $4101 30410 INX 30420 STX $4102 30430 JSR ADDITION 30440 LDA $4091 30450 CMP #$04 30460 BCC FAIL 30470 CMP #$50 30480 BCS FAIL 30490 SUCPASS JMP SUCCESS 30500 FAIL INC COLOUR 30505 LDA COLOUR 30510 CMP MAXCOL 30520 BEQ SUCPASS 30530 JSR SUBTRACT 30540 LDA #$12 30550 STA $4100 30560 LDA #$05 30570 STA $4101 30580 LDA #$13 30590 STA $4102 30600 JSR ADDITION 30610 LDA #$07 30620 STA $4100 30630 LDA #$08 30640 STA $4101 30650 INC $4102 30660 JSR MULTIPLY 30670 LDA #$14 30680 STA $4100 30690 LDA #$1C 30700 STA $4101 30710 LDA #$15 30720 STA $4102 30730 JSR MULTIPLY 30740 LDA #$15 30750 STA $4100 30760 LDA #$06 30770 STA $4101 30780 LDA #$16 30790 STA $4102 30800 JSR ADDITION 30810 LDA #$13 30820 STA $4100 30830 LDA #$07 30840 STA $4102 30850 JSR EQUAL 30860 LDA #$16 30870 STA $4100 30880 LDA #$08 30890 STA $4102 30900 JSR EQUAL 30910 JMP LOOP 30920 SUCCESS JSR PLOT 30930 LDA #$05 30940 STA $4100 30950 STA $4102 30960 LDA #$02 30970 STA $4101 30980 JSR ADDITION 30990 LDA XPIXEL 31000 BNE XRELOP 31010 LDA #$06 31020 STA $4100 31030 STA $4102 31040 LDA #$04 31050 STA $4101 31060 JSR ADDITION 31070 INC YPIXEL 31080 LDA YPIXEL 31090 CMP #$C8 31100 BNE YRELOP 31105 CLI 31110 RTS 31120 XRELOP JMP MMAINLB 31130 YRELOP JMP MMAINL 31200 MANDPLOT JSR MANDLE 31210 JMP CONTROLOP 40000 ; ARITHMETIC ROUTINES 40010 GETDIGIT CLD 40020 ASL A 40030 ASL A 40040 ASL A 40050 STA $02 40060 TXA 40070 LSR A 40080 STA $24 40090 LDA #$07 40100 SEC 40110 SBC $24 40120 CLC 40130 ADC $02 40140 TAY 40150 LDA $4000,Y 40160 TAY 40170 TXA 40180 AND #$01 40190 BEQ LSNGD 40200 TYA 40210 AND #$F0 40220 LSR A 40230 LSR A 40240 LSR A 40250 LSR A 40260 RTS 40270 LSNGD TYA 40280 AND #$0F 40290 RTS 40300 MULTIPLYB JSR NEGATIVE 40305 LDA $4102 40310 ASL A 40320 ASL A 40330 ASL A 40340 TAX 40350 LDA #$00 40360 TAY 40370 MLOPA STA $4000,X 40380 INY 40390 INX 40400 CPY #$08 40410 BNE MLOPA 40420 LDA #$06 40430 STA $FC 40440 NEWDIGIT LDA $4101 40450 LDX $FC 40460 JSR GETDIGIT 40470 CMP #$00 40480 BEQ DMOVER 40490 STA $FD 40500 LDA #$06 40510 STA $FB 40520 DMLOP LDA $4100 40530 LDX $FB 40540 JSR GETDIGIT 40550 CMP #$00 40560 BEQ DMOVER 40570 STA $FE 40580 LDA $FB 40590 CLC 40600 ADC $FC 40610 SEC 40620 SBC #$0C 40630 LDX $FD 40640 TAY 40650 AND #$01 40660 BEQ MSKIP 40670 TXA 40680 ASL A 40690 ASL A 40700 ASL A 40710 ASL A 40720 TAX 40730 MSKIP TYA 40740 LSR A 40750 STA $02 40760 LDA #$07 40770 SEC 40780 SBC $02 40790 STA $02 40800 LDA $4102 40810 ASL A 40820 ASL A 40830 ASL A 40840 ADC $02 40845 STA $25 40850 TAY 40860 STX $24 40870 DMLB LDX $02 40880 SED 40890 LDA $4000,Y 40900 CLC 40910 ADC $24 40920 STA $4000,Y 40930 MALP CLD 40940 BCC MAQUIT 40950 DEY 40960 DEX 40970 CPX #$FF 40980 BEQ MAQUIT 40990 SED 41000 LDA $4000,Y 41010 CLC 41020 ADC #$01 41030 STA $4000,Y 41040 JMP MALP 41050 DMOVER INC $FB 41060 LDA $FB 41070 CMP #$0E 41080 BCC DMLOP 41090 INC $FC 41100 LDA $FC 41110 CMP #$0E 41120 BCC NEWDIGIT 41130 LDA YPIB 41140 BEQ QUIT 41150 LDA $4102 41160 STA $4101 41170 LDA #$1D 41180 STA $4100 41190 JSR SUBTRACT 41200 QUIT RTS 41210 MAQUIT LDX $FE 41220 DEX 41223 BEQ DMOVER 41226 STX $FE 41230 LDY $25 41240 JMP DMLB 41250 MSUP LDA $4100 41260 ASL A 41270 ASL A 41280 ASL A 41290 TAX 41300 DEX 41310 STX $FB 41320 LDA $4101 41330 ASL A 41340 ASL A 41350 ASL A 41360 TAX 41370 DEX 41380 STX $FD 41390 LDA $4102 41400 ASL A 41410 ASL A 41420 ASL A 41430 TAX 41440 DEX 41450 STX $22 41460 LDA #$40 41470 STA $FC 41480 STA $FE 41490 STA $23 41500 RTS 41510 EQUAL JSR MSUP 41520 LDY #$08 41530 ELOP LDA ($FB),Y 41540 STA ($22),Y 41550 DEY 41560 BNE ELOP 41570 RTS 41580 ADDITION JSR MSUP 41590 LDY #$08 41600 SED 41610 CLC 41620 ADLOP LDA ($FB),Y 41630 ADC ($FD),Y 41640 STA ($22),Y 41650 DEY 41660 BNE ADLOP 41670 CLD 41680 RTS 41690 SUBTRACT JSR MSUP 41700 LDY #$08 41710 SED 41720 SEC 41730 SULOP LDA ($FB),Y 41740 SBC ($FD),Y 41750 STA ($22),Y 41760 DEY 41770 BNE SULOP 41780 CLD 41790 RTS 41800 NEGATIVE LDA #$00 41810 PHA 41820 LDA $4100 41830 TAY 41840 ASL A 41850 ASL A 41860 ASL A 41870 TAX 41880 LDA $4001,X 41890 CMP #$50 41895 BCC NEGRMOVEAB 41900 PLA 41910 ADC #$00 41920 PHA 41930 JMP NEGRMOVEA 41940 NEGRMOVEAB LDA $4101 41950 TAY 41960 ASL A 41970 ASL A 41980 ASL A 41990 TAX 42000 LDA $4001,X 42010 CMP #$50 42020 PLA 42030 BCC NOEOR 42040 EOR #$01 42050 PHA 42060 BCS NEGRMOVEB 42070 NEGRMOVEBB PLA 42080 NOEOR STA YPIB 42090 RTS 42100 NEGRMOVE LDA $4100 42110 PHA 42120 LDA $4101 42130 PHA 42140 LDA $4102 42150 PHA 42160 TYA 42170 STA $4101 42180 STA $4102 42190 LDA #$1D 42200 STA $4100 42210 JSR SUBTRACT 42220 PLA 42230 STA $4102 42240 PLA 42250 STA $4101 42260 PLA 42270 STA $4100 42280 RTS 42290 NEGRMOVEA JSR NEGRMOVE 42300 JMP NEGRMOVEAB 42310 NEGRMOVEB JSR NEGRMOVE 42320 JMP NEGRMOVEBB 42330 MULTIPLY LDA $4102 42340 PHA 42350 LDA $4101 42360 PHA 42370 LDA #$18 42380 STA $4102 42390 JSR EQUAL 42400 INC $4102 42410 PLA 42420 STA $4100 42430 JSR EQUAL 42440 LDA #$18 42450 STA $4100 42460 LDA #$19 42470 STA $4101 42480 PLA 42490 STA $4102 42500 JMP MULTIPLYB 50000 ; GRAPHIC POINT PLOTTER 50010 PLOTPC LDA #$47 50020 STA $FB 50030 LDA #$3F 50040 STA $FC 50050 LDA YPIXEL 50060 LSR A 50070 LSR A 50080 LSR A 50090 STA YPIB 50100 AND #$03 50110 ASL A 50120 ASL A 50130 ASL A 50140 ASL A 50150 ASL A 50160 ASL A 50170 STA $02 50180 LDA $FB 50190 SEC 50200 SBC $02 50210 STA $FB 50220 LDA $FC 50230 SBC #$00 50235 SBC YPIB 50240 PHA 50250 LDA YPIB 50260 LSR A 50270 LSR A 50280 STA $02 50290 PLA 50300 SEC 50310 SBC $02 50320 STA $FC 50330 LDA YPIXEL 50340 AND #$07 50350 STA YPIB 50360 LDA $FB 50370 SEC 50380 SBC YPIB 50390 PHA 50400 LDA XPIXEL 50410 AND #$F8 50420 STA YPIB 50430 PLA 50440 CLC 50450 ADC YPIB 50460 STA $FB 50470 LDA $FC 50480 SBC #$00 50490 STA $FC 50500 LDA XPIXEL 50510 AND #$07 50520 TAX 50530 LDA #$80 50540 GBITLP CPX #$00 50550 BEQ PPCONT 50560 LSR A 50570 DEX 50580 JMP GBITLP 50590 PPCONT STA $FD 50600 RTS 50610 PLOTON JSR PLOTPC 50620 LDY #$00 50630 LDA ($FB),Y 50640 ORA $FD 50650 STA ($FB),Y 50660 RTS 50670 PLOTOFF JSR PLOTPC 50680 LDA $FD 50690 EOR #$FF 50700 STA $FD 50710 LDY #$00 50720 LDA ($FB),Y 50730 AND $FD 50740 STA ($FB),Y 50750 RTS 50760 PLOT LDA COLOUR 50770 AND #$02 50780 BNE PPAON 50790 JSR PLOTOFF 50800 JMP PPACNT 50810 PPAON JSR PLOTON 50820 PPACNT INC XPIXEL 50830 LDA COLOUR 50840 AND #$01 50850 BNE PPBON 50860 JSR PLOTOFF 50870 JMP PPBCNT 50880 PPBON JSR PLOTON 50890 PPBCNT INC XPIXEL 50900 RTS 55000 ; ZOOM CALCULATION ROUTINES 55010 NOZOOM JMP CONTROLOP 55020 ZOOMIN LDA $D015 55030 AND #$F0 55040 CMP #$F0 55050 BNE NOZOOM 55060 LDA #$1E 55070 STA $4100 55080 LDA #$01 55090 STA $4101 55100 LDA #$10 55110 STA $4102 55120 JSR SUBTRACT 55130 LDA #$01 55140 STA $4100 55150 INC $4102 55160 JSR EQUAL 55170 LDA #$10 55180 STA $4100 55190 LDA #$1B 55200 STA $4101 55210 LDA #$12 55220 STA $4102 55230 JSR MULTIPLY 55240 LDA #$11 55250 STA $4100 55260 STA $4102 55270 LDA #$12 55280 STA $4101 55290 LDA $D008 55300 SEC 55310 SBC #$58 55320 CALCINLOPA CMP #$00 55330 BEQ CALCENDIA 55340 PHA 55350 JSR ADDITION 55360 PLA 55370 TAX 55380 DEX 55390 TXA 55400 JMP CALCINLOPA 55410 CALCENDIA LDA #$01 55420 STA $4100 55430 LDA #$13 55440 STA $4102 55450 JSR EQUAL 55460 LDA #$13 55470 STA $4100 55480 STA $4102 55490 LDA #$12 55500 STA $4101 55510 LDA $D00A 55520 SEC 55530 SBC #$40 55540 CALCINLOPB CMP #$00 55550 BEQ CALCENDIB 55560 PHA 55570 JSR ADDITION 55580 PLA 55590 TAX 55600 DEX 55610 TXA 55620 JMP CALCINLOPB 55630 CALCENDIB LDA #$11 55640 STA $4100 55650 LDA #$01 55660 STA $4102 55670 JSR EQUAL 55680 LDA #$13 55690 STA $4100 55700 LDA #$1E 55710 STA $4102 55720 JSR EQUAL 55730 LDA #$1F 55740 STA $4100 55750 LDA #$03 55760 STA $4101 55770 LDA #$10 55780 STA $4102 55790 JSR SUBTRACT 55800 LDA #$03 55810 STA $4100 55820 INC $4102 55830 JSR EQUAL 55840 LDA #$10 55850 STA $4100 55860 LDA #$12 55870 STA $4102 55880 LDA #$1A 55890 STA $4101 55900 JSR MULTIPLY 55910 LDA #$11 55920 STA $4100 55930 STA $4102 55940 LDA #$12 55950 STA $4101 55960 LDA $D009 55970 SEC 55980 SBC #$32 55990 CALCINYA CMP #$00 56000 BEQ CALCENDIC 56010 PHA 56020 JSR ADDITION 56030 PLA 56040 TAX 56050 DEX 56060 TXA 56070 JMP CALCINYA 56080 CALCENDIC LDA #$03 56090 STA $4100 56100 LDA #$13 56110 STA $4102 56120 JSR EQUAL 56130 LDA #$13 56140 STA $4100 56150 STA $4102 56160 LDA #$12 56170 STA $4101 56180 LDA $D00D 56190 SEC 56200 SBC #$1D 56210 CALCINYB CMP #$00 56220 BEQ CALCENDID 56230 PHA 56240 JSR ADDITION 56250 PLA 56260 TAX 56270 DEX 56280 TXA 56290 JMP CALCINYB 56300 CALCENDID LDA #$11 56310 STA $4100 56320 LDA #$03 56330 STA $4102 56340 JSR EQUAL 56350 LDA #$13 56360 STA $4100 56370 LDA #$1F 56380 STA $4102 56390 JSR EQUAL 56400 LDA #$1E 56410 STA $4100 56420 LDA #$01 56430 STA $4101 56440 LDA #$10 56450 STA $4102 56460 JSR SUBTRACT 56470 LDA #$10 56480 STA $4100 56490 LDA #$1B 56500 STA $4101 56510 LDA #$02 56520 STA $4102 56530 JSR MULTIPLY 56540 LDA #$1F 56550 STA $4100 56560 LDA #$03 56570 STA $4101 56580 LDA #$10 56590 STA $4102 56600 JSR SUBTRACT 56610 LDA #$10 56620 STA $4100 56630 LDA #$1A 56640 STA $4101 56650 LDA #$04 56660 STA $4102 56670 JSR MULTIPLY 56680 JSR MANDLE 56690 JMP CONTROLOP 60000 ; ZOOM ROUTINES 60010 BOX LDA XP 60020 STA XPIB 60030 LDA YP 60040 STA YPIB 60050 LDA XPB 60060 STA XPBIB 60070 LDX #$3C 60080 STX $07FC 60090 INX 60100 STX $07FD 60110 INX 60120 STX $07FE 60130 INX 60140 STX $07FF 60150 LDA $D015 60160 ORA #$F0 60170 STA $D015 60180 BOXWAIT LDA CLICK 60190 BNE BOXWAIT 60280 BOXLOOP LDA XPBIB 60290 CMP XPB 60300 BEQ CHECKFINE 60310 BCS LESSTHAN 60320 JMP MORETHAN 60330 CHECKFINE LDA XPIB 60340 CMP XP 60350 BCS LESSTHAN 60360 MORETHAN LDA XPIB 60370 STA $D008 60380 STA $D00C 60390 LDX #$00 60400 LDA XPBIB 60410 BEQ NOXPBADD 60420 LDX #$50 60430 NOXPBADD LDA $D010 60440 AND #$AF 60450 STX $02 60460 CLC 60470 ADC $02 60480 STA $D010 60485 LDX #$00 60490 LDA XP 60500 SEC 60510 SBC #$18 60520 STA $D00A 60530 STA $D00E 60540 BCC MTSUB 60550 LDX XPB 60560 BEQ MTSUB 60570 LDX #$A0 60580 MTSUB LDA $D010 60590 AND #$5F 60600 STX $02 60610 CLC 60620 ADC $02 60630 STA $D010 60640 JMP BOXCONT 60650 LESSTHAN LDA XP 60660 LDX XPB 60670 BNE NOTOUT 60680 CMP #$58 60690 BCS NOTOUT 60700 LDA #$58 60710 NOTOUT STA $D008 60720 STA $D00C 60730 CPX #$00 60740 BEQ LTNOADD 60750 LDX #$50 60760 LTNOADD LDA $D010 60770 AND #$AF 60780 STX $02 60790 CLC 60800 ADC $02 60810 STA $D010 60815 LDX #$00 60820 LDA XPIB 60830 SEC 60840 SBC #$18 60850 STA $D00A 60860 STA $D00E 60870 BCC LTSUB 60880 LDX XPBIB 60890 BEQ LTSUB 60900 LDX #$A0 60910 LTSUB LDA $D010 60920 AND #$5F 60930 STX $02 60940 CLC 60950 ADC $02 60960 STA $D010 60970 BOXCONT LDA YP 60980 CMP YPIB 60990 BCC LESSY 61000 LDA YPIB 61010 STA $D009 61020 STA $D00B 61030 LDA YP 61040 SEC 61050 SBC #$15 61060 STA $D00D 61070 STA $D00F 61080 JMP BOXCONTII 61090 LESSY LDA YP 61100 STA $D009 61110 STA $D00B 61120 LDA YPIB 61130 SEC 61140 SBC #$15 61150 STA $D00D 61160 STA $D00F 61170 BOXCONTII LDA CLICK 61180 BNE BOXEND 61190 JMP BOXLOOP 61200 BOXEND JMP CONTROLOP 62000 BOXFLASH LDA $A2 62010 AND #$3C 62020 LSR A 62030 LSR A 62040 TAX 62050 LDA BOXCOLS,X 62060 STA $D02B 62070 STA $D02C 62080 STA $D02D 62090 STA $D02E 62100 JMP $EA31 62110 BOXCOLS TXT 0,9,2,8,10,7,13,1 62120 TXT 1,13,3,5,14,4,6,0 63000 ; DELETE THESE!! 63010 COLS JMP CONTROLOP 63020 COLCYCLE JMP CONTROLOP 63050 POSITION JMP CONTROLOP 63060 ZOOMOUT JMP CONTROLOP
;MANDELPLOT " ;SOURCE CODE 0 ;22/10/95 6( ; Bd ��$0E00 ji ; VARIABLES {n XPIXEL�$4103 �x YPIXEL�$4104 �� COLOUR�$4105 �� YPIB�$4106 �� MAXCOL�$4107 �� XP�$4108 �� YP�$4109 �� XPB�$410A �� CLICK�$410B � HOUR�$410C � XPIB�$410D # � XPBIB�$410E K ; ROM ROUTINES \ "OUTDO �$AB47 k #�LFS�$FFBA z $�NAM�$FFBD � %�ROM�$FFD8 � ,; SPRITE DATA � 1; � 6TXT 224,000,000,176,000,000,152,000 @TXT 000,140,000,000,134,000,000,131 / JTXT 000,000,129,128,000,128,192,000 W TTXT 128,064,000,147,192,000,185,000 ^TXT 000,233,000,000,009,128,000,012 � hTXT 128,000,004,128,000,004,128,000 � rTXT 007,128,000,000,000,000,000,000 � |TXT 000,000,000,000,000,000,000,153 � �; %�TXT 000,000,000,064,000,000,096,000 M�TXT 000,112,000,000,120,000,000,124 u�TXT 000,000,126,000,000,127,000,000 ��TXT 127,128,000,108,000,000,070,000 ��TXT 000,006,000,000,006,000,000,003 ��TXT 000,000,003,000,000,003,000,000 �TXT 000,000,000,000,000,000,000,000 =�TXT 000,000,000,000,000,000,000,153 C�; k�TXT 255,192,000,129,064,000,128,064 ��TXT 000,129,064,000,066,128,000,064 ��TXT 128,000,051,000,000,012,000,000 ��TXT 055,000,000,065,128,000,066,128 �TXT 000,129,064,000,130,192,000,133 3 TXT 064,000,255,192,000,000,000,000 [ TXT 000,000,000,000,000,000,000,000 � TXT 000,000,000,000,000,000,000,197 � !; � &TXT 255,192,000,255,192,000,255,192 � 0TXT 000,255,192,000,127,128,000,127 :TXT 128,000,063,000,000,012,000,000 )DTXT 063,000,000,127,128,000,127,128 QNTXT 000,255,192,000,255,192,000,255 yXTXT 192,000,255,192,000,000,000,000 �bTXT 000,000,000,000,000,000,000,000 �lTXT 000,000,000,000,000,000,000,197 �q; �vTXT 168,000,000,000,000,000,128,000 �TXT 000,000,000,000,128,000,000,000 G�TXT 000,000,000,000,000,000,000,000 o�TXT 000,000,000,000,000,000,000,000 ��TXT 000,000,000,000,000,000,000,000 ��TXT 000,000,000,000,000,000,000,000 ��TXT 000,000,000,000,000,000,000,000 �TXT 000,000,000,000,000,000,000,197 �; =�TXT 000,000,021,000,000,000,000,000 e�TXT 001,000,000,000,000,000,001,000 ��TXT 000,000,000,000,000,000,000,000 ��TXT 000,000,000,000,000,000,000,000 ��TXT 000,000,000,000,000,000,000,000 �TXT 000,000,000,000,000,000,000,000 -TXT 000,000,000,000,000,000,000,000 UTXT 000,000,000,000,000,000,000,000 [; �TXT 000,000,000,000,000,000,000,000 � TXT 000,000,000,000,000,000,000,000 �*TXT 000,000,000,000,000,000,000,000 �4TXT 000,000,000,000,000,000,000,000 #>TXT 000,000,000,000,000,000,000,000 KHTXT 000,000,000,000,000,000,000,000 sRTXT 128,000,000,000,000,000,128,000 �\TXT 000,000,000,000,168,000,000,000 �a; �fTXT 000,000,000,000,000,000,000,000 �pTXT 000,000,000,000,000,000,000,000 zTXT 000,000,000,000,000,000,000,000 A�TXT 000,000,000,000,000,000,000,000 i�TXT 000,000,000,000,000,000,000,000 ��TXT 000,000,000,000,000,000,000,000 ��TXT 000,000,001,000,000,000,000,000 ��TXT 001,000,000,000,000,000,021,000 ��; '; MAIN �ROL ROUTINES 'JSR INIT /$'COMEBACK JSR HIRES� D.'�ROLOP LDA CLICK S8'BNE �ROLOP gB'�LOPB LDA CLICK uL'BEQ �LOPB �V'LDA XP �`'CMP #$58 �j'BCC �� �t'JMP BOX �~'�� LDA YP ��'SEC ��'SBC #$5A ��'LSR A ��'LSR A ��'� #$FE ��'TAX ��'LDA VEC�RS,X �'STA $FB �'INX $�'LDA VEC�RS,X 0�'STA $FC @�'JMP ($00FB) � (VEC�RS TXT �ZOOMOUT,�ZOOMOUT,��ROLOP,��ROLOP,�ZOOMIN,�ZOOMIN � (TXT ��ROLOP,��ROLOP,��ITI�,��ITI�,��ROLOP,��ROLOP �(TXT ��ROLOP,��ROLOP,�COLS,�COLS,��ROLOP,��ROLOP '(TXT �COLCYCLE,�COLCYCLE,��ROLOP,��ROLOP,�M�PLOT,�M�PLOT [((TXT ��ROLOP,��ROLOP,��ROLOP,��ROLOP,�EXIT,�EXIT �2(TXT ��ROLOP,��ROLOP,��,��,��ROLOP,��ROLOP,��,�� �<(TXT ��ROLOP,��ROLOP,��ROLOP,��ROLOP,��ROLOP,��ROLOP �)EXIT JSR HIRESOFF �)LDA #$93 �)JSR OUTDO ")LDA #$05 ,)JSR OUTDO 6)RTS A�.; WIMP ROUTINES T�.; WIMP - MOUSE e�.IRQ LDA #$00 s/STA CLICK /LDA $C5 �/CMP #$01 �&/BNE C�CHECK �0/STA CLICK �:/C�CHECK CMP #$0C �D/BEQ LEFTK �N/LKC CMP #$17 �X/BEQ RIGHTK �b/RKC CMP #$32 l/BEQ UPK v/UPKC CMP #$37 *�/BEQ DOWNK <�/DKC LDA $DC00 G�/� #$01 S�/BEQ UPJ e�/UJC LDA $DC00 p�/� #$02 ~�/BEQ DOWNJ ��/DJC LDA $DC00 ��/� #$04 ��/BEQ LEFTJ ��/LJC LDA $DC00 ��/� #$08 �0BEQ RIGHTJ �0RJC LDA $DC00 �0� #$10 � 0E� #$10 *0BEQ CJCH 40STA CLICK />0CJCH JMP BOXFLASH BH0LEFTK JSR LEFT NR0JMP LKC c\0RIGHTK JSR RIGHT of0JMP RKC ~p0UPK JSR UP �z0JMP UPKC ��0DOWNK JSR DOWN ��0JMP DKC ��0UPJ JSR UP ��0JMP UJC ��0DOWNJ JSR DOWN ��0JMP DJC ��0LEFTJ JSR LEFT �0JMP LJC �0RIGHTJ JSR RIGHT $�0JMP RJC 4�0LEFT DEC XP ?�0LDA XP L�0CMP #$FF X1BNE �FF e1LDY #$00 q1STY XPB �$1�FF LDY XPB �.1BNE FIN �81CMP #$18 �B1BNE FIN �L1INC XP �V1FIN JMP �ROL �`1RIGHT INC XP �j1LDA XP �t1BNE �00 �~1LDY #$01 �1STY XPB �1�00 LDY XPB �1BEQ FIN ,�1CMP #$58 8�1BNE FIN C�1DEC XP P�1JMP �ROL ^�1UP DEC YP i�1LDA YP v�1CMP #$32 ��1BNE FIN ��1INC YP � 2JMP �ROL � 2DOWN INC YP �2LDA YP �2CMP #$F8 �(2BNE FIN �22DEC YP �<2JMP �ROL �F2; WIMP � PO�ER P2�ROL LDA HOUR Z2BEQ NHGLASS (�3LDX #$3A 6�3STX $07F8 >�3INX L�3STX $07F9 _�3NHGLASS LDA XP m�3STA $D000 {�3STA $D002 ��3LDA YP ��3STA $D001 ��3STA $D003 ��3LDA $D010 �4� #$FC �4LSR A �4CLC �&4ADC XPB �04ASL A �:4CLC �D4ADC XPB N4STA $D010 X4LDA #$00 b4STA $D027 -l4LDA #$01 ;v4STA $D028 I�4LDA $D015 U�4�A #$03 c�4STA $D015 p�4LDA HOUR }�4BNE QTRO ��4LDX #$38 ��4STX $07F8 ��4INX ��4STX $07F9 ��4QTRO RTS ��4; STARTUP ROUTINES ��4INIT LDA #$00 ��4STA $D020 5STA $D021 5STA XP 5STA HOUR & 5STA $D015 3*5LDA #$01 ?45STA XPB L>5LDA #$80 WH5STA YP kR5HIRES� LDA #$3B y\5STA $D011 �f5LDA #$D8 �p5STA $D016 �z5LDA #$00 ��5STA $FB ��5TAY ��5LDA #$04 ��5STA $FC ��5LDA #$7E ��5FLOP STA ($FB),Y ��5INY �5BEQ FLOPINC �5CPY #$F8 "�5BNE FLOP .�5LDX $FC ;�5CPX #$07 H�5BNE FLOP U6JSR LEFT ]6SEI k6LDA #�IRQ y$6STA $0314 �.6LDA #�IRQ �86STA $0315 �B6CLI �L6LDA #$D8 �V6STA $FC �`6LDA #$02 �j6LDY #$00 �t6FLOPB STA ($FB),Y �~6INY ��6BNE FLOPB �6INC $FC �6LDX $FC ! �6CPX #$DC / �6BNE FLOPB < �6LDA #$18 J �6STA $D018 R 4:RTS f >:FLOPINC INC $FC s H:JMP FLOP � R:HIRESOFF SEI � \:LDA #$31 � f:STA $0314 � p:LDA #$EA � z:STA $0315 � �:CLI � �:LDA #$00 � �:STA $D015 � �:LDA #$9B � �:STA $D011 !�:LDA #$C8 !�:STA $D016 !�:LDA #$15 .!�:STA $D018 6!�:RTS I! N� JSR HIRESOFF V!*NLDA #$1C d!4NJSR OUTDO q!>NLDA #$93 !HNJSR OUTDO �!RNLDA #$00 �!\N�LOOP PHA �!fNASL A �!pNASL A �!zNCLC �!�NADC #$42 �!�NSTA $FC �!�NLDY #$00 �!�NSTY $FB �!�NSTY $FD "�NLDA #$04 "�NSTA $FE $"�N�LOOPB LDA ($FB),Y 4"�NSTA ($FD),Y <"�NINY K"�NBNE �LOOPB W"�NINC $FC c"�NINC $FE o"OLDA $FE |"OCMP #$08 �"OBNE �LOOPB �"$O�� LDA $C5 �".OCMP #$40 �"8OBNE �� �"BO��B LDA $C5 �"LOCMP #$40 �"VOBEQ ��B �"`OTAX �"jOPLA �"tOCPX #$01 #~OBEQ HNOM�E #�OCPX #$28 #�OBEQ � +#�OCPX #$2B 8#�OBEQ PREV E#�O�RET PHA Q#�OJMP ��B i#�OHNOM�E JMP COMEBACK x#�O� CMP #$04 �#�OBEQ �RET �#�OCLC �#�OADC #$01 �#�OJMP �LOOP �# PPREV CMP #$00 �# PBEQ �RET �#PSEC �#PSBC #$01 �#(PJMP �LOOP $�a; SAVE ROUTINES #$�a�AME TXT 147,5 9$�aTXT "FILENAME:",0 `$�a�RD TXT 13,13,"(T)APE OR (D)ISK",0 �$�a�T TXT 13,13,"POSITION TAPE <SPACE>",13,0 �$�aINSD TXT 13,13,"INSERT DISK <SPACE>",13,0 �$�aPSTRING LDY #$00 �$�aPSTRLOP LDA ($FB),Y �$�aBEQ PSTRQUIT %bJSR OUTDO %bINY %bJMP PSTRLOP 1%bPSTRQUIT RTS F% b�OFF LDA $040A,Y R%*bE� #$80 b%4bSTA $040A,Y j%>bRTS y%Hb�� LDA $C5 �%RbCMP #$40 �%\bBNE �� �%fb��B LDA $C5 �%pbCMP #$40 �%zbBEQ ��B �%�bTAX �%�bLDA ��,X �%�bBEQ �� �%�bRTS �%�b� JSR HIRESOFF &�bLDX #$00 &�bLDA #$20 %&�b�AME� STA $41F0,X -&�bINX :&�bCPX #$10 H&�bBNE �AME� W&�bLDA #��AME c&�bSTA $FB r&cLDA #��AME ~&cSTA $FC �&cJSR PSTRING �&$cLDA #$00 �&.cPHA �&8c�LOOP TAY �&=cJSR �OFF �&BcJSR �� �&GcPHA �&LcJSR �OFF �&QcPLA �&VcCMP #$80 '`cBCS DECODE 'jcTAY 'tcPLA '~cTAX "'�cTYA 2'�cSTA $040A,X ?'�cCMP #$20 M'�cBCS NOSPC U'�cCLC b'�cADC #$40 x'�cNOSPC STA $41F0,X �'�cINC� CPX #$0F �'�cBEQ �RELOP �'�cINX �'�c�RELOP TXA �'�cPHA �'�cJMP �LOOP �'