From 406e651c662f7a82c0ba23a86f96fcb2cd6edaff Mon Sep 17 00:00:00 2001 From: "Adrian.Conlon" Date: Thu, 31 Aug 2017 17:19:32 +0100 Subject: [PATCH] Whoops: The processor should only execute instructions while it is powered. Otherwise, it'll get into an infinite loop. Signed-off-by: Adrian.Conlon --- src/Processor.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Processor.cpp b/src/Processor.cpp index 655b4a7..a356f89 100644 --- a/src/Processor.cpp +++ b/src/Processor.cpp @@ -19,9 +19,9 @@ void EightBit::Processor::initialise() { int EightBit::Processor::run(int limit) { int current = 0; - do { + while (powered() && current < limit) { current += singleStep(); - } while (current < limit); + } return current; }