1 REMark treitz22 (c) Timo Salmi
2 REMark Mon 1992 Oct 19 22:09:41
3 REMark version 1.5
4 :
100 hires 0,1
110 a=250:b=150:c=70:d=50
120 FOR i=0 TO 1.01 STEP 5E-2
130  s_line c*i,200-(d+b)*(1-i),a+c*i,200-d-(b-d)*i,1
140 END FOR i
150 FOR i=0 TO 1.01 STEP 5E-2
160  s_line a*i,b*i,c+a*i,199-b*i,1
170 END FOR i
180 s_rec 0,0,a,b,1:s_rec c,d,a-2,b-2,1
190 FOR i=0 TO 1
200  FOR j=0 TO 1
210   s_line i*a,j*b,i*a+c,j*b+d,1
220  END FOR j
230 END FOR i
240 :
10120 DEFine PROCedure s_line(x1%,y1%,x2%,y2%,z%)
10130  INK f_vari((z%))
10140  LINE x1%,200-y1% TO x2%,200-y2%
10150 END DEFine s_line
10160 :
10170 DEFine PROCedure s_rec(x1%,y1%,dx%,dy%,z%)
10180  LOCal x2%,y2%
10190  x2%=x1%+dx%:y2%=y1%+dy%
10200  s_line x1%,y1%,x2%,y1%,z%
10210  s_line x2%,y1%,x2%,y2%,z%
10220  s_line x2%,y2%,x1%,y2%,z%
10230  s_line x1%,y2%,x1%,y1%,z%
10240 END DEFine s_rec
10250 :
15000 DEFine PROCedure hires(etu%,taus%)
15010  MODE 8
15020  etuvari%=etu%:taustavari%=taus%
15030  WINDOW 512,256,0,0:PAPER 1:CLS
15040  WINDOW 430,200,41,16
15050  PAPER f_varikoodi((taus%)):CLS
15060  INK f_varikoodi((etu%))
15070  SCALE 200,0,0
15080 END DEFine hires
15090 :
15100 DEFine FuNction f_varikoodi(vari%)
15110  LOCal varil:varil=vari%
15120  SELect ON varil
15130   = 0:RETurn 0  :REMark black
15140   = 1:RETurn 7  :REMark white
15150   = 2:RETurn 2  :REMark red
15160   = 3:RETurn 5  :REMark cyan
15170   = 4:RETurn 202:REMark purple
15180   = 5:RETurn 4  :REMark green
15190   = 6:RETurn 1  :REMark blue
15200   = 7:RETurn 6  :REMark yellow
15210   = 8:RETurn 226:REMark orange
15220   = 9:RETurn 208:REMark brown
15230   =10:RETurn 234:REMark light red
15240   =11:RETurn 250:REMark grey 1
15250   =12:RETurn 248:REMark grey 2
15260   =13:RETurn 220:REMark light green
15270   =14:RETurn 5:REMark light blue
15280   =15:RETurn 206:REMark grey 3
15290   =REMAINDER :RETurn 0
15300  END SELect 
15310 END DEFine f_varikoodi
15320 :
15330 DEFine FuNction f_vari(tapa%)
15340  LOCal tapal:tapal=tapa%
15350  SELect ON tapal
15360   =0:RETurn f_varikoodi((taustavari%))
15370   =1:RETurn f_varikoodi((etuvari%))
15380   =REMAINDER :RETurn f_varikoodi((etuvari%))
15390  END SELect 
15400 END DEFine f_vari
15410 :
31000 DEFine PROCedure reset(i)
31010  LOCal il:MODE i
31020  FOR il=1,2:OPEN#il,con_:END FOR il
31030  WINDOW 512,256,0,0:PAPER 0:CLS
31040  WINDOW#0,448,40-(i=4),32,216+(i=4)
31050  WINDOW#2,448,200,32,16:PAPER#2,1:INK#2,7
31060  WINDOW 448+8*(i=4),200+2*(i=4),32-4*(i=4),16-(i=4)
31070  PAPER 2*(i=8):BORDER (i=4),4*(i=4)
31080  FOR il=0,1,2:CSIZE#il,(i=4)+2*(i=8),0:END FOR il
31090  PAPER#0,0:INK#0,7-3*(i=0):INK 7:CLS
31100  SCALE 100,0,0:FILL 0
31110 END DEFine reset
31120 :
31990 STOP
32000 vsave 1:STOP
32010 vsave 2:STOP
32020 vsave 3:STOP
32030 vsave 4:STOP
32040 vsave 5:STOP
32050 vsave 6:STOP
32060 DEFine PROCedure vsave(dr)
32070  LOCal avl$(42),bvl$(42),dvl$(6,5):avl$="treitz22"
32080  bvl$=DATE$:bvl$=bvl$(1 TO 4)
32090  IF bvl$<>1992 THEN 
32100   PRINT#0,DAY$!DATE$!"Not saved, set SDATE"
32110   BEEP 4000,12:STOP:END IF 
32120  ver1%=1:ver2%=5
32130  dvl$(1)="mdv1_":dvl$(2)="mdv2_"
32140  dvl$(3)="fdk1_":dvl$(4)="fdk2_"
32150  dvl$(5)="ram1_":dvl$(6)="ram2_"
32160  bvl$=dvl$(dr)&avl$
32170  DELETE bvl$:OPEN_NEW#3,bvl$:ver%=ver2%+1
32180  PRINT#3,"1 REMark ";avl$!"(c) Timo Salmi"
32190  PRINT#3,"2 REMark ";DAY$!DATE$
32200  PRINT#3,"3 REMark version"!ver1%;".";ver%
32210  PRINT#3,"4 :"
32220  LIST#3,100 TO 32110
32230  PRINT#3,"32120  ver1%=";ver1%;":ver2%=";ver%
32240  LIST#3,32130 TO:CLOSE#3
32250  PRINT#0,"Saved"!bvl$!"version"!ver1%;".";ver%
32260 END DEFine vsave
