home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Go64!
/
Go64_2000-06_2000_CSW_Side_A.d64
/
audio
(
.txt
)
next >
Wrap
Commodore BASIC
|
2023-02-26
|
9KB
|
294 lines
1000 rem ------------------------------
1010 rem scsi listing4
1011 rem original by achim taege 1997
1012 rem adapted for c64 and modified
1013 rem by torsten baade 2000
1014 rem email:torsten@sport-moeller.de
1015 rem v1.10 07/24/2000
1020 rem ------------------------------
1060 print chr$(147);chr$(14) :rem clr sreen & s/b
1070 bd=peek(186):rem current floppy
1080 dim pu(9),td(36,7),pe%(512)
1090 bl=2352:rem length of audioblock =1/75 sec
1100 sk=0 :rem sessionnumber
1110 :
1120 mh=48:ml=0: rem h- & l-byte of scsi buffer
1130 dp=48*256: rem scsi data buffer
1140 z$="----------------------------------------"
1150 l$=" "
1190 goto 60000 :rem to main program
2000 rem - scsi-command: inquiry 6 byte
2010 sc$=chr$(18)+chr$(lu*32)+chr$(0)+chr$(0)+chr$(32)+chr$(0)
2020 gosub 4000:return:rem send command
2030 :
2040 rem ---------- scsi-kommando test unit ready 6 byte ---
2050 sc$=chr$(0)+chr$(lu*32)+chr$(0)+chr$(0)+chr$(0)+chr$(0)
2060 gosub 4000:return:rem send command
2070 :
2400 rem ---------- scsi-kommando read toc 10 byte ----------
2410 sc$=chr$(67)+chr$(lu*32+2)+chr$(0)+chr$(0)+chr$(0)
2420 sc$=sc$+chr$(0)+chr$(0)+chr$(int(bl/256))+chr$(bl and 255)+chr$(0)
2430 gosub 4000
2440 if fe<>0 then 2600: rem else read titles
2450 ii=1:rem sufficient for 36 titles
2460 :open 15,dv,15
2470 :for b=0 to ii
2480 : print#15,"m-r"chr$(ml)chr$(mh+b)chr$(0)
2490 : for i=0 to 255:get#15,b$:pe%(b*256+i)=asc(b$+chr$(0)):next
2500 :next
2510 :close15
2520 tn=pe%(0)*256+pe%(1): rem lenght of toc
2530 fk=pe%(2) :rem first title
2540 lk=pe%(3) :rem last title
2550 for i=fk-1 to lk:print : rem read start and end time
2560 : for ii=0 to 7 : rem 8 byte per title
2570 : td(i,ii)=pe%(4+(i*8)+ii)
2580 : next
2590 :next
2600 :
2610 return
2620 :
2700 rem ---------- play mfs ----------------------------------------
2710 sc$=chr$(71)+chr$(lu*32)+chr$(0)
2720 sc$=sc$+chr$(td(nr,5))+chr$(td(nr,6))+chr$(td(nr,7))
2730 sc$=sc$+chr$(mm)+chr$(ss)+chr$(dd)+chr$(0)
2740 gosub 4000:return:rem send command
2750 :
2800 rem ---------- read subchannel ---------------------------------
2801 print "[212]itle number > [157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157]";t
2802 pa=td(nr,5)*4500+td(nr,6)*75+td(nr,7):pe=mm*4500+ss*75+dd
2803 pg=(pe-pa)/4500:a=pg:gosub3600
2804 print l$:print "[145][212]itle length > ";a$:a$=""
2805 print l$: print l$: print l$
2806 print "[145][145][212]ime > "
2807 print "[210]emaining > "
2810 sc$=chr$(66)+chr$(lu*32+2)+chr$(64)+chr$(1)
2820 sc$=sc$+chr$(0)+chr$(0)+chr$(0)+chr$(0)
2830 sc$=sc$+chr$(15)+chr$(0)
2835 tf=0
2840 gosub 4000 :rem send command
2845 if fe>0 then tf=1:return :rem device not ready
2850 open 15,dv,15
2860 :print#15,"m-r"chr$(ml)chr$(mh)chr$(15)
2870 :for i=0 to 14:get#15,b$
2872 pe%(i)=asc(b$+chr$(0))
2875 next
2880 close15
2890 :
2900 pp=(pe%(13)*4500+pe%(14)*75+pe%(15))/4500+0.004
2910 a=pp:gosub 3600
2920 print "[145][145] [157][157][157][157][157][157][157]";a$:a$=""
2925 a=pg-pp:gosub 3600
2930 print " [157][157][157][157][157][157][157]";a$:a$=""
2940 :
2950 x$="":get x$
2960 if x$="_" then t=lk+1:goto 2990:rem lk+1 = cancel
2970 if x$="+" then 2990 :rem next titel
2972 if x$="-"then t=t-2-(t=1):goto 2990 :rem previous titel
2980 if pe%(1)<>21 then 2840 :rem 21 = title end
2990 return
2995 :
3100 rem --------- start / stop unit -------------------------------
3110 sc$=chr$(27)+chr$(lu*32)+chr$(0)+chr$(0)+chr$(0)+chr$(0)
3120 gosub 4000
3130 :
3500 rem ---------- mfs to lbn -------------------------------------
3510 bn=td(t,5)*4500+td(t,6)*75+td(t,7)-150
3520 return
3530 :
3540 rem ---------- lbn to mfs -------------------------------------
3550 bn=bn+150:mm=int(bn/4500):ss=int((bn-mm*4500)/75)
3560 dd=bn-mm*4500-ss*75
3570 return
3580 :
3600 rem ------------- 1/100 min to sec
3610 b=int(a)
3620 c=(a-b)*60/100
3630 c=int(c*100)
3640 a$=right$(str$(b),2)+":"+right$("0"+mid$(str$(c),2),2)
3650 return
4000 rem ---------- scsi-kommando request sense 6 byte ------
4010 gosub 4110
4015 return
4020 rem request sense makes no sence for audio cd
4030 :
4110 rem ---------- send scsi-kommando -----------------------------
4120 gosub 4160
4130 if fe>0 then gosub 4160
4140 return
4150 :
4160 open 15,dv,15
4170 :print#15,"s-c"+chr$(id)chr$(ml)chr$(mh)sc$ :rem send command
4180 get#15,fe$
4182 if fe$="" then fe=0:goto4190
4185 fe=asc(fe$)
4190 close 15
4200 return
4210 :
5000 rem -------------- scann cbm-bus for cmd-hd ------------------
5010 print "[211]earching for [195][205][196]-[200][196]"
5020 :
5030 for ga=8 to 30 :rem test drives 8 - 30
5040 : open 15,ga,15 :rem open drive and close immediately
5050 : close 15 :rem for setting st
5060 : if st=-128 then 5170 :rem st=-128 : device not present
5070 : open 15,ga,15 :rem st=0 drive enabled
5080 : print#15,"ui" :rem send reset
5090 : input#15,fe,fe$ :rem read error # and string
5100 : close 15
5110 if left$(fe$,6)<>"cmd hd" then fe=1:goto5170
5120 : dv=ga :rem cmd-hd found
5130 : ga=30:fe=0 :rem cose for-next loop
5140 : print "[195][205][196]-[200][196] is drive #";dv;"[146]":print
5170 next
5180 return
5190 :
5200 rem --------------- scann scsi-bus for scsi-device --------------------
5210 print "[211]earching for [211][195][211][201]-devices"
5220 dp=48*256 :rem scsi datenpuffer
5230 mh=48:ml=0 :rem init h.byte and l.byte of scsi buffer
5250 sd=0:sl=0 :rem init scsi id and lun
5260 id=sd:lu=sl
5270 gosub 2000 :rem inquiry
5280 if fe<>0 then 5570 :rem read 1byte from buffer
5290 open 15,dv,15,"m-r"+chr$(ml)+chr$(mh)+chr$(1)
5300 get#15,ty$:rem scsi device class
5302 if ty$=""then ty=0:goto 5305
5303 ty=(asc(ty$) and 31)
5305 : close 15
5310 : if ty<>5 then 5570 :rem cd/drive not found
5510 : lu=sl:id=sd:sl=7:sd=8
5570 :sl=sl+1:if sl=8 then sl=0:sd=sd+1
5575 print".";
5580 if sd<8 then 5260
5585 print
5590 return
5600 :
6000 rem -------------- clr screen
6010 poke53280,6:poke53281,11
6020 print "[147] [195][196]-[193]udio-[208]layer by [193]chim [212]aege"
6030 print " adapted for [195]64 by [212]orsten [194]aade[153]"
6050 print z$
6060 print"[215]hile playing please choose:"
6062 print" +[146][153] - next title
6063 [153]" -waitprint - previous title
6065 print" _[146][153] - quit playing
6080 [142]
6100 [143] ------------- akt screen
6110 [153]"";
6120 [153] "(NULL)tatus > cmdcmdcmdcmdcmdcmdcmdcmdcmdcmdcmdcmdcmdcmdcmdcmdcmdcmdcmd";"";ts$;"print"
6130 [142]
6200 [143] ------------- init screen
6210 fe[178]0:pu[178]pu(0)
6220 [141] 6000:[141] 6100
6230 [142]
6240 :
7000 [143] -------- scan for hd and cd rom
7010 [143] dummy
7011 [143] ^^^ delete line 7010 for a new search for device numbers
7030 [141] 5000: [143] scan cbm-bus
7040 [139] fe[178]0 [167] 7070
7050 [153]"(NULL)orry, no left$str$ found..."
7060 [128]
7070 [141] 5200: [143] scan scsi-bus
7080 [153]"(NULL)len(NULL)right$-right$str$ is ";id;"wait, (NULL)(NULL)(NULL) is ";lu"wait"
7100 [153]"(NULL)his program is self modifying."
7105 [153]"right$f you are pressing _wait then a new
7110 print"program called 'audio cd player' will be";
7111 print"stored on disc that contains all device
7115 [153]"numbers. (NULL)ext time load this proggy and
7120 print"you don't have to wait for finding the
7125 [153]"drives again. right$f you need a new search,
7130 print"delete line 7010 and [210][213][206] the program."
7135 print"[194][212][215]: any other key has no effect :-)
7150 [161] a$: [139] a$[178]"" [167] 7150
7180 [139] a$[178]"_" [167] 7200
7190 [142]
7200 [143] self modification
7210 [159]15,bd,15,"s:audio cd player":[160]15:[143] delete old file
7220 [153]
7225 [153]"7010 dv=";dv;":id=";id;":lun=";lu;":return"
7230 [153]"save"[170][199](34)[170]"audio cd player"[170][199](34)[170]","[170][196](bd)
7240 [153]"runononononon"
7250 [151]631,13:[151]632,13:[151]633,145:[151]634,145:[151]635,145:[151]636,13
7260 [151] 198,6 :[143] 3*return + 2*^ to key buffer
7290 [128]
7500 [143] ------- input subtitute
7510 [151]204,0:[143] cursor
7520 [161]a$: [139] a$[178]"" [167] 7520
7530 wa$[178]a$
7540 [139] [197](a$)[178]0 [167] 7595:[143] alphanumeric or 0
7545 [153] a$;
7550 [161] a$: [139] a$[178]"" [167] 7550
7560 [139] [198](a$)[178]13 [167] 7595
7570 [139] [198](a$)[179]48 [176] [198](a$)[177]57 [167] 7550:[143] no number
7580 wa$[178]wa$[170]a$
7590 [137] 7545
7595 [151]204,1:[142]
60000 [143] ---------- main program
60010 [141] 7000:[143] scan for hd and cd-rom
60050 ts$[178]"(NULL)lease insert a lenstr$":[141] 6200 :[143] init screen
60060 fe[178]8
60070 :
60080 : [141] 2040 :[143] test unit ready
60090 : [141] 6100
60100 [139] fe[177]0 [137] 60070
60120 ts$[178]"(NULL)eading (NULL)(NULL)len":[141] 6100
60130 [141] 2400 :[143] read toc
60140 ts$[178]"(NULL)lease choose :":[141] 6100
60150 [129]i[178]0[164]5:[153]l$:[130]:[153]"onononononon";
60155 [153]" pwait - start lenstr$ and exit
60156 print" r[146] - random play
60157 [153]" _wait - exit programonononon"
60160 [153] " awaitll or title";fk;"-";lk;"> ";:[141] 7500
60170 [139] wa$[178]"a" [167] [141] 60500
60180 [139] wa$[178]"_"[167] [141]3100:[153]"":[128]
60185 [139] wa$[178]"r" [167] [141] 60800: [143] random play
60190 [139] wa$[178]"p"[167] [141]60700:[153]"":[128]:[143] play and exit prog
60200 [139] tf[178]1 [167] tf[178]0: [137] 60050: [143] error while playing
60210 t[178][197](wa$)
60220 [139] t[179]fk [176] t[177]lk [167] 60140
60230 [141] 3500:bn[178]bn[171]1:[141] 3540:nr[178]t[171]1:[141] 2700
60240 ts$[178]"(NULL)laying":[141] 6100
60250 [141] 2800
60260 [141] 3100
60265 [139] tf[178]1 [167] 60050
60266 [139] pe%(1)[178]21 [167] 60140: [143] new title
60267 t[178]t[170]1:[139] t[179]lk[170]1 [167] 60230: [143] next/previous title
60270 [137] 60140
60500 [143] --------------- play all
60510 [129] t[178]fk [164] lk
60520 [141] 3500:[143] lbn for title end
60530 bn[178]bn[171]1 :[143] lbn of title end
60540 [141] 3540:[143] change lbn to mfs
60550 nr[178]t[171]1 :[143] count from 0
60560 [141] 2700 :[143] start playing
60570 ts$[178]"(NULL)laying all":[141] 6100
60580 :
60590 [141] 2800 :[143] read subcannel till title end
60600 [139] tf[178]1 [167] t[178]lk[170]1: [143] error while playing -> exit
60610 [130]
60620 [141] 3100 :[143] stop unit
60630 [142]
60700 [143] --- play entire cd
60710 t[178]lk:[143] last title
60720 [141]3500: [143] lbn of title end
60730 bn[178]bn[171]1
60740 [141]3540: [143] lbn -> mfs
60750 nr[178]fk[171]1: [143] start at first title
60760 [141]2700: [143] start playing
60770 [142]
60800 [143] ------------- random play
60805 t[178][187]([171]ti)
60810 t[178][181]((lk[171]fk[170]1)[172][187](ti)[170]fk)
60820 [141] 3500:[143] lbn for title end
60830 bn[178]bn[171]1 :[143] lbn of title end
60840 [141] 3540:[143] change lbn to mfs
60850 nr[178]t[171]1 :[143] count from 0
60860 [141] 2700 :[143] start playing
60870 ts$[178]"(NULL)andom play":[141] 6100
60880 [141] 2800 :[143] read subcannel till title end
60890 [139]([168](x$[178]"_")[175](tf[178]0))[167] 60810
60895 [141] 3100 :[143] stop unit
60899 [142]