mirror of
https://github.com/curioustorvald/tsvm.git
synced 2026-03-07 19:51:51 +09:00
debug panels for COM
This commit is contained in:
@@ -5,7 +5,7 @@ import java.util.concurrent.atomic.AtomicInteger
|
||||
|
||||
abstract class BlockTransferInterface(val isMaster: Boolean, val isSlave: Boolean) {
|
||||
|
||||
protected var recipient: BlockTransferInterface? = null
|
||||
var recipient: BlockTransferInterface? = null; protected set
|
||||
|
||||
val ready = AtomicBoolean(true)
|
||||
val busy = AtomicBoolean(false)
|
||||
|
||||
32
tsvm_executable/src/net/torvald/tsvm/TevdMenu.kt
Normal file
32
tsvm_executable/src/net/torvald/tsvm/TevdMenu.kt
Normal file
@@ -0,0 +1,32 @@
|
||||
package net.torvald.tsvm
|
||||
|
||||
import com.badlogic.gdx.graphics.Color
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import net.torvald.tsvm.VMEmuExecutableWrapper.Companion.FONT
|
||||
|
||||
/**
|
||||
* Created by minjaesong on 2023-03-25.
|
||||
*/
|
||||
class TevdMenu(parent: VMEmuExecutable, x: Int, y: Int, w: Int, h: Int) : EmuMenu(parent, x, y, w, h) {
|
||||
|
||||
override fun show() {
|
||||
}
|
||||
|
||||
override fun hide() {
|
||||
}
|
||||
|
||||
override fun update() {
|
||||
}
|
||||
|
||||
override fun render(batch: SpriteBatch) {
|
||||
|
||||
batch.inUse {
|
||||
batch.color = Color.CORAL
|
||||
FONT.draw(batch, "Tevd!", 12f, 12f)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
override fun dispose() {
|
||||
}
|
||||
}
|
||||
@@ -206,6 +206,7 @@ class VMEmuExecutable(val windowWidth: Int, val windowHeight: Int, var panelsX:
|
||||
Gdx.input.inputProcessor = if (currentVMselection != null) vms[currentVMselection!!]?.vm?.getIO() ?: null else vmEmuInputProcessor
|
||||
|
||||
refreshCardTabs()
|
||||
refreshComTabs()
|
||||
}
|
||||
|
||||
internal fun initVMenv(vm: VM, profileName: String) {
|
||||
@@ -418,6 +419,7 @@ class VMEmuExecutable(val windowWidth: Int, val windowHeight: Int, var panelsX:
|
||||
private val dummyMenu = DummyMenu(this, menuTabX, menuTabY, menuTabW, menuTabH)
|
||||
private val menuRepository = mapOf(
|
||||
VM.PERITYPE_SOUND to AudioMenu(this, menuTabX, menuTabY, menuTabW, menuTabH),
|
||||
"TevdDiskDrive" to TevdMenu(this, menuTabX, menuTabY, menuTabW, menuTabH),
|
||||
"DUMMY" to dummyMenu
|
||||
)
|
||||
|
||||
@@ -456,6 +458,7 @@ class VMEmuExecutable(val windowWidth: Int, val windowHeight: Int, var panelsX:
|
||||
val menu = menuRepository[periType] ?: dummyMenu
|
||||
menu.cardIndex = i
|
||||
tabs[cardTabIndex + i - 1] = menu
|
||||
// println("Tabs[${cardTabIndex + i - 1}] = $periType")
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -464,11 +467,12 @@ class VMEmuExecutable(val windowWidth: Int, val windowHeight: Int, var panelsX:
|
||||
val vm = getCurrentlySelectedVM()?.vm
|
||||
|
||||
if (vm != null) {
|
||||
for (i in 1..7) {
|
||||
val periType = TODO() ?: "DUMMY"
|
||||
for (i in 0..3) {
|
||||
val periType = vm.getIO().blockTransferPorts[i].recipient?.javaClass?.simpleName ?: "DUMMY"
|
||||
val menu = menuRepository[periType] ?: dummyMenu
|
||||
menu.cardIndex = i // COM will recycle cardIndex
|
||||
tabs[comTabIndex + i - 1] = menu
|
||||
tabs[comTabIndex + i] = menu
|
||||
// println("Tabs[${comTabIndex + i}] = $periType")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user