Debugger: F2 or Ctrl+F2 whilst debugger will immediately stop the drive spinning (allowing disk swap) (fixed #460)
This commit is contained in:
parent
dd510801fc
commit
8fce7a8753
3 changed files with 15 additions and 5 deletions
|
@ -811,12 +811,12 @@ static void __stdcall DiskReadWrite(WORD pc, WORD addr, BYTE bWrite, BYTE d, ULO
|
||||||
// https://github.com/AppleWin/AppleWin/issues/201
|
// https://github.com/AppleWin/AppleWin/issues/201
|
||||||
// NB. Prevent flooding of forcing UI to redraw!!!
|
// NB. Prevent flooding of forcing UI to redraw!!!
|
||||||
if( ((fptr->byte) & 0xFF) == 0 )
|
if( ((fptr->byte) & 0xFF) == 0 )
|
||||||
FrameDrawDiskStatus( (HDC)0 );
|
FrameDrawDiskStatus( (HDC)0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
|
|
||||||
void DiskReset(void)
|
void DiskReset(const bool bIsPowerCycle/*=false*/)
|
||||||
{
|
{
|
||||||
// RESET forces all switches off (UTAIIe Table 9.1)
|
// RESET forces all switches off (UTAIIe Table 9.1)
|
||||||
currdrive = 0;
|
currdrive = 0;
|
||||||
|
@ -824,6 +824,16 @@ void DiskReset(void)
|
||||||
floppyloadmode = 0;
|
floppyloadmode = 0;
|
||||||
floppywritemode = 0;
|
floppywritemode = 0;
|
||||||
phases = 0;
|
phases = 0;
|
||||||
|
|
||||||
|
if (bIsPowerCycle) // GH#460 - Ctrl+Reset whilst debugging acts like a power-cycle
|
||||||
|
{
|
||||||
|
g_aFloppyDisk[DRIVE_1].spinning = 0;
|
||||||
|
g_aFloppyDisk[DRIVE_1].writelight = 0;
|
||||||
|
g_aFloppyDisk[DRIVE_2].spinning = 0;
|
||||||
|
g_aFloppyDisk[DRIVE_2].writelight = 0;
|
||||||
|
|
||||||
|
FrameRefreshStatus(DRAW_LEDS,false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
|
|
|
@ -57,7 +57,7 @@ void DiskGetLightStatus (Disk_Status_e *pDisk1Status_, Disk_Status_e *pDisk2S
|
||||||
ImageError_e DiskInsert(const int iDrive, LPCTSTR pszImageFilename, const bool bForceWriteProtected, const bool bCreateIfNecessary);
|
ImageError_e DiskInsert(const int iDrive, LPCTSTR pszImageFilename, const bool bForceWriteProtected, const bool bCreateIfNecessary);
|
||||||
BOOL DiskIsSpinning(void);
|
BOOL DiskIsSpinning(void);
|
||||||
void DiskNotifyInvalidImage(const int iDrive, LPCTSTR pszImageFilename, const ImageError_e Error);
|
void DiskNotifyInvalidImage(const int iDrive, LPCTSTR pszImageFilename, const ImageError_e Error);
|
||||||
void DiskReset(void);
|
void DiskReset(const bool bIsPowerCycle=false);
|
||||||
bool DiskGetProtect(const int iDrive);
|
bool DiskGetProtect(const int iDrive);
|
||||||
void DiskSetProtect(const int iDrive, const bool bWriteProtect);
|
void DiskSetProtect(const int iDrive, const bool bWriteProtect);
|
||||||
int DiskGetCurrentDrive();
|
int DiskGetCurrentDrive();
|
||||||
|
|
|
@ -2036,7 +2036,7 @@ void RelayEvent (UINT message, WPARAM wparam, LPARAM lparam) {
|
||||||
// todo: consolidate CtrlReset() and ResetMachineState()
|
// todo: consolidate CtrlReset() and ResetMachineState()
|
||||||
void ResetMachineState ()
|
void ResetMachineState ()
|
||||||
{
|
{
|
||||||
DiskReset(); // Set floppymotoron=0
|
DiskReset(true); // Set floppymotoron=0
|
||||||
g_bFullSpeed = 0; // Might've hit reset in middle of InternalCpuExecute() - so beep may get (partially) muted
|
g_bFullSpeed = 0; // Might've hit reset in middle of InternalCpuExecute() - so beep may get (partially) muted
|
||||||
|
|
||||||
MemReset();
|
MemReset();
|
||||||
|
@ -2069,7 +2069,7 @@ void CtrlReset()
|
||||||
MemResetPaging();
|
MemResetPaging();
|
||||||
|
|
||||||
PravetsReset();
|
PravetsReset();
|
||||||
DiskReset();
|
DiskReset(g_nAppMode == MODE_DEBUG); // For MODE_DEBUG act like a power-cycle (GH#460)
|
||||||
KeybReset();
|
KeybReset();
|
||||||
if (!IS_APPLE2) // TODO: Why not for A][ & A][+ too?
|
if (!IS_APPLE2) // TODO: Why not for A][ & A][+ too?
|
||||||
VideoResetState(); // Switch Alternate char set off
|
VideoResetState(); // Switch Alternate char set off
|
||||||
|
|
Loading…
Add table
Reference in a new issue