From 9e7318e7ed009bfc9087436a4eea28df520cc2fd Mon Sep 17 00:00:00 2001 From: tomcw Date: Sat, 12 Aug 2017 11:50:31 +0100 Subject: [PATCH] Debugger: revert behaviour from 8fce7a8 so that Ctrl+F2 doesn't immediately stop the drive spinning, but F2 still does (#460) --- source/Disk.cpp | 2 +- source/Frame.cpp | 14 +++++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/source/Disk.cpp b/source/Disk.cpp index 71eb4e81..1539167c 100644 --- a/source/Disk.cpp +++ b/source/Disk.cpp @@ -828,7 +828,7 @@ void DiskReset(const bool bIsPowerCycle/*=false*/) floppywritemode = 0; phases = 0; - if (bIsPowerCycle) // GH#460 - Ctrl+Reset whilst debugging acts like a power-cycle + if (bIsPowerCycle) // GH#460 { g_aFloppyDisk[DRIVE_1].spinning = 0; g_aFloppyDisk[DRIVE_1].writelight = 0; diff --git a/source/Frame.cpp b/source/Frame.cpp index 807bbc54..d3f04f4d 100644 --- a/source/Frame.cpp +++ b/source/Frame.cpp @@ -2033,13 +2033,21 @@ void RelayEvent (UINT message, WPARAM wparam, LPARAM lparam) { //=========================================================================== +// CtrlReset() vs ResetMachineState(): +// . CPU: +// Ctrl+Reset : sp=-3 / CpuReset() +// Power cycle: sp=0x1ff / CpuInitialize() +// . Disk][: +// Ctrl+Reset : if motor-on, then motor-off but continue to spin for 1s +// Power cycle: motor-off & immediately stop spinning + // todo: consolidate CtrlReset() and ResetMachineState() void ResetMachineState () { - DiskReset(true); // Set floppymotoron=0 + DiskReset(true); g_bFullSpeed = 0; // Might've hit reset in middle of InternalCpuExecute() - so beep may get (partially) muted - MemReset(); + MemReset(); // calls CpuInitialize() PravetsReset(); DiskBoot(); VideoResetState(); @@ -2069,7 +2077,7 @@ void CtrlReset() MemResetPaging(); PravetsReset(); - DiskReset(g_nAppMode == MODE_DEBUG); // For MODE_DEBUG act like a power-cycle (GH#460) + DiskReset(); KeybReset(); if (!IS_APPLE2) // TODO: Why not for A][ & A][+ too? VideoResetState(); // Switch Alternate char set off