mirror of
https://github.com/mnaberez/py65.git
synced 2025-01-01 11:29:32 +00:00
Speed up run() by caching in local variables
This commit is contained in:
parent
1586b1808d
commit
9f5cd2e425
@ -439,17 +439,19 @@ class Monitor(cmd.Cmd):
|
||||
def _run(self, stopcodes):
|
||||
stopcodes = set(stopcodes)
|
||||
breakpoints = set(self._breakpoints)
|
||||
mpu = self._mpu
|
||||
mem = self._mpu.memory
|
||||
|
||||
if not breakpoints: # optimization
|
||||
if not breakpoints:
|
||||
while True:
|
||||
self._mpu.step()
|
||||
if self._mpu.memory[self._mpu.pc] in stopcodes:
|
||||
mpu.step()
|
||||
if mem[mpu.pc] in stopcodes:
|
||||
break
|
||||
else:
|
||||
while True:
|
||||
self._mpu.step()
|
||||
pc = self._mpu.pc
|
||||
if self._mpu.memory[pc] in stopcodes:
|
||||
mpu.step()
|
||||
pc = mpu.pc
|
||||
if mem[pc] in stopcodes:
|
||||
break
|
||||
if pc in breakpoints:
|
||||
msg = "Breakpoint %d reached."
|
||||
|
Loading…
Reference in New Issue
Block a user