Punkline
Dr. Frankenstack
- Joined
- May 15, 2015
- Messages
- 423
Stop the display of GFX and textures when hitbox display is toggled on.
Update 1.2: Fixed a bug where item entities would trigger the new hook and confuse the hitbox display check logic.
Update 1.1: Rewrote code to use more inclusive hook provided by Achilles~
$UnobscuredHitboxDisplay1.2 (Melee 1.02) [Punkline, Achilles]
C205FDDC 00000008
2C040000 41820034
A1640000 2C0B0006
8164002C 40820014
816B0518 2C0B0000
41820018 816B002C
896B21FC 2C0B0001
41A20008 4E800020
7C0802A6 00000000
The injection mod contains ports for 1.00, 1.01, and PAL:
---
Update 1.2: Fixed a bug where item entities would trigger the new hook and confuse the hitbox display check logic.
Update 1.1: Rewrote code to use more inclusive hook provided by Achilles~
$UnobscuredHitboxDisplay1.2 (Melee 1.02) [Punkline, Achilles]
C205FDDC 00000008
2C040000 41820034
A1640000 2C0B0006
8164002C 40820014
816B0518 2C0B0000
41820018 816B002C
896B21FC 2C0B0001
41A20008 4E800020
7C0802A6 00000000
The injection mod contains ports for 1.00, 1.01, and PAL:
Code:
-==-
Unobscured Hitbox Display 1.2
Prevent GFX from spawning during hitbox display.
[Punkline, Achilles]
Version -- DOL Offset ------ Hex to Replace ---------- ASM Code
PAL ------- 0x5D080 ---- 7C0802A6 -> Branch
2C040000 41820034
A1640000 2C0B0006
8164002C 40820014
816B0518 2C0B0000
41820018 816B002C
896B21FC 2C0B0001
41A20008 4E800020
7C0802A6 00000000
1.01 ------ 0x5C9A8 ---- 7C0802A6 -> Branch
2C040000 41820034
A1640000 2C0B0006
8164002C 40820014
816B0518 2C0B0000
41820018 816B002C
896B21FC 2C0B0001
41A20008 4E800020
7C0802A6 00000000
1.02 ------ 0x5C9BC ---- 7C0802A6 -> Branch
2C040000 41820034
A1640000 2C0B0006
8164002C 40820014
816B0518 2C0B0000
41820018 816B002C
896B21FC 2C0B0001
41A20008 4E800020
7C0802A6 00000000
1.00 ------ 0x5C898 ---- 7C0802A6 -> Branch
2C040000 41820034
A1640000 2C0B0006
8164002C 40820014
816B0518 2C0B0000
41820018 816B002C
896B21FC 2C0B0001
41A20008 4E800020
7C0802A6 00000000
Code:
#unobscuredHitboxDisplay [Punkline, Achilles]
#@ 8005fddc : mflr r0 (beginning of prolog)
#lr is fresh from the caller, r11 appears to be safe
#r4 == external entity data pointer, if GFX comes from a player
cmpwi r4, 0
beq return
lhz r11, 0(r4)
cmpwi r11, 6 #item entities have 6 here, where player entities have a 4
lwz r11, 0x2C(r4)
bne player
item:
lwz r11, 0x518(r11) #if it's an item, we want to check the "owner"
cmpwi r11, 0
beq return
lwz r11, 0x2C(r11) #use "owner" pointer for player hitbox display check
player:
lbz r11, 0x21FC(r11) #internal player data offset 0x21FC is the 8-bit hitbox display state
cmpwi r11, 1 #1 is the default state (no display)
beq+ return
blr #return immediately from GFX func if displaying hitboxes
return:
mflr r0
---
Kou
requested a code that got rid of graphic effects during hitbox display, and I figured I’d give it a shot. It turned out to be a bit more complicated than I thought, but I came up with something that might still do the job.
I thought it’d be as simple as skipping just GFX (like the calls made in subaction parsing functions,) but that only removes regular particle effects.
I learned that many of the more obscuring effects (like fox’s fire effect) are textures (formed over meshes?) and are separate from normal GFX. A function (8005be88) that calls a symbol Achilles had mapped as “TextureInitialization” in the community symbol map appears to be responsible for constructing these.
This code stops character-specific GFX and character "textures" from being called when hitboxes are displayed. The injection mod contains ports for 1.00, 1.01, and PAL:
$UnobscuredHitboxDisplay (Melee 1.02) [Punkline]
C20676F0 00000003
8803225C 2C000001
41A20008 4E800020
7C0802A6 00000000
C205C038 00000005
807E0008 8863225C
2C030001 41A20014
3C608005 6063C050
7C6803A6 4E800020
3C808039 00000000
I thought it’d be as simple as skipping just GFX (like the calls made in subaction parsing functions,) but that only removes regular particle effects.
I learned that many of the more obscuring effects (like fox’s fire effect) are textures (formed over meshes?) and are separate from normal GFX. A function (8005be88) that calls a symbol Achilles had mapped as “TextureInitialization” in the community symbol map appears to be responsible for constructing these.
This code stops character-specific GFX and character "textures" from being called when hitboxes are displayed. The injection mod contains ports for 1.00, 1.01, and PAL:
$UnobscuredHitboxDisplay (Melee 1.02) [Punkline]
C20676F0 00000003
8803225C 2C000001
41A20008 4E800020
7C0802A6 00000000
C205C038 00000005
807E0008 8863225C
2C030001 41A20014
3C608005 6063C050
7C6803A6 4E800020
3C808039 00000000
Code:
-==-
Unobscured Hitbox Display
Prevent GFX from spawning during hitbox display.
[Punkline]
Version -- DOL Offset ------ Hex to Replace ---------- ASM Code
1.02 ----- 0x800676f0 --- 7C0802A6 -> Branch
8803225C 2C000001
41A20008 4E800020
7C0802A6 00000000
1.02 ----- 0x8005c038 --- 3C808039 -> Branch
807E0008 8863225C
2C030001 41A20014
3C608005 6063C050
7C6803A6 4E800020
3C808039 00000000
1.01 ----- 0x800676DC --- 7C0802A6 -> Branch
8803225C 2C000001
41A20008 4E800020
7C0802A6 00000000
1.01 ----- 0x8005C024 --- 3C808039 -> Branch
807E0008 8863225C
2C030001 41A20014
3C608005 6063C03C
7C6803A6 4E800020
3C808039 00000000
1.00 ----- 0x800675CC --- 7C0802A6 -> Branch
8803225C 2C000001
41A20008 4E800020
7C0802A6 00000000
1.00 ----- 0x8005BF14 --- 3C808039 -> Branch
807E0008 8863225C
2C030001 41A20014
3C608005 6063BF2C
7C6803A6 4E800020
3C808039 00000000
PAL ------ 0x80067DB4 --- 7C0802A6 -> Branch
8803225C 2C000001
41A20008 4E800020
7C0802A6 00000000
PAL ------ 0x8005C6FC --- 3C808039 -> Branch
807E0008 8863225C
2C030001 41A20014
3C608005 6063C714
7C6803A6 4E800020
3C808039 00000000
-==-
Code:
#unobscuredHitboxDisplay [Punkline]
#@800676f0: mflr r0 (beginning of prolog for main GFX spawn function)
#context:
#lr is fresh from the caller
#cr1 appears to hold an important comparison. cr0 appears to be safe?
#r3 == passed player data offset
lbz r0, 0x225C(r3) #player.0x225C is the 8-bit hitbox display state
cmpwi r0, 1 #1 is the default state (no display)
beq+ return
blr #return immediately from GFX func if displaying hitboxes
return: mflr r0
#@8005c038: lis r4, 0x8039 (start setting up function call for texture init)
#this function calls player texture inits mid-match
#context:
#r3-6 are about to be clobbered (safe)
#cr0 appears safe
#lr is safe
#r30 = data pointer? 0x8 holds pointer to player
lwz r3, 0x8(r30)
lbz r3, 0x225C(r3)
cmpwi r3, 1
beq+ return
lis r3, 0x8005
ori r3, r3, 0xc050 #branching here skips the call
mtlr r3
blr
return: lis r4, 0x8039
Last edited: