mirror of
https://github.com/jtauber/applepy.git
synced 2024-11-26 16:49:32 +00:00
added test_run to run CPU over a fragment of memory with no UI event handling (for automated testings)
This commit is contained in:
parent
bdc7b3a1e2
commit
fcb1d585a0
15
applepy.py
15
applepy.py
@ -773,6 +773,21 @@ class CPU:
|
||||
pygame.display.flip()
|
||||
update_cycle = 0
|
||||
|
||||
def test_run(self, start, end):
|
||||
self.program_counter = start
|
||||
while True:
|
||||
if self.program_counter == end:
|
||||
break
|
||||
op = self.read_pc_byte()
|
||||
func = self.ops[op]
|
||||
if func is None:
|
||||
print "UNKNOWN OP"
|
||||
print hex(self.program_counter - 1)
|
||||
print hex(op)
|
||||
break
|
||||
else:
|
||||
self.ops[op]()
|
||||
|
||||
####
|
||||
|
||||
def get_pc(self, inc=1):
|
||||
|
Loading…
Reference in New Issue
Block a user