From ccd7294095c975c43c1a1ebeb831e3d1694336e1 Mon Sep 17 00:00:00 2001 From: Poliwrath Date: Wed, 1 May 2019 01:27:46 -0400 Subject: [PATCH 1/6] Move Daytona3 taskkill stuff --- OpenParrot/src/Functions/Global.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/OpenParrot/src/Functions/Global.cpp b/OpenParrot/src/Functions/Global.cpp index e752fb6..6452ca9 100644 --- a/OpenParrot/src/Functions/Global.cpp +++ b/OpenParrot/src/Functions/Global.cpp @@ -40,16 +40,13 @@ DWORD WINAPI QuitGameThread(__in LPVOID lpParameter) { while (true) { - if ((GameDetect::currentGame == GameID::Daytona3) && (GetAsyncKeyState(VK_ESCAPE))) - { -#ifndef _DEBUG - system("taskkill /f /im InpWrapper.exe"); - TerminateProcess(GetCurrentProcess(), 0); -#endif - } - else if (GetAsyncKeyState(VK_ESCAPE)) + if (GetAsyncKeyState(VK_ESCAPE)) { #ifndef _DEBUG + if (GameDetect::currentGame == GameID::Daytona3) + { + system("taskkill /f /im InpWrapper.exe"); + } TerminateProcess(GetCurrentProcess(), 0); #endif //ExitProcess(0); From b5e7fe12a4285487cc559eb6c51c09403b95b453 Mon Sep 17 00:00:00 2001 From: Poliwrath Date: Wed, 1 May 2019 01:33:06 -0400 Subject: [PATCH 2/6] Rename PokkenXInputEmu to XInputEmu --- .../{PokkenXInputEmu.cpp => XInputEmu.cpp} | 728 +++++++++--------- .../{PokkenXInputEmu.h => XInputEmu.h} | 0 2 files changed, 361 insertions(+), 367 deletions(-) rename OpenParrot/src/Functions/{PokkenXInputEmu.cpp => XInputEmu.cpp} (93%) rename OpenParrot/src/Functions/{PokkenXInputEmu.h => XInputEmu.h} (100%) diff --git a/OpenParrot/src/Functions/PokkenXInputEmu.cpp b/OpenParrot/src/Functions/XInputEmu.cpp similarity index 93% rename from OpenParrot/src/Functions/PokkenXInputEmu.cpp rename to OpenParrot/src/Functions/XInputEmu.cpp index eee506c..071cf85 100644 --- a/OpenParrot/src/Functions/PokkenXInputEmu.cpp +++ b/OpenParrot/src/Functions/XInputEmu.cpp @@ -1,367 +1,361 @@ -#pragma optimize("", off) -#include "StdInc.h" -#include "Utility/GameDetect.h" -#include "Utility/InitFunction.h" -#include "PokkenXInputEmu.h" - -struct XboxOneControllerHandler -{ - struct usb_dev_handle *handle; - bool isConnected; - XBOXONE_STATE controllerState; - - uint8_t lastState[64]; - unsigned int tickCount; - - XINPUT_GAMEPAD lastGamepadState; -}; - -XboxOneControllerHandler *controllerHandler[4] = { NULL, NULL, NULL, NULL }; -HANDLE XboxOneControllerThread[4] = { 0 }; -HANDLE XboxOneControllerMutex[4] = { 0 }; - -static unsigned short idVendor = 0x045E; -static unsigned short idProduct = 0x02D1; - -int configuration = 1; -int interface = 0; -int endpointIn = 0x81; -int endpointOut = 0x01; -int timeout = 2000; // milliseconds -bool controllerInit = false; -bool runThread = true; - -// Structure we receive from the controller -struct XboxOneControllerState -{ - char eventCount; - char unknown; - char buttons1; - char buttons2; - short leftTrigger; // Triggers are 0 - 1023 - short rightTrigger; - short thumbLX; // Axes are -32767 - 32767 - short thumbLY; - short thumbRX; - short thumbRY; -}; - -bool connectController(bool enable) -{ - controllerInit = enable; - return true; -} - -int iround(double num) { - return (num > 0.0) ? (int)floor(num + 0.5) : (int)ceil(num - 0.5); -} - -extern int* ffbOffset; -extern int* ffbOffset2; - -DWORD WINAPI XInputGetState -( - __in DWORD dwUserIndex, // Index of the gamer associated with the device - __out XINPUT_STATE* pState // Receives the current state -) -{ - if (!controllerInit) - { - connectController(true); - } - if (controllerInit && dwUserIndex == 0) - { - XINPUT_GAMEPAD gamepadState = { 0 }; - - if (GameDetect::currentGame == GameID::Daytona3 || GameDetect::currentGame == GameID::PokkenTournament) - gamepadState.wButtons |= *ffbOffset; - else - gamepadState.wButtons |= 0; -#ifdef _M_IX86 - if (GameDetect::currentGame == GameID::Daytona3) - { - gamepadState.bRightTrigger = daytonaPressStart ? 0xFF : 0x00; - } - if (GameDetect::currentGame == GameID::Daytona3) - { - gamepadState.sThumbLX |= (-(33024 - *ffbOffset2) * 255); - } -#endif - if (pState->dwPacketNumber == UINT_MAX) - pState->dwPacketNumber = 0; - else - pState->dwPacketNumber++; - - pState->Gamepad = gamepadState; - return ERROR_SUCCESS; - } - else - { - return ERROR_DEVICE_NOT_CONNECTED; - } -} - -DWORD WINAPI XInputSetState -( - __in DWORD dwUserIndex, // Index of the gamer associated with the device - __in XINPUT_VIBRATION* pVibration // The vibration information to send to the controller -) -{ - if (!controllerInit) - { - connectController(true); - } - - if (controllerInit && dwUserIndex == 0) - { - // We're receiving as XInput [0 ~ 65535], need to be [0 ~ 255] !! - int leftVal = iround(((float)pVibration->wLeftMotorSpeed / 65535) * 255); - int rightVal = iround(((float)pVibration->wRightMotorSpeed / 65535) * 255); - return ERROR_SUCCESS; - } - else - { - return ERROR_DEVICE_NOT_CONNECTED; - } -} - -DWORD WINAPI XInputGetCapabilities -( - __in DWORD dwUserIndex, // Index of the gamer associated with the device - __in DWORD dwFlags, // Input flags that identify the device type - __out XINPUT_CAPABILITIES* pCapabilities // Receives the capabilities -) -{ - if (!controllerInit) - { - connectController(true); - } - - if (dwFlags > XINPUT_FLAG_GAMEPAD) - { - return ERROR_BAD_ARGUMENTS; - } - - if (controllerInit && dwUserIndex == 0) - { - pCapabilities->Flags = XINPUT_CAPS_VOICE_SUPPORTED; - pCapabilities->Type = XINPUT_DEVTYPE_GAMEPAD; - pCapabilities->SubType = XINPUT_DEVSUBTYPE_GAMEPAD; - - pCapabilities->Gamepad.wButtons = 0xF3FF; - - pCapabilities->Gamepad.bLeftTrigger = 0xFF; - pCapabilities->Gamepad.bRightTrigger = 0xFF; - - pCapabilities->Gamepad.sThumbLX = (SHORT)0xFFC0; - pCapabilities->Gamepad.sThumbLY = (SHORT)0xFFC0; - pCapabilities->Gamepad.sThumbRX = (SHORT)0xFFC0; - pCapabilities->Gamepad.sThumbRY = (SHORT)0xFFC0; - - pCapabilities->Vibration.wLeftMotorSpeed = 0xFF; - pCapabilities->Vibration.wRightMotorSpeed = 0xFF; - - return ERROR_SUCCESS; - } - else - { - return ERROR_DEVICE_NOT_CONNECTED; - } -} - -void WINAPI XInputEnable -( - __in bool enable // [in] Indicates whether xinput is enabled or disabled. -) -{ - if (!controllerInit) - { - connectController(true); - } - - if (controllerInit && !enable) - { - XINPUT_VIBRATION Vibration = { 0, 0 }; - int xboxControllerCounter = 0; - - while (xboxControllerCounter < 4) - { - if (controllerHandler[xboxControllerCounter]) - { - XInputSetState(xboxControllerCounter, &Vibration); - } - xboxControllerCounter++; - } - } -} - -DWORD WINAPI XInputGetDSoundAudioDeviceGuids -( - __in DWORD dwUserIndex, // Index of the gamer associated with the device - __out GUID* pDSoundRenderGuid, // DSound device ID for render - __out GUID* pDSoundCaptureGuid // DSound device ID for capture -) -{ - if (!controllerInit) - { - connectController(true); - } - - if (controllerInit && dwUserIndex == 0) - { - pDSoundRenderGuid = NULL; - pDSoundCaptureGuid = NULL; - - return ERROR_SUCCESS; - } - else - { - return ERROR_DEVICE_NOT_CONNECTED; - } -} - -DWORD XInputGetBatteryInformation -( - __in DWORD dwUserIndex, // Index of the gamer associated with the device - __in BYTE devType, // Which device on this user index - __out XINPUT_BATTERY_INFORMATION* pBatteryInformation // Contains the level and types of batteries -) -{ - if (!controllerInit) - { - connectController(true); - } - - if (controllerInit && dwUserIndex == 0) - { - pBatteryInformation->BatteryType = BATTERY_TYPE_WIRED; - pBatteryInformation->BatteryLevel = BATTERY_LEVEL_FULL; - return ERROR_SUCCESS; - } - else - { - return ERROR_DEVICE_NOT_CONNECTED; - } -} - -DWORD WINAPI XInputGetKeystroke -( - __in DWORD dwUserIndex, // Index of the gamer associated with the device - __reserved DWORD dwReserved, // Reserved for future use - __out PXINPUT_KEYSTROKE pKeystroke // Pointer to an XINPUT_KEYSTROKE structure that receives an input event. -) -{ - if (!controllerInit) - { - connectController(true); - } - - if (controllerInit && dwUserIndex == 0) - { - return ERROR_EMPTY; // or ERROR_SUCCESS - } - else - { - return ERROR_DEVICE_NOT_CONNECTED; - } -} - -DWORD WINAPI XInputGetStateEx -( - __in DWORD dwUserIndex, // Index of the gamer associated with the device - __out XINPUT_STATE* pState // Receives the current state -) -{ - if (!controllerInit) - { - connectController(true); - } - if (controllerInit && dwUserIndex == 0) - { - XINPUT_GAMEPAD gamepadState = { 0 }; - - if (GameDetect::currentGame == GameID::Daytona3 || GameDetect::currentGame == GameID::PokkenTournament) - gamepadState.wButtons = *ffbOffset; - else - gamepadState.wButtons = 0; - -#ifdef _M_IX86 - if (GameDetect::currentGame == GameID::Daytona3) - { - gamepadState.bRightTrigger = daytonaPressStart ? 0xFF : 0x00; - } - if (GameDetect::currentGame == GameID::Daytona3) - { - gamepadState.sThumbLX |= (-(33024 - *ffbOffset2) * 255); - } -#endif - if (pState->dwPacketNumber == UINT_MAX) - pState->dwPacketNumber = 0; - else - pState->dwPacketNumber++; - pState->Gamepad = gamepadState; - return ERROR_SUCCESS; - } - else - { - return ERROR_DEVICE_NOT_CONNECTED; - } -} - -DWORD WINAPI XInputSetStateEx -( -__in DWORD dwUserIndex, // Index of the gamer associated with the device -__in XINPUT_VIBRATION_EX* pVibration // The vibration information to send to the controller -) -{ - if (!controllerInit) - { - connectController(true); - } - - if (controllerInit && dwUserIndex == 0) - { - int leftTriggerVal = iround(((float)pVibration->wLeftTriggerMotorSpeed / 65535) * 255); - int rightTriggerVal = iround(((float)pVibration->wRightTriggerMotorSpeed / 65535) * 255); - int leftVal = iround(((float)pVibration->wLeftMotorSpeed / 65535) * 255); - int rightVal = iround(((float)pVibration->wRightMotorSpeed / 65535) * 255); - - return ERROR_SUCCESS; - } - else - { - return ERROR_DEVICE_NOT_CONNECTED; - } -} - -LPCWSTR libName = L"xinput1_3.dll"; -LPCWSTR daytonalibName = L"xinput9_1_0.dll"; -LPCWSTR ptrToUse; - -static InitFunction XInputHook([]() -{ - if (GameDetect::currentGame == GameID::PokkenTournament || GameDetect::currentGame == GameID::SchoolOfRagnarok || GameDetect::currentGame == GameID::Daytona3) - { - controllerInit = true; - - MH_Initialize(); - - if (GameDetect::currentGame == GameID::Daytona3) - ptrToUse = daytonalibName; - else - ptrToUse = libName; - - MH_CreateHookApi(ptrToUse, "XInputGetState", &XInputGetState, NULL); - MH_CreateHookApi(ptrToUse, "XInputSetState", &XInputSetState, NULL); - MH_CreateHookApi(ptrToUse, "XInputGetCapabilities", &XInputGetCapabilities, NULL); - MH_CreateHookApi(ptrToUse, "XInputEnable", &XInputEnable, NULL); - MH_CreateHookApi(ptrToUse, "XInputGetDSoundAudioDeviceGuids", &XInputGetDSoundAudioDeviceGuids, NULL); - MH_CreateHookApi(ptrToUse, "XInputGetBatteryInformation", &XInputGetBatteryInformation, NULL); - MH_CreateHookApi(ptrToUse, "XInputGetKeystroke", &XInputGetKeystroke, NULL); - MH_CreateHookApi(ptrToUse, "XInputGetStateEx", &XInputGetStateEx, NULL); - MH_CreateHookApi(ptrToUse, "XInputSetStateEx", &XInputSetStateEx, NULL); - - MH_EnableHook(MH_ALL_HOOKS); - } -}); -#pragma optimize("", on)´ +#pragma optimize("", off) +#include "StdInc.h" +#include "Utility/GameDetect.h" +#include "Utility/InitFunction.h" +#include "XInputEmu.h" + +struct XboxOneControllerHandler +{ + struct usb_dev_handle *handle; + bool isConnected; + XBOXONE_STATE controllerState; + + uint8_t lastState[64]; + unsigned int tickCount; + + XINPUT_GAMEPAD lastGamepadState; +}; + +XboxOneControllerHandler *controllerHandler[4] = { NULL, NULL, NULL, NULL }; +HANDLE XboxOneControllerThread[4] = { 0 }; +HANDLE XboxOneControllerMutex[4] = { 0 }; + +static unsigned short idVendor = 0x045E; +static unsigned short idProduct = 0x02D1; + +int configuration = 1; +int interface = 0; +int endpointIn = 0x81; +int endpointOut = 0x01; +int timeout = 2000; // milliseconds +bool controllerInit = false; +bool runThread = true; + +// Structure we receive from the controller +struct XboxOneControllerState +{ + char eventCount; + char unknown; + char buttons1; + char buttons2; + short leftTrigger; // Triggers are 0 - 1023 + short rightTrigger; + short thumbLX; // Axes are -32767 - 32767 + short thumbLY; + short thumbRX; + short thumbRY; +}; + +bool connectController(bool enable) +{ + controllerInit = enable; + return true; +} + +int iround(double num) { + return (num > 0.0) ? (int)floor(num + 0.5) : (int)ceil(num - 0.5); +} + +extern int* ffbOffset; +extern int* ffbOffset2; + +DWORD WINAPI XInputGetState +( + __in DWORD dwUserIndex, // Index of the gamer associated with the device + __out XINPUT_STATE* pState // Receives the current state +) +{ + if (!controllerInit) + { + connectController(true); + } + if (controllerInit && dwUserIndex == 0) + { + XINPUT_GAMEPAD gamepadState = { 0 }; + + if (GameDetect::currentGame == GameID::Daytona3 || GameDetect::currentGame == GameID::PokkenTournament) + gamepadState.wButtons |= *ffbOffset; + else + gamepadState.wButtons |= 0; +#ifdef _M_IX86 + if (GameDetect::currentGame == GameID::Daytona3) + { + gamepadState.bRightTrigger = daytonaPressStart ? 0xFF : 0x00; + gamepadState.sThumbLX |= (-(33024 - *ffbOffset2) * 255); + } +#endif + if (pState->dwPacketNumber == UINT_MAX) + pState->dwPacketNumber = 0; + else + pState->dwPacketNumber++; + + pState->Gamepad = gamepadState; + return ERROR_SUCCESS; + } + else + { + return ERROR_DEVICE_NOT_CONNECTED; + } +} + +DWORD WINAPI XInputSetState +( + __in DWORD dwUserIndex, // Index of the gamer associated with the device + __in XINPUT_VIBRATION* pVibration // The vibration information to send to the controller +) +{ + if (!controllerInit) + { + connectController(true); + } + + if (controllerInit && dwUserIndex == 0) + { + // We're receiving as XInput [0 ~ 65535], need to be [0 ~ 255] !! + int leftVal = iround(((float)pVibration->wLeftMotorSpeed / 65535) * 255); + int rightVal = iround(((float)pVibration->wRightMotorSpeed / 65535) * 255); + return ERROR_SUCCESS; + } + else + { + return ERROR_DEVICE_NOT_CONNECTED; + } +} + +DWORD WINAPI XInputGetCapabilities +( + __in DWORD dwUserIndex, // Index of the gamer associated with the device + __in DWORD dwFlags, // Input flags that identify the device type + __out XINPUT_CAPABILITIES* pCapabilities // Receives the capabilities +) +{ + if (!controllerInit) + { + connectController(true); + } + + if (dwFlags > XINPUT_FLAG_GAMEPAD) + { + return ERROR_BAD_ARGUMENTS; + } + + if (controllerInit && dwUserIndex == 0) + { + pCapabilities->Flags = XINPUT_CAPS_VOICE_SUPPORTED; + pCapabilities->Type = XINPUT_DEVTYPE_GAMEPAD; + pCapabilities->SubType = XINPUT_DEVSUBTYPE_GAMEPAD; + + pCapabilities->Gamepad.wButtons = 0xF3FF; + + pCapabilities->Gamepad.bLeftTrigger = 0xFF; + pCapabilities->Gamepad.bRightTrigger = 0xFF; + + pCapabilities->Gamepad.sThumbLX = (SHORT)0xFFC0; + pCapabilities->Gamepad.sThumbLY = (SHORT)0xFFC0; + pCapabilities->Gamepad.sThumbRX = (SHORT)0xFFC0; + pCapabilities->Gamepad.sThumbRY = (SHORT)0xFFC0; + + pCapabilities->Vibration.wLeftMotorSpeed = 0xFF; + pCapabilities->Vibration.wRightMotorSpeed = 0xFF; + + return ERROR_SUCCESS; + } + else + { + return ERROR_DEVICE_NOT_CONNECTED; + } +} + +void WINAPI XInputEnable +( + __in bool enable // [in] Indicates whether xinput is enabled or disabled. +) +{ + if (!controllerInit) + { + connectController(true); + } + + if (controllerInit && !enable) + { + XINPUT_VIBRATION Vibration = { 0, 0 }; + int xboxControllerCounter = 0; + + while (xboxControllerCounter < 4) + { + if (controllerHandler[xboxControllerCounter]) + { + XInputSetState(xboxControllerCounter, &Vibration); + } + xboxControllerCounter++; + } + } +} + +DWORD WINAPI XInputGetDSoundAudioDeviceGuids +( + __in DWORD dwUserIndex, // Index of the gamer associated with the device + __out GUID* pDSoundRenderGuid, // DSound device ID for render + __out GUID* pDSoundCaptureGuid // DSound device ID for capture +) +{ + if (!controllerInit) + { + connectController(true); + } + + if (controllerInit && dwUserIndex == 0) + { + pDSoundRenderGuid = NULL; + pDSoundCaptureGuid = NULL; + + return ERROR_SUCCESS; + } + else + { + return ERROR_DEVICE_NOT_CONNECTED; + } +} + +DWORD XInputGetBatteryInformation +( + __in DWORD dwUserIndex, // Index of the gamer associated with the device + __in BYTE devType, // Which device on this user index + __out XINPUT_BATTERY_INFORMATION* pBatteryInformation // Contains the level and types of batteries +) +{ + if (!controllerInit) + { + connectController(true); + } + + if (controllerInit && dwUserIndex == 0) + { + pBatteryInformation->BatteryType = BATTERY_TYPE_WIRED; + pBatteryInformation->BatteryLevel = BATTERY_LEVEL_FULL; + return ERROR_SUCCESS; + } + else + { + return ERROR_DEVICE_NOT_CONNECTED; + } +} + +DWORD WINAPI XInputGetKeystroke +( + __in DWORD dwUserIndex, // Index of the gamer associated with the device + __reserved DWORD dwReserved, // Reserved for future use + __out PXINPUT_KEYSTROKE pKeystroke // Pointer to an XINPUT_KEYSTROKE structure that receives an input event. +) +{ + if (!controllerInit) + { + connectController(true); + } + + if (controllerInit && dwUserIndex == 0) + { + return ERROR_EMPTY; // or ERROR_SUCCESS + } + else + { + return ERROR_DEVICE_NOT_CONNECTED; + } +} + +DWORD WINAPI XInputGetStateEx +( + __in DWORD dwUserIndex, // Index of the gamer associated with the device + __out XINPUT_STATE* pState // Receives the current state +) +{ + if (!controllerInit) + { + connectController(true); + } + if (controllerInit && dwUserIndex == 0) + { + XINPUT_GAMEPAD gamepadState = { 0 }; + + if (GameDetect::currentGame == GameID::Daytona3 || GameDetect::currentGame == GameID::PokkenTournament) + gamepadState.wButtons = *ffbOffset; + else + gamepadState.wButtons = 0; + +#ifdef _M_IX86 + if (GameDetect::currentGame == GameID::Daytona3) + { + gamepadState.bRightTrigger = daytonaPressStart ? 0xFF : 0x00; + gamepadState.sThumbLX |= (-(33024 - *ffbOffset2) * 255); + } +#endif + if (pState->dwPacketNumber == UINT_MAX) + pState->dwPacketNumber = 0; + else + pState->dwPacketNumber++; + pState->Gamepad = gamepadState; + return ERROR_SUCCESS; + } + else + { + return ERROR_DEVICE_NOT_CONNECTED; + } +} + +DWORD WINAPI XInputSetStateEx +( +__in DWORD dwUserIndex, // Index of the gamer associated with the device +__in XINPUT_VIBRATION_EX* pVibration // The vibration information to send to the controller +) +{ + if (!controllerInit) + { + connectController(true); + } + + if (controllerInit && dwUserIndex == 0) + { + int leftTriggerVal = iround(((float)pVibration->wLeftTriggerMotorSpeed / 65535) * 255); + int rightTriggerVal = iround(((float)pVibration->wRightTriggerMotorSpeed / 65535) * 255); + int leftVal = iround(((float)pVibration->wLeftMotorSpeed / 65535) * 255); + int rightVal = iround(((float)pVibration->wRightMotorSpeed / 65535) * 255); + + return ERROR_SUCCESS; + } + else + { + return ERROR_DEVICE_NOT_CONNECTED; + } +} + +LPCWSTR libName = L"xinput1_3.dll"; +LPCWSTR daytonalibName = L"xinput9_1_0.dll"; +LPCWSTR ptrToUse; + +static InitFunction XInputHook([]() +{ + if (GameDetect::currentGame == GameID::PokkenTournament || GameDetect::currentGame == GameID::SchoolOfRagnarok || GameDetect::currentGame == GameID::Daytona3) + { + controllerInit = true; + + MH_Initialize(); + + if (GameDetect::currentGame == GameID::Daytona3) + ptrToUse = daytonalibName; + else + ptrToUse = libName; + + MH_CreateHookApi(ptrToUse, "XInputGetState", &XInputGetState, NULL); + MH_CreateHookApi(ptrToUse, "XInputSetState", &XInputSetState, NULL); + MH_CreateHookApi(ptrToUse, "XInputGetCapabilities", &XInputGetCapabilities, NULL); + MH_CreateHookApi(ptrToUse, "XInputEnable", &XInputEnable, NULL); + MH_CreateHookApi(ptrToUse, "XInputGetDSoundAudioDeviceGuids", &XInputGetDSoundAudioDeviceGuids, NULL); + MH_CreateHookApi(ptrToUse, "XInputGetBatteryInformation", &XInputGetBatteryInformation, NULL); + MH_CreateHookApi(ptrToUse, "XInputGetKeystroke", &XInputGetKeystroke, NULL); + MH_CreateHookApi(ptrToUse, "XInputGetStateEx", &XInputGetStateEx, NULL); + MH_CreateHookApi(ptrToUse, "XInputSetStateEx", &XInputSetStateEx, NULL); + + MH_EnableHook(MH_ALL_HOOKS); + } +}); +#pragma optimize("", on)´ diff --git a/OpenParrot/src/Functions/PokkenXInputEmu.h b/OpenParrot/src/Functions/XInputEmu.h similarity index 100% rename from OpenParrot/src/Functions/PokkenXInputEmu.h rename to OpenParrot/src/Functions/XInputEmu.h From 88b210c092fbaec515e4148b8f9d473e94a9f8e4 Mon Sep 17 00:00:00 2001 From: Poliwrath Date: Wed, 1 May 2019 01:54:03 -0400 Subject: [PATCH 3/6] translate a few comments, remove English (New Zealand) traces, delete .aps file and gitignore it --- .gitignore | 1 + OpenParrot/premake5.lua | 2 +- .../src/Functions/Nesica_Libs/RfidEmu.cpp | 4 ++-- OpenParrot/src/OpenParrot.aps | Bin 2652 -> 0 bytes OpenParrot/src/OpenParrot.rc | Bin 5260 -> 4552 bytes 5 files changed, 4 insertions(+), 3 deletions(-) delete mode 100644 OpenParrot/src/OpenParrot.aps diff --git a/.gitignore b/.gitignore index 52396ce..7559923 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,4 @@ TeknoParrot/TeknoParrot\.vcxproj\.user ParrotLoader/ParrotLoader\.vcxproj\.user *.user +*.aps \ No newline at end of file diff --git a/OpenParrot/premake5.lua b/OpenParrot/premake5.lua index 36299c1..8d84af4 100644 --- a/OpenParrot/premake5.lua +++ b/OpenParrot/premake5.lua @@ -7,7 +7,7 @@ project "OpenParrot" { "src/**.cpp", "src/**.h", "deps/cpp/**.cpp", "deps/inc/**.h", - "src/OpenParrot.aps", "src/OpenParrot.rc" + "src/OpenParrot.rc" } includedirs { "src", "deps/inc/" } diff --git a/OpenParrot/src/Functions/Nesica_Libs/RfidEmu.cpp b/OpenParrot/src/Functions/Nesica_Libs/RfidEmu.cpp index 8b2561e..0335a43 100644 --- a/OpenParrot/src/Functions/Nesica_Libs/RfidEmu.cpp +++ b/OpenParrot/src/Functions/Nesica_Libs/RfidEmu.cpp @@ -144,10 +144,10 @@ public: for (DWORD i = sizeaddr; ipgWZOO?M17sX&`Gjl#00E!&bX*Njao{+0s z9FOr7d;FhHjhTGw`i#I&mjU~J+#DzAIIi@Q=SBM{Nz!;cJWabvoF=2;I3B#{bxxAB zY{mX488kX+I-G1KOKBH)P3QTzzpHR2whHsOHxzLLX_7@M9f8TUD~+)2InSbY;DmlN zu$^|RQg1r2Obc7O-1hhPD_(UbE}JG5uH+TGDDdkGd&)o1<>A4;GdCCS9|H57&W;C6 zOJ!uV!gk9ELf7}&u2=J6;bRzX)ozDTC30=t-nQ;w8-}u#`A;6k?5XiTUxz=GM6W}{ z&AOglZ&tZUCB4OS(z$mxa_=p;q7Qt*>g8j7Ne*CMTb{Lz`-suR7zt9&F)HYjevTq+ z9FY=!Ovw zwmNV^mPMI(KEBQ8qQIZM3L`%S|eeEL@V?4))3&yNS){^?;-yg5gSn;#K(@ZMW} zi3abFhJj*u&JacNr_*Z-eAavR{F3ajg%EAd4gyjxd(Pup_FE$@&##4l{)3#68p078 zc&KLZf)p^nw=))sWEk`}Vb4iV^%gxRJ@h?04EUFB3|_r5GvDPX<2%k$_bcSv)Hz}Q zcc}j(v&oP_{73A)AIKfz5yv6>6L>%bHWo3e3Jba__J}zgQ*R)q8xckLCN69CE!qo; zE$ysXpJ)9p@vc%|_A*hr1LoJ)vfPARCFa`aPo8h_3GM5&70m0a-Hy0VsaB83HKC4F zAkP!DvWZkhcB0A3?J8e2m5V>Km1>K}ImXFKFm?0Z^_+H84Ku7fB!YFBg=)erJEyab+X|oF he>Z#*OqyJ1lT}T}5kZ#o3vJf1M{wsa+Pn#O{s+VWyH5ZB diff --git a/OpenParrot/src/OpenParrot.rc b/OpenParrot/src/OpenParrot.rc index 1b667800014afb4d50f77dc03d766dc7c8f4cf6a..43457909149ba2663c9a7af8af32e4bdf999dc2c 100644 GIT binary patch delta 51 zcmeCtJfXZHgMBg=^P Date: Wed, 1 May 2019 02:09:28 -0400 Subject: [PATCH 4/6] Tiny darius code style change --- OpenParrot/src/Functions/Nesica_Libs/FastIoEmu.cpp | 2 +- OpenParrot/src/Functions/Nesica_Libs/NesysEmu.cpp | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/OpenParrot/src/Functions/Nesica_Libs/FastIoEmu.cpp b/OpenParrot/src/Functions/Nesica_Libs/FastIoEmu.cpp index 21798b3..a647b8c 100644 --- a/OpenParrot/src/Functions/Nesica_Libs/FastIoEmu.cpp +++ b/OpenParrot/src/Functions/Nesica_Libs/FastIoEmu.cpp @@ -53,7 +53,7 @@ int __cdecl iDmacDrvRegisterRead(int DeviceId, DWORD CommandCode, LPVOID OutBuff result = 0x00FF00FF; break; case 0x4004: - if(GameDetect::currentGame == GameID::DariusBurst) + if (GameDetect::currentGame == GameID::DariusBurst) { // I/O error without this switch result = 0x00FF00FF; diff --git a/OpenParrot/src/Functions/Nesica_Libs/NesysEmu.cpp b/OpenParrot/src/Functions/Nesica_Libs/NesysEmu.cpp index 08a720a..47acad0 100644 --- a/OpenParrot/src/Functions/Nesica_Libs/NesysEmu.cpp +++ b/OpenParrot/src/Functions/Nesica_Libs/NesysEmu.cpp @@ -481,11 +481,7 @@ void NesysEmu::Initialize(bool isDarius) { while (true) { - HANDLE pipe; - if(!isDarius) - pipe = CreateNamedPipeW(L"\\\\.\\pipe\\nesys_games", PIPE_ACCESS_DUPLEX, PIPE_TYPE_MESSAGE | PIPE_READMODE_MESSAGE | PIPE_WAIT, PIPE_UNLIMITED_INSTANCES, 8192, 8192, 0, nullptr); - else - pipe = CreateNamedPipeW(L"\\\\.\\pipe\\nesystest", PIPE_ACCESS_DUPLEX, PIPE_TYPE_MESSAGE | PIPE_READMODE_MESSAGE | PIPE_WAIT, PIPE_UNLIMITED_INSTANCES, 8192, 8192, 0, nullptr); + HANDLE pipe = CreateNamedPipeW(isDarius ? L"\\\\.\\pipe\\nesystest" : L"\\\\.\\pipe\\nesys_games", PIPE_ACCESS_DUPLEX, PIPE_TYPE_MESSAGE | PIPE_READMODE_MESSAGE | PIPE_WAIT, PIPE_UNLIMITED_INSTANCES, 8192, 8192, 0, nullptr); if (pipe == INVALID_HANDLE_VALUE) { From f52db0012556ed6f81dfeb7346530c234ff9214b Mon Sep 17 00:00:00 2001 From: Poliwrath Date: Wed, 1 May 2019 02:19:08 -0400 Subject: [PATCH 5/6] resource files are dumb --- OpenParrot/src/OpenParrot.rc | Bin 4552 -> 5260 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/OpenParrot/src/OpenParrot.rc b/OpenParrot/src/OpenParrot.rc index 43457909149ba2663c9a7af8af32e4bdf999dc2c..1b667800014afb4d50f77dc03d766dc7c8f4cf6a 100644 GIT binary patch delta 114 zcmX@1+@rZ6gMITXJ|@P=Y|Ohv{TNai${7?GqJVTFLk Date: Wed, 1 May 2019 02:25:16 -0400 Subject: [PATCH 6/6] DOES IT WORK YET?? --- OpenParrot/src/OpenParrot.rc | Bin 5260 -> 5260 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/OpenParrot/src/OpenParrot.rc b/OpenParrot/src/OpenParrot.rc index 1b667800014afb4d50f77dc03d766dc7c8f4cf6a..38c5d426259e872c577708fd179775dd1c4241b3 100644 GIT binary patch delta 21 bcmeCt?9tpH#>;51S)7-h1xU#Y<}w2SJkSKy delta 21 bcmeCt?9tpH#>;59S)7-h1xU#Y<}w2SJmUn{