summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoruvok2026-01-26 20:32:31 +0100
committeruvok2026-01-26 20:32:31 +0100
commitdb43a1239ea64825bd0fe45caf8a87bbf9516325 (patch)
treefb51771d908a575d43f15e845d9f61f5ba591768
parent4cc62801974319a0ea2a1ed59fcf61aa9afed5bd (diff)
eater: Display ALU flags
-rw-r--r--eater_cpu/cpp/simpc_curses.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/eater_cpu/cpp/simpc_curses.cpp b/eater_cpu/cpp/simpc_curses.cpp
index 5ae98b1..c7de19b 100644
--- a/eater_cpu/cpp/simpc_curses.cpp
+++ b/eater_cpu/cpp/simpc_curses.cpp
@@ -59,9 +59,14 @@ void simpc_ui_write(const std::unique_ptr<Veater_computer> &topp, uint64_t i) {
PRINT_ME_W(status_top, 1, 1, "Step: %10lu", i);
PRINT_ME_W(status_top, 2, 1, "%-20s", paused ? "Paused" : "Running");
- PRINT_ME_W(clock_regs, 1, 1, "CLK: %2d\tState: 0x%02X\tHLT: %-2d",
+ const char* alu_flags;
+ if(topp->eater_computer->ALU_flags_out & 0xc0) alu_flags = "ZC";
+ else if(topp->eater_computer->ALU_flags_out & 0x80) alu_flags = "Z-";
+ else if(topp->eater_computer->ALU_flags_out & 0x40) alu_flags = "-C";
+ else alu_flags = "--";
+ PRINT_ME_W(clock_regs, 1, 1, "CLK: %2d\tState: 0x%02X\tHLT: %-6d\tFlags: %s",
topp->clk_in, topp->eater_computer->decoder__DOT__internal_state,
- topp->halt);
+ topp->halt, alu_flags);
PRINT_ME_W(clock_regs, 2, 1, "BUS: %02X\tPC: @0x%02X\tINS: 0x%02X",
topp->eater_computer->bus, topp->eater_computer->PC_out, opcode);