CON device file

This commit is contained in:
minjaesong
2022-08-17 15:43:20 +09:00
parent 258cf1bd0a
commit 883736192c
4 changed files with 91 additions and 7 deletions

View File

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

View File

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