Improve situation in the battle psi window

Temporally broke the main menu psi window.
This commit is contained in:
Lorenzooone 2019-09-05 12:51:12 +02:00
parent 0d405412ce
commit 0f7438300f
2 changed files with 87 additions and 50 deletions

View File

@ -68,6 +68,24 @@ mov r3,6
.org 0x80BEAA6 :: bl beaa6_fix_sounds
.org 0x80BEA88 :: bl bea88_fix_sounds
//---------------------------------------------------------
// Main battle window hacks
//---------------------------------------------------------
.org 0x80DC22A :: bl dc22a_load_buffer_battle
//---------------------------------------------------------
// PSI battle window hacks
//---------------------------------------------------------
.org 0x80E0762 :: bl initWindow_buffer
.org 0x80E0776 :: bl print_window_with_buffer
.org 0x80E07C2 :: bl clearWindowTiles_buffer
.org 0x80E0892 :: bl initWindow_buffer
.org 0x80E08A6 :: bl print_window_with_buffer
.org 0x80E0A30 :: bl initWindow_buffer
.org 0x80E0A54 :: bl print_window_with_buffer
//---------------------------------------------------------
// BAC18 hacks (status window)
//---------------------------------------------------------
@ -89,7 +107,16 @@ mov r3,6
.org 0x80BADCC :: b 0x80BADD8
//---------------------------------------------------------
// PSI window hacks
// Normal PSI window hacks
//---------------------------------------------------------
.org 0x80B8C34 :: bl initWindow_buffer
.org 0x80B8C42 :: bl baec6_psi_window_print_buffer
.org 0x80B8C7E :: bl initWindow_buffer
.org 0x80B8C8C :: bl baec6_psi_window_print_buffer
//---------------------------------------------------------
// Class PSI window hacks
//---------------------------------------------------------
.org 0x80BAE1C :: bl print_window_with_buffer

View File

@ -377,6 +377,15 @@ bl m2_soundeffect
@@end:
pop {pc}
//==============================================================================
// Loads the buffer up in battle
dc22a_load_buffer_battle:
push {lr}
mov r9,r0
ldr r3,[r5,#0]
bl load_pixels_overworld
pop {pc}
//==============================================================================
// Calls m2_soundeffect only if we're out of the main menu
bea88_fix_sounds:
@ -696,7 +705,8 @@ push {r0-r3,lr}
mov r0,2
mov r1,3
mov r2,1
bl print_blankstr
ldr r3,=#overworld_buffer - 0x2000
bl print_blankstr_buffer
// Render PSI string
add sp,-4
@ -707,8 +717,8 @@ ldr r0,[r0] // window pointer
mov r2,1 // highlight
str r2,[sp]
mov r2,1
mov r3,1
bl 0x80C96F0 // render string
mov r3,2
bl printstr_hlight_buffer // render string
add sp,4
// Clobbered code
@ -727,11 +737,13 @@ add sp,-4
mov r0,2
mov r1,1
mov r2,1
bl print_blankstr
ldr r3,=#overworld_buffer - 0x2000
bl print_blankstr_buffer
mov r0,2
mov r1,3
mov r2,1
bl print_blankstr
ldr r3,=#overworld_buffer - 0x2000
bl print_blankstr_buffer
// We need to figure out whether to draw Bash or Do Nothing
// If [0x2025122] == 2, draw Do Nothing; else, draw Bash
@ -752,7 +764,7 @@ mov r2,0 // no highlight
str r2,[sp]
mov r2,1
mov r3,0
bl 0x80C96F0 // render string
bl printstr_hlight_buffer // render string
// Render PSI string
ldr r0,=0x80DC1EC // address of PSI string pointer
@ -762,8 +774,8 @@ ldr r0,[r0] // window pointer
mov r2,1 // highlight
str r2,[sp]
mov r2,1
mov r3,1
bl 0x80C96F0 // render string
mov r3,2
bl printstr_hlight_buffer // render string
add sp,4
// Clobbered code
@ -1768,7 +1780,6 @@ add r0,#0xA
bx r0
@@goToInner:
bl load_pixels_overworld_psi_window
ldr r0,[r4,#0x1C] //Stores false in vwf_skip, which means the window will be printed
mov r2,#0
strb r2,[r0,#3]
@ -1894,7 +1905,6 @@ strb r2,[r0,#3]
b @@end //Goes to the end of the routine
@@goToInner:
bl load_pixels_overworld_psi_window
lsl r0,r0,0x10 //Properly stores the output into r4 and, since we're going into the inner window, sets vwf_skip to false
asr r4,r0,0x10
ldr r0,[r5,#0x20]
@ -2253,7 +2263,7 @@ pop {pc}
b8c2a_set_proper_wvf_skip_and_window_type:
push {lr}
strb r1,[r0,#1]
bl m2_initwindow
bl initWindow_buffer
pop {pc}