Esempio n. 1
0
def ind(cpu, arg1, arg2):
    int addrLSB = arg1 + (arg2 << 8)
    int addrMSB = ((arg1 + 1) & 0xFF) + (arg2 << 8)
    cpu.PC += 3
    return memory.read(addrLSB) + (memory.read(addrMSB) << 8)
Esempio n. 2
0
def abx(cpu, arg1, arg2):
    return memory.read(ABX(cpu,arg1,arg2))
Esempio n. 3
0
def aby(cpu, arg1, arg2):
    return memory.read(ABY(cpu,arg1,arg2))
Esempio n. 4
0
def zpy(cpu, arg1, arg2):
    return memory.read(ZPY(cpu,arg1,arg2))
Esempio n. 5
0
def abt(cpu, arg1, arg2):
    return memory.read(ABS(cpu,arg1,arg2))
Esempio n. 6
0
def INY(cpu, arg1, arg2):
    indirectAddress = memory.read(arg1) + (memory.read((arg1 + 1) & 0xFF) << 8)
    cpu.cycles += pageBoundaryCycles(indirectAddress, cpu.Y)
    cpu.PC += 2
    return (indirectAddress + cpu.Y) & 0xFFFF
Esempio n. 7
0
def RLA(cpu, value):
    ROL(cpu, value)
    AND(cpu, memory.read(value))
Esempio n. 8
0
def BRK(cpu, value):
    vector = memory.read(VECTOR_BRK) + memory.read(VECTOR_BRK+1)<<8
    processInterrupt(cpu,vector)
Esempio n. 9
0
def condRead(cpu, addr):
    if addr is -1:
        return cpu.A
    return memory.read(addr)
Esempio n. 10
0
def DCP(cpu, value):
    modMemory(cpu, value, -1)
    compareWithRegister(cpu, memory.read(value), cpu.A)
Esempio n. 11
0
def ISB(cpu, value):
    INC(cpu, value)
    SBC(cpu, memory.read(value))
Esempio n. 12
0
def modMemory(cpu, address, dVal):
    value = memory.read(address)
    value += dVal
    memory.write(address, value)
    cpu.setNZ(value)
Esempio n. 13
0
def popFromStack(cpu):
    cpu.S += 1
    return memory.read(0x100 | (cpu.S & 0xFF))
Esempio n. 14
0
def SRE(cpu, value):
    LSR(cpu, value)
    EOR(cpu, memory.read(value))
Esempio n. 15
0
def INX(cpu, arg1, arg2):
    zpAddr = (arg1 + cpu.X) & 0xFF
    indirectAddress = memory.read(zpAddress) + (memory.read((zpAddress + 1) & 0xFF) << 8)
    cpu.PC += 2
    return indirectAddress
Esempio n. 16
0
def zp(cpu, arg1, arg2):
    return memory.read(arg1)
Esempio n. 17
0
def inx(cpu, arg1, arg2):
    return memory.read(INX(cpu,arg1,arg2))
Esempio n. 18
0
def zpx(cpu, arg1, arg2):
    return memory.read(ZPX(cpu,arg1,arg2))
Esempio n. 19
0
def iny(cpu, arg1, arg2):
    return memory.read(INY(cpu,arg1,arg2))
Esempio n. 20
0
def SLO(cpu, value):
    ASL(cpu, value)
    ORA(cpu, memory.read(value))