diff options
| author | uvok | 2026-01-11 11:02:54 +0100 |
|---|---|---|
| committer | uvok | 2026-01-11 11:02:54 +0100 |
| commit | a538fb5524fa771a16e8cc291cae6cce46ea546d (patch) | |
| tree | e85cc43d2851ab9423bebbf905d7e3e0c1e5cc6e | |
| parent | acd85c5766ae4fd4c7a961369540b3b5b4b4f146 (diff) | |
Move finish into UI
| -rw-r--r-- | nandgame/cpp/Vcomputer__main.cpp | 5 | ||||
| -rw-r--r-- | nandgame/cpp/simpc_ui.cpp | 7 | ||||
| -rw-r--r-- | nandgame/cpp/simpc_ui.h | 3 |
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); |
