115 lines
3.6 KiB
Plaintext
115 lines
3.6 KiB
Plaintext
|
{{ ---------------------------------------------------------------------------------------------------------
|
|||
|
|
|||
|
Hive-Computer-Projekt
|
|||
|
|
|||
|
Name : Vectron-Demo 1
|
|||
|
Chip : Regnatix-Code
|
|||
|
Version : 0.1
|
|||
|
Dateien : vecdem1.spin
|
|||
|
|
|||
|
Beschreibung :
|
|||
|
|
|||
|
Eigenschaften :
|
|||
|
|
|||
|
Logbuch :
|
|||
|
|
|||
|
Kommandoliste:
|
|||
|
|
|||
|
--------------------------------------------------------------------------------------------------------- }}
|
|||
|
|
|||
|
OBJ
|
|||
|
ios: "ios"
|
|||
|
|
|||
|
CON
|
|||
|
|
|||
|
_CLKMODE = XTAL1 + PLL16X
|
|||
|
_XINFREQ = 5_000_000
|
|||
|
|
|||
|
OS_TIBLEN = 64 'gr<67><72>e des inputbuffers
|
|||
|
|
|||
|
VAR
|
|||
|
'systemvariablen
|
|||
|
byte tib[OS_TIBLEN] 'tastatur-input-buffer
|
|||
|
byte cmdstr[OS_TIBLEN] 'kommandostring f<>r interpreter
|
|||
|
byte parastr[OS_TIBLEN] 'parameterstring f<>r interpreter
|
|||
|
byte tibpos 'aktuelle position im tib
|
|||
|
|
|||
|
long lcnt 'zeiger f<>r dateiliste
|
|||
|
byte fn[12] 'puffer f<>r dateinamen
|
|||
|
|
|||
|
PUB main | wflag
|
|||
|
|
|||
|
wflag := ios.start 'ios initialisieren
|
|||
|
|
|||
|
'mu<6D> auskommentiert werden f<>r bin-datei
|
|||
|
'ios.startram 'testcode f<>r ramupload
|
|||
|
|
|||
|
ios.breset 'bellatrix neu starten
|
|||
|
waitcnt(cnt + 200_000_000) 'warte bis bel fertig ist
|
|||
|
ios.bload(string("vecdem1.bel")) 'grafiktreiber laden
|
|||
|
waitcnt(cnt + 200_000_000) 'warte bis bel fertig ist
|
|||
|
|
|||
|
ios.sdmount 'medium mounten
|
|||
|
repeat
|
|||
|
repsongs
|
|||
|
|
|||
|
|
|||
|
PUB repsongs | fnadr,len,fcnt,i 'alle songs auf der sd-card abspielen
|
|||
|
|
|||
|
ios.sddir 'kommando: verzeichnis <20>ffnen
|
|||
|
startlist 'zum listenanfang
|
|||
|
fcnt := 0 'z<>hler f<>r dateianzahl
|
|||
|
repeat 'dateiliste einlesen
|
|||
|
fnadr := ios.sdnext
|
|||
|
if fnadr <> 0 'ist eintrag g<>ltig?
|
|||
|
len := strsize(fnadr)
|
|||
|
if strcomp(@ext1,(fnadr+len-4))
|
|||
|
fcnt++
|
|||
|
wrfn(fnadr)
|
|||
|
while fnadr <> 0 'wiederholen solange stradr <> 0
|
|||
|
startlist 'zum listenanfang
|
|||
|
repeat i from 0 to fcnt-1 'dateiliste abspielen
|
|||
|
rdfn(@fn)
|
|||
|
playsong(@fn)
|
|||
|
fadeout
|
|||
|
|
|||
|
PUB fadeout | i 'song langsam ausblenden
|
|||
|
repeat i from 0 to 15
|
|||
|
ios.hss_vol(15 - i)
|
|||
|
waitcnt(cnt + 60_000_000)
|
|||
|
waitcnt(cnt + 30_000_000)
|
|||
|
|
|||
|
CON
|
|||
|
|
|||
|
' long lcnt 'zeiger f<>r dateiliste
|
|||
|
' byte fn[12] 'puffer f<>r dateinamen
|
|||
|
|
|||
|
PUB wrfn(stradr) | len,i 'kopiert dateinamen in eram
|
|||
|
len := strsize(stradr)
|
|||
|
repeat i from 0 to len-1
|
|||
|
ios.ram_write(byte[stradr][i],lcnt++)
|
|||
|
ios.ram_write(0,lcnt++)
|
|||
|
|
|||
|
|
|||
|
PUB rdfn(stradr) | i,n 'liest dateinamen aus eram
|
|||
|
i := 0
|
|||
|
repeat
|
|||
|
n := ios.ram_read(lcnt++)
|
|||
|
byte[stradr][i++] := n
|
|||
|
while n <> 0
|
|||
|
|
|||
|
PUB startlist 'zeiger auf listenanfang (dateinamen)
|
|||
|
lcnt := 0
|
|||
|
|
|||
|
PUB playsong(stradr) | n 'spielt die musikdatei bis zum ende
|
|||
|
|
|||
|
ios.hss_stop
|
|||
|
ios.hss_playfile(stradr)
|
|||
|
repeat
|
|||
|
n := ios.hss_intreg(ios#iRepeat)
|
|||
|
until n == 3
|
|||
|
|
|||
|
|
|||
|
|
|||
|
DAT
|
|||
|
ext1 byte ".HSS",0
|