示例#1
0
            public static void SetPCToAddressLatchAndFetchInstruction(Cpu cpu, IBus bus)
            {
                cpu.CpuState.PC = (ushort)(cpu.AddressLatchLow | (cpu.AddressLatchHigh << 8));

                var instruction = bus.Read(cpu.CpuState.PC);

                cpu.ExecuteInstruction(instruction);
            }
示例#2
0
 public static void FetchInstruction(Cpu cpu, IBus bus)
 {
     if (cpu._nmi && cpu._nmiCycle != cpu._totalCycles - 1)
     {
         cpu.CheckForNmi();
     }
     else
     {
         var instruction = bus.Read(cpu.CpuState.PC);
         cpu.ExecuteInstruction(instruction);
     }
 }