diff options
| author | uvok | 2026-01-09 16:26:35 +0100 |
|---|---|---|
| committer | uvok | 2026-01-09 16:26:35 +0100 |
| commit | b65ed96c66b9ad2243bda0367274b42b963e9321 (patch) | |
| tree | 323aae1ec1b045a733e0349b3bbb6fac0d14604a /nandgame/Vcomputer__main.cpp | |
| parent | 1952ab0f86bdf2ee8d0bde8fe2e5e12f5855c045 (diff) | |
simu: longer simu, stop condition
Diffstat (limited to 'nandgame/Vcomputer__main.cpp')
| -rw-r--r-- | nandgame/Vcomputer__main.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/nandgame/Vcomputer__main.cpp b/nandgame/Vcomputer__main.cpp index 79b1ef7..2bf6117 100644 --- a/nandgame/Vcomputer__main.cpp +++ b/nandgame/Vcomputer__main.cpp @@ -104,7 +104,7 @@ int main(int argc, char **argv, char **) { curs_set(0); #endif - while (VL_LIKELY(!contextp->gotFinish()) && i < 100) { + while (VL_LIKELY(!contextp->gotFinish()) && i < 500) { //topp->computer->clk_in = ~topp->computer->clk_in; topp->clk_in = !topp->clk_in; @@ -113,10 +113,14 @@ int main(int argc, char **argv, char **) { draw_ui(topp, i); + // both bits 14 and 15 need to be set + uint16_t opcode = topp->computer->PC_content_int; + if ((opcode & 0xC000) == 0x8000) + break; + // Advance time contextp->timeInc(1); i++; - } PRINT_ME(10 + NCUR_OFFSET, 10, "Simulation finished."); |
