Files
psopeeps-newserv/system/client-functions/EnemyHPBars/EnemyHPBars-TextHandlerXB.x86.inc.s
T
Martin Michelsen 24722f0a27 more patches
2025-01-28 23:26:12 -08:00

35 lines
1004 B
ArmAsm

# WARNING: FlickeringStatusIcons patch starts immediately after this; if the
# size of this is changed, that patch will have to be changed too
# Replacement for handle_0E (do nothing)
ret
# Call table: 2 functions (on_window_created, on_hp_updated)
jmp on_window_created
on_hp_updated:
call rewrite_string
movsx ecx, word [ebp + 0x02BC] # Replaced opcode at callsite
ret
on_window_created:
mov [0x00010C08], eax # prev_desc
push ebp
mov ebp, ebx
call rewrite_string
pop ebp
mov dword [esp + 4], 0x00010C1C # Change first argument to desc_buf
jmp [0x00010C04] # Call original function
rewrite_string:
movsx eax, word [ebp + 0x02BC] # max HP
push eax
movsx eax, word [ebp + 0x0330] # current HP
push eax
push dword [0x00010C08] # prev_desc
push 0x00010C0C # desc_template
push 0x00010C1C # desc_buf
call [0x00010C00] # sprintf
add esp, 0x14
ret