Skip to content

Commit d83edee

Browse files
committed
glf backspin item
1 parent 59f7952 commit d83edee

1 file changed

Lines changed: 36 additions & 0 deletions

File tree

src/hooks/Glf/items_Glf.cpp

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,5 +322,41 @@ TRAMPOLINE_DEF(0x803fac54, 0x803fac58) {
322322
// clang-format on
323323
}
324324

325+
bool GlfHasBackSpin() {
326+
return ItemMgr::GetInstance().IsGlfSpin();
327+
}
328+
329+
/**
330+
* @brief GlfHasBackSpin trampoline
331+
*/
332+
TRAMPOLINE_DEF(0x80414068, 0x80414088) {
333+
// clang-format off
334+
TRAMPOLINE_BEGIN
335+
336+
// r30 = pGlfBall
337+
mr r31, r3 // r31 = pSpinVel
338+
339+
bl GlfHasBackSpin
340+
cmpwi r3, 0
341+
beq NoBackSpin
342+
343+
// add spin velocity X+Y
344+
psq_l f1, 0x88(r30), 0, 0
345+
psq_l f0, 0x0(r31), 0, 0
346+
ps_add f0, f1, f0
347+
psq_st f0, 0x88(r30), 0, 0
348+
349+
// add spin velocity Z
350+
psq_l f1, 0x90(r30), 1, 0
351+
psq_l f0, 0x8(r31), 1, 0
352+
ps_add f0, f1, f0
353+
psq_st f0, 0x90(r30), 1, 0
354+
355+
NoBackSpin:
356+
TRAMPOLINE_END
357+
blr
358+
// clang-format on
359+
}
360+
325361
} // namespace Glf
326362
} // namespace AP

0 commit comments

Comments
 (0)