mirror of
https://github.com/AppleWin/AppleWin.git
synced 2025-08-15 18:27:29 +00:00
Mousecard: fix persisting card in slot-4 after a VM restart. (Fixes #993)
This commit is contained in:
@@ -137,9 +137,9 @@ void CardManager::RemoveInternal(UINT slot)
|
|||||||
m_slot[slot] = NULL;
|
m_slot[slot] = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CardManager::Remove(UINT slot)
|
void CardManager::Remove(UINT slot, bool updateRegistry/*=true*/)
|
||||||
{
|
{
|
||||||
Insert(slot, CT_Empty);
|
Insert(slot, CT_Empty, updateRegistry);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CardManager::InsertAuxInternal(SS_CARDTYPE type)
|
void CardManager::InsertAuxInternal(SS_CARDTYPE type)
|
||||||
|
@@ -29,7 +29,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Insert(UINT slot, SS_CARDTYPE type, bool updateRegistry = true);
|
void Insert(UINT slot, SS_CARDTYPE type, bool updateRegistry = true);
|
||||||
void Remove(UINT slot);
|
void Remove(UINT slot, bool updateRegistry = true);
|
||||||
SS_CARDTYPE QuerySlot(UINT slot) { _ASSERT(slot<NUM_SLOTS); return m_slot[slot]->QueryType(); }
|
SS_CARDTYPE QuerySlot(UINT slot) { _ASSERT(slot<NUM_SLOTS); return m_slot[slot]->QueryType(); }
|
||||||
Card& GetRef(UINT slot)
|
Card& GetRef(UINT slot)
|
||||||
{
|
{
|
||||||
|
@@ -292,7 +292,7 @@ void CPageInput::DlgOK(HWND hWnd)
|
|||||||
UINT uNewJoyType1 = SendDlgItemMessage(hWnd, IDC_JOYSTICK1, CB_GETCURSEL, 0, 0);
|
UINT uNewJoyType1 = SendDlgItemMessage(hWnd, IDC_JOYSTICK1, CB_GETCURSEL, 0, 0);
|
||||||
if (uNewJoyType1 >= J1C_MAX) uNewJoyType1 = 0; // GH#434
|
if (uNewJoyType1 >= J1C_MAX) uNewJoyType1 = 0; // GH#434
|
||||||
|
|
||||||
const bool bIsSlot4Mouse = m_PropertySheetHelper.GetConfigNew().m_Slot[4] == CT_MouseInterface;
|
const bool bIsSlot4Mouse = m_PropertySheetHelper.GetConfigNew().m_Slot[SLOT4] == CT_MouseInterface;
|
||||||
|
|
||||||
if (JoySetEmulationType(hWnd, m_nJoy0ChoiceTranlationTbl[uNewJoyType0], JN_JOYSTICK0, bIsSlot4Mouse))
|
if (JoySetEmulationType(hWnd, m_nJoy0ChoiceTranlationTbl[uNewJoyType0], JN_JOYSTICK0, bIsSlot4Mouse))
|
||||||
{
|
{
|
||||||
@@ -381,7 +381,7 @@ void CPageInput::InitJoystickChoices(HWND hWnd, int nJoyNum, int nIdcValue)
|
|||||||
pszMem += strlen(ppszJoyChoices[nJC_JOYSTICK])+1;
|
pszMem += strlen(ppszJoyChoices[nJC_JOYSTICK])+1;
|
||||||
pnJoyTranslationTbl[nIdx++] = nJC_JOYSTICK;
|
pnJoyTranslationTbl[nIdx++] = nJC_JOYSTICK;
|
||||||
|
|
||||||
const bool bIsSlot4Mouse = m_PropertySheetHelper.GetConfigNew().m_Slot[4] == CT_MouseInterface;
|
const bool bIsSlot4Mouse = m_PropertySheetHelper.GetConfigNew().m_Slot[SLOT4] == CT_MouseInterface;
|
||||||
|
|
||||||
// Now exclude:
|
// Now exclude:
|
||||||
// . the other Joystick type (if it exists) from this new list
|
// . the other Joystick type (if it exists) from this new list
|
||||||
|
@@ -552,7 +552,7 @@ int APIENTRY WinMain(HINSTANCE passinstance, HINSTANCE, LPSTR lpCmdLine, int)
|
|||||||
if (pMouseCard)
|
if (pMouseCard)
|
||||||
{
|
{
|
||||||
// dtor removes event from g_SynchronousEventMgr - do before g_SynchronousEventMgr.Reset()
|
// dtor removes event from g_SynchronousEventMgr - do before g_SynchronousEventMgr.Reset()
|
||||||
GetCardMgr().Remove( pMouseCard->GetSlot() );
|
GetCardMgr().Remove( pMouseCard->GetSlot(), false );
|
||||||
LogFileOutput("Main: CMouseInterface::dtor\n");
|
LogFileOutput("Main: CMouseInterface::dtor\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user