Exemple #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)
Exemple #2
0
def abx(cpu, arg1, arg2):
    return memory.read(ABX(cpu,arg1,arg2))
Exemple #3
0
def aby(cpu, arg1, arg2):
    return memory.read(ABY(cpu,arg1,arg2))
Exemple #4
0
def zpy(cpu, arg1, arg2):
    return memory.read(ZPY(cpu,arg1,arg2))
Exemple #5
0
def abt(cpu, arg1, arg2):
    return memory.read(ABS(cpu,arg1,arg2))
Exemple #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
Exemple #7
0
def RLA(cpu, value):
    ROL(cpu, value)
    AND(cpu, memory.read(value))
Exemple #8
0
def BRK(cpu, value):
    vector = memory.read(VECTOR_BRK) + memory.read(VECTOR_BRK+1)<<8
    processInterrupt(cpu,vector)
Exemple #9
0
def condRead(cpu, addr):
    if addr is -1:
        return cpu.A
    return memory.read(addr)
Exemple #10
0
def DCP(cpu, value):
    modMemory(cpu, value, -1)
    compareWithRegister(cpu, memory.read(value), cpu.A)
Exemple #11
0
def ISB(cpu, value):
    INC(cpu, value)
    SBC(cpu, memory.read(value))
Exemple #12
0
def modMemory(cpu, address, dVal):
    value = memory.read(address)
    value += dVal
    memory.write(address, value)
    cpu.setNZ(value)
Exemple #13
0
def popFromStack(cpu):
    cpu.S += 1
    return memory.read(0x100 | (cpu.S & 0xFF))
Exemple #14
0
def SRE(cpu, value):
    LSR(cpu, value)
    EOR(cpu, memory.read(value))
Exemple #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
Exemple #16
0
def zp(cpu, arg1, arg2):
    return memory.read(arg1)
Exemple #17
0
def inx(cpu, arg1, arg2):
    return memory.read(INX(cpu,arg1,arg2))
Exemple #18
0
def zpx(cpu, arg1, arg2):
    return memory.read(ZPX(cpu,arg1,arg2))
Exemple #19
0
def iny(cpu, arg1, arg2):
    return memory.read(INY(cpu,arg1,arg2))
Exemple #20
0
def SLO(cpu, value):
    ASL(cpu, value)
    ORA(cpu, memory.read(value))