// Reset CPU control section and instruction decoder internal state
        private void ResetCPUControlState()
        {
            // Z80CPU.cs internal state
            tStateCounter = 0;
            machineCycleCounter = 0;
            instructionCounter = 0;
            instructionOrigin = null;
            currentInstruction = null;
            executeInstruction = null;
            halfTStateIndex = 0;
            machineCycleIndex = 0;
            machineCycleCountAfterInstruction = 0;
            currentMachineCycle = null;
            executeMachineCycle = null;

            // Z80CPU_Instruction_Decoder.cs internal state
            opcodeTableIndex = 0;

            // Z80CPU_ExternalControl.cs internal state
            busRequestPending = false;
            maskableInterruptPending = false;
            nonMaskableInterruptPending = false;
        }
        private void StartMachineCycle(MachineCycle machineCycle)
        {
            machineCycleCounter++;

            currentMachineCycle = machineCycle;
            DecodeMachineCycleExecutionMethod();
        }
 private void EndMachineCycle()
 {
     currentMachineCycle = null;
     executeMachineCycle = null;
 }