10REM **** PC-UTIL ******terug.gif
   20REM VERSION 2.00 250999.
   30REM R. LEURS - BORN (L)
   40REM====================
   50 
   55ESCAPE=OFF
   60R=#9000 ; REM PLAATS VAN DE CODE TIJDENS ASSEMBLEREN
   70P.$16$15"SOURCE  PC-UTIL"';DOP."=";U.C.>=15
   80P.''"CLEANING SPACE"'';@=0;NONMI
   90F.X=R TO R+#FFC S.4;!X=#FFFFFFFF;N.
  100P.'"PASS1";PASS2;GOS.a
  110P.'"PASS2";PASS1;GOS.a
  120P.'ERRORS" ERRORS, "WARNINGS" WARNINGS"''
  130P.''"CODE VAN #"&PCROM" T/M #"&(P-1)'
  140P."NOG VRIJ: "(#AFBF-P)" BYTES"''
  150 $(R+#FC0)="C:\ATOM\HELP\ATOMHELP.IDX"
  160 $(R+#FE0)="C:\ATOM\HELP\ATOMHELP.TXT"
  165 ESCAPE=ON
  170 END
  180 
  190a
  200 ASM-B
  210 
  220 .OPTION #40
  230 .CODE #A000
  240 .RAM R
  250 
  260 :ZP = #90
  270 :HS = #DE
  280 :VS = #DF
  290 :OSBYTE   = #FFC2
  300 :LEESBYTE = #FFC5
  310 :ZENDBYTE = #FFC8
  320 :WRITE = #FFF4
  330 
  340 :PCROM     .BY #40,#BF
  350 
  360\interpreteerroutine
  370 LDX @#FF
  380 :ZOEK0     LDY #5E
  390 DEY
  400 :ZOEK1     INX
  410 INY
  420 :ZOEK2     LDA TABEL,X
  430 BMI ZOEK4
  440 CMP (#05),Y
  450 BEQ ZOEK1
  460 DEX
  470 :ZOEK3     INX
  480 LDA TABEL,X
  490 BPL ZOEK3
  500 INX
  510 LDA (#05),Y
  520 CMP @#2E
  530 BNE ZOEK0
  540 INY
  550 DEX
  560 BCS ZOEK2
  570 :ZOEK4     STA #53
  580 LDA TABEL+1,X
  590 STA #52
  600 STY #03
  610 LDX #04
  620 JMP (#52)
  630 
  640 :TABEL
  650 .AS "CHAIN"           ; .DB KETTING
  660 .AS "FILECNV"         ; .DB FILECNV
  670 .AS "GWINDOW"         ; .DB GWINDOW
  680 .AS "GWOFF"           ; .DB GWOFF
  690 .AS "HELP"            ; .DB HELP
  700 .AS "HFILL"           ; .DB HFILL
  710 .AS "GETWIN"          ; .DB WINGET
  720 .AS "ORIGIN"          ; .DB ORIGIN
  730 .AS "OSCLI"           ; .DB OSCLI
  740 .AS "PCC"             ; .DB PCC
  750 .AS "PDMENU"          ; .DB PDMENU
  760 .AS "POWERDOWN"       ; .DB POWERDOWN
  767 .AS "RGET"            ; .DB RGET
  769 .AS "RPUT"            ; .DB RPUT
  770 .AS "SAVWIN"          ; .DB SAVWIN
  777 .AS "SCOPY"           ; .DB SCOPY
  780 .AS "SCREEN"          ; .DB SCREEN
  790 .AS "TXMOD"           ; .DB TXMOD
  800 .AS "UTIL"            ; .DB PCUTIL
  810 .AS "VCC"             ; .DB VCC
  820 .AS "VDU"             ; .DB VCC
  830 .AS "VFILL"           ; .DB VFILL
  840 .AS "VIDEO"           ; .DB VIDEO
  850 .AS "XBLOCK"          ; .DB XBLOCK
  860 .AS "XCIRCLE"         ; .DB XCIRCLE
  870 .AS "XLINE"           ; .DB XLINE
  880 .AS "XPAINT"          ; .DB XPAINT
  890 .AS "XPALET"          ; .DB XPALET
  900 .AS "XSTYLE"          ; .DB XSTYLE
  910 .AS "XTRIANGLE"       ; .DB XTRIANGLE
  920 .DB #C558
  930 
  940       
  950 :STACK     LDX @#00
  960 STX #04
  970 RTS
  980 
  990 :COMMANDO   PHA
 1000 LDA @#00
 1010 JSR ZENDBYTE
 1020 PLA
 1030 JMP ZENDBYTE
 1040 
 1050 :LEESPAR6 JSR #C78B;JSR #C231
 1060 :LEESPAR5 JSR #C78B;JSR #C231
 1070 :LEESPAR4 JSR #C78B;JSR #C231
 1080 :LEESPAR3 JSR #C78B;JSR #C231
 1090 :LEESPAR2 JSR #C78B;JSR #C231
 1100 :LEESPAR1 JMP #C4E1
 1110 
 1120 :ZETSEM LDA @#0B;JSR OSBYTE;BCC ZETSEM+2;RTS
 1130 :WISSEM PHA;LDA @#0A;JSR OSBYTE;PLA;RTS
 1140 
 1150 \ HELP ROUTINE
 1160 :PCUTIL JSR #C4E4;JSR #F7D1
 1170 .BY 16
 1180 :NAAM .AS "PC-UTIL V2.00 26-09-1999" 
 1190 .BY #0D,#0A,#0A
 1200 .AS "(c) Roland Leurs 1995-1997",#0D,#0A,#0A,#EA
 1210 JSR PCBOX7
 1220 STA ZP+1
 1230 STA ZP+2
 1240 TAY
 1250 :PCBOX1   LDA TABEL,Y
 1260 STA ZP+2
 1270 CMP @#C5
 1280 BNE PCBOX2
 1290 INY
 1300 LDA TABEL,Y
 1310 CMP @#58
 1320 BEQ PCBOX8
 1330 DEY
 1340 :PCBOX2   LDA ZP+2
 1350 AND @#F0
 1360 CMP @#A0
 1370 BNE PCBOX3
 1380 LDA ZP
 1390 CMP @#0B
 1400 BNE PCBOX5
 1410 LDA ZP+1
 1420 CMP @#02
 1430 BEQ PCBOX6
 1440 CLC
 1450 ADC @#01
 1460 STA ZP+1
 1470 JSR PCBOX7
 1480 INY
 1490 INY
 1500 JMP PCBOX1
 1510 :PCBOX3   LDA ZP
 1520 CLC
 1530 ADC @#01
 1540 STA ZP
 1550 CMP @#0B
 1560 BEQ PCBOX1
 1570 LDA ZP+2
 1580 JSR #FFF4
 1590 CMP @#20
 1600 BNE PCBOX4
 1610 JMP PCBOX5
 1620 :PCBOX4   INY
 1630 JMP PCBOX1
 1640 :PCBOX5   LDA @#20
 1650 STA ZP+2
 1660 JMP PCBOX3
 1670 :PCBOX6   JSR #FFED
 1680 JSR PCBOX7
 1690 STA ZP+1
 1700 INY
 1710 INY
 1720 JMP PCBOX1
 1730 :PCBOX7   LDA @#00
 1740 STA ZP
 1750 RTS
 1760 :PCBOX8   JSR #FFED
 1770 JSR #FFED
 1780 JMP #C55B
 1790 
 1800 :VCC \VIDEO CONTROL CODE
 1810 LDA @#C8;STA ZP;LDA @#FF;STA ZP+1
 1820 BNE PCCR
 1830 
 1840 :PCC \PRINTER CONTROL CODE
 1850 LDA @<PCCV;STA ZP;LDA @>PCCV;STA ZP+1
 1860 :PCCR JSR ZETSEM
 1870 :PCC0 JSR #F291;CMP @#0D;BEQ PCC_END
 1880 CMP @CH";";BEQ PCC_END;CMP @CH",";BEQ P+4
 1890 DEC #03;JSR #C78B;LDA #16;JSR ZCC
 1900 JSR#F291;CMP @CH"~";BNE PCC1
 1910 LDA #25;JSR ZCC;INC #03
 1920 :PCC1 DEC #03;LDA @#00;STA #04;BEQ PCC0
 1930 :PCC_END JSR WISSEM;DEC #03;JSR STACK;JMP #C558
 1940 :ZCC JMP (ZP)
 1950 :PCCV PHA;LDA @#47;JSR COMMANDO;PLA;JMP ZENDBYTE
 1960 
 1970 :GWINDOW \ GRAFISCH VENSTER DEFINIEREN
 1980 JSR LEESPAR4;LDX @#00;JSR ZETSEM;LDA @#4C;JSR COMMANDO
 1990 :GWINDOW1 LDA #16,X;JSR ZENDBYTE;LDA #25,X;JSR ZENDBYTE
 2000 INX;CPX @#04;BNE GWINDOW1
 2010 JSR WISSEM;JSR STACK;JMP #C55B
 2020 
 2030 :GWOFF   \ GRAFISCH VENSTER OPHEFFEN
 2040 JSR #C4E4;JSR ZETSEM;LDA @#4D
 2050 JSR COMMANDO;JSR WISSEM;JMP #C55B
 2060 
 2070 :SYNERR LDX @135;LDA @#0C;JMP OSBYTE
 2080 
 2090 :VFILL   \ VERTIKAAL VULLEN
 2100 JSR #C78B;JSR #F291;CMP @CH"T";BNE SYNERR
 2110 JSR #F291;CMP @CH"O";BNE SYNERR;JSR #C231;JSR LEESPAR3
 2120 LDA #16;STA ZP;LDA #25;STA ZP+1
 2130 LDA #17;STA ZP+4;LDA #26;STA ZP+5
 2140 LDA #18;STA ZP+2;LDA #27;STA ZP+3
 2150 LDA #19;STA ZP+6;LDY @0;LDA @#4A;BNE FILL
 2160 
 2170 :HFILL   \ HORIZONTAAL VULLEN
 2180 JSR #C78B;JSR #C231;JSR #C78B;JSR #F291;CMP @CH"T";BNE SYNERR
 2190 JSR #F291;CMP @CH"O";BNE SYNERR;JSR #C231;JSR LEESPAR2
 2200 LDA #16;STA ZP;LDA #25;STA ZP+1
 2210 LDA #17;STA ZP+2;LDA #26;STA ZP+3
 2220 LDA #18;STA ZP+4;LDA #27;STA ZP+5
 2230 LDA #19;STA ZP+6;LDY @2;LDA @#49
 2240 :FILL STA ZP+7;JSR ZETSEM
 2250 INC ZP+4;BNE P+4;INC ZP+5
 2260 :FILL0 LDA ZP+7;JSR COMMANDO;LDX @0
 2270 :FILL1 LDA ZP,X;JSR ZENDBYTE;INX;CPX @4;BNE FILL1
 2280 LDA ZP+6;JSR ZENDBYTE
 2290 CLC;LDA ZP,Y;ADC @1;STA ZP,Y;LDA ZP+1,Y;ADC @0;STA ZP+1,Y
 2300 LDA ZP,Y;CMP ZP+4;BNE FILL0
 2310 LDA ZP+1,Y;CMP ZP+5;BNE FILL0
 2320 JSR WISSEM;JSR STACK;JMP #C55B
 2330 
 2340 :SCREEN     \ SELECTEER BEELDPAGINA
 2345 JSR #F291;CMP @CH"/";BNE SCREEN0;JMP SCOPY
 2350 :SCREEN0 DEC #03;JSR LEESPAR1;JSR ZETSEM;LDA #16
 2360 AND @#80;BNE SCREEN1
 2370 LDA @#50;JSR COMMANDO;LDA #16;AND @#0F;JSR ZENDBYTE
 2380 :SCREEN1 LDA #16;AND @#40;BNE SCREEN2
 2390 LDA @#4F;JSR COMMANDO;LDA #16;AND @#0F;JSR ZENDBYTE
 2400 :SCREEN2 JSR WISSEM;JSR STACK;JMP #C55B
 2410 
 2420 :ORIGIN
 2430 JSR LEESPAR2;JSR ZETSEM;LDA @#4E;JSR COMMANDO;LDX @0
 2440 :ORIGIN1 LDA #16,X;JSR ZENDBYTE
 2450 LDA #25,X;JSR ZENDBYTE;INX;CPX @2;BNE ORIGIN1
 2460 JSR WISSEM;JSR STACK;JMP #C55B
 2470 
 2480 :ED64 LDX @#00
 2490 :PCRUN JSR #C4E4
 2500 LDA @CH"P";STA #100;LDA @CH"C";STA #101;LDA @CH" ";STA #102
 2510 LDY @#03
 2520 :PCRUN1 LDA #AF00,X;STA #100,Y;INX;INY
 2530 CMP @#0D;BNE PCRUN1
 2540 JSR #FFF7;JMP #C55B
 2550 
 2560 :EDIT LDX @#20;BNE PCRUN
 2570 :MODEM LDX @#40;BNE PCRUN
 2580 :PCTOOLS LDX @#60;BNE PCRUN
 2590 :TEKENPRG LDX @#80;BNE PCRUN
 2600 :BASIC LDX @#A0;BNE PCRUN
 2610 
 2620 :HELP       \ ONLINE HELPFUNCTIE
 2630 JSR ZETSEM;LDA @#5A;JSR COMMANDO;LDA @8;JSR ZENDBYTE
 2640 JSR LEESBYTE;JSR WISSEM;PHA;JSR #F7D1
 2650 .BY #11,#0C,#10,#0A,#0E
 2660 .AS "**************************",#0A,#0D
 2670 .AS "* ATOM ON-LINE HELP V1.1 *",#0A,#0D
 2680 .AS "* (c) Pascalle en Roland *",#0A,#0D
 2690 .AS "**************************",#0A,#0D
 2700 .BY #0A,#0A,#EA
 2710 LDA @17;JSR #FFF4;PLA;PHA;JSR #FFF4
 2720 JSR #F291;DEC #03;CMP @#0D;BEQ HELPSYN;CMP @CH";";BEQ HELPSYN
 2730 JMP HELPSTR
 2740 :HELPSYN JSR #C4E4;JSR #F7D1
 2750 .BY 17,9
 2760 .AS "Syntax: HELP <keyword>",#0D,#0A,#0D
 2770 .AS "Keywords:",#0D,#0A,#11,#EA
 2780 PLA;PHA;JSR #FFF4
 2790 JSR OPENIDX;LDA @#00;STA ZP
 2800 :HELPSYN1 JSR #FFD4;BCS HELPEND;CMP @#0D;BEQ HELPSYN2
 2810 JSR #FFF4;INC ZP;BNE HELPSYN1
 2820 :HELPSYN2 LDA ZP;CMP @20;BEQ HELPSYN3
 2830 LDA @#20;JSR #FFF4;INC ZP;BNE HELPSYN2
 2840 :HELPSYN3 JSR LEESPTR   \ SKIP INDEX
 2850 LDA @#00;STA ZP;BEQ HELPSYN1
 2860 :HELPEND JSR #FFCB;JSR #F7D1
 2870 .BY #0A,#0D,#0F,#11,#EA
 2880 PLA;JSR #FFFF4;JMP #C55B
 2890 
 2900 :OPENIDX LDA @#C0;STA ZP;LDA @#AF;STA ZP+1;LDX @ZP;SEC;JSR #FFCE
 2910 CMP @#00;BEQ OPENERR;TAY;RTS
 2920 :OPENTXT LDA @#E0;BNE OPENIDX+2
 2930 :OPENERR LDX ZP;JSR #FFED
 2940 :OPENERR1 LDA #AF00,X;JSR #FFF4;INX;CMP @#0D;BNE OPENERR1
 2950 LDX @49;LDA @#0C;JMP OSBYTE
 2960 :NOHELP JSR #FFCB;JSR #F7D1
 2970 .AS "Geen hulp aanwezig voor ",#EA
 2980 LDX @#00
 2990 :NOHELP1 LDA #140,X;JSR #FFF4;INX;CMP @#0D;BNE NOHELP1
 3000 LDX @200;LDA @#0C;JMP OSBYTE
 3010 
 3020 :LEESPTR JSR #FFD4;STA ZP+2;JSR #FFD4;STA ZP+3
 3030 JSR #FFD4;STA ZP+4;JSR #FFD4;STA ZP+5
 3040 RTS
 3050 
 3060 :HELPSTR LDX @#00
 3070 :HELPSTR1 JSR #F291;STA #140,X;INX;CMP @#0D;BEQ HELPSTRE
 3080 CMP @CH";";BNE HELPSTR1
 3090 :HELPSTRE DEC #03;LDA @#0D;DEX;STA #140,X;JSR #C4E4;JSR OPENIDX
 3100 LDX @#00
 3110 :HELPSTR2 JSR #FFD4;BCS NOHELP
 3120 STA #100,X;INX;CMP @#0D;BNE HELPSTR2
 3130 LDX @#00
 3140 :HELPSTR3 LDA #100,X;CMP #140,X;BEQ HELPSTR4
 3150 JSR LEESPTR;LDX @#00;BEQ HELPSTR2
 3160 :HELPSTR4 INX;CMP @#0D;BNE HELPSTR3
 3170 \ OP DEZE PLAATS IS DE ZOEKSTRING IN DE INDEXFILE GEVONDEN
 3180 \ EN KAN DE PTR GELEZEN WORDEN.
 3190 JSR LEESPTR;JSR #FFCB   \ POINTER GELEZEN, SLUIT INDEXFILE
 3200 JSR OPENTXT;LDX @ZP+2;JSR #FFD7   \  ZET POINTER IN TEXTFILE
 3210 LDA @17;JSR #FFF4;LDA @9;JSR #FFF4;LDA @32;STA ZP
 3220 :HELPSTR5 JSR #FFD4;BCS HELPSTR6;CMP @126;BEQ HELPSTR6
 3230 CMP @13;BNE HELPSTR7;LDA @17;JSR #FFF4;PLA;PHA;JSR #FFF4;LDA @13
 3240 :HELPSTR7 CMP @32;BNE HELPSTR8;CMP ZP;BEQ HELPSTR9;LDA @32;STA ZP
 3250 LDA@17;JSR #FFF4;PLA;PHA;JSR #FFF4;LDA @32;BNE HELPSTR9
 3260 :HELPSTR8 CMP @CH"`";BNE HELPSTR9;LDA @17;JSR #FFF4;LDA @14;JSR #FFF4
 3270 LDA @0;STA ZP;BNE HELPSTR5
 3280 :HELPSTR9 JSR #FFF4;JMP HELPSTR5
 3290 :HELPSTR6 JMP HELPEND
 3300 
 3310 :POWERDOWN JSR #C4E4;LDX @#00
 3320 :LGOUT1 LDA LGTXT,X;STA #100,X;INX;CMP @#0D;BNE LGOUT1
 3330 JSR #FFF7;JSR #F7D1
 3340 .AS "Geheugen weggeschreven van #300 t/m #9FFF in de file MEMORY.PD"
 3350 .BY #0D,#0A,#EA
 3360 JMP #C55B
 3370 :LGTXT .AS "SAVE MEMORY.PD 300 A000",#0D
 3380 
 3390 :FILECNV       \ FILE CONVERSIE ATOM <-> MSDOS
 3400 LDX @#01;JSR #F291;STA #140;LDY #03
 3410 :FILECNV1 LDA (#05),Y;CMP @CH" ";BEQ FILECNV2;STA #140,X;INX
 3420 INY;INC #03;BNE FILECNV1
 3430 :FILECNV2 LDA @#0D;STA #140,X;LDX @#01;JSR #F291;STA #160;LDY #03
 3440 :FILECNV3 LDA (#05),Y;CMP @CH" ";BEQ FILECNV4;STA #160,X;INX
 3450 INY;INC #03;BNE FILECNV3
 3460 :FILECNV4 LDA @#0D;STA #160,X;LDX @#00
 3470 :FILECMP LDA #140,X;CMP #160,X;BNE FILECMP1;INX;CMP @#0D;BNE FILECMP
 3480 LDX @118;LDA @#0C;JMP OSBYTE
 3490 :FILECMP1 JSR #F291;CMP @CH"H";BEQ FILECNV5
 3500 :FILECNVERR JMP SYNERR
 3510 :FILECNV5 JSR #F291;CMP @CH"-";BEQ DELHEADER;CMP @CH"+";BEQ ADDHEADER
 3520 BNE FILECNVERR
 3530 :DELHEADER JSR FILESOPEN;INC #03
 3540 :FILECOPY LDY ZP+2;JSR #FFD4;BCS ENDCOPY;LDY ZP+3;JSR #FFD1;JMP FILECOPY
 3550 :ENDCOPY JSR #FFCB;LDY ZP+3;JSR #FFCB;DEC #03;JSR STACK;JMP #C558
 3560 
 3570 :ADDHEADER LDA @#00;STA #16;LDA @#29;STA #25;LDA @#44;STA #17
 3580 LDA @#F1;STA #26;JSR #F291;CMP @#0D;BEQ ADD1;CMP @CH";";BEQ ADD1
 3590 DEC #03;JSR #C78B;JSR #C78B;INC #03
 3600 :ADD1 JSR FILESOPEN;LDY ZP+3;LDA #16;JSR #FFD1;LDA #25;JSR #FFD1
 3610 LDA #17;JSR #FFD1;LDA #26;JSR #FFD1;LDX @12;LDA @#00
 3620 :ADD2 JSR #FFD1;DEX;BNE ADD2;LDY ZP+2;JSR MOVPTR;JMP FILECOPY
 3630 
 3640 :FILESOPEN SEC;LDA @#40;JSR OPEN;BNE FILES2
 3650 LDX @49;LDA @#0C;JMP OSBYTE
 3660 :FILES2;STA ZP+2;CLC;LDA @#60;JSR OPEN;BNE FILES4
 3670 LDY ZP+2;JSR #FFCB;LDX @52;LDA @#0C;JMP OSBYTE
 3680 :FILES4 STA ZP+3;LDY ZP+3;JSR MOVPTR;RTS
 3690 :OPEN STA ZP;LDA @#01;STA ZP+1;LDX @ZP;JSR #FFCE
 3700 CMP @#00;RTS
 3710 
 3720 :MOVPTR LDA @<-16;STA ZP+4;LDA @>-16
 3730 STA ZP+5;STA ZP+6;STA ZP+7;LDX @ZP+4;JSR #FFD7;RTS
 3740 
 3750 :OSCLI LDA #208;STA ZP;LDA #209;STA ZP+1
 3760 LDA @<OSCLIVEC;STA #208;LDA @>OSCLIVEC;STA #209;LDA @#00;STA ZP+2
 3770 PLA;PLA;JMP #C334
 3780 :OSCLIVEC PHP;STX ZP+3;LDX ZP+2;STA #140,X;CPX @#40;BCS P+3
 3790 INX;STX ZP+2;LDX ZP+3;CMP @#0D;BEQ OSCLI_EXEC;PLP;RTS
 3800 :OSCLI_EXEC PLA;LDA ZP;STA #208;LDA ZP+1;STA #209;LDX @#00
 3810 :OSCLI1 LDA #140,X;STA #100,X;INX;CMP @#0D;BNE OSCLI1;JSR #FFF7
 3820 LDY #06;DEY;BEQ P+5;JMP #C558;JMP #C2CF
 3830 
 3840 :KETTING       \ CHAIN STATEMENT
 3850 JSR #CEFA;DEY;STY #56;JSR #FFE0;JMP #F144
 3860 
 3870 :FONTINIT
 3880 LDA @#00;JSR ZENDBYTE;LDA @#06;JSR ZENDBYTE
 3890 :FONT1 JSR #F291;CMP @CH";";BEQ ENDFONT;CMP @13;BEQ ENDFONT
 3900 JSR ZENDBYTE;JMP FONT1
 3910 :ENDFONT LDA @#00;JSR ZENDBYTE;DEC #03;JSR LEESBYTE;BNE ENDFONT1
 3920 :RESETSEM LDA @10;JMP OSBYTE
 3930 :ENDFONT1 JSR RESETSEM;LDA @12;LDX @1;JMP OSBYTE
 3940 
 3950 :TXMOD JSR #F291;CMP @CH"/";BEQ TXMOD3;LDY @#00;STY ZP
 3960 :TXMOD1 DEC #03;LDA @#03;LDX @80;JSR OSBYTE
 3970 LDA @#0B;JSR OSBYTE;BCC P-3;LDA @#32;JSR COMMANDO;LDA @#03
 3980 JSR ZENDBYTE;LDY ZP;BEQ TXMOD2
 3990 :TXMOD4 TYA;JSR COMMANDO;CPY @#55;BEQ TXMOD2
 4000 LDA @#27;JSR COMMANDO;JSR LEESBYTE;JSR LEESBYTE
 4010 LDX @#00;CPY @#56;BNE P+4;LDX @#01;AND @#30
 4020 LDY TXMOD5,X;CMP @#10;BNE P+5;LDY TXMOD5+2,X
 4030 LDA @#35;JSR COMMANDO;LDA @#00;JSR ZENDBYTE;TYA;JSR ZENDBYTE
 4040 LDA @79;JSR ZENDBYTE;LDA @0;JSR ZENDBYTE;LDA @16;JSR #FFF4
 4050 :TXMOD2 LDA @#0A;JSR OSBYTE;JMP #C558
 4060 :TXMOD3 JSR #F291;CMP @CH"8";BEQ FONT8;CMP @CH"1";BEQ FONT14
 4070 CMP @CH"F";BEQ FONTF;CMP @CH"C";BEQ FONTU;JMP ENDFONT1
 4080 :FONT8 LDY @#57;STY ZP;JMP TXMOD4
 4090 :FONT14 JSR #F291;CMP @CH"4";BNE FONT8-3;LDY @#56;STY ZP;JMP TXMOD4
 4100 :FONTF JSR FONTINIT;LDY @#55;BNE TXMOD4
 4110 :FONTU LDY @#55;STY ZP;JMP TXMOD4
 4120 :TXMOD5 .BYTE #31,#1B,#2A,#18
 4130 
 4140 :SAVWIN JSR LEESPAR5;JSR ZETSEM
 4150 LDA @#58;JSR COMMANDO;LDX @#01
 4160 :SAVWIN1 LDA #16,X;JSR ZENDBYTE;LDA #25,X;JSR ZENDBYTE
 4170 INX;CPX @5;BNE SAVWIN1;LDA #16;JSR ZENDBYTE;JSR STACK
 4180 JSR WISSEM;JMP #C55B
 4190 
 4200 :WINGET JSR LEESPAR3;JSR ZETSEM
 4210 LDA @#59;JSR COMMANDO;LDX @#01
 4220 :WINGET1 LDA #16,X;JSR ZENDBYTE;LDA #25,X;JSR ZENDBYTE
 4230 INX;CPX @3;BNE WINGET1;LDA #16;JSR ZENDBYTE;JSR STACK  
 4240 JSR WISSEM;JMP #C55B
 4250 
 4260 :XERROR LDX @29;LDA @12;JMP OSBYTE
 4270 
 4280 :XCIRCLE JSR #F291;LDX @0;CMP @CH"O";BEQ XCIRCLE1
 4290 CMP @CH"F";BNE XERROR;INX
 4300 :XCIRCLE1 STX ZP;JSR #C231;JSR LEESPAR3;LDY @3
 4310 :PCCOM5A JSR ZETSEM;LDA @#5A;JSR COMMANDO;LDA ZP;JSR ZENDBYTE;LDX @#00
 4320 :PCCOM5A1 LDA #16,X;JSR ZENDBYTE;LDA #25,X;JSR ZENDBYTE
 4330 INX;DEY;BNE PCCOM5A1;JSR WISSEM;JSR STACK;JMP #C55B
 4340 
 4350 :XBLOCK JSR #F291;LDX @2;CMP @CH"O";BEQ XBLOCK1
 4360 CMP @CH"F";BNE XERROR;INX
 4370 :XBLOCK1 STX ZP;JSR #C231;JSR LEESPAR4;LDY @4;BNE PCCOM5A
 4380 
 4390 :XTRIANGLE JSR #F291;LDX @4;CMP @CH"O";BEQ XTRIANGLE1
 4400 CMP @CH"F";BNE XERROR;INX
 4410 :XTRIANGLE1 STX ZP;JSR #C231;JSR LEESPAR6;LDY @6;BNE PCCOM5A
 4420 
 4430 :XLINE JSR LEESPAR4;LDX @7;STX ZP;LDY @4;BNE PCCOM5A
 4440 
 4450 :XSTYLE JSR LEESPAR1;LDX @6;STX ZP;LDY @1;BNE PCCOM5A 
 4460 
 4470 :ZERO LDA @#00;STA #321,X;STA #33C,X;STA #357,X;STA #372,X;RTS
 4480 
 4490 :INT10 JSR ZETSEM;LDA @#1F;JSR COMMANDO;LDX @0
 4500 :INT101 LDA ZP,X;JSR ZENDBYTE;INX;CPX @8;BNE INT101;LDX @0
 4510 :INT102 JSR LEESBYTE;STA ZP,X;INX;CPX @8;BNE INT102
 4520 JSR WISSEM;RTS
 4530 
 4540 :VIDEO JSR #C4E4;LDX @1;LDY @0
 4550 :VIDEO1 LDA #321,X;STA ZP,Y;LDA #33C,X;STA ZP+1,Y
 4560 INY;INY;INX;CPX @5;BNE VIDEO1;JSR INT10;JMP #C55B
 4570 
 4580 :XPALET JSR LEESPAR2;LDA #16;STA ZP+2;LDA #17;STA ZP+3
 4590 LDA @#00;STA ZP;LDA @#10;STA ZP+1;JSR INT10;JSR STACK;JMP #C55B
 4600 
 4610 :XPAINT JSR #F291;PHA;JSR #C231;PLA;CMP @CH"P";BEQ PAINTP;CMP @CH"C";BEQ PAINTC
 4620 CMP @CH"D";BEQ PAINTD;CMP @CH"L";BEQ PAINTL
 4630 CMP @CH"S";BNE P+5;JMP PAINTS;JMP XERROR
 4640 :PAINTP JSR LEESPAR4;JSR ZETSEM;LDA @#5F;JSR COMMANDO
 4650 LDA #19;JSR ZENDBYTE;LDA #16;JSR ZENDBYTE;LDA #25;JSR ZENDBYTE
 4660 LDA #17;JSR ZENDBYTE;LDA #26;JSR ZENDBYTE;LDA #18;JSR ZENDBYTE
 4670 JSR WISSEM;JSR STACK;JMP #C55B
 4680 
 4690 :PAINTC JSR LEESPAR3;LDA @#00;STA #19;JMP PAINTP+3
 4700 
 4710 :PAINTD JSR LEESPAR2;JSR ZETSEM;LDA @#5F;JSR COMMANDO
 4720 LDA @#FF;JSR ZENDBYTE;LDA #16;JSR ZENDBYTE;LDY @#00
 4730 LDA #17;STA ZP;LDA #26;STA ZP+1 
 4740 :PAINTD1 LDA (ZP),Y;JSR ZENDBYTE;INY;BNE PAINTD1
 4750 JSR WISSEM;JSR STACK;JMP #C55B
 4760 
 4770 :PAINTL LDX @#FD;JSR PAINTLS;JSR LEESBYTE;PHP;JSR WISSEM;PLP
 4780 BEQ PAINTL3;CMP @2;BNE PAINTL2;LDX @1;BNE PAINTL4
 4790 :PAINTL2 CLC;ADC @47;TAX
 4800 :PAINTL4 LDA @#0C;JMP OSBYTE
 4810 :PAINTL3 JMP #C55B
 4820 
 4830 :PAINTS LDX @#FE;JMP PAINTL+2
 4840 
 4850 :PAINTLS STX ZP;JSR ZETSEM;LDA @#5F;JSR COMMANDO
 4860 LDA ZP;JSR ZENDBYTE
 4870 :PAINTLS1 JSR #F291;CMP @13;BEQ PAINTLS2;CMP @CH";";BEQ PAINTLS2
 4880 JSR ZENDBYTE;JMP PAINTLS1
 4890 :PAINTLS2 LDA @#00;JSR ZENDBYTE;RTS
 4900 
 4910 \ TEKEN KADER, GEBRUIKT DOOR KADER EN PDMENU
 4920 :LOCATE
 4930 PHA;TYA;PHA;LDA @30;JSR WRITE
 4940 LDY #16;:LOCATE1 BEQ LOCATE2;LDA @9;JSR WRITE;DEY;JMP LOCATE1
 4950 :LOCATE2
 4960 LDY #19;:LOCATE3 BEQ LOCATE4;LDA @10;JSR WRITE;DEY;JMP LOCATE3
 4970 :LOCATE4 PLA;TAY;PLA;RTS
 4980 
 4990 :TEKADER
 5000 DEC #18 
 5010 LDA #19
 5020 PHA
 5030 LDX ZP+1
 5040 JSR LOCATE
 5050 LDA KARTAB,X ; JSR WRITE
 5060 LDY #16
 5070 LDA KARTAB+2,X
 5080 :KADERLUS1
 5090 JSR WRITE
 5100 INY
 5110 CPY #18
 5120 BNE KADERLUS1
 5130 LDA KARTAB+4,X
 5140 JSR WRITE
 5150 :KADERLUS2
 5160 INC #19
 5170 LDA #19
 5180 CMP #17
 5190 BEQ BOTTOM
 5200 JSR LOCATE
 5210 LDA KARTAB+6,X ; JSR WRITE
 5220 LDY #16
 5230 LDA @#20
 5240 :KADERLUS3
 5250 JSR WRITE
 5260 INY
 5270 CPY #18
 5280 BNE KADERLUS3
 5290 LDA KARTAB+6,X ; JSR WRITE
 5300 JMP KADERLUS2
 5310 :BOTTOM
 5320 JSR LOCATE
 5330 LDA KARTAB+8,X ; JSR WRITE
 5340 LDY #16
 5350 LDA KARTAB+2,X
 5360 :KADERLUS4
 5370 JSR WRITE
 5380 INY
 5390 CPY #18
 5400 BNE KADERLUS4
 5410 LDA KARTAB+10,X ; JSR WRITE
 5420 INC #16
 5430 PLA
 5440 STA #19
 5450 INC #19
 5460 JMP LOCATE
 5470 
 5480 :KARTAB
 5490 .BYTE 201,218,205,196,187,191
 5500 .BYTE 186,179,200,192,188,217
 5510 
 5520 :LEESPAR
 5530 JSR #C78B
 5540 JSR #C231
 5550 JSR #C78B
 5560 JSR #C231
 5570 JSR #C78B
 5580 JSR #C231
 5590 JSR #C78B
 5600 JSR #C231
 5610 JSR #F291
 5620 AND @#01
 5630 STA ZP+1
 5640 JSR #C231
 5650 JSR #C78B
 5660 JSR #C231
 5670 JSR #F291
 5680 CMP @CH"$"
 5690 BEQ P+5
 5700 JMP XERROR
 5710 JSR #C78B
 5720 JSR #C231
 5730 JMP #F291
 5740 
 5750 :PDMENU
 5760 JSR LEESPAR
 5765 STA #1C;INC #04
 5770 LDA #17;CLC;ADC #19;ADC @1;PHA
 5780 LDA #16;CLC;ADC #18;ADC @1;PHA
 5790 LDA #17;STA #19;PLA;STA #18;PLA;STA #17
 5820 LDA @11;JSR OSBYTE;BCC P-3
 5822 LDA @#5A;JSR COMMANDO;LDA @#08;JSR ZENDBYTE;JSR LEESBYTE;PHA
 5830 LDA @17;JSR #FFF4;LDA #1A;JSR #FFF4
 5840 JSR TEKADER
 5850 JSR MOUSE_INIT;JSR MENU
 5855 LDA @17;JSR #FFF4;PLA;JSR #FFF4
 5860 LDA @10;JSR OSBYTE
 5870 LDA #1C;SEC;SBC @CH"@";CMP @CH"Z"+1;BMI PDMENU1 
 5880 LDA @#0C;LDX @138;JMP OSBYTE
 5890 :PDMENU1 TAX;JSR ZERO;TYA;STA #321,X
 5900 JSR STACK;JMP #C558
 5910 
 5920 :MENU LDA #1B;STA ZP+2;LDA #2A;STA ZP+3  \ ZET POINTER NAAR TEKST
 5930 LDA #18;SEC;SBC #16;STA ZP  \ BEREKEN BREEDTE
 5940 LDA #17;SEC;SBC #19;SBC @1;STA ZP+6 \ BEREKEN AANTAL ITEMS
 5945 JSR #F291;DEC #03;CMP @CH",";BNE MENUDEF
 5947 JSR #C231;JSR #C78B;LDX #1D;DEX;STX ZP+4;LDX @0;BEQ MENU0
 5950 :MENUDEF LDX @0;STX ZP+4 \ RESET POINTER NAAR REGEL
 5960 :MENU0 LDA #19;PHA;LDY @0
 5970 :MENULUSY LDA @17;JSR #FFF4;LDA #1A;JSR #FFF4
 5980 CPX ZP+4;BNE MENU1
 5990 LDA @17;JSR #FFF4;LDA #1A;AND @#0F;ASL A;ASL A;ASL A;ASL A
 6000 STA ZP+5;LDA #1A;AND @#F0;LSR A;LSR A;LSR A;LSR A
 6010 ORA ZP+5;JSR #FFF4   \ INVERTEER KLEUR
 6020 :MENU1 JSR LOCATE;LDA ZP;PHA
 6030 :MENU2 LDA (ZP+2),Y;JSR #FFF4;INY;DEC ZP;BPL MENU2;PLA;STA ZP
 6040 INC #19;INX;LDA @13;CMP (ZP+2),Y;BNE MENULUSY
 6050 PLA;STA #19;JSR MOUSESCAN
 6060 :MENU_KEY LDY @#01;JSR KEYSCAN;BCS MENU_KEY_PRESSED
 6070 JSR MOUSESCAN;BCC MENU_KEY;LDA @#19;JSR COMMANDO
 6080 LDA @#00;JSR ZENDBYTE;LDA @4;JSR ZENDBYTE;JMP MENU_KEY_PRESSED+5
 6090 
 6100 :MENU_KEY_PRESSED LDY @#00;JSR KEYSCAN
 6110 CPX @0;BEQ MENU_UPDN;CPX @27;BEQ MENU_ESC;CPX @13;BEQ MENU_SEL
 6120 JMP MENU_KEY
 6130 :MENU_ESC LDY @0;RTS
 6140 :MENU_SEL LDY ZP+4;INY;RTS
 6150 :MENU_UPDN CPY @#48;BEQ MENU_UP
 6160 CPY @#50;BEQ MENU_DN;JMP MENU0
 6170 :MENU_UP LDA ZP+4;CMP @0;BNE MENU_UP1;LDA ZP+6;STA ZP+4;JMP MENU0
 6180 :MENU_UP1 DEC ZP+4;JMP MENU0
 6190 :MENU_DN LDA ZP+4;CMP ZP+6;BNE MENU_DN1;LDA @0;STA ZP+4;JMP MENU0
 6200 :MENU_DN1 INC ZP+4;JMP MENU0
 6201 
 6202 :KEYSCAN LDA @#3A;JSR COMMANDO;JSR ZENDBYTE;TYA
 6203 JSR ZENDBYTE;LDY @#00
 6204 :KEYSCAN1 JSR ZENDBYTE;INY;CPY @6;BNE KEYSCAN1
 6206 JSR LEESBYTE;TAX;JSR LEESBYTE;TAY;JSR LEESBYTE;JSR LEESBYTE
 6208 JSR LEESBYTE;JSR LEESBYTE;JSR LEESBYTE;JSR LEESBYTE;LSR A;RTS
 6210 
 6212 :MOUSE_INIT LDA @#1C;JSR COMMANDO;LDA @#00;LDX @8
 6213 :MOUSE_INIT1 JSR ZENDBYTE;DEX;BNE MOUSE_INIT1
 6214 JSR LEESBYTE;STA ZP+7;JSR LEESBYTE;ORA ZP+7;STA ZP+7
 6215 :MOUSE_INIT2 JSR LEESBYTE;INX;CPX @6;BNE MOUSE_INIT2
 6216 RTS
 6217 
 6218 :MOUSESCAN LDA ZP+7;BNE MOUSESCAN1;CLC;RTS
 6220 :MOUSESCAN1 LDA @#26;JSR COMMANDO
 6230 JSR LEESBYTE;JSR LEESBYTE;TAY;JSR LEESBYTE;TAX
 6240 CPX @1;BEQ MOUSELEFT;CPX @2;BEQ MOUSERIGHT
 6250 CPY @#FE;BCS MOUSEUP;CPY @#01;BCS MOUSEDOWN;CLC;RTS
 6260 :MOUSELEFT LDX @13;LDY @00;JMP MOUSEND
 6270 :MOUSERIGHT LDX @27;LDY @00;JMP MOUSEND
 6280 :MOUSEUP LDX @00;LDY @#48;JMP MOUSEND
 6290 :MOUSEDOWN LDX @00;LDY @#50;JMP MOUSEND
 6295 :MOUSEND SEC;RTS
 6300 
 6310 :SCOPY JSR #F291;LDX @0;CMP @CH"C";BEQ SCOPY_C;CMP @CH"L";BEQ SCOPY_L
 6320 CMP @CH"S";BEQ SCOPY_S
 6330 LDA @12;LDX @135;JMP OSBYTE
 6340 :SCOPY_L INX
 6350 :SCOPY_S INX
 6360 :SCOPY_C STX ZP;JSR #C231;JSR LEESPAR2;LDX ZP
 6370 JSR ZETSEM;LDA @#5C;JSR COMMANDO;TXA;JSR ZENDBYTE
 6380 LDA #16;JSR ZENDBYTE;LDA #17;JSR ZENDBYTE;JSR WISSEM
 6390 JSR STACK;JMP #C55B
 6400 
 6410 :RPUT JSR LEESPAR3;SEC;LDA@#00;SBC#18;LDA@#40;SBC#27;BCS RPUT1
 6415 :RPUT0 LDA @#0C;LDX@109;JMP OSBYTE
 6420 :RPUT1 JSR ZETSEM;LDA @#61;JSR COMMANDO
 6430 LDA @1;JSR ZENDBYTE;LDA #16;JSR ZENDBYTE;LDA #18;STA ZP;JSR ZENDBYTE
 6440 LDA #27;STA ZP+1;JSR ZENDBYTE;LDA #17;STA ZP+2;LDA #26;STA ZP+3;LDY @0
 6450 :RPUT2 LDA ZP;ORA ZP+1;BEQ RPUT3;LDA (ZP+2),Y;JSR ZENDBYTE
 6455 INC ZP+2;BNE P+4;INC ZP+3
 6460 DEC ZP;LDA ZP;CMP @#FF;BNE RPUT2;DEC ZP+1;JMP RPUT2
 6470 :RPUT3 JSR LEESBYTE;BEQ RPUT4;JSR WISSEM;CLC;ADC@47;TAX;LDA@12;JMP OSBYTE
 6480 :RPUT4 JSR LEESBYTE;STA ZP;JSR LEESBYTE;STA ZP+1;JSR WISSEM
 6490 JSR STACK;JMP #C55B
 6500 
 6510 :RGET JSR LEESPAR3;SEC;LDA@#00;SBC#18;LDA@#40;SBC#27;BCS RGET0;JMP RPUT0
 6515 :RGET0 JSR ZETSEM;LDA @#61;JSR COMMANDO
 6520 LDA @0;JSR ZENDBYTE;LDA #16;JSR ZENDBYTE;LDA #18;JSR ZENDBYTE
 6530 LDA #27;JSR ZENDBYTE;LDA #17;STA ZP+2;LDA #26;STA ZP+3;LDY @0
 6533 :RGET3 JSR LEESBYTE;BEQ RGET4;JSR WISSEM;CLC;ADC@47;TAX;LDA@12;JMP OSBYTE
 6536 :RGET4 JSR LEESBYTE;STA ZP;PHA;JSR LEESBYTE;STA ZP+1;PHA
 6540 :RGET2 LDA ZP;ORA ZP+1;BEQ RGET1;JSR LEESBYTE;STA (ZP+2),Y
 6545 INC ZP+2;BNE P+4;INC ZP+3
 6550 DEC ZP;LDA ZP;CMP @#FF;BNE RGET2;DEC ZP+1;JMP RGET2
 6580 :RGET1 PLA;STA ZP+1;PLA;STA ZP;JSR WISSEM;JSR STACK;JMP #C55B
 6590 
 6600 .END
 6610 RETURN
terug.gif