1
0
mirror of https://github.com/mnaberez/py65.git synced 2024-07-05 19:28:57 +00:00

Fix default memory size and add UNUSED constant. (offe)

This commit is contained in:
Mike Naberezny 2009-04-04 20:20:49 -07:00
parent 1ed2582247
commit fac1c257b3

View File

@ -9,6 +9,7 @@ class MPU:
# processor flags
NEGATIVE = 128
OVERFLOW = 64
UNUSED = 32
BREAK = 16
DECIMAL = 8
INTERRUPT = 4
@ -27,7 +28,7 @@ class MPU:
self.internalCycleDelay = 0
if memory is None:
memory = 0xFFFF * [0x00]
memory = 0x10000 * [0x00]
self.memory = memory
self.start_pc = pc
@ -57,15 +58,19 @@ class MPU:
self.a = 0
self.x = 0
self.y = 0
self.flags = 32
self.flags = self.UNUSED
self.breakFlag = False
self.processorCycles = 0
# Helpers for addressing modes
def ByteAt(self, addr):
return self.memory[addr]
def WordAt(self, addr):
return self.ByteAt(addr) + (self.ByteAt(addr + 1) << 8)
# Addressing modes
def ImmediateByte(self):
return self.ByteAt(self.pc)