home *** CD-ROM | disk | FTP | other *** search
- 5 REM*******************************
- 10 REM SET UP MACHINE CODE AND SPRITES
- 15 REM*******************************
- 20 SYS57812"TEXTEDS",8,1:SYS62631:SYS57812"CONTROL",8,1:SYS62631
- 25 POKE2040,225:POKE2041,226:POKE2042,227:POKE2043,230:POKE2044,229
- 30 POKE2045,228:POKE2046,231:POKE2047,232:V=53248:FORT=V+39TOV+46:POKET,7:NEXT
- 35 FORY=3TO15STEP2:POKEV+Y,230:NEXT:FORX=2TO14STEP2:G=G+30:POKEV+X,G:NEXT:POKEV+39,5:POKEV,30:POKEV+1,23
- 40 POKE49153,5:POKEV+21,255:SYS49152
- 42 OPEN15,8,15,"I":CLOSE15:OPEN14,8,15
- 45 REM********************************
- 50 REM INITIALISE
- 55 REM******************************
- 60 VO=15:POKE54296,15:POKE53280,0:POKE53281,0:PRINTCHR$(14),CHR$(8):POKE646,I
- 65 PRINT"[147]";:DIMTEXT$(500):LL=1:PL=1
- 70 TEXT$(0)="[158][178][178][178][178][178][178][178][178][178][178][178][178][178][178][178][178][178][178][178][178][178][178][178][178][178][178][178][178][178][178][178][178][178][178][178][178][178][178][178][178]"
- 75 TEXT$(1)="[158][177][177][177][177][177][177][177][177][177][177][177][177][177][177][177][177][177][177][177][177][177][177][177][177][177][177][177][177][177][177][177][177][177][177][177][177][177][177][177][177][146]"
- 80 DEFFNA(P)=1024+20*40+P:DEFFNB(P2)=1024+40*P2:POKE54277,25:POKE54278,00
- 81 GOSUB260
- 90 REM******************************
- 95 REM EDIT LINE
- 100 REM******************************
- 105 A$=" ":SYS49152
- 110 P=0:PRINT"";A$
- 115 CH=PEEK(FNA(P)):POKE54272+FNA(P),5:POKEFNA(P),111
- 120 PRINT"COLUMN:";P;"[157] WORD COUNT:";WC;"[157] ";
- 125 PRINT"LENGTH:";LL:POKEFNA(P),CH:IFPEEK(56320)=111THENGOSUB690
- 130 GETT$:IFT$=""THENGOTO115
- 135 POKE54276,17:POKE54273,100:POKE54272,255
- 136 POKE54276,16
- 140 IFT$=CHR$(13)ORLEN(A$)=81THENGOSUB210:WC=WC+1:GOTO115
- 145 IFT$="^"THENGOSUB285:POKEFNB(PL-SS),62:GOTO110
- 150 IFT$=""THENGOSUB560
- 155 IFT$=""THENGOSUB260:GOTO90
- 160 IFT$="_"THENP=LEN(A$)-1:GOTO195
- 165 IFT$=CHR$(32)THENWC=WC+1
- 170 IFPEEK(56320)=111THENGOSUB690
- 175 IFT$="."THENWC=WC+1
- 180 IFT$="[147]"ORT$=""ORT$="[145]"THENGOTO195
- 185 IFP>0ANDT$=CHR$(20)THENA$=LEFT$(A$,P-1)+MID$(A$,P+1):P=P-1:GOTO195
- 190 IFT$<>""ANDT$<>"[157]"ANDT$<>""THENA$=LEFT$(A$,P)+T$+MID$(A$,P+1):P=P+1
- 195 PRINT"";A$:IFT$="[157]"ANDP>0THENP=P-1
- 200 IFT$=""ANDP<LEN(A$)-1THENP=P+1
- 205 GOTO115
- 210 REM******************************
- 215 REM INSERT LINE
- 220 REM******************************
- 225 X=0
- 230 IFLEN(A$)<41THENTT$(X)=LEFT$(A$,LEN(A$)-1):A$="":GOTO245
- 235 FORI=41TO1STEP-1:IFMID$(A$,I,1)<>" "THENNEXTI:I=41
- 240 TT$(X)=LEFT$(A$,I-1):A$=MID$(A$,I+1)
- 245 X=X+1:IFA$<>""ANDA$<>" "THENGOTO230
- 250 FORI=LL+XTOPL+XSTEP-1:TEXT$(I)=TEXT$(I-X):NEXTI:FORI=0TOX-1:TEXT$(PL+I)=TT$(I):NEXT
- 255 A$=" ":P=0:PRINT"[147]";:LL=LL+X:PL=PL+X
- 260 SS=PL-7:IFLL-PL<8THENSS=LL-15
- 265 PRINT"[147][154]";A$;"";:IFSS<0THENSS=0
- 270 FORI=SSTOSS+15:PRINT"[158]";TEXT$(I);:IFLEN(TEXT$(I))<40THENPRINT
- 275 IFI=PL-1THENPRINTCHR$(62)
- 280 NEXTI:PRINT" ":RETURN
- 285 REM******************************
- 290 REM MOVE EDIT LINE
- 295 REM******************************
- 300 P2=PL-SS
- 305 GETT1$:IFT1$<>""THEN320
- 310 POKE54272+FNB(P2),1:POKEFNB(P2),62:FORIT=1TO20:NEXT:IFPEEK(56320)=111THENGOSUB690
- 315 POKEFNB(P2),32:GOTO305
- 320 PL=PL+(T1$="[145]")+10*(T1$="U"):IFPL<1THENPL=1
- 325 PL=PL-(T1$="")-10*(T1$="D"):IFPL>LLTHENPL=LL
- 330 IFT1$=CHR$(13)THENRETURN
- 335 IFPL=>LLORT1$<>CHR$(20)THEN345
- 340 LL=LL-1:FORI=PLTOLL:TEXT$(I)=TEXT$(I+1):NEXT:TEXT$(LL+1)=""
- 345 IFPL<LLANDT1$="C"THENA$=TEXT$(PL)+" ":RETURN
- 350 IFT1$="P"THENGOSUB435
- 355 IFT1$="D"THENGOSUB490
- 360 IFT1$="F"THENGOSUB370
- 361 IFT1$="S"THENGOSUB2000
- 365 GOSUB260:GOTO300
- 370 REM******************************
- 375 REM FORMAT LINE
- 380 REM******************************
- 385 FORI=1TOLL-2:IFTEXT$(I)=""ORTEXT$(I+1)=""THEN430
- 387 IFLEFT$(TEXT$(I),1)="*"THENGOTO430
- 388 IFLEFT$(TEXT$(I+1),1)="*"THENGOTO430
- 390 SP=40-LEN(TEXT$(I)):FORJ=1TOLEN(TEXT$(I+1))
- 395 IFMID$(TEXT$(I+1),J,1)<>" "THENNEXTJ:J=J-1
- 400 IFSP<JORJ=LEN(TEXT$(I+1))THEN415
- 405 TEXT$(I)=TEXT$(I)+" "+LEFT$(TEXT$(I+1),J-1)
- 410 TEXT$(I+1)=MID$(TEXT$(I+1),J+1):GOTO387
- 415 IFLEN(TEXT$(I+1))=>SPTHEN430
- 420 TEXT$(I)=TEXT$(I)+" "+TEXT$(I+1)
- 425 FORJ=I+1TOLL:TEXT$(J)=TEXT$(J+1):NEXTJ:LL=LL-1:PL=PL-1:GOTO387
- 430 NEXTI:GOSUB260:RETURN
- 435 REM******************************
- 440 REM OUTPUT TO PRINTER
- 445 REM******************************
- 450 OPEN1,4,7:X=1:PRINT#1,CHR$(27);CHR$(93);CHR$(48);CHR$(17);
- 455 IFX=LLTHEN485
- 460 IFLEFT$(TEXT$(X),1)="*"THENGOSUB1075
- 461 IFLEFT$(TEXT$(X),1)="*"THENX=X+1:GOTO455
- 465 IFTEXT$(X)=""THENPRINT#1,"":X=X+1:GOTO455
- 470 PRINT#1,TEXT$(X);" ";:IFX+1=LLTHEN485
- 471 IFLEFT$(TEXT$(X+1),1)="*"THENGOSUB1075
- 472 IFLEFT$(TEXT$(X+1),1)="*"THENX=X+1:GOTO455
- 475 PRINT#1,TEXT$(X+1):IFTEXT$(X+1)=""THENPRINT#1,""
- 480 X=X+2:GOTO455
- 485 PRINT#1,"":CLOSE1:RETURN
- 490 REM******************************
- 495 REM DISK OPERATIONS
- 500 REM******************************
- 502 POKE56334,0:POKE788,49:POKE789,234:POKEV+21,0:POKE56334,1
- 505 GOSUB750:PRINT"[147][196]ATA HANDLING."
- 510 PRINT"[208]OSITION CORRECT DISK,THEN RETURN[146]--":WAIT197,1
- 515 PRINT"[195]OMMANDS AVAILABLE:":PRINT"1)[211]AVE DATA":PRINT"2)[204]OAD DATA"
- 516 PRINT"3)[205]ERGE FILES":POKE198,0
- 520 INPUT"[150]WHICH DO YOU REQUIRE:";Q:ONQGOTO525,535,552:GOSUB260:RETURN
- 525 INPUT"[198]ILENAME";F$:OPEN1,8,2,F$+",S,W":PRINT#1,PL:PRINT#1,LL
- 530 FORI=0TOLL:FF$=TEXT$(I)+"@":PRINT#1,FF$:NEXTI:CLOSE1
- 531 SYS49152:POKEV+21,255:GOSUB260:RETURN
- 535 INPUT"[198]ILENAME";F$:OPEN1,8,0,F$+",S,R":INPUT#1,PL,LL
- 540 FORI=0TOLL:INPUT#1,TEXT$(I):NEXT:CLOSE1:FORI=0TOLL
- 545 IFTEXT$(I)<>"@"THENTEXT$(I)=LEFT$(TEXT$(I),LEN(TEXT$(I))-1)
- 550 IFTEXT$(I)="@"THENTEXT$(I)=""
- 551 NEXTI:GOSUB260:SYS49152:POKEV+21,255:RETURN
- 552 INPUT"[198]ILENAME";F$:OPEN1,8,0,F$+",S,R":CL=LL:INPUT#1,PL,LL
- 553 FORI=CLTOLL+CL:INPUT#1,TEXT$(I):NEXT:CLOSE1:FORI=CLTOLL+CL
- 554 IFTEXT$(I)<>"@"THENTEXT$(I)=LEFT$(TEXT$(I),LEN(TEXT$(I))-1)
- 555 IFTEXT$(I)="@"THENTEXT$(I)=""
- 556 NEXTI:TEXT$(CL)=" "
- 557 PL=PL+CL:LL=LL+CL:PRINT"[145]";:GOSUB260:SYS49152:POKEV+21,255:RETURN
- 560 REM******************************
- 565 REM HELP SCREENS
- 570 REM******************************
- 575 PRINT"[147] [200][197][204][208] ":PRINT" "
- 580 PRINT"[212]EXT ENTRY MODE: ":PRINT"[210][197][212][213][210][206] PLACES IN TEXT "
- 585 PRINT"_ MOVES CURSOR TO END ":PRINT"^ CALLS UP EDIT MODULE "
- 590 PRINT"[195][210][211][210] KEYS MOVE OVER TEXT":PRINT" "
- 595 GETW$:IFPEEK(56320)<>111ANDW$=""THEN595
- 600 PRINT"[158] [200][197][204][208] 2 "
- 605 PRINTTAB(10)" ":PRINTTAB(10)"[205]AIN EDIT MODE: "
- 610 PRINTTAB(10)"[210][197][212][213][210][206] EXITS EDIT MODULE ":PRINTTAB(10)"[196][197][204][197][212][197] REMOVES LINE "
- 615 PRINTTAB(10)"[195] COPIES LINE ":PRINTTAB(10)"[208] PRINTS TEXT ON PRINTER "
- 620 PRINTTAB(10)"[196] SAVES AND LOADS TEXT "
- 622 PRINTTAB(10)"[198] COMPACTS TEXT "
- 625 PRINTTAB(10)"[195][210][211][210] KEYS MOVE OVER TEXT ":PRINTTAB(10)" "
- 630 GETW$:IFPEEK(56320)<>111ANDW$=""THEN630
- 635 PRINT"";:PRINT" [200][197][204][208] 3 "
- 640 PRINT"DISK STATUS: ":PRINT" ":INPUT#14,RR$,TR$
- 645 PRINT"[145]";TR$:PRINT" ":PRINT"";
- 650 GETW$:IFPEEK(56320)<>111ANDW$=""THEN650
- 655 PRINTTAB(16)"[145][158] [200][197][204][208] 4 ":PRINTTAB(16)"[195][204][210] RESTARTS PROG "
- 660 PRINTTAB(16)"[210][213][206]/[211][212][207][208] FOR HELP ":PRINTTAB(16)" "
- 665 GETW$:IFPEEK(56320)<>111ANDW$=""THEN665
- 666 SYS49152:POKEV+21,255
- 670 GOSUB260:RETURN
- 675 REM*******************************
- 680 REM ICON RECOGNITION
- 685 REM*******************************
- 690 XP=PEEK(V):V=53248:IFXP>25ANDXP<55THENPOKEV+40,1:FORT=0TO500:NEXT:POKEV+40,7:GOSUB440:RETURN
- 695 IFXP>55ANDXP<85THENPOKEV+41,1:FORT=0TO500:NEXT:POKEV+41,7:GOSUB570:RETURN
- 700 IFXP>85ANDXP<115THENPOKEV+42,1:FORT=0TO500:NEXT:POKEV+42,7:GOSUB385:RETURN
- 705 IFXP>115ANDXP<145THENPOKEV+43,1:FORT=0TO500:NEXT:POKEV+43,7:GOSUB730:RETURN
- 710 IFXP>145ANDXP<175THENPOKEV+44,1:FORT=0TO500:NEXT:POKEV+44,7:GOSUB490:RETURN
- 715 IFXP>175ANDXP<205THENPOKEV+45,1:FORT=0TO500:NEXT:POKEV+45,7:GOSUB285:RETURN
- 720 IFXP>205ANDXP<235THENPOKEV+46,1:FORT=0TO500:NEXT:POKEV+46,7:GOTO110
- 725 RETURN:RETURN
- 730 IFVO=15THENPOKE54296,0:VO=0:RETURN
- 735 IFVO=0THENPOKE54296,15:VO=15:RETURN
- 740 RETURN
- 745 REM*******************************
- 750 REM DISK OPERATIONS
- 755 REM*******************************
- 760 OPEN15,8,15,"I":CLOSE15
- 765 PRINT"[147][196][201][211][203][160][207][208][197][210][193][212][201][207][206][211].":PRINT"1) [198]ORMAT [196]ISK"
- 770 PRINT"2) [210]EAD [197]RROR [195]HANNEL":PRINT"3) [201]NITIALIZE [196]RIVE"
- 775 PRINT"4) [214]ALIDATE [196]ISK":PRINT"5) [210]EAD [196]IRECTORY"
- 780 PRINT"6) [210]ENAME [198]ILE":PRINT"7) [211]AVE OR [204]OAD [196]ATA":POKE198,0
- 781 PRINT"8) [210]ETURN TO [212]EXT [197]NTRY [205]ODE"
- 785 INPUT"[215]HICH DO YOU REQUIRE";SK:IFSK<1ORSK>8THEN765
- 790 ONSKGOTO815,850,875,910,945,975,795,796:GOTO765
- 795 RETURN
- 796 SYS49152:POKEV+21,255:GOSUB260:GOTO90
- 800 REM*******************************
- 805 REM FORMAT DISK
- 810 REM*******************************
- 815 PRINT"[147][156][198]ORMAT ([206]EW)[146]"
- 820 PRINT"GIVE REQUIRED NAME AND ID":INPUTNAME$:INPUTID$
- 825 OPEN1,8,15:PRINT#1,"M-W"CHR$(81)CHR$(0)CHR$(1)CHR$(255):CLOSE1
- 830 OPEN15,8,15:PRINT#15,"NEW:"+NAME$+","+ID$:GOTO765
- 835 REM*******************************
- 840 REM READ ERROR CHANNEL
- 845 REM*******************************
- 850 PRINT"[147][197]RRORS";:PRINT"";:INPUT#14,A$,B$,C$,D$:PRINTA$,B$,C$,D$
- 855 POKE198,0:WAIT198,1:GOTO765
- 860 REM*******************************
- 865 REM INITIALIZE DISK
- 870 REM*******************************
- 875 PRINT"[147][156][201]NITIALIZE DISK[146]"
- 880 PRINT"[155][208]LACE A DISK IN DRIVE AND CLOSE THE DOOR"
- 885 POKE198,0:WAIT198,1:OPEN15,8,15,"INITIALIZE":CLOSE15
- 890 PRINT"[144][196]ONE":FORX=0TO1500:NEXT:GOTO765
- 895 REM*******************************
- 900 REM VALIDATE DISK
- 905 REM*******************************
- 910 PRINT"[147][156][214]ALIDATE [196]ISK[146]":CLOSE15
- 915 PRINT"[144][208]LACE DISK IN DRIVE AND CLOSE DOOR.":POKE198,0:WAIT198,1
- 920 OPEN15,8,15,"VALIDATE":PRINT"[196]O NOT REMOVE DISK TILL LIGHT IS OUT"
- 925 REM*******************************
- 930 REM READ DIRECTORY
- 935 REM*******************************
- 940 CLOSE15:PRINT"[144][196]ONE":FORT=0TO1500:NEXT:GOTO765
- 945 PRINT"[147][156][210]EAD [196]IRECTORY.[146]"
- 950 PRINT"PLACE DISK TO BE READ IN DRIVE AND CLOSEDOOR"
- 955 POKE198,0:WAIT198,1:PRINT"[147][196][201][211][203] [196][201][210][197][195][212][207][210][217].[146]":GOTO1010
- 960 REM*******************************
- 965 REM RENAME FILE
- 970 REM*******************************
- 975 PRINT"[147][156][210]ENAME [198]ILE[146]"
- 980 INPUT"[206]AME OF FILE TO BE RENAMED";PR$:INPUT"[206]AME TO CALL NEW FILE";PP$
- 985 PRINT"[207][203]?":GETA$:IFA$="N"THENGOTO975
- 990 OPEN1,8,15,"RENAME:"+PP$+"="+PR$:CLOSE1:PRINT"[144][196]ONE":POKE198,0:WAIT198,1:GOTO765
- 995 REM*******************************
- 1000 REM DIRECTORY READ SUBROUTINE
- 1005 REM*******************************
- 1010 OPEN1,8,0,"$0":GET#1,AW$,BW$
- 1015 GET#1,AW$,BW$:GET#1,AW$,BW$:C=0:IFAW$<>""THENC=ASC(AW$)
- 1020 IFBW$<>""THENC=C+ASC(BW$)*256
- 1025 PRINT""MID$(STR$(C),2);TAB(2);"[146]";
- 1030 GET#1,BW$:IFST<>0THEN1070
- 1035 IFBW$<>CHR$(34)THEN1030
- 1040 GET#1,BW$:IFBW$<>CHR$(34)THENPRINTBW$;:GOTO1040
- 1045 GET#1,BW$:IFBW$=CHR$(32)THEN1045
- 1050 PRINTTAB(18);:C$=""
- 1055 C$=C$+BW$:GET#1,BW$:IFBW$<>""THEN1055
- 1060 PRINT""LEFT$(C$,3):IFPEEK(1024)<>32THENPOKE198,0:WAIT198,1
- 1065 IFST=0THEN1015
- 1070 PRINT" BLOCKS FREE":CLOSE1:POKE198,0:WAIT198,1:GOTO765
- 1075 REM*******************************
- 1080 REM OUTPUT PRINTER CONTROL CODES
- 1085 REM*******************************
- 1087 CM$=TEXT$(X)
- 1090 IFLEFT$(CM$,7)="*COLOUR"THENPRINT#1,CHR$(27);CHR$(114);CHR$((RIGHT$(CM$,2))
- 1095 IFLEFT$(CM$,4)="*NLQ"THENPRINT#1,CHR$(27);CHR$(120);CHR$(49);
- 1100 IFLEFT$(CM$,6)="*DRAFT"THENPRINT#1,CHR$(27);CHR$(120);CHR$(48);
- 1105 IFLEFT$(CM$,7)="*ITALIC"THENPRINT#1,CHR$(27);CHR$(52);
- 1110 IFLEFT$(CM$,11)="*ITALIC OFF"THENPRINT#1,CHR$(27);CHR$(53);
- 1115 IFLEFT$(CM$,11)="*EMPHASIZED"THENPRINT#1,CHR$(27);CHR$(69);
- 1120 IFLEFT$(CM$,15)="*EMPHASIZED OFF"THENPRINT#1,CHR$(27);CHR$(70);
- 1125 IFLEFT$(CM$,13)="*DOUBLESTRIKE"THENPRINT#1,CHR$(27);CHR$(71);
- 1130 IFLEFT$(CM$,17)="*DOUBLESTRIKE OFF"THENPRINT#1,CHR$(27);CHR$(72);
- 1135 IFLEFT$(CM$,8)="*REVERSE"THENPRINT#1,CHR$(18);
- 1140 IFLEFT$(CM$,12)="*REVERSE OFF"THENPRINT#1,CHR$(146);
- 1145 IFLEFT$(CM$,10)="*UNDERLINE"THENPRINT#1,CHR$(27);CHR$(45);CHR$(49);
- 1150 IFLEFT$(CM$,14)="*UNDERLINE OFF"THENPRINT#1,CHR$(27);CHR$(45);CHR$(48);
- 1155 IFLEFT$(CM$,12)="*SUPERSCRIPT"THENPRINT#1,CHR$(27);CHR$(83);CHR$(48);
- 1160 IFLEFT$(CM$,10)="*SUBSCRIPT"THENPRINT#1,CHR$(27);CHR$(83);CHR$(49);
- 1165 IFLEFT$(CM$,11)="*SCRIPT OFF"THENPRINT#1,CHR$(27);CHR$(84);
- 1170 IFLEFT$(CM$,9)="*EXPANDED"THENPRINT#1,CHR$(14);
- 1175 IFLEFT$(CM$,13)="*EXPANDED OFF"THENPRINT#1,CHR$(15);
- 1180 IFLEFT$(CM$,5)="*PICA"THENPRINT#1,CHR$(27);CHR$(80);
- 1185 IFLEFT$(CM$,6)="*ELITE"THENPRINT#1,CHR$(27);CHR$(77);
- 1190 IFLEFT$(CM$,13)="*PROPORTIONAL"THENPRINT#1,CHR$(27);CHR$(112);CHR$(49);
- 1195 IFLEFT$(CM$,14)="*PROPORTIONAL OFF"THENPRINT#1,CHR$(27);CHR$(112);CHR$(48);
- 1200 IFLEFT$(CM$,8)="*DOUBLE "THENPRINT#1,CHR$(27);CHR$(119);CHR$(49);
- 1205 IFLEFT$(CM$,7)="*NORMAL"THENPRINT#1,CHR$(27);CHR$(119);CHR$(48);
- 1210 IFLEFT$(CM$,14)="*BOTTOM MARGIN"THENPRINT#1,CHR$(147);
- 1215 IFLEFT$(CM$,10)="*FORM FEED"THENPRINT#1,CHR$(12);
- 1220 IFLEFT$(CM$,12)="*LEFT MARGIN"THENPRINT#1,CHR$(27);CHR$(108);CHR$(RIGHT$(CM$,2));
- 1225 IFLEFT$(CM$,13)="*RIGHT MARGIN"THENPRINT#1,CHR$(27);CHR$(81);CHR$(RIGHT$(CM$,1));
- 1230 IFLEFT$(CM$,13)="*LEFT JUSTIFY"THENPRINT#1,CHR$(27);CHR$(97);CHR$(0);
- 1235 IFLEFT$(CM$,14)="*RIGHT JUSTIFY"THENPRINT#1,CHR$(27);CHR$(97);CHR$(2);
- 1240 IFLEFT$(CM$,7)="*CENTER"THENPRINT#1,CHR$(27);CHR$(97);CHR$(1);
- 1245 IFLEFT$(CM$,6)="*RESET"THENPRINT#1,CHR$(27);CHR$(64);
- 1250 RETURN
-