From bf2e810657b0413aa01290d06b8fc104626e7502 Mon Sep 17 00:00:00 2001 From: Boomslangnz Date: Fri, 16 Nov 2018 08:36:29 +1300 Subject: [PATCH 1/3] Added system taskkill for InpWrapper --- OpenParrot/src/Functions/Global.cpp | 36 ++++++++++++++++++----------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/OpenParrot/src/Functions/Global.cpp b/OpenParrot/src/Functions/Global.cpp index 09536fd..e752fb6 100644 --- a/OpenParrot/src/Functions/Global.cpp +++ b/OpenParrot/src/Functions/Global.cpp @@ -1,6 +1,7 @@ #include #include #include "Global.h" +#include "Utility/GameDetect.h" #pragma optimize("", off) void *__cdecl memcpy_0(void *a1, const void *a2, size_t a3) @@ -35,20 +36,27 @@ std::wstring utf8_decode(const std::string &str) return wstrTo; } -DWORD WINAPI QuitGameThread(__in LPVOID lpParameter) -{ - while (true) - { - if (GetAsyncKeyState(VK_ESCAPE)) - { -#ifndef _DEBUG - TerminateProcess(GetCurrentProcess(), 0); -#endif - //ExitProcess(0); - } - - Sleep(300); - } +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)) + { +#ifndef _DEBUG + TerminateProcess(GetCurrentProcess(), 0); +#endif + //ExitProcess(0); + } + + Sleep(300); + } } /* WINDOW HOOKS */ From e78b0f0394978e19410e08ee573d29730ec998aa Mon Sep 17 00:00:00 2001 From: Boomslangnz Date: Thu, 22 Nov 2018 18:11:53 +1300 Subject: [PATCH 2/3] Added option to hide mouse cursor out of way on Daytona3 --- OpenParrot/src/Functions/Games/Other/Daytona3.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/OpenParrot/src/Functions/Games/Other/Daytona3.cpp b/OpenParrot/src/Functions/Games/Other/Daytona3.cpp index 8a28b1d..798c303 100644 --- a/OpenParrot/src/Functions/Games/Other/Daytona3.cpp +++ b/OpenParrot/src/Functions/Games/Other/Daytona3.cpp @@ -266,6 +266,10 @@ static InitFunction Daytona3Func([]() { injector::WriteMemoryRaw(imageBase + 0x17CD3D, "\x00", 1, true); } + if (ToBool(config["General"]["Hide Cursor"])) + { + SetCursorPos(2000, 2000); + } MH_Initialize(); MH_CreateHook((void*)(imageBase + 0x1E9280), ControlsFunction, (void**)&g_origControlsFunction); MH_EnableHook(MH_ALL_HOOKS); From 0a4dea24a9680f5d720cdda6016a76758f0c724f Mon Sep 17 00:00:00 2001 From: Boomslangnz Date: Mon, 3 Dec 2018 21:11:04 +1300 Subject: [PATCH 3/3] Modified Daytona 3 again to make ffb work correctly --- OpenParrot/src/Functions/Games/Other/Daytona3.cpp | 1 + OpenParrot/src/Functions/PokkenXInputEmu.cpp | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/OpenParrot/src/Functions/Games/Other/Daytona3.cpp b/OpenParrot/src/Functions/Games/Other/Daytona3.cpp index 798c303..cf62163 100644 --- a/OpenParrot/src/Functions/Games/Other/Daytona3.cpp +++ b/OpenParrot/src/Functions/Games/Other/Daytona3.cpp @@ -256,6 +256,7 @@ static InitFunction Daytona3Func([]() injector::WriteMemoryRaw(imageBase + 0xDD697, "\x90\x90\x90\x90\x90\x90\x38\x05\xC8\xF9\x5A\x01\x90\x90\x90\x90\x90\x90", 18, true); injector::WriteMemoryRaw(imageBase + 0x12958F, "\x33\xC0\x8A\x45\x08\x90\x90\x90\x90\x72\x08\x66\xA3\x46\xFC\x5A\x01\xEB\x06\x66\xA3\x44\xFC\x5A\x01\x31\xFF\x31\xF6\x47\xBE\x0F\x00\x00\x00\xEB\x4C\x90\x90\x90\x90", 41, true); injector::WriteMemoryRaw(imageBase + 0xD8616C, "\x2E\x2E\x2F\x73\x68\x65\x6C\x6C\x00\x00\x00\x00\x00\x00\x00\x00\x2E\x2E\x2F\x73\x68\x65\x6C\x6C\x5C\x49\x6E\x70\x57\x72\x61\x70\x70\x65\x72\x2E\x65\x78\x65\x00\x00\x00\x00\x00\x00\x00\x00\x00", 48, true); + injector::WriteMemoryRaw(imageBase + 0x7D087, "\x85\xFF\x0F\x84\xE9\x01\x00\x00\x6A\x00\x8B\xCF\xE8\xC8\xD2\x21\x00\x8D\x80\x00\x80\x00\x00\x89\x46\x40\x6A\x05\x8B\xCF\xE8\xB6\xD2\x21\x00\xC1\xE0\x08\x89\x46\x44\x6A\x04\x8B\xCF\xE8\xA7\xD2\x21\x00\xC1\xE0\x08\x89\x46\x48\x90\xEB\x2E\xE8\xE9\xD4\x21\x00\x8B\x5E\x04\x8B\xF8\x8B\xCF\xE8\x2D\xD5\x21\x00\x8D\x4B\x01\x3B\xC1\x0F\x8C\x9A\x01\x00\x00\x53\x8B\xCF\xE8\xDA\xD4\x21\x00\x8B\xF8\xEB\x9D\x90\x90\x90\x90\x90\x90", 105, true); injector::MakeNOP(imageBase + 0x1DDDFA, 5); injector::MakeNOP(imageBase + 0x1DDE1E, 6); injector::MakeNOP(imageBase + 0x1DDE45, 6); diff --git a/OpenParrot/src/Functions/PokkenXInputEmu.cpp b/OpenParrot/src/Functions/PokkenXInputEmu.cpp index 9f3a09b..68841df 100644 --- a/OpenParrot/src/Functions/PokkenXInputEmu.cpp +++ b/OpenParrot/src/Functions/PokkenXInputEmu.cpp @@ -57,6 +57,7 @@ int iround(double num) { } extern int* ffbOffset; +extern int* ffbOffset2; DWORD WINAPI XInputGetState ( @@ -81,6 +82,10 @@ DWORD WINAPI XInputGetState { gamepadState.bRightTrigger = daytonaPressStart ? 0xFF : 0x00; } + if (GameDetect::currentGame == GameID::Daytona3) + { + gamepadState.sThumbLX |= (-(33024 - *ffbOffset2) * 255); + } #endif if (pState->dwPacketNumber == UINT_MAX) pState->dwPacketNumber = 0; @@ -285,8 +290,11 @@ DWORD WINAPI XInputGetStateEx { 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