From 58493299951611cc67eaa3edb80846ab473cd34d Mon Sep 17 00:00:00 2001 From: Aaron M Date: Sat, 24 Apr 2021 13:17:06 +1200 Subject: [PATCH] Move KOF Sky Stage Windowed bool to existing area --- .../Functions/Games/TypeX2/TypeX2Generic.cpp | 43 +++++++++---------- 1 file changed, 20 insertions(+), 23 deletions(-) diff --git a/OpenParrot/src/Functions/Games/TypeX2/TypeX2Generic.cpp b/OpenParrot/src/Functions/Games/TypeX2/TypeX2Generic.cpp index e89e6a1..00afd4e 100644 --- a/OpenParrot/src/Functions/Games/TypeX2/TypeX2Generic.cpp +++ b/OpenParrot/src/Functions/Games/TypeX2/TypeX2Generic.cpp @@ -1510,6 +1510,26 @@ static InitFunction initFunction([]() // skip dinput devices (TODO: maybe make original Dinput.dll wrapper?) injector::WriteMemory(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(imageBase + 0x12F6CA, 0x01, true); + injector::WriteMemory(imageBase + 0x12F7D8, 0xEB, true); + injector::WriteMemory(imageBase + 0x12F7FD, 0x01, true); + + // change window title + static const char* title = "OpenParrot - The King of Fighters Sky Stage"; + injector::WriteMemory(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(imageBase + 0x12F6CA, 0x01, true); - injector::WriteMemory(imageBase + 0x12F7D8, 0xEB, true); - injector::WriteMemory(imageBase + 0x12F7FD, 0x01, true); - - // change window title - static const char* title = "OpenParrot - The King of Fighters Sky Stage"; - injector::WriteMemory(imageBase + 0xBE812, (DWORD)title, true); - } - } - if (GameDetect::currentGame == GameID::RaidenIII) { if (ToBool(config["General"]["Windowed"]))