summaryrefslogtreecommitdiff
path: root/nandgame
diff options
context:
space:
mode:
Diffstat (limited to 'nandgame')
-rw-r--r--nandgame/Vcomputer__main.cpp8
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.");