virtualcomputer: unix-like operation system [WIP]

Former-commit-id: 68bb33337b78c7357d16a5a3ca47ad5f834f3d08
Former-commit-id: 6c8931a114682d2b1414414484597f5e0d0ca095
This commit is contained in:
Song Minjae
2016-10-02 01:18:58 +09:00
parent 3f34286b3f
commit 81958709ee
25 changed files with 650 additions and 193 deletions

View File

@@ -191,10 +191,11 @@ class BaseTerrarumComputer(peripheralSlots: Int) {
fun update(gc: GameContainer, delta: Int) {
input = gc.input
if (currentExecutionThread.state == Thread.State.TERMINATED)
unsetThreadRun()
// time the execution time of the thread
if (threadRun) {
threadTimer += delta
@@ -205,9 +206,15 @@ class BaseTerrarumComputer(peripheralSlots: Int) {
//currentExecutionThread.interrupt()
unsetThreadRun()
}
driveBeepQueueManager(delta)
}
driveBeepQueueManager(delta)
if (isHalted) {
currentExecutionThread.interrupt()
}
}
fun keyPressed(key: Int, c: Char) {
@@ -240,8 +247,6 @@ class BaseTerrarumComputer(peripheralSlots: Int) {
class ThreadRunCommand : Runnable {
val DEBUGTHRE = true
val mode: Int
val arg1: Any
val arg2: String
@@ -276,7 +281,7 @@ class BaseTerrarumComputer(peripheralSlots: Int) {
}
catch (e: LuaError) {
lua.STDERR.println("${SimpleTextTerminal.ASCII_DLE}${e.message}${SimpleTextTerminal.ASCII_DC4}")
if (DEBUGTHRE) e.printStackTrace(System.err)
e.printStackTrace(System.err)
}
}
}