From b6f62286afd37499bfc4d12fc2ed4853e79f887f Mon Sep 17 00:00:00 2001 From: Reaver Date: Mon, 1 Nov 2021 16:53:14 +0200 Subject: [PATCH] Fix APM3 Emu - Fix badly emulated APM3 call - Add profiles for new dumped titles --- OpenParrot/src/Functions/Games/APM3/APM3.cpp | 22 ++++++++++++++++++-- OpenParrot/src/Utility/GameDetect.cpp | 6 ++++++ OpenParrot/src/Utility/GameID.h | 4 +++- 3 files changed, 29 insertions(+), 3 deletions(-) diff --git a/OpenParrot/src/Functions/Games/APM3/APM3.cpp b/OpenParrot/src/Functions/Games/APM3/APM3.cpp index 4704185..a355a0f 100644 --- a/OpenParrot/src/Functions/Games/APM3/APM3.cpp +++ b/OpenParrot/src/Functions/Games/APM3/APM3.cpp @@ -536,12 +536,14 @@ SystemRegionCode System_getRegionCode() return SystemRegionCode::Japan; } -DWORD_PTR System_getResolution() +DWORD_PTR resolution = 0; + +DWORD_PTR *System_getResolution() { #ifdef _LOGAPM3 info(true, "System_getResolution"); #endif - return System_getResolutionReturnValue; + return &resolution; } DWORD_PTR System_isDevelop() @@ -1067,6 +1069,22 @@ static InitFunction initDoa6TestFunc([]() __int64 mainModuleBase = (__int64)GetModuleHandle(0); }, GameID::Doa6Test); + +static InitFunction initNosferatuLilinorTestFunc([]() + { + HookAPM3(L"SDHP"); + __int64 mainModuleBase = (__int64)GetModuleHandle(0); + + }, GameID::NosferatuLilinor); + +static InitFunction initKasioriTestFunc([]() + { + HookAPM3(L"SDHV"); + __int64 mainModuleBase = (__int64)GetModuleHandle(0); + + }, GameID::Kasiori); + + #else void __declspec(naked) setOption_x86() diff --git a/OpenParrot/src/Utility/GameDetect.cpp b/OpenParrot/src/Utility/GameDetect.cpp index 514053f..3d27fbd 100644 --- a/OpenParrot/src/Utility/GameDetect.cpp +++ b/OpenParrot/src/Utility/GameDetect.cpp @@ -735,6 +735,12 @@ void GameDetect::DetectCurrentGame() case 0xd9557fd6: SetGameId(GameID::CottonRocknRollATest, "Cotton Rock n Roll A Test Menu"); break; + case 0x6dfc8f9a: + SetGameId(GameID::NosferatuLilinor, "Nosferatu Lilinor"); + break; + case 0x5451ddfd: + SetGameId(GameID::NosferatuLilinor, "Kasiori"); + break; #endif default: #ifdef _DEBUG diff --git a/OpenParrot/src/Utility/GameID.h b/OpenParrot/src/Utility/GameID.h index 6a80fd5..26028ed 100644 --- a/OpenParrot/src/Utility/GameID.h +++ b/OpenParrot/src/Utility/GameID.h @@ -126,5 +126,7 @@ enum class GameID WMMT5DX, Aleste11, CottonRocknRollA, - CottonRocknRollATest + CottonRocknRollATest, + NosferatuLilinor, + Kasiori }; \ No newline at end of file