add DeathlessBlooperSurfing
This commit is contained in:
parent
01e1c09997
commit
a4739844e3
2 changed files with 31 additions and 0 deletions
3
src/DeathlessBlooperSurfing.ld
Normal file
3
src/DeathlessBlooperSurfing.ld
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
$$ = 0;
|
||||||
|
|
||||||
|
$C2$.onSurfClash = (DEFINED(SMS__GMSJ01) ? 0x248 : 0x24c) + TMario.surfing;
|
28
src/DeathlessBlooperSurfing.s
Normal file
28
src/DeathlessBlooperSurfing.s
Normal 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:
|
Loading…
Reference in a new issue