diff options
| author | uvok | 2026-01-11 12:17:45 +0100 |
|---|---|---|
| committer | uvok | 2026-01-11 12:17:45 +0100 |
| commit | 838bffe0d2a4296a42bc067435c654da021b7579 (patch) | |
| tree | 0c4314476455582850f2d9d1e7ef1fc47012b669 /nandgame/cpp | |
| parent | 3696780079e50a4f2de4647de970f56e732d5ac3 (diff) | |
Print finish message in the top
Diffstat (limited to 'nandgame/cpp')
| -rw-r--r-- | nandgame/cpp/simpc_ui.cpp | 16 |
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) { |
