home *** CD-ROM | disk | FTP | other *** search
- 100 '***************************** ESCHER CUBES ******************************
- 110 '***************************** By Jim Luczak *****************************
- 120 '*************************** Ver 1.4d 2/6/87 ****************************
- 130 dim mhl(26),cl0(15),cl1(15),cl2(15),cl3(15),tx(56),titlep(10),ctx$(10)
- 140 max=5000:dim ps(5000),fv(10),fm(4):path=0:icon=3:priority=2
- 150 a#=gb:gintin=peek(a#+8):gintout=peek(a#+12):pl#=1114
- 160 addrin=peek(a#+16):path$="\*.CUB":path1$=path$+string$(24,chr$(0))
- 170 test$="\"+chr$(14)+chr$(15):button$="CANCEL|DELETE":button1$=button$
- 180 box$="Verify DELETE Operation":box1$=box$
- 190 if peek(systab)=4 then goto LOWREZMSG
- 200 if peek(systab)=2 then restore MEDREZ
- 210 if peek(systab)=1 then restore HIREZ
- 220 read v1,v2,v3,v4,v5,st,t1,t2,cm1,cm2,j,j1,txty,rz,dfy,dth,ta,mkc1
- 230 read y7,y8,y12,y13,ta2,ta3,ta4,ta5
- 240 for x=1 to 4:read fm(x):next x
- 250 for x=1 to 10:read fv(x):next x
- 260 for x=0 to 15:read cl0(x):next x
- 270 for x=0 to 15:read cl1(x):next x
- 280 for x=0 to 15:read cl2(x):next x
- 290 for x=0 to 15:read cl3(x):next x
- 300 restore CBARDAT
- 310 for x=1 to 26:read mhl(x):next x
- 320 for x=0 to 56:read tx(x):next x
- 330 for x=0 to 10:read titlep(x):next x
- 340 restore CNTDATA
- 350 for x=1 to 9:read ctx$(x):next x
- 360 ctx$(10)=chr$(14)+chr$(15)+" Exit Program "+chr$(14)+chr$(15)
- 370 sz=4:a=cm1*sz:b=cm2*sz:c=3*sz:sd=4:sd1=4
- 380 dfx=304:lv=-1:lh=0:mkc2=3:c1=1:c2=2:c3=3
- 390 ind=2:st1=st:ts=30/j:rzm=1:lc=3:lc1=1:lc2=2:cl$=space$(50)
- 400 title$=chr$(32)+chr$(1)+chr$(32)+chr$(2)+chr$(32)+chr$(3)+chr$(32)+chr$(4)
- 410 title$=title$+chr$(32)+chr$(t1)+chr$(32)+chr$(t2)
- 420 title$=title$+" Col= 0 Bkg= 0 Fill= Erase OFF Clear "
- 430 title$=title$+"Size= 4 "+chr$(8)+chr$(32)+chr$(0)
- 440 tlt1$=chr$(32)+chr$(14)+chr$(15)+" Escher Cubes File Control "
- 450 tlt1$=tlt1$+chr$(14)+chr$(15)+chr$(32)+chr$(0)
- 460 tlt2$=" 1= "+chr$(1)+" 2= "+chr$(2)+" 3= "+chr$(3)+" 4= "+chr$(4)
- 470 tlt2$=tlt2$+" 5= "+chr$(t1)+" 6= "+chr$(t2)
- 480 tlt2$=tlt2$+" 7= Col"+chr$(1)+" 8= Bkg"+chr$(1)+" 9= Fill"
- 490 tlt2$=tlt2$+chr$(1)+chr$(32)+chr$(0)
- 500 tlt3$=" Escher Cubes "+chr$(0)
- 510 eds$=" 10= Erase ON/OFF 11= Clear 12= Size"+chr$(1)
- 520 eds$=eds$+" 14= Col"+chr$(2)+" 16= Bkg"+chr$(2)+" 18= Fill"+chr$(2)
- 530 eds1$=" 24= Size"+chr$(2)+" -1= Place Cube XXX YYY -2= NUL"
- 540 eds1$=eds1$+" -3= End -4= Hi -8= Lo"
- 550 gosub TITLEPAGE:poke systab+24,1:gosub SETCOLOR
- 560 txsz=56:txtx=161:gosub DOTEXT:gosub DOCONTROLS
- 570 restore CUBEP:gosub MOUSEFORM
- 580 x=dfx:y=dfy:mx1=dfx:my1=dfy:x1=dfx:y1=dfy
- 590 '----------------------------- MOUSE CONTROLLER -------------------------
- 600 gosub MOUSEON
- 610 mk=0:hc1=-2:while mk=0
- 620 poke contrl,124:poke contrl+2,0:poke contrl+6,0:vdisys(1)
- 630 mx=peek(ptsout):my=peek(ptsout+2):mkey=peek(intout)
- 640 if mkey=1 or mkey=2 then gosub CHECKMOUSE
- 650 if hc1>0 and hc1<7 then gosub DOCUBE
- 660 if hc1>6 and hc1<14 then gosub CONTROLBAR
- 670 if hc1=14 then mx=mx1:my=my1:hc1=-1
- 680 if hc1=15 then mx=x1:my=y1:hc1=-1
- 690 if mkey=2 then hc1=-2:gosub COORD
- 700 if hc1=-1 then gosub PLACECUBE
- 710 hc1=-2:wend
- 720 '--------------------------- CLEAN-UP AND END ---------------------------
- 730 CLEANUP:gosub MOUSEOFF
- 740 clearw 2:poke systab+24,0:tlt=1:title$=" OUTPUT "+chr$(0)
- 750 gosub DOCONTROLS:plt%(0)=1911:plt%(1)=1792:plt%(2)=112:plt%(3)=0
- 760 poke pl#,varptr(plt%(0)):color 1,1,1
- 770 restore DEFAULTP:gosub MOUSEFORM:clear:end
- 780 '------------------------ LOW RESOLUTION MESSAGE -----------------------
- 790 LOWREZMSG:icon=1:priority=1:box1$=" |":fullw 2:clearw 2
- 800 box$=chr$(14)+chr$(15)+" ESCHER CUBES "+chr$(14)+chr$(15)+"|"
- 810 box$=box$+box1$+chr$(3)+" Set Preference To "+chr$(4)
- 820 button$=chr$(175)+" MEDIUM RESOLUTION "+chr$(174):gosub FORMBOX:end
- 830 '---------------------------- ERROR HANDLER -----------------------------
- 840 close #1:if dp=1 then dp=0:goto ERD
- 850 open "R",#1,f$,3:field #1,3 as am$:lset am$=a$:put #1,1:close #1:kill f$
- 860 ERD:?chr$(7);:resume GETANS1
- 870 '------------------------------- MOUSE ON -------------------------------
- 880 MOUSEON:poke gintin,257:gemsys(78):return
- 890 '------------------------------- MOUSE OFF ------------------------------
- 900 MOUSEOFF:poke gintin,256:gemsys(78):return
- 910 '-------------------------- CHECK MOUSE LOCATION ------------------------
- 920 CHECKMOUSE:
- 930 mc=0:hc=1:hc1=1:hct=26
- 940 if my<v1 then gosub MCC:return
- 950 if my>v2 then hc1=-1:return
- 960 while mc=0
- 970 if mx>=mhl(hc) and mx<=mhl(hc+1) then mc=1
- 980 if mc=0 then hc1=hc1+1
- 990 hc=hc+2:if hc>hct then mc=1
- 1000 wend:if hc1>hct/2 then hc1=-1
- 1010 return
- 1020 MCC:if mx>162 and mx<353 then hc1=14:return
- 1030 if mx>354 and mx<532 then hc1=15:return
- 1040 hc1=-2:return
- 1050 '----------------------- CONTROL BAR CONTROLLER -------------------------
- 1060 CONTROLBAR:
- 1070 on hc1-6 goto CB1,CB2,CB3,CB4,CB5,CB6,CB7
- 1080 CB1:if mkey=1 then cr1=cr1+1:if cr1>15 then cr1=0
- 1090 if mkey=2 then cr1=cr1-1:t=1:if cr1<0 then cr1=15
- 1100 gosub DOCUCOL:goto BARDONE
- 1110 CB2:if mkey=1 then cr0=cr0+1:if cr0>15 then cr0=0
- 1120 if mkey=2 then cr0=cr0-1:t=1:if cr0<0 then cr0=15
- 1130 gosub DOBCK:goto BARDONE
- 1140 CB3:if mkey=1 then gosub PATUP
- 1150 if mkey=2 then gosub PATDN
- 1160 gosub DOSTYLE:goto BARDONE
- 1170 CB4:gosub DOERASE:goto BARDONE
- 1180 CB5:gosub CLEARSCR:goto BARDONE
- 1190 CB6:if mkey=1 then sz=sz+1:if sz>12 then sz=1
- 1200 if mkey=2 then sz=sz-1:t=1:if sz<1 then sz=12
- 1210 gosub DOSIZE:goto BARDONE
- 1220 CB7:goto CNTSCREEN
- 1230 CB7A:ps(h)=hc1:gosub CLEARSCR:gosub PLAYBACK:goto BARD
- 1240 BARDONE:ps(h)=hc1:if t=1 then t=0:ps(h)=hc1*2
- 1250 h=h+1:if h>max then h=max:ps(h)=13
- 1260 BARD:mkey=1:return
- 1270 PATUP:st=st+1:if st>24 then st=1:ind=3
- 1280 if st>12 and ind=3 then ind=2:st=1
- 1290 return
- 1300 PATDN:st=st-1:t=1:if st<1 and ind=2 then ind=3:st=12
- 1310 if st<1 and ind=3 then ind=2:st=24
- 1320 return
- 1330 '--------------------------- CUBE CONTROLLER ----------------------------
- 1340 DOCUBE:gosub MOUSEOFF
- 1350 on hc1 goto UP,DOWN,RIGHT,LEFT,FORWARD,BACKWARD
- 1360 UP:y=y-b:gosub SETCUBE:gosub DOBOX:goto CUBEDONE
- 1370 DOWN:y=y+b:if hc2=3 then sd=4:sd1=3
- 1380 if hc2=6 then sd=3:sd1=4
- 1390 gosub SETCUBE:gosub FRONT:sd=sd1:gosub SIDE:goto CUBEDONE
- 1400 RIGHT:x=x+c:y=y-a:gosub SETCUBE
- 1410 if hc2=2 then sd=4:sd1=3:gosub SETRTOP
- 1420 if hc2=6 then sd=3:sd1=4:gosub SETRFRONT
- 1430 gosub FRONT:sd=sd1:gosub TOP:goto CUBEDONE
- 1440 LEFT:x=x-c:y=y+a:gosub SETCUBE:gosub DOBOX:goto CUBEDONE
- 1450 FORWARD:x=x+c:y=y+a:gosub SETCUBE:gosub DOBOX:goto CUBEDONE
- 1460 BACKWARD:x=x-c:y=y-a:gosub SETCUBE
- 1470 if hc2=2 then sd=3:sd1=4
- 1480 if hc2=3 then sd=4:sd1=3:gosub SETBSIDE
- 1490 gosub TOP:sd=sd1:gosub SIDE
- 1500 CUBEDONE:hc2=hc1:sd=4:sd1=4:gosub MOUSEON
- 1510 gosub DOSOUND:mkey=1:ps(h)=hc1
- 1520 h=h+1:if h>max then h=max:ps(h)=13
- 1530 return
- 1540 '----------------------------- PLACE CUBE -------------------------------
- 1550 PLACECUBE:x=mx:y=my*rzm:hc2=hc1
- 1560 if h+3>max then goto PL1
- 1570 ps(h)=hc1:ps(h+1)=mx:ps(h+2)=my
- 1580 gosub DOBOXA:gosub MOUSEON
- 1590 PL1:h=h+3:if h>max then h=max:ps(h)=13
- 1600 return
- 1610 '------------------------------ CLEAR SCREEN ----------------------------
- 1620 CLEARSCR:if t3<>1 then reset:gosub MOUSEOFF:clearw 2:gosub MOUSEON
- 1630 er=1:sz=4:st=st1:cr0=0:cr1=0:ind=2:gosub DOCUCOL
- 1640 x=dfx:y=dfy:mx1=dfx:my1=dfy:x1=dfx:y1=dfy
- 1650 gosub DOSIZE:gosub DOERASE:gosub DOBCK
- 1660 restore COORDTEXT:for z=0 to 5:read tx(z):next z
- 1670 v6=v3:v3=0:v7=v4:v4=639:gosub SETCLIP:v3=v6:v4=v7
- 1680 txsz=56:txtx=161:gosub DOTEXT:gosub SETCLIP:return
- 1690 '---------------------------- DRAW WHOLE CUBE ---------------------------
- 1700 DOBOXA:gosub SETCUBE:gosub DOSOUND:gosub MOUSEOFF
- 1710 DOBOX:gosub FRONT:gosub TOP:gosub SIDE:return
- 1720 '--------------------------- DRAW CUBE TOP ------------------------------
- 1730 TOP:color 1,c1,1,st,ind
- 1740 poke contrl,9:poke contrl+2,sd:poke contrl+6,0
- 1750 poke ptsin,tx:poke ptsin+2,ty
- 1760 poke ptsin+4,tx1:poke ptsin+6,ty1
- 1770 poke ptsin+8,tx2:poke ptsin+10,ty2
- 1780 poke ptsin+12,tx3:poke ptsin+14,ty3
- 1790 vdisys(1):return
- 1800 '--------------------------- DRAW CUBE FRONT ----------------------------
- 1810 FRONT:color 1,c2,1,st,ind
- 1820 poke contrl,9:poke contrl+2,sd:poke contrl+6,0
- 1830 poke ptsin,fx:poke ptsin+2,fy
- 1840 poke ptsin+4,fx1:poke ptsin+6,fy1
- 1850 poke ptsin+8,fx2:poke ptsin+10,fy2
- 1860 poke ptsin+12,fx3:poke ptsin+14,fy3
- 1870 vdisys(1):return
- 1880 '---------------------------- DRAW CUBE SIDE ----------------------------
- 1890 SIDE:color 1,c3,1,st,ind
- 1900 poke contrl,9:poke contrl+2,sd:poke contrl+6,0
- 1910 poke ptsin,sx:poke ptsin+2,sy
- 1920 poke ptsin+4,sx1:poke ptsin+6,sy1
- 1930 poke ptsin+8,sx2:poke ptsin+10,sy2
- 1940 poke ptsin+12,sx3:poke ptsin+14,sy3
- 1950 vdisys(1):return
- 1960 '---------------------------- SET CUBE PARAMETERS -----------------------
- 1970 SETCUBE:
- 1980 tx=x:ty=y-b:tx1=x-c:ty1=y-a:tx2=x:ty2=y:tx3=x+c:ty3=y-a
- 1990 fx=x:fy=y:fx1=x:fy1=y+b:fx2=x+c:fy2=y+a:fx3=x+c:fy3=y-a
- 2000 sx=x:sy=y:sx1=x:sy1=y+b:sx2=x-c:sy2=y+a:sx3=x-c:sy3=y-a:return
- 2010 SETRTOP:
- 2020 tx=x:ty=y-b:tx1=x+c:ty1=y-a:tx2=x:ty2=y:tx3=x-c:ty3=y-a:return
- 2030 SETRFRONT:
- 2040 fx=x:fy=y:fx1=x+c:fy1=y-a:fx2=x+c:fy2=y+a:fx3=x:fy3=y+b:return
- 2050 SETBSIDE:
- 2060 sx=x:sy=y:sx1=x-c:sy1=y-a:sx2=x-c:sy2=y+a:sx3=x:sy3=y+b:return
- 2070 '---------------------------- DISPLAY CONTROLS --------------------------
- 2080 DOCONTROLS:
- 2090 poke gintin,peek(systab+8):poke gintin+2,2
- 2100 s#=gintin+4:poke s#,varptr(title$):gemsys(105):if tlt=1 then tlt=0:return
- 2110 gosub STBOX:return
- 2120 '--------------------------- SET CUBE COLOR -----------------------------
- 2130 DOCUCOL:gosub SETCOLOR
- 2140 a$=str$(cr1):if len(a$)=3 then mid$(title$,19,len(a$))=a$
- 2150 if len(a$)=2 then mid$(title$,20,len(a$))=a$
- 2160 gosub DOCONTROLS:gosub DOSOUND1:return
- 2170 '------------------------- SET BACKGROUND COLOR -------------------------
- 2180 DOBCK:gosub SETCOLOR
- 2190 a$=str$(cr0):if len(a$)=3 then mid$(title$,28,len(a$))=a$
- 2200 if len(a$)=2 then mid$(title$,29,len(a$))=a$
- 2210 gosub DOCONTROLS:gosub DOSOUND1:return
- 2220 '--------------------------- SET INTERIOR INDEX --------------------------
- 2230 DOSTYLE:gosub DOCONTROLS:gosub DOSOUND1:return
- 2240 STBOX:color 1,1,1,st,ind:gosub MOUSEOFF
- 2250 poke contrl,129:poke contrl+2,2:poke contrl+6,1:poke intin,0:vdisys(1)
- 2260 poke contrl,11:poke contrl+2,2:poke contrl+6,0:poke contrl+10,1
- 2270 poke ptsin,327:poke ptsin+2,v1
- 2280 poke ptsin+4,359:poke ptsin+6,v2-1
- 2290 vdisys(1):gosub MOUSEON:gosub SETCLIP:return
- 2300 '--------------------------- TOGGLE ERASE MODE --------------------------
- 2310 DOERASE:
- 2320 if er=0 then er=1:c1=0:c2=0:c3=0:a$="ON "else er=0:c1=1:c2=2:c3=3:a$="OFF"
- 2330 mid$(title$,49,3)=a$:gosub DOCONTROLS:gosub DOSOUND1
- 2340 if er=1 then gosub MOUSEOFF:gosub DOBOX
- 2350 if er=1 then gosub MOUSEON
- 2360 return
- 2370 '---------------------------- SET CUBE SIZE -----------------------------
- 2380 DOSIZE:a=cm1*sz:b=cm2*sz:c=3*sz:sd=4:sd1=4
- 2390 a$=str$(sz):if len(a$)=3 then mid$(title$,66,len(a$))=a$
- 2400 if len(a$)=2 then mid$(title$,67,len(a$))=a$
- 2410 gosub DOCONTROLS:gosub DOSOUND1:return
- 2420 '------------------------------ SET CLIPPING ----------------------------
- 2430 SETCLIP:
- 2440 poke contrl,129:poke contrl+2,2:poke contrl+6,1
- 2450 poke intin,1:poke ptsin,0:poke ptsin+2,v3
- 2460 poke ptsin+4,v4:poke ptsin+6,v5:vdisys(1):return
- 2470 '------------------------------SOUND ROUTINE ----------------------------
- 2480 DOSOUND:
- 2490 sound 1,0,13-sz,hc1+2,0:wave 1,1,1,1024,0:return
- 2500 DOSOUND1:
- 2510 sound 1,0,7,5,0:wave 1,1,1,1024,0:return
- 2520 DOSOUND2:
- 2530 sound 1,0,fc1,8,0:wave 1,1,1,1024,0:return
- 2540 '--------------------------- SET COLOR ROUTINE --------------------------
- 2550 SETCOLOR:
- 2560 plt%(0)=cl0(cr0):plt%(1)=cl1(cr1):plt%(2)=cl2(cr1):plt%(3)=cl3(cr1)
- 2570 SETC:poke pl#,varptr(plt%(0)):return
- 2580 '-------------------------- PLAYBACK RECORDER ---------------------------
- 2590 PLAYBACK:
- 2600 mc1=0:h=0:t3=1:while mc1=0
- 2610 if h+2>max then mc1=1:goto PLAYEND
- 2620 hc1=ps(h):if hc1>13 then hc1=hc1/2:mkey=2
- 2630 if hc1<-3 then rzm=abs(hc1)/rz:h=h+1:goto PLAYEND
- 2640 if hc1=13 or hc1=-3 then mc1=1:goto PLAYEND
- 2650 if hc1=-2 then h=h+1:goto PLAYEND
- 2660 if hc1>0 and hc1<7 then gosub DOCUBE
- 2670 if hc1>6 and hc1<13 then gosub CONTROLBAR
- 2680 if hc1=-1 then mx=ps(h+1):my=ps(h+2):gosub PLACECUBE
- 2690 if hc1>13 then h=h+1
- 2700 PLAYEND:if h>max then h=max:mc1=1
- 2710 wend:t3=0:rzm=1:if h=0 then return
- 2720 if ps(h-1)<>(-rz) then ps(h)=-rz:h=h+1:if h>max then h=max
- 2730 return
- 2740 '--------------------------- SHOW COORDINATES ---------------------------
- 2750 COORD:
- 2760 mx$=str$(mx):my$=str$(my):x$=str$(x):y$=str$(y):h$=str$(h)
- 2770 txsz=4:mx1=mx:my1=my:x1=x:y1=y:z1=4
- 2780 if mx>v4 then mx$=str$(v4):mx1=v4
- 2790 if my<v1 then my$=str$(v1):my1=v1
- 2800 if my>v5 then my$=str$(v5):my1=v5
- 2810 v6=v3:v3=0:v7=v4:v4=639:gosub SETCLIP:v3=v6:v4=v7
- 2820 xx$=mx$:txtx=270:gosub CD:gosub DOTEXT
- 2830 xx$=my$:txtx=320:gosub CD:gosub DOTEXT
- 2840 xx$=x$:txtx=446:gosub CD:gosub DOTEXT
- 2850 xx$=y$:txtx=494:gosub CD:gosub DOTEXT
- 2860 xx$=h$:txtx=579:z1=5:gosub CD:gosub DOTEXT
- 2870 gosub SETCLIP:z1=4:return
- 2880 CD:if len(xx$)<z1 then xx$=xx$+space$(z1)
- 2890 for z=0 to z1-1:a$=mid$(xx$,z+1,1)
- 2900 if a$=" " then tx(z)=32 else tx(z)=val(a$)+48
- 2910 next z:return
- 2920 '-------------------------- CONTROL SCREEN ------------------------------
- 2930 CNTSCREEN:gosub MOUSEOFF:gosub CSCREEN
- 2940 '--------------------- FILE MOUSE CONTROLLER ---------------------------
- 2950 poke gintin,mkc2:gemsys(78):gosub MOUSEON
- 2960 fk=0:while fk=0
- 2970 poke contrl,124:poke contrl+2,0:poke contrl+6,0:vdisys(1)
- 2980 fmx=peek(ptsout):fmy=peek(ptsout+2):fkey=peek(intout)
- 2990 if fkey=1 then gosub CHECKFMOUSE
- 3000 if fc1>0 then gosub MOUSEOFF:gosub DOSOUND2:gosub GETANS
- 3010 fc1=0:wend
- 3020 if fk=1 then goto CLEANUP
- 3030 poke gintin,255:gemsys(78):restore CUBEP:gosub MOUSEFORM:goto CB7A
- 3040 '---------------------- GET FILE BUTTON PRESS --------------------------
- 3050 GETANS:on error goto 0
- 3060 mkc=mkc1:gosub MARKC
- 3070 on fc1 goto CS1,CS2,CS3,CS4,CS5,CS6,CS7,CS8,CS2,CS10
- 3080 CS1:?chr$(7);:reset:box$="Verify RESET Operation"
- 3090 button$="CANCEL|RESET":gosub GROWBOX:gosub FORMBOX
- 3100 box$=box1$:button$=button1$:openw 2:if kc<>2 then goto GETANS1
- 3110 for ct=0 to h:ps(ct)=0:next ct:h=0:ps(h)=13:lh=0:lv=-1:color 2,1,3
- 3120 gotoxy 24/j,5:?"RESET"chr$(7):color 1,1,3:goto GETANS1
- 3130 CS2:gosub GROWBOX:clearw 2:poke systab+24,1
- 3140 gosub DOCONTROLS:gosub SETCOLOR:fk=2:goto GETANS1
- 3150 CS3:goto LOADPIC
- 3160 CS4:goto SAVEPIC
- 3170 CS5:goto DELETEPIC
- 3180 CS6:gosub ENTERPIC:poke systab+24,1:gosub CSCREEN:goto GETANS1
- 3190 CS7:gosub EDITPIC:poke systab+24,1:gosub CSCREEN:goto GETANS1
- 3200 CS8:a$="PRINTING":gosub LISTPIC:goto GETANS1
- 3210 CS10:?chr$(7);:reset:icon=2:box$="Leaving ESCHER CUBES ??"
- 3220 button$="STAY|EXIT":gosub GROWBOX:gosub FORMBOX:box$=box1$:button$=button1$
- 3230 icon=3:if kc<>2 then goto GETANS1 else fk=1
- 3240 GETANS1:mkc=3:gosub MARKC
- 3250 poke gintin,mkc2:gemsys(78):mkc2=3:gosub MOUSEON:return
- 3260 '---------------------- CHECK FILE MOUSE LOCATION ----------------------
- 3270 CHECKFMOUSE:
- 3280 kc=0:fc=1:fc1=1:fct=10
- 3290 if fmx>fm(1) and fmx<fm(2) then fmz=0:goto CFM
- 3300 if fmx>fm(3) and fmx<fm(4) then fmz=5:goto CFM
- 3310 fc1=0:?chr$(7);:return
- 3320 CFM:while kc=0
- 3330 if fmy>=fv(fc) and fmy<=fv(fc+1) then kc=1
- 3340 if kc=0 then fc1=fc1+1
- 3350 fc=fc+2:if fc>fct then kc=1
- 3360 wend:if fc1>fct/2 then fc1=0:?chr$(7);:return
- 3370 fc1=fc1+fmz:return
- 3380 '------------------------- LOAD PICTURE FILE ----------------------------
- 3390 LOADPIC:on error goto 840
- 3400 reset:gosub GROWBOX:gosub FILESELECT:poke systab+24,0
- 3410 if kp=0 or len(f$)<1 then goto LOADEND
- 3420 f2=instr(f$,"."):if f2=0 then goto LOADEND
- 3430 if mid$(f$,f2,len(f$)-(f2-1))<>".CUB" then goto LOADEND
- 3440 if h=0 then goto LOADIT
- 3450 if ps(h-1)=11 then goto LOADIT
- 3460 ps(h)=11:h=h+1:if h>max then ps(max)=13:?chr$(7);:goto LOADEND
- 3470 LOADIT:dp=0:f1$=f$:gosub FILELOCATE
- 3480 open "R",#1,f$,3:field #1,3 as am$:get #1
- 3490 if am$<>test$ then close #1:goto LOADEND
- 3500 mk1=0:while mk1=0:get #1:gdt=cvi(am$):if gdt=-3 then mk1=1
- 3510 if mk1=0 then ps(h)=gdt:h=h+1:if h>max then h=max:mk1=1
- 3520 wend:close #1:gotoxy ts,15:?cl$:?chr$(7);
- 3530 lv=lv+1:if lv>2 then lv=0:lh=lh+20/j:if lh>69/j then lh=0:swap lc1,lc2
- 3540 swap lc,lc1:gotoxy lh,lv:color lc,1,1:?f1$" "chr$(8):color 1,1,1
- 3550 LOADEND:poke systab+24,1:gotoxy 24/j,5:?" ":goto GETANS1
- 3560 '------------------------- SAVE PICTURE FILE ----------------------------
- 3570 SAVEPIC:on error goto 840
- 3580 if h=0 then goto SE1
- 3590 reset:gosub GROWBOX:gosub FILESELECT:poke systab+24,0
- 3600 if kp=0 or len(f$)<1 then goto SE1
- 3610 f2=instr(f$,"."):if f2=0 then f$=f$+".CUB"
- 3620 if right$(f$,4)<>".CUB" then mid$(f$,len(f$)-3,4)=".CUB"
- 3630 dp=1:fh=s-1:fh1=1:gosub FILELOCATE
- 3640 open "R",#1,f$,3:field #1,3 as am$:lset am$=test$:put #1,fh1:fh1=fh1+1
- 3650 if ps(0)>-3 then lset am$=mki$(-rz):put #1,fh1:fh1=fh1+1
- 3660 SP1:fh=fh+1:if fh=h then goto SAVEEND
- 3670 if fh>max then fh=max:goto SAVEEND
- 3680 if ps(fh)=-2 then goto SP1
- 3690 lset am$=mki$(ps(fh)):put #1,fh1:fh1=fh1+1:goto SP1
- 3700 SAVEEND:lset am$=mki$(-3):put #1:close #1
- 3710 SE1:?chr$(7);:poke systab+24,1:goto GETANS1
- 3720 '------------------------- DELETE PICTURE FILE --------------------------
- 3730 DELETEPIC:on error goto 840
- 3740 reset:gosub GROWBOX:gosub FILESELECT:poke systab+24,0
- 3750 if kp=0 or len(f$)<1 then goto DL1
- 3760 ?chr$(7);:reset:box$=box$+"|Delete "+chr$(3)+" "+f$:gosub FORMBOX
- 3770 box$=box1$:openw 2:if kc<>2 then goto DL1
- 3780 gosub FILELOCATE
- 3790 open "R",#1,f$,3:field #1,3 as am$:lset am$=a$:put #1,1:close #1:kill f$
- 3800 DL1:?chr$(7);:poke systab+24,1:goto GETANS1
- 3810 '-------------------------- ENTER PICTURE DATA --------------------------
- 3820 ENTERPIC:gosub GROWBOX
- 3830 poke systab+24,0:title$=tlt2$:tlt=1:gosub DOCONTROLS:title$=tlt$
- 3840 tb=10/j:tb1=tb:tb3=int(h/10):tb4=0:i=0:ep=0:ep1=0:gosub ED1
- 3850 if h=0 then goto EPIC
- 3860 if ps(h-1)<>(-rz) then ps(h)=-rz:h=h+1:if h>max then h=max:goto ENTEREND
- 3870 EPIC:gotoxy 8/j,8:?cl$
- 3880 gotoxy 8/j,8:line input"Enter Data 'D' = Done ";ep$
- 3890 ep=val(ep$):if len(ep$)=0 then ep=ep1
- 3900 if ep$="D" or ep$="d" then ps(h)=-3:goto ENTEREND
- 3910 if ep=0 then ep1=ep:?chr$(7);:goto EPIC
- 3920 if ep<-2 and (ep<>-4 or ep<>-8) then ep1=0:?chr$(7);:goto EPIC
- 3930 ps(h)=ep:h=h+1:ep1=ep:if h>max then h=max:goto ENTEREND
- 3940 wm=2:gosub WMODE:gotoxy 0,5:?tab(tb1)ep:tb1=tb1+5:tb4=tb4+1
- 3950 if tb4>9 then gosub ENT
- 3960 wm=1:gosub WMODE:goto EPIC
- 3970 ENTEREND:?chr$(7);:wm=1:gosub WMODE:clearw 2:return
- 3980 ENT:tb4=0:tb5=0:wm=1:gosub WMODE:gotoxy j1/j,5:?cl$
- 3990 gotoxy 0,5:gosub ED2:return
- 4000 '-------------------------- EDIT PICTURE FILE ---------------------------
- 4010 EDITPIC:if h<1 then ?chr$(7);:return
- 4020 gosub GROWBOX:poke systab+24,0:tb=10/j:tb1=tb:tb2=0:tb3=0:tb4=0:tb5=0
- 4030 tlt=1:title$=tlt2$:gosub DOCONTROLS:title$=tlt$:for i=0 to h-1
- 4040 if ps(i)=13 then i=h-1:goto EDITDONE
- 4050 if tb5=0 then gosub ED1:if edn=1 then goto EDITDONE
- 4060 if ps(i)=-3 then color 2,1,1 else color 1,1,1
- 4070 ?tab(tb1)ps(i);:tb1=tb1+5:tb4=tb4+1:if tb4>9 then tb4=0
- 4080 if tb4=0 then gosub ED2
- 4090 EDITDONE:next i:if edn<>1 then gosub ED3
- 4100 clearw 2:edn=0:return
- 4110 ED1:gosub ED3:if edn=1 then i=h-1:return
- 4120 clearw 2:?:tb1=tb:gotoxy 0,0:?eds$:?eds1$:color 3,1,1
- 4130 ?:?tab(tb1)"Column->";:tb1=tb1+8:?tab(tb1);
- 4140 for z=tb2 to tb2+9:tb1=tb1+5:?tab(tb1)z;:next z:?:?:color 1,1,1
- 4150 ED2:tb5=tb5+1:if tb5>10 then tb5=0:goto ED2a
- 4160 tb1=tb:color 3,1,1:?tab(tb)"Line # "tb3;:tb1=tb1+13
- 4170 tb3=tb3+1:color 1,1,1
- 4180 ED2a:return
- 4190 ED3:?:if i=0 then return
- 4200 gotoxy 8/j,16:color 2,1,1
- 4210 ?"E";:color 1,1,1:?" - Edit ";:color 2,1,1
- 4220 ?"C";:color 1,1,1:?" - Continue List ";:color 2,1,1:?"Q";:color 1,1,1
- 4230 ?" - Quit ";
- 4240 GANS:gotoxy 50/j,16:ans=inp(2):?
- 4250 if ans=69 or ans=101 then goto DOEDIT
- 4260 if ans=67 or ans=99 then return
- 4270 if ans=81 or ans=113 then edn=1:return
- 4280 ?chr$(7);:goto GANS
- 4290 DOEDIT:tb6=tb5:if tb6=0 then tb6=10
- 4300 tb7=tb4-1:if tb7=-1 then tb7=9
- 4310 gotoxy 0,16:?cl$;:gotoxy 1,16:line input"Enter LINE # ";ln$:ln=val(ln$)
- 4320 if ln>tb3-1 or ln<tb3-tb6 then ?chr$(7);:goto DOEDIT
- 4330 DOED1:gotoxy 18/j,16:line input"Enter COLUMN # ";cn$:cn=val(cn$)
- 4340 if cn<0 or cn>9 then ?chr$(7);:goto DOED1
- 4350 if cn >tb7 and ln=tb3-1 then ?chr$(7);:goto DOED1
- 4360 if cn>=0 and tb7>9 and ln=tb3-1 then goto DOEDIT
- 4370 ps1=ps((ln*10)+cn):gotoxy 35/j,16:?"Old Value = "ps1" ";
- 4380 line input"New Value = ";nn$:nn=val(nn$):if nn=0 then nn=-2
- 4390 if nn<-3 and (nn<>-4 and nn<>-8) then nn=-2
- 4400 if len(nn$)=0 then nn=ps1
- 4410 ln1=ln:nn$=str$(nn):if len(nn$)<4 then nn$=nn$+space$(4-len(nn$))
- 4420 ED4:if ln1>9 then ln1=ln1-10:goto ED4
- 4430 wm=2:gosub WMODE:gotoxy 0,ln1+5:?tab(ta+(cn*5));:wm=1:gosub WMODE:?nn$
- 4440 ps((ln*10)+cn)=nn:gotoxy 0,16:?cl$;:goto ED3
- 4450 '------------------- LIST PICTURE DATA TO PRINTER -----------------------
- 4460 LISTPIC:if h<1 then ?chr$(7);:return
- 4470 gosub GROWBOX:tb=10/j:tb1=tb:tb3=0:tb4=0:color 2,1,3:gotoxy ts,15:?a$
- 4480 color 1,1,3:lprint"Escher Cubes File --> "f$:lprint:lprint
- 4490 lprint:lprint tab(tb1)"Column->";:tb1=tb1+8:?tab(tb1);
- 4500 for z=0 to 9:tb1=tb1+5:lprint tab(tb1)z;:next z:lprint:lprint
- 4510 gosub PRT:for i=0 to h-1
- 4520 lprint tab(tb1)ps(i);:tb1=tb1+5:tb4=tb4+1:if tb4>9 then tb4=0
- 4530 if tb4=0 then gosub PRT
- 4540 next i:lprint:lprint:gotoxy 20,15:?cl$;chr$(7);:return
- 4550 PRT:tb1=tb:lprint tab(tb)"Line # "tb3;:tb1=tb1+13
- 4560 tb3=tb3+1:return
- 4570 '------------------------------ WRITE MODE ------------------------------
- 4580 WMODE:
- 4590 poke contrl,32:poke contrl+2,0:poke contrl+6,1
- 4600 poke intin,wm:vdisys(1):return
- 4610 '--------------------------- DO COORDINATE TEXT -------------------------
- 4620 DOTEXT:
- 4630 poke contrl,8:poke contrl+2,1:poke contrl+6,txsz
- 4640 for z=0 to txsz:poke intin+(z*2),tx(z):next z
- 4650 poke ptsin,txtx:poke ptsin+2,txty:vdisys(1):return
- 4660 '--------------------------- TEXT EFFECTS -------------------------------
- 4670 TEFFECT:
- 4680 poke contrl,106:poke contrl+2,0:poke contrl+6,1
- 4690 poke intin,te:vdisys(1):return
- 4700 '---------------------------- TEXT HEIGHT -------------------------------
- 4710 THEIGHT:
- 4720 poke contrl,107:poke contrl+2,0:poke contrl+6,1
- 4730 poke intin,th:vdisys(1):return
- 4740 '----------------------------- TITLE PAGE -------------------------------
- 4750 TITLEPAGE:
- 4760 tlt=1:tlt$=title$:title$=tlt3$:gosub DOCONTROLS:title$=tlt$
- 4770 fullw 2:clearw 2:te=4:th=24:color 2,1,1:c4=1:y10=1:y11=3
- 4780 plt%(0)=0:plt%(1)=1792:plt%(2)=112:plt%(3)=1911:gosub SETC
- 4790 poke contrl,11:poke contrl+2,2:poke contrl+6,0:poke contrl+10,8
- 4800 poke ptsin,1:poke ptsin+2,v2
- 4810 for x=v4 to 210 step -8:color 2,1,c4:c4=c4+1:if c4>3 then c4=1
- 4820 poke ptsin+4,x:poke ptsin+6,y7:y7=y7-y8
- 4830 vdisys(1):sound 1,8,y10,y11,0:wave 1,1,4,256,0
- 4840 y10=y10+1:if y10>12 then y10=1:y11=y11+1:if y11>8 then y11=3
- 4850 next x:gosub TEFFECT:gosub THEIGHT
- 4860 xx=ta3:for x=0 to 5:gotoxy xx/j,4:?chr$(titlep(x));:xx=xx+4:next x
- 4870 color 1,1,1:te=16:th=26:gosub TEFFECT:gosub THEIGHT
- 4880 xx=10:for x=6 to 10:gotoxy xx/j,15:?chr$(titlep(x));:xx=xx+4:next x
- 4890 te=0:th=dth:gosub TEFFECT:gosub THEIGHT
- 4900 color 1,1,1:gotoxy 5/j,0:?"BY ";:te=4:gosub TEFFECT:?" J. Luczak"
- 4910 te=1:gosub TEFFECT:color 2,1,1:gotoxy ta4/j,6:?"Ver. ";
- 4920 te=0:gosub TEFFECT:color 3,1,1:?"1.4d":color 1,1,1:x=y12:y=y13
- 4930 for sz=1 to 12:a=cm1*sz:b=cm2*sz:c=3*sz
- 4940 gosub SETCUBE:gosub DOSOUND:gosub DOBOX:next sz
- 4950 x=dfx:y=dfy:sz=4:a=cm1*sz:b=cm2*sz:c=3*sz
- 4960 for z=1 to 5000:next z:?chr$(7);
- 4970 te=0:th=dth:gosub TEFFECT:gosub THEIGHT
- 4980 clearw 2:color 1,1,1:return
- 4990 '----------------------- SET MOUSE POINTER FORM -------------------------
- 5000 MOUSEFORM:
- 5010 poke contrl,111:poke contrl+2,0:poke contrl+6,37
- 5020 read hx,hy:poke intin,hx-1:poke intin+2,hy-1:poke intin+4,1
- 5030 poke intin+6,0:poke intin+8,1
- 5040 for z=10 to 40 step 2:read ms
- 5050 poke intin+z,ms:poke intin+z+32,ms:next z
- 5060 vdisys(1):return
- 5070 '--------------------------- FILE SELECTOR -----------------------------
- 5080 FILESELECT:gosub MOUSEON
- 5090 pt=1:pathname$=path1$:f$=""+string$(12,chr$(0))
- 5100 n#=addrin:poke n#,varptr(pathname$)
- 5110 o#=addrin+4:poke o#,varptr(f$)
- 5120 gemsys(90):kp=peek(gintout+2)
- 5130 temp$="":for z1=1 to 12
- 5140 if mid$(f$,z1,1)<>chr$(0) then temp$=temp$+mid$(f$,z1,1)
- 5150 next z1:f$="":f$=temp$:path1$=pathname$:gosub MOUSEOFF
- 5160 clearw 2:openw 2:return
- 5170 '-------------------------- FORM ALERT BOX ----------------------------
- 5180 FORMBOX:
- 5190 poke gintin,priority
- 5200 box2$=str$(icon)+"][|"+box$+"|]["+button$+"]"
- 5210 n#=addrin:poke n#,varptr(box2$)
- 5220 gemsys(52):kc=peek(gintout):return
- 5230 '------------------------- ROUNDED RECTANGLE ---------------------------
- 5240 BUTTON:
- 5250 poke ptsin,bx:poke ptsin+2,by:poke ptsin+4,bx1:poke ptsin+6,by1
- 5260 vdisys(1):return
- 5270 '--------------------------DRAW CONTROL SCREEN -------------------------
- 5280 CSCREEN:
- 5290 clearw 2:plt%(0)=0:plt%(1)=1792:plt%(2)=112:plt%(3)=1911
- 5300 poke pl#,varptr(plt%(0)):tlt=1:lh=0:lv=-1:tt=5:color 1,1,3
- 5310 tlt$=title$:title$=tlt1$:gosub DOCONTROLS:title$=tlt$
- 5320 for dox=1 to 10 step 2:gotoxy 10/j,tt:?ctx$(dox)
- 5330 if dox+1=10 then color 2,1,3
- 5340 gotoxy ta2/j,tt:?ctx$(dox+1):tt=tt+2:next dox
- 5350 poke contrl,11:poke contrl+2,2:poke contrl+6,0:poke contrl+10,8
- 5360 bx=fm(1):bx1=fm(2):for dox1=1 to 2:for dox=1 to 10 step 2
- 5370 by=fv(dox):by1=fv(dox+1):gosub BUTTON:next dox
- 5380 bx=fm(3):bx1=fm(4):next dox1:color 1,1,1:return
- 5390 '---------------------------- MARK CHOICE ------------------------------
- 5400 MARKC:color 1,1,mkc:mkd=fc1
- 5410 poke contrl,11:poke contrl+2,2:poke contrl+6,0:poke contrl+10,8
- 5420 if fc1<=5 then bx=fm(1):bx1=fm(2) else bx=fm(3):bx1=fm(4):mkd=fc1-5
- 5430 mke=mkd-1:by=fv(mkd+mke):by1=fv((mkd+mke)+1):gosub BUTTON
- 5440 isx=bx:isy=by:isw=200:ish=11*cm1:gosub GSCNT:return
- 5450 '---------------------------- FILE LOCATOR -----------------------------
- 5460 FILELOCATE:f2=1:f3=1:f4=0
- 5470 while f2<>0:f2=instr(f3,path1$,"\"):if f3>f4 and f3<24 then f4=f3
- 5480 f3=f2+1:wend:f$=left$(path1$,f4-1)+f$:return
- 5490 '------------------------- GROW/SHRINK CONTROL -------------------------
- 5500 GSCNT:on fc1 goto GFO,GFU,GSEL,GSEL,GSEL,GFU,GFU,GPRINT,GFU,GFO
- 5510 GFO:iex=200:iey=75*cm1:iew=200:ieh=75*cm1:return
- 5520 GFU:iex=0:iey=0:iew=639:ieh=199*cm1:return
- 5530 GSEL:iex=200:iey=25*cm1:iew=280:ieh=150*cm1:return
- 5540 GPRINT: iex=200:iey=175*cm1:iew=200:ieh=11*cm1:return
- 5550 '------------------------------ GROW BOX -------------------------------
- 5560 GROWBOX:
- 5570 poke gintin!,isx:poke gintin!+2,isy:poke gintin!+4,isw
- 5580 poke gintin!+6,ish:poke gintin!+8,iex:poke gintin!+10,iey
- 5590 poke gintin!+12,iew:poke gintin!+14,ieh:gemsys(73):return
- 5600 '---------------------------- PROGRAM DATA ------------------------------
- 5610 MEDREZ:
- 5620 data 12,21,22,608,188,4,175,174,1,2,1,19,7,8,83,9,23,2,188,2,100,60
- 5630 data 40,36,15,56,65,265,335,535,67,78,85,96,103,114,121,132,139,150
- 5640 data 1911,546,1792,112,7,5,1312,80,1365,599,119,85,1799,1285,1904,1360
- 5650 data 7,1792,112,1365,1904,119,1799,80,1360,1285,85,1911,1360
- 5660 data 119,1792,1312
- 5670 data 5,1280,80,546,1360,85,1285,48,816,771,51,1365,1185,1904,112,80
- 5680 data 3,768,48,0,816,51,771,16,272,257,17,819,1312,112,7,5
- 5690 HIREZ:
- 5700 data 20,36,38,616,382,4,242,243,2,4,2,16,14,4,172,12,18,0,382,4,100,110
- 5710 data 44,38,16,58,60,260,350,550,123,145,157,179,191,213,225,247,257,281
- 5720 data 1911,0,1911,0,1911,0,1911,0,1911,0,1911,0,1911,0,1911,0
- 5730 data 0,1911,0,1911,0,1911,0,1911,0,1911,0,1911,0,1911,0,1911
- 5740 data 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
- 5750 data 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
- 5760 CBARDAT:
- 5770 data 29,47,48,63,64,79,80,96,97,112,113,129
- 5780 data 130,199,200,270,271,350,351,438,439,493,494,576,577,599
- 5790 COORDTEXT:
- 5800 data 67,117,114,114,101,110,116,32,80,111,115,32,88,61,32,32,32,32
- 5810 data 89,61,32,32,32,32,32,67,117,98,101,32,80,111,115,32,88,61,32,32,32
- 5820 data 32,89,61,32,32,32
- 5830 data 32,32,67,111,117,110,116,32,32,32,32,32
- 5840 TITLEDATA:
- 5850 data 69,83,67,72,69,82,67,85,66,69,83
- 5860 DEFAULTP:
- 5870 data 1,1,32768,49152,57344,61440,63488,64512,65024,65280,64384
- 5880 data 55296,35840,3072,1536,1536,768,0
- 5890 CUBEP:
- 5900 data 1,1,65472,65504,49136,40952,36860,35500,36180,35500,36180
- 5910 data 35500,19796,10924,7508,4092,0,0
- 5920 CNTDATA:
- 5930 data Reset Recorder,Enter [-CUBE-] Data,Play-Back Recorder
- 5940 data Edit [-CUBE-] Data,Load [-CUBE-] File,List Data To Printer
- 5950 data Save [-CUBE-] File,Return To CUBICLE,Delete [-CUBE-] File
- ə