Beispiel #1
0
 /// <summary>
 /// Gets the state of the registers in Intel 8080 format.
 /// </summary>
 /// <exception cref="NotSupportedException">The implementation must have Intel 8080 style registers. I.e. not be a Z80.</exception>
 /// <returns></returns>
 public Intel8080RegisterState GetIntel8080RegisterState()
 =>
 new Intel8080RegisterState(GeneralPurposeRegisters.GetRegisterState(),
                            AccumulatorAndFlagsRegisters.GetRegisterState(),
                            StackPointer,
                            ProgramCounter,
                            InterruptFlipFlop1,
                            InterruptFlipFlop2,
                            InterruptMode);
Beispiel #2
0
        /// <summary>
        /// Resets the registers to the specified state.
        /// </summary>
        /// <typeparam name="TRegisterState">The type of the register state.</typeparam>
        /// <param name="state">The state.</param>
        public void ResetToState <TRegisterState>(TRegisterState state) where TRegisterState : Intel8080RegisterState
        {
            GeneralPurposeRegisters.ResetToState(state.GeneralPurposeRegisterState);
            AccumulatorAndFlagsRegisters.ResetToState(state.AccumulatorAndFlagsRegisterState);

            StackPointer   = state.StackPointer;
            ProgramCounter = state.ProgramCounter;

            InterruptFlipFlop1 = state.InterruptFlipFlop1;
            InterruptFlipFlop2 = state.InterruptFlipFlop2;
            InterruptMode      = state.InterruptMode;
        }
Beispiel #3
0
 /// <summary>
 /// Gets the state of the registers in Z80 format.
 /// Non-applicable state fields are filled with 0's.
 /// </summary>
 /// <returns></returns>
 public Z80RegisterState GetZ80RegisterState()
 =>
 new Z80RegisterState(GeneralPurposeRegisters.GetRegisterState(),
                      default(GeneralPurposeRegisterState),
                      AccumulatorAndFlagsRegisters.GetRegisterState(),
                      default(AccumulatorAndFlagsRegisterState),
                      false,
                      false,
                      0,
                      0,
                      0,
                      0,
                      StackPointer,
                      ProgramCounter,
                      InterruptFlipFlop1,
                      InterruptFlipFlop2,
                      InterruptMode);