guard against SET PC, [SP++], and SET PC, [--SP]

This commit is contained in:
Loic Nageleisen 2012-04-14 15:41:20 +02:00
parent d638ebe7ea
commit a714a9d71a

View file

@ -415,8 +415,10 @@ class CPU(object):
def run(c): def run(c):
"""step until PC is constant""" """step until PC is constant"""
last_pc = 0xFFFF last_pc = 0xFFFF
while c.pc != last_pc: last_sp = 0xFFFF
while c.pc != last_pc or c.sp != last_sp:
last_pc = c.pc last_pc = c.pc
last_sp = c.sp
c.step() c.step()
log("Infinite loop") log("Infinite loop")