aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/gui/RunControlWindow.kt
diff options
context:
space:
mode:
authorJames Barnett <noreply@jamesbarnett.xyz>2018-07-21 19:46:20 +0100
committerJames Barnett <noreply@jamesbarnett.xyz>2018-07-21 19:46:20 +0100
commitc6a953d722b1fdc27a9db6f78f00c52fe43a7222 (patch)
tree6efab06c40d0bd3c26876ca2b40f2f0f20b2def2 /src/main/kotlin/gui/RunControlWindow.kt
parent2861f2db6f918c48019c1ac3f91bf6a407452493 (diff)
downloadKGB-c6a953d722b1fdc27a9db6f78f00c52fe43a7222.tar.xz
KGB-c6a953d722b1fdc27a9db6f78f00c52fe43a7222.zip
Add ability to step through CPU execution of boot rom
Diffstat (limited to 'src/main/kotlin/gui/RunControlWindow.kt')
-rw-r--r--src/main/kotlin/gui/RunControlWindow.kt46
1 files changed, 46 insertions, 0 deletions
diff --git a/src/main/kotlin/gui/RunControlWindow.kt b/src/main/kotlin/gui/RunControlWindow.kt
new file mode 100644
index 0000000..8ffc764
--- /dev/null
+++ b/src/main/kotlin/gui/RunControlWindow.kt
@@ -0,0 +1,46 @@
+package gui
+
+import cpu.Cpu
+import glm_.vec2.Vec2
+import imgui.Cond
+import imgui.ImGui
+
+fun paintRunControlWindow(cpu: Cpu) {
+ with(ImGui) {
+
+ setNextWindowPos(Vec2(20, 410), Cond.FirstUseEver)
+ begin("Run control")
+
+ text("Current op:")
+ separator()
+ if(cpu.currentOp != null) {
+ text(cpu.currentOp!!.name)
+ }
+ else {
+ text("None")
+ }
+
+ newLine()
+
+ text("Next op:")
+ separator()
+ if(cpu.nextOp != null) {
+ text(cpu.nextOp!!.name)
+ }
+ else {
+ text("None")
+ }
+
+ newLine()
+
+ text("Control:")
+ separator()
+
+
+ if(button("Step")) {
+ cpu.executeNextInstruction()
+ }
+
+ end()
+ }
+} \ No newline at end of file