diff --git a/Patches/Common.cpp b/Patches/Common.cpp index b79b5c23..78eab78b 100644 --- a/Patches/Common.cpp +++ b/Patches/Common.cpp @@ -98,6 +98,7 @@ float* MeetingMariaCutsceneFogCounterTwoAddr = nullptr; float* RPTClosetCutsceneMannequinDespawnAddr = nullptr; float* RPTClosetCutsceneBlurredBarsDespawnAddr = nullptr; BYTE* InputAssignmentFlagAddr = nullptr; +float* GlobalFadeHoldValueAddr = nullptr; bool ShowDebugOverlay = false; bool ShowInfoOverlay = false; @@ -2107,9 +2108,35 @@ BYTE GetInputAssignmentFlag() BYTE* GetInputAssignmentFlagPointer() { + if (InputAssignmentFlagAddr) + { + return InputAssignmentFlagAddr; + } + InputAssignmentFlagAddr = (BYTE*)((GameVersion == SH2V_10) ? 0x009415F5 : (GameVersion == SH2V_11) ? 0x009415F5 : (GameVersion == SH2V_DC) ? 0x009441F5 : NULL); return InputAssignmentFlagAddr; } + +float GetGlobalFadeHoldValue() +{ + float* pGlobalFadeHoldValue = GetGlobalFadeHoldValuePointer(); + + return (pGlobalFadeHoldValue) ? *pGlobalFadeHoldValue : 0; +} + +float* GetGlobalFadeHoldValuePointer() +{ + if (GlobalFadeHoldValueAddr) + { + return GlobalFadeHoldValueAddr; + } + + GlobalFadeHoldValueAddr = (float*)((GameVersion == SH2V_10) ? 0x0094262C : + (GameVersion == SH2V_11) ? 0x0094622C : + (GameVersion == SH2V_DC) ? 0x0094522C : NULL); + + return GlobalFadeHoldValueAddr; +} diff --git a/Patches/Patches.h b/Patches/Patches.h index bd008102..ec239f53 100644 --- a/Patches/Patches.h +++ b/Patches/Patches.h @@ -65,6 +65,7 @@ int32_t GetIsWritingQuicksave(); int32_t GetTextAddr(); float GetFrametime(); BYTE GetInputAssignmentFlag(); +float GetGlobalFadeHoldValue(); // Shared pointer function declaration DWORD *GetRoomIDPointer(); @@ -141,6 +142,7 @@ float *GetMeetingMariaCutsceneFogCounterTwoPointer(); float *GetRPTClosetCutsceneMannequinDespawnPointer(); float *GetRPTClosetCutsceneBlurredBarsDespawnPointer(); BYTE* GetInputAssignmentFlagPointer(); +float* GetGlobalFadeHoldValuePointer(); // Function patch declaration void CheckArgumentsForPID(); diff --git a/Resources/BuildNo.rc b/Resources/BuildNo.rc index d0c3e5c3..234b3f4c 100644 --- a/Resources/BuildNo.rc +++ b/Resources/BuildNo.rc @@ -1 +1 @@ -#define BUILD_NUMBER 2064 +#define BUILD_NUMBER 2065 diff --git a/Wrappers/d3d8/IDirect3DDevice8.cpp b/Wrappers/d3d8/IDirect3DDevice8.cpp index 6d89e68e..7bfa95f8 100644 --- a/Wrappers/d3d8/IDirect3DDevice8.cpp +++ b/Wrappers/d3d8/IDirect3DDevice8.cpp @@ -1900,8 +1900,13 @@ HRESULT m_IDirect3DDevice8::BeginScene() RunFlashlightClockPush(); } + // Fix cutscene James final blow to his wife + if (GetRoomID() == 0xBB && GetGlobalFadeHoldValue() == 2.0f) + { + IsInFakeFadeout = true; + } // Bowling cutscene fading - if (IsInFakeFadeout && GetCutsceneID() != 0x19) + else if (IsInFakeFadeout && GetCutsceneID() != 0x19) { IsInFakeFadeout = false; }