mirror of
https://github.com/lloeki/python-dcpu_16.git
synced 2025-12-06 18:04:38 +01:00
Compare commits
No commits in common. "master" and "v1.1" have entirely different histories.
1 changed files with 1 additions and 4 deletions
|
|
@ -334,7 +334,6 @@ class Memory(object):
|
||||||
class CPU(object):
|
class CPU(object):
|
||||||
"""DCPU-16"""
|
"""DCPU-16"""
|
||||||
def __init__(c, memory=Memory(), debug=False):
|
def __init__(c, memory=Memory(), debug=False):
|
||||||
"""If you don't specify memory, CPUs will share the same, default memory object"""
|
|
||||||
c.m = memory
|
c.m = memory
|
||||||
c.clear()
|
c.clear()
|
||||||
c.reset()
|
c.reset()
|
||||||
|
|
@ -415,10 +414,8 @@ 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
|
||||||
last_sp = 0xFFFF
|
while c.pc != last_pc:
|
||||||
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")
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue