Merge remote-tracking branch 'origin/reset' into reset_linux
This commit is contained in:
commit
cf6ddba626
4 changed files with 96 additions and 96 deletions
|
@ -4,6 +4,7 @@ extern HINSTANCE g_hInstance;
|
||||||
extern HWND g_hFrameWindow;
|
extern HWND g_hFrameWindow;
|
||||||
extern BOOL g_bConfirmReboot; // saved PageConfig REGSAVE
|
extern BOOL g_bConfirmReboot; // saved PageConfig REGSAVE
|
||||||
extern BOOL g_bMultiMon;
|
extern BOOL g_bMultiMon;
|
||||||
|
extern bool g_bFreshReset;
|
||||||
|
|
||||||
void FrameDrawDiskLEDS(HDC hdc);
|
void FrameDrawDiskLEDS(HDC hdc);
|
||||||
void FrameDrawDiskStatus(HDC hdc);
|
void FrameDrawDiskStatus(HDC hdc);
|
||||||
|
|
|
@ -42,12 +42,20 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
#include "SaveState.h"
|
#include "SaveState.h"
|
||||||
#include "SerialComms.h"
|
#include "SerialComms.h"
|
||||||
#include "Speaker.h"
|
#include "Speaker.h"
|
||||||
|
#include "Memory.h"
|
||||||
|
#include "Pravets.h"
|
||||||
|
#include "Keyboard.h"
|
||||||
#include "Mockingboard.h"
|
#include "Mockingboard.h"
|
||||||
#include "Interface.h"
|
#include "Interface.h"
|
||||||
|
#include "SoundCore.h"
|
||||||
|
|
||||||
#include "Configuration/IPropertySheet.h"
|
#include "Configuration/IPropertySheet.h"
|
||||||
#include "Tfe/Tfe.h"
|
#include "Tfe/Tfe.h"
|
||||||
|
|
||||||
|
#ifdef USE_SPEECH_API
|
||||||
|
#include "Speech.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
// Backwards compatibility with AppleWin <1.24.0
|
// Backwards compatibility with AppleWin <1.24.0
|
||||||
static void LoadConfigOldJoystick_v1(const UINT uJoyNum)
|
static void LoadConfigOldJoystick_v1(const UINT uJoyNum)
|
||||||
{
|
{
|
||||||
|
@ -501,3 +509,86 @@ void GetAppleWindowTitle()
|
||||||
case MODE_STEPPING: g_pAppTitle += std::string(TEXT(" [")) + TITLE_STEPPING + TEXT("]"); break;
|
case MODE_STEPPING: g_pAppTitle += std::string(TEXT(" [")) + TITLE_STEPPING + TEXT("]"); break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//===========================================================================
|
||||||
|
|
||||||
|
// CtrlReset() vs ResetMachineState():
|
||||||
|
// . CPU:
|
||||||
|
// Ctrl+Reset : 6502.sp=-3 / CpuReset()
|
||||||
|
// Power cycle: 6502.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()
|
||||||
|
{
|
||||||
|
GetCardMgr().GetDisk2CardMgr().Reset(true);
|
||||||
|
HD_Reset();
|
||||||
|
g_bFullSpeed = 0; // Might've hit reset in middle of InternalCpuExecute() - so beep may get (partially) muted
|
||||||
|
|
||||||
|
MemReset(); // calls CpuInitialize(), CNoSlotClock.Reset()
|
||||||
|
PravetsReset();
|
||||||
|
if (GetCardMgr().QuerySlot(SLOT6) == CT_Disk2)
|
||||||
|
dynamic_cast<Disk2InterfaceCard&>(GetCardMgr().GetRef(SLOT6)).Boot();
|
||||||
|
VideoResetState();
|
||||||
|
KeybReset();
|
||||||
|
if (GetCardMgr().IsSSCInstalled())
|
||||||
|
GetCardMgr().GetSSC()->CommReset();
|
||||||
|
PrintReset();
|
||||||
|
JoyReset();
|
||||||
|
MB_Reset();
|
||||||
|
SpkrReset();
|
||||||
|
if (GetCardMgr().IsMouseCardInstalled())
|
||||||
|
GetCardMgr().GetMouseCard()->Reset();
|
||||||
|
SetActiveCpu(GetMainCpu());
|
||||||
|
#ifdef USE_SPEECH_API
|
||||||
|
g_Speech.Reset();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
SoundCore_SetFade(FADE_NONE);
|
||||||
|
LogFileTimeUntilFirstKeyReadReset();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//===========================================================================
|
||||||
|
|
||||||
|
/*
|
||||||
|
* In comments, UTAII is an abbreviation for a reference to "Understanding the Apple II" by James Sather
|
||||||
|
*/
|
||||||
|
|
||||||
|
// todo: consolidate CtrlReset() and ResetMachineState()
|
||||||
|
void CtrlReset()
|
||||||
|
{
|
||||||
|
if (!IS_APPLE2)
|
||||||
|
{
|
||||||
|
// For A][ & A][+, reset doesn't reset the LC switches (UTAII:5-29)
|
||||||
|
MemResetPaging();
|
||||||
|
|
||||||
|
// For A][ & A][+, reset doesn't reset the video mode (UTAII:4-4)
|
||||||
|
VideoResetState(); // Switch Alternate char set off
|
||||||
|
}
|
||||||
|
|
||||||
|
if (IsAppleIIeOrAbove(GetApple2Type()) || IsCopamBase64A(GetApple2Type()))
|
||||||
|
{
|
||||||
|
// For A][ & A][+, reset doesn't reset the annunciators (UTAIIe:I-5)
|
||||||
|
// Base 64A: on RESET does reset to ROM page 0 (GH#807)
|
||||||
|
MemAnnunciatorReset();
|
||||||
|
}
|
||||||
|
|
||||||
|
PravetsReset();
|
||||||
|
GetCardMgr().GetDisk2CardMgr().Reset();
|
||||||
|
HD_Reset();
|
||||||
|
KeybReset();
|
||||||
|
if (GetCardMgr().IsSSCInstalled())
|
||||||
|
GetCardMgr().GetSSC()->CommReset();
|
||||||
|
MB_Reset();
|
||||||
|
if (GetCardMgr().IsMouseCardInstalled())
|
||||||
|
GetCardMgr().GetMouseCard()->Reset(); // Deassert any pending IRQs - GH#514
|
||||||
|
#ifdef USE_SPEECH_API
|
||||||
|
g_Speech.Reset();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
CpuReset();
|
||||||
|
g_bFreshReset = true;
|
||||||
|
}
|
||||||
|
|
|
@ -11,3 +11,6 @@ void InsertFloppyDisks(const UINT slot, LPSTR szImageName_drive[NUM_DRIVES], boo
|
||||||
void InsertHardDisks(LPSTR szImageName_harddisk[NUM_HARDDISKS], bool& bBoot);
|
void InsertHardDisks(LPSTR szImageName_harddisk[NUM_HARDDISKS], bool& bBoot);
|
||||||
void UnplugHardDiskControllerCard(void);
|
void UnplugHardDiskControllerCard(void);
|
||||||
void GetAppleWindowTitle();
|
void GetAppleWindowTitle();
|
||||||
|
|
||||||
|
void CtrlReset();
|
||||||
|
void ResetMachineState();
|
||||||
|
|
|
@ -30,11 +30,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
|
||||||
#include "Windows/WinFrame.h"
|
#include "Windows/WinFrame.h"
|
||||||
#include "Windows/AppleWin.h"
|
#include "Windows/AppleWin.h"
|
||||||
#include "CardManager.h"
|
|
||||||
#include "CPU.h"
|
|
||||||
#include "Disk.h"
|
|
||||||
#include "DiskImage.h"
|
|
||||||
#include "Harddisk.h"
|
|
||||||
#include "Keyboard.h"
|
#include "Keyboard.h"
|
||||||
#include "Log.h"
|
#include "Log.h"
|
||||||
#include "Memory.h"
|
#include "Memory.h"
|
||||||
|
@ -43,7 +38,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
#include "Windows/DirectInput.h"
|
#include "Windows/DirectInput.h"
|
||||||
#include "NTSC.h"
|
#include "NTSC.h"
|
||||||
#include "ParallelPrinter.h"
|
#include "ParallelPrinter.h"
|
||||||
#include "Pravets.h"
|
|
||||||
#include "Registry.h"
|
#include "Registry.h"
|
||||||
#include "SaveState.h"
|
#include "SaveState.h"
|
||||||
#include "SerialComms.h"
|
#include "SerialComms.h"
|
||||||
|
@ -51,11 +45,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
#include "Speaker.h"
|
#include "Speaker.h"
|
||||||
#include "Frame.h"
|
#include "Frame.h"
|
||||||
#include "Utilities.h"
|
#include "Utilities.h"
|
||||||
#ifdef USE_SPEECH_API
|
|
||||||
#include "Speech.h"
|
|
||||||
#endif
|
|
||||||
#include "Windows/WinVideo.h"
|
#include "Windows/WinVideo.h"
|
||||||
|
|
||||||
#include "../resource/resource.h"
|
#include "../resource/resource.h"
|
||||||
#include "Configuration/PropertySheet.h"
|
#include "Configuration/PropertySheet.h"
|
||||||
#include "Debugger/Debug.h"
|
#include "Debugger/Debug.h"
|
||||||
|
@ -146,11 +136,10 @@ static UINT g_uCount100msec = 0;
|
||||||
static bool g_bShowingCursor = true;
|
static bool g_bShowingCursor = true;
|
||||||
static bool g_bLastCursorInAppleViewport = false;
|
static bool g_bLastCursorInAppleViewport = false;
|
||||||
|
|
||||||
void DrawStatusArea (HDC passdc, BOOL drawflags);
|
static void DrawStatusArea (HDC passdc, int drawflags);
|
||||||
static void ProcessButtonClick (int button, bool bFromButtonUI=false);
|
static void ProcessButtonClick (int button, bool bFromButtonUI=false);
|
||||||
void ProcessDiskPopupMenu(HWND hwnd, POINT pt, const int iDrive);
|
void ProcessDiskPopupMenu(HWND hwnd, POINT pt, const int iDrive);
|
||||||
void RelayEvent (UINT message, WPARAM wparam, LPARAM lparam);
|
void RelayEvent (UINT message, WPARAM wparam, LPARAM lparam);
|
||||||
void ResetMachineState ();
|
|
||||||
void SetFullScreenMode ();
|
void SetFullScreenMode ();
|
||||||
void SetNormalMode ();
|
void SetNormalMode ();
|
||||||
static void SetUsingCursor(BOOL);
|
static void SetUsingCursor(BOOL);
|
||||||
|
@ -2231,90 +2220,6 @@ void RelayEvent (UINT message, WPARAM wparam, LPARAM lparam) {
|
||||||
SendMessage(tooltipwindow,TTM_RELAYEVENT,0,(LPARAM)&msg);
|
SendMessage(tooltipwindow,TTM_RELAYEVENT,0,(LPARAM)&msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
//===========================================================================
|
|
||||||
|
|
||||||
// CtrlReset() vs ResetMachineState():
|
|
||||||
// . CPU:
|
|
||||||
// Ctrl+Reset : 6502.sp=-3 / CpuReset()
|
|
||||||
// Power cycle: 6502.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 ()
|
|
||||||
{
|
|
||||||
GetCardMgr().GetDisk2CardMgr().Reset(true);
|
|
||||||
HD_Reset();
|
|
||||||
g_bFullSpeed = 0; // Might've hit reset in middle of InternalCpuExecute() - so beep may get (partially) muted
|
|
||||||
|
|
||||||
MemReset(); // calls CpuInitialize(), CNoSlotClock.Reset()
|
|
||||||
PravetsReset();
|
|
||||||
if (GetCardMgr().QuerySlot(SLOT6) == CT_Disk2)
|
|
||||||
dynamic_cast<Disk2InterfaceCard&>(GetCardMgr().GetRef(SLOT6)).Boot();
|
|
||||||
VideoResetState();
|
|
||||||
KeybReset();
|
|
||||||
if (GetCardMgr().IsSSCInstalled())
|
|
||||||
GetCardMgr().GetSSC()->CommReset();
|
|
||||||
PrintReset();
|
|
||||||
JoyReset();
|
|
||||||
MB_Reset();
|
|
||||||
SpkrReset();
|
|
||||||
if (GetCardMgr().IsMouseCardInstalled())
|
|
||||||
GetCardMgr().GetMouseCard()->Reset();
|
|
||||||
SetActiveCpu( GetMainCpu() );
|
|
||||||
#ifdef USE_SPEECH_API
|
|
||||||
g_Speech.Reset();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
SoundCore_SetFade(FADE_NONE);
|
|
||||||
LogFileTimeUntilFirstKeyReadReset();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//===========================================================================
|
|
||||||
|
|
||||||
/*
|
|
||||||
* In comments, UTAII is an abbreviation for a reference to "Understanding the Apple II" by James Sather
|
|
||||||
*/
|
|
||||||
|
|
||||||
// todo: consolidate CtrlReset() and ResetMachineState()
|
|
||||||
// Ctrl+Reset - TODO: This is a terrible place for this code! Should be in AppleWin.cpp
|
|
||||||
void CtrlReset()
|
|
||||||
{
|
|
||||||
if (!IS_APPLE2)
|
|
||||||
{
|
|
||||||
// For A][ & A][+, reset doesn't reset the LC switches (UTAII:5-29)
|
|
||||||
MemResetPaging();
|
|
||||||
|
|
||||||
// For A][ & A][+, reset doesn't reset the video mode (UTAII:4-4)
|
|
||||||
VideoResetState(); // Switch Alternate char set off
|
|
||||||
}
|
|
||||||
|
|
||||||
if (IsAppleIIeOrAbove(GetApple2Type()) || IsCopamBase64A(GetApple2Type()))
|
|
||||||
{
|
|
||||||
// For A][ & A][+, reset doesn't reset the annunciators (UTAIIe:I-5)
|
|
||||||
// Base 64A: on RESET does reset to ROM page 0 (GH#807)
|
|
||||||
MemAnnunciatorReset();
|
|
||||||
}
|
|
||||||
|
|
||||||
PravetsReset();
|
|
||||||
GetCardMgr().GetDisk2CardMgr().Reset();
|
|
||||||
HD_Reset();
|
|
||||||
KeybReset();
|
|
||||||
if (GetCardMgr().IsSSCInstalled())
|
|
||||||
GetCardMgr().GetSSC()->CommReset();
|
|
||||||
MB_Reset();
|
|
||||||
if (GetCardMgr().IsMouseCardInstalled())
|
|
||||||
GetCardMgr().GetMouseCard()->Reset(); // Deassert any pending IRQs - GH#514
|
|
||||||
#ifdef USE_SPEECH_API
|
|
||||||
g_Speech.Reset();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
CpuReset();
|
|
||||||
g_bFreshReset = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue