gpu: reading existence of other banks using mmio

This commit is contained in:
minjaesong
2022-04-14 14:08:03 +09:00
parent 4a02198d79
commit b46c1d6f01
4 changed files with 11 additions and 6 deletions

View File

@@ -15,6 +15,10 @@ class GraphicsJSR223Delegate(val vm: VM) {
return vm.findPeribyType(VM.PERITYPE_GPU_AND_TERM)?.peripheral as? GraphicsAdapter
}
fun getVramSize() {
getFirstGPU()?.mmio_read(11)
}
fun resetPalette() {
getFirstGPU()?.poke(250883L, 1)
}

View File

@@ -36,7 +36,7 @@ data class AdapterConfig(
)
data class SuperGraphicsAddonConfig(
val hasSecondBank: Boolean = false
val bankCount: Int = 1
)
class ReferenceGraphicsAdapter(assetsRoot: String, vm: VM) : GraphicsAdapter(assetsRoot, vm, GraphicsAdapter.DEFAULT_CONFIG_COLOR_CRT)
@@ -268,7 +268,7 @@ open class GraphicsAdapter(private val assetsRoot: String, val vm: VM, val confi
8L -> lastUsedColour
9L -> ttyFore.toByte()
10L -> ttyBack.toByte()
11L -> 1
11L -> sgr.bankCount.toByte()
in 0 until VM.MMIO_SIZE -> -1
else -> null