/// <summary> /// This method recreates the .vmstate file for a Spectrum +3 virtual machine /// in Spectrum +3 startup mode /// </summary> /// <param name="controller">Virtual machine controller</param> /// <returns>True, if preparation successful; otherwise, true</returns> private async Task <bool> CreateSpectrumP3StartupP3State(ISpectrumVmController controller) { // --- Wait while the main menu appears controller.SetDebugMode(false); controller.Start(new ExecuteCycleOptions(EmulationMode.UntilExecutionPoint, terminationRom: 0, terminationPoint: SPP3_MAIN_WAITING_LOOP, fastTapeMode: true, fastVmMode: true)); if (!await WaitForTerminationPoint()) { return(false); } controller.Start(new ExecuteCycleOptions(EmulationMode.UntilExecutionPoint, terminationRom: 0, terminationPoint: SPP3_RETURN_TO_EDITOR, fastTapeMode: true, fastVmMode: true)); // --- Move to Spectrum +3 mode QueueKeyStroke(SpectrumKeyCode.N6, SpectrumKeyCode.CShift); await Task.Delay(WAIT_FOR_MENU_KEY); QueueKeyStroke(SpectrumKeyCode.Enter); return(await WaitForTerminationPoint()); }
/// <summary> /// This method recreates the .vmstate file for a Spectrum 48 virtual machine startup /// </summary> /// <param name="controller">Virtual machine controller</param> /// <returns>True, if preparation successful; otherwise, true</returns> private async Task <bool> CreateSpectrum48StartupState(ISpectrumVmController controller) { controller.SetDebugMode(false); controller.Start(new ExecuteCycleOptions(EmulationMode.UntilExecutionPoint, terminationRom: 0, terminationPoint: SP48_MAIN_EXEC_ADDR, fastTapeMode: true, fastVmMode: true)); return(await WaitForTerminationPoint()); }