1
0
Fork 0

add DeathlessBlooperSurfing

This commit is contained in:
sup39 2023-02-12 03:07:49 +09:00
parent 01e1c09997
commit a4739844e3
2 changed files with 31 additions and 0 deletions

View file

@ -0,0 +1,3 @@
$$ = 0;
$C2$.onSurfClash = (DEFINED(SMS__GMSJ01) ? 0x248 : 0x24c) + TMario.surfing;

View file

@ -0,0 +1,28 @@
.set rObjHead, 9
.set rObjPtr, 10
# prevent killing Mario and respawn Bloopers instead
.onSurfClash:
.prepare:
lwz r12, gpMapObjManager$r13(r13)
lwz rObjHead, 0x18(r12)
lwz rObjPtr, 0x14(r12)
slwi rObjPtr, rObjPtr, 2
add rObjPtr, rObjHead, rObjPtr
# find blooper and set active
.loop:
lwzu r12, -4(rObjPtr)
## check vtable
lwz r0, 0(r12)
xoris r0, r0, TSurfGesoObj.__vt@h
cmplwi r0, TSurfGesoObj.__vt@l
bne+ .loop.next
## clear 0x9 bit
lhz r0, 0xF2(r12)
andi. r0, r0, 0xffff-0x9
sth r0, 0xF2(r12)
.loop.next:
cmplw rObjPtr, rObjHead
bgt+ .loop
.loop.done: