-==-
Intangible Hurtbubble Display Only
Skips hurtbubble draw during collision bubble display if not in an intangible state.
[Punkline]
Version -- DOL Offset ------ Hex to Replace ---------- ASM Code
1.02 ----- 0x800806d8 --- 4BF89B6D -> Branch
# INJECTION @ 800806d8 : bl -> 0x8000A244
# r3 = start of hurtbox
# r4, r5 = arguments passed to collision bubble display function
lwz r6, 0(r3)
cmpwi r6, 2 # 2 == intan state
beql 0x8000a244 # if intan, then display
return:
.long 0x00000000
-==-
Force Display of Intangible Hurtbubbles
Overhauls the collision bubble display state to serve the purpose of displaying intangible hurtbubbles while they are active. Turns off display when they are inactive.
[Punkline]
Version -- DOL Offset ------ Hex to Replace ---------- ASM Code
1.02 ----- 0x800a0dac --- 9421FFC0 -> Branch
# INJECTION @ 800a0dac : stwu sp, -0x40(sp)
# we use the stack frame to store a variable for us
stwu sp, -0x50(sp) # we add 0x10 to the stack frame for our own use
li r0, 0
stw r0, 0x48(sp) # 0x48(sp) is now our variable for ORing the hurtbox status
return:
.long 0x00000000
---------- 0x800a0dec --- C05D0028 -> Branch
# INJECTION @ 800a0dec : lfs f2, 0x28(r29)
# r29 = current hurtbox in loop
# -- code simply checks for intangible status and ors to value in stack
# -- intan status is "2" and max ID is "2"--so we can rely on the "2" bit like a bool
# freshly returned from update function, no return values
# so volatile registers are free
lwz r3, 0(r29) # load status (0, 1, or 2)
lwz r4, 0x48(sp) # load ORed status
or r3, r3, r4
stw r3, 0x48(sp) # OR status to the variable
return:
lfs f2, 0x28(r29)
.long 0x00000000
---------- 0x800a0ee0 --- 80010044 -> Branch
# INJECTION @ 800a0ee0 : lwz r0, 0x0044 (sp)
# r27 = internal player data BA
# -- code checks the ors for any intangible bones and uses it to inform collision display
lbz r4, 0x21FC(r27) # player display state
ori r5, r4, 0x02 # r5 = added toggle for collision bubble display
lwz r3, 0x1988(r27) # r3 = player body state
lwz r6, 0x198C(r27) # r6 = ... other body state (both seem to be used separately)
or r3, r3, r6 #
andi. r3, r3, 2 # check 2 bit like a bool
bne display # if body state is intangible, display
lwz r3, 0x48(sp)
andi. r3, r3, 2 # check 2 bit like a bool (we ORed values that might include 1)
bne display # if OR loop collected any 2 bits, then toggle on display
noDisplay: # else, toggle off display
andi. r5, r4, 0xFD
display:
stb r5, 0x21FC(r27)
return:
lwz r0, 0x0054 (sp) # we add 0x10 to the original instruction because of our change to the stack
.long 0x00000000
---------- 0x800a0ef4 --- 38210040 -> # OVERWRITE @ 800a0ef4 :
# addi sp, sp, 0x40
# ->
addi sp, sp, 0x50