mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-10 18:44:05 +09:00
virtualcomputer: unix-like operation system [WIP]
Former-commit-id: 68bb33337b78c7357d16a5a3ca47ad5f834f3d08 Former-commit-id: 6c8931a114682d2b1414414484597f5e0d0ca095
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user