From 83e6ecb5af7ca7cf607e6b2ee764bb98c2039a09 Mon Sep 17 00:00:00 2001 From: Gauvain 'GovanifY' Roussel-Tarbouriech Date: Sat, 12 Dec 2020 10:05:55 +0100 Subject: [PATCH] PAD: s/Lily/PAD/g + logging changes --- pcsx2/PAD/Windows/Default.ini | 2 +- pcsx2/PAD/Windows/PAD.cpp | 22 +++++++--------------- pcsx2/PAD/Windows/PADConfig.cpp | 20 ++++++++++---------- pcsx2/PAD/Windows/Tooltips.cpp | 4 ++-- pcsx2/PAD/Windows/WndProcEater.cpp | 14 ++++---------- 5 files changed, 24 insertions(+), 38 deletions(-) diff --git a/pcsx2/PAD/Windows/Default.ini b/pcsx2/PAD/Windows/Default.ini index 6c3b82dfb3..5133ff4586 100644 --- a/pcsx2/PAD/Windows/Default.ini +++ b/pcsx2/PAD/Windows/Default.ini @@ -1,6 +1,6 @@ [General Settings] Last Config Path=inis -Last Config Name=LilyPad.lily +Last Config Name=PAD.pad Force Cursor Hide=0 Mouse Unfocus=1 Background=1 diff --git a/pcsx2/PAD/Windows/PAD.cpp b/pcsx2/PAD/Windows/PAD.cpp index f91bdf7460..30a0a004b2 100644 --- a/pcsx2/PAD/Windows/PAD.cpp +++ b/pcsx2/PAD/Windows/PAD.cpp @@ -43,7 +43,7 @@ #define FORCE_UPDATE_WPARAM ((WPARAM)0x74328943) #define FORCE_UPDATE_LPARAM ((LPARAM)0x89437437) -// LilyPad version. +// PAD version. #define VERSION ((0 << 8) | 12 | (1 << 24)) #ifdef __linux__ @@ -634,7 +634,6 @@ void Update(unsigned int port, unsigned int slot) { if (!anyDeviceActiveAndBound) { - fprintf(stderr, "LilyPad: A device(%ls) has been attached with bound controls.\n", dev->displayName); anyDeviceActiveAndBound = true; } currentDeviceActiveAndBound = true; @@ -643,7 +642,7 @@ void Update(unsigned int port, unsigned int slot) if (!currentDeviceActiveAndBound && activeWindow) { if (anyDeviceActiveAndBound) - fprintf(stderr, "LilyPad: Warning! No controls are bound to a currently attached device!\nPlease attach a controller that has been setup for use with LilyPad or go to the Plugin settings and setup new controls.\n"); + Console.Warning("PAD: Warning! No controls are bound to a currently attached device!\nPlease attach a controller that has been setup for use with PAD or go to the Plugin settings and setup new controls.\n"); anyDeviceActiveAndBound = false; } dm->PostRead(); @@ -815,18 +814,13 @@ inline void SetVibrate(int port, int slot, int motor, u8 val) // Used in about and config screens. void GetNameAndVersionString(wchar_t* out) { -#if defined(PCSX2_DEBUG) - wsprintfW(out, L"LilyPad Debug %i.%i.%i (%lld)", (VERSION >> 8) & 0xFF, VERSION & 0xFF, (VERSION >> 24) & 0xFF, SVN_REV); -#else - wsprintfW(out, L"LilyPad %i.%i.%i (%lld)", (VERSION >> 8) & 0xFF, VERSION & 0xFF, (VERSION >> 24) & 0xFF, SVN_REV); -#endif + wsprintfW(out, L"GamePad settings", (VERSION >> 8) & 0xFF, VERSION & 0xFF, (VERSION >> 24) & 0xFF, SVN_REV); } #endif void PADshutdown() { - DEBUG_TEXT_OUT("LilyPad shutdown.\n\n"); for (int i = 0; i < 8; i++) pads[i & 1][i >> 1].initialized = 0; portInitialized[0] = portInitialized[1] = 0; @@ -1084,7 +1078,6 @@ s32 PADopen(void* pDsp) { if (openCount++) return 0; - DEBUG_TEXT_OUT("LilyPad opened\n\n"); miceEnabled = !config.mouseUnfocus; #ifdef _MSC_VER @@ -1102,12 +1095,12 @@ s32 PADopen(void* pDsp) { openCount = 0; MessageBoxA(GetActiveWindow(), - "Invalid Window handle passed to LilyPad.\n" + "Invalid Window handle passed to PAD.\n" "\n" "Either your emulator or gs plugin is buggy,\n" "Despite the fact the emulator is about to\n" - "blame LilyPad for failing to initialize.", - "Non-LilyPad Error", MB_OK | MB_ICONERROR); + "blame PAD for failing to initialize.", + "Non-PAD Error", MB_OK | MB_ICONERROR); return -1; } hWndTop = hWnd; @@ -1191,7 +1184,6 @@ void PADclose() { if (openCount && !--openCount) { - DEBUG_TEXT_OUT("LilyPad closed\n\n"); #ifdef _MSC_VER updateQueued = 0; hWndGSProc.Release(); @@ -1695,7 +1687,7 @@ s32 PADfreeze(int mode, freezeData* data) { if (!data) { - printf("LilyPad savestate null pointer!\n"); + Console.Warning("PAD savestate null pointer!\n"); return -1; } diff --git a/pcsx2/PAD/Windows/PADConfig.cpp b/pcsx2/PAD/Windows/PADConfig.cpp index 8769238957..28b1a46401 100644 --- a/pcsx2/PAD/Windows/PADConfig.cpp +++ b/pcsx2/PAD/Windows/PADConfig.cpp @@ -48,7 +48,7 @@ HWND hWndProp = 0; int selected = 0; bool quickSetup = false; -// Older versions of PCSX2 don't always create the ini dir on startup, so LilyPad does it +// Older versions of PCSX2 don't always create the ini dir on startup, so PAD does it // for it. But if PCSX2 sets the ini path with a call to setSettingsDir, then it means // we shouldn't make our own. bool createIniDir = true; @@ -331,7 +331,7 @@ wchar_t* GetCommandStringW(u8 command, int port, int slot) return L""; } -static wchar_t iniFile[MAX_PATH * 2] = L"inis/LilyPad.ini"; +static wchar_t iniFile[MAX_PATH * 2] = L"inis/PAD.ini"; void PADsetSettingsDir(const char* dir) { @@ -339,7 +339,7 @@ void PADsetSettingsDir(const char* dir) //uint targlen = MultiByteToWideChar(CP_ACP, 0, dir, -1, NULL, 0); MultiByteToWideChar(CP_UTF8, 0, dir, -1, iniFile, MAX_PATH * 2); - wcscat_s(iniFile, L"/LilyPad.ini"); + wcscat_s(iniFile, L"/PAD.ini"); createIniDir = false; @@ -1065,7 +1065,7 @@ int LoadSettings(int force, wchar_t* file) { file = iniFile; GetPrivateProfileStringW(L"General Settings", L"Last Config Path", L"inis", config.lastSaveConfigPath, sizeof(config.lastSaveConfigPath), file); - GetPrivateProfileStringW(L"General Settings", L"Last Config Name", L"LilyPad.lily", config.lastSaveConfigFileName, sizeof(config.lastSaveConfigFileName), file); + GetPrivateProfileStringW(L"General Settings", L"Last Config Name", L"PAD.pad", config.lastSaveConfigFileName, sizeof(config.lastSaveConfigFileName), file); } else { @@ -2729,17 +2729,17 @@ INT_PTR CALLBACK GeneralDialogProc(HWND hWnd, unsigned int msg, WPARAM wParam, L memset(&ofn, 0, sizeof(ofn)); ofn.lStructSize = sizeof(ofn); ofn.hwndOwner = hWnd; - ofn.lpstrFilter = L"LilyPad Config Files\0*.lily\0All Files\0*.*\0\0"; + ofn.lpstrFilter = L"PAD Config Files\0*.pad\0All Files\0*.*\0\0"; wchar_t file[MAX_PATH + 1]; ofn.lpstrFile = file; ofn.nMaxFile = MAX_PATH; wcscpy(file, config.lastSaveConfigFileName); ofn.lpstrInitialDir = config.lastSaveConfigPath; ofn.Flags = OFN_DONTADDTORECENT | OFN_LONGNAMES | OFN_NOCHANGEDIR; - ofn.lpstrDefExt = L"lily"; + ofn.lpstrDefExt = L"pad"; if (LOWORD(wParam) == ID_LOAD) { - ofn.lpstrTitle = L"Load LilyPad Configuration"; + ofn.lpstrTitle = L"Load PAD Configuration"; ofn.Flags |= OFN_FILEMUSTEXIST; if (GetOpenFileNameW(&ofn)) { @@ -2750,7 +2750,7 @@ INT_PTR CALLBACK GeneralDialogProc(HWND hWnd, unsigned int msg, WPARAM wParam, L } else { - ofn.lpstrTitle = L"Save LilyPad Configuration"; + ofn.lpstrTitle = L"Save PAD Configuration"; ofn.Flags |= OFN_OVERWRITEPROMPT; if (GetSaveFileNameW(&ofn)) { @@ -2764,14 +2764,14 @@ INT_PTR CALLBACK GeneralDialogProc(HWND hWnd, unsigned int msg, WPARAM wParam, L } else if (HIWORD(wParam) == BN_CLICKED && LOWORD(wParam) == ID_RESTORE_DEFAULTS) { - int msgboxID = MessageBoxA(hWndProp, "This will delete all current settings and revert back to the default settings of LilyPad. Continue?", + int msgboxID = MessageBoxA(hWndProp, "This will delete all current settings and revert back to the default settings of PAD. Continue?", "Restore Defaults Confirmation", MB_YESNO | MB_DEFBUTTON2 | MB_ICONEXCLAMATION); switch (msgboxID) { case IDNO: break; case IDYES: - char iniLocation[MAX_PATH * 2] = "inis/LilyPad.ini"; + char iniLocation[MAX_PATH * 2] = "inis/PAD.ini"; remove(iniLocation); createIniDir = true; LoadSettings(1); diff --git a/pcsx2/PAD/Windows/Tooltips.cpp b/pcsx2/PAD/Windows/Tooltips.cpp index 2af0148df2..8cbacf04ed 100644 --- a/pcsx2/PAD/Windows/Tooltips.cpp +++ b/pcsx2/PAD/Windows/Tooltips.cpp @@ -33,7 +33,7 @@ LPWSTR dialog_message(int ID, bool* updateText) L"Note 1: By default PCSX2 uses a double-click by the left mouse button to toggle fullscreen mode, this makes the left mouse button unusable as an input." L"To disable this option in PCSX2 go to Config > Emulation Settings > GS Window tab, and disable the \"Double-click toggles fullscreen mode\" checkbox.\n\n" L"Note 2: This does not enable the mouse to function as an in-game mouse in PS2 games that support a USB mouse or lightgun." - L"This requires a USB plugin, while LilyPad is a PAD plugin(PAD means it emulates devices that are to be plugged into the PlayStation controller port that connects the DualShock 2 controller)."; + L"This requires a USB device, while PAD is a PAD plugin(PAD means it emulates devices that are to be plugged into the PlayStation controller port that connects the DualShock 2 controller)."; case IDC_MOUSE_UNFOCUS: return L"Enabled: Mouse is unfocused and can be used for emulation and outside it.\n\n" L"Disabled: Mouse is focused and can be used for emulation."; @@ -66,7 +66,7 @@ LPWSTR dialog_message(int ID, bool* updateText) L"If it doesn't support Xinput then running through Steam as a non-Steam game might be required for the controllers to work properly.\n\n" L"https://gamepad-tester.com/ to test your controller and check if it only says 'Xinput' on top."; case ID_RESTORE_DEFAULTS: - return L"Restores the default contents of LilyPad.ini, undoing all settings changes and bindings that have been set up."; + return L"Restores the default contents of PAD.ini, undoing all settings changes and bindings that have been set up."; // Pad tabs case IDC_BINDINGS_LIST: return L"Shows a list of currently bound inputs of the selected Pad.\n\n" diff --git a/pcsx2/PAD/Windows/WndProcEater.cpp b/pcsx2/PAD/Windows/WndProcEater.cpp index bce61811b0..7185c0b50d 100644 --- a/pcsx2/PAD/Windows/WndProcEater.cpp +++ b/pcsx2/PAD/Windows/WndProcEater.cpp @@ -25,7 +25,7 @@ WndProcEater::WndProcEater() extraProcs = 0; numExtraProcs = 0; - hMutex = CreateMutex(0, 0, L"LilyPad"); + hMutex = CreateMutex(0, 0, L"PAD"); } WndProcEater::~WndProcEater() throw() @@ -43,8 +43,6 @@ void WndProcEater::ReleaseExtraProc(ExtraWndProc proc) if (hMutex) WaitForSingleObject(hMutex, 100); - //printf( "(Lilypad) Regurgitating! -> 0x%x\n", proc ); - for (int i = 0; i < numExtraProcs; i++) { if (extraProcs[i].proc == proc) @@ -68,7 +66,7 @@ void WndProcEater::Release() ReleaseExtraProc(extraProcs[0].proc); if (hWndEaten && IsWindow(hWndEaten)) { - RemoveProp(hWndEaten, L"LilyHaxxor"); + RemoveProp(hWndEaten, L"PADHaxxor"); SetWindowLongPtr(hWndEaten, GWLP_WNDPROC, (LONG_PTR)eatenWndProc); hWndEaten = 0; eatenWndProc = 0; @@ -124,7 +122,7 @@ LRESULT WndProcEater::_OverrideWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPAR static LRESULT CALLBACK OverrideWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { - WndProcEater* obj = (WndProcEater*)GetProp(hWnd, L"LilyHaxxor"); + WndProcEater* obj = (WndProcEater*)GetProp(hWnd, L"PADHaxxor"); return (obj == NULL) ? DefWindowProc(hWnd, uMsg, wParam, lParam) : obj->_OverrideWndProc(hWnd, uMsg, wParam, lParam); @@ -135,10 +133,8 @@ bool WndProcEater::SetWndHandle(HWND hWnd) if (hWnd == hWndEaten) return true; - //printf( "(Lilypad) (Re)-Setting window handle! -> this=0x%08x, hWnd=0x%08x\n", this, hWnd ); - Release(); - SetProp(hWnd, L"LilyHaxxor", (HANDLE)this); + SetProp(hWnd, L"PADHaxxor", (HANDLE)this); eatenWndProc = (WNDPROC)SetWindowLongPtr(hWnd, GWLP_WNDPROC, (LONG_PTR)OverrideWndProc); hWndEaten = (eatenWndProc) ? hWnd : 0; @@ -157,8 +153,6 @@ void WndProcEater::Eat(ExtraWndProc proc, DWORD flags) if (hMutex) WaitForSingleObject(hMutex, 100); - //printf( "(Lilypad) EatingWndProc! -> 0x%x\n", proc ); - extraProcs = (ExtraWndProcInfo*)realloc(extraProcs, sizeof(ExtraWndProcInfo) * (numExtraProcs + 1)); extraProcs[numExtraProcs].proc = proc; extraProcs[numExtraProcs].flags = flags;