Daytona Usa 3 is now fixed
Fixed bug that boomslangz had which caused some control inputs to crash the game.
This commit is contained in:
parent
e37fa64ae3
commit
0b8ed332e3
@ -41,7 +41,9 @@ static void InjectKeys()
|
||||
if (track != 0)
|
||||
{
|
||||
BYTE track1 = *(BYTE *)(track + 0x4);
|
||||
#ifdef _DEBUG
|
||||
info(true, "%02X %02X", track1, gamestate);
|
||||
#endif
|
||||
if ((track1 == 2 || track1 == 4) && (gamestate == 0x16))
|
||||
{
|
||||
BYTE reverse = wheel * 0xFF;
|
||||
@ -49,18 +51,24 @@ static void InjectKeys()
|
||||
*(BYTE *)(imageBase + 0x15B4678) = 0xFF;
|
||||
else
|
||||
*(BYTE *)(imageBase + 0x15B4678) = reverse;
|
||||
#ifdef _DEBUG
|
||||
info(true, "Reverse wheel");
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
*(BYTE *)(imageBase + 0x15B4678) = wheel;
|
||||
#ifdef _DEBUG
|
||||
info(true, "Normal wheel1");
|
||||
#endif
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
*(BYTE *)(imageBase + 0x15B4678) = wheel;
|
||||
#ifdef _DEBUG
|
||||
info(true, "Normal wheel2");
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@ -208,8 +216,18 @@ static void InjectKeys()
|
||||
}
|
||||
}
|
||||
|
||||
int(__stdcall *g_origControlsFunction)();
|
||||
|
||||
int __stdcall ControlsFunction()
|
||||
{
|
||||
int result = g_origControlsFunction();
|
||||
InjectKeys();
|
||||
return result;
|
||||
}
|
||||
|
||||
static InitFunction Daytona3Func([]()
|
||||
{
|
||||
|
||||
imageBase = (uintptr_t)GetModuleHandleA(0);
|
||||
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::MakeNOP(imageBase + 0x1DDDFA, 5);
|
||||
@ -218,7 +236,9 @@ static InitFunction Daytona3Func([]()
|
||||
injector::MakeNOP(imageBase + 0x1DE10D, 6);
|
||||
injector::MakeNOP(imageBase + 0x29B481, 3);
|
||||
injector::MakeNOP(imageBase + 0x29B513, 4);
|
||||
MH_Initialize();
|
||||
MH_CreateHook((void*)(imageBase + 0x1E9280), ControlsFunction, (void**)&g_origControlsFunction);
|
||||
MH_EnableHook(MH_ALL_HOOKS);
|
||||
|
||||
injector::MakeCALL(imageBase + 0x1DDDFA, InjectKeys);
|
||||
}, GameID::Daytona3);
|
||||
#endif
|
@ -369,6 +369,12 @@ void GameDetect::DetectCurrentGame()
|
||||
currentGame = GameID::MachStorm;
|
||||
break;
|
||||
}
|
||||
if(*(uint32_t*)(moduleBase + 0xABB7) == 0x00E445C7 &&
|
||||
*(uint32_t*)(moduleBase + 0xABB7 + 4) == 0xC7000100)
|
||||
{
|
||||
currentGame = GameID::Daytona3;
|
||||
break;
|
||||
}
|
||||
#else
|
||||
// X64
|
||||
// School of Ragnarok
|
||||
|
Loading…
x
Reference in New Issue
Block a user