mirror of
https://github.com/dschmenk/PLASMA.git
synced 2025-02-10 10:30:58 +00:00
Pass yieldtime into GetKey
This commit is contained in:
parent
222e34e229
commit
6267264467
@ -1,4 +1,4 @@
|
||||
import sndseq
|
||||
predef spkrTone(pitch, duration)#0, spkrPWM(sample, speed, len)#0
|
||||
predef musicPlay(track, rept)#0, musicStop#0, musicGetKey(backgroundProc)#1
|
||||
predef musicPlay(track, rept)#0, musicStop#0, musicGetKey(yield,backgroundProc)#1
|
||||
end
|
||||
|
@ -763,17 +763,14 @@ export def musicStop#0
|
||||
musicSequence = @noSequence
|
||||
end
|
||||
//
|
||||
// Get a keystroke and convert it to upper case
|
||||
// Play until keystroke
|
||||
//
|
||||
export def musicGetKey(backgroundProc)#1
|
||||
byte key
|
||||
|
||||
export def musicGetKey(yield, backgroundProc)#1
|
||||
while ^$C000 < 128
|
||||
musicSequence($08, backgroundProc)#0 // Call background proc every half second
|
||||
musicSequence(yield, backgroundProc)#0 // Call background proc every half second
|
||||
loop
|
||||
key = ^$C000 & $7F
|
||||
^$C010
|
||||
return key
|
||||
return ^$C000
|
||||
end
|
||||
done
|
||||
|
||||
@ -798,7 +795,7 @@ musicStop()
|
||||
The getUpperKey routine will call a dummy sequence routine that will
|
||||
keep the correct timing for any background processing
|
||||
|
||||
getKey()
|
||||
musicGetKey(yieldtime, yieldproc)
|
||||
Wait for a keypress and return the character
|
||||
While waiting for the keypress, the track sequence will be played though
|
||||
either the MockingBoard (if present) or the internal speaker. Optionally,
|
||||
|
@ -22,7 +22,7 @@ if ^arg
|
||||
fileio:read(ref, heapmark(), heapavail())
|
||||
fileio:close(ref)
|
||||
musicPlay(heapmark(), TRUE)
|
||||
musicGetKey(@backgroundProc)
|
||||
musicGetKey(8, @backgroundProc) // Yield every 8/16 second
|
||||
musicStop
|
||||
else
|
||||
puts("File not found.\n")
|
||||
|
Loading…
x
Reference in New Issue
Block a user