Fix issue with text speed window printing when pressing up or down in the text flavour window.

This commit is contained in:
Lorenzooone 2019-08-11 23:49:45 +02:00
parent cf3eb45ef9
commit 2ab18de102
3 changed files with 24 additions and 4 deletions

View File

@ -800,7 +800,7 @@ void print_windows(int windowX, int windowY, int window_selector)
m2_cstm_last_printed[0] = window_selector | (m2_cstm_last_printed[0] & 0x20);
break;
case 1: //Text Speed
if((m2_cstm_last_printed[0] & 0x1F) != 1) //If Text Flavour is printed, don't reprint it
if(((m2_cstm_last_printed[0] & 0x1F) != 1) && ((m2_cstm_last_printed[0] & 0x80) == 0)) //If Text Flavour is printed, don't reprint it
{
text_speed_setup(String, 0);
print_file_string(1, 1, 0x40, String, window_selector, windowX, windowY);
@ -812,6 +812,8 @@ void print_windows(int windowX, int windowY, int window_selector)
print_file_string(2, 7, 0x40, String, window_selector, windowX, windowY);
m2_cstm_last_printed[0] = window_selector | (m2_cstm_last_printed[0] & 0x20);
}
else if ((m2_cstm_last_printed[0] & 0x80) != 0) //This has not been printed. Instead Text Flavour has been.
m2_cstm_last_printed[0] = 2;
break;
case 0x2: //Text Flavour
if((m2_cstm_last_printed[0] & 0x1F) != 2){

View File

@ -1082,6 +1082,8 @@ nop
//Text Speed options
.org 0x8003BBC :: bl _4092_print_window //Printing
.org 0x8003FA2 :: bl _4092_print_window
.org 0x8003E86 :: bl _3e86_special_setup //Avoid printing when not necessary
.org 0x8003EF2 :: bl _3e86_special_setup //Avoid printing when not necessary
.org 0x82B79D0 :: dw 0x10 //new window width
.org 0x86DB0FC :: .incbin "data/m2-textspeed-template.bin"

View File

@ -1603,6 +1603,7 @@ mov r3,#0
pop {pc}
//==============================================================================
//X cursor for the Options submenu in the File Select window
_41D4_cursor_X:
push {lr}
cmp r0,#1
@ -1627,6 +1628,7 @@ lsl r0,r0,#3
pop {pc}
//==============================================================================
//Makes sure Paula's window is loaded properly since the name length has been changed to 5 and the game previously used the 4 to load the window too
_4f7c_window_selector:
push {lr}
mov r0,#4
@ -1697,7 +1699,7 @@ pop {r4-r5,pc}
.pool
//==============================================================================
//
//Fixes issue with file select menu not printing after going back to it from the alphabet
_53f6_fix_out_of_description:
push {lr}
bl 0x800341C
@ -1705,7 +1707,7 @@ bl _setup_file_strings
pop {pc}
//==============================================================================
//
//Fixes issue with the option submenu (if it's there) and the file select menu after going back to the text speed window from the text flavour window
_3dce_fix_out_of_text_flavour:
push {lr}
bl 0x8003F44
@ -1722,3 +1724,17 @@ bl _4092_print_window //Prints the option menu
@@end:
bl _setup_file_strings
pop {pc}
//==============================================================================
//Fixes text reprinting when pressing up or down in the text flavour window
_3e86_special_setup:
push {lr}
push {r0-r2}
ldr r0,=#m2_cstm_last_printed
ldrb r2,[r0,#0]
mov r1,#0x80
orr r1,r2
strb r1,[r0,#0]
pop {r0-r2}
bl 0x8003F44
pop {pc}