mirror of
https://github.com/mnaberez/py65.git
synced 2025-02-13 04:30:37 +00:00
Added WAI operation
Signed-off-by: Mike Naberezny <mike@naberezny.com>
This commit is contained in:
parent
cba7990d29
commit
af11a3722a
@ -1,15 +1,24 @@
|
|||||||
from py65.devices.mpu6502 import MPU as NMOS6502
|
from py65.devices import mpu6502
|
||||||
from py65.utils.devices import make_instruction_decorator
|
from py65.utils.devices import make_instruction_decorator
|
||||||
|
|
||||||
class MPU(NMOS6502):
|
class MPU(mpu6502.MPU):
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
NMOS6502.__init__(self, *args, **kwargs)
|
mpu6502.MPU.__init__(self, *args, **kwargs)
|
||||||
self.name = '65C02'
|
self.name = '65C02'
|
||||||
|
self.waiting = False
|
||||||
|
|
||||||
instruct = NMOS6502.instruct[:]
|
def step(self):
|
||||||
cycletime = NMOS6502.cycletime[:]
|
if self.waiting:
|
||||||
extracycles = NMOS6502.extracycles[:]
|
self.processorCycles += 1
|
||||||
disassemble = NMOS6502.disassemble[:]
|
else:
|
||||||
|
mpu6502.MPU.step(self)
|
||||||
|
return self
|
||||||
|
|
||||||
|
# Make copies of the lists
|
||||||
|
instruct = mpu6502.MPU.instruct[:]
|
||||||
|
cycletime = mpu6502.MPU.cycletime[:]
|
||||||
|
extracycles = mpu6502.MPU.extracycles[:]
|
||||||
|
disassemble = mpu6502.MPU.disassemble[:]
|
||||||
|
|
||||||
instruction = make_instruction_decorator(instruct, disassemble,
|
instruction = make_instruction_decorator(instruct, disassemble,
|
||||||
cycletime, extracycles)
|
cycletime, extracycles)
|
||||||
@ -243,6 +252,10 @@ class MPU(NMOS6502):
|
|||||||
def inst_0x80(self):
|
def inst_0x80(self):
|
||||||
self.BranchRelAddr()
|
self.BranchRelAddr()
|
||||||
|
|
||||||
|
@instruction(name="WAI", mode='imp', cycles=3)
|
||||||
|
def inst_0xCB(self):
|
||||||
|
self.waiting = True
|
||||||
|
|
||||||
@instruction(name="SBC", mode="zpi", cycles=5)
|
@instruction(name="SBC", mode="zpi", cycles=5)
|
||||||
def inst_0xf2(self):
|
def inst_0xf2(self):
|
||||||
self.opSBC(self.ZeroPageIndirectAddr)
|
self.opSBC(self.ZeroPageIndirectAddr)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user