diff --git a/data/ResidentEvilRevelations2.FusionFix/scripts/ResidentEvilRevelations2.FusionFix.ini b/data/ResidentEvilRevelations2.FusionFix/scripts/ResidentEvilRevelations2.FusionFix.ini index 0fe87645e..438662a56 100644 --- a/data/ResidentEvilRevelations2.FusionFix/scripts/ResidentEvilRevelations2.FusionFix.ini +++ b/data/ResidentEvilRevelations2.FusionFix/scripts/ResidentEvilRevelations2.FusionFix.ini @@ -5,4 +5,5 @@ DisableDamageOverlay = 1 DisableFilmGrain = 1 DisableFade = 0 // Not recommended FOVFactor = 1.0 -DisableCreateQuery = 0 // Use for potential performance improvement \ No newline at end of file +DisableCreateQuery = 0 // Use for potential performance improvement +ForceLogo = 0 // 0: Default, 1: Biohazard (r), 2 or 4: Resident Evil (r), 3: Resident Evil (tm) diff --git a/external/spdlog b/external/spdlog index 276ee5f5c..96a7d2a1d 160000 --- a/external/spdlog +++ b/external/spdlog @@ -1 +1 @@ -Subproject commit 276ee5f5c0eb13626bd367b006ace5eae9526d8a +Subproject commit 96a7d2a1d445689318dc899541f43794bc10a278 diff --git a/source/ResidentEvilRevelations2.FusionFix/dllmain.cpp b/source/ResidentEvilRevelations2.FusionFix/dllmain.cpp index b766070af..f9bc0a78c 100644 --- a/source/ResidentEvilRevelations2.FusionFix/dllmain.cpp +++ b/source/ResidentEvilRevelations2.FusionFix/dllmain.cpp @@ -248,7 +248,7 @@ void __fastcall sub_96C410(int _this, int edx, int a2, int a3) v9 = v10; if (IsSplitScreenActive()) - a2 += (int32_t)(720.0f * GetAspectRatio()) - (1280.0f / (1280.0f / GetNativeSplitScreenResX())); + a2 += (int32_t)((720.0f * GetAspectRatio()) - (1280.0f / (1280.0f / GetNativeSplitScreenResX()))); else a2 += (int32_t)(((720.0f * GetAspectRatio()) - 1280.0f) / 2.0f); @@ -356,12 +356,12 @@ void __fastcall sub_E18040(int _this, int edx, int a2) *((uint32_t*)v2 + 81) |= 1u; if (v13) { - v14 = 2.0 / (float)(v28 - v19); - v15 = -2.0 / (float)(v21 - v29); + v14 = 2.0f / (float)(v28 - v19); + v15 = -2.0f / (float)(v21 - v29); v13[0] = v14 * v4; v13[1] = v15 * v5; - v13[2] = (float)(v14 * v6) - 1.0; - v13[3] = (float)(v15 * v7) + 1.0; + v13[2] = (float)(v14 * v6) - 1.0f; + v13[3] = (float)(v15 * v7) + 1.0f; *((uint32_t*)v2 + 19) &= ~2u; switch (edx) @@ -373,42 +373,42 @@ void __fastcall sub_E18040(int _this, int edx, int a2) { if (v21 == GetCurrentSplitScreenResY() || v21 == (GetCurrentSplitScreenResY() + 1)) { - v14 = 2.0 / (float)(v28 - v19); - v15 = -2.0 / (float)(v21 - v29); + v14 = 2.0f / (float)(v28 - v19); + v15 = -2.0f / (float)(v21 - v29); v13[0] = v14 * v4 * ((edx == SUBTITLES) ? (1.0f / GetDiff()) : 1.0f); v13[1] = v15 * v5; v13[2] = (float)(v14 * v6) - (1.0f / GetDiff()); - v13[3] = (float)(v15 * v7) + 1.0; + v13[3] = (float)(v15 * v7) + 1.0f; } else if (v21 == GetResY()) { - v14 = 2.0 / (float)(v28 - v19); - v15 = -2.0 / (float)(v21 - v29); + v14 = 2.0f / (float)(v28 - v19); + v15 = -2.0f / (float)(v21 - v29); v13[0] = v14 * v4 * ((edx == SUBTITLES) ? (1.0f / GetDiff()) : 1.0f); v13[1] = v15 * v5; v13[2] = (float)(v14 * v6) - (1.0f / (GetAspectRatio() / defaultAspectRatio)); - v13[3] = (float)(v15 * v7) + 1.0; + v13[3] = (float)(v15 * v7) + 1.0f; } } else { - v14 = 2.0 / (float)(v28 - v19); - v15 = -2.0 / (float)(v21 - v29); + v14 = 2.0f / (float)(v28 - v19); + v15 = -2.0f / (float)(v21 - v29); v13[0] = v14 * v4 * ((edx == SUBTITLES) ? (1.0f / GetDiff()) : 1.0f); v13[1] = v15 * v5; v13[2] = (float)(v14 * v6) - (1.0f / GetDiff()); - v13[3] = (float)(v15 * v7) + 1.0; + v13[3] = (float)(v15 * v7) + 1.0f; } } break; case STRETCH: { - v14 = (2.0 * GetDiff()) / (float)(v28 - v19); - v15 = -2.0 / (float)(v21 - v29); + v14 = (2.0f * GetDiff()) / (float)(v28 - v19); + v15 = -2.0f / (float)(v21 - v29); v13[0] = v14 * v4; v13[1] = v15 * v5; v13[2] = -1.0f; //(float)(v14 * v6) - fDiffInv; - v13[3] = (float)(v15 * v7) + 1.0; + v13[3] = (float)(v15 * v7) + 1.0f; } break; case OFFSET: @@ -417,33 +417,33 @@ void __fastcall sub_E18040(int _this, int edx, int a2) { if (v21 == GetCurrentSplitScreenResY() || v21 == (GetCurrentSplitScreenResY() + 1)) { - v14 = 2.0 / (float)(v28 - v19); - v15 = -2.0 / (float)(v21 - v29); + v14 = 2.0f / (float)(v28 - v19); + v15 = -2.0f / (float)(v21 - v29); v13[0] = v14 * v4; v13[1] = v15 * v5; v13[2] = (float)(v14 * v6) - (1.0f / GetDiff()); - v13[3] = (float)(v15 * v7) + 1.0; + v13[3] = (float)(v15 * v7) + 1.0f; } else if (v21 == GetResY()) { - v14 = 2.0 / (float)(v28 - v19); - v15 = -2.0 / (float)(v21 - v29); + v14 = 2.0f / (float)(v28 - v19); + v15 = -2.0f / (float)(v21 - v29); v13[0] = v14 * v4; v13[1] = v15 * v5; v13[2] = (float)(v14 * v6) - (1.0f / (GetAspectRatio() / defaultAspectRatio)); - v13[3] = (float)(v15 * v7) + 1.0; + v13[3] = (float)(v15 * v7) + 1.0f; } } else { if (v21 == GetResY()) { - v14 = 2.0 / (float)(v28 - v19); - v15 = -2.0 / (float)(v21 - v29); + v14 = 2.0f / (float)(v28 - v19); + v15 = -2.0f / (float)(v21 - v29); v13[0] = v14 * v4; v13[1] = v15 * v5; v13[2] = (float)(v14 * v6) - (1.0f / GetDiff()); - v13[3] = (float)(v15 * v7) + 1.0; + v13[3] = (float)(v15 * v7) + 1.0f; } } } @@ -476,7 +476,7 @@ void __fastcall sub_E18040(int _this, int edx, int a2) { goto LABEL_18; } - v18 = v20 + 0.25; + v18 = v20 + 0.25f; LABEL_19: v16 = a2; LABEL_20: @@ -777,6 +777,12 @@ DWORD WINAPI XInputGetStateHook(DWORD dwUserIndex, XINPUT_STATE* pState) return ret; } +int nForceLogo = 0; +int sub_984240() +{ + return nForceLogo - 1; +} + void Init() { CIniReader iniReader(""); @@ -790,6 +796,7 @@ void Init() if (fFOVFactor <= 0.0f) fFOVFactor = 1.0f; bDisableCreateQuery = iniReader.ReadInteger("MAIN", "DisableCreateQuery", 0) != 0; auto bAutoclicker = iniReader.ReadInteger("MAIN", "Autoclicker", 0) != 0; + nForceLogo = std::clamp(iniReader.ReadInteger("MAIN", "ForceLogo", 0), 0, 4); if (bSkipIntro) { @@ -979,6 +986,21 @@ void Init() hb_954B40.fun = injector::MakeCALL(pattern.get_first(), sub_954B40, true).get(); } + if (nForceLogo) + { + auto pattern = hook::pattern("E8 ? ? ? ? 83 F8 03 77 ? FF 24 85 ? ? ? ? 6A 01 68 04 8F 39 01"); + injector::MakeCALL(pattern.get_first(), sub_984240, true); + + pattern = hook::pattern("E8 ? ? ? ? 83 F8 03 0F 87 ? ? ? ? FF 24 85 ? ? ? ? 68 E8 8E 39 01"); + injector::MakeCALL(pattern.get_first(), sub_984240, true); + + pattern = hook::pattern("E8 ? ? ? ? 83 F8 03 77 ? FF 24 85 ? ? ? ? 6A 01 68 E8 EC 3B 01"); + injector::MakeCALL(pattern.get_first(), sub_984240, true); + + pattern = hook::pattern("E8 ? ? ? ? 83 F8 03 0F 87 ? ? ? ? FF 24 85 ? ? ? ? 68 B4 EC 3B 01"); + injector::MakeCALL(pattern.get_first(), sub_984240, true); + } + { static auto sPlayerPtr = *hook::get_pattern("8B 0D ? ? ? ? 56 E8 ? ? ? ? 85 C0 74 7B 8B C8", 2);