示例#1
0
文件: RTS.cs 项目: Dervall/LeetNES
        public int Execute(CpuState cpuState, IMemory memory)
        {
            var low = cpuState.PopStack(memory);
            var high = cpuState.PopStack(memory);

            cpuState.Pc = (ushort)((high << 8) | low);
            ++cpuState.Pc;
            return 6;
        }
示例#2
0
文件: RTI.cs 项目: Dervall/LeetNES
        public int Execute(CpuState cpuState, IMemory memory)
        {
            var breakSet = cpuState.IsFlagSet(CpuState.Flags.Break);
            cpuState.StatusRegister = cpuState.PopStack(memory);
            cpuState.SetFlag(CpuState.Flags.Break, breakSet);
            cpuState.StatusRegister |= 1 << 5;

            var low = cpuState.PopStack(memory);
            var high = cpuState.PopStack(memory);

            cpuState.Pc = (ushort)((high << 8) | low);

            return 6;
        }
示例#3
0
文件: PLA.cs 项目: Dervall/LeetNES
 protected override void InternalExecute(CpuState cpuState, IMemory memory, byte arg, Action<byte> write, ref int cycles)
 {
     cpuState.A = cpuState.PopStack(memory);
     cpuState.SetNegativeFlag(cpuState.A);
     cpuState.SetZeroFlag(cpuState.A);
     cycles = 4;
 }
示例#4
0
文件: PLP.cs 项目: Dervall/LeetNES
 protected override void InternalExecute(CpuState cpuState, IMemory memory, byte arg, Action<byte> write, ref int cycles)
 {
     var breakSet = cpuState.IsFlagSet(CpuState.Flags.Break);
     cpuState.StatusRegister = cpuState.PopStack(memory);
     cpuState.StatusRegister |= 1 << 5;
     cpuState.SetFlag(CpuState.Flags.Break, breakSet);
     cycles = 4;
 }