mirror of
https://github.com/jtauber/applepy.git
synced 2024-06-09 21:29:26 +00:00
from __future__ import print_function
This commit is contained in:
parent
878700d78d
commit
62c7d4b2b3
17
cpu6502.py
17
cpu6502.py
|
@ -3,6 +3,7 @@
|
||||||
# originally written 2001, updated 2011
|
# originally written 2001, updated 2011
|
||||||
|
|
||||||
|
|
||||||
|
from __future__ import print_function
|
||||||
import BaseHTTPServer
|
import BaseHTTPServer
|
||||||
import json
|
import json
|
||||||
import re
|
import re
|
||||||
|
@ -16,9 +17,7 @@ bus = None # socket for bus I/O
|
||||||
|
|
||||||
|
|
||||||
def signed(x):
|
def signed(x):
|
||||||
if x > 0x7F:
|
return x - 0x100 if x > 0x7F else x
|
||||||
x = x - 0x100
|
|
||||||
return x
|
|
||||||
|
|
||||||
|
|
||||||
class ROM:
|
class ROM:
|
||||||
|
@ -718,9 +717,9 @@ class CPU:
|
||||||
op = self.read_pc_byte()
|
op = self.read_pc_byte()
|
||||||
func = self.ops[op]
|
func = self.ops[op]
|
||||||
if func is None:
|
if func is None:
|
||||||
print "UNKNOWN OP"
|
print("UNKNOWN OP")
|
||||||
print hex(self.program_counter - 1)
|
print(hex(self.program_counter - 1))
|
||||||
print hex(op)
|
print(hex(op))
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
self.ops[op]()
|
self.ops[op]()
|
||||||
|
@ -735,9 +734,9 @@ class CPU:
|
||||||
op = self.read_pc_byte()
|
op = self.read_pc_byte()
|
||||||
func = self.ops[op]
|
func = self.ops[op]
|
||||||
if func is None:
|
if func is None:
|
||||||
print "UNKNOWN OP"
|
print("UNKNOWN OP")
|
||||||
print hex(self.program_counter - 1)
|
print(hex(self.program_counter - 1))
|
||||||
print hex(op)
|
print(hex(op))
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
self.ops[op]()
|
self.ops[op]()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user