1
0
mirror of synced 2025-01-20 17:48:51 +01:00

more FNF fixes

SuperBikes2 TEST button now working again!
SuperBikes2 TOGGLE MANUAL-AUTO now working!
**Shifting Gear Up** is done like this: when GAS pressed, just press SHIFT button.
**Shifting Gear Down** is done like this: when BRAKE pressed, just press SHIFT button.
SuperBikes2 VIEW button is now working too!
This commit is contained in:
00C0FFEE 2019-06-27 10:13:19 +02:00
parent 2bfd24c0f5
commit cc576b6d2a
6 changed files with 49 additions and 30 deletions

View File

@ -388,6 +388,9 @@ static InitFunction FNFFunc([]()
injector::MakeNOP((0x4159B + BaseAddress3), 14);
injector::WriteMemory<BYTE>((0x415AA + BaseAddress3), DIK_BACK, true);
// REMOVE ESC BOX
injector::MakeNOP((0x440A0B), 5, true);
MH_Initialize();
MH_CreateHookApi(L"user32.dll", "SetCursorPos", &SetCursorPosRT3, (void**)&original_SetCursorPosRT3);
MH_CreateHookApi(L"user32.dll", "DefWindowProcA", &DefWindowProcART3, (void**)&original_DefWindowProcA3);

View File

@ -316,6 +316,9 @@ static InitFunction FNFDriftFunc([]()
injector::MakeNOP((0x57B35 + BaseAddress), 14);
injector::WriteMemory<BYTE>((0x57B44 + BaseAddress), DIK_BACK, true);
// REMOVE ESC BOX
injector::MakeNOP((0x455FC8), 5, true);
CreateThread(NULL, 0, InputRT, NULL, 0, NULL);
if (ToBool(config["General"]["Windowed"]))

View File

@ -110,8 +110,7 @@ DWORD WINAPI InputRT4(LPVOID lpParam)
}
// buttons see bitwise values in TPui//RawThrills.cs
// START
// START
if (*ffbOffset & 0x08)
{
injector::WriteMemory<BYTE>((keyboardBuffer + DIK_SPACE), 2, true);
@ -391,6 +390,9 @@ static InitFunction FNFSBFunc([]()
injector::MakeNOP((0x4C426 + BaseAddress4), 14);
injector::WriteMemory<BYTE>((0x4C435 + BaseAddress4), DIK_BACK, true);
// REMOVE ESC BOX
injector::MakeNOP((0x44B4B5), 5, true);
MH_Initialize();
MH_CreateHookApi(L"user32.dll", "SetCursorPos", &SetCursorPosRT4, (void**)&original_SetCursorPosRT4);
MH_CreateHookApi(L"user32.dll", "DefWindowProcA", &DefWindowProcART4, (void**)&original_DefWindowProcA4);

View File

@ -354,6 +354,9 @@ static InitFunction FNFSCFunc([]()
// REMOVE CMD WATSON nonsense
injector::MakeNOP((0x5F3882), 2, true);
// REMOVE ESC BOX
injector::MakeNOP((0x464A58), 5, true);
CreateThread(NULL, 0, InputRT2, NULL, 0, NULL);
MH_Initialize();

View File

@ -25,7 +25,8 @@ static bool button1pressed = false;
static bool button2pressed = false;
static bool button3pressed = false;
static bool button4pressed = false;
static bool viewpressed = false;
static bool normalview = false;
static bool geartoggpressed = false;
static bool PINpressed = false;
static bool NUMpressed = false;
static bool NUMpressed0 = false;
@ -273,14 +274,15 @@ DWORD WINAPI InputRT5(LPVOID lpParam)
// TEST
if (*ffbOffset & 0x01)
{
injector::WriteMemory<BYTE>((keyboardBuffer + DIK_RBRACKET), 2, true);
injector::WriteMemory<BYTE>((keyboardBuffer + DIK_RETURN), 2, true);
injector::MakeNOP((0x6ABB9 + BaseAddress5), 23, true);
}
// NITRO ( = START too)
// NITRO / Neon Color
if (*ffbOffset & 0x100)
{
if (button1pressed == false)
{
injector::WriteMemory<BYTE>((keyboardBuffer + DIK_SPACE), 2, true);
injector::WriteMemory<BYTE>((keyboardBuffer + DIK_A), 2, true);
injector::WriteMemory<BYTE>((keyboardBuffer + DIK_N), 2, true);
button1pressed = true;
}
@ -292,12 +294,22 @@ DWORD WINAPI InputRT5(LPVOID lpParam)
button1pressed = false;
}
}
// BUTTON 1/ VIEW 1
// BUTTON 1/ VIEW
if (*ffbOffset & 0x200)
{
if (button2pressed == false)
{
injector::WriteMemory<BYTE>((keyboardBuffer + DIK_A), 2, true);
injector::WriteMemoryRaw((0x718F5 + BaseAddress5), "\x90\x90", 2, true);
if (normalview == false)
{
injector::WriteMemoryRaw((0x718F8 + BaseAddress5), "\x24\xD9 ", 2, true);
normalview = true;
}
else
{
injector::WriteMemoryRaw((0x718F8 + BaseAddress5), "\xA8\xD7 ", 2, true);
normalview = false;
}
button2pressed = true;
}
}
@ -305,16 +317,18 @@ DWORD WINAPI InputRT5(LPVOID lpParam)
{
if (button2pressed == true)
{
injector::WriteMemoryRaw((0x718F8 + BaseAddress5), "\x8C\xD7 ", 2, true);
injector::WriteMemoryRaw((0x718F5 + BaseAddress5), "\x74\x14", 2, true);
button2pressed = false;
}
}
// BUTTON 2/ VIEW ? (+ RIGHT BRAKE)
// BUTTON 2/ SHIFT LEVER / Bike Color
if (*ffbOffset & 0x400)
{
if (button3pressed == false)
{
injector::WriteMemory<BYTE>((keyboardBuffer + DIK_B), 2, true);
injector::WriteMemory<BYTE>((keyboardBuffer + DIK_4), 2, true);
injector::WriteMemory<BYTE>((keyboardBuffer + DIK_B), 2, true);
button3pressed = true;
}
}
@ -325,7 +339,7 @@ DWORD WINAPI InputRT5(LPVOID lpParam)
button3pressed = false;
}
}
// BUTTON 3/ MUSIC (+ LEFT BRAKE)
// BUTTON 3/ MUSIC / Change Pilot
if (*ffbOffset & 0x800)
{
if (button4pressed == false)
@ -342,22 +356,23 @@ DWORD WINAPI InputRT5(LPVOID lpParam)
button4pressed = false;
}
}
// BUTTON VIEW
// BUTTON MENU TOGGLE MANUAL-AUTO
if (*ffbOffset & 0x10)
{
if (viewpressed == false)
if (geartoggpressed == false)
{
// TO-DO
// injector::WriteMemory<BYTE>((keyboardBuffer + DIK_ESCAPE), 2, true);
// injector::WriteMemory<BYTE>((keyboardBuffer + DIK_RETURN), 2, true);
viewpressed = true;
injector::MakeNOP((0x226B6 + BaseAddress5), 6, true);
injector::MakeNOP((0x226CB + BaseAddress5), 6, true);
geartoggpressed = true;
}
}
else
{
if (viewpressed == true)
if (geartoggpressed == true)
{
viewpressed = false;
injector::WriteMemoryRaw((0x226B6 + BaseAddress5), "\x0F\x84\x9A\x00\x00\x00", 6, true);
injector::WriteMemoryRaw((0x226CB + BaseAddress5), "\x0F\x84\x85\x00\x00\x00", 6, true);
geartoggpressed = false;
}
}
// BUTTON ENTER-PIN
@ -613,6 +628,9 @@ static InitFunction FNFSB2Func([]()
// REMOVE CMD WATSON nonsense
injector::MakeNOP((0x529E62), 2, true);
// REMOVE ESC BOX
injector::MakeNOP((0x4714DA), 5, true);
// Force correct backbuffer format
injector::MakeJMP(BaseAddress5 + 0xB7BD2, BaseAddress5 + 0xB7BE3, true);

View File

@ -376,17 +376,7 @@ HRESULT __stdcall Hook_DirectInput8Create(HINSTANCE hinst, DWORD dwVersion, REFI
static InitFunction initFunc([]()
{
if (GameDetect::currentGame == GameID::PokkenTournament)
return;
if (GameDetect::currentGame == GameID::FNFDrift)
return;
if (GameDetect::currentGame == GameID::FNFSC)
return;
if (GameDetect::currentGame == GameID::FNF)
return;
if (GameDetect::currentGame == GameID::FNFSB)
return;
if (GameDetect::currentGame == GameID::GHA)
if (GameDetect::currentGame == GameID::PokkenTournament || GameDetect::currentGame == GameID::FNFDrift || GameDetect::currentGame == GameID::FNFSC || GameDetect::currentGame == GameID::FNF || GameDetect::currentGame == GameID::FNFSB || GameDetect::currentGame == GameID::FNFSB2 || GameDetect::currentGame == GameID::GHA)
return;
MH_Initialize();