MCPcopy Create free account
hub / github.com/AppleWin/AppleWin / ApplyConfigAfterClose

Method ApplyConfigAfterClose

source/Configuration/PageInput.cpp:192–221  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

190}
191
192void CPageInput::ApplyConfigAfterClose()
193{
194 HWND hWnd = GetFrame().g_hFrameWindow;
195
196 uint32_t newJoyType0 = m_PropertySheetHelper.GetConfigNew().m_joystickType[JN_JOYSTICK0];
197 if (newJoyType0 >= J0C_MAX) newJoyType0 = J0C_DISABLED; // GH#434
198 if (m_nJoy0ChoiceTranlationTbl[newJoyType0] < 0) newJoyType0 = J0C_DISABLED; // eg. was Mouse, then Mouse card inserted
199 if (JoySetEmulationType(hWnd, m_nJoy0ChoiceTranlationTbl[newJoyType0], JN_JOYSTICK0, IsMouseCardInAnySlot()))
200 REGSAVE(REGVALUE_JOYSTICK0_EMU_TYPE, JoyGetJoyType(JN_JOYSTICK0));
201
202 uint32_t newJoyType1 = m_PropertySheetHelper.GetConfigNew().m_joystickType[JN_JOYSTICK1];
203 if (newJoyType1 >= J1C_MAX) newJoyType1 = J1C_DISABLED; // GH#434
204 if (m_nJoy1ChoiceTranlationTbl[newJoyType1] < 0) newJoyType1 = J1C_DISABLED; // eg. was Mouse, then Mouse card inserted
205 if (JoySetEmulationType(hWnd, m_nJoy1ChoiceTranlationTbl[newJoyType1], JN_JOYSTICK1, IsMouseCardInAnySlot()))
206 REGSAVE(REGVALUE_JOYSTICK1_EMU_TYPE, JoyGetJoyType(JN_JOYSTICK1));
207
208 JoySetTrim(m_PropertySheetHelper.GetConfigNew().m_pdlXTrim, true);
209 JoySetTrim(m_PropertySheetHelper.GetConfigNew().m_pdlYTrim, false);
210 REGSAVE(REGVALUE_PDL_XTRIM, JoyGetTrim(true));
211 REGSAVE(REGVALUE_PDL_YTRIM, JoyGetTrim(false));
212
213 m_uCursorControl = m_PropertySheetHelper.GetConfigNew().m_cursorControl;
214 m_bmAutofire = m_PropertySheetHelper.GetConfigNew().m_autofire;
215 m_bSwapButtons0and1 = m_PropertySheetHelper.GetConfigNew().m_swapButtons0and1;
216 m_uCenteringControl = m_PropertySheetHelper.GetConfigNew().m_centeringControl;
217 REGSAVE(REGVALUE_AUTOFIRE, m_bmAutofire);
218 REGSAVE(REGVALUE_CENTERING_CONTROL, m_uCenteringControl);
219 REGSAVE(REGVALUE_CURSOR_CONTROL, m_uCursorControl);
220 REGSAVE(REGVALUE_SWAP_BUTTONS_0_AND_1, m_bSwapButtons0and1);
221}
222
223void CPageInput::InitJoystickChoices(HWND hWnd, const int joyNum)
224{

Callers 1

PostMsgAfterCloseMethod · 0.45

Calls 4

JoySetEmulationTypeFunction · 0.85
JoyGetJoyTypeFunction · 0.85
JoySetTrimFunction · 0.85
JoyGetTrimFunction · 0.85

Tested by

no test coverage detected