vmemu: updating default profiles

This commit is contained in:
minjaesong
2022-12-12 16:09:41 +09:00
parent 34b5304a22
commit 0e0e858ee6
3 changed files with 23 additions and 14 deletions

View File

@@ -43,7 +43,7 @@ public class AppLoader {
// VM pipvm = new VM("./assets", 4096, new TheRealWorld(), new VMProgramRom[]{PipBios.INSTANCE, PipROM.INSTANCE}, 8);
vm.getIO().getBlockTransferPorts()[0].attachDevice(new TestDiskDrive(vm, 0, diskPath));
vm.getIO().getBlockTransferPorts()[1].attachDevice(new HttpModem(vm));
vm.getIO().getBlockTransferPorts()[1].attachDevice(new HttpModem(vm, 1024, -1));

View File

@@ -20,6 +20,9 @@ class ProfilesMenu(parent: VMEmuExecutable, x: Int, y: Int, w: Int, h: Int) : Em
private var selectedProfileIndex: Int? = null
private val viewportRows = parent.panelsY
private val viewportColumns = parent.panelsX
private fun resetState() {
profilesScroll = 0
}
@@ -90,12 +93,15 @@ class ProfilesMenu(parent: VMEmuExecutable, x: Int, y: Int, w: Int, h: Int) : Em
}
// draw profile detals view
batch.color = EmulatorGuiToolkit.Theme.COL_WELL2
batch.fillRect(251, 11, 375, 403)
batch.fillRect(251, 427, 375, 26)
if (selectedProfileIndex != null) profileNames[selectedProfileIndex!!].let { profileName ->
batch.color = EmulatorGuiToolkit.Theme.COL_WELL2
batch.fillRect(251, 11, 375, 390)
batch.fillRect(251, 427, 375, 26)
val profile = parent.profiles[profileName]!!
val theVM = parent.getVMbyProfileName(profileName)
val vmViewport = parent.getViewportForTheVM(theVM)
val ramsize = profile.getLong("ramsize")
val cardslots = profile.getInt("cardslots")
@@ -118,6 +124,16 @@ class ProfilesMenu(parent: VMEmuExecutable, x: Int, y: Int, w: Int, h: Int) : Em
for (i in 2 until cardslots) {
FONT.draw(batch, "$i) ${cards[i-1]?.let { it.substring(it.lastIndexOf('.')+1) } ?: ""}", 253f, 11f + (10+i)*FONT.H)
}
// draw panel chooser
FONT.draw(batch, "Show on viewport:", 253f, 414f)
for (i in 1 until viewportRows * viewportColumns) {
batch.color = if (vmViewport != null && i == vmViewport + 1)
EmulatorGuiToolkit.Theme.COL_ACTIVE2
else
Color.WHITE
FONT.draw(batch, "$i", 239f + (i * 14f) + (if (i < 10) 7f else 0f), 434f)
}
}
}
}

View File

@@ -157,17 +157,10 @@ class VMEmuExecutable(val windowWidth: Int, val windowHeight: Int, var panelsX:
initVMenv(vm)
vms[0] = VMRunnerInfo(vm, "Initial VM")*/
val testJson = JsonReader().parse("{$defaultProfile}")
val vm1 = getVMbyProfileName("Initial VM")!!
initVMenv(vm1)
vms[0] = VMRunnerInfo(vm1, "Initial VM")
val vm2 = VM("./assets", 64 shl 10, TheRealWorld(), arrayOf(TsvmBios), 8)
vm2.getIO().blockTransferPorts[0].attachDevice(TestDiskDrive(vm2, 0, "assets/disk0"))
initVMenv(vm2)
vms[1] = VMRunnerInfo(vm2, "Initial VM2")
init()
}
@@ -373,7 +366,7 @@ class VMEmuExecutable(val windowWidth: Int, val windowHeight: Int, var panelsX:
coroutineJobs.values.forEach { it.cancel() }
vms.forEach { it?.vm?.dispose() }
writeProfilesToFile(Gdx.files.absolute("$APPDATADIR/profiles_new.json"))
writeProfilesToFile(Gdx.files.absolute("$APPDATADIR/profiles.json"))
}
private val menuTabW = windowWidth - 4
@@ -455,7 +448,7 @@ class VMEmuExecutable(val windowWidth: Int, val windowHeight: Int, var panelsX:
"cardslots":8,
"roms":["./assets/bios/tsvmbios.js"],
"com1":{"cls":"net.torvald.tsvm.peripheral.TestDiskDrive", "args":[0, "./assets/disk0/"]},
"com2":{"cls":"net.torvald.tsvm.peripheral.HttpModem", "args":[]},
"com2":{"cls":"net.torvald.tsvm.peripheral.HttpModem", "args":[1024, -1]},
"card4":{"cls":"net.torvald.tsvm.peripheral.RamBank", "args":[256]}
}
""".trimIndent()