summaryrefslogtreecommitdiff
path: root/nandgame
diff options
context:
space:
mode:
Diffstat (limited to 'nandgame')
-rw-r--r--nandgame/cpp/Vcomputer__main.cpp5
-rw-r--r--nandgame/cpp/simpc_ui.cpp7
-rw-r--r--nandgame/cpp/simpc_ui.h3
3 files changed, 10 insertions, 5 deletions
diff --git a/nandgame/cpp/Vcomputer__main.cpp b/nandgame/cpp/Vcomputer__main.cpp
index 50f7c1b..5b7f615 100644
--- a/nandgame/cpp/Vcomputer__main.cpp
+++ b/nandgame/cpp/Vcomputer__main.cpp
@@ -94,10 +94,7 @@ int main(int argc, char **argv, char **) {
// Print statistical summary report
// contextp->statsPrintSummary();
-#if NCUR
- getch();
- endwin();
-#endif
+ ui_finish();
return 0;
}
diff --git a/nandgame/cpp/simpc_ui.cpp b/nandgame/cpp/simpc_ui.cpp
index 2fce3b8..5a75121 100644
--- a/nandgame/cpp/simpc_ui.cpp
+++ b/nandgame/cpp/simpc_ui.cpp
@@ -98,3 +98,10 @@ void draw_init(void) {
curs_set(0);
#endif
}
+
+void ui_finish(void) {
+#if NCUR
+ getch();
+ endwin();
+#endif
+}
diff --git a/nandgame/cpp/simpc_ui.h b/nandgame/cpp/simpc_ui.h
index 4f03d4a..8e07092 100644
--- a/nandgame/cpp/simpc_ui.h
+++ b/nandgame/cpp/simpc_ui.h
@@ -8,4 +8,5 @@
void draw_init(void);
void draw_ui(const std::unique_ptr<Vcomputer> &topp, int &i, StepPosition_t sp);
void draw_finish(const std::unique_ptr<VerilatedContext> &contextp,
- const std::unique_ptr<Vcomputer> &topp); \ No newline at end of file
+ const std::unique_ptr<Vcomputer> &topp);
+void ui_finish(void);