1
0
mirror of https://github.com/dschmenk/PLASMA.git synced 2024-10-18 22:24:28 +00:00

Pass yieldtime into GetKey

This commit is contained in:
David Schmenk 2018-02-02 16:41:10 -08:00
parent 222e34e229
commit 6267264467
3 changed files with 7 additions and 10 deletions

View File

@ -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

View File

@ -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,

View File

@ -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")