Skip to content

Commit 31d0119

Browse files
committed
Added Golf Zoom and Topographical View Items
1 parent 5141156 commit 31d0119

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

src/hooks/hooks_Glf.cpp

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,16 @@ void GlfSetBlindFlag(bool hold2) {
2424
}
2525
}
2626

27+
u32 GlfDisableZoom(u32 input) {
28+
if (!ItemMgr::GetInstance().IsGlfViewLow()) return 0;
29+
else return input;
30+
}
31+
32+
u32 GlfDisableTopo(u32 input) {
33+
if (!ItemMgr::GetInstance().IsGlfViewSlope()) return 0;
34+
else return input;
35+
}
36+
2737
/**
2838
* @brief GlfSetBlindFlag trampoline
2939
*/
@@ -38,5 +48,39 @@ TRAMPOLINE_DEF(0x80406a1c, 0x80406a30) {
3848
// clang-format on
3949
}
4050

51+
/**
52+
* @brief GlfDisableZoom trampoline
53+
*/
54+
TRAMPOLINE_DEF(0x803facdc, 0x803face0) {
55+
// clang-format off
56+
TRAMPOLINE_BEGIN
57+
58+
lwz r0, 0x1c(r31)
59+
mr r3, r0
60+
bl GlfDisableZoom
61+
mr r0, r3
62+
63+
TRAMPOLINE_END
64+
blr
65+
// clang-format on
66+
}
67+
68+
/**
69+
* @brief GlfDisableTopo trampoline
70+
*/
71+
TRAMPOLINE_DEF(0x803fac64, 0x803fac68) {
72+
// clang-format off
73+
TRAMPOLINE_BEGIN
74+
75+
lwz r0, 0x1c(r31)
76+
mr r3, r0
77+
bl GlfDisableTopo
78+
mr r0, r3
79+
80+
TRAMPOLINE_END
81+
blr
82+
// clang-format on
83+
}
84+
4185
} // namespace Glf
4286
} // namespace AP

0 commit comments

Comments
 (0)