home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 216
/
216.d81
/
concert
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-26
|
8KB
|
259 lines
4 poke56,88:poke55,0:clr:tl=88*256
5 dv=peek(186):ifdv<8thendv=8
10 ifpeek(44)<>27thenstop
11 dimw$(100),w(20),tl(20),nx(9),n(9),tp(20):tl(0)=tl
12 deffnl(x)=x-fnh(x)*256:deffnh(x)=int(x/256):deffni(x)=peek(x)+256*peek(x+1)
20 sys57812"toolbox c000a",dv,0:poke780,0:poke781,0:poke782,192:sys65493
22 sys57812"concert font",dv,0:poke780,0:poke781,0:poke782,8:sys65493
24 poke53272,19
26 print"";
30 dm=49152:rd=dm+3:bn=dm+6:in=dm+9
31 gi=dm+12:bl=dm+30:bx=dm+15:ss=dm+18
32 sr=dm+21:pa=dm+24:ct=dm+27:sh=dm+72
33 br=dm+45:mu=dm+48:cm=dm+54:sw=dm+57
34 gw=dm+66:fi=dm+63
35 sysbl,"concert screen",dv,40960:syssr,160:poke53280,14:poke53281,1
37 sysss,208:sysss,216
40 lo=4096:sysbl,"cplay.ml",dv,lo
42 forx=0to33:poke6622+x,0:next
45 cm=0:cm$(0)="cue mode off":cm$(1)="cue mode on "
46 x=56832:pokex+14,255:pokex+24,128:pokex+19,0:pokex+20,240:pokex+18,129
47 m9=0:y=peek(x+28)andpeek(x+28):ify=255thenm9=3:pokex+18,0
48 a$(0)="midi & sid mode":a$(1)="stereo sid mode"
49 sysss,208
50 poke53281,1:syssr,208:wi=20:co=6:cr=160:ch=1:gosub10020
51 syspa,xp+1,yp+1,"choose:"
53 sysct,yp+2,"quick play"
54 sysct,yp+3,"create concert":sysct,yp+4,"_ to exit"
55 ch=2:gosub10100
56 iff%=0then600
57 iff%=2then2000
90 syssr,208:xp=21:yp=20:xw=len(a$(0))+2:yw=3:cr=160:co=2+m9+abs(cm-1)*8
91 gosub10000
92 syspa,xp+1,yp+1,a$(m9/3)
96 syspa,xp+1,yp+2,cm$(cm)
100 xp=0:yp=18:xw=14:yw=5:cr=160:co=10:gosub10000
110 syspa,xp+1,yp+1,"choose:"
120 syspa,xp+2,yp+2,"get song"
130 syspa,xp+2,yp+3,"change mode"
135 syspa,xp+2,yp+4,"disk access"
136 syspa,xp+3,yp+5,"_ to exit"
140 sysmu,yp+2,xp+2,xp+12,3,co,0,95
150 iff%=0then50
160 onf%goto200,300,390
200 sysss,216:sysdm,"$:p?.*",dv,57344,20,3,12,0,6
201 syssr,216:iff$=""then235
202 ifleft$(f$,3)="pc."then260
203 ifleft$(f$,3)="pd."thenclose15:open15,dv,15,"cd:"+f$:close15:cd=cd+1:goto200
204 co=7:ms$="loading: "+f$:gosub7400
206 sys6088:rem upload tools
210 sysbl,f$,dv,40560
220 poke163,112:poke164,158:poke165,2:poke166,160
223 ifcm=1thenco=5:ms$=f$+" cued":poke198,0:gosub7400
224 ifcm=1thengetz$:ifz$=""then224
225 co=6:ms$="playing: "+f$:gosub7400
230 syslo+m9:sys6121:rem download tools
235 ifcd>0thenclose15:open15,dv,15,"cd:_":cd=cd-1:close15:goto235
240 goto90
260 sysfi,f$,dv,0:n=f%:gosub7100:goto235
299 stop
300 cm=abs(cm-1)
305 ifcm>0then320
310 m9=abs(m9-3)
320 syssr,208:goto90
390 gosub400:goto90
400 syssr,208:co=0:cr=160:wi=20:ch=1:gosub10020:sysct,yp+1,"disk access: "
401 dq=0:sysct,yp+2,"send command to "+str$(dv):sysct,yp+3,"change device"
402 sysmu,yp+2,xp+1,xp+xw-1,2,0,12,95:iff%=0thenreturn
403 onf%goto404,500
404 syspa,0,0,"[146][144]@ "
405 syspa,1,0,""
410 sysgw,0,2,38
415 ifw$=""then450
420 close15:open15,dv,15,w$:input#15,e,en$,n,f:close15
430 syssr,216:syspa,0,0,"[154]":printe"[157] ";n"[157] ";en$;" ";f
440 forx=1to3000:next
450 return
500 k=0:fori=8to15:close2:open2,i,2:close2:ifstthen510
505 i(k)=i:k=k+1
510 next:syssr,216:cr=160:co=9:wi=8:ch=k:gosub10020
520 sysct,yp+1,"drive: "
530 forx=0tok-1:sysct,yp+3+x,str$(i(x)):next:poke186,dv
540 sysmu,yp+3,xp+1,xp+xw-1,k,co,0,95
550 iff%=0thenreturn
560 dv=i(f%-1):poke186,dv:return
600 cr=160:co=8:wi=25:ch=0:gosub10020
610 sysct,yp+1,"leaving presto concert?"
620 sysct,yp+2,"(y/n)":poke198,0
630 getz$:ifz$=""then630
640 ifz$="y"then40000
650 goto50
1000 poke53281,0:sysbx,0,39,0,24,160,14:mode=0:nn=0:v$="make":n=0
1001 qd=0:ifnn=99thengosub2500:poke53281,1:syssr,208:goto2000
1002 xp=0:xw=14:yp=0:yw=12:cr=160:co=3:ifn=099thenf%=8:goto1025
1003 gosub10000:syspa,xp+1,yp+1,v$+" concert:"
1004 syspa,xp+2,yp+3,"begin"
1005 syspa,xp+2,yp+4,"load"
1006 syspa,xp+2,yp+5,"cue"
1007 syspa,xp+2,yp+6,"play":syspa,xp+2,yp+7,"pause"
1008 syspa,xp+2,yp+8,"continue":syspa,xp+2,yp+9,"remove"
1009 syspa,xp+2,yp+10,"end":sysss,216:syspa,30,0,""+str$(53248-tl)
1010 sysmu,yp+3,xp+1,xp+xw-1,8,co,1,95
1011 iff%=0thensyssr,208:goto2000
1012 ifmode=1then1025
1015 ifmode=0thenif(f%=1)or(f%=8)then1020
1016 goto1010
1020 iff%=8thenf%=0:goto1011
1021 mode=1:n=0:gosub1100:goto1010
1025 onf%goto1100,1200,1300,1400,1500,1600,1700,1900
1100 w$(n)="begin":kn=0:tl=88*256:goto1800
1200 ifdq=1thensysdm+3,20,3,12,1,7:syssr,216:goto1202
1201 sysdm,"$:pr.*,p1.*,p2.*,p3.*,pc.*",dv,57344,20,3,12,1,7:syssr,216:dq=1
1202 iff$=""then1801
1203 ifleft$(f$,3)="pc."thenw$(n)="concert:"+f$:n=n+1:goto1100
1204 kn=kn+1:w(kn)=n:ot=tl
1205 sys57812(f$),dv,0:poke780,1:poke781,fnl(tl):poke782,fnh(tl):sys65493:tl=fni(781)
1206 iftl>53248then1210
1207 tl(kn)=tl
1208 w$(n)=right$("0"+mid$(str$(kn),2),2)+"load:"+f$:goto1800
1210 syspa,20,0,"[150]not enough memory"
1212 forx=1to5000:next:kn=kn-1:tl=ot:goto1801
1300 w$(n)=" cue...":goto1800
1400 gosub1998:ifkn=0thensyssr,216:gosub1999:goto1801
1401 gosub1450
1406 iff%=0then1801
1408 w$(n)="play"+left$(w$(w(f%)),2)+":"+mid$(w$(w(f%)),8):goto1800
1450 xp=20:yp=0:xw=18:yw=kn+1:co=1:cr=160:gosub10000
1451 forx=1tokn:syspa,xp+1,yp+x,mid$(w$(w(x)),8):next
1452 sysmu,yp+1,xp+1,xp+xw-1,kn,1,1,95:syssr,216:goto1999
1500 w$(n)="@ pause...":goto1800
1600 gosub1998:ifkn>0then1602
1601 syssr,216:gosub1999:goto1801
1602 w$=left$(w$(n-1),2):if(w$<>"pl")and(w$<>"c0")then1601
1604 gosub1450
1606 iff%=0then1801
1608 w$(n)="c0nt"+left$(w$(w(f%)),2)+":"+mid$(w$(w(f%)),8):goto1800
1700 ifn=1then1801
1701 n=n-1:ifval(w$(n))>0thenkn=kn-1:tl=tl(kn)
1702 ifw$(n)="begin"thennx=n-1:gosub7001
1719 goto1801
1800 n=n+1
1801 ifn>13then1820
1802 gosub1998:ch=n-1:co=13:wi=24:sysbx,0,39,0,24,160,14
1805 gosub10020:forx=0ton-1:syspa,xp+2,yp+1+x,w$(x):next
1806 syspa,xp+1,yp+1+x,">"
1809 gosub1999
1810 goto1001
1820 gosub1998:ch=12:co=13:wi=24
1821 sysbx,0,39,0,24,160,14:gosub10020:q=0:forx=n-13ton-1
1822 syspa,xp+2,yp+1+q,w$(x):q=q+1:next
1824 syspa,xp+1,yp+1+q,">":goto1809
1900 w$(n)="x end":nn=099:goto1800
1998 c0=co:x1=xp:x2=xw:y1=yp:y2=yw:return
1999 co=c0:xp=x1:xw=x2:yp=y1:yw=y2:return
2000 poke53281,1:syssr,208:ch=4:wi=20:cr=160:co=5:gosub10020
2010 sysct,yp+1,"make concert"
2020 sysct,yp+2,"edit concert"
2030 sysct,yp+3,"save concert"
2035 sysct,yp+4,"load concert"
2036 sysct,yp+5,"play concert"
2037 sysct,yp+6,"disk access ":sysct,yp+7,"_ to exit"
2040 sysmu,yp+1,xp+1,xp+xw-1,6,co,0,95
2050 iff%=0then50
2060 onf%goto1000,3000,4000,5000,5500,6000
2500 sysbx,14,24,4,6,160,6:sysbx,13,23,3,5,160,2:syspa,14,4,"press key"
2501 poke198,0:wait198,1:poke198,0:return
3000 poke53281,0:sysbx,0,39,0,34,160,14:nn=0:v$="edit"
3001 mode=0:ifn>0thenmode=1
3002 goto1801
4000 ifn=0then2000
4005 wi=18:cr=160:co=2:ch=0:syssr,208:gosub10020
4010 syspa,xp+1,yp+1,"save:"
4020 syspa,xp+1,yp+2,"[146][144]pc. ":syspa,xp+4,yp+2,""
4030 sysgw,0,15,13:ifw$=""then2000
4031 w$="pc."+w$
4035 close15:open15,dv,15,"s0:"+w$:close15
4040 close4:open4,dv,4,w$+",s,w"
4050 forx=0ton-1:print#4,w$(x):next:close4
4080 goto2000
5000 ifn=0then5020
5010 wi=18:cr=160:co=2:ch=1:syssr,208:gosub10020
5012 syspa,xp+1,yp+1,"load:"
5013 sysct,yp+2,"new concert"
5014 sysct,yp+3,"append"
5015 sysmu,yp+2,xp+1,xp+xw-1,2,co,0,95
5016 iff%=0then2000
5017 iff%=1thenn=0:kn=0:goto5020
5018 n=n-1
5020 syssr,208:sysdm,"$:pc.*",dv,57344,20,3,12,0,6
5030 sysfi,f$,dv,n:n=f%
5040 gosub7000:goto2000
5500 gosub7100:goto2000
6000 sysss,216:gosub400:goto2000
7000 nx=n
7001 tl=88*256:tl(0)=tl:kn=0
7002 ifnx<0thenreturn
7003 ifw$(nx)<>"begin"thennx=nx-1:goto7002
7004 ifnx=nthenreturn
7005 nx=nx+1:ifval(w$(nx))=0then7004
7006 sys57812(w$(nx)),dv,0:poke780,1:poke781,fnl(tl):poke782,fnh(tl):sys65493
7007 kn=kn+1:w(kn)=val(w$(nx)):tl=fni(781):tl(kn)=tl:goto7004
7100 sys6088:dq=0:syssr,208:nx=0:sp=0:goto7102
7101 nx=nx+1:ifnx>100thenw$="x ":goto7114
7102 w$=left$(w$(nx),2):w=val(w$(nx))
7104 ifw$="be"thentp=88*256:goto7101
7106 ifw>0thentp(w)=tp:gosub7300:goto7101
7108 ifw$=" "thengosub7200:goto7101
7110 ifw$="pl"thengosub7210:goto7101
7112 ifw$="@ "thengosub7700:goto7101
7114 ifw$="x "then7250
7116 ifw$="co"thengosub7260:goto7101
7200 sysss,216:co=5
7202 ms$=mid$(w$(nx+1),8)+" cued":gosub7400
7204 poke198,0:wait198,1:poke198,0:return
7210 kx=0:w=val(mid$(w$(nx),5)):poke163,fnl(tp(w)):poke164,fnh(tp(w))
7212 poke165,fnl(tp(w)+402):poke166,fnh(tp(w)+402):poke829,0
7214 ifleft$(w$(nx+1),2)="c0"thengosub7500
7215 co=4:ms$="pl