Skip to content

Commit 12e5c6d

Browse files
authored
Fix gravestone puzzle alignment when viewed from memos (#1131)
1 parent fbc64a3 commit 12e5c6d

File tree

3 files changed

+36
-3
lines changed

3 files changed

+36
-3
lines changed

Patches/Common.cpp

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ float *RPTClosetCutsceneBlurredBarsDespawnAddr = nullptr;
101101
BYTE *InputAssignmentFlagAddr = nullptr;
102102
BYTE *PauseMenuQuitIndexAddr = nullptr;
103103
int16_t *MemoCountIndexAddr = nullptr;
104+
BYTE *MemoUniqueIdAddr = nullptr;
104105
BYTE *QuitSubmenuFlagAddr = nullptr;
105106
BYTE *MousePointerVisibleFlagAddr = nullptr;
106107
int32_t *MemoListIndexAddr = nullptr;
@@ -2436,6 +2437,36 @@ BYTE* GetReadingMemoFlagPointer()
24362437
return ReadingMemoFlagAddr;
24372438
}
24382439

2440+
BYTE GetMemoUniqueId()
2441+
{
2442+
BYTE* pMemoUniqueId = GetMemoUniqueIdPointer();
2443+
2444+
return (pMemoUniqueId) ? *pMemoUniqueId : 0;
2445+
}
2446+
2447+
BYTE* GetMemoUniqueIdPointer()
2448+
{
2449+
if (MemoUniqueIdAddr)
2450+
{
2451+
return MemoUniqueIdAddr;
2452+
}
2453+
2454+
switch (GameVersion)
2455+
{
2456+
case SH2V_10:
2457+
MemoUniqueIdAddr = reinterpret_cast<BYTE*>(0x94D860);
2458+
break;
2459+
case SH2V_11:
2460+
MemoUniqueIdAddr = reinterpret_cast<BYTE*>(0x951460);
2461+
break;
2462+
case SH2V_DC:
2463+
MemoUniqueIdAddr = reinterpret_cast<BYTE*>(0x950460);
2464+
break;
2465+
}
2466+
2467+
return MemoUniqueIdAddr;
2468+
}
2469+
24392470
DWORD* GetDrawCursorPointer()
24402471
{
24412472
if (DrawCursorAddr)

Patches/Patches.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,7 @@ int16_t GetMemoCountIndex();
438438
int32_t GetMemoInventory();
439439
BYTE GetMousePointerVisibleFlag();
440440
BYTE GetReadingMemoFlag();
441+
BYTE GetMemoUniqueId();
441442
float GetGlobalFadeHoldValue();
442443
float GetPuzzleCursorHorizontalPos();
443444
float GetPuzzleCursorVerticalPos();
@@ -543,6 +544,7 @@ int16_t *GetMemoCountIndexPointer();
543544
int32_t *GetMemoInventoryPointer();
544545
BYTE *GetMousePointerVisibleFlagPointer();
545546
BYTE *GetReadingMemoFlagPointer();
547+
BYTE *GetMemoUniqueIdPointer();
546548
DWORD *GetDrawCursorPointer();
547549
DWORD *GetSetShowCursorPointer();
548550
BYTE* GetInputAssignmentFlagPointer();
@@ -640,7 +642,6 @@ void PatchFullscreenImages();
640642
void PatchFullscreenVideos();
641643
void PatchGameLoad();
642644
void PatchGameLoadFlashFix();
643-
void PatchGravestoneBoardsFix();
644645
void PatchHealthIndicatorOption();
645646
void PatchGreatKnifeBoatSpeed();
646647
void PatchHoldDamage();

Patches/PuzzleAlignmentFixes.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ static DrawUserInterfaceFunc DrawUserInterface = nullptr;
88

99
void GravestoneBoardsFix(UIElement* uiElement)
1010
{
11-
// Check we're in the grave room and examining the gravestone
12-
if (GetRoomID() == R_MAN_GRAVE_ROOM && IsInFullScreenImageEvent())
11+
// Check we're in the grave room and examining the gravestone or reading memo 54
12+
if ((GetRoomID() == R_MAN_GRAVE_ROOM && IsInFullScreenImageEvent()) ||
13+
(GetReadingMemoFlag() && GetEventIndex() == EVENT_MEMO_LIST && GetMemoUniqueId() == 54))
1314
{
1415
// Step 1: Adjust the texture coordinates for each board to more closely match eachother
1516

0 commit comments

Comments
 (0)