10
20
30 MODE&84:oflg%=0:
40 *K.10O.|MRUN|M
50 er%=TRUE:ON ERROR PROC_ERROR:er%=TRUE:IF ERR<>17 ANDoflg%=0 GOTO170 ELSE IFoflg% CLS:GOTO170 ELSE GOTO560
60 OSWORD=&FFF1:DIM cblk% 20:IFFNarc:*POINTER 1
70 totalI%=(HIMEM-TOP-2000-(8000 AND FNarc))/32:DIM icons% 32*totalI%
80 ic%=0:thisI%=0:VDU23,132,255,129,129,129,129,129,129,255
90 mx%=0:my%=0:ms%=0:mL%=0:mM%=0:mR%=0
100 xo%=640:yo%=348:*FX225,1
110 *FX226,128
120 *K.11|!J
130 *K.12|!L
140 *K.13|!M
150 *K.14|!N
160 *K.15|!O
170 PRINTTAB(0,30);SPC5;:*FX4,2
180 PROC_CSET:oflg%=0:PRINTTAB(20,24);"Type ";F%AND3
190 PRINTTAB(16,26)"Icon area start: &";~icons%;TAB(13,27)"Display area start: &";~icons%;TAB(18,28)"Maximum icons: ";totalI%
200 RESTORE:Q=9:REPEAT:READ A$:PRINTTAB(18,Q);A$:Q=Q+1:UNTIL A$=""
210 Q=9:REPEAT:READ A$:PRINTTAB(28,Q);A$:Q=Q+1:UNTIL A$=""
220 DATA Get,Put,Load,Save,Quit," "," ",Cursors,to move,& scroll,
230 DATA I Invert,H Rotate ^v,V Rotate <>,+ Rotate +90,- Rotate -90,\ Reflect,/ Reflect,T Reflect ^v,M Reflect <>,F Icon Type,
240 GOTO550
250 DEFPROC_CSET:LOCAL A,B,I:VDU30
260 FOR A=ic% TO ic%+63:IF(A AND15)=0 PRINTSPC(5-LENSTR$A);A;" ";
270 PROCicon(A):IF(A AND 15)=15 PRINT'
280 NEXT:ENDPROC
290 DEFPROCPic(I%):PRINTTAB((I%AND15)*2+6,((I%-ic%)AND&70)DIV8);:PROCicon(I%):ENDPROC
300 DEFPROCicon(I%):IF(F%AND3)=2 PROCic2(I%):ENDPROC
310 LOCAL A%,B%,C%:C%=icons%+I%*32:FOR A%=0 TO 3:VDU23,128+A%:FOR B%=0 TO 7:VDU?C%:C%=C%+1:NEXT:NEXT
320 IF(F%AND1) VDU128,130,8,8,10,129,131,11 ELSE VDU128,129,8,8,10,130,131,11
330 ENDPROC
340 DEFPROCic2(I%):LOCAL A%,B%,C%,D%:C%=icons%+32*I%:FOR A%=0 TO 3:D%=C%+8*(A%AND2)+(A%AND1):VDU23,128+A%:FOR B%=0 TO 7:VDU?D%:D%=D%+2:NEXT:NEXT
350 VDU128,129,8,8,10,130,131,11:ENDPROC
360 DEFPROC_EXPAND(C%):PRINTTAB(20,21);:PROCicon(C%):PRINT" Icon ";C%;" ":PROC_BIGGER:ENDPROC
370 DEFPROCsave128:LOCAL A%,X%,Y%:?cblk%=128:X%=cblk%:Y%=X%DIV256:A%=10:CALL OSWORD:g128=TRUE:VDU23,128,255,129,129,129,129,129,129,255:ENDPROC
380 DEFPROCget128:IFNOTg128 ENDPROC
390 LOCAL X:VDU23,128:FORX=1TO8:VDUcblk%?X:NEXT:g128=0:ENDPROC
400 DEFFNd(A%):=STRING$(3-LENSTR$A%,"0")+STR$A%
410 DEFPROC_BIGGER:LOCAL A,X,Y
420 FOR Y=0 TO 15:PRINTTAB(1,9+Y);:FOR X=0 TO 15
430 IF POINT(xo%+X*4,yo%-Y*4) COLOUR135:VDU32:COLOUR128:A=A+1 ELSE VDU132
440 NEXT:NEXT:ENDPROC
450 DEFPROCwait:PROCmse:IFms% GCOL4,0:MOVEmx%-12,my%:DRAWmx%+12,my%:MOVEmx%,my%-12:DRAWmx%,my%+12
460 A$=INKEY$(5):IFms% MOVEmx%-12,my%:DRAWmx%+12,my%:MOVEmx%,my%-12:DRAWmx%,my%+12
470 ENDPROC
480 DEFPROC_ERROR:IFoflg%=0 PRINTTAB(0,30);SPC(38);
490 IFer% er%=FALSE:CLOSE#0
500 PRINTTAB(0,31);SPC38;:IF ERR<>17 GOTO540
510 IF INKEY-1 ANDINKEY-2 OSCLI"FX4":PRINTTAB(0,29)':END
520 *FX4,2
530 PRINTTAB(0,29)SPC28;:ENDPROC
540 PRINTTAB(0,29)SPC(38)';:REPORT:IF ERR<128 ANDINKEY-1 PRINT" at line ";ERL:OSCLI"FX4":END ELSE A$=GET$:PRINTTAB(0,31);SPC(38);:ENDPROC
550 X=0:Y=0:PROC_EXPAND(thisI%)
560 VDU31,X+1,Y+9:GCOL 0,7
570 REPEAT:PROCwait
580 IFmx%>8 ANDmx%<564 ANDmy%>200 ANDmy%<756 PROCmsKlk
590 IFmx%>196 ANDmx%<1216 ANDmy%>764 PROCmsChr
600 IFmy%<736 AND((mx%>576 ANDmy%>576)OR(mx%>899 ANDmy%>412))ANDmL% PROCklik2
610 IFmy%<192 AND my%>64 AND mx%>420 AND mL% A$="D"
620 UNTILA$<>"":GCOL0,7
630 IFA$>"`" AND A$<"{" A$=CHR$(ASCA$-32)
640 IF A$=CHR$204 X=(X-1) AND15
650 IF A$=CHR$205 X=(X+1) AND15
660 IF A$=CHR$206 Y=(Y+1) AND15
670 IF A$=CHR$207 Y=(Y-1) AND15
680 IF A$>CHR$139 AND A$<CHR$144 PROC_SCROLL((ASCA$)-140)
690 IF A$=CHR$13 OR A$="P" GOTO910
700 IF A$="*" GOTO970
710 IF A$="S" GOTO1000
720 IF A$="L" GOTO1040
730 IF (A$=CHR$202 OR A$=CHR$9) AND POINT(xo%+X*4,yo%-Y*4)=0 A$="1"
740 IF (A$=CHR$202 OR A$=CHR$9) A$="0"
750 IF A$="1" PLOT 69,xo%+X*4,yo%-Y*4:COLOUR135:VDU31,X+1,Y+9,32,8:COLOUR128:GOTO570
760 IF A$="0" PLOT 71,xo%+X*4,yo%-Y*4:PROCsave128:VDU31,X+1,Y+9,128,8:PROCget128:GOTO570
770 IF A$="G" OR A$="C" INPUTTAB(0,29)"Get which icon: "thisI%:PRINTTAB(0,29);SPC(20);:GOTO550
780 IF A$="F" F%=(F%+1)MOD3:PRINTTAB(25,24);F%AND3:PROC_CSET:GOTO560
790 IF A$="I" PROCinv:GOTO560
800 IF A$="H" PROCrotH:GOTO560
810 IF A$="V" PROCrotV:GOTO560
820 IF A$="+" OR A$=";" PROCrotP:GOTO560
830 IF A$="-" OR A$="=" PROCrotM:GOTO560
840 IF A$="/" OR A$="?" PROCrefD1:GOTO560
850 IF A$="\" OR A$="|" PROCrefD2:GOTO560
860 IF A$="T" PROCtip:GOTO560
870 IF A$="M" PROCmirr:GOTO560
880 IF A$="Q" PROCquit:GOTO560
890 IF A$="D" INPUTTAB(0,29)"Display start icon "ic%:ic%=(ic%AND&FFF0):PROC_CSET:PRINTTAB(34,27);~icons%+32*ic%" ";TAB(0,29)SPC(38);:GOTO560
900 GOTO560
910 INPUTTAB(0,29)"Enter onto icon "ch%:PRINTTAB(0,29);"Please wait..."SPC10:D%=icons%+32*ch%:I%=D%
920 FOR C%=0 TO 3:IF(F%AND3)=2 I%=D%+8*(C%AND2)+(C%AND1)
930 FOR A%=0 TO 7:Q%=0:FOR B%=0 TO 7:Q%=Q%*2:IFPOINT(xo%+B%*4+32*(C%AND1),yo%-A%*4-16*(C%AND2)) Q%=Q%+1
940 NEXT:IF(F%AND3)=2 ?I%=Q%:I%=I%+2 ELSE IF(F%AND1) ?(I%+((C%DIV2)+2*(C%AND1))*8+A%)=Q% ELSE ?(I%+C%*8+A%)=Q%
950 NEXT:NEXT:PRINTTAB(0,29)SPC(20):IF(ch%AND&FFC0)=ic% PROCPic(ch%)
960 GOTO560
970 PRINTTAB(0,28);"*";
980 OSCLI"FX4":oflg%=TRUE:REPEAT:INPUT LINE""A$:OSCLI A$:PRINT":";:REPEATA$=GET$:UNTILINSTR(CHR$13+"LlSs*",A$):IFA$="*" VDU127,42
990 UNTIL A$<>"*":PRINT':IF A$="L" OR A$="l" GOTO 1040 ELSE IF A$=CHR$13 oflg%=0:CLS:GOTO170
1000 PRINTTAB(0,30);:OSCLI"FX4":INPUT"Filename to save by: "A$:PRINTTAB(0,30);SPC(38)
1010 INPUTTAB(0,29);"Start at icon "start
1020 PRINTTAB(0,29);SPC16;:INPUTTAB(0,29);"End at icon "end:PRINTTAB(0,29)SPC(16)
1030 OSCLI"FX4,2":OSCLI"SAVE "+A$+" "+STR$~(icons%+start*32)+" "+STR$~(icons%+end*32+32)+" FFFFFF00 FFFFFD00":CLS:GOTO170
1040 OSCLI"FX4":INPUTTAB(0,30);"Filename to load: "A$:PRINTTAB(0,30);SPC(38)
1050 INPUTTAB(0,29)"Start at icon "start
1060 OSCLI"LOAD "+A$+" "+STR$~(icons%+start*32):CLS:GOTO170
1070 DEFPROC_SCROLL(A):LOCAL X,Y,xs,xe,xst,ys,ye,yst,temp
1080 ON A+1 GOSUB 1110,1100,1150,1160
1090 PROC_BIGGER:GCOL0,7:ENDPROC
1100 xs=15:xe=1:xst=-1:GOTO1120
1110 xs=0:xe=14:xst=1
1120 FOR Y=0 TO 15:temp=POINT(xo%+xs*4,yo%-Y*4):FOR X=xs TO xe STEP xst
1130 GCOL 0,POINT(xo%+(X+xst)*4,yo%-Y*4):PLOT 69,xo%+X*4,yo%-Y*4:NEXT
1140 GCOL 0,temp:PLOT 69,xo%+(xe+xst)*4,yo%-Y*4:NEXT:RETURN
1150 ys=15:ye=1:yst=-1:GOTO1170
1160 ys=0:ye=14:yst=1
1170 FOR X=0 TO 15
1180 temp=POINT(xo%+X*4,yo%-ys*4):FOR Y=ys TO ye STEP yst
1190 GCOL 0,POINT(xo%+X*4,yo%-(Y+yst)*4):PLOT 69,xo%+X*4,yo%-Y*4:NEXT
1200 GCOL 0,temp:PLOT 69,xo%+X*4,yo%-(ye+yst)*4:NEXT
1210 RETURN
1220 DEFPROCmsKlk:IFmL%+mM%+mR%=0 ENDPROC
1230 IFmx%<32 A$=CHR$140:ENDPROC
1240 IFmx%>539 A$=CHR$141:ENDPROC
1250 IFmy%<224 A$=CHR$142:ENDPROC
1260 IFmy%>732 A$=CHR$143:ENDPROC
1270 IFmL% A$="1"
1280 IFmM% A$=CHR$9
1290 IFmR% A$="0"
1300 X=mx%DIV32-1:Y=22-my%DIV32:VDU31,X+1,Y+9
1310 IFmM% REPEATPROCmse:UNTILNOTmM%
1320 ENDPROC
1330 DEFPROCmsChr:IFmL%+mR%=0 ENDPROC
1340 ch%=(mx%-196)DIV64+16*(15-my%DIV64)+ic%
1350 IFmL% A$="C"
1360 IFmR% A$=CHR$13
1370 OSCLI"FX138,0,"+STR$(48+ch%DIV100):ch%=ch%MOD100
1380 OSCLI"FX138,0,"+STR$(48+ch%DIV10):ch%=ch%MOD10
1390 OSCLI"FX138,0,"+STR$(48+ch%):OSCLI"FX138,0,13"
1400 ENDPROC
1410 DEFPROCklik2:LOCAL x%:x%=mx%DIV32:IFx%>27 x%=28 ELSE x%=18
1420 VDU31,x%,31-my%DIV32:A%=135:ch%=(USR&FFF4 AND&FF00)DIV256:A$=CHR$ch%:VDU31,X+1,Y+8:ENDPROC
1430 DEFPROCmse:LOCALX%,Y%,A%
1440 IFFNarc mx%=ADVAL(7):my%=ADVAL(8):mL%=INKEY-10:mM%=INKEY-11:mR%=INKEY-12:ENDPROC
1450 X%=cblk%:Y%=X%DIV256:A%=64:!X%=-1:CALL&FFF1:ms%=!X%<>-1:IFNOTms% ENDPROC
1460 mx%=!X%AND&FFFF:my%=X%!2 AND&FFFF
1470 mL%=(X%?6 AND32)=0:mM%=(X%?6 AND64)=0:mR%=(X%?6 AND128)=0:ENDPROC
1480 DEFPROCinv:LOCAL A,X,Y
1490 GCOL 4,0:FOR X=0 TO 15:FOR Y=0 TO 15:PLOT 69,xo%+X*4,yo%-Y*4:NEXT:NEXT:PROC_BIGGER:ENDPROC
1500 DEFPROCrotH:LOCAL A,X,Y
1510 FOR X=0 TO 15:FOR Y=0 TO 7:A=POINT(xo%+X*4,yo%-Y*4):GCOL 0,POINT(xo%+X*4,yo%-60+Y*4):PLOT 69,xo%+X*4,yo%-Y*4:GCOL 0,A:PLOT 69,xo%+X*4,yo%-60+Y*4:NEXT:NEXT:PROC_BIGGER:ENDPROC
1520 DEFPROCrotV:LOCAL A,X,Y
1530 FOR Y=0 TO 15:FOR X=0 TO 7:A=POINT(xo%+X*4,yo%-Y*4):GCOL 0,POINT(xo%+60-X*4,yo%-Y*4):PLOT 69,xo%+X*4,yo%-Y*4:GCOL 0,A:PLOT 69,xo%+60-X*4,yo%-Y*4:NEXT:NEXT:PROC_BIGGER:ENDPROC
1540 DEFPROCrefD2:LOCAL A,X,Y
1550 PRINTTAB(0,30)"Copy Topright or Bottomleft?";:A=FNupDn("TB"):PRINTTAB(0,30)SPC30;
1560 FOR X=0 TO 15:FOR Y=X TO 15:IF A GCOL 0,POINT(xo%+4*X,yo%-4*Y):PLOT 69,xo%+4*Y,yo%-4*X ELSE GCOL 0,POINT(xo%+4*Y,yo%-4*X):PLOT 69,xo%+4*X,yo%-4*Y
1570 NEXT:NEXT:PROC_BIGGER:ENDPROC
1580 DEFPROCrefD1:LOCAL A,X,Y
1590 PRINTTAB(0,30)"Copy Topleft or Bottomright?";:A=FNupDn("TB"):PRINTTAB(0,30)SPC30;
1600 FOR Y=0 TO 15:FOR X=Y TO 15:IF A GCOL 0,POINT(xo%+60-4*Y,yo%-4*X):PLOT 69,xo%+60-4*X,yo%-4*Y ELSE GCOL 0,POINT(xo%+60-4*X,yo%-4*Y):PLOT 69,xo%+60-4*Y,yo%-4*X
1610 NEXT:NEXT:PROC_BIGGER:ENDPROC
1620 ENDPROC
1630 DEFFNupDn(B$):LOCAL x%:x%=POS*32:REPEAT:PROCwait:UNTILmL%+mM%+mR%=0:REPEAT:PROCwait:IFA$>"`" A$=CHR$(ASCA$-32)
1640 IFmR% AND B$="NY" A$="N"
1650 IFmL% AND my%<64 AND mx%<x% THEN A$=MID$(B$,1+2*mx%DIVx%,1):IFB$="NY" A$="Y"
1660 UNTILINSTR(B$,A$) AND A$<>"":PRINTA$;:=INSTR(B$,A$)=2
1670 DEFPROCrotP:PROCrotD2:PROCrotV:ENDPROC
1680 ENDPROC
1690 DEFPROCrotM:PROCrotD1:PROCrotH:ENDPROC
1700 ENDPROC
1710 DEFPROCrotD1:LOCAL A,X,Y:FOR X=0 TO 15:FOR Y=X TO 15:A=POINT(xo%+4*X,yo%-4*Y):GCOL 0,POINT(xo%+4*Y,yo%-4*X):PLOT 69,xo%+4*X,yo%-4*Y:GCOL 0,A:PLOT 69,xo%+4*Y,yo%-4*X:NEXT:NEXT:ENDPROC
1720 DEFPROCrotD2:LOCAL A,X,Y
1730 FOR Y=0 TO 15:FOR X=Y TO 15
1740 A=POINT(xo%+4*X,yo%-4*Y):GCOL 0,POINT(xo%+4*Y,yo%-4*X):PLOT 69,xo%+4*X,yo%-4*Y:GCOL 0,A:PLOT 69,xo%+4*Y,yo%-4*X:NEXT:NEXT:ENDPROC
1750 DEFPROCtip:LOCAL A,X,Y
1760 PRINTTAB(0,30);"Copy Top or Bottom?";:A=NOTFNupDn("TB"):PRINTTAB(0,30)SPC20;
1770 FOR X=0 TO 15:FOR Y=0 TO 7:IF A GCOL 0,POINT(xo%+4*X,yo%-4*Y):PLOT 69,xo%+X*4,yo%-60+Y*4 ELSE GCOL 0,POINT(xo%+4*X,yo%-60+4*Y):PLOT 69,xo%+X*4,yo%-Y*4
1780 NEXT:NEXT:PROC_BIGGER:ENDPROC
1790 DEFPROCmirr:LOCAL A,X,Y
1800 PRINTTAB(0,30);"Copy Left or Right?";:A=NOTFNupDn("LR"):PRINTTAB(0,30)SPC20;
1810 FOR Y=0 TO 15:FOR X=0 TO 7:IF A GCOL 0,POINT(xo%+4*X,yo%-4*Y):PLOT 69,xo%+60-X*4,yo%-Y*4 ELSE GCOL 0,POINT(xo%+60-4*X,yo%-4*Y):PLOT 69,xo%+X*4,yo%-Y*4
1820 NEXT:NEXT:PROC_BIGGER:ENDPROC
1830 DEFPROCquit:PRINTTAB(0,30);"Quit program? ";:A=FNupDn("NY"):PRINTTAB(0,30)SPC20;TAB(0,29);:IF A OSCLI"FX4":END ELSE ENDPROC
1840 DEFFNarc=(INKEY-256 AND&F0)=&A0
1990 :
2000 DEFPROClist
2010 FOR AD%=&9B00 TO &BFFF STEP 32*4
2020 PRINT"&";~AD%;" ";
2030 FOR AD2%=AD% TO AD%+32*4-1 STEP 32
2040 PROCicon((AD2%-&9B00)DIV32):VDU32
2050 NEXT:IF(AD%AND&80):PRINT'' ELSE VDU32
2060 NEXT
2070 ENDPROC