mirror of
https://github.com/curioustorvald/tsvm.git
synced 2026-06-08 22:34:03 +09:00
CON device file
This commit is contained in:
@@ -14,6 +14,10 @@ class GraphicsJSR223Delegate(val vm: VM) {
|
||||
return vm.findPeribyType(VM.PERITYPE_GPU_AND_TERM)?.peripheral as? GraphicsAdapter
|
||||
}
|
||||
|
||||
fun getGpuMemBase(): Int {
|
||||
return -1 - (1048576 * (vm.findPeriIndexByType(VM.PERITYPE_GPU_AND_TERM) ?: 0))
|
||||
}
|
||||
|
||||
fun getVramSize() {
|
||||
getFirstGPU()?.mmio_read(11)
|
||||
}
|
||||
|
||||
@@ -103,6 +103,13 @@ class VM(
|
||||
return null
|
||||
}
|
||||
|
||||
fun findPeriIndexByType(searchTerm: String): Int? {
|
||||
for (i in 0 until peripheralSlots) {
|
||||
if (peripheralTable[i].type == searchTerm) return i
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
fun update(delta: Float) {
|
||||
getIO().update(delta)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user