From 35572cb76ae9da8d64690e6563dee01eb4b4e5ba Mon Sep 17 00:00:00 2001 From: Stevan Freeborn Date: Sat, 18 Jul 2026 15:16:07 -0500 Subject: [PATCH] fix(cpu): break cycle execution loop if waiting for key --- main.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/main.c b/main.c index 059ce78..78bd5a6 100644 --- a/main.c +++ b/main.c @@ -278,6 +278,9 @@ int main(int argc, char *argv[]) { } for(int i = 0; i < CYCLES_PER_FRAME; i++) { + if (chip->waiting_for_key) { + break; + } // read 2 bytes at a time from memory // reading first 1 byte shifting left 1 byte ORing 2 byte uint16_t opcode = (chip->memory[chip->pc] << 8) | (chip->memory[chip->pc + 1]);