From c51e9d0622aec4407c0e2cd920555d473aeece3a Mon Sep 17 00:00:00 2001 From: Aaron M Date: Sat, 16 Nov 2019 17:33:54 +1300 Subject: [PATCH 1/2] Fix Star Wars Battle Pod Controls Stop native Xinput controls working so TP can do its thing --- .../src/Functions/Games/ES3X/StarWars.cpp | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/OpenParrot/src/Functions/Games/ES3X/StarWars.cpp b/OpenParrot/src/Functions/Games/ES3X/StarWars.cpp index eb97fa6..c30283e 100644 --- a/OpenParrot/src/Functions/Games/ES3X/StarWars.cpp +++ b/OpenParrot/src/Functions/Games/ES3X/StarWars.cpp @@ -3,7 +3,23 @@ #include "Utility/ES3XLauncherHook.h" #include "Utility/InitFunction.h" #include "Functions/Global.h" +#include "Utility/GameDetect.h" +DWORD WINAPI XInputGetStateStarWars +( + __in DWORD dwUserIndex, // Index of the gamer associated with the device + __out DWORD* pState // Receives the current state +) +{ + if (GameDetect::currentGame == GameID::StarWarsEs3X) + { + return ERROR_SUCCESS; + } + else + { + return ERROR_DEVICE_NOT_CONNECTED; + } +} static unsigned char hasp_buffer[0xD40]; @@ -96,7 +112,8 @@ static InitFunction StarWarsEs3XFunc([]() MH_CreateHookApi(L"hasp_windows_x64_100610.dll", "hasp_encrypt", Hook_hasp_encrypt, NULL); MH_CreateHookApi(L"hasp_windows_x64_100610.dll", "hasp_logout", Hook_hasp_logout, NULL); MH_CreateHookApi(L"hasp_windows_x64_100610.dll", "hasp_login", Hook_hasp_login, NULL); - MH_EnableHook(MH_ALL_HOOKS); + MH_CreateHookApi(L"xinput1_3.dll", "XInputGetState", &XInputGetStateStarWars, NULL); + MH_EnableHook(MH_ALL_HOOKS); }, GameID::StarWarsEs3X); From dc3b15544964c3ab6198f6766a8766c07a035556 Mon Sep 17 00:00:00 2001 From: Aaron M Date: Sat, 16 Nov 2019 17:37:36 +1300 Subject: [PATCH 2/2] . --- OpenParrot/src/Functions/Games/ES3X/StarWars.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OpenParrot/src/Functions/Games/ES3X/StarWars.cpp b/OpenParrot/src/Functions/Games/ES3X/StarWars.cpp index c30283e..3285f2a 100644 --- a/OpenParrot/src/Functions/Games/ES3X/StarWars.cpp +++ b/OpenParrot/src/Functions/Games/ES3X/StarWars.cpp @@ -7,8 +7,8 @@ DWORD WINAPI XInputGetStateStarWars ( - __in DWORD dwUserIndex, // Index of the gamer associated with the device - __out DWORD* pState // Receives the current state + __in DWORD dwUserIndex, // Index of the gamer associated with the device + __out DWORD* pState // Receives the current state ) { if (GameDetect::currentGame == GameID::StarWarsEs3X)