UnclePunch
Smash Ace
- Joined
- Nov 9, 2014
- Messages
- 673
Code:
$Player % = Time Spent in CliffWait [UnclePunch]
C209A8FC 00000007
89DF000C 39E00E90
7DEE79D6 3DC08045
61CE3080 7DCE7A14
C1DF0894 FDC0701E
D9C1FFF8 81E1FFFC
39EFFFFF B1EE0060
7C0802A6 00000000
Code:
inject @8009a8fc
original codeline = mflr r0
ASM:
lbz r14,0xc(r31) #get player slot (0-3)
li r15,0xe90 #static player block length
mullw r15,r14,r15 #multiply block length by player number
lis r14,0x8045 #load in static player block base address
ori r14,r14,0x3080 #load in static player block base address
add r14,r14,r15 #add length to base address to get current player's block
lfs f14,0x894(r31) #get action state frame number from dynamic player block
fctiwz f14,f14 #do some ppc wizardry to go from float->hex
stfd f14,-0x8(sp) #hex representation is stored at the end of f14, so the whole register is stored to the stack (0x8 btes long)
lwz r15,-0x4(sp) #load the second half of the value into r15 (hex representation is here)
subi r15,r15,0x1 #subtract 1 from the counter so percent is 0 when done frame perfectly
sth r15,0x60(r14) #store % value in static block (will be displayed)
mflr r0 #original codeline
Thanks J jjhoho for the suggestion!
Last edited: