summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--nandgame/cpp/simpc_ui.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/nandgame/cpp/simpc_ui.cpp b/nandgame/cpp/simpc_ui.cpp
index 31566ad..a17cbb9 100644
--- a/nandgame/cpp/simpc_ui.cpp
+++ b/nandgame/cpp/simpc_ui.cpp
@@ -100,17 +100,19 @@ void simpc_ui_write(const std::unique_ptr<Vcomputer> &topp, uint64_t &i,
void simpc_ui_finish_message(const std::unique_ptr<VerilatedContext> &contextp,
const std::unique_ptr<Vcomputer> &topp) {
-#if NCUR
- refresh();
-#endif
- PRINT_ME(10 + NCUR_OFFSET, 10, "Simulation finished.");
+ PRINT_ME(1, 30, "Simulation finished.");
+ const char *msg;
if (topp->halt) {
- PRINT_ME(11 + NCUR_OFFSET, 10, "Halt encountered.");
+ msg = "Halt encountered.";
} else if (!contextp->gotFinish()) {
- PRINT_ME(11 + NCUR_OFFSET, 10, "Step count exceeded.");
+ msg = "Step count exceeded.";
} else {
- PRINT_ME(11 + NCUR_OFFSET, 10, "Regular finish.");
+ msg = "Regular finish.";
}
+ PRINT_ME(2, 30, "%s", msg);
+#if NCUR
+ refresh();
+#endif
}
void simpc_ui_init(void) {