10 'save "b:editor.bas",a 20 DATA "<<<<<< DSP-PTB SYSTEM DEBUG/EDIT PROGRAM by Y.Nagashima >>>>>>" 30 ' DEBUG=1:' <-- Not [REM] = Only Development Mode !! 40 '======= Menu Screen Setting ======= 50 DIM GD$(100,2),INDT$(128),DF$(100),DFT(100) 60 DIM A$(4,18),A(1,72),B(72):' A=Tone Data,B=Flag 70 DIM Y(5,256),PF(14):'Y=Wave Data 80 DIM HC(128):'Harmony Coefficients 90 MAIT=200:OUTPT=&HE0D0:INPT=&HE0D8:OUT OUTPT,0 100 TEST=1:' <-- Timer Escape Mode ON !! 110 SCREEN 3:CONSOLE 0,25,0,1:WIDTH 80,25:COLOR 7:CLS 3 120 VIEW(0,0)-(639,399),,7 130 '======= Mode Select ======= 140 CLS 3 150 LOCATE 5,9:COLOR 5 160 PRINT "If you have missed operation, and if you want to return to "; 170 PRINT "EDITOR," 180 LOCATE 5,12:COLOR 5 190 PRINT "Please Input the word !!!" 200 A$=INKEY$:IF A$="" THEN 200 210 IF A$<>"s" AND A$<>"S" THEN 350 220 LOCATE 20,18:COLOR 4:PRINT A$; 230 A$=INKEY$:IF A$="" THEN 230 240 IF A$<>"o" AND A$<>"O" THEN 350 250 LOCATE 23,18:COLOR 4:PRINT A$; 260 A$=INKEY$:IF A$="" THEN 260 270 IF A$<>"r" AND A$<>"R" THEN 350 280 LOCATE 26,18:COLOR 4:PRINT A$; 290 A$=INKEY$:IF A$="" THEN 290 300 IF A$<>"r" AND A$<>"R" THEN 350 310 LOCATE 29,18:COLOR 4:PRINT A$; 320 A$=INKEY$:IF A$="" THEN 320 330 IF A$<>"y" AND A$<>"Y" THEN 350 340 GOTO 870:' Jump to Command Control Mode 350 '======= OS Mode ======= 360 CLS 3 370 LOCATE 20,0:COLOR 5:PRINT "*** ";:COLOR 6 380 PRINT "OS MODE";:COLOR 5:PRINT " ***" 390 LOCATE 18,6:COLOR 6:PRINT "<<>>" 400 LOCATE 20,8:COLOR 7:PRINT "0:SYSTEM RESET" 410 LOCATE 20,10:COLOR 7:PRINT "1:System Boot" 420 LOCATE 20,12:COLOR 7:PRINT "2:Execute" 430 LOCATE 20,14:COLOR 7:PRINT "Input Number="; 440 K=VAL(INPUT$(1)) 450 PRINT K 460 IF K>2 THEN BEEP :GOTO 110 470 ON K GOTO 110,510 480 LOCATE 20,8:COLOR 3:PRINT "0:SYSTEM RESET" 490 OD=&H0:GOSUB 2590:RD=&HF0:GOSUB 2710 500 GOTO 110 510 LOCATE 20,12:COLOR 3:PRINT "2:Execute" 520 LOCATE 20,15:COLOR 7:PRINT "(RETURN to Tester mode)" 530 LOCATE 20,14:COLOR 7:INPUT "Input jump address:&H",K$ 540 IF K$="" THEN K$="E000" 550 K$=RIGHT$("000"+K$,4) 560 OD=&H2:GOSUB 2590:OD=VAL("&H"+LEFT$(K$,2)):GOSUB 2590 570 OD=VAL("&H"+RIGHT$(K$,2)):GOSUB 2590:RD=&HF2:GOSUB 2710 580 IF VAL("&H"+K$)<>&HE000 THEN PRINT "Not availavle":END 590 '======= Tester Mode ======= 600 COLOR 7:CLS 3 610 LOCATE 20,0:COLOR 5:PRINT "*** OS MODE-->"; 620 COLOR 6:PRINT "Tester MODE ";:COLOR 5:PRINT "***" 630 LOCATE 18,6:COLOR 5:PRINT "<<>>" 640 LOCATE 20,7:COLOR 6:PRINT "<<>>" 650 LOCATE 22,9:COLOR 7:PRINT "0:Return to OS mode" 660 LOCATE 22,11:COLOR 7:PRINT "1:Command control mode" 670 LOCATE 22,13:COLOR 7:PRINT "2:Realtime mode" 680 LOCATE 22,15:COLOR 7:PRINT "Input Number="; 690 K=VAL(INPUT$(1)) 700 PRINT K 710 IF K>2 THEN BEEP :GOTO 390 720 ON K GOTO 860,750 730 OD=&H0:GOSUB 2590:RD=&HF1:GOSUB 2710 740 GOTO 110 750 CLS 3 760 LOCATE 20,0:COLOR 5:PRINT "***OS MODE-->Tester MODE-->"; 770 COLOR 6:PRINT "Realtime MODE";:COLOR 5:PRINT "***" 780 LOCATE 18,6:COLOR 5:PRINT "<<>>" 790 LOCATE 20,7:COLOR 5:PRINT "<<>>" 800 LOCATE 22,8:COLOR 6:PRINT "<<>>" 810 LOCATE 24,11:COLOR 7:PRINT "(RETURN to Tester mode)" 820 LOCATE 24,10:COLOR 7:INPUT"INPUT Register Number";K$ 830 IF K$="" THEN GOTO 600 840 LOCATE 24,12:COLOR 7:INPUT"INPUT Register DATA";K 850 GOTO 760 860 OD=&H1:GOSUB 2590:RD=&HF3:GOSUB 2710 870 '======= Command Control Mode ======= 880 CLS 3 890 LOCATE 10,0:COLOR 5:PRINT "***OS MODE-->Tester MODE-->"; 900 COLOR 6:PRINT "Command MODE";:COLOR 5:PRINT "***" 910 COLOR 7 920 XD=1:YD=1:OX=1:OY=1 930 LOCATE 25,7:PRINT "Wait for moments !!!" 940 LOCATE 1,13:PRINT STRING$(72,"*") 950 RESTORE 3220:BN=0 960 FOR J=1 TO 18 970 FOR I=1 TO 4 980 READ G$:A$(I,J)=G$:BN=BN+1 990 A(0,BN)=VAL("&h"+RIGHT$(A$(I,J),1)) 1000 A(1,BN)=VAL("&h"+MID$(A$(I,J),15,1)) 1010 LOCATE 72-(J-1)*4-(I-1),13:PRINT " "; 1020 NEXT I 1030 NEXT J 1040 RESTORE 3650:FOR I=1 TO 72:READ B(I):NEXT I 1050 '======== Print Main Menu ======= 1060 CLS 3 1070 COLOR 6:LOCATE 5,1:RESTORE 20:READ G$:PRINT G$ 1080 GOSUB 3130:' <--- flame / Mode Writing 1090 FOR I=1 TO 18 1100 FOR J=1 TO 4 1110 LOCATE (J-1)*19+4,(I-1)+6:PRINT A$(J,I) 1120 NEXT J 1130 NEXT I 1140 LINE (30,11*16)-(18*8*3+33+8,11*16) 1150 LINE (18*8*3+34+8,10*16)-(18*8*4+33+8,12*16),,B 1160 LINE (30,12*16)-(18*8*4+33+8,12*16) 1170 LINE (18*8*2+27+8,12*16)-(18*8*2+27+8,16*16),,B 1180 LINE (29,9*16)-(18*8*4+33+8,16*16),,B 1190 '======== Edit Main Menu ======= 1200 GOSUB 3170:GOSUB 3180:GOSUB 3190 1210 ' KKK$=CHR$(28)+CHR$(29)+CHR$(31)+CHR$(30)+"Q"+"q"+CHR$(127)+CHR$(18) 1220 LC=4:GOSUB 1440 1230 D$=INKEY$:IF D$="" THEN 1230 1240 ' ON INSTR(KKK$,D$) GOSUB 3070,3080,3100,3090,1530,1530,1290,1250 1241 IF D$=CHR$(28) THEN GOSUB 3070 1242 IF D$=CHR$(29) THEN GOSUB 3080 1243 IF D$=CHR$(31) THEN GOSUB 3100 1244 IF D$=CHR$(30) THEN GOSUB 3090 1245 IF D$="Q" THEN GOSUB 1530 1246 IF D$="q" THEN GOSUB 1530 1247 IF D$=CHR$(127) THEN GOSUB 1290 1248 IF D$=CHR$(18) THEN GOSUB 1250 1250 COLOR 7 1260 LOCATE (OX-1)*19+4,(OY-1)+6:PRINT A$(OX,OY) 1270 OX=XD:OY=YD 1280 GOTO 1220 1290 RETURN 1300 1300 GOSUB 3160:GOSUB 3180:GOSUB 3200 1310 NB=(YD-1)*4+XD:GOSUB 1420 1320 LC=6:GOSUB 1440 1330 IF B(NB)<>0 THEN GOSUB 1790:GOTO 1200 1340 A$(XD,YD)=LEFT$(A$(XD,YD),14)+HEX$(A(1,NB))+HEX$(A(0,NB)) 1350 LOCATE XD*19-1,YD+5:COLOR CH:PRINT HEX$(A(1,NB)); 1360 LOCATE XD*19,YD+5:COLOR CL:PRINT HEX$(A(0,NB)); 1370 D$=INKEY$:IF D$="" THEN 1370 1380 ' ON INSTR(KKK$,D$) GOSUB 1420,1430,1490,1510,1530,1530,1400,1410 1381 IF D$=CHR$(28) THEN GOSUB 1420 1382 IF D$=CHR$(29) THEN GOSUB 1430 1383 IF D$=CHR$(31) THEN GOSUB 1490 1384 IF D$=CHR$(30) THEN GOSUB 1510 1385 IF D$="Q" THEN GOSUB 1530 1386 IF D$="q" THEN GOSUB 1530 1387 IF D$=CHR$(127) THEN GOSUB 1400 1388 IF D$=CHR$(18) THEN GOSUB 1410 1390 GOTO 1340 1400 GOSUB 1550 1410 RETURN 1200 1420 HL=0:CH=6:CL=5:RETURN 1430 HL=1:CH=5:CL=6:RETURN 1440 COLOR LC 1450 LOCATE (XD-1)*19+4,(YD-1)+6:PRINT A$(XD,YD) 1460 LOCATE 0,0:'DUMY 1470 RETURN 1480 '======= Key Scan Routine ======= 1490 IF A(HL,NB)=0 THEN A(HL,NB)=15 ELSE A(HL,NB)=A(HL,NB)-1 1500 RETURN 1510 IF A(HL,NB)=15 THEN A(HL,NB)=0 ELSE A(HL,NB)=A(HL,NB)+1 1520 RETURN 1530 '======= Program Stop Routine ======= 1540 COLOR 7:CLS:OUT OUTPT,0:END 1550 '======= Tone Data Block Transfer routine ======= 1560 GOSUB 3160:GOSUB 3170:GOSUB 3210 1570 LC=2:GOSUB 1440 1580 IF NB>40 THEN RETURN 1590 IF NB>12 THEN 1680 1600 IF NB=6 THEN 1620 1610 RETURN 1620 OD=&H50:GOSUB 2590 1630 OD=A(0,2):GOSUB 2590 1640 RD=&H0:GOSUB 2710:RETURN:' Song NO. Transfer 1650 '======= Tone Data Send ======= 1660 DATA 21,22,23,25,27,29,30,33,34,31,32,35,36,20,24,13,14 1670 DATA 26,28,15,16,17,18,19,37,38,39,40 1680 XX=A(1,1)*16+A(0,1):IF XX>31 THEN BEEP:GOTO 1610 1690 OD=&H30:GOSUB 2590 1700 OD=XX:GOSUB 2590 1710 RESTORE 1660 1720 SUM=XX 1730 FOR J=1 TO 28 1740 READ K:XX=A(1,K)*16+A(0,K):SUM=(SUM+XX) MOD 256 1750 OD=XX:GOSUB 2590 1760 NEXT J 1770 FOR J=29 TO 48:OD=0:GOSUB 2590:NEXT J 1780 OD=SUM:GOSUB 2590:RD=&H0:GOSUB 2710:RETURN 1790 '======= Command Transfer Routine ======= 1800 GOSUB 3160:GOSUB 3170:GOSUB 3210 1810 LC=2:GOSUB 1440 1820 IF B(NB)=0 THEN RETURN:' Not Command ! 1830 IF B(NB)=1 THEN RETURN:' Not Defined ! (Reserved) 1840 IF B(NB)=2 THEN GOSUB 3710:' Song Data Transfer 1850 IF B(NB)=3 THEN GOSUB 2050:' Play Start 1860 IF B(NB)=4 THEN GOSUB 2070:' Play Stop 1870 IF B(NB)=5 THEN GOSUB 2090:' Play Continue 1880 IF B(NB)=6 THEN GOSUB 8240:' Wave Drawing Editor 1890 IF B(NB)=7 THEN GOSUB 6600:' Harmonics Editor 1900 IF B(NB)=8 THEN GOSUB 6330:' Data File Send 1910 IF B(NB)=9 THEN GOSUB 7050:' File Killer 1920 IF B(NB)=10 THEN GOSUB 2120:' Tone Data Load 1930 IF B(NB)=11 THEN GOSUB 2290:' Tone Data Save 1940 IF B(NB)=12 THEN GOSUB 4160:' Old Wave Editor 1950 IF B(NB)=13 THEN GOSUB 2570:' Return to TEST Mode 1960 IF B(NB)=14 THEN GOSUB 9340:' File Name List Up 1970 IF B(NB)=15 THEN GOSUB 11350:' PCM Data Plotter 1980 IF B(NB)=16 THEN GOSUB 10990:' Full PCM Data Converter 1990 IF B(NB)=17 THEN GOSUB 9410:' Sweep PCM Data Maker 2000 IF B(NB)=18 THEN GOSUB 2040:' 2010 IF B(NB)=19 THEN GOSUB 11540:' Files Define 2020 IF B(NB)=20 THEN GOSUB 12240:' Files Preset 2030 IF B(NB)=21 THEN GOSUB 2040 2040 RETURN 2050 OD=&H90:GOSUB 2590:OD=16*A(1,4)+A(0,4) 2060 GOSUB 2590:RD=&H0:GOSUB 2710:RETURN:' Play Start 2070 OD=&HB0:GOSUB 2590:OD=16*A(1,4)+A(0,4) 2080 GOSUB 2590:RD=&H0:GOSUB 2710:RETURN:' Play Stop 2090 OD=&HA0:GOSUB 2590:OD=16*A(1,4)+A(0,4) 2100 GOSUB 2590:RD=&H0:GOSUB 2710:RETURN:' Play Continue 2110 '======= Tone Data File Load ======= 2120 COLOR 7:CLS 3 2130 LOCATE 25,0:COLOR 6:PRINT "LOAD TONE DATA" 2140 LOCATE 0,3:COLOR 7:PRINT "FILE NAME LIST":SY=CSRLIN+1 2150 FILES "b:\data\*.DAT":MY=CSRLIN-1 2160 GOSUB 2380 2170 IF F$=" " THEN BEEP :GOTO 2270 2180 OPEN "b:\data\"+F$+".DAT" FOR INPUT AS #1 2190 FOR K=13 TO 40 2200 INPUT #1,XX 2210 A(1,K)=INT(XX/16) 2220 A(0,K)=XX MOD 16 2230 A$=HEX$(A(1,K))+HEX$(A(0,K)) 2240 TX=(K MOD 4):TY=INT(K/4)+1 2250 A$(TX,TY)=LEFT$(A$(TX,TY),14)+A$ 2260 NEXT K 2270 CLOSE #1:RETURN 1050 2280 '======= Tone Data File Save ======= 2290 COLOR 7:CLS 3 2300 LOCATE 25,0:COLOR 6:PRINT "SAVE TONE DATA" 2310 LOCATE 0,3:COLOR 7:PRINT "FILE NAME LIST":FILES "b:\data\*.DAT" 2320 INPUT "Save File Name=";F$ 2330 IF F$="" THEN BEEP :GOTO 2370 2340 OPEN "b:\data\"+F$+".DAT" FOR OUTPUT AS #1 2350 FOR K=13 TO 40:PRINT #1,A(1,K)*16+A(0,K):NEXT K 2360 FOR K=1 TO 20:PRINT #1,0:NEXT K 2370 CLOSE #1:RETURN 1050 2380 '======= File Name Edit ======= 2390 CX=0:CY=SY:DEF SEG=&HA000 2400 K$="":FOR I=CX*2+CY*160 TO CX*2+CY*160+79 STEP 2:K$=K$+CHR$(PEEK(I)) 2410 NEXT I 2420 LOCATE CX,CY:COLOR 4:PRINT K$:LOCATE 0,0 2430 D$=INPUT$(1) 2440 COLOR 7:LOCATE CX,CY:PRINT K$ 2450 ON INSTR(KKK$,D$) GOSUB 2470,2470,2480,2500,2490,2490,2520,2520 2460 GOTO 2400 2470 CX=(CX+40)MOD 80:RETURN 2480 IF CY=MY THEN CY=SY ELSE CY=CY+1 2490 RETURN 2500 IF CY=SY THEN CY=MY ELSE CY=CY-1 2510 RETURN 2520 COLOR 6:LOCATE CX,CY 2530 F$=LEFT$(K$,8) 2540 RETURN 2550 2550 RETURN 2560 '======= Return to Tester mode ======= 2570 FD=1000:OD=&H0:GOSUB 2590:RD=&HF2:GOSUB 2710 2580 RETURN 590 2590 '======= 1 Data Send Only ======= 2600 IF DEBUG=1 THEN RETURN 2610 ODD=OD AND &HF:OD=INT(OD/16) 2620 OUT OUTPT,(&H10 OR (&HF AND (NOT OD))):CTR=0 2630 ID=INP(INPT) AND &H20:RR=1:GOSUB 3010:IF ID<>0 THEN 2630 2640 OUT OUTPT,0:CTR=0 2650 ID=INP(INPT) AND &H20:RR=1:GOSUB 3010:IF ID=0 THEN 2650 2660 OUT OUTPT,(&H10 OR (&HF AND (NOT ODD))):CTR=0 2670 ID=INP(INPT) AND &H20:RR=2:GOSUB 3010:IF ID<>0 THEN 2670 2680 OUT OUTPT,0:CTR=0 2690 ID=INP(INPT) AND &H20:RR=2:GOSUB 3010:IF ID=0 THEN 2690 2700 RETURN 2710 '======= Message Receive only ======= 2720 IF DEBUG=1 THEN RETURN 2730 OUT OUTPT,&H10:CTR=0 2740 ID=INP(INPT) AND &H2F:RR=3:GOSUB 3010:IF ID<>0 THEN 2740:'<0> 2750 OUT OUTPT,0:CTR=0 2760 ID=INP(INPT) AND &H2F:RR=3:GOSUB 3010:IF ID<>&H2F THEN 2760:' 2770 OUT OUTPT,&H10:CTR=0 2780 ID=INP(INPT) AND &H2F:RR=4:GOSUB 3010:IF ID<>&HF THEN 2780 2790 OUT OUTPT,0:CTR=0 2800 ID=INP(INPT) AND &H20:RR=4:GOSUB 3010:IF ID=0 THEN 2800 2810 OUT OUTPT,&H10:CTR=0 2820 ID=INP(INPT) AND &H2F:RR=5:GOSUB 3010:IF (ID AND &H20)<>0 THEN 2820:'H 2830 GD=16*(ID AND &HF):OUT OUTPT,0:CTR=0 2840 ID=INP(INPT) AND &H2F:RR=5:GOSUB 3010:IF (ID AND &H20)=0 THEN 2840:' 2850 GD=GD OR (ID AND &HF):OUT OUTPT,&H10:CTR=0 2860 ID=INP(INPT) AND &H2F:RR=6:GOSUB 3010:IF ID<>&HF THEN 2860 2870 OUT OUTPT,0:CTR=0 2880 ID=INP(INPT) AND &H20:RR=6:GOSUB 3010:IF ID=0 THEN 2880 2890 IF RD=GD THEN RETURN ELSE RR=0:GOTO 3030 2900 '======= 8 Bit Data Receive only ======= 2910 IF DEBUG=1 THEN RETURN 2920 OUT OUTPT,&H10:CTR=0 2930 ID=INP(INPT) AND &H2F:RR=7:GOSUB 3010:IF (ID AND &H20)<>0 THEN 2930:'H 2940 GD=16*(ID AND &HF):OUT OUTPT,0:CTR=0 2950 ID=INP(INPT) AND &H2F:RR=7:GOSUB 3010:IF (ID AND &H20)=0 THEN 2950:' 2960 GD=GD OR (ID AND &HF):OUT OUTPT,&H10:CTR=0 2970 ID=INP(INPT) AND &H2F:RR=8:GOSUB 3010:IF ID<>&HF THEN 2970 2980 OUT OUTPT,0:CTR=0 2990 ID=INP(INPT) AND &H20:RR=8:GOSUB 3010:IF ID=0 THEN 2990 3000 RETURN 3010 '======= Communication Error Check ======= 3020 CTR=CTR+1:IF TEST=0 OR CTR" 3150 GOSUB 3160:GOSUB 3170:GOSUB 3180:RETURN 3160 LOCATE 32,4:COLOR 7:PRINT " DATA SELECT ":RETURN 3170 LOCATE 47,4:COLOR 7:PRINT " DATA CHANGE ":RETURN 3180 LOCATE 62,4:COLOR 7:PRINT " DATA TRANSFER ":RETURN 3190 LOCATE 32,4:COLOR 3:PRINT " DATA SELECT ":RETURN 3200 LOCATE 47,4:COLOR 3:PRINT " DATA CHANGE ":RETURN 3210 LOCATE 62,4:COLOR 3:PRINT " DATA TRANSFER ":RETURN 3220 '======= Menu Data Area ======= 3230 DATA "Edit Tone NO= 01" 3240 DATA "Play Song NO= 00","Send Song NO= 00" 3250 DATA "Play Channel= FF" 3260 DATA "Song Data Trans." 3270 DATA " Play Start !! "," Play Stop !! " 3280 DATA " Play Continue !" 3290 DATA " ・・・・・・・・ "," ・・・・・・・・ "," ・・・・・・・・ " 3300 DATA " ・・・・・・・・ " 3310 DATA "Random (A) = 00" 3320 DATA "Random (B) = 00" 3330 DATA "Random Clk = 02" 3340 DATA "Random Sel. = 47" 3350 DATA "Rnd.F-No(L) = FF","Rnd.F-No(M) = FF","Rnd.F-No(H) = 01" 3360 DATA "Sweep Range = 07" 3370 DATA "F-No.(low) = 00","F-No.(mid) = 00","F-No.(high) = 00" 3380 DATA "Sweep Speed = 05" 3390 DATA "Bank NO.(A) = 60","Control SGA = 00" 3400 DATA "Bank NO.(B) = 64","Control SGB = 10" 3410 DATA "Att.Lev.(A) = F6","Dec.Lev.(A) = 00" 3420 DATA "Att.Lev.(B) = FF","Dec.Lev.(B) = 00" 3430 DATA "Att.Spd (A) = 45" 3440 DATA "Dec.Spd (A) = C6" 3450 DATA "Att.Spd (B) = 45" 3460 DATA "Dec.Spd (B) = C6" 3470 DATA "Rel.Lev.(A) = 00","Rel.Spd (A) = 95" 3480 DATA "Rel.Lev.(B) = 00","Rel.Spd (B) = 95" 3490 DATA " ・・・・・・・・ "," ・・・・・・・・ "," ・・・・・・・・ " 3500 DATA " ・・・・・・・・ " 3510 DATA "Harmonics Drawer"," Files Define "," Files Preset " 3520 DATA " //////// " 3530 DATA " ・・・・・・・・ "," ・・・・・・・・ "," ・・・・・・・・ " 3540 DATA " ・・・・・・・・ " 3550 DATA "Wave Draw Editor","Harmonics Editor","Data File Trans." 3560 DATA "Data File Killer" 3570 DATA " ・・・・・・・・ "," ・・・・・・・・ "," ・・・・・・・・ " 3580 DATA " ・・・・・・・・ " 3590 DATA "File Name ListUp","PCM Data Plotter","Full PCM Convert" 3600 DATA "Sweep PCM Data !" 3610 DATA " ・・・・・・・・ "," ・・・・・・・・ "," ・・・・・・・・ " 3620 DATA " ・・・・・・・・ " 3630 DATA " Tone Data Load " 3640 DATA " Tone Data Save ","Old Wave Editor ","Return to Start " 3650 DATA 0,0,0,0,2,3,4,5,1,1,1,1 3660 DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0:'Tone Data 3670 DATA 1,1,1,1,18,19,20,21 3680 DATA 1,1,1,1,6,7,8,9 3690 DATA 1,1,1,1,14,15,16,17 3700 DATA 1,1,1,1,10,11,12,13 3710 '======= Song Data Transfer ======= 3720 XX=A(1,3)*16+A(0,3):IF XX>15 THEN BEEP:RETURN 3730 TEST=0:GOSUB 5580:IF TEST=1 THEN RETURN 3740 RETURN:' ### NINTENDO FORMAT IS DELETED !!! 3750 '======= 128 Wave Mode ======= 3760 LINE (0,0)-(350,399),0,BF 3770 LINE(9,17)-(282,274),5,B 3780 FOR I=1 TO 128 3790 HC(I)=0 3800 NEXT I 3810 CLS:GOSUB 5330:'Title 3820 COLOR 7 3830 LOCATE 2,18:PRINT "1st ------ Harmonics ------ 128st" 3840 LOCATE 2,20:INPUT "Harmonics(1-128) or End(Return)";BNO 3850 IF BNO=0 THEN 3940 3860 IF BNO>129 THEN BEEP :GOTO 3810 3870 LOCATE 2,21:INPUT "POWER(0-128)";PW$ 3880 IF PW$="" THEN 3900 ELSE PW=VAL(PW$) 3890 IF PW>128 OR PW<0 THEN BEEP :GOTO 3810 3900 HC(BNO)=PW 3910 LINE (BNO*2+15,274-128*2)-(BNO*2+17,274),0,BF 3920 LINE (BNO*2+15,274-PW*2)-(BNO*2+17,274),7,BF 3930 GOTO 3810 3940 LOCATE 2,21:INPUT "WAVE BOX No.(1<->6)";BNK 3950 IF BNK<1 OR BNK>6 THEN BEEP:GOTO 4140 3960 BNK=BNK-1 3970 LOCATE 2,23:COLOR 3:PRINT " Now Computing !!!" 3980 MAXY=0 3990 FOR X=1 TO 256 4000 Y(BNK,X)=0 4010 FOR I=1 TO 128 4020 IF HC(I)=0 THEN 4040 4030 Y(BNK,X)=HC(I)*SIN(6.283*X/256*I)+Y(BNK,X) 4040 NEXT I 4050 IF MAXY5 THEN RETURN 1050 4300 ON N GOSUB 4330,5190,5070,5370,3750 4310 GOTO 4190 4320 '======= 14 Wave Make ======= 4330 LINE (0,0)-(350,399),0,BF 4340 LINE(9,17)-(350,274),5,B 4350 PF(1)=256/2 4360 FOR I=2 TO 14 4370 PF(I)=0 4380 NEXT I 4390 LINE (24-5,18)-(24+2,274),7,BF 4400 CLS:GOSUB 5330 4410 COLOR 7 4420 LOCATE 2,18:PRINT "01 02 03 04 05 06 07 08 09 10 11 12 13 14" 4430 LOCATE 2,19:INPUT "F-No.(1<->14) or NEXT(RETURN)";BNO 4440 IF BNO=0 THEN 4520 4450 IF BNO>14 THEN BEEP :GOTO 4400 4460 LOCATE 2,20:INPUT "POWER(0<->128)";PW 4470 IF PW>128 OR PW<0 THEN BEEP :GOTO 4400 4480 PF(BNO)=PW 4490 LINE (BNO*24-5,274-128*2)-(BNO*24+2,274),0,BF 4500 LINE (BNO*24-5,274-PW*2)-(BNO*24+2,274),7,BF 4510 GOTO 4400 4520 LOCATE 2,20:INPUT "WAVE BOX No.(1<->6)";BNK 4530 IF BNK<1 OR BNK>6 THEN BEEP:GOTO 4700 4540 BNK=BNK-1 4550 MAXY=0 4560 FOR X=1 TO 256 4570 Y(BNK,X)=0 4580 FOR I=1 TO 14 4590 IF PF(I)=0 THEN 4610 4600 Y(BNK,X)=PF(I)*SIN(6.283*X/256*I)+Y(BNK,X) 4610 NEXT I 4620 IF MAXY6)";BNK:BNK=BNK-1 5100 IF BNK>5 OR BNK<0 THEN BEEP:RETURN 5110 INPUT "Save File Name";F$ 5120 IF F$="" THEN BEEP:GOTO 5170 5130 OPEN "B:\data\"+F$+".WAV" FOR OUTPUT AS #1 5140 FOR X=1 TO 256 5150 PRINT #1,CHR$(Y(BNK,X)+128); 5160 NEXT X 5170 CLOSE #1 5180 RETURN 5190 '======= Wave File Load ======= 5200 PRINT:PRINT "FILE NAME LIST":SY=CSRLIN+1 5210 FILES "B:\data\*.WAV":MY=CSRLIN-1 5220 INPUT "WAVE BOX No.(1<->6)";BNK:BNK=BNK-1 5230 IF BNK>5 OR BNK<0 THEN BEEP:RETURN 5240 GOSUB 2380 5250 IF F$=" " THEN BEEP:GOTO 5300 5260 OPEN "B:\data\"+F$+".WAV" FOR INPUT AS #1 5270 FOR X=1 TO 256 5280 Y(BNK,X)=ASC(INPUT$(1,#1))-128 5290 NEXT X 5300 CLOSE #1 5310 GOSUB 4850 5320 RETURN 5330 '======= Wave Editor Title ======= 5340 LOCATE 25,0:COLOR 6 5350 PRINT "WAVE EDITOR V1.0" 5360 RETURN 5370 '======= Wave Data Transfer ======= 5380 PRINT 5390 INPUT"WAVE BOX NO.(1<->6)=";BNK 5400 BNK=BNK-1 5410 IF BNK<0 OR BNK>5 THEN BEEP:RETURN 5420 INPUT"BANK NO.=(0<->255)";BANK 5430 IF BANK<0 OR BANK>255 THEN BEEP:RETURN 5440 COLOR 2 5450 PRINT "WAVE BOX NO.";:COLOR 5:PRINT BNK+1;:COLOR 2 5460 PRINT"-->BANK NO.";:COLOR 5:PRINT BANK 5470 COLOR 7 5480 OD=&H31:GOSUB 2590 5490 OD=BANK:GOSUB 2590 5500 SUM=BANK 5510 FOR I=1 TO 256 5520 IF Y(BNK,I)<0 THEN OD=128-Y(BNK,I) ELSE OD=Y(BNK,I):'NOT EXIST 128 5530 SUM=(SUM+OD) MOD 256:GOSUB 2590 5540 NEXT I 5550 OD=SUM:GOSUB 2590 5560 RD=&H0:GOSUB 2710 5570 RETURN 5580 '======= Tester Song Data Send Routine ======= 5590 FOR I=0 TO 4:LOCATE 0,I:COLOR 7:PRINT STRING$(79," "):NEXT I 5600 LOCATE 5,0:COLOR 6:PRINT "Select Songs :" 5610 LOCATE 30,0:COLOR 5:PRINT "(1) TEST Songs" 5620 LOCATE 30,1:COLOR 5:PRINT "(2) NINTENDO Songs" 5630 LOCATE 20,3:COLOR 3:PRINT "Select ---"; 5640 SEL$=INKEY$:IF SEL$="" THEN 5640 5650 IF SEL$="1" THEN 5710 5660 FOR I=0 TO 4:LOCATE 0,I:COLOR 7:PRINT STRING$(79," "):NEXT I 5670 LOCATE 20,0:COLOR 5:PRINT "***OS MODE-->Tester MODE-->"; 5680 COLOR 6:PRINT "Comand MODE";:COLOR 5:PRINT "***" 5690 COLOR 7,0:LOCATE 5,1:RESTORE 20:READ G$:PRINT G$ 5700 RETURN 5710 TEST=1 5720 FOR I=0 TO 4:LOCATE 0,I:COLOR 7:PRINT STRING$(79," "):NEXT I 5730 LOCATE 5,0:COLOR 3:PRINT "Select Display Mode :" 5740 LOCATE 30,0:COLOR 4:PRINT "(1) Display Monitor ON" 5750 LOCATE 30,1:COLOR 4:PRINT "(2) Silent (High Speed)" 5760 LOCATE 20,3:COLOR 6:PRINT "Select ---"; 5770 SEL$=INKEY$:IF SEL$="" THEN 5770 5780 IF SEL$<>"1" THEN 6130 ELSE 5910 5790 FOR I=0 TO 4:LOCATE 0,I:COLOR 7:PRINT STRING$(79," "):NEXT I 5800 LOCATE 0,0:COLOR 5:FILES "b:\data\*.nkk" 5810 LOCATE 0,0:COLOR 7:PRINT STRING$(79," "):LOCATE 20,4:COLOR 3 5820 INPUT "Input File Name (*****.DSP) ";FIL$ 5830 FOR I=0 TO 4:LOCATE 0,I:COLOR 7:PRINT STRING$(79," "):NEXT I 5840 OPEN "b:\data\"+FIL$+".nkk" AS #1 5850 FIELD #1,128 AS DUM1$,128 AS DUM2$:GET #1 5860 LL=256*ASC(MID$(DUM1$,2,1))+ASC(LEFT$(DUM1$,1)):MM=INT(LL/256)+1 5870 GD$(1,1)=RIGHT$(DUM1$,128-16):GD$(1,2)=DUM2$ 5880 FOR I=2 TO MM:GET #1:GD$(I,1)=DUM1$:GD$(I,2)=DUM2$:NEXT I 5890 NN=LL MOD 256:IF NN>127 THEN NN=NN-128:JJ=2 ELSE JJ=1:GD$(MM,2)="" 5900 GD$(MM,JJ)=LEFT$(GD$(MM,JJ),NN):CLOSE #1:RETURN 5910 GOSUB 5790 5920 OD=&H40:GOSUB 2590:SUM=XX 5930 OD=XX:GOSUB 2590 5940 LL=LL-16:COLOR 6 5950 OD=INT(LL/256):SUM=(SUM+OD) MOD 256:GOSUB 2590 5960 OD=INT(LL MOD 256):SUM=(SUM+OD) MOD 256:GOSUB 2590 5970 LOCATE 0,0:LINENO=0:FOR JJJ=1 TO MM 5980 FOR III=1 TO LEN(GD$(JJJ,1)) 5990 AA$=HEX$(ASC(MID$(GD$(JJJ,1),III,1))):IF LEN(AA$)=1 THEN AA$="0"+AA$ 6000 OD=VAL("&h"+AA$):SUM=(SUM+OD) MOD 256:GOSUB 2590 6010 PRINT AA$;" ";:LINENO=LINENO+1:IF LINENO MOD 25=0 THEN PRINT 6020 IF LINENO MOD 125=0 THEN LOCATE 0,0 6030 NEXT III 6040 FOR III=1 TO LEN(GD$(JJJ,2)) 6050 AA$=HEX$(ASC(MID$(GD$(JJJ,2),III,1))):IF LEN(AA$)=1 THEN AA$="0"+AA$ 6060 OD=VAL("&h"+AA$):SUM=(SUM+OD) MOD 256:GOSUB 2590 6070 PRINT AA$;" ";:LINENO=LINENO+1:IF LINENO MOD 25=0 THEN PRINT 6080 IF LINENO MOD 125=0 THEN LOCATE 0,0 6090 NEXT III 6100 NEXT JJJ 6110 OD=SUM:GOSUB 2590:RD=&H0:GOSUB 2710 6120 BEEP:GOTO 5660 6130 GOSUB 5790 6140 OD=&H40:GOSUB 2590:SUM=XX 6150 OD=XX:GOSUB 2590 6160 LL=LL-16:COLOR 6 6170 OD=INT(LL/256):SUM=(SUM+OD) MOD 256:GOSUB 2590 6180 OD=INT(LL MOD 256):SUM=(SUM+OD) MOD 256:GOSUB 2590 6190 LOCATE 10,2:COLOR 6:PRINT "Block Size =";MM 6200 FOR JJJ=1 TO MM 6210 FOR III=1 TO LEN(GD$(JJJ,1)) 6220 AA$=HEX$(ASC(MID$(GD$(JJJ,1),III,1))) 6230 OD=VAL("&h"+AA$):SUM=(SUM+OD) MOD 256:GOSUB 2590 6240 NEXT III 6250 FOR III=1 TO LEN(GD$(JJJ,2)) 6260 AA$=HEX$(ASC(MID$(GD$(JJJ,2),III,1))) 6270 OD=VAL("&h"+AA$):SUM=(SUM+OD) MOD 256:GOSUB 2590 6280 NEXT III 6290 LOCATE 35,2:COLOR 5:PRINT "Remain =";:COLOR 3:PRINT MM-JJJ 6300 NEXT JJJ 6310 OD=SUM:GOSUB 2590:RD=&H0:GOSUB 2710 6320 BEEP:GOTO 5660 6330 '======= Data File Transfer Routine ======= 6340 COLOR 7:CLS 3 6350 LOCATE 25,0:INPUT "Send Tone NO ( 0 - 1F ) = ";ZZ$:XX=VAL("&h"+ZZ$) 6360 IF XX<>INT(XX) OR XX>31 THEN BEEP:GOTO 6350 6370 LOCATE 0,3:COLOR 7:PRINT "Select File : ":SY=CSRLIN+1 6380 FILES "b:\data\*.DAT":MY=CSRLIN-1 6390 GOSUB 2380 6400 IF F$="BASIC " OR F$="" THEN 6590 6410 OPEN "b:\data\"+F$+".DAT" FOR INPUT AS #1 6420 FOR K=13 TO 40 6430 INPUT #1,WW 6440 A(1,K)=INT(WW/16) 6450 A(0,K)=WW MOD 16 6460 NEXT K 6470 CLOSE #1 6480 OD=&H30:GOSUB 2590 6490 OD=XX:GOSUB 2590 6500 RESTORE 1660 6510 SUM=XX 6520 FOR J=1 TO 28 6530 READ K:XX=A(1,K)*16+A(0,K):SUM=(SUM+XX) MOD 256 6540 OD=XX:GOSUB 2590 6550 NEXT J 6560 FOR J=29 TO 48:OD=0:GOSUB 2590:NEXT J 6570 OD=SUM:GOSUB 2590:RD=&H0:GOSUB 2710 6580 GOTO 6340 6590 RETURN 1050 6600 '======= Harmonics Data File Routine ======= 6610 FOR K=1 TO 128:HC(K)=0:NEXT K 6620 CLS 3:COLOR 7:GOSUB 7250 6630 CLS 6640 LOCATE 2,0:COLOR 4:PRINT "<< Harmonics Data File Editor >>" 6650 LOCATE 10,2:COLOR 7 6660 PRINT "1.Data File Load" 6670 LOCATE 10,3:COLOR 7 6680 PRINT "2.Data File Save " 6690 LOCATE 10,4:COLOR 7 6700 PRINT "3.Data Caluclate/Save/Transfer" 6710 LOCATE 10,5:COLOR 7 6720 PRINT "4.Data Edit" 6730 LOCATE 10,6:COLOR 7 6740 PRINT "5.Rerurn" 6750 LOCATE 50,5:COLOR 6:PRINT "Input NO. ?"; 6760 ANS$=INKEY$:N=VAL(ANS$):IF N>0 AND N<6 THEN 6770 ELSE 6760 6770 IF N=1 THEN GOSUB 6820:CLS:GOSUB 7250:GOTO 6640 6780 IF N=2 THEN GOSUB 6940:CLS:GOSUB 7250:GOTO 6640 6790 IF N=3 THEN GOSUB 7680:CLS:GOSUB 7250:GOTO 6640 6800 IF N=4 THEN GOSUB 7320:GOTO 6630 6810 RETURN 1050 6820 '======= Harmonics Data File Load ======= 6830 COLOR 7:CLS 3 6840 LOCATE 25,0:COLOR 3:PRINT "Load Harmonics Data" 6850 LOCATE 0,3:COLOR 7:PRINT "File Name List":SY=CSRLIN+1 6860 FILES "b:\data\*.hcc":MY=CSRLIN-1 6870 GOSUB 2380 6880 IF F$="end " THEN 6930 6890 OPEN "b:\data\"+F$+".hcc" FOR INPUT AS #1 6900 FOR K=1 TO 128 6910 INPUT #1,HC(K) 6920 NEXT K 6930 CLOSE #1:RETURN 6940 '======= Harmonics Data File Save ======= 6950 COLOR 7:CLS 3 6960 LOCATE 25,0:COLOR 3:PRINT "Save Harmonics Data" 6970 LOCATE 0,3:COLOR 7:PRINT "File Name List":FILES "b:\data\*.hcc" 6980 INPUT "Save File Name=";F$ 6990 IF F$="" THEN BEEP :GOTO 7040 7000 OPEN "b:\data\"+F$+".hcc" FOR OUTPUT AS #1 7010 FOR K=1 TO 128 7020 PRINT #1,HC(K) 7030 NEXT K 7040 CLOSE #1:RETURN 7050 '======= File Erase ======= 7060 COLOR 7:CLS 3 7070 LOCATE 25,0:COLOR 6:PRINT "Erase File" 7080 LOCATE 0,3:COLOR 5:PRINT "Select : [ WAV / DAT / HCC / PCM"; 7090 INPUT " / SRC / BIN ]";SF$ 7100 IF SF$="wav" OR SF$="WAV" THEN 7170 7110 IF SF$="dat" OR SF$="DAT" THEN 7170 7120 IF SF$="hcc" OR SF$="HCC" THEN 7170 7130 IF SF$="pcm" OR SF$="PCM" THEN 7170 7140 IF SF$="src" OR SF$="SRC" THEN 7170 7150 IF SF$="bin" OR SF$="BIN" THEN 7170 7160 BEEP:GOTO 7240 7170 LOCATE 0,5:COLOR 7:PRINT "File Name List":SY=CSRLIN+1 7180 FILES "b:\data\*."+SF$:MY=CSRLIN-1 7190 GOSUB 2380 7200 IF F$=" " THEN 7240 7210 LOCATE 25,0:COLOR 2:BEEP:INPUT " OK ? (y/n) ";ANS$ 7220 IF ANS$<>"Y" AND ANS$<>"y" THEN 7240 7230 KILL "b:\data\"+F$+"."+SF$ 7240 RETURN 1050 7250 '======= Harmonics Data Draw ======= 7260 LINE(54,141)-(586,399),0,BF 7270 LINE(54,141)-(586,399),5,B 7280 FOR K=1 TO 128 7290 LINE (K*4+60,398-HC(K)*2)-(K*4+62,398),7,BF 7300 NEXT K 7310 RETURN 7320 '======= Harmonics Data Edit ======= 7330 CLS:K=1 7340 LOCATE 20,1:COLOR 6:PRINT "Harmonic NO. =" 7350 LOCATE 20,3:COLOR 6:PRINT "Harmonic Level =" 7360 GOSUB 7440:GOSUB 7530 7370 ED$=INKEY$ 7380 IF ED$=CHR$(28) THEN GOSUB 7580:GOTO 7370:' Right 7390 IF ED$=CHR$(29) THEN GOSUB 7600:GOTO 7370:' Left 7400 IF ED$=CHR$(30) THEN GOSUB 7620:GOTO 7370:' Up 7410 IF ED$=CHR$(31) THEN GOSUB 7640:GOTO 7370:' Down 7420 IF ED$=CHR$(13) THEN 7660:' Return 7430 GOTO 7370 7440 LINE(54,115)-(586,135),0,BF 7450 LINE (K*4+55,115)-(K*4+67,125),4,BF 7460 LINE (K*4+58,116)-(K*4+64,130),3,BF 7470 LINE (K*4+60,118)-(K*4+62,135),6,BF 7480 LOCATE 35,1:COLOR 5:PRINT " "; 7490 LOCATE 35,1:COLOR 5:PRINT K; 7500 LOCATE 37,3:COLOR 5:PRINT " "; 7510 LOCATE 37,3:COLOR 5:PRINT HC(K); 7520 RETURN 7530 LINE (K*4+60,398-128*2)-(K*4+62,398),0,BF 7540 LINE (K*4+60,398-HC(K)*2)-(K*4+62,398),7,BF 7550 LOCATE 37,3:COLOR 5:PRINT " "; 7560 LOCATE 37,3:COLOR 5:PRINT HC(K); 7570 RETURN 7580 IF K=128 THEN RETURN 7590 K=K+1:GOSUB 7440:RETURN 7600 IF K=1 THEN RETURN 7610 K=K-1:GOSUB 7440:RETURN 7620 IF HC(K)=128 THEN RETURN 7630 HC(K)=HC(K)+1:GOSUB 7530:RETURN 7640 IF HC(K)=0 THEN RETURN 7650 HC(K)=HC(K)-1:GOSUB 7530:RETURN 7660 LINE(54,115)-(586,135),0,BF 7670 RETURN 7680 '======= Wave Compute/Save/Transfer ======= 7690 BNK=0:CLS 7700 LOCATE 25,2:COLOR 3:PRINT "!!! Now Computing !!!" 7710 MAXY=0 7720 FOR X=1 TO 256 7730 LINE (X*2+60,130)-(X*2+61,135),6,BF 7740 Y(BNK,X)=0 7750 FOR I=1 TO 128 7760 IF HC(I)=0 THEN 7780 7770 Y(BNK,X)=HC(I)*SIN(6.283*X/256*I)+Y(BNK,X) 7780 NEXT I 7790 IF MAXY"y" AND ANS$<>"Y" THEN 8110 7970 COLOR 7:LOCATE 5,4 7980 INPUT"BANK NO.=(0<->255)";BANK 7990 IF BANK<0 OR BANK>255 THEN BEEP:GOTO 7970 8000 LOCATE 2,7:COLOR 4:PRINT "Now Transfer Start !!" 8010 OD=&H31:GOSUB 2590 8020 OD=BANK:GOSUB 2590 8030 SUM=BANK 8040 FOR I=1 TO 256 8050 IF Y(BNK,I)<0 THEN OD=128-Y(BNK,I) ELSE OD=Y(BNK,I):'NOT EXIST 128 8060 IF OD=256 THEN OD=255 8070 SUM=(SUM+OD) MOD 256:GOSUB 2590 8080 NEXT I 8090 OD=SUM:GOSUB 2590 8100 RD=&H0:GOSUB 2710 8110 CLS 8120 LOCATE 0,2:COLOR 5:PRINT "Wave Data File Save ? (Y/N)" 8130 ANS$=INKEY$:IF ANS$="" THEN 8130 8140 IF ANS$<>"y" AND ANS$<>"Y" THEN CLS 3:RETURN 8150 CLS 3:COLOR 7:PRINT:PRINT "File Name List":FILES "B:\data\*.WAV" 8160 PRINT:INPUT "Save File Name";F$ 8170 IF F$="" THEN RETURN 8180 OPEN "B:\data\"+F$+".WAV" FOR OUTPUT AS #1 8190 FOR X=1 TO 256 8200 PRINT #1,CHR$(Y(BNK,X)+128); 8210 NEXT X 8220 CLOSE #1 8230 RETURN 8240 '======= Wave Drawing Editor ======= 8250 BNK=0:FOR X=1 TO 256:Y(BNK,X)=0:NEXT X 8260 CLS 3:COLOR 7:GOSUB 8680 8270 LOCATE 2,0:COLOR 4:PRINT "<< Wave Data Drawing Editor >>" 8280 LOCATE 10,2:COLOR 7 8290 PRINT "1.Data File Load" 8300 LOCATE 10,3:COLOR 7 8310 PRINT "2.Data File Save " 8320 LOCATE 10,4:COLOR 7 8330 PRINT "3.Data Transfer" 8340 LOCATE 10,5:COLOR 7 8350 PRINT "4.Data Drawing Edit" 8360 LOCATE 10,6:COLOR 7 8370 PRINT "5.Rerurn" 8380 LOCATE 50,5:COLOR 3:PRINT "Input NO. ?"; 8390 ANS$=INKEY$:N=VAL(ANS$):IF N>0 AND N<6 THEN 8400 ELSE 8390 8400 IF N=1 THEN GOSUB 8450:GOSUB 8680:GOTO 8270 8410 IF N=2 THEN GOSUB 8570:GOSUB 8680:GOTO 8270 8420 IF N=3 THEN GOSUB 9180:CLS:GOTO 8270 8430 IF N=4 THEN GOSUB 8760:GOSUB 8680:GOTO 8270 8440 RETURN 1050 8450 '======= Wave Data File Load ======= 8460 COLOR 7:CLS 3 8470 LOCATE 25,0:COLOR 3:PRINT "Load Wave Data" 8480 LOCATE 0,3:COLOR 7:PRINT "File Name List":SY=CSRLIN+1 8490 FILES "b:\data\*.wav":MY=CSRLIN-1 8500 GOSUB 2380 8510 IF F$="end " OR F$="" THEN RETURN 8520 OPEN "b:\data\"+F$+".wav" FOR INPUT AS #1 8530 FOR X=1 TO 256 8540 Y(BNK,X)=ASC(INPUT$(1,#1))-128 8550 NEXT X 8560 CLOSE #1:RETURN 8570 '======= Wave Data File Save ======= 8580 COLOR 7:CLS 3 8590 LOCATE 25,0:COLOR 3:PRINT "Save Wave Data" 8600 LOCATE 0,3:COLOR 7:PRINT "File Name List":FILES "b:\data\*.wav" 8610 INPUT "Save File Name=";F$ 8620 IF F$="" THEN RETURN 8630 OPEN "b:\data\"+F$+".wav" FOR OUTPUT AS #1 8640 FOR K=1 TO 256 8650 PRINT #1,CHR$(Y(BNK,K)+128); 8660 NEXT K 8670 CLOSE #1:RETURN 8680 '======= Wave Data Draw ======= 8690 CLS 8700 LINE(54,270-129)-(586,270+129),0,BF 8710 LINE(54,270-129)-(586,270+129),5,B 8720 FOR K=1 TO 256 8730 CIRCLE (K*2+60,270-Y(BNK,K)),1,6 8740 NEXT K 8750 RETURN 8760 '======= Wave Draw Editing ======= 8770 CLS:K=1 8780 LOCATE 20,1:COLOR 7:PRINT "Point Address =" 8790 LOCATE 20,3:COLOR 7:PRINT "Point Level =" 8800 GOSUB 8880:GOSUB 9010 8810 ED$=INKEY$ 8820 IF ED$=CHR$(28) THEN GOSUB 9080:GOTO 8810:' Right 8830 IF ED$=CHR$(29) THEN GOSUB 9100:GOTO 8810:' Left 8840 IF ED$=CHR$(30) THEN GOSUB 9120:GOTO 8810:' Up 8850 IF ED$=CHR$(31) THEN GOSUB 9140:GOTO 8810:' Down 8860 IF ED$=CHR$(13) THEN 9160:' Return 8870 GOTO 8810 8880 LINE(54,115)-(586,135),0,BF 8890 LINE (K*2+55,115)-(K*2+67,125),4,BF 8900 LINE (K*2+58,116)-(K*2+64,130),3,BF 8910 LINE (K*2+60,118)-(K*2+62,135),6,BF 8920 CIRCLE (OLDX,OLDY),2,0 8930 CIRCLE (K*2+60,270-Y(BNK,K)),1,6 8940 CIRCLE (K*2+60,270-Y(BNK,K)),2,4 8950 OLDX=K*2+60:OLDY=270-Y(BNK,K) 8960 LOCATE 35,1:COLOR 5:PRINT " "; 8970 LOCATE 35,1:COLOR 5:PRINT K; 8980 LOCATE 33,3:COLOR 5:PRINT " "; 8990 LOCATE 33,3:COLOR 5:PRINT Y(BNK,K)+128 9000 RETURN 9010 CIRCLE (OLDX,OLDY),2,0 9020 CIRCLE (K*2+60,270-Y(BNK,K)),1,6 9030 CIRCLE (K*2+60,270-Y(BNK,K)),2,4 9040 OLDX=K*2+60:OLDY=270-Y(BNK,K) 9050 LOCATE 33,3:COLOR 5:PRINT " "; 9060 LOCATE 33,3:COLOR 5:PRINT Y(BNK,K)+128 9070 RETURN 9080 IF K=256 THEN RETURN 9090 K=K+1:GOSUB 8880:RETURN 9100 IF K=1 THEN RETURN 9110 K=K-1:GOSUB 8880:RETURN 9120 IF Y(BNK,K)=127 THEN RETURN 9130 Y(BNK,K)=Y(BNK,K)+1:GOSUB 9010:RETURN 9140 IF Y(BNK,K)=<-127 THEN RETURN 9150 Y(BNK,K)=Y(BNK,K)-1:GOSUB 9010:RETURN 9160 LINE(54,115)-(586,135),0,BF 9170 RETURN 9180 '======= Drawn Wave Transfer ======= 9190 CLS:COLOR 7:LOCATE 2,0 9200 INPUT"BANK NO.=(0<->255)";BANK 9210 IF BANK<0 OR BANK>255 THEN BEEP:GOTO 9190 9220 LOCATE 20,2:COLOR 4:PRINT "Now Transfer Start !!" 9230 OD=&H31:GOSUB 2590 9240 OD=BANK:GOSUB 2590 9250 SUM=BANK 9260 FOR I=1 TO 256 9270 IF Y(BNK,I)<0 THEN OD=128-Y(BNK,I) ELSE OD=Y(BNK,I):'NOT EXIST 128 9280 IF OD=256 THEN OD=255 9290 SUM=(SUM+OD) MOD 256:GOSUB 2590 9300 NEXT I 9310 OD=SUM:GOSUB 2590 9320 RD=&H0:GOSUB 2710 9330 RETURN 9340 '======= File Name List Up ======= 9350 COLOR 7:CLS 3 9360 INPUT "List Up File Name Suffix =";F$ 9370 IF F$="" THEN F$="*" 9380 LOCATE 0,2:COLOR 7:FILES "b:\data\*."+F$ 9390 IF INKEY$="" THEN 9390 9400 RETURN 1050 9410 '======= Sweep PCM Data Make Routine ======= 9420 FOR K=1 TO 128:HC(K)=0:NEXT K 9430 CLS 3:COLOR 7:GOSUB 7250 9440 CLS 9450 LOCATE 2,0:COLOR 4:PRINT "<< Sweep PCM Data File Maker >>" 9460 LOCATE 10,2:COLOR 7 9470 PRINT "1. Data File Load" 9480 LOCATE 10,3:COLOR 7 9490 PRINT "2. Data File Save " 9500 LOCATE 10,4:COLOR 7 9510 PRINT "3. Data Caluclate to " 9520 LOCATE 10,5:COLOR 7 9530 PRINT "4. Data Transfer to DSP" 9540 LOCATE 10,6:COLOR 7 9550 PRINT "5. Source PCM Data File Converter to " 9560 LOCATE 10,7:COLOR 7 9570 PRINT "6. Rerurn" 9580 LOCATE 55,7:COLOR 6:PRINT "Input NO. ?"; 9590 ANS$=INKEY$:N=VAL(ANS$):IF N>0 AND N<7 THEN 9600 ELSE 9590 9600 IF N=1 THEN GOSUB 6820:CLS:GOSUB 7250:GOTO 9450 9610 IF N=2 THEN GOSUB 6940:CLS:GOSUB 7250:GOTO 9450 9620 IF N=3 THEN GOSUB 9670:CLS:GOSUB 7250:GOTO 9450 9630 IF N=4 THEN GOSUB 10130:CLS:GOSUB 7250:GOTO 9450 9640 IF N=5 THEN GOSUB 10450:CLS 3:GOTO 9450 9650 RETURN 1050 9660 RETURN : 'DUMMY 9670 '======= Sweep PCM Data Compute/Save ======= 9680 BNK=0:CLS 9690 LOCATE 25,2:COLOR 3:PRINT "!!! Now Computing !!!" 9700 MAXY=0 9710 FOR X=1 TO 256 9720 LINE (X*2+60,130)-(X*2+61,135),6,BF 9730 Y(BNK,X)=0 9740 FOR I=1 TO 128 9750 IF HC(I)=0 THEN 9770 9760 Y(BNK,X)=HC(I)*SIN(6.283*X/256*I)+Y(BNK,X) 9770 NEXT I 9780 IF MAXY Data File Save ? (Y/N)" 9950 ANS$=INKEY$:IF ANS$="" THEN 9950 9960 IF ANS$<>"y" AND ANS$<>"Y" THEN CLS 3:RETURN 9970 CLS 3:COLOR 7:PRINT:PRINT "File Name List":FILES "B:\data\*.PCM" 9980 PRINT:INPUT "Save File Name";F$ 9990 IF F$="" OR LEN(F$)>5 THEN BEEP:GOTO 9930 10000 COLOR 7:PRINT:INPUT "PCM Page NO (0-255)";FGH 10010 IF FGH>255 THEN BEEP:GOTO 9930 10020 PRINT:COLOR 5:PRINT "Save OK ? (Y/N)" 10030 ANS$=INKEY$:IF ANS$="" THEN 10030 10040 IF ANS$<>"y" AND ANS$<>"Y" THEN CLS 3:RETURN 10050 FG$=HEX$(FGH):IF LEN(FG$)=1 THEN FG$="0"+FG$ 10060 OPEN "B:\data\"+F$+FG$+".PCM" FOR OUTPUT AS #1 10070 PRINT #1,FG$ 10080 FOR X=1 TO 256 10090 PRINT #1,CHR$(Y(BNK,X)+128); 10100 NEXT X 10110 CLOSE #1 10120 GOTO 10000 10130 '======= Sweep PCM Data Transfer to DSP ======= 10140 COLOR 7:CLS 3:BNK=0 10150 INPUT "List Up File Name =";F$ 10160 IF F$="" THEN F$="*" 10170 LOCATE 0,2:COLOR 7:FILES "b:\data\"+F$+"*.PCM" 10180 PRINT:INPUT "Transfer File Name =";F$ 10190 INPUT "Max Bank NO (1,2,4,8,16,32,64,128,256) =";BKMAX 10200 PRINT:COLOR 3:PRINT "Transfer to DSP OK ? (Y/N)" 10210 ANS$=INKEY$:IF ANS$="" THEN 10210 10220 IF ANS$="y" OR ANS$="Y" THEN 10230 ELSE RETURN 10230 CLS:LOCATE 2,4:COLOR 4:PRINT "Now Transfer Start !!" 10240 LOCATE 0,9:COLOR 6 10250 FOR JKJ=0 TO BKMAX-1 10260 FG$=HEX$(JKJ):IF LEN(FG$)=1 THEN FG$="0"+FG$ 10270 OPEN "b:\data\"+F$+FG$+".PCM" FOR INPUT AS #1 10280 INPUT #1,DUM$:PRINT DUM$;" , "; 10290 FOR X=1 TO 256 10300 Y(BNK,X)=ASC(INPUT$(1,#1))-128 10310 NEXT X 10320 CLOSE #1 10330 OD=&H31:GOSUB 2590 10340 OD=JKJ:GOSUB 2590 10350 SUM=JKJ 10360 FOR I=1 TO 256 10370 IF Y(BNK,I)<0 THEN OD=128-Y(BNK,I) ELSE OD=Y(BNK,I):'NOT EX. 128 10380 IF OD=256 THEN OD=255 10390 SUM=(SUM+OD) MOD 256:GOSUB 2590 10400 NEXT I 10410 OD=SUM:GOSUB 2590 10420 RD=&H0:GOSUB 2710 10430 NEXT JKJ 10440 RETURN 10450 '======= Source PCM Data Covert to File ======= 10460 COLOR 7:CLS 3:BNK=0 10470 LOCATE 0,2:FILES "b:\data\*.PCM" 10480 PRINT:INPUT "Output File Name =";FA$ 10490 CLS:LOCATE 0,2:FILES "b:*.SRC" 10500 PRINT:INPUT "Input File Name =";FB$ 10510 PRINT:INPUT "Start Bank NO (1-256) =";BKMIN 10520 PRINT:INPUT "Max Bank NO (1,2,4,8,32,64,128,256) =";BKMAX 10530 PRINT:PRINT:COLOR 3:PRINT "File Make OK ? (Y/N)" 10540 ANS$=INKEY$:IF ANS$="" THEN 10540 10550 IF ANS$="y" OR ANS$="Y" THEN 10560 ELSE RETURN 10560 FOR JKJ=BKMIN-1 TO BKMAX-1 10570 CLS 3:LOCATE 2,2:COLOR 3:PRINT "Now Compute Bank =";JKJ+1 10580 FG$=STR$(JKJ+1):FG$=RIGHT$(FG$,LEN(FG$)-1) 10590 OPEN "b:\data\"+FB$+FG$+".SRC" FOR INPUT AS #1 10600 INPUT #1,INDT$(1):IF LEFT$(INDT$(1),2)="/*" THEN 10600 10610 FOR X=2 TO 127:INPUT #1,INDT$(X):NEXT X 10620 CLOSE #1:PRINT:PRINT:COLOR 5 10630 FOR X=1 TO 128 10640 HC(X)=VAL(RIGHT$(INDT$(X),10)) 10650 PRINT HC(X); 10660 NEXT X 10670 MAXY=0 10680 FOR X=1 TO 256 10690 LINE (X*2+60,330)-(X*2+61,435),6,BF 10700 Y(BNK,X)=0 10710 FOR I=1 TO 128 10720 IF HC(I)=0 THEN 10740 10730 Y(BNK,X)=HC(I)*SIN(6.283*X/256*I)+Y(BNK,X) 10740 NEXT I 10750 IF MAXY File Name =";FB$ 11030 PRINT:INPUT "Input File Size (Byte) =";DTSIZE 11040 IF INT(DTSIZE/256)<>DTSIZE/256 THEN BEEP:GOTO 11010 11050 CLS:LOCATE 0,2:FILES "b:\data\*.PCM" 11060 PRINT:INPUT "Output File Name =";FA$ 11070 PRINT "Max Bank NO =";DTSIZE/256 11080 PRINT:PRINT:COLOR 3:PRINT "File Make OK ? (Y/N)" 11090 ANS$=INKEY$:IF ANS$="" THEN 11090 11100 IF ANS$<>"y" AND ANS$<>"Y" THEN RETURN 1050 11110 CLS 3:OPEN "b:\data\"+FB$+".BIN" FOR INPUT AS #1 11120 FOR JKJ=0 TO DTSIZE/256-1 11130 LOCATE 2,2:COLOR 3:PRINT "Now Compute Bank =";JKJ+1 11140 FOR X=1 TO 256 11150 DUMINP=ASC(INPUT$(1,#1))-128 11160 IF DUMINP<0 THEN Y(BNK,X)=DUMINP+127 ELSE Y(BNK,X)=-DUMINP 11170 NEXT X 11180 WM=200:OFST=330 11190 LINE (OFST+10-1,WM-128)-(OFST+10+256,WM+128),0,BF 11200 LINE (OFST+10,WM)-(OFST+266,WM),7 11210 LINE (OFST+10-1,WM-128)-(OFST+10+256,WM+128),4,B 11220 FOR X=1 TO 256 11230 PSET (OFST+X+10,WM-Y(BNK,X)) 11240 NEXT X 11250 FG$=HEX$(JKJ):IF LEN(FG$)=1 THEN FG$="0"+FG$ 11260 OPEN "B:\data\"+FA$+FG$+".PCM" FOR OUTPUT AS #2 11270 PRINT #2,FG$ 11280 FOR X=1 TO 256 11290 PRINT #2,CHR$(Y(BNK,X)+128); 11300 NEXT X 11310 CLOSE #2 11320 NEXT JKJ 11330 CLOSE #1 11340 RETURN 1050 11350 '======= PCM Data Plotter ======= 11360 COLOR 7:CLS 3:WM=250 11370 LOCATE 0,2:FILES "b:\data\*.BIN" 11380 PRINT:INPUT "Plot File Name =";FB$ 11390 IF FB$="" THEN RETURN 1050 11400 PRINT:INPUT "File Size (Byte) =";DTSIZE 11410 CLS 3 11420 LOCATE 18,1:COLOR 5:PRINT"File Name = < ";FB$;".BIN >" 11430 LOCATE 18,3:PRINT"Data Size = ";DTSIZE;" bytes" 11440 LINE (0,WM)-(639,WM),7 11450 LINE (0,WM-128)-(639,WM+128),4,B 11460 OPEN "b:\data\"+FB$+".BIN" FOR INPUT AS #1 11470 FOR JKJ=0 TO DTSIZE-1 11480 DUMINP=ASC(INPUT$(1,#1))-128 11490 IF DUMINP<0 THEN PLOTY=DUMINP+127 ELSE PLOTY=-DUMINP 11500 PSET (INT(640*(JKJ+1)/DTSIZE),WM-PLOTY),6 11510 NEXT JKJ 11520 CLOSE #1 11530 IF INKEY$="" THEN 11530 ELSE 11360 11540 '======= Files Define ======= 11550 OPEN "B:\data\files.def" FOR INPUT AS #1 11560 INPUT #1,DFCOUNT 11570 FOR I=1 TO DFCOUNT 11580 INPUT #1,DFT(I) 11590 INPUT #1,DF$(I) 11600 NEXT I 11610 CLOSE #1 11620 CLS 3 11630 COLOR 7:PRINT 11640 FOR I=1 TO DFCOUNT 11650 PRINT " (";I;") "; 11660 COLOR 5:PRINT DF$(I);:COLOR 7:NF$=DF$(I) 11670 IF RIGHT$(NF$,4)=".dat" THEN PRINT " , Tone NO. = ";DFT(I); 11680 IF RIGHT$(NF$,4)=".DAT" THEN PRINT " , Tone NO. = ";DFT(I); 11690 IF RIGHT$(NF$,4)=".wav" THEN PRINT " , Bank NO. = ";DFT(I); 11700 IF RIGHT$(NF$,4)=".WAV" THEN PRINT " , Bank NO. = ";DFT(I); 11710 PRINT 11720 NEXT I 11730 COLOR 3:PRINT:PRINT "Select : "; 11740 COLOR 6:PRINT "(1) New File / (2) Delete File / (3) Escape" 11750 A$=INKEY$:IF A$="" THEN 11750 11760 IF A$="3" THEN 12060 11770 IF A$="1" THEN 11790 11780 IF A$="2" THEN 11940 ELSE 11750 11790 COLOR 4:PRINT:PRINT " << New File Define >>" 11800 COLOR 7:INPUT " New File Name = ";NF$ 11810 IF RIGHT$(NF$,4)=".dat" THEN 11850 11820 IF RIGHT$(NF$,4)=".DAT" THEN 11850 11830 IF RIGHT$(NF$,4)=".wav" THEN 11870 11840 IF RIGHT$(NF$,4)=".WAV" THEN 11870 ELSE BEEP:GOTO 11800 11850 COLOR 6:INPUT " Tone NO. = ";DFT(DFCOUNT+1) 11860 IF DFT(DFCOUNT+1)>31 THEN BEEP:GOTO 11850 ELSE GOTO 11890 11870 COLOR 6:INPUT " Bank NO. = ";DFT(DFCOUNT+1) 11880 IF DFT(DFCOUNT+1)>255 THEN BEEP:GOTO 11870 11890 FOR I=1 TO DFCOUNT 11900 IF NF$=DF$(I) THEN BEEP:GOTO 11800 11910 NEXT I 11920 DFCOUNT=DFCOUNT+1:DF$(DFCOUNT)=NF$ 11930 GOTO 11630 11940 COLOR 4:PRINT:PRINT " << File Delete >>" 11950 COLOR 7:INPUT " Delete File NO. = ";KF 11960 IF KF>DFCOUNT OR KF<>INT(KF) THEN BEEP:GOTO 11950 11970 COLOR 2:BEEP:PRINT:PRINT " !!! Delete OK ? (Y/N) !!!" 11980 A$=INKEY$:IF A$="" THEN 11980 11990 IF A$<>"y" AND A$<>"Y" THEN 11630 12000 IF KF=DFCOUNT THEN DFCOUNT=DFCOUNT-1:GOTO 11630 12010 FOR I=KF TO DFCOUNT-1 12020 DF$(I)=DF$(I+1) 12030 DFT(I)=DFT(I+1) 12040 NEXT I 12050 DFCOUNT=DFCOUNT-1:GOTO 11630 12060 COLOR 4:BEEP:PRINT:PRINT:PRINT " Define File Save ? (Y/N)" 12070 A$=INKEY$:IF A$="" THEN 12070 12080 IF A$<>"y" AND A$<>"Y" THEN 12160 12090 OPEN "B:\data\files.def" FOR OUTPUT AS #1 12100 PRINT #1,DFCOUNT 12110 FOR I=1 TO DFCOUNT 12120 PRINT #1,DFT(I) 12130 PRINT #1,DF$(I) 12140 NEXT I 12150 CLOSE #1 12160 RETURN 1050 12170 OPEN "B:\data\files.def" FOR OUTPUT AS #1 12180 PRINT #1,5 12190 FOR I=1 TO 5 12200 PRINT #1,1 12210 PRINT #1,"dummy.dat" 12220 NEXT I 12230 CLOSE #1 12240 '======= Files Preset ======= 12250 CLS 3:COLOR 7 12260 PRINT " <<< Preset File Read >>>":PRINT:COLOR 6 12270 OPEN "B:\data\files.def" FOR INPUT AS #1 12280 INPUT #1,DFCOUNT 12290 FOR I=1 TO DFCOUNT 12300 INPUT #1,DFT(I) 12310 INPUT #1,DF$(I) 12320 PRINT " File #";I;" = ";DF$(I) 12330 NEXT I 12340 CLOSE #1:PRINT:PRINT 12350 FOR PRS=1 TO DFCOUNT 12360 IF RIGHT$(DF$(PRS),3)="dat" THEN 12410 12370 IF RIGHT$(DF$(PRS),3)="DAT" THEN 12410 12380 IF RIGHT$(DF$(PRS),3)="wav" THEN 12620 12390 IF RIGHT$(DF$(PRS),3)="WAV" THEN 12620 12400 GOTO 12790 12410 XX=DFT(PRS) 12420 COLOR 4:PRINT 12430 PRINT " < ";DF$(PRS);" > is Read , Transfer to DSP : Tone NO =";XX 12440 OPEN "b:\data\"+DF$(PRS) FOR INPUT AS #1 12450 FOR K=13 TO 40 12460 INPUT #1,WW 12470 A(1,K)=INT(WW/16) 12480 A(0,K)=WW MOD 16 12490 NEXT K 12500 CLOSE #1 12510 OD=&H30:GOSUB 2590 12520 OD=XX:GOSUB 2590 12530 RESTORE 1660 12540 SUM=XX 12550 FOR J=1 TO 28 12560 READ K:XX=A(1,K)*16+A(0,K):SUM=(SUM+XX) MOD 256 12570 OD=XX:GOSUB 2590 12580 NEXT J 12590 FOR J=29 TO 48:OD=0:GOSUB 2590:NEXT J 12600 OD=SUM:GOSUB 2590:RD=&H0:GOSUB 2710 12610 GOTO 12790 12620 BANK=DFT(PRS) 12630 COLOR 3:PRINT 12640 PRINT " < ";DF$(PRS);" > is Read , Transfer to DSP : Bank NO =";BANK 12650 OPEN "b:\data\"+DF$(PRS) FOR INPUT AS #1 12660 FOR X=1 TO 256 12670 Y(BNK,X)=ASC(INPUT$(1,#1))-128 12680 NEXT X 12685 CLOSE #1 12690 OD=&H31:GOSUB 2590 12700 OD=BANK:GOSUB 2590 12710 SUM=BANK 12720 FOR I=1 TO 256 12730 IF Y(BNK,I)<0 THEN OD=128-Y(BNK,I) ELSE OD=Y(BNK,I):'NOT EXIST 128 12740 IF OD=256 THEN OD=255 12750 SUM=(SUM+OD) MOD 256:GOSUB 2590 12760 NEXT I 12770 OD=SUM:GOSUB 2590 12780 RD=&H0:GOSUB 2710 12790 NEXT PRS 12800 RETURN 1050