summaryrefslogtreecommitdiff
path: root/nandgame/cpp/simpc_ui.cpp
diff options
context:
space:
mode:
authoruvok2026-01-11 12:04:16 +0100
committeruvok2026-01-11 12:04:16 +0100
commit7c8d84fb83875a2f3a45d6450516ee5ac96717ee (patch)
tree3bd4df627dfb7be3370074f943cce401c873f616 /nandgame/cpp/simpc_ui.cpp
parent4e4401db2d168f92968bb583225c2d8a9d36cd21 (diff)
Mark to-store registers
Diffstat (limited to 'nandgame/cpp/simpc_ui.cpp')
-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 e4b3bf8..abe1fa8 100644
--- a/nandgame/cpp/simpc_ui.cpp
+++ b/nandgame/cpp/simpc_ui.cpp
@@ -22,7 +22,7 @@
#define PRINT_ME(y, x, ...) \
{ \
- printf("%*c", x, ' '); \
+ printf("%*c", x, ' '); \
printf(__VA_ARGS__); \
printf("\n"); \
}
@@ -64,16 +64,18 @@ void simpc_ui_write(const std::unique_ptr<Vcomputer> &topp, uint64_t &i,
"A: 0x%04X\tD: 0x%04X\tM: 0x%04X\tRES: 0x%04X",
topp->computer->reg_A_int, topp->computer->reg_D_int,
topp->computer->reg_pA_int, topp->computer->result_int);
- PRINT_ME(6 + NCUR_OFFSET, NCUR_X,
- "%9d\t%9d\t%9d\t%11d",
- topp->computer->reg_A_int, topp->computer->reg_D_int,
- topp->computer->reg_pA_int, topp->computer->result_int);
+ PRINT_ME(
+ 6 + NCUR_OFFSET, NCUR_X, "%c%8d\t%c%8d\t%c%8d\t%11d",
+ topp->computer->store_to_A_int ? '*' : ' ', topp->computer->reg_A_int,
+ topp->computer->store_to_D_int ? '*' : ' ', topp->computer->reg_D_int,
+ topp->computer->store_to_pA_int ? '*' : ' ', topp->computer->reg_pA_int,
+ topp->computer->result_int);
PRINT_ME(7 + NCUR_OFFSET, NCUR_X, "ALU");
PRINT_ME(8 + NCUR_OFFSET, NCUR_X, "X: %5d\tY: %5d",
topp->computer->CPU->my_alu->int_op_x,
topp->computer->CPU->my_alu->int_op_y);
- PRINT_ME(getmaxy(stdscr) - 1, 1, "q - Quit; p - (Un)pause; any key in pause - step");
-
+ PRINT_ME(getmaxy(stdscr) - 1, 1,
+ "q - Quit; p - (Un)pause; any key in pause - step");
PRINT_NEXT();