Only re-render PSI help on button press

Without this, the game will constantly try to clear+render the whole PSI
help window per frame which causes extreme lag and tearing.
This commit is contained in:
jeffman 2017-03-17 00:56:41 -04:00
parent db21533c21
commit 7329bcef6b
2 changed files with 32 additions and 0 deletions

View File

@ -48,6 +48,9 @@ incsrc m2-status-switch.asm
org $80BACFC; bl m2_vwf_entries.bac18_redraw_status
org $80BADE6; bl m2_vwf_entries.bac18_redraw_status
org $80BACEE; bl m2_vwf_entries.bac18_clear_psi
org $80BADC8
bl m2_vwf_entries.bac18_check_button
b $80BADD8
//---------------------------------------------------------
// C1FBC hacks (PSI window)

View File

@ -359,3 +359,32 @@ pop {r0}
lsl r0,r0,#0x10
asr r4,r0,#0x10
pop {pc}
//==============================================================================
// Only clear+redraw the PSI help if a button has been pressed
.bac18_check_button:
push {lr}
// Copy the thing that was on the stack from the caller
add sp,#-4
ldr r0,[sp,#8]
str r0,[sp,#0]
ldr r0,=#0x3002500
ldrh r0,[r0,#0]
cmp r0,#0
beq +
// Clear window
ldr r0,[r5,#0x28]
mov r1,r2
mov r2,#0
bl $80BE458
// Render window
ldr r0,[r5,#0x28]
bl $80C8BE4
+
add sp,#4
pop {pc}