10 'save "fract",a 20 DEFINT A-N:DEFDBL P-Z:KEY OFF:SCREEN 1 30 INPUT "Input Center (X) = ",P1:INPUT "Input Center (Y) = ",P2:INPUT "Expand Scale = ",P3:INPUT "Plot Step = ",JX 40 CLS:LINE (0,29)-(1023,767),1,B 50 LOCATE 1,8,0:PRINT "Center = (";P1;",";P2;") Scale =";P3;" Step =";JX; 60 X0=P1-P3:Y0=P2+P3:X1=P3/512# 70 FOR IX=1 TO 1023 STEP JX:X2=X0+CDBL(IX)*X1 80 FOR IY=143 TO 881 STEP JX:Y2=Y0-CDBL(IY)*X1 90 GOSUB 120:IF F1=1 THEN PSET (IX,IY-114) 100 NEXT IY:LOCATE 1,73,0:PRINT IX;:NEXT IX:LOCATE 1,73,0:PRINT " "; 110 A$=INKEY$:IF A$<>" " THEN 110 ELSE SCREEN 0:KEY ON:LOCATE 1,1,1:END 120 F1=0:Z1=0#:Z2=0#:FOR K1=1 TO 100:ZZ=Z1*Z1-Z2*Z2+X2:Z2=2#*Z1*Z2+Y2:Z1=ZZ 130 IF Z1*Z1+Z2*Z2>4# THEN RETURN 140 NEXT K1:F1=1:RETURN 10 'SAVE "lesson.bas",A 20 MAXX=9:DIM BUFF$(100) 30 KEY OFF:CLS 40 LOCATE 1,5:COLOR 0:INPUT "SELECT LESSON NO.(1-9) = ",C$ 50 LEVEL=VAL(C$):IF LEVEL>MAXX OR LEVEL<1 OR LEVEL<>INT(LEVEL) THEN 30 60 CLS:RESTORE 270:CTR=1 70 READ DUM$:IF LEFT$(DUM$,2)<>"**" THEN 70 80 IF VAL(RIGHT$(DUM$,LEN(DUM$)-2))<>LEVEL THEN 70 90 READ BUFF$(CTR):IF LEFT$(BUFF$(CTR),2)<>"**" THEN CTR=CTR+1:GOTO 90 100 FOR LOOP=1 TO CTR-1 110 A$=BUFF$(LOOP):COUNT=LEN(A$) 120 IF MAXX>6 THEN A$=A$+STRING$(70-LEN(A$)," "):GOTO 150 130 A$=A$+" "+A$:IF LEN(A$)<70 THEN 130 ELSE A$=LEFT$(A$,70) 140 IF RIGHT$(A$,1)=" " THEN COUNT=69 ELSE COUNT=70 150 LOCATE 17,5:COLOR 0:PRINT A$:LOCATE 19,5:COLOR 0:PRINT STRING$(60," ") 160 FOR I=1 TO COUNT:'### MAIN LOOP ### 170 LOCATE 17,4+I:COLOR 1:PRINT MID$(A$,I,1) 180 LOCATE 19,4+I:COLOR 0 190 C$=INKEY$:IF C$="" THEN 190 ELSE PRINT C$ 200 IF C$=CHR$(7) THEN 30 210 IF C$=CHR$(14) THEN 260 220 IF C$=CHR$(2) AND LOOP>1 THEN LOOP=LOOP-1:GOTO 110 230 IF C$=MID$(A$,I,1) THEN 250 240 IF INKEY$=CHR$(8) THEN 180 ELSE 240 250 LOCATE 17,4+I:COLOR 0:PRINT MID$(A$,I,1):NEXT I 260 NEXT LOOP:BEEP:GOTO 30 270 DATA "**1" 280 DATA "asdf;lkj" 290 DATA "ask","lad","all","fall","lass","asks","lads","falls" 300 DATA "alas","add","flask","salad" 310 DATA "**2" 320 DATA "asdfgf ;lkjhj" 330 DATA "had","ash","has","gall","hash","jags","hags" 340 DATA "glass","gala","lag","jag","gas","lash","flag","sash","half" 350 DATA "slash","flags","gash","hall","lags","glad","slag","dash" 360 DATA "shall","flash","halls" 370 DATA "**3" 380 DATA "aqaswsdedfrf ;p;lolkikjuj" 390 DATA "sails","liked","jokes","forks","lakes","parks","larks","fills" 400 DATA "sales","dirks","fails","skill","apples","fields","squads" 410 DATA "floors","killed","raised","depress","workers","refusal" 420 DATA "dollars","awkward","defiles" 430 DATA "**4" 440 DATA "tfrf yjuj" 450 DATA "tall","sorry","yours","trial","shout","yield","others" 460 DATA "gladly","though","takes","yeast","trout","forest","joyful" 470 DATA "faults","artful","styles","lastly","truly","shifts","spirit" 480 DATA "eighty","firstly","laughed","faithful","yourself","spiteful" 490 DATA "hit the key","type this well","read this paper" 500 DATA "he will tell you","write with this","there is a pupil" 510 DATA "type these words","there are houses","he wrote a letter" 520 DATA "she is a good typist","here is a typewriter" 530 DATA "there are pretty dolls" 540 DATA "**5" 550 DATA "aszsdxdfcfvf ;l,lkmkjnjbj" 560 DATA "lacks","calls","formal","zeal","next","black","summer","cabled" 570 DATA "arrival","local","native","cancel","visits","manual","several" 580 DATA "object","drizzle","examined","nations","meaning","anxious" 590 DATA "because","numbers","activity","subject","examples","umbrella" 600 DATA "**6" 610 DATA "James","Frank","India","England","London","Spain","Paris" 620 DATA "America","Tokyo" 630 DATA "I am now ready to begin typing." 640 DATA "We are happy to have you in the typing class." 650 DATA "It is good for all of us to know how to type." 660 DATA "He likes to sing all the songs that he hears." 670 DATA "Keep your arms, elbows, and wrists still while typing." 680 DATA "It is very easy to type these short words." 690 DATA "The first thing for me to do is to type with ease." 700 DATA "I can do this work well if I just think that I can." 710 DATA "Curve your fingers; hold them lightly on the guide keys." 720 DATA "You do not get much done by starting tomorrow." 730 DATA "If you do your best, you will develop your typing skill." 740 DATA "Speed will look after itself if you play your part well." 750 DATA "Do not be afraid to make errors while you are practising." 760 DATA "Be alert while typing and hit the keys firmly and evenly." 770 DATA "**7" 780 DATA "If he is in, tell him that I want to see him in an hour" 790 DATA " or so." 800 DATA "If you do your best work each day, you will soon be a" 810 DATA " good typist." 820 DATA "You must know what you are to do; then do it as nicely" 830 DATA " as you can." 840 DATA "I can read very fast. He can write very well. She can" 850 DATA " type quickly." 860 DATA "If it is fine, I shall go with you. I hope we can enjoy" 870 DATA " it very much." 880 DATA "Hit one key at a time. Do not pause after you hit the" 890 DATA " key." 900 DATA "If I do my lesson well, my typing skill will grow in due" 910 DATA " course." 920 DATA "We must have faith that we can do well anything we want" 930 DATA " to learn." 940 DATA "Typing is a new kind of work for me and a new way for me" 950 DATA " to learn it." 960 DATA "Do more than you say you will do. This is a good plan to" 970 DATA " follow all the time." 980 DATA "It is not easy at first to think the word and type the" 990 DATA " word." 1000 DATA "Faith that we can do well is needed by all of us to do" 1010 DATA " things well." 1020 DATA "Try to hit the key with a sharp blow; then lift the" 1030 DATA " finger at once." 1040 DATA "You will find that there are a good many fields in which" 1050 DATA " you can use your typing skill." 1060 DATA "Hold the hands and arms quiet; hold them low so that your" 1070 DATA " fingers can flick the keys and get away quickly." 1080 DATA "**8" 1090 DATA "abcde fghij klmno pqrst uvwxyz abcdefghijklmnopqrstuvwxyz" 1100 DATA "Dick asserted that the quick brown fox jumped over the" 1110 DATA " lazy dog." 1120 DATA "A very hot, quick blaze can be made from just pine twigs" 1130 DATA " and boxes." 1140 DATA "Fred Carver requests we keep the dozen large boxes of" 1150 DATA " juicy lemons." 1160 DATA "A zinc plate, six inches square, would make a very good" 1170 DATA " job for you." 1180 DATA "The public was amazed to view the quick and dexterous" 1190 DATA " work of James on the foggy day." 1200 DATA "The bright cat quickly jumped off a box and seized seven" 1210 DATA " wee mice." 1220 DATA "Jim goes forward expectantly but very quickly realizes" 1230 DATA " his mistake." 1240 DATA "A fat lazy boy, named Jack Davis, slept quietly on a big" 1250 DATA " haedware box." 1260 DATA "Six dozen of heavy blankets were added to the equipment" 1270 DATA " for George and Jack." 1280 DATA "A large number of our citizens have signed a petition" 1290 DATA " which makes request for a more just system of taxation." 1300 DATA "Both of the young girls from Japan were vexed at his" 1310 DATA " quizzical look." 1320 DATA "Jim Faraday may achieve success by exercise of superior" 1330 DATA " judgment, zeal, and quick work." 1340 DATA "When the big black fox jumped over the fence, the little" 1350 DATA " squirrel gazed very curiously." 1360 DATA "You will probably have to explain if you did not use zeal" 1370 DATA " and judgment and work as quietly as you could." 1380 DATA "Just one hour of quiet, steady, exact work, is of far" 1390 DATA " greater value than a dozen hours of spasmodic bustling." 1400 DATA "**9" 1410 DATA "It cannot be too often repeated that it is not helps but" 1420 DATA " obstacles, not facilities but difficulties, that make men." 1430 DATA "The main purpose of the study of chemistry in school is to" 1440 DATA " teach the scientific method; that is, the appeal to experiment." 1450 DATA "Re Paper Release Lever: By means of the paper release lever" 1460 DATA " the paper in the machine is adjusted when it is fed twisted." 1470 DATA "Opportunity is coy. The careless, the slow, the lazy, the" 1480 DATA " unobservant, fail to see it, or clutch at it when it has gone." 1490 DATA "Poverty is a great evil in any station of life; but poverty" 1500 DATA " is never felt so severely as by those who have seen better days." 1510 DATA "Enclosed is a statement for your September account. This" 1520 DATA " is due on the 11th October, but has evidently escaped your notice." 1530 DATA "**END" 1540 IF FLG<>0 THEN FLG=0:GOTO 1600 ELSE FLG=1 1550 LOCATE 5,4:COLOR 7:PRINT "1 2 3 4 5 6 7 8 9 0 -" 1560 LOCATE 5,6:COLOR 7:PRINT " Q W E R T Y U I O P " 1570 LOCATE 5,8:COLOR 7:PRINT " A S D F G H J K L ; :" 1580 LOCATE 5,10:COLOR 7:PRINT " Z X C V B N M , . / " 1590 RETURN 1600 LOCATE 5,4:COLOR 7:PRINT "!" 1610 LOCATE 9,4:COLOR 7:PRINT CHR$(34) 1620 LOCATE 13,4:COLOR 7:PRINT "# $ % & ' ( ) =" 1630 LOCATE 5,6:COLOR 7:PRINT " Q W E R T Y U I O P " 1640 LOCATE 5,8:COLOR 7:PRINT " A S D F G H J K L + *" 1650 LOCATE 5,10:COLOR 7:PRINT " Z X C V B N M < > ? " 1660 RETURN 1000 'save "e:card1.bas",a 1010 DEFINT A-N:A=&H40:DIM B(2048):CLS 1020 OUT (&H37),&HD:OUT (&H46),&H82:OUT (&H46),&HF:OUT (&H37),&HC 1030 OUT (A),&H80:GOTO 1170 ' << Initialize >> 1040 '### Data Write : Data=[DT],Add(L)=[AL],Add(H)=[AH] ### 1050 DD=128+(DT MOD 16):OUT (A),DD:OUT (A),DD-128:OUT (A),DD ' D0-D3 1060 DD=144+INT(DT/16): OUT (A),DD:OUT (A),DD-128:OUT (A),DD ' D4-D7 1070 DD=160+(AL MOD 16):OUT (A),DD:OUT (A),DD-128:OUT (A),DD ' A0-A3 1080 DD=176+INT(AL/16): OUT (A),DD:OUT (A),DD-128:OUT (A),DD ' A4-A7 1090 DD=192+(AH MOD 16):OUT (A),DD:OUT (A),DD-128:OUT (A),DD ' A8-A11 1100 OUT (&H46),&HE:OUT (&H46),&HF:RETURN ' Strobe 1110 '### Data Read : Add(L)=[AL],Add(H)=[AH] -> Data=[DX] ### 1120 DD=160+(AL MOD 16):OUT (A),DD:OUT (A),DD-128:OUT (A),DD ' A0-A3 1130 DD=176+INT(AL/16): OUT (A),DD:OUT (A),DD-128:OUT (A),DD ' A4-A7 1140 DD=192+(AH MOD 16):OUT (A),DD:OUT (A),DD-128:OUT (A),DD ' A8-A11 1150 DX=0:FOR I=0 TO 7:OUT (A),128+16*I:J=(INP(&H42) AND &H4)/4 1160 DX=DX+J*2^I:NEXT I:RETURN 1170 '### Main Routine ### 1180 INPUT "Data Display : Input High Address ( 0 - 7 )";AH 1190 FOR AL=0 TO 255 1200 GOSUB 1110:PRINT HEX$(DX)+" "; 1210 NEXT AL 10 'save "coresim",a 20 KEY OFF:SCREEN 2:LOCATE ,,0:DIM MT(256) 30 ISX=3:ISY=2:IXMIN=150:IXMAX=IXMIN+255*ISX:IYMIN=170:IYMAX=IYMIN+255*ISY 40 CT=1:GOSUB 90 50 Z$=INKEY$:IF Z$="" THEN 50 60 IF Z$=" " THEN CT=CT+1:GOSUB 90 70 IF Z$<>CHR$(&H1B) THEN GOTO 50 80 SCREEN 0,0,0:LOCATE 1,1,1:KEY ON:END 90 ON CT GOSUB 100,200,300,400,500,600,700,800,80:RETURN 100 '***** Normal Power-Mantissa ***** 110 CLS:LINE (IXMIN-ISX,IYMIN-ISY)-(IXMAX+ISX,IYMAX+ISY),1,B 120 LOCATE 3,25:PRINT "<< 1:Normal Power-Mantissa >>" 130 FOR I=0 TO 255 140 MANTISSA=I MOD 16 150 POWER=INT(I/16) 160 MT(I)=INT(256*(2^(-POWER))*(MANTISSA/16)) 170 CIRCLE (IXMIN+I*ISX,IYMAX-MT(I)*ISY),2 180 PAINT (IXMIN+I*ISX,IYMAX-MT(I)*ISY) 190 NEXT I:RETURN 200 '***** Mantissa:Bit Swap ***** 210 CLS:LINE (IXMIN-ISX,IYMIN-ISY)-(IXMAX+ISX,IYMAX+ISY),1,B 220 LOCATE 3,25:PRINT "<< 2:Mantissa-Bit Swap >>" 230 FOR I=0 TO 255 240 MANTISSA=I MOD 16 250 POWER=INT(I/16) 260 MT(I)=INT(256*(2^(-POWER))*((15-MANTISSA)/16)) 270 CIRCLE (IXMIN+I*ISX,IYMAX-MT(I)*ISY),2 280 PAINT (IXMIN+I*ISX,IYMAX-MT(I)*ISY) 290 NEXT I:RETURN 300 '***** ***** 310 CLS:LINE (IXMIN-ISX,IYMIN-ISY)-(IXMAX+ISX,IYMAX+ISY),1,B 320 LOCATE 3,25:PRINT "<< 3:Power-Swap >>" 330 FOR I=0 TO 255 340 MANTISSA=I MOD 16 350 POWER=INT(I/16) 360 MT(I)=INT(256*(2^(-(15-POWER)))*(MANTISSA/16)) 370 CIRCLE (IXMIN+I*ISX,IYMAX-MT(I)*ISY),2 380 PAINT (IXMIN+I*ISX,IYMAX-MT(I)*ISY) 390 NEXT I:RETURN 400 '***** ***** 410 CLS:LINE (IXMIN-ISX,IYMIN-ISY)-(IXMAX+ISX,IYMAX+ISY),1,B 420 LOCATE 3,25:PRINT "<< 4: >>" 430 FOR I=0 TO 255 440 MANTISSA=I MOD 16 450 POWER=INT(I/16) 460 MT(I)=INT(256*(2^(-POWER))*(MANTISSA/16)) 470 CIRCLE (IXMIN+I*ISX,IYMAX-MT(I)*ISY),2 480 PAINT (IXMIN+I*ISX,IYMAX-MT(I)*ISY) 490 NEXT I:RETURN 500 '***** ***** 510 CLS:LINE (IXMIN-ISX,IYMIN-ISY)-(IXMAX+ISX,IYMAX+ISY),1,B 520 LOCATE 3,25:PRINT "<< 5: >>" 530 FOR I=0 TO 255 540 MANTISSA=I MOD 16 550 POWER=INT(I/16) 560 MT(I)=INT(256*(2^(-POWER))*(MANTISSA/16)) 570 CIRCLE (IXMIN+I*ISX,IYMAX-MT(I)*ISY),2 580 PAINT (IXMIN+I*ISX,IYMAX-MT(I)*ISY) 590 NEXT I:RETURN 600 '***** ***** 610 CLS:LINE (IXMIN-ISX,IYMIN-ISY)-(IXMAX+ISX,IYMAX+ISY),1,B 620 LOCATE 3,25:PRINT "<< 6: >>" 630 FOR I=0 TO 255 640 MANTISSA=I MOD 16 650 POWER=INT(I/16) 660 MT(I)=INT(256*(2^(-POWER))*(MANTISSA/16)) 670 CIRCLE (IXMIN+I*ISX,IYMAX-MT(I)*ISY),2 680 PAINT (IXMIN+I*ISX,IYMAX-MT(I)*ISY) 690 NEXT I:RETURN 700 '***** ***** 710 CLS:LINE (IXMIN-ISX,IYMIN-ISY)-(IXMAX+ISX,IYMAX+ISY),1,B 720 LOCATE 3,25:PRINT "<< 7: >>" 730 FOR I=0 TO 255 740 MANTISSA=I MOD 16 750 POWER=INT(I/16) 760 MT(I)=INT(256*(2^(-POWER))*(MANTISSA/16)) 770 CIRCLE (IXMIN+I*ISX,IYMAX-MT(I)*ISY),2 780 PAINT (IXMIN+I*ISX,IYMAX-MT(I)*ISY) 790 NEXT I:RETURN 800 '***** ***** 810 CLS:LINE (IXMIN-ISX,IYMIN-ISY)-(IXMAX+ISX,IYMAX+ISY),1,B 820 LOCATE 3,25:PRINT "<< 8: >>" 830 FOR I=0 TO 255 840 MANTISSA=I MOD 16 850 POWER=INT(I/16) 860 MT(I)=INT(256*(2^(-POWER))*(MANTISSA/16)) 870 CIRCLE (IXMIN+I*ISX,IYMAX-MT(I)*ISY),2 880 PAINT (IXMIN+I*ISX,IYMAX-MT(I)*ISY) 890 NEXT I:RETURN 10 'save "dirmap.bas",a 20 DIM X$(200),Y(200):CT=1 30 OPEN "dirlist.mes" FOR INPUT AS #1 40 INPUT #1,A$:IF LEN(A$)=0 THEN 170 50 J=1:K=LEN(A$) 60 IF J>=K THEN 170 ELSE B=ASC(MID$(A$,J,1)) 70 IF (128=K THEN J=J-K:GOTO 350 360 J=J+K:NEXT I:RETURN 1000 'save "file-cut2",a 1010 OPEN "f:z.z" FOR INPUT AS #1 1020 CLS:PRINT "<";TIME$;"> Start !" 1040 NO=0 1050 '### Loop ### 1060 NO=NO+1 1070 A$=HEX$(NO):PRINT "<";TIME$;"> FILE NAME = [ zz-";A$;".z ]" 1080 OPEN "c:zz-"+A$+".z" FOR OUTPUT AS #2 1090 I=0 1100 IF EOF(1) THEN CLOSE #1:CLOSE #2:END 1101 INPUT #1,E$ 1102 PRINT #2,E$ 1110 I=I+1:IF I<500 THEN 1100 1150 CLOSE #2 1200 GOTO 1050 10 'save "fno.bas",a 20 CLS:DIM X$(12):FOR I=0 TO 11:X$(I)=" db ":NEXT I 30 DIM Y$(12):FOR I=0 TO 11:Y$(I)=" db ":NEXT I 40 DIM Z$(12):FOR I=0 TO 11:Z$(I)=" db ":NEXT I 50 G#=3520#*(2#^(6.5#/12#)):H#=(2#^(1#/12#/32#)):A#=(2#^(1#/12#)):FOR I=0 TO 11 60 RESTORE 160:FOR K=1 TO (12-I):READ A$:NEXT K:PRINT "===== [ ";A$;" ] =====" 70 B#=1#/A#:FOR N=0 TO I:B#=B#*A#:NEXT N 80 FOR L=0 TO 31:PRINT " Offset (";:E$=HEX$(L):IF LEN(E$)=1 THEN E$="0"+E$ 90 PRINT E$;") :";:P#=1#/H#:FOR N=0 TO L:P#=P#*H#:NEXT N:U$=HEX$(L):IF LEN(U$)=1 THEN U$="0"+U$ 100 O#=G#*P#*B#:PRINT " f =";:PRINT USING "#####.######";O#;:PRINT "Hz"; 110 Q#=2#^24#*O#/62500#:C$=HEX$(INT(Q#)/256):PRINT " Data = ";C$; 120 D$=HEX$(INT(Q#)-256*INT(Q#/256)):IF LEN(D$)=1 THEN D$="0"+D$ 130 PRINT D$;:PRINT:X$(I)=X$(I)+"0"+LEFT$(C$,2)+"h," 140 Y$(I)=Y$(I)+"0"+RIGHT$(C$,2)+"h,":Z$(I)=Z$(I)+"0"+D$+"h," 150 NEXT L:PRINT :NEXT I 160 DATA "Eb-9","D -9","C#-9","C -9","B -8","Bb-8","A -8","Ab-8","G -8","F#-8","F -8","E -8" 170 OPEN "fnodata.s14" FOR OUTPUT AS #1 180 FOR I=0 TO 11:PRINT #1,X$(I):NEXT I:PRINT #1," " 190 FOR I=0 TO 11:PRINT #1,Y$(I):NEXT I:PRINT #1," " 200 FOR I=0 TO 11:PRINT #1,Z$(I):NEXT I:PRINT #1," " 210 CLOSE #1:END 10 'save "fileconv.bas",a 20 DEFINT A-Z 30 DATA 1,2,3,4,99,99,6,99,99,99,99,99,99,99,7,8 40 G$="demo":QT=4 50 PHASE=0:'First=0 !!! 60 IF PHASE=9 THEN 1520:'!!!!! Debug Only !!!!! 70 GOSUB 960:GOSUB 440:GOSUB 100 80 SHELL "copy f:dummy.dum a:"+G$+".kmy" 90 END 100 '***** TESTER File ***************************************** 110 OPEN "f:dummy.dum" FOR OUTPUT AS #2 120 FOR I=1 TO 32:PRINT #2,CHR$(0);:NEXT I 130 FF=0:F1=0:F2=0:GOSUB 420 140 OPEN "f:tr1.buf" FOR INPUT AS #1 150 FD=LOF(1)-1:GOSUB 420:CLOSE #1 160 OPEN "f:tr2.buf" FOR INPUT AS #1 170 FD=LOF(1)-1:GOSUB 420:CLOSE #1 180 OPEN "f:tr3.buf" FOR INPUT AS #1 190 FD=LOF(1)-1:GOSUB 420:CLOSE #1 200 OPEN "f:tr4.buf" FOR INPUT AS #1 210 FD=LOF(1)-1:GOSUB 420:CLOSE #1 220 OPEN "f:tr5.buf" FOR INPUT AS #1 230 FD=LOF(1)-1:GOSUB 420:CLOSE #1 240 OPEN "f:tr6.buf" FOR INPUT AS #1 250 FD=LOF(1)-1:GOSUB 420:CLOSE #1 260 OPEN "f:tr7.buf" FOR INPUT AS #1 270 FD=LOF(1)-1:GOSUB 420:CLOSE #1 280 FOR I=1 TO 16:PRINT #2,CHR$(0);:NEXT I 290 OPEN "f:tr1.buf" FOR INPUT AS #1:GOSUB 380 300 OPEN "f:tr2.buf" FOR INPUT AS #1:GOSUB 380 310 OPEN "f:tr3.buf" FOR INPUT AS #1:GOSUB 380 320 OPEN "f:tr4.buf" FOR INPUT AS #1:GOSUB 380 330 OPEN "f:tr5.buf" FOR INPUT AS #1:GOSUB 380 340 OPEN "f:tr6.buf" FOR INPUT AS #1:GOSUB 380 350 OPEN "f:tr7.buf" FOR INPUT AS #1:GOSUB 380 360 OPEN "f:tr8.buf" FOR INPUT AS #1:GOSUB 380 370 CLOSE #2:RETURN 380 FOR I=1 TO ((LOF(1)-1)/2) 390 E1$=INPUT$(1,#1):E2$=INPUT$(1,#1) 400 PRINT #2,CHR$(VAL("&H"+E1$+E2$));:PRINT E1$+E2$+" ";:NEXT I 410 CLOSE #1:RETURN 420 FF=FF+FD/2:F2=FF MOD 256:F1=INT(FF/256) 430 PRINT #2,CHR$(F2);:PRINT #2,CHR$(F1);:PRINT "#";:RETURN 440 '***** TESTER Format ***************************************** 450 DIM D(5000,4) 460 IF PHASE>2 THEN RETURN 470 OPEN "f:tr1.trk" FOR INPUT AS #1 480 OPEN "f:tr1.buf" FOR OUTPUT AS #2 490 GOSUB 720 500 OPEN "f:tr2.trk" FOR INPUT AS #1 510 OPEN "f:tr2.buf" FOR OUTPUT AS #2 520 GOSUB 720 530 OPEN "f:tr3.trk" FOR INPUT AS #1 540 OPEN "f:tr3.buf" FOR OUTPUT AS #2 550 GOSUB 720 560 OPEN "f:tr4.trk" FOR INPUT AS #1 570 OPEN "f:tr4.buf" FOR OUTPUT AS #2 580 GOSUB 720 590 OPEN "f:tr5.trk" FOR INPUT AS #1 600 OPEN "f:tr5.buf" FOR OUTPUT AS #2 610 GOSUB 720 620 OPEN "f:tr6.trk" FOR INPUT AS #1 630 OPEN "f:tr6.buf" FOR OUTPUT AS #2 640 GOSUB 720 650 OPEN "f:tr7.trk" FOR INPUT AS #1 660 OPEN "f:tr7.buf" FOR OUTPUT AS #2 670 GOSUB 720 680 OPEN "f:tr8.trk" FOR INPUT AS #1 690 OPEN "f:tr8.buf" FOR OUTPUT AS #2 700 GOSUB 720 710 RETURN 720 I=1:MK=0 730 IF EOF(1) THEN 800 ELSE INPUT #1,TM,ST,KN,VL 740 PRINT HEX$(TM),HEX$(ST),HEX$(KN),HEX$(VL):MK=1:TB=0 750 IF ST>&HBF THEN TB=TM:D(I,2)=&HC0:D(I,3)=KN:I=I+1:GOTO 730 760 IF VL>0 THEN D(I,1)=TM+TB:D(I,2)=KN:D(I,4)=VL:I=I+1:GOTO 730 770 FOR J=I-1 TO 1 STEP -1 780 IF D(J,2)=KN THEN D(J,3)=TM+TB:GOTO 730 790 NEXT J:PRINT "Error !!!":END 800 IF MK=0 THEN 880 810 FOR J=1 TO I-2 820 IF D(J,2)=&HC0 THEN 840 830 D1=D(J,2):D2=D(J+1,1)-D(J,1):D3=D(J,3)-D(J,1):D4=D(J,4):GOTO 860 840 D1=&HC0:D2=D(J,3):D3=0:D4=0:GOSUB 890 850 D1=&H80:D2=D(J+1,1)-D(J,1):D3=0:D4=0 860 PRINT "*";:GOSUB 890:NEXT J 870 D1=D(J,2):D2=D(J,3)-D(J,1):D3=D(J,3)-D(J,1):D4=D(J,4):GOSUB 890 880 D1=&HD0:D2=0:D3=0:D4=0:GOSUB 890:CLOSE:RETURN 890 IF D2>255 THEN DN=D2-255:DM=D1:D1=&H80:D2=&HFF:D3=0:D4=0:GOSUB 910:D1=DM:D2=DN:GOTO 890 900 IF D3>255 THEN D3=D3 AND 255:PRINT " $$$ "; 910 IF D1<16 THEN PRINT #2,"0"+HEX$(D1); ELSE PRINT #2,HEX$(D1); 920 IF D2<16 THEN PRINT #2,"0"+HEX$(D2); ELSE PRINT #2,HEX$(D2); 930 IF D3<16 THEN PRINT #2,"0"+HEX$(D3); ELSE PRINT #2,HEX$(D3); 940 IF D4<16 THEN PRINT #2,"0"+HEX$(D4); ELSE PRINT #2,HEX$(D4); 950 RETURN 960 '***** Init File Read ***************************************** 970 IF PHASE>0 THEN 1020 980 'CHDIR "a:\data" 990 'SHELL "copy a:"+G$+".dat f:"+G$+".dat" 1000 'SHELL "hdcut f:"+G$+".dat f:"+G$+".cut" 1010 SHELL "bin2asc f:"+G$+".cut f:"+G$+".asc":CLS 1020 IF PHASE>1 THEN 1510 1030 DIM AS(16):RESTORE 30 1040 FOR I=1 TO 16:READ AS(I):NEXT I 1050 OPEN "f:"+G$+".asc" FOR INPUT AS #10 1060 OPEN "f:tr1.trk" FOR OUTPUT AS #1 1070 OPEN "f:tr2.trk" FOR OUTPUT AS #2 1080 OPEN "f:tr3.trk" FOR OUTPUT AS #3 1090 OPEN "f:tr4.trk" FOR OUTPUT AS #4 1100 OPEN "f:tr5.trk" FOR OUTPUT AS #5 1110 OPEN "f:tr6.trk" FOR OUTPUT AS #6 1120 OPEN "f:tr7.trk" FOR OUTPUT AS #7 1130 OPEN "f:tr8.trk" FOR OUTPUT AS #8 1140 ZM=0 1150 IF EOF(10) THEN 1510 ELSE IP1$=INPUT$(1,#10):IP2$=INPUT$(1,#10) 1160 DT1=16*VAL("&H"+IP1$)+VAL("&H"+IP2$):ZM=ZM+DT1 1170 IF DT1=&HF8 THEN 1510 1180 IP1$=INPUT$(1,#10):IP2$=INPUT$(1,#10) 1190 GOSUB 1220 1200 PRINT ZM,HEX$(DT1),HEX$(DT2),HEX$(DT3),HEX$(DT4) 1210 GOTO 1150 1220 DT2=16*VAL("&H"+IP1$)+VAL("&H"+IP2$) 1230 IF DT2<&H80 AND ST>&HBF AND ST<&HD0 THEN 1360 1240 IF DT2<&H80 AND ST>&H8F AND ST<&HA0 THEN 1380 1250 IF DT2>&HBF AND DT2<&HD0 THEN 1330 1260 IF DT2>&H8F AND DT2<&HA0 THEN 1280 1270 PRINT "Error":END 1280 ST=DT2:IP1$=INPUT$(1,#10):IP2$=INPUT$(1,#10) 1290 DT3=16*VAL("&H"+IP1$)+VAL("&H"+IP2$) 1300 IP1$=INPUT$(1,#10):IP2$=INPUT$(1,#10) 1310 DT4=16*VAL("&H"+IP1$)+VAL("&H"+IP2$) 1320 GOSUB 1410:RETURN 1330 ST=DT2:IP1$=INPUT$(1,#10):IP2$=INPUT$(1,#10) 1340 DT3=16*VAL("&H"+IP1$)+VAL("&H"+IP2$):DT4=0 1350 GOSUB 1410:RETURN 1360 DT3=DT2:DT2=ST:DT4=0 1370 GOSUB 1410:RETURN 1380 DT3=DT2:DT2=ST:IP1$=INPUT$(1,#10):IP2$=INPUT$(1,#10) 1390 DT4=16*VAL("&H"+IP1$)+VAL("&H"+IP2$) 1400 GOSUB 1410:RETURN 1410 CH=DT2 AND &HF:IF AS(CH+1)>16 THEN RETURN 1420 ON AS(CH+1) GOTO 1430,1440,1450,1460,1470,1480,1490,1500 1430 PRINT #1,ZM/QT,DT2,DT3,DT4:RETURN 1440 PRINT #2,ZM/QT,DT2,DT3,DT4:RETURN 1450 PRINT #3,ZM/QT,DT2,DT3,DT4:RETURN 1460 PRINT #4,ZM/QT,DT2,DT3,DT4:RETURN 1470 PRINT #5,ZM/QT,DT2,DT3,DT4:RETURN 1480 PRINT #6,ZM/QT,DT2,DT3,DT4:RETURN 1490 PRINT #7,ZM/QT,DT2,DT3,DT4:RETURN 1500 PRINT #8,ZM/QT,DT2,DT3,DT4:RETURN 1510 CLOSE:RETURN 1520 '***** Debug Only ***************************************** 1530 OPEN "f:tr6.trk" FOR INPUT AS #1 1540 IF EOF(1) THEN END 1550 INPUT #1,A,B,C,D 1560 PRINT HEX$(A),HEX$(B),HEX$(C),HEX$(D) 1570 GOTO 1540 10 'save "dsp-fno.bas",a 20 KEY OFF 30 CLS:DIM X$(12):FOR I=0 TO 11:X$(I)=" db ":NEXT I 40 DIM Y$(12):FOR I=0 TO 11:Y$(I)=" db ":NEXT I 50 DIM Z$(12):FOR I=0 TO 11:Z$(I)=" db ":NEXT I 60 G#=3520#*(2#^(10.5#/12#)):H#=(2#^(1#/12#/32#)):A#=(2#^(1#/12#)):FOR I=0 TO 11 70 PRINT :PRINT :PRINT :PRINT :PRINT 80 RESTORE 210:FOR K=1 TO (12-I):READ A$:NEXT K:PRINT "===== [ ";A$;" ] =====" 90 B#=1#/A#:FOR N=0 TO I:B#=B#*A#:NEXT N 100 FOR L=0 TO 31:PRINT " Offset (";:E$=HEX$(L):IF LEN(E$)=1 THEN E$="0"+E$ 110 PRINT E$;") :";:P#=1#/H#:FOR N=0 TO L:P#=P#*H#:NEXT N:U$=HEX$(L):IF LEN(U$)=1 THEN U$="0"+U$ 120 O#=G#*P#*B#:PRINT " f =";:PRINT USING "#####.######";O#;:PRINT "Hz"; 130 Q#=2#^24#*O#/62500#:C$=HEX$(INT(Q#)/256):PRINT " Data = ";C$; 140 D$=HEX$(INT(Q#)-256*INT(Q#/256)):IF LEN(D$)=1 THEN D$="0"+D$ 150 PRINT D$;:PRINT:X$(I)=X$(I)+"0"+LEFT$(C$,2)+"h," 160 Y$(I)=Y$(I)+"0"+RIGHT$(C$,2)+"h,":Z$(I)=Z$(I)+"0"+D$+"h," 170 IF L MOD 16<>15 THEN 190 180 IF INKEY$="" THEN 180 ELSE CLS 190 NEXT L:PRINT 200 NEXT I 210 DATA "G -9","F#-9","F -9","E -9" 220 DATA "Eb-9","D -9","C#-9","C -9","B -8","Bb-8","A -8","Ab-8" 10 'save "dspedit.bas",a 20 DATA 2,0,1,1,1,3,3,3,3,3,3,3,3,3,3,3 30 CLS:DIM F$(64):GOSUB 2460:GOSUB 2280:GOSUB 2590:'<--- File Access 40 '''A$="c:dsdemo2.dat":'********* D U M M Y ************ 50 PRINT:PRINT :GOSUB 1370:CLS:GOTO 740 60 VIEW PRINT 1 TO 23:LOCATE 15,5:PRINT "<< PHASE #7 : Head Block Set >>" 70 DIM HEAD(64):FOR I=1 TO 16:HEAD(I-1)=ASC(MID$(NSM$,I,1)):NEXT I 80 VIEW PRINT 17 TO 22:FOR I=0 TO 15:PRINT HEAD(I);:NEXT I 90 FOR I=16 TO 33:HEAD(I)=0:NEXT I:HEAD(&H14)=4:HEAD(&H15)=120 100 IF TIMMAX=576 THEN HEAD(&H13)=3 ELSE HEAD(&H13)=4 110 HEAD(&H22)=(4*EVECTB+12) MOD 256 120 HEAD(&H23)=INT((4*EVECTB+12)/256) 130 HEAD(&H24)=((4*(EVECTB+EVECTC)+24) MOD 256) 140 HEAD(&H25)=INT((4*(EVECTB+EVECTC)+24)/256) 150 FOR I=0 TO 12 160 HEAD(&H26+2*I)=((4*(EVECTB+EVECTC+EVECTR)+36+4*I) MOD 256) 170 HEAD(&H27+2*I)=INT((4*(EVECTB+EVECTC+EVECTR)+36+4*I)/256) 180 NEXT I 190 PRINT:FOR I=16 TO 63:PRINT HEAD(I);:NEXT I 200 DIM ENDMK(4):ENDMK(1)=&HFC:ENDMK(2)=0:ENDMK(3)=0:ENDMK(4)=0 210 DIM LOPMK(4):LOPMK(1)=&HE1:LOPMK(2)=0:LOPMK(3)=0:LOPMK(4)=0 220 OPEN NKM$ FOR OUTPUT AS #3 230 FOR I=0 TO 63:PRINT #3,CHR$(HEAD(I));:NEXT I 240 FOR I=1 TO EVECTB:FOR K=1 TO 4:PRINT #3,CHR$(CH1(K,I));:NEXT K:NEXT I 250 TSUM=0:FOR I=1 TO EVECTB:TSUM=TSUM+CH1(2,I):NEXT I 260 PRINT #3,CHR$(&HF8); 270 PRINT #3,CHR$(INT(TIMMAX/IQ)-TSUM); 280 PRINT #3,CHR$(0);:PRINT #3,CHR$(0); 290 FOR K=1 TO 4:PRINT #3,CHR$(LOPMK(K));:NEXT K 300 FOR K=1 TO 4:PRINT #3,CHR$(ENDMK(K));:NEXT K 310 FOR I=1 TO EVECTC:FOR K=1 TO 4:PRINT #3,CHR$(CH2(K,I));:NEXT K:NEXT I 320 TSUM=0:FOR I=1 TO EVECTC:TSUM=TSUM+CH2(2,I):NEXT I 330 PRINT #3,CHR$(&HF8); 340 PRINT #3,CHR$(INT(TIMMAX/IQ)-TSUM); 350 PRINT #3,CHR$(0);:PRINT #3,CHR$(0); 360 FOR K=1 TO 4:PRINT #3,CHR$(LOPMK(K));:NEXT K 370 FOR K=1 TO 4:PRINT #3,CHR$(ENDMK(K));:NEXT K 380 FOR I=1 TO EVECTR:FOR K=1 TO 4:PRINT #3,CHR$(CH3(K,I));:NEXT K:NEXT I 390 TSUM=0:FOR I=1 TO EVECTR:TSUM=TSUM+CH3(2,I):NEXT I 400 PRINT #3,CHR$(&HF8); 410 PRINT #3,CHR$(INT(TIMMAX/IQ)-TSUM); 420 PRINT #3,CHR$(0);:PRINT #3,CHR$(0); 430 FOR K=1 TO 4:PRINT #3,CHR$(LOPMK(K));:NEXT K 440 FOR I=1 TO 14:FOR K=1 TO 4:PRINT #3,CHR$(ENDMK(K));:NEXT K:NEXT I 450 CLOSE #3 460 FOR I=1 TO 8:PRINT:NEXT I 470 VIEW PRINT 1 TO 23:LOCATE 15,5:PRINT " " 480 LOCATE 12,15:PRINT "***** is completely finished." 490 PRINT 500 END:''' VIEW PRINT 1 TO 23:KEY ON:END:'*************** 510 VIEW PRINT 1 TO 23:LOCATE 15,5:PRINT "<< PHASE #6 : 24's Normalize >>" 520 VIEW PRINT 17 TO 22:PRINT "Max Time Count =";TIMMAX 530 IF PRM6=1 THEN LPRINT:LPRINT "***** Quantize Normalise *****" 540 IF PRM6=1 THEN LPRINT:LPRINT "" 550 FOR I=1 TO EVECTB:CH1(2,I)=INT(CH1(2,I)/IQ):CH1(3,I)=INT(CH1(3,I)/IQ):NEXT I 560 FOR J=1 TO EVECTB:IF PRM6=0 THEN 580 570 LPRINT HEX$(CH1(1,J));" ";CH1(2,J);CH1(3,J);" ";HEX$(CH1(4,J)) 580 PRINT HEX$(CH1(1,J));" ";CH1(2,J);CH1(3,J);" ";HEX$(CH1(4,J)) 590 NEXT J 600 IF PRM6=1 THEN LPRINT:LPRINT "" 610 FOR I=1 TO EVECTC:CH2(2,I)=INT(CH2(2,I)/IQ):CH2(3,I)=INT(CH2(3,I)/IQ):NEXT I 620 FOR J=1 TO EVECTC:IF PRM6=0 THEN 640 630 LPRINT HEX$(CH2(1,J));" ";CH2(2,J);CH2(3,J);" ";HEX$(CH2(4,J)) 640 PRINT HEX$(CH2(1,J));" ";CH2(2,J);CH2(3,J);" ";HEX$(CH2(4,J)) 650 NEXT J 660 IF PRM6=1 THEN LPRINT:LPRINT "" 670 FOR I=1 TO EVECTR:CH3(2,I)=INT(CH3(2,I)/IQ):CH3(3,I)=INT(CH3(3,I)/IQ):NEXT I 680 FOR J=1 TO EVECTR:IF PRM6=0 THEN 700 690 LPRINT HEX$(CH3(1,J));" ";CH3(2,J);CH3(3,J);" ";HEX$(CH3(4,J)) 700 PRINT HEX$(CH3(1,J));" ";CH3(2,J);CH3(3,J);" ";HEX$(CH3(4,J)) 710 NEXT J 720 FOR I=1 TO 6:PRINT :NEXT I 730 GOTO 60 740 OPEN A$ FOR INPUT AS #1:LL=LOF(1):LOCATE 1,10:PRINT "File Name = ";A$; 750 PRINT " ( Data Length =";LL;"Bytes )":DIM D(LL) 760 IF PRM6+PRM5+PRM4+PRM3+PRM2+PRM1<>0 THEN LPRINT "File Name = ";A$:LPRINT 770 LOCATE 3,10:PRINT"Ch.Assign : Bass < 1st Track > = "; 780 FOR I=0 TO 15:IF AS(I)=O THEN PRINT HEX$(I+1);" "; 790 NEXT I:LOCATE 4,10:PRINT" Chord < 2nd Track > = "; 800 FOR I=0 TO 15:IF AS(I)=1 THEN PRINT HEX$(I+1);" "; 810 NEXT I:LOCATE 5,10:PRINT" Rhythm < 3rd Track > = "; 820 FOR I=0 TO 15:IF AS(I)=2 THEN PRINT HEX$(I+1);" "; 830 NEXT I 840 GOTO 1460:'----------------------------------------------------- 850 IF PRM4=0 THEN 880 860 LPRINT " Source = [";EVC(0);EVC(1);EVC(2);"]" 870 LPRINT " Result = [";MAXB;MAXC;MAXR;"]" 880 VIEW PRINT 1 TO 23:LOCATE 7,10:PRINT "Double Event Check : ("; 890 PRINT EVC(0);EVC(1);EVC(2);") --> (";MAXB;MAXC;MAXR;")" 900 LOCATE 13,5:PRINT " " 910 LOCATE 15,5:PRINT "<< PHASE #5 : KAMIYA Convert >>" 920 LOCATE 9,10:PRINT "Making File = ";NKM$;" ( Song Name = [";NSM$;"] )" 930 DIM CH1(4,MAXB),CH2(4,MAXC),CH3(4,MAXR):VIEW PRINT 17 TO 22 940 CNTB=2:CNTC=2:CNTR=2 950 CH1(1,1)=BASS(2,1):CH1(2,1)=0:CH1(3,1)=0:CH1(4,1)=BASS(3,1) 960 CH2(1,1)=CHORD(2,1):CH2(2,1)=0:CH2(3,1)=0:CH2(4,1)=CHORD(3,1) 970 CH3(1,1)=RHYTHM(2,1):CH3(2,1)=0:CH3(3,1)=0:CH3(4,1)=RHYTHM(3,1) 980 FOR I=2 TO MAXB:IF BASS(3,I)=0 THEN 1030 990 CH1(1,CNTB)=BASS(2,I):CH1(2,CNTB)=BASS(1,I) 1000 CH1(3,CNTB)=BASS(1,I):CH1(4,CNTB)=BASS(3,I) 1010 CH1(2,CNTB-1)=BASS(1,I)-CH1(2,CNTB-1) 1020 JJ=CNTB:CNTB=CNTB+1:GOTO 1050 1030 FOR J=CNTB-1 TO -1 STEP -1:IF BASS(2,I)=CH1(1,J) THEN 1040 ELSE NEXT J 1040 CH1(3,J)=BASS(1,I)-CH1(3,J) 1050 NEXT I:CH1(2,JJ)=BASS(1,I-1)-CH1(2,JJ):EVECTB=JJ 1060 FOR J=1 TO JJ:IF PRM5=0 THEN 1080 1070 LPRINT HEX$(CH1(1,J));" ";CH1(2,J);CH1(3,J);" ";HEX$(CH1(4,J)) 1080 PRINT HEX$(CH1(1,J));" ";CH1(2,J);CH1(3,J);" ";HEX$(CH1(4,J)) 1090 NEXT J 1100 FOR I=2 TO MAXC:IF CHORD(3,I)=0 THEN 1150 1110 CH2(1,CNTC)=CHORD(2,I):CH2(2,CNTC)=CHORD(1,I) 1120 CH2(3,CNTC)=CHORD(1,I):CH2(4,CNTC)=CHORD(3,I) 1130 CH2(2,CNTC-1)=CHORD(1,I)-CH2(2,CNTC-1) 1140 JJ=CNTC:CNTC=CNTC+1:GOTO 1170 1150 FOR J=CNTC-1 TO -1 STEP -1:IF CHORD(2,I)=CH2(1,J) THEN 1160 ELSE NEXT J 1160 CH2(3,J)=CHORD(1,I)-CH2(3,J) 1170 NEXT I:CH2(2,JJ)=CHORD(1,I-1)-CH2(2,JJ):EVECTC=JJ 1180 FOR J=1 TO JJ:IF PRM5=0 THEN 1200 1190 LPRINT HEX$(CH2(1,J));" ";CH2(2,J);CH2(3,J);" ";HEX$(CH2(4,J)) 1200 PRINT HEX$(CH2(1,J));" ";CH2(2,J);CH2(3,J);" ";HEX$(CH2(4,J)) 1210 NEXT J 1220 FOR I=2 TO MAXR:IF RHYTHM(3,I)=0 THEN 1270 1230 CH3(1,CNTR)=RHYTHM(2,I):CH3(2,CNTR)=RHYTHM(1,I) 1240 CH3(3,CNTR)=RHYTHM(1,I):CH3(4,CNTR)=RHYTHM(3,I) 1250 CH3(2,CNTR-1)=RHYTHM(1,I)-CH3(2,CNTR-1) 1260 JJ=CNTR:CNTR=CNTR+1:GOTO 1290 1270 FOR J=CNTR-1 TO -1 STEP -1:IF RHYTHM(2,I)=CH3(1,J) THEN 1280 ELSE NEXT J 1280 CH3(3,J)=RHYTHM(1,I)-CH3(3,J) 1290 NEXT I:CH3(2,JJ)=RHYTHM(1,I-1)-CH3(2,JJ):EVECTR=JJ 1300 FOR J=1 TO JJ:IF PRM5=0 THEN 1320 1310 LPRINT HEX$(CH3(1,J));" ";CH3(2,J);CH3(3,J);" ";HEX$(CH3(4,J)) 1320 PRINT HEX$(CH3(1,J));" ";CH3(2,J);CH3(3,J);" ";HEX$(CH3(4,J)) 1330 NEXT J 1340 FOR I=1 TO 6:PRINT :NEXT I 1350 GOTO 510 1360 ' ------------------------------------------- 1370 PRINT "Selected Data File Name = ";A$:PRINT 1380 PRINT " Output [TESTER] File Name = ";LEFT$(A$,2); 1390 INPUT "",NKM$:IF NKM$<>"" THEN NKM$=LEFT$(A$,2)+NKM$+".KMY":PRINT:GOTO 1430 1400 FOR I=1 TO 10:PP$=MID$(A$,I,1):IF PP$="." THEN 1420 1410 NKM$=NKM$+PP$:NEXT I 1420 NKM$=NKM$+".KMY":PRINT 1430 INPUT " Song Name = ",NSM$:IF LEN(NSM$)>16 THEN NSM$=LEFT$(NSM$,16) 1440 IF LEN(NSM$)<16 THEN NSM$=NSM$+STRING$(16-LEN(NSM$)," ") 1450 PRINT :RETURN 1460 LOCATE 13,5:PRINT "<< PHASE #1 : Data File Read >>":VIEW PRINT 15 TO 22 1470 FOR I=1 TO LL:B$=INPUT$(1,#1):C=ASC(B$):D$="":IF C<16 THEN D$="0" 1480 D(I)=C:PRINT D$+HEX$(C);" ";:IF I MOD 25=0 THEN PRINT 1490 IF PRM1=1 THEN LPRINT D$+HEX$(C);" ";:IF I MOD 25=0 THEN LPRINT 1500 NEXT I:CLOSE #1:FOR I=1 TO 8:PRINT :NEXT I 1510 VIEW PRINT 1 TO 23:LOCATE 13,5:PRINT "<< PHASE #2 : Format Convert >>" 1520 VIEW PRINT 15 TO 22:DIM FM(INT(LL/3),4):TIM=0:EVE=1:LOP=0 1530 GOSUB 2430:TIM=TIM+TB:GOSUB 2350:FM(EVE,1)=TIM:FM(EVE,2)=ST 1540 FM(EVE,3)=D(LOP):IF ST>&HBF AND ST<&HD0 THEN FM(EVE,4)=0:GOTO 1560 1550 LOP=LOP+1:FM(EVE,4)=D(LOP) 1560 IF PRM2=0 THEN 1600 ELSE IF EVE=1 THEN LPRINT 1570 LPRINT " Event NO. =";EVE;" --- Time =";FM(EVE,1);" --- Data = [ "; 1580 FOR K=2 TO 4:PD=FM(EVE,K):DM$="":IF PD<16 THEN DM$="0" 1590 LPRINT DM$+HEX$(PD)+" ";:NEXT K:LPRINT "]" 1600 PRINT " Event NO. =";EVE;" --- Time =";FM(EVE,1);" --- Data = [ "; 1610 FOR K=2 TO 4:PD=FM(EVE,K):DM$="":IF PD<16 THEN DM$="0" 1620 PRINT DM$+HEX$(PD)+" ";:NEXT K:PRINT "]" 1630 EVE=EVE+1:GOTO 1530 1640 TIMMAX=TIM:FOR I=1 TO 8:PRINT :NEXT I:VIEW PRINT 1 TO 23 1650 LOCATE 13,5:PRINT "<< PHASE #3 : Channel Assign >>":VIEW PRINT 15 TO 22 1660 DIM RD(3,4,EVE),EVC(3):TOF=0:FOR I=0 TO 3:EVC(I)=0:NEXT I 1670 DIM NM$(3):NM$(0)="Bass ":NM$(1)="Chord ":NM$(2)="Rhythm" 1680 FOR I=1 TO EVE-1:IF FM(I,2)>&H9F THEN TOF=TOF+FM(I,1):GOTO 1790 1690 CY=AS(FM(I,2) MOD 16):IF CY>2 THEN TOF=TOF+FM(I,1):GOTO 1790 1700 EVC(CY)=EVC(CY)+1:FOR K=1 TO 4:RD(CY,K,EVC(CY))=FM(I,K):NEXT K 1710 IF (FM(I,4)<>0 AND &H8F>":VIEW PRINT 15 TO 22 1810 DIM BASS(3,EVC(0)):CTT=0:FOR I=1 TO EVC(0):IF RD(0,4,I)=0 THEN 1860 1820 FOR J=I-1 TO 1 STEP -1 1830 IF RD(0,3,J)=RD(0,3,I) AND RD(0,4,J)=0 THEN 1900 1840 IF RD(0,3,J)=RD(0,3,I) AND RD(0,4,J)<>0 THEN 1950 1850 NEXT J:GOTO 1900 1860 FOR J=I-1 TO 1 STEP -1 1870 IF RD(0,3,J)=RD(0,3,I) AND RD(0,4,J)<>0 THEN 1900 1880 IF RD(0,3,J)=RD(0,3,I) AND RD(0,4,J)=0 THEN 1950 1890 NEXT J 1900 CTT=CTT+1 1910 BASS(1,CTT)=RD(0,1,I):BASS(2,CTT)=RD(0,3,I):BASS(3,CTT)=RD(0,4,I) 1920 FOR K=1 TO 3:PRINT HEX$(BASS(K,CTT));" ";:NEXT K 1930 IF PRM4=0 THEN 1950 1940 FOR K=1 TO 3:LPRINT HEX$(BASS(K,CTT));" ";:NEXT K:LPRINT "/ "; 1950 NEXT I:MAXB=CTT 1960 DIM CHORD(3,EVC(1)):CTT=0:FOR I=1 TO EVC(1):IF RD(1,4,I)=0 THEN 2010 1970 FOR J=I-1 TO 1 STEP -1 1980 IF RD(1,3,J)=RD(1,3,I) AND RD(1,4,J)=0 THEN 2050 1990 IF RD(1,3,J)=RD(1,3,I) AND RD(1,4,J)<>0 THEN 2100 2000 NEXT J:GOTO 2050 2010 FOR J=I-1 TO 1 STEP -1 2020 IF RD(1,3,J)=RD(1,3,I) AND RD(1,4,J)<>0 THEN 2050 2030 IF RD(1,3,J)=RD(1,3,I) AND RD(1,4,J)=0 THEN 2100 2040 NEXT J 2050 CTT=CTT+1 2060 CHORD(1,CTT)=RD(1,1,I):CHORD(2,CTT)=RD(1,3,I):CHORD(3,CTT)=RD(1,4,I) 2070 FOR K=1 TO 3:PRINT HEX$(CHORD(K,CTT));" ";:NEXT K 2080 IF PRM4=0 THEN 2100 2090 FOR K=1 TO 3:LPRINT HEX$(CHORD(K,CTT));" ";:NEXT K:LPRINT "/ "; 2100 NEXT I:MAXC=CTT 2110 DIM RHYTHM(3,EVC(2)):CTT=0:FOR I=1 TO EVC(2):IF RD(2,4,I)=0 THEN 2160 2120 FOR J=I-1 TO 1 STEP -1 2130 IF RD(2,3,J)=RD(2,3,I) AND RD(2,4,J)=0 THEN 2200 2140 IF RD(2,3,J)=RD(2,3,I) AND RD(2,4,J)<>0 THEN 2250 2150 NEXT J:GOTO 2200 2160 FOR J=I-1 TO 1 STEP -1 2170 IF RD(2,3,J)=RD(2,3,I) AND RD(2,4,J)<>0 THEN 2200 2180 IF RD(2,3,J)=RD(2,3,I) AND RD(2,4,J)=0 THEN 2250 2190 NEXT J 2200 CTT=CTT+1 2210 RHYTHM(1,CTT)=RD(2,1,I):RHYTHM(2,CTT)=RD(2,3,I):RHYTHM(3,CTT)=RD(2,4,I) 2220 FOR K=1 TO 3:PRINT HEX$(RHYTHM(K,CTT));" ";:NEXT K 2230 IF PRM4=0 THEN 2250 2240 FOR K=1 TO 3:LPRINT HEX$(RHYTHM(K,CTT));" ";:NEXT K:LPRINT "/ "; 2250 NEXT I:MAXR=CTT 2260 FOR I=1 TO 8:PRINT :NEXT I:GOTO 850 2270 '-------------------------------------------------------------- 2280 DIM AS(16):PRINT "MIDI Channel Assign ( Default=Below ) :":PRINT 2290 RESTORE 20:FOR I=0 TO 15:READ AS(I):NEXT I 2300 PRINT " [0] = Bass , [1] = Chord , [2] = Rhythm":PRINT 2310 FOR I=0 TO 15:PRINT " Ch(";HEX$(I);") =";AS(I);:NEXT I:PRINT 2320 PRINT:INPUT " Ok (Y/N) ? ",A$:IF A$<>"n" THEN PRINT:RETURN 2330 PRINT:FOR I=0 TO 15:PRINT " Channel [";HEX$(I);:INPUT "] ---> ",AS(I) 2340 NEXT I:PRINT:PRINT "New Assigned Channel :":PRINT :GOTO 2300 2350 LOP=LOP+1:ST=D(LOP):IF 127 dirlist.mes":OPEN "dirlist.mes" FOR INPUT AS #2 2620 INPUT #2,F$(J):IF F$(J)="" THEN 2620 ELSE AA=ASC(F$(J)) 2630 IF AA>64 AND AA<91 THEN F$(J)=LEFT$(F$(J),8):J=J+1 2640 IF AA>57 OR AA<48 THEN 2620 ELSE CLOSE #2:J=J-1 2650 CLS:PRINT "Select File :":K=J 2660 FOR I=1 TO J:LOCATE 3+INT((I-1)/5),8+14*((I-1) MOD 5):PRINT F$(I):NEXT I 2670 LOCATE 3+INT((J-1)/5),6+14*((J-1) MOD 5):PRINT "<"; 2680 LOCATE 3+INT((J-1)/5),17+14*((J-1) MOD 5):PRINT ">"; 2690 LOCATE 3+INT((J-1)/5),5+14*((J-1) MOD 5) 2700 B$=INKEY$:IF B$="" THEN 2700 ELSE IF B$=CHR$(13) THEN 2760 2710 IF LEN(B$)=1 THEN 2700 2720 IF ASC(RIGHT$(B$,1))=80 AND J=0 AND J1 THEN GOSUB 2770:J=J-1:GOTO 2670 2750 IF ASC(RIGHT$(B$,1))=72 AND J>5 THEN GOSUB 2770:J=J-5:GOTO 2670 ELSE GOTO 2700 2760 A$=DR$+":"+F$(J)+".DAT":RETURN 2770 LOCATE 3+INT((J-1)/5),6+14*((J-1) MOD 5):PRINT " "; 2780 LOCATE 3+INT((J-1)/5),17+14*((J-1) MOD 5):PRINT " ";:RETURN 10 'save "macconv.bas",a 20 CHDIR "a:\data":DIM F$(150):J=1 30 SHELL "dir a:*.dat > c:dirlist.mes" 40 OPEN "c:dirlist.mes" FOR INPUT AS #1 50 IF EOF(1) THEN 80 60 INPUT #1,F$(J) 70 F$(J)=LEFT$(F$(J),8):J=J+1:GOTO 50 80 CLOSE #1 90 FOR I=5 TO J-3:PRINT F$(I);" ";:NEXT I 100 IF INKEY$="" THEN 100:'******************* 110 FOR I=5 TO J-3 120 G$="":FOR K=1 TO 8 130 H$=MID$(F$(I),K,1):IF H$<>" " THEN G$=G$+H$ 140 NEXT K 150 SHELL "trauto a:"+G$+".dat a:"+G$+".cut" 160 SHELL "bin2asc a:"+G$+".cut a:"+G$+".asc" 170 NEXT I 10 'save "miditest.bas",a 20 OPEN "com1:9600,n,8,1" AS #1 30 START$=":90":CLEAN$=":B07B00" 40 PRINT #1,START$; 50 FOR I=100 TO 30 STEP -1 60 PRINT #1,HEX$(I)+"7F"; 70 FOR J=1 TO 50:NEXT J 80 NEXT I 90 PRINT #1,CLEAN$; 10 'SAVE "nonline",A 20 KEY OFF:SCREEN 1:DIM A(256),B(256),X(4),Y(4) 30 X(1)=50:Y(1)=186:X(2)=400:Y(2)=360:X(3)=750:Y(3)=215:X(4)=750:Y(4)=564 40 FOR I=1 TO 4:LINE (X(I),Y(I)-128)-(X(I)+257,Y(I)+129),1,B:NEXT I 50 FOR I=1 TO 4:LINE (X(I),Y(I))-(X(I)+257,Y(I)),1,,&HCCCC:NEXT I 60 FOR I=1 TO 2:LINE (X(I)+257,Y(I))-(X(I+1),Y(I+1)),1,,&HFCFC:NEXT I 70 LINE (X(2)+257,Y(2))-(X(4),Y(4)),1,,&HFCFC 80 LOCATE 2,9,0:PRINT "Source Wave"; 90 LOCATE 3,63:PRINT "Result Wave"; 100 LOCATE 8,36:PRINT "Trans Wave"; 110 LOCATE 15,63:PRINT "Reverse Wave"; 120 FOR I=1 TO 256:GOSUB 170:PSET (X(1)+I,Y(1)+128-A(I)):NEXT I 130 FOR I=1 TO 256:GOSUB 180:PSET (X(2)+I,Y(2)+128-B(I)):NEXT I 140 FOR I=1 TO 256:PSET (X(3)+I,Y(3)+128-B(A(I))):NEXT I 150 FOR I=1 TO 256:PSET (X(4)+I,Y(4)+128-A(B(I))):NEXT I 160 A$=INKEY$:IF A$<>" " THEN 160 ELSE SCREEN 0:KEY ON:LOCATE 1,1,1:END 170 A(I)=INT(127.999*SIN(I*3.1415926535#/128)+128):RETURN 180 B(I)=I:RETURN 10 'save "outconv.bas",a 20 CHDIR "a:\data":DIM F$(150):J=1 30 SHELL "dir a:*.kmy > c:dirlist.mes" 40 OPEN "c:dirlist.mes" FOR INPUT AS #1 50 IF EOF(1) THEN 80 60 INPUT #1,F$(J) 70 F$(J)=LEFT$(F$(J),8):J=J+1:GOTO 50 80 CLOSE #1 90 FOR I=5 TO J-3:PRINT F$(I);" ";:NEXT I 100 IF INKEY$="" THEN 100:'******************* 110 CHDIR "a:\" 120 FOR I=5 TO J-3 130 G$="":FOR K=1 TO 8 140 H$=MID$(F$(I),K,1):IF H$<>" " THEN G$=G$+H$ 150 NEXT K 160 SHELL "bin2asc a:\data\"+G$+".kmy a:\"+G$+".asc /w" 170 NEXT I 10 'save "pccont1.bas",a 20 'save "a:control3.bas",a 30 GOSUB *PARAINIT:GOSUB *DISPINIT:GOSUB *PORTINIT 40 *MAIN:A$=INKEY$:IF A$="" THEN *MAIN 50 IF A$=CHR$(&H1B) THEN *FINISH 60 IF A$=CHR$(30) THEN GOSUB *UPMOVE 70 IF A$=" " OR A$=CHR$(31) THEN GOSUB *DOWNMOVE 80 IF A$=CHR$(253) OR A$=CHR$(13) THEN ON MASKOLD GOSUB *CABLE,*DUMMY,*DUMMY,*DUMMY,*DUMMY,*DUMMY,*DUMMY,*DUMMY,*DUMMY,*DUMMY,*DUMMY,*DUMMY 90 Z$=A$:GOSUB *DATADISP 100 GOTO *MAIN 110 *FINISH:CLS 2:CONSOLE 0,25,1,0,1:LOCATE ,,1:LIST 20-*FINISH:END 120 *INIT 130 RETURN 140 *DUMMY:RETURN 150 *CABLE:GOSUB *CLRSCRN:RESTORE *DATA2:READ NEX$:FOR I=1 TO 7:READ DD$:PRINT DD$:NEXT I:PRINT NEX$; 160 *CABLE1:DDIN$=INKEY$:IF DDIN$="" THEN *CABLE1 ELSE PRINT:FOR I=1 TO 7:READ DD$:PRINT DD$:NEXT I:PRINT NEX$; 170 *CABLE2:DDIN$=INKEY$:IF DDIN$="" THEN *CABLE2 ELSE GOSUB *CLRSCRN:RETURN 180 *DATADISP:PRINT HEX$(ASC(Z$));" ";:RETURN 190 *UPMOVE 200 MASKNEW=MASKNEW-1:IF MASKNEW=0 THEN MASKNEW=KINDS 210 GOSUB *CURSORWRITE:RETURN 220 *DOWNMOVE 230 MASKNEW=MASKNEW+1:IF MASKNEW>KINDS THEN MASKNEW=1 240 GOSUB *CURSORWRITE:RETURN 250 *CURSORWRITE 260 COLOR@ (12,MASKOLD+2)-(LEN(B$(MASKOLD))+13,MASKOLD+2),0 270 COLOR@ (12,MASKNEW+2)-(LEN(B$(MASKNEW))+13,MASKNEW+2),4 280 MASKOLD=MASKNEW:RETURN 290 *DISPINIT:WIDTH 80,25:CONSOLE ,,0,0,1 300 LOCATE 12,1:PRINT "C O N T R O L P A N E L" 310 LOCATE 50,1:PRINT "produced by Y.Nagashima" 320 COLOR@ (2,1)-(77,1),4 330 LOCATE 5,3:PRINT "[MENU]" 340 FOR I=1 TO KINDS 350 LOCATE 13,I+2:PRINT B$(I) 360 NEXT I 370 MASKOLD=1:MASKNEW=1:GOSUB *CURSORWRITE 380 LOCATE 0,16:PRINT "-----< Data Area >"+STRING$(62,"-") 390 CONSOLE 17,8:LOCATE 0,17,0:RETURN 400 *CLRSCRN:PRINT:PRINT:PRINT:PRINT:PRINT:PRINT:PRINT:PRINT:PRINT:LOCATE 0,17:RETURN 410 *PORTINIT:OPEN "com1:n81nn" AS#1:RETURN 420 *PARAINIT:KINDS=12:DIM B$(KINDS) 430 RESTORE *DATA1:FOR I=1 TO KINDS:READ B$(I):NEXT I:RETURN 440 *DATA1 450 DATA "MIDI Cable Connection List" 460 DATA "Initial System Setting","Parameter List Display" 470 DATA "Keyboard Parameter Change","MIDI SW Matrix Change" 480 DATA "The Parameter Set","K-1m Exclusive Set" 490 DATA "Multi Track Sequencer","Program Change Control" 500 DATA "Dummy" 510 DATA "Load Parameter File","Save Current Parameter/Setting" 520 *DATA2 530 DATA " --------- ( Hit Any Key ! )" 540 DATA " (1) [LT] RS232C -----> [BOX] RS232C Port : DSUB" 550 DATA " (2) [Keyboard] Power Out -----> [BOX] Poewr In : MIDI-5" 560 DATA " (3) [BOX] MIDI Out -----> [Keyboard] MIDI In (1) : MIDI" 570 DATA " (4) [Keyboard] MIDI Out (1) -----> [BOX] MIDI In : MIDI" 575 DATA " (5) [BOX] Line Out (R/L) -----> Mixer / Amp : LINE" 580 DATA " (6) [Ext.KBD] MIDI Out -----> [Keyboard] MIDI In (2) : MIDI" 590 DATA " (7) [Keyboard] MIDI Out (2) -----> [Ext.KBD] MIDI In : MIDI" 610 DATA " (8) [Ext.KBD] Line Out (R/L) -----> Mixer / Amp : LINE" 620 DATA " (9) [K-1m] MIDI Out -----> [Keyboard] MIDI In (2) : MIDI" 630 DATA " (10) [Keyboard] MIDI Out (2) -----> [K-1m] MIDI In : MIDI" 640 DATA " (11) [K-1m] Line Out (R/L) -----> Mixer / Amp : LINE" 650 DATA " (12)" 660 DATA " (13)" 670 DATA " (14)" 10 'save "phase.bas",a 20 WEI=1.5:LIM=0:GOSUB 60 30 LIM=LIM+1:IF LIM>256*50 THEN 150 40 AAA=A(LIM MOD 256)+WEI*A((LIM+PH*INT(LIM/256)) MOD 256) 50 PSET (LIM MOD 2560,256+384*INT(LIM/2560)-INT(AAA/(1+WEI))):GOTO 30 60 CLS:INPUT "Input Phase Speed [0-255] --- ",PH 70 KEY OFF:SCREEN 1:DIM A(256) 80 WINDOW SCREEN (-9,-180)-(256*10+9,256*5+128*4+9):FOR I=0 TO 255 90 A(I)=INT(128+127.999*SIN(I*3.1415926535#/128)):NEXT I 100 FOR J=0 TO 4:FOR I=0 TO 256*9 STEP 256 110 LINE (I,J*384)-(I+256,J*384+256),1,B,&H1111:NEXT I 120 LINE (0,J*384)-(2560,J*384+256),1,B 130 LINE (0,J*384+128)-(2560,J*384+128),1,B,&H3333:NEXT J 140 LOCATE 1,40,0:PRINT "Phase = [";PH;"]";:RETURN 150 A$=INKEY$:IF A$<>" " THEN 150 ELSE SCREEN 0:KEY ON:LOCATE 1,1,1:END 10 'save "rain.bas",a 20 CT=20:KEY OFF:SCREEN 1:LOCATE 1,1,0 30 DIM R(3,20):FOR I=1 TO CT:R(1,I)=0:NEXT I 40 DIM RR(20):FOR I=1 TO 20:RR(I)=10*I:NEXT I 50 RANDOMIZE TIMER 60 FOR I=1 TO CT:IF R(1,I)=0 THEN 120 70 R(1,I)=R(1,I)+1:IF R(1,I)>20 THEN R(1,I)=0:GOTO 120 80 IF R(1,I)<6 THEN CIRCLE (R(2,I),R(3,I)),RR(R(1,I)),1:GOTO 120 90 IF R(1,I)>15 THEN CIRCLE (R(2,I),R(3,I)),RR(R(1,I)-5),0:GOTO 120 100 CIRCLE (R(2,I),R(3,I)),RR(R(1,I)),1 110 CIRCLE (R(2,I),R(3,I)),RR(R(1,I)-5),0 120 NEXT I 130 RND1=INT((CT-.01)*RND(1))+1:IF R(1,RND1)<>0 THEN 160 140 RND2=INT(1023.99*RND(2))+1:RND3=INT(767.99*RND(3))+1 150 R(1,RND1)=1:R(2,RND1)=RND2:R(3,RND1)=RND3:CIRCLE (RND2,RND3),10,1 160 IF INKEY$<>" " THEN 50 ELSE SCREEN 0:END 1000 'save "rnd",a 1010 DIM A(55,2) 1020 RANDOMIZE (33) 1030 FOR I=1 TO 55 : A(I,2)=0 : NEXT I 1040 OPEN "f:z.z" FOR OUTPUT AS #1 1050 FOR I=1 TO 55 1060 NO=INT(55*RND(1))+1 1070 IF A(NO,2)=1 THEN 1060 1080 A(NO,2)=1 1090 A$=HEX$(NO) 1100 PRINT A$;" "; 1110 PRINT #1,",0x"+A$ 1120 NEXT I 1130 CLOSE #1 1000 'save "rnd2",a 1010 DIM A(256,2) 1020 RANDOMIZE (33) 1030 FOR I=0 TO 255 : A(I,2)=0 : NEXT I 1040 OPEN "f:z.z" FOR OUTPUT AS #1 1050 FOR I=0 TO 25 1060 NO=INT(255.99*RND(1)) 1070 IF A(NO,2)=1 THEN 1060 1080 IF NO=26 THEN 1060 1090 A(NO,2)=1 1100 A$=HEX$(NO) 1110 PRINT A$;" "; 1120 PRINT #1,",0x"+A$ 1130 NEXT I 1140 NO=26 1150 A(NO,2)=1 1160 A$=HEX$(NO) 1170 PRINT A$;" "; 1180 PRINT #1,",0x"+A$ 1190 FOR I=27 TO 255 1200 NO=INT(255.99*RND(1)) 1210 IF A(NO,2)=1 THEN 1200 1220 A(NO,2)=1 1230 A$=HEX$(NO) 1240 PRINT A$;" "; 1250 PRINT #1,",0x"+A$ 1260 NEXT I 1270 CLOSE #1 10 'save "sine.bas",a 20 CLS:DIM X$(256):FOR I=0 TO 255:X$(I)=",":NEXT I 30 FOR I=0 TO 127 40 X=INT(127.999*SIN(I*3.141592*360/256/180)) 45 X$(I)=STR$(X) 50 PRINT X$(I);" "; 60 NEXT I 130 FOR I=0 TO 127 140 X=128+INT(127.999*SIN(I*3.141592*360/256/180)) 145 X$(I+128)=STR$(X) 150 PRINT X$(I+128);" "; 160 NEXT I 170 'OPEN "f:sine.dat" FOR OUTPUT AS #1 180 'FOR I=0 TO 255:PRINT #1,X$(I):NEXT I 210 'CLOSE #1:END 10 'save "tinycad",a 20 CLEAR ,&HC000:DEFINT I-N:DIM IC(33),DP(16) 30 LIM=200:IST=10:GR$="LINE":JX=330:JY=230:IUM=0:UM$="LIST File" 40 ISC=0:IDM=1:IGR=0 50 GOSUB 1580:GOSUB 1600 60 '### Main Menu ### 70 GOSUB 1530:GOSUB 1160:GOSUB 350 80 GOSUB 940:IPH=0 90 Z$=INKEY$:IF Z$="" THEN 90 ELSE IF LEN(Z$)=2 THEN Z$=RIGHT$(Z$,1) 100 IF Z$=CHR$(72) THEN GOSUB 300:GOTO 90 110 IF Z$=CHR$(80) THEN GOSUB 310:GOTO 90 120 IF Z$=CHR$(77) THEN GOSUB 320:GOTO 90 130 IF Z$=CHR$(75) THEN GOSUB 330:GOTO 90 140 IF Z$=CHR$(13) AND IPH=0 THEN GOSUB 1000:IPH=1:GOTO 90 150 IF Z$=CHR$(13) AND IPH=1 THEN ITI=1:GOSUB 1010:IPH=0:GOTO 90 160 IF Z$=" " AND ISC=0 THEN ISC=1:GOTO 80 170 IF Z$=" " AND ISC=1 THEN ISC=0:GOTO 80 180 IF Z$="R" OR Z$="r" THEN 70 190 IF Z$="P" OR Z$="p" THEN GOSUB 1500:GOTO 80 200 IF Z$="L" OR Z$="l" THEN GOSUB 1440:GOTO 80 210 IF Z$="S" OR Z$="s" THEN GOSUB 1320:GOTO 80 220 IF Z$="F" OR Z$="f" THEN GOSUB 1300:GOTO 80 230 IF Z$="M" OR Z$="m" THEN GOSUB 690:GOTO 70 240 IF Z$="U" OR Z$="u" THEN 550 250 IF (Z$="D" OR Z$="d") AND IDM=0 THEN IDM=1:GOTO 70 260 IF (Z$="D" OR Z$="d") AND IDM=1 THEN IDM=0:GOTO 70 270 IF Z$="E" OR Z$="e" THEN GOSUB 360:GOTO 70 280 IF Z$="C" OR Z$="c" THEN 1400 290 IF Z$=CHR$(27) THEN 1570 ELSE 90 300 IF JY<20+IST THEN RETURN ELSE PUT (JX,JY),IC:JY=JY-IST:GOTO 340 310 IF JY>490-IST THEN RETURN ELSE PUT (JX,JY),IC:JY=JY+IST:GOTO 340 320 IF JX>699-IST THEN RETURN ELSE PUT (JX,JY),IC:JX=JX+IST:GOTO 340 330 IF JX<10+IST THEN RETURN ELSE PUT (JX,JY),IC:JX=JX-IST:GOTO 340 340 GOSUB 350:LOCATE 1,70:PRINT JX;JY:RETURN 350 PUT (JX,JY),IC:RETURN 360 LOCATE 1,1:PRINT SPACE$(80);:LOCATE 1,1:PRINT "<< ERASE >>"; 370 KER=LIM:PRINT " [N]ext , [E]rase , [Q]uit " 380 IF KER=0 THEN RETURN ELSE LINE (11,21)-(698,489),0,BF 390 ADD=&HC000+16*(KER-1):KDT=PEEK(ADD):IF KDT<>2 THEN 420 400 LX=PEEK(ADD+1):LY=PEEK(ADD+2):LMX=PEEK(ADD+3):MD$="":FOR LM=1 TO LMX 410 MD$=MD$+CHR$(PEEK(ADD+3+LM)):NEXT LM:LOCATE LY,LX:PRINT MD$;:GOTO 510 420 IF KDT<>1 THEN KER=KER-1:IF KER=0 THEN RETURN ELSE GOTO 390 430 IGR=PEEK(ADD+1):FOR IK=1 TO 8:DP(IK)=PEEK(ADD+IK+1):NEXT IK 440 IX1=256*DP(1)+DP(2):IY1=256*DP(3)+DP(4) 450 MX=256*DP(5)+DP(6):MY=256*DP(7)+DP(8):IR=256*DP(5)+DP(6) 460 IF IGR=0 THEN LINE (IX1,IY1)-(MX,MY),1:GOTO 510 470 IF IGR=1 THEN LINE (IX1,IY1)-(MX,MY),1,B:GOTO 510 480 IF IGR=2 THEN LINE (IX1,IY1)-(MX,MY),1,BF:GOTO 510 490 IF IGR=3 THEN CIRCLE (IX1,IY1),IR,1:GOTO 510 500 IF IGR=4 THEN LINE (MX-1,MY-1)-(MX+1,MY+1),1,BF:CIRCLE (MX,MY),2,1 510 B$=INKEY$:IF B$="" THEN 510 520 IF B$=" " OR B$="N" OR B$="n" THEN KER=KER-1:GOTO 380 530 IF B$=CHR$(27) OR B$="E" OR B$="e" THEN POKE ADD,0:KER=KER-1:GOTO 380 540 IF B$=CHR$(13) OR B$="Q" OR B$="q" THEN RETURN ELSE GOTO 510 550 LOCATE 1,1:PRINT SPACE$(80);:LOCATE 1,1:PRINT "<< Utilities >>"; 560 LOCATE 1,20:PRINT "Select Mode = ";UM$;" "; 570 B$=INKEY$:IF B$="" THEN 570 580 IF B$=CHR$(27) THEN 70 590 IF B$=CHR$(13) THEN 630 ELSE IUM=(IUM+1) MOD 4 600 IF IUM=0 THEN UM$="LIST File" ELSE IF IUM=1 THEN UM$="LOAD File" 610 IF IUM=2 THEN UM$="SAVE File" ELSE IF IUM=3 THEN UM$="KILL File" 620 GOTO 560 630 IF IUM=0 THEN 670 ELSE INPUT " Name = ";UN$ 640 IF IUM=2 THEN BSAVE UN$+".cad",&HC000,&H4000:GOTO 80 650 IF IUM=1 THEN BLOAD UN$+".cad",&HC000:GOTO 70 660 KILL UN$+".cad":GOTO 80 670 LINE (0,0)-(719,511),0,BF:LOCATE 4,1:FILES 680 B$=INKEY$:IF B$="" THEN 680 ELSE GOTO 70 690 GOSUB 350:LOCATE 1,1:PRINT SPACE$(80);:LOCATE 1,1 700 LOCATE 1,1,0:PRINT " [ Message Print ] --- " 710 LOCATE 1,26:PRINT "Point Setting !!" 720 LX=INT((JX+4)/9):LY=INT((JY+10)/20):IF LX<3 THEN LX=3 730 IF LX>77 THEN LX=77 ELSE IF LY<3 THEN LY=3 ELSE IF LY>24 THEN LY=24 740 GOSUB 860 750 Y$=INKEY$:IF Y$="" THEN 750 ELSE IF LEN(Y$)=2 THEN Y$=RIGHT$(Y$,1) 760 IF Y$=CHR$(72) THEN GOSUB 810:GOTO 750 770 IF Y$=CHR$(80) THEN GOSUB 820:GOTO 750 780 IF Y$=CHR$(77) THEN GOSUB 830:GOTO 750 790 IF Y$=CHR$(75) THEN GOSUB 840:GOTO 750 800 IF Y$=CHR$(13) THEN 870 810 IF LY=3 THEN RETURN ELSE GOSUB 860:LY=LY-1:GOSUB 860:RETURN 820 IF LY=24 THEN RETURN ELSE GOSUB 860:LY=LY+1:GOSUB 860:RETURN 830 IF LX=77 THEN RETURN ELSE GOSUB 860:LX=LX+1:GOSUB 860:RETURN 840 IF LX=3 THEN RETURN ELSE GOSUB 860:LX=LX-1:GOSUB 860:RETURN 850 IF Y$=CHR$(27) THEN RETURN ELSE 750 860 PUT (9*LX-4,20*LY-10),IC:RETURN 870 LOCATE 1,26:PRINT "Input Data = " 880 LOCATE 1,40:INPUT MD$:IF LEN(MD$)>12 THEN BEEP:GOTO 870 ELSE ITI=1 890 ADD=&HC000+16*(ITI-1):KDT=PEEK(ADD):IF KDT=0 THEN 910 900 ITI=ITI+1:IF ITI>LIM THEN BEEP:RETURN ELSE 890 910 POKE ADD+1,LX:POKE ADD+2,LY:POKE ADD+3,LEN(MD$):FOR LM=1 TO LEN(MD$) 920 ME$=MID$(MD$,LM,1):AM=ASC(ME$):IF AM>255 THEN BEEP:GOTO 870 930 POKE ADD+3+LM,AM:NEXT LM:POKE ADD,2:RETURN 940 LOCATE 1,1:PRINT SPACE$(80);:IF ISC=1 THEN 970 950 LOCATE 1,1,0:PRINT "[R]edraw [S]elect "; 960 PRINT "[M]essage [E]rase [P]arameter";:GOTO 990 970 LOCATE 1,1,0:PRINT "[U]tility [F]reeze [D]otMesh [L]imit "; 980 PRINT "[C]lear" 990 LOCATE 1,70:PRINT JX;JY:RETURN 1000 IX1=JX:IY1=JY:RETURN 1010 ADD=&HC000+16*(ITI-1):KDT=PEEK(ADD):IF KDT=0 THEN 1030 1020 ITI=ITI+1:IF ITI>LIM THEN BEEP:RETURN ELSE 1010 1030 POKE ADD,1:POKE ADD+1,IGR:ON IGR+1 GOSUB 1040,1090,1100,1110,1150:RETURN 1040 LINE (IX1,IY1)-(JX,JY),1 1050 POKE ADD+2,INT(IX1/256):POKE ADD+3,(IX1 MOD 256) 1060 POKE ADD+4,INT(IY1/256):POKE ADD+5,(IY1 MOD 256) 1070 POKE ADD+6,INT(JX/256):POKE ADD+7,(JX MOD 256) 1080 POKE ADD+8,INT(JY/256):POKE ADD+9,(JY MOD 256):RETURN 1090 LINE (IX1,IY1)-(JX,JY),1,B:GOTO 1050 1100 LINE (IX1,IY1)-(JX,JY),1,BF:GOTO 1050 1110 IR=INT(SQR((IX1-JX)*(IX1-JX)+(IY1-JY)*(IY1-JY))):CIRCLE (IX1,IY1),IR,1 1120 POKE ADD+2,INT(IX1/256):POKE ADD+3,(IX1 MOD 256) 1130 POKE ADD+4,INT(IY1/256):POKE ADD+5,(IY1 MOD 256) 1140 POKE ADD+6,INT(IR/256):POKE ADD+7,(IR MOD 256):RETURN 1150 LINE (JX-1,JY-1)-(JX+1,JY+1),1,BF:CIRCLE (JX,JY),2,1:GOTO 1070 1160 FOR ITI=1 TO LIM:ADD=&HC000+16*(ITI-1):KDT=PEEK(ADD):IF KDT<>2 THEN 1190 1170 LX=PEEK(ADD+1):LY=PEEK(ADD+2):LMX=PEEK(ADD+3):MD$="":FOR LM=1 TO LMX 1180 MD$=MD$+CHR$(PEEK(ADD+3+LM)):NEXT LM:LOCATE LY,LX:PRINT MD$; 1190 NEXT ITI 1200 FOR ITI=1 TO LIM:ADD=&HC000+16*(ITI-1):KDT=PEEK(ADD):IF KDT<>1 THEN 1290 1210 IGR=PEEK(ADD+1):FOR IK=1 TO 8:DP(IK)=PEEK(ADD+IK+1):NEXT IK 1220 IX1=256*DP(1)+DP(2):IY1=256*DP(3)+DP(4) 1230 JX=256*DP(5)+DP(6):JY=256*DP(7)+DP(8):IR=256*DP(5)+DP(6) 1240 IF IGR=0 THEN LINE (IX1,IY1)-(JX,JY),1:GOTO 1290 1250 IF IGR=1 THEN LINE (IX1,IY1)-(JX,JY),1,B:GOTO 1290 1260 IF IGR=2 THEN LINE (IX1,IY1)-(JX,JY),1,BF:GOTO 1290 1270 IF IGR=3 THEN CIRCLE (IX1,IY1),IR,1:JX=IX1:JY=IY1:GOTO 1290 1280 IF IGR=4 THEN LINE (JX-1,JY-1)-(JX+1,JY+1),1,BF:CIRCLE (JX,JY),2,1 1290 NEXT ITI:IGR=0:GR$="LINE":RETURN 1300 LOCATE 1,1:PRINT SPACE$(80);:PUT (JX,JY),IC 1310 B$=INKEY$:IF B$="" THEN 1310 ELSE PUT (JX,JY),IC:RETURN 1320 LOCATE 1,1:PRINT SPACE$(80);:LOCATE 1,1:PRINT "<< Graph Select >>"; 1330 LOCATE 1,26:PRINT "Select Graph = ";GR$;" "; 1340 B$=INKEY$:IF B$="" THEN 1340 1350 IF B$=CHR$(13) THEN RETURN ELSE IGR=(IGR+1) MOD 5 1360 IF IGR=0 THEN GR$="LINE" ELSE IF IGR=1 THEN GR$="SQUARE" 1370 IF IGR=2 THEN GR$="BLOCK" ELSE IF IGR=3 THEN GR$="CIRCLE" 1380 IF IGR=4 THEN GR$="DOT" 1390 GOTO 1330 1400 LOCATE 1,1:PRINT SPACE$(80);:LOCATE 1,1:PRINT "### All Data Clear ###"; 1410 LOCATE 1,30:PRINT "CAUTION !!! ALL DATA DELETE OK? (Y/N)" 1420 B$=INKEY$:IF B$="" THEN 1420 1430 IF B$="Y" OR B$="y" THEN GOSUB 1590:GOTO 70 ELSE GOTO 80 1440 LOCATE 1,1:PRINT SPACE$(80);:LOCATE 1,1:PRINT "<< Data Count Limit >>"; 1450 KEF=0:FOR ITI=1 TO LIM:ADD=&HC000+16*(ITI-1) 1460 IF PEEK(ADD)<>0 THEN KEF=KEF+1 1470 NEXT ITI:US=INT(100*KEF/LIM) 1480 LOCATE 1,30:PRINT "Using =";KEF;" (";US;"% ) , Limit =";LIM;:INPUT B$ 1490 IF B$="" THEN RETURN ELSE LIM=VAL(B$):GOTO 1440 1500 LOCATE 1,1:PRINT SPACE$(80);:LOCATE 1,1:PRINT "<< Parameter Define >>"; 1510 LOCATE 1,30:PRINT "ICON Step Speed =";IST;:INPUT B$ 1520 IF B$="" THEN RETURN ELSE IST=VAL(B$):RETURN 1530 LINE (0,0)-(719,511),0,BF:LINE (10,20)-(699,490),1,B,&HCCCC 1540 IF IDM=0 THEN RETURN 1550 FOR IDX=20 TO 680 STEP 20:FOR IDY=40 TO 480 STEP 20 1560 PSET (IDX,IDY):NEXT IDY:NEXT IDX:RETURN 1570 COLOR 0,0,0:SCREEN 0,0,0:LOCATE 1,1,1:KEY ON:END:'####< END >#### 1580 KEY OFF:SCREEN 2:LINE (0,480)-(100,511),0,BF:LOCATE ,,0 1590 FOR XI=&HC000 TO &HFFFF STEP 16:POKE XI,0:NEXT XI:RETURN 1600 RESTORE 1670:DEF SEG=&HA000:FOR LIN=0 TO 20 1610 ADD=(LIN MOD 2)*&H8000+128*INT(LIN/2):IDAT=0:FOR IBIT=0 TO 7:READ IDOT 1620 IDAT=IDAT+IDOT*2^(7-IBIT):NEXT IBIT:POKE ADD,IDAT:ADD=ADD+1:IDAT=0 1630 FOR IBIT=0 TO 7:READ IDOT:IDAT=IDAT+IDOT*2^(7-IBIT):NEXT IBIT 1640 POKE ADD,IDAT:ADD=ADD+1:IDAT=0:FOR IBIT=0 TO 4:READ IDOT 1650 IDAT=IDAT+IDOT*2^(7-IBIT):NEXT IBIT:POKE ADD,IDAT:NEXT LIN :DEF SEG 1660 GET (0,0)-(20,20),IC:LINE (0,0)-(20,20),0,BF:RETURN 1670 DATA 1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0:'<1> 1680 DATA 1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0:'<2> 1690 DATA 0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0:'<3> 1700 DATA 0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0:'<4> 1710 DATA 0,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0:'<5> 1720 DATA 0,1,0,0,0,1,1,1,1,0,0,0,1,1,1,0,0,0,0,0,0:'<6> 1730 DATA 0,1,0,0,0,1,1,0,0,1,0,1,0,0,0,1,0,0,0,0,0:'<7> 1740 DATA 0,1,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0:'<8> 1750 DATA 0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0:'<9> 1760 DATA 0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0:'<10> 1770 DATA 0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0:'<11> 1780 DATA 0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0:'<12> 1790 DATA 0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0:'<13> 1800 DATA 0,0,0,0,0,0,1,0,0,0,0,0,0,1,1,0,0,0,0,0,0:'<14> 1810 DATA 0,0,0,0,0,0,0,1,0,0,0,0,0,1,1,0,0,0,0,0,0:'<15> 1820 DATA 0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,1,1,1,0,0,0:'<16> 1830 DATA 0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,1,0,1,1,0,0:'<17> 1840 DATA 0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,1,0,1,1,0:'<18> 1850 DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1:'<19> 1860 DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0:'<20> 1870 DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0:'<21> 10 'save "transim",a 20 DEFINT A-Z:DIM MT(256),MX(256):GOSUB 470:GOSUB 1090:GOSUB 930 30 '***** Main Loop ***** 40 GOSUB 100:GOSUB 180:Z$=INKEY$:IF Z$="" THEN 30 50 IF Z$="f" OR Z$="F" THEN GOSUB 880 60 IF Z$="s" OR Z$="S" THEN GOSUB 810 70 IF Z$="l" OR Z$="L" THEN GOSUB 740 80 IF Z$="t" OR Z$="T" THEN GOSUB 530 90 IF Z$<>CHR$(&H1B) THEN 30 ELSE SCREEN 0,0,0:LOCATE 1,1,1:KEY ON:END 100 '***** Mouse Point Check ***** 110 AX%=3:GOSUB 1210:JJX=CX%:JJY=DX%:IF JJX=JX AND JJY=JY THEN RETURN 120 JX=JJX:JY=JJY 130 II=(JX-IXMIN)/ISX:JJ=(IYMAX-JY)/ISY 140 XX$=HEX$(II):IF LEN(XX$)=1 THEN XX$="0"+XX$ 150 YY$=HEX$(JJ):IF LEN(YY$)=1 THEN YY$="0"+YY$ 160 LOCATE 3,45:PRINT "Address = [";XX$;"] , Data = [";YY$;"] " 170 RETURN 180 '***** Plot Point Check ***** 190 AX%=5:BX%=0:GOSUB 1210:IF BX%>0 THEN 210 200 AX%=5:BX%=1:GOSUB 1210:IF BX%=0 THEN RETURN 210 JX=CX%:JY=DX% 220 II=(JX-IXMIN)/ISX:JJ=(IYMAX-JY)/ISY 230 IF II=0 OR II=255 THEN MT(II)=JJ:GOTO 930 240 AX%=2:GOSUB 1210 'HIDE POINT CURSOR 250 KX=IXMIN+II*ISX:KY=IYMAX-JJ*ISY 260 FOR I=II+1 TO 254 270 IF MT(I)<256 THEN 290 280 NEXT I 290 RX=IXMIN+I*ISX:RY=IYMAX-MT(I)*ISY 300 FOR I=II-1 TO 1 STEP -1 310 IF MT(I)<256 THEN 330 320 NEXT I 330 LX=IXMIN+I*ISX:LY=IYMAX-MT(I)*ISY 340 IF MT(II)<256 THEN 410 ELSE MT(II)=JJ 350 LINE (LX,LY)-(RX,RY),0 360 CIRCLE (KX,KY),2 370 PAINT (KX,KY) 380 LINE (LX,LY)-(KX,KY) 390 LINE (KX,KY)-(RX,RY) 400 GOTO 460 410 NY=IYMAX-MT(II)*ISY:MT(II)=999 420 LINE (LX,LY)-(KX,NY),0 430 LINE (KX,NY)-(RX,RY),0 440 LINE (KX-2,NY-2)-(KX+2,NY+2),0,BF 450 LINE (LX,LY)-(RX,RY) 460 AX%=1:GOSUB 1210:RETURN 'SHOW POINT CURSOR 470 '***** Initialize Subroutine ***** 480 KEY OFF:SCREEN 2:LOCATE ,,0 490 MT(0)=0:FOR I=1 TO 254:MT(I)=999:NEXT I:MT(255)=255 500 ISX=3:ISY=2:IXMIN=130:IXMAX=IXMIN+255*ISX:IYMIN=130:IYMAX=IYMIN+255*ISY 510 JX=IXMIN:JY=IYMAX 520 RETURN 530 '***** Transfer Subroutine ***** 540 CLS:LOCATE 10,20:PRINT "W A I T A M O M E N T ! ! !" 550 OPEN "trnsdmy.tns" FOR OUTPUT AS #1 560 FOR I=0 TO 255:PRINT #1,MT(I):NEXT I:CLOSE #1 570 KZ=1:III=0 580 IF MT(KZ)>255 THEN 620 590 FOR J=III TO KZ-1 600 MX(J)=INT(MT(III)+(J-III)*((MT(KZ)-MT(III))/(KZ-III))) 610 NEXT J:III=KZ 620 KZ=KZ+1:IF KZ<256 THEN 580 ELSE MX(255)=MT(255) 630 OPEN "trnsdmy.asc" FOR OUTPUT AS #2 640 FOR I=0 TO 255 650 O1$=HEX$(I):IF LEN(O1$)=1 THEN O1$="0"+O1$ 660 O2$=HEX$(MX(I)):IF LEN(O2$)=1 THEN O2$="0"+O2$ 670 PRINT #2,"TNS"+CHR$(&HD)+":"+O1$+":"+O2$+":"; 680 NEXT I:CLOSE #2 690 SHELL "slowcopy.exe trnsdmy.asc" 700 KEY OFF:SCREEN 2:LOCATE ,,0 710 OPEN "trnsdmy.tns" FOR INPUT AS #1 720 FOR I=0 TO 255:INPUT #1,MT(I):NEXT I:CLOSE #1 730 CLS:GOSUB 930:RETURN 740 '***** Load Subroutine ***** 750 CLS:PRINT :PRINT " <<< Data File List Up >>>":PRINT :FILES "*.tns" 760 PRINT :INPUT " Input Load File NO. (TRNS***) --- ",YD$ 770 IF LEN(YD$)>3 THEN YD$=LEFT$(YD$,3) 780 OPEN "trns"+YD$+".tns" FOR INPUT AS #1 790 FOR I=0 TO 255:INPUT #1,MT(I):NEXT I:CLOSE #1 800 CLS:GOSUB 930:RETURN 810 '***** Save Subroutine ***** 820 CLS:PRINT :PRINT " <<< Data File List Up >>>":PRINT :FILES "*.tns" 830 PRINT :INPUT " Input Save File NO. (TRNS***) --- ",YD$ 840 IF LEN(YD$)>3 THEN YD$=LEFT$(YD$,3) 850 OPEN "trns"+YD$+".tns" FOR OUTPUT AS #1 860 FOR I=0 TO 255:PRINT #1,MT(I):NEXT I:CLOSE #1 870 CLS:GOSUB 930:RETURN 880 '***** Files Subroutine ***** 890 CLS:PRINT :PRINT " <<< Data File List Up >>>":PRINT :FILES "*.tns" 900 PRINT :PRINT " (Hit Any Key !)"; 910 IF INKEY$="" THEN 910 920 CLS:GOSUB 930:RETURN 930 '***** Screen Redraw ***** 940 AX%=2:GOSUB 1210 'HIDE POINT CURSOR 950 LINE (IXMIN-ISX,IYMIN-ISY)-(IXMAX+ISX+16,IYMAX+ISY+16),0,BF 960 LOCATE 1,3:PRINT "***** KTG101 Wave Conversion Simulate System *****" 970 LOCATE 24,30:PRINT "[F]iles [L]oad [S]ave [T]ransfer"; 980 LINE (IXMIN-ISX,IYMIN-ISY)-(IXMAX+ISX,IYMAX+ISY),1,B 990 FOR I=0 TO 255:IF MT(I)>255 THEN 1020 1000 CIRCLE (IXMIN+I*ISX,IYMAX-MT(I)*ISY),2 1010 PAINT (IXMIN+I*ISX,IYMAX-MT(I)*ISY) 1020 NEXT I:KX=IXMIN:KY=IYMAX-MT(0)*ISY:KZ=1 1030 IF MT(KZ)>255 THEN 1060 1040 LX=IXMIN+KZ*ISX:LY=IYMAX-MT(KZ)*ISY 1050 LINE (KX,KY)-(LX,LY):KX=LX:KY=LY 1060 KZ=KZ+1:IF KZ<256 THEN 1030 1070 AX%=1:GOSUB 1210 'SHOW POINT CURSOR 1080 RETURN 1090 '***** Mouse Initialize ***** 1100 DEF SEG=0 1110 MSEG=256*PEEK(51*4+3)+PEEK(51*4+2) 'GET INT33H VECTOR (SEG) 1120 MOUSE=256*PEEK(51*4+1)+PEEK(51*4)+2 'GET INT33H VECTOR (OFFSET) 1130 DEF SEG=MSEG 1140 AX%=30:BX%=3:GOSUB 1210 'MOUSE MODE SET 1150 AX%=0:GOSUB 1210 'RESET MOUSE 1160 AX%=15:CX%=8:DX%=8:GOSUB 1210 'SET MOUSE MOTION RATIO 1170 AX%=4:CX%=JX:DX%=JY:GOSUB 1210 'SET MOUSE CURSOR POSITION 1180 AX%=7:CX%=IXMIN:DX%=IXMAX:GOSUB 1210 1190 AX%=8:CX%=IYMIN:DX%=IYMAX:GOSUB 1210 1200 RETURN 1210 CALL MOUSE(AX%,BX%,CX%,DX%):RETURN