mirror of
https://github.com/curioustorvald/tsvm.git
synced 2026-03-07 19:51:51 +09:00
debug menu improvements
This commit is contained in:
@@ -33,8 +33,10 @@ class AudioMenu(parent: VMEmuExecutable, x: Int, y: Int, w: Int, h: Int) : EmuMe
|
||||
private val COL_SOUNDSCOPE_FORE = Color(0x80f782ff.toInt())
|
||||
private val STR_PLAY = "\u00D2\u00D3"
|
||||
|
||||
|
||||
override fun render(batch: SpriteBatch) {
|
||||
val adev = parent.getCurrentlySelectedVM()?.vm?.peripheralTable?.getOrNull(cardIndex ?: -1)?.peripheral as? AudioAdapter
|
||||
|
||||
val adev = parent.currentlyPersistentVM?.vm?.peripheralTable?.getOrNull(cardIndex ?: -1)?.peripheral as? AudioAdapter
|
||||
|
||||
if (adev != null) {
|
||||
batch.inUse {
|
||||
|
||||
@@ -24,27 +24,27 @@ class MMUMenu(parent: VMEmuExecutable, x: Int, y: Int, w: Int, h: Int) : EmuMenu
|
||||
override fun update() {
|
||||
}
|
||||
|
||||
private var vmInfo: VMEmuExecutable.VMRunnerInfo? = null // to remember previous selection as `parent.getCurrentlySelectedVM()` will return null when MMU menu is clicked
|
||||
|
||||
override fun render(batch: SpriteBatch) {
|
||||
batch.color = Color.WHITE
|
||||
|
||||
vmInfo = parent.getCurrentlySelectedVM() ?: vmInfo
|
||||
parent.currentlyPersistentVM.let { vmInfo ->
|
||||
|
||||
if (vmInfo == null) {
|
||||
batch.inUse {
|
||||
FONT.draw(batch, "Please select a VM", 12f, 11f + 0* FONT.H)
|
||||
if (vmInfo == null) {
|
||||
batch.inUse {
|
||||
FONT.draw(batch, "Please select a VM", 12f, 11f + 0* FONT.H)
|
||||
}
|
||||
}
|
||||
}
|
||||
else vmInfo!!.let { (vm, vmName) ->
|
||||
batch.inUse {
|
||||
FONT.draw(batch, "Allocated size: ${vm.allocatedBlockCount * vm.MALLOC_UNIT}", 12f, 11f + 0* FONT.H)
|
||||
else vmInfo.let { (vm, vmName) ->
|
||||
batch.inUse {
|
||||
FONT.draw(batch, "Allocated size: ${vm.allocatedBlockCount * vm.MALLOC_UNIT}", 12f, 11f + 0* FONT.H)
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
drawAllocMap(batch, vm, 62f, 2f * FONT.H)
|
||||
}
|
||||
|
||||
drawAllocMap(batch, vm, 62f, 2f * FONT.H)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -122,6 +122,12 @@ class VMEmuExecutable(val windowWidth: Int, val windowHeight: Int, var panelsX:
|
||||
}
|
||||
|
||||
internal fun getCurrentlySelectedVM(): VMRunnerInfo? = if (currentVMselection == null) null else vms[currentVMselection!!]
|
||||
internal var currentlyPersistentVM: VMRunnerInfo? = null
|
||||
get() {
|
||||
if (currentVMselection != null) { field = vms[currentVMselection!!] }
|
||||
return field
|
||||
}
|
||||
private set
|
||||
|
||||
private fun writeProfilesToFile(outFile: FileHandle) {
|
||||
val out = StringBuilder()
|
||||
|
||||
Reference in New Issue
Block a user