OS library implementation

Former-commit-id: b4f7f283080ead5e92c273015bfe2559cbe99e47
Former-commit-id: adaa0af80068a916e534f677f6e5ffe1f3072241
This commit is contained in:
Song Minjae
2016-09-29 00:21:42 +09:00
parent db8e46e5c2
commit ae114c53e0
32 changed files with 551 additions and 507 deletions

View File

@@ -223,7 +223,7 @@ open class SimpleTextTerminal(
}
else {
when (c) {
ASCII_BEL -> beep()
ASCII_BEL -> bell(".")
ASCII_BS -> { cursorX -= 1; wrap() }
ASCII_TAB -> { cursorX = (cursorX).div(TABSIZE).times(TABSIZE) + TABSIZE }
ASCII_LF -> newLine()
@@ -318,13 +318,13 @@ open class SimpleTextTerminal(
* @param duration: milliseconds
* @param freg: Frequency (float)
*/
override fun beep(duration: Int, freq: Float) {
override fun emitTone(duration: Int, freq: Float) {
// println("!! Beep playing row $beepCursor, d ${Math.min(duration, maxDuration)} f $freq")
host.clearBeepQueue()
host.enqueueBeep(duration, freq)
}
/** for "beep code" on modern BIOS. */
/** for "emitTone code" on modern BIOS. */
override fun bell(pattern: String) {
host.clearBeepQueue()
@@ -336,7 +336,7 @@ open class SimpleTextTerminal(
for (c in pattern) {
when (c) {
'.' -> { host.enqueueBeep(50, freq); host.enqueueBeep(50, 0f) }
'.' -> { host.enqueueBeep(80, freq); host.enqueueBeep(50, 0f) }
'-' -> { host.enqueueBeep(200, freq); host.enqueueBeep(50, 0f) }
'=' -> { host.enqueueBeep(500, freq); host.enqueueBeep(50, 0f) }
' ' -> { host.enqueueBeep(200, 0f) }