From 838bffe0d2a4296a42bc067435c654da021b7579 Mon Sep 17 00:00:00 2001 From: uvok Date: Sun, 11 Jan 2026 12:17:45 +0100 Subject: Print finish message in the top --- nandgame/cpp/simpc_ui.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'nandgame') 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 &topp, uint64_t &i, void simpc_ui_finish_message(const std::unique_ptr &contextp, const std::unique_ptr &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) { -- cgit v1.2.3