1
0
mirror of synced 2025-02-23 13:39:06 +01:00

Move KOF Sky Stage Windowed bool to existing area

This commit is contained in:
Aaron M 2021-04-24 13:17:06 +12:00
parent a75ba16ae7
commit 5849329995

View File

@ -1510,6 +1510,26 @@ static InitFunction initFunction([]()
// skip dinput devices (TODO: maybe make original Dinput.dll wrapper?)
injector::WriteMemory<BYTE>(imageBase + 0xBD1D7, 0xEB, true);
DWORD oldPageProtection = 0;
if (ToBool(config["General"]["Windowed"]))
{
VirtualProtect((LPVOID)(imageBase + 0x21F290), 4, PAGE_EXECUTE_READWRITE, &oldPageProtection);
windowHooks hooks = { 0 };
hooks.createWindowExA = imageBase + 0x21F290;
init_windowHooks(&hooks);
VirtualProtect((LPVOID)(imageBase + 0x21F290), 4, oldPageProtection, &oldPageProtection);
// show cursor
injector::WriteMemory<BYTE>(imageBase + 0x12F6CA, 0x01, true);
injector::WriteMemory<BYTE>(imageBase + 0x12F7D8, 0xEB, true);
injector::WriteMemory<BYTE>(imageBase + 0x12F7FD, 0x01, true);
// change window title
static const char* title = "OpenParrot - The King of Fighters Sky Stage";
injector::WriteMemory<DWORD>(imageBase + 0xBE812, (DWORD)title, true);
}
}
if (GameDetect::currentGame == GameID::TroubleWitches)
@ -1669,29 +1689,6 @@ static InitFunction initFunction([]()
}
}
if (GameDetect::currentGame == GameID::KOFSkyStage100J)
{
DWORD oldPageProtection = 0;
if (ToBool(config["General"]["Windowed"]))
{
VirtualProtect((LPVOID)(imageBase + 0x21F290), 4, PAGE_EXECUTE_READWRITE, &oldPageProtection);
windowHooks hooks = { 0 };
hooks.createWindowExA = imageBase + 0x21F290;
init_windowHooks(&hooks);
VirtualProtect((LPVOID)(imageBase + 0x21F290), 4, oldPageProtection, &oldPageProtection);
// show cursor
injector::WriteMemory<BYTE>(imageBase + 0x12F6CA, 0x01, true);
injector::WriteMemory<BYTE>(imageBase + 0x12F7D8, 0xEB, true);
injector::WriteMemory<BYTE>(imageBase + 0x12F7FD, 0x01, true);
// change window title
static const char* title = "OpenParrot - The King of Fighters Sky Stage";
injector::WriteMemory<DWORD>(imageBase + 0xBE812, (DWORD)title, true);
}
}
if (GameDetect::currentGame == GameID::RaidenIII)
{
if (ToBool(config["General"]["Windowed"]))