public void RunOneInstruction()
{
try {
ushort word = ReadMemInt16(PC, SegmentIndex.CS);
PC += 2;
// Check for hardware interrupt:
if (PS_H && !PS_Q && BUS.IsIRQ)
Interrupt_HWI();
// Check for RTC interrupt:
if (m_RTC.IsEnabled && m_RTC.IRQ(Cycles))
Interrupt_Clock();
// Execute Memory[PC]
YCPUInstruction opcode = m_Opcodes[word & 0x00FF];
opcode.Opcode(word);
// Increment the Cycle counter.
Cycles += opcode.Cycles;
}
catch (SegFaultException e) {
Interrupt_SegFault(e.SegmentType, 0xffff, PC);
}
}