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); }
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); } }