mirror of https://github.com/PCSX2/pcsx2.git
PAD: s/Lily/PAD/g + logging changes
This commit is contained in:
parent
8067a480c7
commit
83e6ecb5af
|
@ -1,6 +1,6 @@
|
||||||
[General Settings]
|
[General Settings]
|
||||||
Last Config Path=inis
|
Last Config Path=inis
|
||||||
Last Config Name=LilyPad.lily
|
Last Config Name=PAD.pad
|
||||||
Force Cursor Hide=0
|
Force Cursor Hide=0
|
||||||
Mouse Unfocus=1
|
Mouse Unfocus=1
|
||||||
Background=1
|
Background=1
|
||||||
|
|
|
@ -43,7 +43,7 @@
|
||||||
#define FORCE_UPDATE_WPARAM ((WPARAM)0x74328943)
|
#define FORCE_UPDATE_WPARAM ((WPARAM)0x74328943)
|
||||||
#define FORCE_UPDATE_LPARAM ((LPARAM)0x89437437)
|
#define FORCE_UPDATE_LPARAM ((LPARAM)0x89437437)
|
||||||
|
|
||||||
// LilyPad version.
|
// PAD version.
|
||||||
#define VERSION ((0 << 8) | 12 | (1 << 24))
|
#define VERSION ((0 << 8) | 12 | (1 << 24))
|
||||||
|
|
||||||
#ifdef __linux__
|
#ifdef __linux__
|
||||||
|
@ -634,7 +634,6 @@ void Update(unsigned int port, unsigned int slot)
|
||||||
{
|
{
|
||||||
if (!anyDeviceActiveAndBound)
|
if (!anyDeviceActiveAndBound)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "LilyPad: A device(%ls) has been attached with bound controls.\n", dev->displayName);
|
|
||||||
anyDeviceActiveAndBound = true;
|
anyDeviceActiveAndBound = true;
|
||||||
}
|
}
|
||||||
currentDeviceActiveAndBound = true;
|
currentDeviceActiveAndBound = true;
|
||||||
|
@ -643,7 +642,7 @@ void Update(unsigned int port, unsigned int slot)
|
||||||
if (!currentDeviceActiveAndBound && activeWindow)
|
if (!currentDeviceActiveAndBound && activeWindow)
|
||||||
{
|
{
|
||||||
if (anyDeviceActiveAndBound)
|
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;
|
anyDeviceActiveAndBound = false;
|
||||||
}
|
}
|
||||||
dm->PostRead();
|
dm->PostRead();
|
||||||
|
@ -815,18 +814,13 @@ inline void SetVibrate(int port, int slot, int motor, u8 val)
|
||||||
// Used in about and config screens.
|
// Used in about and config screens.
|
||||||
void GetNameAndVersionString(wchar_t* out)
|
void GetNameAndVersionString(wchar_t* out)
|
||||||
{
|
{
|
||||||
#if defined(PCSX2_DEBUG)
|
wsprintfW(out, L"GamePad settings", (VERSION >> 8) & 0xFF, VERSION & 0xFF, (VERSION >> 24) & 0xFF, SVN_REV);
|
||||||
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
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
void PADshutdown()
|
void PADshutdown()
|
||||||
{
|
{
|
||||||
DEBUG_TEXT_OUT("LilyPad shutdown.\n\n");
|
|
||||||
for (int i = 0; i < 8; i++)
|
for (int i = 0; i < 8; i++)
|
||||||
pads[i & 1][i >> 1].initialized = 0;
|
pads[i & 1][i >> 1].initialized = 0;
|
||||||
portInitialized[0] = portInitialized[1] = 0;
|
portInitialized[0] = portInitialized[1] = 0;
|
||||||
|
@ -1084,7 +1078,6 @@ s32 PADopen(void* pDsp)
|
||||||
{
|
{
|
||||||
if (openCount++)
|
if (openCount++)
|
||||||
return 0;
|
return 0;
|
||||||
DEBUG_TEXT_OUT("LilyPad opened\n\n");
|
|
||||||
|
|
||||||
miceEnabled = !config.mouseUnfocus;
|
miceEnabled = !config.mouseUnfocus;
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
|
@ -1102,12 +1095,12 @@ s32 PADopen(void* pDsp)
|
||||||
{
|
{
|
||||||
openCount = 0;
|
openCount = 0;
|
||||||
MessageBoxA(GetActiveWindow(),
|
MessageBoxA(GetActiveWindow(),
|
||||||
"Invalid Window handle passed to LilyPad.\n"
|
"Invalid Window handle passed to PAD.\n"
|
||||||
"\n"
|
"\n"
|
||||||
"Either your emulator or gs plugin is buggy,\n"
|
"Either your emulator or gs plugin is buggy,\n"
|
||||||
"Despite the fact the emulator is about to\n"
|
"Despite the fact the emulator is about to\n"
|
||||||
"blame LilyPad for failing to initialize.",
|
"blame PAD for failing to initialize.",
|
||||||
"Non-LilyPad Error", MB_OK | MB_ICONERROR);
|
"Non-PAD Error", MB_OK | MB_ICONERROR);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
hWndTop = hWnd;
|
hWndTop = hWnd;
|
||||||
|
@ -1191,7 +1184,6 @@ void PADclose()
|
||||||
{
|
{
|
||||||
if (openCount && !--openCount)
|
if (openCount && !--openCount)
|
||||||
{
|
{
|
||||||
DEBUG_TEXT_OUT("LilyPad closed\n\n");
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
updateQueued = 0;
|
updateQueued = 0;
|
||||||
hWndGSProc.Release();
|
hWndGSProc.Release();
|
||||||
|
@ -1695,7 +1687,7 @@ s32 PADfreeze(int mode, freezeData* data)
|
||||||
{
|
{
|
||||||
if (!data)
|
if (!data)
|
||||||
{
|
{
|
||||||
printf("LilyPad savestate null pointer!\n");
|
Console.Warning("PAD savestate null pointer!\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -48,7 +48,7 @@ HWND hWndProp = 0;
|
||||||
int selected = 0;
|
int selected = 0;
|
||||||
bool quickSetup = false;
|
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
|
// for it. But if PCSX2 sets the ini path with a call to setSettingsDir, then it means
|
||||||
// we shouldn't make our own.
|
// we shouldn't make our own.
|
||||||
bool createIniDir = true;
|
bool createIniDir = true;
|
||||||
|
@ -331,7 +331,7 @@ wchar_t* GetCommandStringW(u8 command, int port, int slot)
|
||||||
return L"";
|
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)
|
void PADsetSettingsDir(const char* dir)
|
||||||
{
|
{
|
||||||
|
@ -339,7 +339,7 @@ void PADsetSettingsDir(const char* dir)
|
||||||
|
|
||||||
//uint targlen = MultiByteToWideChar(CP_ACP, 0, dir, -1, NULL, 0);
|
//uint targlen = MultiByteToWideChar(CP_ACP, 0, dir, -1, NULL, 0);
|
||||||
MultiByteToWideChar(CP_UTF8, 0, dir, -1, iniFile, MAX_PATH * 2);
|
MultiByteToWideChar(CP_UTF8, 0, dir, -1, iniFile, MAX_PATH * 2);
|
||||||
wcscat_s(iniFile, L"/LilyPad.ini");
|
wcscat_s(iniFile, L"/PAD.ini");
|
||||||
|
|
||||||
createIniDir = false;
|
createIniDir = false;
|
||||||
|
|
||||||
|
@ -1065,7 +1065,7 @@ int LoadSettings(int force, wchar_t* file)
|
||||||
{
|
{
|
||||||
file = iniFile;
|
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 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
|
else
|
||||||
{
|
{
|
||||||
|
@ -2729,17 +2729,17 @@ INT_PTR CALLBACK GeneralDialogProc(HWND hWnd, unsigned int msg, WPARAM wParam, L
|
||||||
memset(&ofn, 0, sizeof(ofn));
|
memset(&ofn, 0, sizeof(ofn));
|
||||||
ofn.lStructSize = sizeof(ofn);
|
ofn.lStructSize = sizeof(ofn);
|
||||||
ofn.hwndOwner = hWnd;
|
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];
|
wchar_t file[MAX_PATH + 1];
|
||||||
ofn.lpstrFile = file;
|
ofn.lpstrFile = file;
|
||||||
ofn.nMaxFile = MAX_PATH;
|
ofn.nMaxFile = MAX_PATH;
|
||||||
wcscpy(file, config.lastSaveConfigFileName);
|
wcscpy(file, config.lastSaveConfigFileName);
|
||||||
ofn.lpstrInitialDir = config.lastSaveConfigPath;
|
ofn.lpstrInitialDir = config.lastSaveConfigPath;
|
||||||
ofn.Flags = OFN_DONTADDTORECENT | OFN_LONGNAMES | OFN_NOCHANGEDIR;
|
ofn.Flags = OFN_DONTADDTORECENT | OFN_LONGNAMES | OFN_NOCHANGEDIR;
|
||||||
ofn.lpstrDefExt = L"lily";
|
ofn.lpstrDefExt = L"pad";
|
||||||
if (LOWORD(wParam) == ID_LOAD)
|
if (LOWORD(wParam) == ID_LOAD)
|
||||||
{
|
{
|
||||||
ofn.lpstrTitle = L"Load LilyPad Configuration";
|
ofn.lpstrTitle = L"Load PAD Configuration";
|
||||||
ofn.Flags |= OFN_FILEMUSTEXIST;
|
ofn.Flags |= OFN_FILEMUSTEXIST;
|
||||||
if (GetOpenFileNameW(&ofn))
|
if (GetOpenFileNameW(&ofn))
|
||||||
{
|
{
|
||||||
|
@ -2750,7 +2750,7 @@ INT_PTR CALLBACK GeneralDialogProc(HWND hWnd, unsigned int msg, WPARAM wParam, L
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ofn.lpstrTitle = L"Save LilyPad Configuration";
|
ofn.lpstrTitle = L"Save PAD Configuration";
|
||||||
ofn.Flags |= OFN_OVERWRITEPROMPT;
|
ofn.Flags |= OFN_OVERWRITEPROMPT;
|
||||||
if (GetSaveFileNameW(&ofn))
|
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)
|
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);
|
"Restore Defaults Confirmation", MB_YESNO | MB_DEFBUTTON2 | MB_ICONEXCLAMATION);
|
||||||
switch (msgboxID)
|
switch (msgboxID)
|
||||||
{
|
{
|
||||||
case IDNO:
|
case IDNO:
|
||||||
break;
|
break;
|
||||||
case IDYES:
|
case IDYES:
|
||||||
char iniLocation[MAX_PATH * 2] = "inis/LilyPad.ini";
|
char iniLocation[MAX_PATH * 2] = "inis/PAD.ini";
|
||||||
remove(iniLocation);
|
remove(iniLocation);
|
||||||
createIniDir = true;
|
createIniDir = true;
|
||||||
LoadSettings(1);
|
LoadSettings(1);
|
||||||
|
|
|
@ -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"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"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"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:
|
case IDC_MOUSE_UNFOCUS:
|
||||||
return L"Enabled: Mouse is unfocused and can be used for emulation and outside it.\n\n"
|
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.";
|
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"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.";
|
L"https://gamepad-tester.com/ to test your controller and check if it only says 'Xinput' on top.";
|
||||||
case ID_RESTORE_DEFAULTS:
|
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
|
// Pad tabs
|
||||||
case IDC_BINDINGS_LIST:
|
case IDC_BINDINGS_LIST:
|
||||||
return L"Shows a list of currently bound inputs of the selected Pad.\n\n"
|
return L"Shows a list of currently bound inputs of the selected Pad.\n\n"
|
||||||
|
|
|
@ -25,7 +25,7 @@ WndProcEater::WndProcEater()
|
||||||
extraProcs = 0;
|
extraProcs = 0;
|
||||||
numExtraProcs = 0;
|
numExtraProcs = 0;
|
||||||
|
|
||||||
hMutex = CreateMutex(0, 0, L"LilyPad");
|
hMutex = CreateMutex(0, 0, L"PAD");
|
||||||
}
|
}
|
||||||
|
|
||||||
WndProcEater::~WndProcEater() throw()
|
WndProcEater::~WndProcEater() throw()
|
||||||
|
@ -43,8 +43,6 @@ void WndProcEater::ReleaseExtraProc(ExtraWndProc proc)
|
||||||
if (hMutex)
|
if (hMutex)
|
||||||
WaitForSingleObject(hMutex, 100);
|
WaitForSingleObject(hMutex, 100);
|
||||||
|
|
||||||
//printf( "(Lilypad) Regurgitating! -> 0x%x\n", proc );
|
|
||||||
|
|
||||||
for (int i = 0; i < numExtraProcs; i++)
|
for (int i = 0; i < numExtraProcs; i++)
|
||||||
{
|
{
|
||||||
if (extraProcs[i].proc == proc)
|
if (extraProcs[i].proc == proc)
|
||||||
|
@ -68,7 +66,7 @@ void WndProcEater::Release()
|
||||||
ReleaseExtraProc(extraProcs[0].proc);
|
ReleaseExtraProc(extraProcs[0].proc);
|
||||||
if (hWndEaten && IsWindow(hWndEaten))
|
if (hWndEaten && IsWindow(hWndEaten))
|
||||||
{
|
{
|
||||||
RemoveProp(hWndEaten, L"LilyHaxxor");
|
RemoveProp(hWndEaten, L"PADHaxxor");
|
||||||
SetWindowLongPtr(hWndEaten, GWLP_WNDPROC, (LONG_PTR)eatenWndProc);
|
SetWindowLongPtr(hWndEaten, GWLP_WNDPROC, (LONG_PTR)eatenWndProc);
|
||||||
hWndEaten = 0;
|
hWndEaten = 0;
|
||||||
eatenWndProc = 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)
|
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) ?
|
return (obj == NULL) ?
|
||||||
DefWindowProc(hWnd, uMsg, wParam, lParam) :
|
DefWindowProc(hWnd, uMsg, wParam, lParam) :
|
||||||
obj->_OverrideWndProc(hWnd, uMsg, wParam, lParam);
|
obj->_OverrideWndProc(hWnd, uMsg, wParam, lParam);
|
||||||
|
@ -135,10 +133,8 @@ bool WndProcEater::SetWndHandle(HWND hWnd)
|
||||||
if (hWnd == hWndEaten)
|
if (hWnd == hWndEaten)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
//printf( "(Lilypad) (Re)-Setting window handle! -> this=0x%08x, hWnd=0x%08x\n", this, hWnd );
|
|
||||||
|
|
||||||
Release();
|
Release();
|
||||||
SetProp(hWnd, L"LilyHaxxor", (HANDLE)this);
|
SetProp(hWnd, L"PADHaxxor", (HANDLE)this);
|
||||||
|
|
||||||
eatenWndProc = (WNDPROC)SetWindowLongPtr(hWnd, GWLP_WNDPROC, (LONG_PTR)OverrideWndProc);
|
eatenWndProc = (WNDPROC)SetWindowLongPtr(hWnd, GWLP_WNDPROC, (LONG_PTR)OverrideWndProc);
|
||||||
hWndEaten = (eatenWndProc) ? hWnd : 0;
|
hWndEaten = (eatenWndProc) ? hWnd : 0;
|
||||||
|
@ -157,8 +153,6 @@ void WndProcEater::Eat(ExtraWndProc proc, DWORD flags)
|
||||||
if (hMutex)
|
if (hMutex)
|
||||||
WaitForSingleObject(hMutex, 100);
|
WaitForSingleObject(hMutex, 100);
|
||||||
|
|
||||||
//printf( "(Lilypad) EatingWndProc! -> 0x%x\n", proc );
|
|
||||||
|
|
||||||
extraProcs = (ExtraWndProcInfo*)realloc(extraProcs, sizeof(ExtraWndProcInfo) * (numExtraProcs + 1));
|
extraProcs = (ExtraWndProcInfo*)realloc(extraProcs, sizeof(ExtraWndProcInfo) * (numExtraProcs + 1));
|
||||||
extraProcs[numExtraProcs].proc = proc;
|
extraProcs[numExtraProcs].proc = proc;
|
||||||
extraProcs[numExtraProcs].flags = flags;
|
extraProcs[numExtraProcs].flags = flags;
|
||||||
|
|
Loading…
Reference in New Issue