2012-03-27 21:20:36 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "IPropertySheetPage.h"
|
|
|
|
#include "PropertySheetDefs.h"
|
2018-02-24 15:12:40 +00:00
|
|
|
#include "../Joystick.h"
|
2012-03-27 21:20:36 +00:00
|
|
|
class CPropertySheetHelper;
|
2012-05-06 22:14:03 +00:00
|
|
|
class CConfigNeedingRestart;
|
2012-03-27 21:20:36 +00:00
|
|
|
|
2012-05-06 22:14:03 +00:00
|
|
|
class CPageInput : private IPropertySheetPage
|
2012-03-27 21:20:36 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
CPageInput(CPropertySheetHelper& PropertySheetHelper) :
|
|
|
|
m_Page(PG_INPUT),
|
|
|
|
m_PropertySheetHelper(PropertySheetHelper),
|
|
|
|
m_uScrollLockToggle(0),
|
2013-12-06 21:10:41 +00:00
|
|
|
m_uCursorControl(1),
|
2013-12-31 22:40:10 +00:00
|
|
|
m_uCenteringControl(JOYSTICK_MODE_CENTERING),
|
2013-12-06 21:10:41 +00:00
|
|
|
m_bmAutofire(0),
|
2020-01-18 19:06:06 +00:00
|
|
|
m_bSwapButtons0and1(false),
|
2012-03-27 21:20:36 +00:00
|
|
|
m_uMouseShowCrosshair(0),
|
|
|
|
m_uMouseRestrictToWindow(0),
|
2021-09-10 13:57:55 +01:00
|
|
|
m_CPMChoice(CPM_UNPLUGGED),
|
|
|
|
m_FourPlayChoice(FOURPLAY_UNPLUGGED),
|
|
|
|
m_SNESMAXChoice(SNESMAX_UNPLUGGED)
|
2012-03-27 21:20:36 +00:00
|
|
|
{
|
|
|
|
CPageInput::ms_this = this;
|
|
|
|
}
|
|
|
|
virtual ~CPageInput(){}
|
|
|
|
|
2021-01-01 23:57:40 +11:00
|
|
|
static INT_PTR CALLBACK DlgProc(HWND window, UINT message, WPARAM wparam, LPARAM lparam);
|
2012-03-27 21:20:36 +00:00
|
|
|
|
|
|
|
UINT GetScrollLockToggle(void){ return m_uScrollLockToggle; }
|
|
|
|
void SetScrollLockToggle(UINT uValue){ m_uScrollLockToggle = uValue; }
|
2013-12-31 22:40:10 +00:00
|
|
|
UINT GetJoystickCursorControl(void){ return m_uCursorControl; }
|
|
|
|
void SetJoystickCursorControl(UINT uValue){ m_uCursorControl = uValue; }
|
|
|
|
UINT GetJoystickCenteringControl(void){ return m_uCenteringControl; }
|
|
|
|
void SetJoystickCenteringControl(UINT uValue){ m_uCenteringControl = uValue; }
|
2013-12-06 21:10:41 +00:00
|
|
|
UINT GetAutofire(UINT uButton) { return (m_bmAutofire >> uButton) & 1; } // Get a specific button
|
|
|
|
void SetAutofire(UINT uValue) { m_bmAutofire = uValue; } // Set all buttons
|
2020-01-18 19:06:06 +00:00
|
|
|
bool GetButtonsSwapState(void){ return m_bSwapButtons0and1; }
|
|
|
|
void SetButtonsSwapState(bool value){ m_bSwapButtons0and1 = value; }
|
2012-03-27 21:20:36 +00:00
|
|
|
UINT GetMouseShowCrosshair(void){ return m_uMouseShowCrosshair; }
|
|
|
|
void SetMouseShowCrosshair(UINT uValue){ m_uMouseShowCrosshair = uValue; }
|
|
|
|
UINT GetMouseRestrictToWindow(void){ return m_uMouseRestrictToWindow; }
|
|
|
|
void SetMouseRestrictToWindow(UINT uValue){ m_uMouseRestrictToWindow = uValue; }
|
|
|
|
|
|
|
|
protected:
|
|
|
|
// IPropertySheetPage
|
2021-01-01 23:57:40 +11:00
|
|
|
virtual INT_PTR DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, LPARAM lparam);
|
2012-05-06 22:14:03 +00:00
|
|
|
virtual void DlgOK(HWND hWnd);
|
|
|
|
virtual void DlgCANCEL(HWND hWnd){}
|
2012-03-27 21:20:36 +00:00
|
|
|
|
|
|
|
private:
|
2012-05-06 22:14:03 +00:00
|
|
|
void InitOptions(HWND hWnd);
|
|
|
|
void InitJoystickChoices(HWND hWnd, int nJoyNum, int nIdcValue);
|
|
|
|
void InitSlotOptions(HWND hWnd);
|
|
|
|
void InitCPMChoices(HWND hWnd);
|
2021-09-10 13:57:55 +01:00
|
|
|
void InitFourPlayChoices(HWND hWnd);
|
|
|
|
void InitSNESMAXChoices(HWND hWnd);
|
2012-03-27 21:20:36 +00:00
|
|
|
|
|
|
|
static CPageInput* ms_this;
|
|
|
|
static const UINT MaxMenuChoiceLen = 40;
|
|
|
|
|
|
|
|
static const TCHAR m_szJoyChoice0[];
|
|
|
|
static const TCHAR m_szJoyChoice1[];
|
|
|
|
static const TCHAR m_szJoyChoice2[];
|
|
|
|
static const TCHAR m_szJoyChoice3[];
|
|
|
|
static const TCHAR m_szJoyChoice4[];
|
|
|
|
static const TCHAR m_szJoyChoice5[];
|
2017-06-07 10:14:25 +12:00
|
|
|
static const TCHAR m_szJoyChoice6[];
|
2012-03-27 21:20:36 +00:00
|
|
|
static const TCHAR* const m_pszJoy0Choices[J0C_MAX];
|
|
|
|
static const TCHAR* const m_pszJoy1Choices[J1C_MAX];
|
|
|
|
|
|
|
|
static const TCHAR m_szCPMSlotChoice_Slot4[];
|
|
|
|
static const TCHAR m_szCPMSlotChoice_Slot5[];
|
|
|
|
static const TCHAR m_szCPMSlotChoice_Unplugged[];
|
|
|
|
static const TCHAR m_szCPMSlotChoice_Unavailable[];
|
|
|
|
|
2021-09-10 13:57:55 +01:00
|
|
|
static const TCHAR m_szFourPlaySlotChoice_Slot3[];
|
|
|
|
static const TCHAR m_szFourPlaySlotChoice_Slot4[];
|
|
|
|
static const TCHAR m_szFourPlaySlotChoice_Slot5[];
|
|
|
|
static const TCHAR m_szFourPlaySlotChoice_Unplugged[];
|
|
|
|
static const TCHAR m_szFourPlaySlotChoice_Unavailable[];
|
|
|
|
|
|
|
|
static const TCHAR m_szSNESMAXSlotChoice_Slot3[];
|
|
|
|
static const TCHAR m_szSNESMAXSlotChoice_Slot4[];
|
|
|
|
static const TCHAR m_szSNESMAXSlotChoice_Slot5[];
|
|
|
|
static const TCHAR m_szSNESMAXSlotChoice_Unplugged[];
|
|
|
|
static const TCHAR m_szSNESMAXSlotChoice_Unavailable[];
|
|
|
|
|
2012-03-27 21:20:36 +00:00
|
|
|
int m_nJoy0ChoiceTranlationTbl[J0C_MAX];
|
|
|
|
TCHAR m_joystick0choices[J0C_MAX * MaxMenuChoiceLen];
|
|
|
|
int m_nJoy1ChoiceTranlationTbl[J1C_MAX];
|
|
|
|
TCHAR m_joystick1choices[J1C_MAX * MaxMenuChoiceLen];
|
|
|
|
|
|
|
|
const PAGETYPE m_Page;
|
|
|
|
CPropertySheetHelper& m_PropertySheetHelper;
|
|
|
|
|
|
|
|
UINT m_uScrollLockToggle;
|
2013-12-31 22:40:10 +00:00
|
|
|
UINT m_uCursorControl; // 1 = Allow AppleII to read cursor keys from $C000 (when using keyboard for joystick emu)
|
|
|
|
UINT m_uCenteringControl; // 1 = Centering, 0=Floating (when using keyboard for joystick emu)
|
2013-12-06 21:10:41 +00:00
|
|
|
UINT m_bmAutofire; // bitmask b2:0
|
2020-01-18 19:06:06 +00:00
|
|
|
bool m_bSwapButtons0and1;
|
2012-03-27 21:20:36 +00:00
|
|
|
UINT m_uMouseShowCrosshair;
|
|
|
|
UINT m_uMouseRestrictToWindow;
|
|
|
|
|
|
|
|
enum CPMCHOICE {CPM_SLOT4=0, CPM_SLOT5, CPM_UNPLUGGED, CPM_UNAVAILABLE, _CPM_MAX_CHOICES};
|
|
|
|
TCHAR m_szCPMSlotChoices[_CPM_MAX_CHOICES * MaxMenuChoiceLen];
|
|
|
|
CPMCHOICE m_CPMChoice;
|
|
|
|
CPMCHOICE m_CPMComboItemToChoice[_CPM_MAX_CHOICES];
|
2021-09-10 13:57:55 +01:00
|
|
|
|
|
|
|
enum FOURPLAYCHOICE {FOURPLAY_SLOT3=0, FOURPLAY_SLOT4, FOURPLAY_SLOT5, FOURPLAY_UNPLUGGED, FOURPLAY_UNAVAILABLE, _FOURPLAY_MAX_CHOICES};
|
|
|
|
TCHAR m_szFourPlaySlotChoices[_FOURPLAY_MAX_CHOICES * MaxMenuChoiceLen];
|
|
|
|
FOURPLAYCHOICE m_FourPlayChoice;
|
|
|
|
FOURPLAYCHOICE m_FourPlayComboItemToChoice[_FOURPLAY_MAX_CHOICES];
|
|
|
|
|
|
|
|
enum SNESMAXCHOICE {SNESMAX_SLOT3=0, SNESMAX_SLOT4, SNESMAX_SLOT5, SNESMAX_UNPLUGGED, SNESMAX_UNAVAILABLE, _SNESMAX_MAX_CHOICES};
|
|
|
|
TCHAR m_szSNESMAXSlotChoices[_SNESMAX_MAX_CHOICES * MaxMenuChoiceLen];
|
|
|
|
SNESMAXCHOICE m_SNESMAXChoice;
|
|
|
|
SNESMAXCHOICE m_SNESMAXComboItemToChoice[_SNESMAX_MAX_CHOICES];
|
2012-03-27 21:20:36 +00:00
|
|
|
};
|