LilyPad: in PS2 mode - disable configs/hacks which PCSX2 doesn't need

Disable and overrides the following hacks at the config and dialog:
- Disable screensaver
- Safe fullscreen exit on escape
- save state in title

All of those are hacks which PCSX2 doesn't need anymore and therefore are just
confusing if enabled.

Note that we assume PCSX2 is synonym for PS2 mode in LilyPad, and while AFAIK it
is the case now, it might need a more fine grained override system.
This commit is contained in:
Avi Halachmi (:avih) 2015-10-07 01:22:47 +03:00
parent fa04f0970e
commit 7d6a73ab27
2 changed files with 38 additions and 4 deletions

View File

@ -30,6 +30,25 @@
// Needed to know if raw input is available. It requires XP or higher.
#include "RawInput.h"
// Hacks or configurations which PCSX2 needs with a specific value
void PCSX2_overrideConfig(GeneralConfig& config_in_out) {
config_in_out.disableScreenSaver = 0; // Not required - handled internally by PCSX2
config_in_out.escapeFullscreenHack = 0; // Not required - handled internally by PCSX2
config_in_out.saveStateTitle = 0; // Not required - handled internally by PCSX2
}
// Dialog widgets which should be disabled - mostly matching PCSX2_overrideConfig
const UINT* PCSX2_disabledWidgets() {
static const UINT disabledWidgets[] = {
IDC_DISABLE_SCREENSAVER,
IDC_ESCAPE_FULLSCREEN_HACK,
IDC_SAVE_STATE_TITLE,
IDC_ANALOG_START1, // start in analog mode - only useful for PS1
0
};
return disabledWidgets;
}
GeneralConfig config;
// 1 if running inside a PS2 emulator. Set to 1 on any
@ -71,11 +90,11 @@ const GeneralSettingsBool BoolOptionsInfo[] = {
{L"Multitap 1", IDC_MULTITAP1, 0},
{L"Multitap 2", IDC_MULTITAP2, 0},
{L"Escape Fullscreen Hack", IDC_ESCAPE_FULLSCREEN_HACK, 1},
{L"Disable Screen Saver", IDC_DISABLE_SCREENSAVER, 1},
{L"Escape Fullscreen Hack", IDC_ESCAPE_FULLSCREEN_HACK, 1}, // Not required for PCSX2
{L"Disable Screen Saver", IDC_DISABLE_SCREENSAVER, 1}, // Not required for PCSX2
{L"Logging", IDC_DEBUG_FILE, 0},
{L"Save State in Title", IDC_SAVE_STATE_TITLE, 0}, //No longer required, PCSX2 now handles it - avih 2011-05-17
{L"Save State in Title", IDC_SAVE_STATE_TITLE, 0}, // Not required for PCSX2
{L"GH2", IDC_GH2_HACK, 0},
{L"Turbo Key Hack", IDC_TURBO_KEY_HACK, 0},
@ -1027,6 +1046,9 @@ int LoadSettings(int force, wchar_t *file) {
RefreshEnabledDevicesAndDisplay(1);
if (ps2e)
PCSX2_overrideConfig(config);
return 0;
}
@ -1765,7 +1787,7 @@ void UpdatePadList(HWND hWnd) {
CheckDlgButton(hWnd, IDC_ANALOG_START1, BST_CHECKED*config.padConfigs[port][slot].autoAnalog);
}
EnableWindow(hWndCombo, enable);
EnableWindow(hWndAnalog, enable && !ps2e);
EnableWindow(hWndAnalog, enable);
//ListView_SetExtendedListViewStyleEx(hWndList, LVS_EX_DOUBLEBUFFER|LVS_EX_ONECLICKACTIVATE, LVS_EX_DOUBLEBUFFER|LVS_EX_ONECLICKACTIVATE);
recurse = 0;
}
@ -1795,6 +1817,16 @@ INT_PTR CALLBACK GeneralDialogProc(HWND hWnd, unsigned int msg, WPARAM wParam, L
SendMessage(hWndCombo, CB_ADDSTRING, 0, (LPARAM) L"Unplugged");
SendMessage(hWndCombo, CB_ADDSTRING, 0, (LPARAM) L"Dualshock 2");
SendMessage(hWndCombo, CB_ADDSTRING, 0, (LPARAM) L"Guitar");
if (ps2e) {
// This disabled some widgets which are not required for PCSX2.
// Currently the trigger is that it's in PS2 emulation mode
const UINT* toDisable = PCSX2_disabledWidgets();
while (toDisable && *toDisable) {
EnableWindow(GetDlgItem(hWnd, *toDisable), 0);
toDisable++;
}
}
}
}
UpdatePadPages();

View File

@ -980,6 +980,8 @@ ExtraWndProcResult HideCursorProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lP
}
char restoreFullScreen = 0;
// This hack sends ALT+ENTER to the window to toggle fullscreen.
// PCSX2 doesn't need it (it exits full screen on ESC on its own).
DWORD WINAPI MaximizeWindowThreadProc(void *lpParameter) {
Sleep(100);
keybd_event(VK_LMENU, MapVirtualKey(VK_LMENU, MAPVK_VK_TO_VSC), 0, 0);