From a678fe4a4e6a3f810db22fa91a483c7be7d5a3a9 Mon Sep 17 00:00:00 2001 From: Ethan Sifferman Date: Sat, 29 Jul 2023 15:38:45 -0700 Subject: [PATCH] stop condition now checked on first instruction --- py65/monitor.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/py65/monitor.py b/py65/monitor.py index 5726281..66c42d7 100644 --- a/py65/monitor.py +++ b/py65/monitor.py @@ -504,12 +504,11 @@ def _run(self, stopcodes): if not breakpoints: while True: - mpu.step() if mem[mpu.pc] in stopcodes: break + mpu.step() else: while True: - mpu.step() pc = mpu.pc if mem[pc] in stopcodes: break @@ -517,6 +516,7 @@ def _run(self, stopcodes): msg = "Breakpoint %d reached." self._output(msg % self._breakpoints.index(pc)) break + mpu.step() # Switch back to the previous input mode. console.restore_mode()