diff --git a/asm/easy_chat.s b/asm/easy_chat.s index c73224807..70786ab65 100644 --- a/asm/easy_chat.s +++ b/asm/easy_chat.s @@ -369,7 +369,7 @@ _0811AF86: thumb_func_start sub_811AF8C sub_811AF8C: @ 811AF8C push {lr} - bl Menu_ProcessInputNoWrap_ + bl Menu_ProcessInputNoWrapClearOnChoose lsls r0, 24 asrs r1, r0, 24 cmp r1, 0 @@ -418,7 +418,7 @@ _0811AFE6: thumb_func_start sub_811AFEC sub_811AFEC: @ 811AFEC push {r4,lr} - bl Menu_ProcessInputNoWrap_ + bl Menu_ProcessInputNoWrapClearOnChoose lsls r0, 24 asrs r1, r0, 24 cmp r1, 0 @@ -461,7 +461,7 @@ _0811B03A: thumb_func_start sub_811B040 sub_811B040: @ 811B040 push {lr} - bl Menu_ProcessInputNoWrap_ + bl Menu_ProcessInputNoWrapClearOnChoose lsls r0, 24 asrs r1, r0, 24 cmp r1, 0 @@ -566,7 +566,7 @@ sub_811B0E8: @ 811B0E8 thumb_func_start sub_811B0F8 sub_811B0F8: @ 811B0F8 push {r4,lr} - bl Menu_ProcessInputNoWrap_ + bl Menu_ProcessInputNoWrapClearOnChoose lsls r0, 24 asrs r1, r0, 24 cmp r1, 0 diff --git a/asm/party_menu.s b/asm/party_menu.s index 53a66378c..cb66565e5 100644 --- a/asm/party_menu.s +++ b/asm/party_menu.s @@ -2740,7 +2740,7 @@ sub_81B1708: @ 81B1708 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 - bl Menu_ProcessInputNoWrap_ + bl Menu_ProcessInputNoWrapClearOnChoose lsls r0, 24 asrs r1, r0, 24 cmp r1, 0 @@ -4196,7 +4196,7 @@ sub_81B227C: @ 81B227C push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 - bl Menu_ProcessInputNoWrap_ + bl Menu_ProcessInputNoWrapClearOnChoose lsls r0, 24 asrs r1, r0, 24 cmp r1, 0 @@ -8138,7 +8138,7 @@ sub_81B43DC: @ 81B43DC push {r4-r6,lr} lsls r0, 24 lsrs r4, r0, 24 - bl Menu_ProcessInputNoWrap_ + bl Menu_ProcessInputNoWrapClearOnChoose lsls r0, 24 asrs r1, r0, 24 cmp r1, 0 @@ -8671,7 +8671,7 @@ sub_81B48DC: @ 81B48DC muls r1, r0 ldr r0, =gPlayerParty adds r4, r1, r0 - bl Menu_ProcessInputNoWrap_ + bl Menu_ProcessInputNoWrapClearOnChoose lsls r0, 24 asrs r1, r0, 24 cmp r1, 0 @@ -8963,7 +8963,7 @@ sub_81B4BA0: @ 81B4BA0 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 - bl Menu_ProcessInputNoWrap_ + bl Menu_ProcessInputNoWrapClearOnChoose lsls r0, 24 asrs r1, r0, 24 cmp r1, 0 @@ -9069,7 +9069,7 @@ sub_81B4C94: @ 81B4C94 push {r7} lsls r0, 24 lsrs r5, r0, 24 - bl Menu_ProcessInputNoWrap_ + bl Menu_ProcessInputNoWrapClearOnChoose lsls r0, 24 asrs r1, r0, 24 cmp r1, 0 @@ -9877,7 +9877,7 @@ sub_81B5430: @ 81B5430 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 - bl Menu_ProcessInputNoWrap_ + bl Menu_ProcessInputNoWrapClearOnChoose lsls r0, 24 asrs r1, r0, 24 cmp r1, 0 @@ -10171,7 +10171,7 @@ sub_81B56D8: @ 81B56D8 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 - bl Menu_ProcessInputNoWrap_ + bl Menu_ProcessInputNoWrapClearOnChoose lsls r0, 24 asrs r1, r0, 24 cmp r1, 0 @@ -12543,7 +12543,7 @@ ether_effect_related_3: @ 81B6AB4 lsls r0, 24 lsrs r4, r0, 24 adds r5, r4, 0 - bl ProcessMenuInput + bl Menu_ProcessInput lsls r0, 24 asrs r1, r0, 24 movs r0, 0x2 @@ -13156,7 +13156,7 @@ sub_81B7028: @ 81B7028 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 - bl Menu_ProcessInputNoWrap_ + bl Menu_ProcessInputNoWrapClearOnChoose lsls r0, 24 asrs r1, r0, 24 cmp r1, 0 @@ -13458,7 +13458,7 @@ sub_81B72C8: @ 81B72C8 muls r1, r0 ldr r0, =gPlayerParty adds r4, r1, r0 - bl Menu_ProcessInputNoWrap_ + bl Menu_ProcessInputNoWrapClearOnChoose lsls r0, 24 asrs r5, r0, 24 cmp r5, 0 @@ -15240,7 +15240,7 @@ sub_81B82D4: @ 81B82D4 push {r4-r7,lr} lsls r0, 24 lsrs r5, r0, 24 - bl Menu_ProcessInputNoWrap_ + bl Menu_ProcessInputNoWrapClearOnChoose lsls r0, 24 asrs r1, r0, 24 cmp r1, 0 diff --git a/asm/pokemon_storage_system.s b/asm/pokemon_storage_system.s index 9d5603085..3fefdd530 100644 --- a/asm/pokemon_storage_system.s +++ b/asm/pokemon_storage_system.s @@ -1904,7 +1904,7 @@ _080C8F0C: adds r0, 0x1 strb r0, [r1] _080C8F22: - bl Menu_ProcessInputNoWrap_ + bl Menu_ProcessInputNoWrapClearOnChoose lsls r0, 24 asrs r1, r0, 24 cmp r1, 0 @@ -2628,7 +2628,7 @@ _080C9584: b _080C9664 .pool _080C95A4: - bl Menu_ProcessInputNoWrap_ + bl Menu_ProcessInputNoWrapClearOnChoose lsls r0, 24 asrs r1, r0, 24 cmp r1, 0 @@ -3422,7 +3422,7 @@ _080C9C78: b _080C9CAA .pool _080C9C8C: - bl Menu_ProcessInputNoWrap_ + bl Menu_ProcessInputNoWrapClearOnChoose lsls r0, 24 asrs r1, r0, 24 cmp r1, 0 @@ -3553,7 +3553,7 @@ _080C9DAC: b _080C9DE0 .pool _080C9DC0: - bl Menu_ProcessInputNoWrap_ + bl Menu_ProcessInputNoWrapClearOnChoose lsls r0, 24 asrs r1, r0, 24 cmp r1, 0 diff --git a/asm/rom_8011DC0.s b/asm/rom_8011DC0.s index 415ebfc0c..91669d074 100644 --- a/asm/rom_8011DC0.s +++ b/asm/rom_8011DC0.s @@ -2905,7 +2905,7 @@ _080170CA: negs r0, r0 b _08017110 _080170D4: - bl sub_8197930 + bl DisplayYesNoMenu ldrb r0, [r4] adds r0, 0x1 strb r0, [r4] @@ -2920,7 +2920,7 @@ _080170E0: negs r0, r0 b _08017110 _080170F2: - bl Menu_ProcessInputNoWrap_ + bl Menu_ProcessInputNoWrapClearOnChoose lsls r0, 24 asrs r1, r0, 24 movs r2, 0x80 @@ -6278,7 +6278,7 @@ _08018BD6: b _08018C3E .pool _08018BE4: - bl Menu_ProcessInputNoWrap_ + bl Menu_ProcessInputNoWrapClearOnChoose lsls r0, 24 asrs r6, r0, 24 movs r1, 0x80 @@ -16904,7 +16904,7 @@ _0801E16A: b _0801E23A .pool _0801E17C: - bl ProcessMenuInput + bl Menu_ProcessInput lsls r0, 24 asrs r0, 8 lsrs r6, r0, 16 @@ -20614,7 +20614,7 @@ _0801FEFE: thumb_func_start sub_801FF08 sub_801FF08: @ 801FF08 push {lr} - bl ProcessMenuInput + bl Menu_ProcessInput lsls r0, 24 asrs r0, 24 pop {r1} @@ -28887,10 +28887,10 @@ _08024246: strb r0, [r5, 0xC] b _080242D8 _0802426A: - bl sub_8197930 + bl DisplayYesNoMenu b _080242D0 _08024270: - bl Menu_ProcessInputNoWrap_ + bl Menu_ProcessInputNoWrapClearOnChoose lsls r0, 24 asrs r4, r0, 24 movs r0, 0x2 @@ -47811,7 +47811,7 @@ _0802DA84: thumb_func_start sub_802DA8C sub_802DA8C: @ 802DA8C push {lr} - bl Menu_ProcessInputNoWrap_ + bl Menu_ProcessInputNoWrapClearOnChoose lsls r0, 24 asrs r0, 24 pop {r1} diff --git a/asm/roulette.s b/asm/roulette.s index f5d2dc372..1552ba4fe 100644 --- a/asm/roulette.s +++ b/asm/roulette.s @@ -736,7 +736,7 @@ sub_8140914: @ 8140914 adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 - bl sub_8197930 + bl DisplayYesNoMenu ldr r5, =gUnknown_0203AB8C ldrb r0, [r5] movs r1, 0 @@ -4502,7 +4502,7 @@ sub_81428C4: @ 81428C4 adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 - bl sub_8197930 + bl DisplayYesNoMenu ldr r1, =gUnknown_085B6408 adds r0, r4, 0 bl sub_8121F68 diff --git a/asm/script_menu.s b/asm/script_menu.s index ed6f5c328..6d8513245 100644 --- a/asm/script_menu.s +++ b/asm/script_menu.s @@ -5,1046 +5,6 @@ .text - thumb_func_start sub_80E1FBC -sub_80E1FBC: @ 80E1FBC - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - lsls r1, 24 - lsrs r7, r1, 24 - lsls r2, 24 - lsrs r2, 24 - mov r9, r2 - lsls r3, 24 - lsrs r4, r3, 24 - ldr r1, =gUnknown_02039F90 - movs r0, 0x2 - strb r0, [r1] - movs r2, 0 - ldr r6, =Task_HandleMultichoiceInput - ldr r5, =gUnknown_0858BB68 - movs r3, 0xC -_080E1FE6: - adds r0, r2, r5 - ldrb r0, [r0] - cmp r0, r4 - bne _080E1FF0 - strb r3, [r1] -_080E1FF0: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x5 - bls _080E1FE6 - adds r0, r6, 0 - movs r1, 0x50 - bl CreateTask - lsls r0, 24 - lsrs r2, r0, 24 - ldr r1, =gTasks - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r1, r0, r1 - mov r0, r8 - strh r0, [r1, 0x10] - cmp r7, 0x3 - bls _080E202C - movs r0, 0x1 - b _080E202E - .pool -_080E202C: - movs r0, 0 -_080E202E: - strh r0, [r1, 0x12] - ldr r1, =gTasks - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r0, r1 - mov r1, r9 - strh r1, [r0, 0x14] - strh r4, [r0, 0x16] - adds r0, r4, 0 - bl sub_80E2A94 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E1FBC - - thumb_func_start Task_HandleMultichoiceInput -Task_HandleMultichoiceInput: @ 80E2058 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r5, r0, r1 - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _080E20FC - ldr r1, =gUnknown_02039F90 - ldrb r0, [r1] - cmp r0, 0 - beq _080E2090 - subs r0, 0x1 - strb r0, [r1] - b _080E20FC - .pool -_080E2090: - movs r1, 0xA - ldrsh r0, [r5, r1] - cmp r0, 0 - bne _080E209E - bl Menu_ProcessInputNoWrapAround - b _080E20A2 -_080E209E: - bl ProcessMenuInput -_080E20A2: - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r0, 0xC0 - ands r0, r1 - cmp r0, 0 - beq _080E20B8 - ldrb r0, [r5, 0xE] - bl sub_80E2A94 -_080E20B8: - lsls r0, r4, 24 - asrs r1, r0, 24 - movs r0, 0x2 - negs r0, r0 - cmp r1, r0 - beq _080E20FC - adds r0, 0x1 - cmp r1, r0 - bne _080E20E8 - movs r1, 0x8 - ldrsh r0, [r5, r1] - cmp r0, 0 - bne _080E20FC - movs r0, 0x5 - bl PlaySE - ldr r1, =gSpecialVar_Result - movs r0, 0x7F - strh r0, [r1] - b _080E20EC - .pool -_080E20E8: - ldr r0, =gSpecialVar_Result - strh r1, [r0] -_080E20EC: - ldrb r0, [r5, 0xC] - bl sub_80E2A78 - adds r0, r6, 0 - bl DestroyTask - bl EnableBothScriptContexts -_080E20FC: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end Task_HandleMultichoiceInput - - thumb_func_start ScriptMenu_YesNo -ScriptMenu_YesNo: @ 80E2108 - push {r4,lr} - ldr r4, =task_yes_no_maybe - adds r0, r4, 0 - bl FuncIsActiveTask - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080E2138 - ldr r1, =gSpecialVar_Result - movs r0, 0xFF - strh r0, [r1] - bl sub_8197930 - adds r0, r4, 0 - movs r1, 0x50 - bl CreateTask - movs r0, 0x1 - b _080E213A - .pool -_080E2138: - movs r0, 0 -_080E213A: - pop {r4} - pop {r1} - bx r1 - thumb_func_end ScriptMenu_YesNo - - thumb_func_start sub_80E2140 -sub_80E2140: @ 80E2140 - push {lr} - ldr r0, =gSpecialVar_Result - ldrh r0, [r0] - cmp r0, 0xFF - beq _080E2154 - movs r0, 0x1 - b _080E2156 - .pool -_080E2154: - movs r0, 0 -_080E2156: - pop {r1} - bx r1 - thumb_func_end sub_80E2140 - - thumb_func_start task_yes_no_maybe -task_yes_no_maybe: @ 80E215C - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r1, r0, r1 - ldrh r2, [r1, 0xC] - movs r3, 0xC - ldrsh r0, [r1, r3] - cmp r0, 0x4 - bgt _080E2180 - adds r0, r2, 0x1 - strh r0, [r1, 0xC] - b _080E21C4 - .pool -_080E2180: - bl Menu_ProcessInputNoWrap_ - lsls r0, 24 - asrs r1, r0, 24 - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _080E21A4 - cmp r1, r0 - bgt _080E219C - subs r0, 0x1 - cmp r1, r0 - beq _080E21C4 - b _080E21BA -_080E219C: - cmp r1, 0 - beq _080E21B4 - cmp r1, 0x1 - bne _080E21BA -_080E21A4: - movs r0, 0x5 - bl PlaySE - ldr r1, =gSpecialVar_Result - movs r0, 0 - b _080E21B8 - .pool -_080E21B4: - ldr r1, =gSpecialVar_Result - movs r0, 0x1 -_080E21B8: - strh r0, [r1] -_080E21BA: - adds r0, r4, 0 - bl DestroyTask - bl EnableBothScriptContexts -_080E21C4: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end task_yes_no_maybe - - thumb_func_start ScriptMenu_MultichoiceGrid -ScriptMenu_MultichoiceGrid: @ 80E21D0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x10 - ldr r4, [sp, 0x30] - lsls r0, 24 - lsrs r7, r0, 24 - lsls r1, 24 - lsrs r1, 24 - str r1, [sp, 0x4] - lsls r2, 24 - lsrs r5, r2, 24 - lsls r3, 24 - lsrs r3, 24 - str r3, [sp, 0x8] - lsls r4, 24 - lsrs r4, 24 - mov r10, r4 - ldr r0, =sub_80E2308 - bl FuncIsActiveTask - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080E2210 - movs r0, 0 - b _080E22E8 - .pool -_080E2210: - ldr r0, =gSpecialVar_Result - movs r1, 0xFF - strh r1, [r0] - movs r2, 0 - movs r6, 0 - ldr r1, =gUnknown_0858B760 - lsls r5, 3 - adds r0, r5, r1 - str r5, [sp, 0xC] - ldrb r0, [r0, 0x4] - cmp r2, r0 - bge _080E2246 - mov r8, r1 -_080E222A: - mov r0, r8 - adds r4, r5, r0 - ldr r1, [r4] - lsls r0, r6, 3 - adds r0, r1 - ldr r0, [r0] - adds r1, r2, 0 - bl display_text_and_get_width - adds r2, r0, 0 - adds r6, 0x1 - ldrb r4, [r4, 0x4] - cmp r6, r4 - blt _080E222A -_080E2246: - adds r0, r2, 0 - bl convert_pixel_width_to_tile_width - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - mov r1, r10 - muls r1, r5 - mov r8, r1 - adds r0, r7, 0 - bl sub_80E2D5C - lsls r0, 24 - lsrs r7, r0, 24 - ldr r2, =gUnknown_0858B760 - mov r9, r2 - ldr r0, [sp, 0xC] - add r9, r0 - mov r1, r9 - ldrb r0, [r1, 0x4] - mov r1, r10 - bl __udivsi3 - adds r6, r0, 0 - lsls r6, 24 - lsrs r6, 24 - ldr r0, =sub_80E2308 - movs r1, 0x50 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gTasks - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - adds r4, r1 - mov r2, sp - ldrh r2, [r2, 0x8] - strh r2, [r4, 0x10] - mov r0, r8 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - lsls r3, r6, 25 - lsrs r3, 24 - adds r0, r7, 0 - ldr r1, [sp, 0x4] - mov r2, r8 - bl CreateWindowFromRect - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x14] - movs r1, 0 - bl SetStandardWindowBorderStyle - ldrb r0, [r4, 0x14] - lsls r5, 27 - lsrs r5, 24 - mov r2, r9 - ldr r1, [r2] - str r1, [sp] - adds r1, r5, 0 - mov r2, r10 - adds r3, r6, 0 - bl sub_81997AC - ldrb r0, [r4, 0x14] - movs r1, 0 - str r1, [sp] - adds r1, r5, 0 - mov r2, r10 - adds r3, r6, 0 - bl sub_8199944 - ldrb r0, [r4, 0x14] - movs r1, 0x3 - bl CopyWindowToVram - movs r0, 0x1 -_080E22E8: - add sp, 0x10 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end ScriptMenu_MultichoiceGrid - - thumb_func_start sub_80E2308 -sub_80E2308: @ 80E2308 - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r5, r0, r1 - bl sub_8199334 - lsls r0, 24 - asrs r1, r0, 24 - movs r0, 0x2 - negs r0, r0 - cmp r1, r0 - beq _080E2360 - adds r0, 0x1 - cmp r1, r0 - bne _080E234C - movs r1, 0x8 - ldrsh r0, [r5, r1] - cmp r0, 0 - bne _080E2360 - movs r0, 0x5 - bl PlaySE - ldr r1, =gSpecialVar_Result - movs r0, 0x7F - strh r0, [r1] - b _080E2350 - .pool -_080E234C: - ldr r0, =gSpecialVar_Result - strh r1, [r0] -_080E2350: - ldrb r0, [r5, 0xC] - bl sub_80E2A78 - adds r0, r4, 0 - bl DestroyTask - bl EnableBothScriptContexts -_080E2360: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E2308 - - thumb_func_start ScrSpecial_CreatePCMenu -@ bool ScrSpecial_CreatePCMenu() -ScrSpecial_CreatePCMenu: @ 80E236C - push {lr} - ldr r0, =Task_HandleMultichoiceInput - bl FuncIsActiveTask - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080E2394 - ldr r1, =gSpecialVar_Result - movs r0, 0xFF - strh r0, [r1] - bl CreatePCMenu - movs r0, 0x1 - b _080E2396 - .pool -_080E2394: - movs r0, 0 -_080E2396: - pop {r1} - bx r1 - thumb_func_end ScrSpecial_CreatePCMenu - - thumb_func_start CreatePCMenu -CreatePCMenu: @ 80E239C - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0xC - movs r7, 0x8 - movs r5, 0 - movs r4, 0 - ldr r6, =gUnknown_0858BB70 -_080E23AC: - ldm r6!, {r0} - adds r1, r5, 0 - bl display_text_and_get_width - adds r5, r0, 0 - adds r4, 0x1 - cmp r4, 0x3 - bls _080E23AC - ldr r6, =0x00000864 @ = FLAG_SYS_GAME_CLEAR - adds r0, r6, 0 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _080E23D4 - ldr r0, =gText_HallOfFame - adds r1, r5, 0 - bl display_text_and_get_width - adds r5, r0, 0 -_080E23D4: - adds r0, r5, 0 - bl convert_pixel_width_to_tile_width - lsls r0, 24 - lsrs r4, r0, 24 - adds r0, r6, 0 - bl FlagGet - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0 - beq _080E2448 - movs r0, 0x4 - mov r8, r0 - movs r0, 0 - movs r1, 0 - adds r2, r4, 0 - movs r3, 0x8 - bl CreateWindowFromRect - lsls r0, 24 - lsrs r6, r0, 24 - adds r0, r6, 0 - movs r1, 0 - bl SetStandardWindowBorderStyle - ldr r2, =gText_HallOfFame - movs r0, 0x21 - str r0, [sp] - movs r5, 0xFF - str r5, [sp, 0x4] - movs r4, 0 - str r4, [sp, 0x8] - adds r0, r6, 0 - movs r1, 0x1 - adds r3, r7, 0 - bl AddTextPrinterParameterized - ldr r2, =gText_LogOff - movs r0, 0x31 - str r0, [sp] - str r5, [sp, 0x4] - str r4, [sp, 0x8] - adds r0, r6, 0 - movs r1, 0x1 - adds r3, r7, 0 - bl AddTextPrinterParameterized - b _080E247A - .pool -_080E2448: - movs r0, 0x3 - mov r8, r0 - movs r0, 0 - movs r1, 0 - adds r2, r4, 0 - movs r3, 0x6 - bl CreateWindowFromRect - lsls r0, 24 - lsrs r6, r0, 24 - adds r0, r6, 0 - movs r1, 0 - bl SetStandardWindowBorderStyle - ldr r2, =gText_LogOff - movs r0, 0x21 - str r0, [sp] - movs r0, 0xFF - str r0, [sp, 0x4] - str r5, [sp, 0x8] - adds r0, r6, 0 - movs r1, 0x1 - adds r3, r7, 0 - bl AddTextPrinterParameterized -_080E247A: - ldr r0, =0x000008ab - bl FlagGet - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - beq _080E24B0 - ldr r2, =gText_LanettesPC - movs r0, 0x1 - str r0, [sp] - movs r0, 0xFF - str r0, [sp, 0x4] - movs r0, 0 - str r0, [sp, 0x8] - adds r0, r6, 0 - movs r1, 0x1 - adds r3, r7, 0 - bl AddTextPrinterParameterized - b _080E24C6 - .pool -_080E24B0: - ldr r2, =gText_SomeonesPC - movs r0, 0x1 - str r0, [sp] - movs r0, 0xFF - str r0, [sp, 0x4] - str r1, [sp, 0x8] - adds r0, r6, 0 - movs r1, 0x1 - adds r3, r7, 0 - bl AddTextPrinterParameterized -_080E24C6: - ldr r4, =gStringVar4 - ldr r1, =gText_PlayersPC - adds r0, r4, 0 - bl StringExpandPlaceholders - adds r0, r6, 0 - adds r1, r4, 0 - adds r2, r7, 0 - movs r3, 0x11 - bl PrintPlayerNameOnWindow - adds r0, r6, 0 - mov r1, r8 - movs r2, 0 - bl InitMenuInUpperLeftCornerPlaySoundWhenAPressed - adds r0, r6, 0 - movs r1, 0x3 - bl CopyWindowToVram - movs r0, 0 - mov r1, r8 - adds r2, r6, 0 - movs r3, 0x1 - bl sub_80E1FBC - add sp, 0xC - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end CreatePCMenu - - thumb_func_start ScriptMenu_DisplayPCStartupPrompt -ScriptMenu_DisplayPCStartupPrompt: @ 80E2514 - push {lr} - sub sp, 0x10 - movs r0, 0 - movs r1, 0x1 - bl sub_819786C - ldr r2, =gUnknown_0827266F - movs r0, 0 - str r0, [sp] - movs r0, 0x2 - str r0, [sp, 0x4] - movs r0, 0x1 - str r0, [sp, 0x8] - movs r0, 0x3 - str r0, [sp, 0xC] - movs r0, 0 - movs r1, 0x1 - movs r3, 0 - bl AddTextPrinterParameterized2 - add sp, 0x10 - pop {r0} - bx r0 - .pool - thumb_func_end ScriptMenu_DisplayPCStartupPrompt - - thumb_func_start sub_80E2548 -sub_80E2548: @ 80E2548 - push {lr} - ldr r0, =Task_HandleMultichoiceInput - bl FuncIsActiveTask - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080E2570 - ldr r1, =gSpecialVar_Result - movs r0, 0xFF - strh r0, [r1] - bl sub_80E2578 - movs r0, 0x1 - b _080E2572 - .pool -_080E2570: - movs r0, 0 -_080E2572: - pop {r1} - bx r1 - thumb_func_end sub_80E2548 - - thumb_func_start sub_80E2578 -sub_80E2578: @ 80E2578 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0xC - movs r5, 0 - movs r4, 0 - ldr r3, =gUnknown_03001124 - movs r2, 0xFF -_080E258A: - adds r0, r4, r3 - ldrb r1, [r0] - orrs r1, r2 - strb r1, [r0] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x6 - bls _080E258A - movs r0, 0x1 - movs r1, 0 - bl GetFontAttribute - ldr r0, =gSpecialVar_0x8004 - ldrh r1, [r0] - cmp r1, 0 - bne _080E25D2 - ldr r4, =gUnknown_03001124 - adds r0, r5, r4 - strb r1, [r0] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - movs r0, 0xE8 - lsls r0, 1 - bl FlagGet - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x1 - bne _080E25D2 - adds r0, r5, r4 - strb r1, [r0] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 -_080E25D2: - ldr r0, =0x00000113 - movs r1, 0x1 - bl CheckBagHasItem - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080E2630 - ldr r0, =0x000008b3 - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080E2630 - ldr r2, =gSpecialVar_0x8004 - ldrh r0, [r2] - cmp r0, 0 - bne _080E2606 - ldr r0, =gUnknown_03001124 - adds r0, r5, r0 - movs r1, 0x2 - strb r1, [r0] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 -_080E2606: - ldrh r0, [r2] - cmp r0, 0x1 - bne _080E2630 - movs r4, 0xD7 - lsls r4, 1 - adds r0, r4, 0 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - bne _080E2630 - ldr r0, =gUnknown_03001124 - adds r0, r5, r0 - movs r1, 0x2 - strb r1, [r0] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - adds r0, r4, 0 - bl FlagSet -_080E2630: - movs r0, 0xB9 - lsls r0, 1 - movs r1, 0x1 - bl CheckBagHasItem - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080E2690 - movs r0, 0x8E - lsls r0, 4 - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080E2690 - ldr r2, =gSpecialVar_0x8004 - ldrh r0, [r2] - cmp r0, 0 - bne _080E2668 - ldr r0, =gUnknown_03001124 - adds r0, r5, r0 - movs r1, 0x3 - strb r1, [r0] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 -_080E2668: - ldrh r0, [r2] - cmp r0, 0x1 - bne _080E2690 - ldr r4, =0x000001db - adds r0, r4, 0 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - bne _080E2690 - ldr r0, =gUnknown_03001124 - adds r0, r5, r0 - movs r1, 0x3 - strb r1, [r0] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - adds r0, r4, 0 - bl FlagSet -_080E2690: - ldr r0, =0x00000173 - movs r1, 0x1 - bl CheckBagHasItem - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080E26EC - ldr r0, =0x000008d5 - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080E26EC - ldr r2, =gSpecialVar_0x8004 - ldrh r0, [r2] - cmp r0, 0 - bne _080E26C4 - ldr r0, =gUnknown_03001124 - adds r0, r5, r0 - movs r1, 0x4 - strb r1, [r0] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 -_080E26C4: - ldrh r0, [r2] - cmp r0, 0x1 - bne _080E26EC - ldr r4, =0x000001af - adds r0, r4, 0 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - bne _080E26EC - ldr r0, =gUnknown_03001124 - adds r0, r5, r0 - movs r1, 0x4 - strb r1, [r0] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - adds r0, r4, 0 - bl FlagSet -_080E26EC: - movs r0, 0xBC - lsls r0, 1 - movs r1, 0x1 - bl CheckBagHasItem - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080E274C - ldr r0, =0x000008d6 - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080E274C - ldr r2, =gSpecialVar_0x8004 - ldrh r0, [r2] - cmp r0, 0 - bne _080E2722 - ldr r0, =gUnknown_03001124 - adds r0, r5, r0 - movs r1, 0x5 - strb r1, [r0] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 -_080E2722: - ldrh r0, [r2] - cmp r0, 0x1 - bne _080E274C - movs r4, 0xD8 - lsls r4, 1 - adds r0, r4, 0 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - bne _080E274C - ldr r0, =gUnknown_03001124 - adds r0, r5, r0 - movs r1, 0x5 - strb r1, [r0] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - adds r0, r4, 0 - bl FlagSet -_080E274C: - ldr r0, =gUnknown_03001124 - adds r0, r5, r0 - movs r1, 0x6 - strb r1, [r0] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =gSpecialVar_0x8004 - ldrh r0, [r0] - cmp r0, 0 - bne _080E276E - movs r0, 0xE8 - lsls r0, 1 - bl FlagGet - lsls r0, 24 - lsrs r0, 24 -_080E276E: - adds r7, r5, 0 - cmp r7, 0x7 - bne _080E27A4 - ldr r1, =gSpecialVar_0x8004 - movs r0, 0xB - strh r0, [r1] - bl sub_813A128 - b _080E2860 - .pool -_080E27A4: - movs r1, 0 - movs r4, 0 - lsls r6, r7, 25 - subs r0, r7, 0x1 - mov r9, r0 - ldr r5, =gUnknown_0858BB80 -_080E27B0: - ldr r0, =gUnknown_03001124 - adds r0, r4, r0 - ldrb r0, [r0] - cmp r0, 0xFF - beq _080E27C6 - lsls r0, 2 - adds r0, r5 - ldr r0, [r0] - bl display_text_and_get_width - adds r1, r0, 0 -_080E27C6: - adds r4, 0x1 - cmp r4, 0x6 - bls _080E27B0 - adds r0, r1, 0 - bl convert_pixel_width_to_tile_width - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - movs r0, 0x1C - subs r0, r2 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x6 - subs r1, r7 - lsls r1, 25 - lsrs r1, 24 - lsrs r3, r6, 24 - bl CreateWindowFromRect - lsls r0, 24 - lsrs r6, r0, 24 - adds r0, r6, 0 - movs r1, 0 - bl SetStandardWindowBorderStyle - movs r5, 0 - movs r4, 0 - ldr r0, =gUnknown_0858BB80 - mov r8, r0 -_080E2802: - ldr r0, =gUnknown_03001124 - adds r1, r4, r0 - ldrb r0, [r1] - cmp r0, 0xFF - beq _080E2834 - lsls r0, 2 - add r0, r8 - ldr r2, [r0] - lsls r0, r5, 4 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp] - movs r0, 0xFF - str r0, [sp, 0x4] - movs r0, 0 - str r0, [sp, 0x8] - adds r0, r6, 0 - movs r1, 0x1 - movs r3, 0x8 - bl AddTextPrinterParameterized - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 -_080E2834: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x6 - bls _080E2802 - mov r0, r9 - lsls r2, r0, 24 - lsrs r2, 24 - adds r0, r6, 0 - adds r1, r7, 0 - bl InitMenuInUpperLeftCornerPlaySoundWhenAPressed - adds r0, r6, 0 - movs r1, 0x3 - bl CopyWindowToVram - movs r0, 0 - adds r1, r7, 0 - adds r2, r6, 0 - movs r3, 0x8 - bl sub_80E1FBC -_080E2860: - add sp, 0xC - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80E2578 - thumb_func_start sub_80E2878 sub_80E2878: @ 80E2878 push {lr} diff --git a/asm/trade.s b/asm/trade.s index f81d8c6b2..341aa0869 100644 --- a/asm/trade.s +++ b/asm/trade.s @@ -3349,7 +3349,7 @@ sub_8078EF8: @ 8078EF8 sub_8078F50: @ 8078F50 push {lr} sub sp, 0x4 - bl Menu_ProcessInputNoWrapAround + bl Menu_ProcessInputNoWrap lsls r0, 24 asrs r0, 24 movs r1, 0x1 @@ -3695,7 +3695,7 @@ _0807920E: thumb_func_start sub_8079218 sub_8079218: @ 8079218 push {lr} - bl Menu_ProcessInputNoWrap_ + bl Menu_ProcessInputNoWrapClearOnChoose lsls r0, 24 asrs r1, r0, 24 cmp r1, 0 @@ -3797,7 +3797,7 @@ _080792D8: thumb_func_start sub_80792E4 sub_80792E4: @ 80792E4 push {lr} - bl Menu_ProcessInputNoWrap_ + bl Menu_ProcessInputNoWrapClearOnChoose lsls r0, 24 asrs r1, r0, 24 cmp r1, 0 diff --git a/asm/use_pokeblock.s b/asm/use_pokeblock.s index e04dedd9e..d294a2fae 100644 --- a/asm/use_pokeblock.s +++ b/asm/use_pokeblock.s @@ -900,7 +900,7 @@ sub_8166D44: @ 8166D44 thumb_func_start sub_8166DE4 sub_8166DE4: @ 8166DE4 push {r4,lr} - bl Menu_ProcessInputNoWrap_ + bl Menu_ProcessInputNoWrapClearOnChoose lsls r0, 24 lsrs r4, r0, 24 asrs r1, r0, 24 diff --git a/data/event_scripts.s b/data/event_scripts.s index 46ba34db5..350086a01 100644 --- a/data/event_scripts.s +++ b/data/event_scripts.s @@ -1771,7 +1771,7 @@ EventScript_PC:: @ 8271D92 end EventScript_271DAC:: @ 8271DAC - message gUnknown_0827266F + message gText_WhichPCShouldBeAccessed waitmessage special ScrSpecial_CreatePCMenu waitstate @@ -3112,7 +3112,7 @@ Text_272640: @ 8272640 Text_27265A: @ 827265A .string "{PLAYER} booted up the PC.$" -gUnknown_0827266F:: @ 827266F +gText_WhichPCShouldBeAccessed:: @ 827266F .string "Which PC should be accessed?$" gUnknown_0827268C:: @ 827268C diff --git a/data/script_menu.s b/data/script_menu.s index dbfb05621..008d36bf4 100644 --- a/data/script_menu.s +++ b/data/script_menu.s @@ -577,7 +577,7 @@ gUnknown_0858B758:: @ 58B758 .4byte gText_Exit, 0 -gUnknown_0858B760:: @ 858B760 +gMultichoiceLists:: @ 858B760 .4byte gUnknown_0858ABD8, 3 .4byte gUnknown_0858B758, 1 .4byte gUnknown_0858ABF0, 3 @@ -729,7 +729,7 @@ gUnknown_0858BB68:: @ 858BB68 .byte 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F .align 2 -gUnknown_0858BB70:: @ 858BB70 +sPCNameStrings:: @ 858BB70 .4byte gText_SomeonesPC .4byte gText_LanettesPC .4byte gText_PlayersPC diff --git a/include/field_specials.h b/include/field_specials.h index 0e2daf9c3..8422af061 100644 --- a/include/field_specials.h +++ b/include/field_specials.h @@ -15,5 +15,6 @@ bool32 sub_8138168(void); bool32 sub_81381B0(void); bool32 sub_81381F8(void); bool32 CountSSTidalStep(u16 delta); +void sub_813A128(void); #endif // GUARD_FIELD_SPECIALS_H diff --git a/include/menu.h b/include/menu.h index d105eb5ec..f4960119e 100644 --- a/include/menu.h +++ b/include/menu.h @@ -32,7 +32,7 @@ void PrintPlayerNameOnWindow(u8, const u8*, u16, u16); void DisplayItemMessageOnField(u8 taskId, const u8 *src, TaskFunc callback); void sub_8197434(u8 windowId, bool8 copyToVram); void SetStandardWindowBorderStyle(u8 a0, u8 a1); -void sub_8197930(void); +void DisplayYesNoMenu(void); u8 GetPlayerTextSpeed(void); void sub_81978B0(u16 arg0); void AddTextPrinterWithCallbackForMessage(bool8 a1, void (*callback)(struct TextSubPrinter *, u16)); @@ -44,8 +44,8 @@ void schedule_bg_copy_tilemap_to_vram(u8 bgNum); void PrintMenuTable(u8 windowId, u8 itemCount, const struct MenuAction *strs); u8 InitMenuInUpperLeftCornerPlaySoundWhenAPressed(u8 windowId, u8 numItems, u8 initialCursorPos); u8 GetMenuCursorPos(void); -s8 ProcessMenuInput(void); -s8 Menu_ProcessInputNoWrapAround(void); +s8 Menu_ProcessInput(void); +s8 Menu_ProcessInputNoWrap(void); void blit_move_info_icon(u8 winId, u8 a2, u16 x, u16 y); void reset_temp_tile_data_buffers(void); void *decompress_and_copy_tile_data_to_vram(u8 bgId, const void *src, int size, u16 offset, u8 mode); @@ -53,7 +53,7 @@ bool8 free_temp_tile_data_buffers_if_possible(void); struct WindowTemplate CreateWindowTemplate(u8 bg, u8 left, u8 top, u8 width, u8 height, u8 paletteNum, u16 baseBlock); void CreateYesNoMenu(const struct WindowTemplate *windowTemplate, u16 borderFirstTileNum, u8 borderPalette, u8 initialCursorPos); void DecompressAndLoadBgGfxUsingHeap(u8 bgId, const void *src, int size, u16 offset, u8 mode); -s8 Menu_ProcessInputNoWrap_(void); +s8 Menu_ProcessInputNoWrapClearOnChoose(void); s8 ProcessMenuInput_other(void); void do_scheduled_bg_tilemap_copies_to_vram(void); void clear_scheduled_bg_copies_to_vram(void); @@ -88,5 +88,7 @@ void sub_8199C30(u8 bgId, u8 left, u8 top, u8 width, u8 height, u8 palette); void sub_8199D3C(void *ptr, int delta, int width, int height, bool32 is8BPP); void sub_8198204(const u8 *string, const u8 *string2, u8 a3, u8 a4, bool8 copyToVram); void sub_8197AE8(bool8 copyToVram); +void sub_81997AC(u8 windowId, u8 a4, u8 a6, u8 a7, const struct MenuAction *strs); +s8 Menu_ProcessInputGridLayout(void); #endif // GUARD_MENU_H diff --git a/include/script_menu.h b/include/script_menu.h index 8dd65263a..587e3e08b 100644 --- a/include/script_menu.h +++ b/include/script_menu.h @@ -13,6 +13,6 @@ s32 convert_pixel_width_to_tile_width(s32); u8 CreateWindowFromRect(u8, u8, u8, u8); void sub_80E2A78(u8); u32 display_text_and_get_width(const u8*, u32); -u32 sub_80E2D5C(u8 arg0, u8 tileWidth); +u32 sub_80E2D5C(u8 arg0, u32 tileWidth); #endif //GUARD_SCRIPT_MENU_H diff --git a/include/strings.h b/include/strings.h index c563353ec..3600dd891 100644 --- a/include/strings.h +++ b/include/strings.h @@ -877,4 +877,11 @@ extern const u8 gText_PokemonOnHook[]; extern const u8 gText_NotEvenANibble[]; extern const u8 gText_ItGotAway[]; +extern const u8 gText_HallOfFame[]; +extern const u8 gText_LogOff[]; +extern const u8 gText_LanettesPC[]; +extern const u8 gText_SomeonesPC[]; +extern const u8 gText_PlayersPC[]; +extern const u8 gText_WhichPCShouldBeAccessed[]; + #endif //GUARD_STRINGS_H diff --git a/src/apprentice.c b/src/apprentice.c index f2a8aa9c0..632eeda8f 100644 --- a/src/apprentice.c +++ b/src/apprentice.c @@ -1570,9 +1570,9 @@ static void Task_ChooseAnswer(u8 taskId) s16 *data = gTasks[taskId].data; if (!tWrapAround) - input = Menu_ProcessInputNoWrapAround(); + input = Menu_ProcessInputNoWrap(); else - input = ProcessMenuInput(); + input = Menu_ProcessInput(); switch (input) { diff --git a/src/battle_pyramid_bag.c b/src/battle_pyramid_bag.c index e8ff7cce7..41d5e3254 100644 --- a/src/battle_pyramid_bag.c +++ b/src/battle_pyramid_bag.c @@ -949,7 +949,7 @@ static void HandleFewMenuActionsInput(u8 taskId) { if (sub_81221EC() != TRUE) { - s32 id = Menu_ProcessInputNoWrapAround(); + s32 id = Menu_ProcessInputNoWrap(); switch (id) { case -2: diff --git a/src/berry_blender.c b/src/berry_blender.c index 8e0bc8043..3a10bc849 100644 --- a/src/berry_blender.c +++ b/src/berry_blender.c @@ -2499,7 +2499,7 @@ static void CB2_HandleBlenderEndGame(void) sBerryBlenderData->gameEndState++; break; case 10: - switch (Menu_ProcessInputNoWrap_()) + switch (Menu_ProcessInputNoWrapClearOnChoose()) { case 1: case -1: diff --git a/src/clear_save_data_screen.c b/src/clear_save_data_screen.c index 839a77e4a..4e47eb607 100644 --- a/src/clear_save_data_screen.c +++ b/src/clear_save_data_screen.c @@ -86,7 +86,7 @@ static void Task_DoClearSaveDataScreenYesNo(u8 taskId) static void Task_ClearSaveDataScreenYesNoChoice(u8 taskId) { - switch(Menu_ProcessInputNoWrap_()) + switch(Menu_ProcessInputNoWrapClearOnChoose()) { case 0: FillWindowPixelBuffer(0, 17); diff --git a/src/decoration.c b/src/decoration.c index 796cc794a..55556bb6d 100644 --- a/src/decoration.c +++ b/src/decoration.c @@ -520,7 +520,7 @@ void sub_8126B80(u8 taskId) if (!gPaletteFade.active) { menuPos = GetMenuCursorPos(); - switch (ProcessMenuInput()) + switch (Menu_ProcessInput()) { default: PlaySE(SE_SELECT); @@ -710,7 +710,7 @@ void sub_8127088(u8 taskId) if (!gPaletteFade.active) { - input = ProcessMenuInput(); + input = Menu_ProcessInput(); switch (input) { case -1: @@ -1628,7 +1628,7 @@ void sub_8128950(u8 taskId) void sub_81289D0(u8 taskId) { - sub_8197930(); + DisplayYesNoMenu(); sub_8121F68(taskId, &gUnknown_085A72C4); } @@ -1693,7 +1693,7 @@ void sub_8128AAC(u8 taskId) void sub_8128B80(u8 taskId) { - sub_8197930(); + DisplayYesNoMenu(); sub_8121F68(taskId, &gUnknown_085A72CC); } @@ -2588,7 +2588,7 @@ void sub_812A0E8(u8 taskId) void sub_812A1A0(u8 taskId) { - sub_8197930(); + DisplayYesNoMenu(); sub_8121F68(taskId, &gUnknown_085A7348); } @@ -2601,7 +2601,7 @@ void sub_812A1C0(u8 taskId) void sub_812A1F0(u8 taskId) { - sub_8197930(); + DisplayYesNoMenu(); sub_8121F68(taskId, &gUnknown_085A7350); } @@ -2725,7 +2725,7 @@ void sub_812A3D4(u8 taskId) void sub_812A458(u8 taskId) { - sub_8197930(); + DisplayYesNoMenu(); sub_8121F68(taskId, &gUnknown_085A741C); } diff --git a/src/egg_hatch.c b/src/egg_hatch.c index 9f2526295..9d3f7237a 100644 --- a/src/egg_hatch.c +++ b/src/egg_hatch.c @@ -673,7 +673,7 @@ static void CB2_EggHatch_1(void) } break; case 10: - switch (Menu_ProcessInputNoWrap_()) + switch (Menu_ProcessInputNoWrapClearOnChoose()) { case 0: GetMonNick(&gPlayerParty[sEggHatchData->eggPartyID], gStringVar3); diff --git a/src/evolution_scene.c b/src/evolution_scene.c index 067e103c2..9d3c8676e 100644 --- a/src/evolution_scene.c +++ b/src/evolution_scene.c @@ -1218,7 +1218,7 @@ static void Task_TradeEvolutionScene(u8 taskID) } break; case 4: - switch (Menu_ProcessInputNoWrap_()) + switch (Menu_ProcessInputNoWrapClearOnChoose()) { case 0: sEvoCursorPos = 0; diff --git a/src/item_menu.c b/src/item_menu.c index bb619cac8..106babdae 100755 --- a/src/item_menu.c +++ b/src/item_menu.c @@ -1543,7 +1543,7 @@ void Task_HandleInBattleItemMenuInput(u8 taskId) { if (sub_81221EC() != TRUE) { - s8 r4 = Menu_ProcessInputNoWrapAround(); + s8 r4 = Menu_ProcessInputNoWrap(); switch (r4) { case -2: diff --git a/src/learn_move.c b/src/learn_move.c index ff23cb3dc..7717a5193 100644 --- a/src/learn_move.c +++ b/src/learn_move.c @@ -377,7 +377,7 @@ static void LearnMoveMain(void) break; case 9: { - s8 selection = Menu_ProcessInputNoWrap_(); + s8 selection = Menu_ProcessInputNoWrapClearOnChoose(); if (selection == 0) { @@ -414,7 +414,7 @@ static void LearnMoveMain(void) break; case 13: { - s8 selection = Menu_ProcessInputNoWrap_(); + s8 selection = Menu_ProcessInputNoWrapClearOnChoose(); if (selection == 0) { @@ -447,7 +447,7 @@ static void LearnMoveMain(void) break; case 18: { - s8 var = Menu_ProcessInputNoWrap_(); + s8 var = Menu_ProcessInputNoWrapClearOnChoose(); if (var == 0) { @@ -474,7 +474,7 @@ static void LearnMoveMain(void) break; case 26: { - s8 var = Menu_ProcessInputNoWrap_(); + s8 var = Menu_ProcessInputNoWrapClearOnChoose(); if (var == 0) { diff --git a/src/main_menu.c b/src/main_menu.c index bcc4f9af5..69388e8f3 100644 --- a/src/main_menu.c +++ b/src/main_menu.c @@ -1501,7 +1501,7 @@ static void Task_NewGameBirchSpeech_CreateNameYesNo(u8 taskId) static void Task_NewGameBirchSpeech_ProcessNameYesNoMenu(u8 taskId) { - switch (Menu_ProcessInputNoWrap_()) + switch (Menu_ProcessInputNoWrapClearOnChoose()) { case 0: PlaySE(SE_SELECT); @@ -1976,7 +1976,7 @@ static void NewGameBirchSpeech_ShowGenderMenu(void) static s8 NewGameBirchSpeech_ProcessGenderMenuInput(void) { - return Menu_ProcessInputNoWrapAround(); + return Menu_ProcessInputNoWrap(); } static void NewGameBirchSpeech_SetDefaultPlayerName(u8 nameId) diff --git a/src/mauville_old_man.c b/src/mauville_old_man.c index 3d3408bbb..c85789b54 100644 --- a/src/mauville_old_man.c +++ b/src/mauville_old_man.c @@ -1179,7 +1179,7 @@ static void Task_StoryListMenu(u8 taskId) // Task_StoryListMenu task->data[0]++; break; case 1: - selection = ProcessMenuInput(); + selection = Menu_ProcessInput(); if (selection == -2) break; if (selection == -1 || selection == GetFreeStorySlot()) diff --git a/src/menu.c b/src/menu.c index 0e5d1b856..c1d2f3641 100644 --- a/src/menu.c +++ b/src/menu.c @@ -458,7 +458,7 @@ void DisplayItemMessageOnField(u8 taskId, const u8 *string, TaskFunc callback) CopyWindowToVram(0, 3); } -void sub_8197930(void) +void DisplayYesNoMenu(void) { CreateYesNoMenu(&gUnknown_0860F0A8, STD_WINDOW_BASE_TILE_NUM, STD_WINDOW_PALETTE_NUM, 0); } @@ -972,7 +972,7 @@ u8 GetMenuCursorPos(void) return gUnknown_0203CD90.cursorPos; } -s8 ProcessMenuInput(void) +s8 Menu_ProcessInput(void) { if (gMain.newKeys & A_BUTTON) { @@ -1000,7 +1000,7 @@ s8 ProcessMenuInput(void) return MENU_NOTHING_CHOSEN; } -s8 Menu_ProcessInputNoWrapAround(void) +s8 Menu_ProcessInputNoWrap(void) { u8 oldPos = gUnknown_0203CD90.cursorPos; @@ -1201,9 +1201,9 @@ void sub_8198C34(const struct WindowTemplate *window, u8 fontId, u16 baseTileNum sub_8198AF8(window, fontId, 0, 1, baseTileNum, paletteNum, 0); } -s8 Menu_ProcessInputNoWrap_(void) +s8 Menu_ProcessInputNoWrapClearOnChoose(void) { - s8 result = Menu_ProcessInputNoWrapAround(); + s8 result = Menu_ProcessInputNoWrap(); if (result != MENU_NOTHING_CHOSEN) sub_8198C78(); return result; @@ -1447,7 +1447,7 @@ s8 sub_8199284(void) return MENU_NOTHING_CHOSEN; } -s8 sub_8199334(void) +s8 Menu_ProcessInputGridLayout(void) { u8 oldPos = gUnknown_0203CD90.cursorPos; diff --git a/src/menu_helpers.c b/src/menu_helpers.c index 8cabbde42..79480cda2 100644 --- a/src/menu_helpers.c +++ b/src/menu_helpers.c @@ -169,7 +169,7 @@ void CreateYesNoMenuWithCallbacks(u8 taskId, const struct WindowTemplate *templa static void Task_CallYesOrNoCallback(u8 taskId) { - switch (Menu_ProcessInputNoWrap_()) + switch (Menu_ProcessInputNoWrapClearOnChoose()) { case 0: PlaySE(SE_SELECT); diff --git a/src/player_pc.c b/src/player_pc.c index bdbef1b43..18f4a8fc1 100644 --- a/src/player_pc.c +++ b/src/player_pc.c @@ -352,9 +352,9 @@ static void PlayerPCProcessMenuInput(u8 taskId) data = gTasks[taskId].data; if(gPcItemMenuOptionsNum > 3) - inputOptionId = ProcessMenuInput(); + inputOptionId = Menu_ProcessInput(); else - inputOptionId = Menu_ProcessInputNoWrapAround(); + inputOptionId = Menu_ProcessInputNoWrap(); switch(inputOptionId) { @@ -463,7 +463,7 @@ static void ItemStorageMenuProcessInput(u8 taskId) s8 inputOptionId; r5 = GetMenuCursorPos(); - inputOptionId = ProcessMenuInput(); + inputOptionId = Menu_ProcessInput(); r2 = GetMenuCursorPos(); switch(inputOptionId) { @@ -762,13 +762,13 @@ static void Mailbox_MoveToBag(u8 taskId) static void Mailbox_DrawYesNoBeforeMove(u8 taskId) { - sub_8197930(); + DisplayYesNoMenu(); gTasks[taskId].func = Mailbox_MoveToBagYesNoPrompt; } static void Mailbox_MoveToBagYesNoPrompt(u8 taskId) { - switch(Menu_ProcessInputNoWrap_()) + switch(Menu_ProcessInputNoWrapClearOnChoose()) { case 0: Mailbox_DoMailMoveToBag(taskId); diff --git a/src/pokeblock.c b/src/pokeblock.c index d0a867b3a..70ae6c455 100644 --- a/src/pokeblock.c +++ b/src/pokeblock.c @@ -1139,7 +1139,7 @@ static void Task_HandlePokeblockOptionsInput(u8 taskId) if (sub_81221EC() == TRUE) return; - itemId = Menu_ProcessInputNoWrapAround(); + itemId = Menu_ProcessInputNoWrap(); if (itemId == MENU_NOTHING_CHOSEN) { return; diff --git a/src/pokemon_storage_system.c b/src/pokemon_storage_system.c index 031f704a4..c102b570a 100644 --- a/src/pokemon_storage_system.c +++ b/src/pokemon_storage_system.c @@ -270,7 +270,7 @@ void Task_PokemonStorageSystem(u8 taskId) } break; case 2: - task->data[2] = ProcessMenuInput(); + task->data[2] = Menu_ProcessInput(); switch(task->data[2]) { case -2: diff --git a/src/script_menu.c b/src/script_menu.c index aec2e472f..0a1a019cb 100644 --- a/src/script_menu.c +++ b/src/script_menu.c @@ -1,10 +1,19 @@ #include "global.h" +#include "main.h" #include "event_data.h" +#include "field_specials.h" +#include "item.h" #include "menu.h" +#include "palette.h" +#include "script.h" #include "script_menu.h" +#include "sound.h" #include "string_util.h" +#include "strings.h" #include "task.h" #include "text.h" +#include "constants/items.h" +#include "constants/songs.h" struct MultichoiceListStruct { @@ -12,14 +21,24 @@ struct MultichoiceListStruct u8 count; }; -extern const struct MultichoiceListStruct gUnknown_0858B760[]; +extern const struct MultichoiceListStruct gMultichoiceLists[]; +extern const u8 gUnknown_0858BB68[]; +extern const u8 *sPCNameStrings[4]; +extern const u8 *gUnknown_0858BB80[7]; -IWRAM_DATA u8 gUnknown_03001124[6]; +extern EWRAM_DATA u8 gUnknown_02039F90; + +IWRAM_DATA u8 gUnknown_03001124[7]; IWRAM_DATA u32 filler_0300112c; /*static*/ void Task_HandleMultichoiceInput(u8); +/*static*/ void Task_HandleYesNoInput(u8); +/*static*/ void Task_HandleMultichoiceGridInput(u8); /*static*/ void DrawMultichoiceMenu(u8, u8, u8, bool8, u8); /*static*/ void sub_80E1FBC(u8, u8, u8, u8); +/*static*/ void sub_80E2A94(u8); +/*static*/ void CreatePCMenu(void); +/*static*/ void sub_80E2578(void); bool8 ScriptMenu_Multichoice(u8 left, u8 top, u8 multichoiceId, u8 ignoreBPress) { @@ -80,15 +99,23 @@ bool8 ScriptMenu_MultichoiceWithDefault(u8 left, u8 top, u8 multichoiceId, bool8 u8 right; u8 bottom; u8 windowId; - int count = gUnknown_0858B760[multichoiceId].count; - const struct MenuAction *actions = gUnknown_0858B760[multichoiceId].list; + u8 count = gMultichoiceLists[multichoiceId].count; + const struct MenuAction *actions = gMultichoiceLists[multichoiceId].list; + const struct MenuAction *action; int width = 0; u8 newWidth; - i = count; - while (0 < i) + // Must be a fakematch because come on, seriously + if (width < count) { - width = display_text_and_get_width(actions[count - i].text, width); + action = &actions[0]; + i = count; + do + { + width = display_text_and_get_width(action->text, width); + action++; + i--; + } while (i != 0); } newWidth = convert_pixel_width_to_tile_width(width); @@ -100,3 +127,587 @@ bool8 ScriptMenu_MultichoiceWithDefault(u8 left, u8 top, u8 multichoiceId, bool8 schedule_bg_copy_tilemap_to_vram(0); sub_80E1FBC(ignoreBPress, count, windowId, multichoiceId); } + +#define tLeft data[0] +#define tTop data[1] +#define tRight data[2] +#define tBottom data[3] +#define tIgnoreBPress data[4] +#define tDoWrap data[5] +#define tWindowId data[6] +#define tMultichoiceId data[7] + +/*static*/ void sub_80E1FBC(u8 ignoreBPress, u8 count, u8 windowId, u8 multichoiceId) +{ + u8 i; + u8 taskId; + gUnknown_02039F90 = 2; + + for (i = 0; i < 6; i++) + { + if (gUnknown_0858BB68[i] == multichoiceId) + { + gUnknown_02039F90 = 12; + } + } + + taskId = CreateTask(Task_HandleMultichoiceInput, 80); + + gTasks[taskId].tIgnoreBPress = ignoreBPress; + + if (count > 3) + gTasks[taskId].tDoWrap = TRUE; + else + gTasks[taskId].tDoWrap = FALSE; + + gTasks[taskId].tWindowId = windowId; + gTasks[taskId].tMultichoiceId = multichoiceId; + + sub_80E2A94(multichoiceId); +} + +/*static*/ void Task_HandleMultichoiceInput(u8 taskId) +{ + s8 selection; + s16 *data = gTasks[taskId].data; + + if (!gPaletteFade.active) + { + if (gUnknown_02039F90) + { + gUnknown_02039F90--; + } + else + { + if (!tDoWrap) + selection = Menu_ProcessInputNoWrap(); + else + selection = Menu_ProcessInput(); + + if (gMain.newKeys & (DPAD_UP | DPAD_DOWN)) + { + sub_80E2A94(tMultichoiceId); + } + + if (selection != -2) + { + if (selection == -1) + { + if (tIgnoreBPress) + return; + PlaySE(SE_SELECT); + gSpecialVar_Result = 127; + } + else + { + gSpecialVar_Result = selection; + } + sub_80E2A78(tWindowId); + DestroyTask(taskId); + EnableBothScriptContexts(); + } + } + } +} + +bool8 ScriptMenu_YesNo(u8 left, u8 top) +{ + u8 taskId; + + if (FuncIsActiveTask(Task_HandleYesNoInput) == TRUE) + { + return FALSE; + } + else + { + gSpecialVar_Result = 0xFF; + DisplayYesNoMenu(); + taskId = CreateTask(Task_HandleYesNoInput, 0x50); + return TRUE; + } +} + +// unused +bool8 IsScriptActive(void) +{ + if (gSpecialVar_Result == 0xFF) + return FALSE; + else + return TRUE; +} + +/*static*/ void Task_HandleYesNoInput(u8 taskId) +{ + u8 left, top; + + if (gTasks[taskId].tRight < 5) + { + gTasks[taskId].tRight++; + return; + } + + switch (Menu_ProcessInputNoWrapClearOnChoose()) + { + case -2: + return; + case -1: + case 1: + PlaySE(SE_SELECT); + gSpecialVar_Result = 0; + break; + case 0: + gSpecialVar_Result = 1; + break; + } + + DestroyTask(taskId); + EnableBothScriptContexts(); +} + +#ifdef NONMATCHING +bool8 ScriptMenu_MultichoiceGrid(u8 left, u8 top, u8 multichoiceId, u8 ignoreBPress, u8 columnCount) +{ + u8 bottom = 0; + + if (FuncIsActiveTask(Task_HandleMultichoiceGridInput) == TRUE) + { + return FALSE; + } + else + { + u8 taskId; + u8 unk2; + int width; + int i; + u8 newWidth; + + gSpecialVar_Result = 0xFF; + width = 0; + i = 0; + + if (width < gMultichoiceLists[multichoiceId].count) + { + do + { + width = display_text_and_get_width(gMultichoiceLists[multichoiceId].list[i].text, width); + i++; + } while (i < gMultichoiceLists[multichoiceId].count); + } + + newWidth = convert_pixel_width_to_tile_width(width); + + left = sub_80E2D5C(left, columnCount * newWidth); + unk2 = gMultichoiceLists[multichoiceId].count / columnCount; + + taskId = CreateTask(Task_HandleMultichoiceGridInput, 80); + + gTasks[taskId].tIgnoreBPress = ignoreBPress; + gTasks[taskId].tWindowId = CreateWindowFromRect(left, top, columnCount * newWidth, unk2 * 2); + SetStandardWindowBorderStyle(gTasks[taskId].tWindowId, 0); + sub_81997AC(gTasks[taskId].tWindowId, newWidth * 8, columnCount, unk2, gMultichoiceLists[multichoiceId].list); + sub_8199944(gTasks[taskId].tWindowId, newWidth * 8, columnCount, unk2, 0); + CopyWindowToVram(gTasks[taskId].tWindowId, 3); + return TRUE; + } +} +#else +NAKED +bool8 ScriptMenu_MultichoiceGrid(u8 left, u8 top, u8 multichoiceId, u8 ignoreBPress, u8 columnCount) +{ + asm_unified(" push {r4-r7,lr}\n\ + mov r7, r10\n\ + mov r6, r9\n\ + mov r5, r8\n\ + push {r5-r7}\n\ + sub sp, 0x10\n\ + ldr r4, [sp, 0x30]\n\ + lsls r0, 24\n\ + lsrs r7, r0, 24\n\ + lsls r1, 24\n\ + lsrs r1, 24\n\ + str r1, [sp, 0x4]\n\ + lsls r2, 24\n\ + lsrs r5, r2, 24\n\ + lsls r3, 24\n\ + lsrs r3, 24\n\ + str r3, [sp, 0x8]\n\ + lsls r4, 24\n\ + lsrs r4, 24\n\ + mov r10, r4\n\ + ldr r0, =Task_HandleMultichoiceGridInput\n\ + bl FuncIsActiveTask\n\ + lsls r0, 24\n\ + lsrs r0, 24\n\ + cmp r0, 0x1\n\ + bne _080E2210\n\ + movs r0, 0\n\ + b _080E22E8\n\ + .pool\n\ +_080E2210:\n\ + ldr r0, =gSpecialVar_Result\n\ + movs r1, 0xFF\n\ + strh r1, [r0]\n\ + movs r2, 0\n\ + movs r6, 0\n\ + ldr r1, =gMultichoiceLists\n\ + lsls r5, 3\n\ + adds r0, r5, r1\n\ + str r5, [sp, 0xC]\n\ + ldrb r0, [r0, 0x4]\n\ + cmp r2, r0\n\ + bge _080E2246\n\ + mov r8, r1\n\ +_080E222A:\n\ + mov r0, r8\n\ + adds r4, r5, r0\n\ + ldr r1, [r4]\n\ + lsls r0, r6, 3\n\ + adds r0, r1\n\ + ldr r0, [r0]\n\ + adds r1, r2, 0\n\ + bl display_text_and_get_width\n\ + adds r2, r0, 0\n\ + adds r6, 0x1\n\ + ldrb r4, [r4, 0x4]\n\ + cmp r6, r4\n\ + blt _080E222A\n\ +_080E2246:\n\ + adds r0, r2, 0\n\ + bl convert_pixel_width_to_tile_width\n\ + adds r5, r0, 0\n\ + lsls r5, 24\n\ + lsrs r5, 24\n\ + mov r1, r10\n\ + muls r1, r5\n\ + mov r8, r1\n\ + adds r0, r7, 0\n\ + bl sub_80E2D5C\n\ + lsls r0, 24\n\ + lsrs r7, r0, 24\n\ + ldr r2, =gMultichoiceLists\n\ + mov r9, r2\n\ + ldr r0, [sp, 0xC]\n\ + add r9, r0\n\ + mov r1, r9\n\ + ldrb r0, [r1, 0x4]\n\ + mov r1, r10\n\ + bl __udivsi3\n\ + adds r6, r0, 0\n\ + lsls r6, 24\n\ + lsrs r6, 24\n\ + ldr r0, =Task_HandleMultichoiceGridInput\n\ + movs r1, 0x50\n\ + bl CreateTask\n\ + lsls r0, 24\n\ + lsrs r0, 24\n\ + ldr r1, =gTasks\n\ + lsls r4, r0, 2\n\ + adds r4, r0\n\ + lsls r4, 3\n\ + adds r4, r1\n\ + mov r2, sp\n\ + ldrh r2, [r2, 0x8]\n\ + strh r2, [r4, 0x10]\n\ + mov r0, r8\n\ + lsls r0, 24\n\ + lsrs r0, 24\n\ + mov r8, r0\n\ + lsls r3, r6, 25\n\ + lsrs r3, 24\n\ + adds r0, r7, 0\n\ + ldr r1, [sp, 0x4]\n\ + mov r2, r8\n\ + bl CreateWindowFromRect\n\ + lsls r0, 24\n\ + lsrs r0, 24\n\ + strh r0, [r4, 0x14]\n\ + movs r1, 0\n\ + bl SetStandardWindowBorderStyle\n\ + ldrb r0, [r4, 0x14]\n\ + lsls r5, 27\n\ + lsrs r5, 24\n\ + mov r2, r9\n\ + ldr r1, [r2]\n\ + str r1, [sp]\n\ + adds r1, r5, 0\n\ + mov r2, r10\n\ + adds r3, r6, 0\n\ + bl sub_81997AC\n\ + ldrb r0, [r4, 0x14]\n\ + movs r1, 0\n\ + str r1, [sp]\n\ + adds r1, r5, 0\n\ + mov r2, r10\n\ + adds r3, r6, 0\n\ + bl sub_8199944\n\ + ldrb r0, [r4, 0x14]\n\ + movs r1, 0x3\n\ + bl CopyWindowToVram\n\ + movs r0, 0x1\n\ +_080E22E8:\n\ + add sp, 0x10\n\ + pop {r3-r5}\n\ + mov r8, r3\n\ + mov r9, r4\n\ + mov r10, r5\n\ + pop {r4-r7}\n\ + pop {r1}\n\ + bx r1\n\ + .pool"); +} +#endif + +/*static*/ void Task_HandleMultichoiceGridInput(u8 taskId) +{ + s16 *data = gTasks[taskId].data; + s8 selection = Menu_ProcessInputGridLayout(); + + if (selection != -2) + { + if (selection == -1) + { + if (tIgnoreBPress) + return; + PlaySE(SE_SELECT); + gSpecialVar_Result = 0x7F; + } + else + { + gSpecialVar_Result = selection; + } + sub_80E2A78(tWindowId); + DestroyTask(taskId); + EnableBothScriptContexts(); + } +} + +#undef tLeft +#undef tTop +#undef tRight +#undef tBottom +#undef tIgnoreBPress +#undef tDoWrap +#undef tWindowId +#undef tMultichoiceId + +bool8 ScrSpecial_CreatePCMenu(void) +{ + if (FuncIsActiveTask(Task_HandleMultichoiceInput) == TRUE) + { + return FALSE; + } + else + { + gSpecialVar_Result = 0xFF; + CreatePCMenu(); + return TRUE; + } +} + +/*static*/ void CreatePCMenu(void) +{ + u8 y = 8; + u32 pixelWidth = 0; + u8 width; + u8 numChoices; + u8 windowId; + int i; + + for (i = 0; i < ARRAY_COUNT(sPCNameStrings); i++) + { + pixelWidth = display_text_and_get_width(sPCNameStrings[i], pixelWidth); + } + + if (FlagGet(FLAG_SYS_GAME_CLEAR)) + { + pixelWidth = display_text_and_get_width(gText_HallOfFame, pixelWidth); + } + + width = convert_pixel_width_to_tile_width(pixelWidth); + + if (FlagGet(FLAG_SYS_GAME_CLEAR)) // player has cleared game? + { + numChoices = 4; + windowId = CreateWindowFromRect(0, 0, width, 8); + SetStandardWindowBorderStyle(windowId, 0); + AddTextPrinterParameterized(windowId, 1, gText_HallOfFame, y, 33, TEXT_SPEED_FF, NULL); + AddTextPrinterParameterized(windowId, 1, gText_LogOff, y, 49, TEXT_SPEED_FF, NULL); + } + else + { + numChoices = 3; + windowId = CreateWindowFromRect(0, 0, width, 6); + SetStandardWindowBorderStyle(windowId, 0); + AddTextPrinterParameterized(windowId, 1, gText_LogOff, y, 33, TEXT_SPEED_FF, NULL); + } + + if (FlagGet(FLAG_SYS_PC_LANETTE)) // player met lanette? + AddTextPrinterParameterized(windowId, 1, gText_LanettesPC, y, 1, TEXT_SPEED_FF, NULL); + else + AddTextPrinterParameterized(windowId, 1, gText_SomeonesPC, y, 1, TEXT_SPEED_FF, NULL); + + StringExpandPlaceholders(gStringVar4, gText_PlayersPC); + PrintPlayerNameOnWindow(windowId, gStringVar4, y, 17); + InitMenuInUpperLeftCornerPlaySoundWhenAPressed(windowId, numChoices, 0); + CopyWindowToVram(windowId, 3); + sub_80E1FBC(FALSE, numChoices, windowId, 1); +} + +void ScriptMenu_DisplayPCStartupPrompt(void) +{ + sub_819786C(0, TRUE); + AddTextPrinterParameterized2(0, 1, gText_WhichPCShouldBeAccessed, 0, NULL, 2, 1, 3); +} + +bool8 sub_80E2548(void) +{ + if (FuncIsActiveTask(Task_HandleMultichoiceInput) == TRUE) + { + return FALSE; + } + else + { + gSpecialVar_Result = 0xFF; + sub_80E2578(); + return TRUE; + } +} + +/*static*/ void sub_80E2578(void) +{ + u8 unk = 0; + u8 count; + u32 pixelWidth; + u8 width; + u8 windowId; + u8 i; + u8 y; + u32 j; + + for (i = 0; i < ARRAY_COUNT(gUnknown_03001124); i++) + { + gUnknown_03001124[i] |= 0xFF; + } + + GetFontAttribute(1, FONTATTR_MAX_LETTER_WIDTH); + + if (gSpecialVar_0x8004 == 0) + { + gUnknown_03001124[unk] = 0; + unk++; + if (FlagGet(FLAG_0x1D0) == TRUE) + { + gUnknown_03001124[unk] = 1; + unk++; + } + } + + if (CheckBagHasItem(ITEM_EON_TICKET, 1) == TRUE && FlagGet(FLAG_SYS_HAS_EON_TICKET) == TRUE) + { + if (gSpecialVar_0x8004 == 0) + { + gUnknown_03001124[unk] = 2; + unk++; + } + + if (gSpecialVar_0x8004 == 1 && FlagGet(FLAG_0x1AE) == FALSE) + { + gUnknown_03001124[unk] = 2; + unk++; + FlagSet(FLAG_0x1AE); + } + } + + if (CheckBagHasItem(ITEM_MYSTIC_TICKET, 1) == TRUE && FlagGet(FLAG_0x8E0) == TRUE) + { + if (gSpecialVar_0x8004 == 0) + { + gUnknown_03001124[unk] = 3; + unk++; + } + + if (gSpecialVar_0x8004 == 1 && FlagGet(FLAG_0x1DB) == FALSE) + { + gUnknown_03001124[unk] = 3; + unk++; + FlagSet(FLAG_0x1DB); + } + } + + if (CheckBagHasItem(ITEM_AURORA_TICKET, 1) == TRUE && FlagGet(FLAG_0x8D5) == TRUE) + { + if (gSpecialVar_0x8004 == 0) + { + gUnknown_03001124[unk] = 4; + unk++; + } + + if (gSpecialVar_0x8004 == 1 && FlagGet(FLAG_0x1AF) == FALSE) + { + gUnknown_03001124[unk] = 4; + unk++; + FlagSet(FLAG_0x1AF); + } + } + + if (CheckBagHasItem(ITEM_OLD_SEA_MAP, 1) == TRUE && FlagGet(FLAG_0x8D6) == TRUE) + { + if (gSpecialVar_0x8004 == 0) + { + gUnknown_03001124[unk] = 5; + unk++; + } + + if (gSpecialVar_0x8004 == 1 && FlagGet(FLAG_0x1B0) == FALSE) + { + gUnknown_03001124[unk] = 5; + unk++; + FlagSet(FLAG_0x1B0); + } + } + + gUnknown_03001124[unk] = 6; + unk++; + + if (gSpecialVar_0x8004 == 0 && FlagGet(FLAG_0x1D0) == TRUE) + { + count = unk; + } + + count = unk; + if (count == 7) + { + gSpecialVar_0x8004 = 11; + sub_813A128(); + } + else + { + pixelWidth = 0; + + for (j = 0; j < ARRAY_COUNT(gUnknown_0858BB80); j++) + { + u8 test = gUnknown_03001124[j]; + if (test != 0xFF) + { + pixelWidth = display_text_and_get_width(gUnknown_0858BB80[test], pixelWidth); + } + } + + width = convert_pixel_width_to_tile_width(pixelWidth); + windowId = CreateWindowFromRect(28 - width, (6 - count) * 2, width, count * 2); + SetStandardWindowBorderStyle(windowId, 0); + + for (y = 0, i = 0; i < ARRAY_COUNT(gUnknown_0858BB80); i++) + { + if (gUnknown_03001124[i] != 0xFF) + { + AddTextPrinterParameterized(windowId, 1, gUnknown_0858BB80[gUnknown_03001124[i]], 8, y * 16 + 1, TEXT_SPEED_FF, NULL); + y++; + } + } + + InitMenuInUpperLeftCornerPlaySoundWhenAPressed(windowId, count, count - 1); + CopyWindowToVram(windowId, 3); + sub_80E1FBC(FALSE, count, windowId, 8); + } +} diff --git a/src/secret_base.c b/src/secret_base.c index a684f3982..85c969ed2 100644 --- a/src/secret_base.c +++ b/src/secret_base.c @@ -997,7 +997,7 @@ void sub_80E9FB0(u8 taskId) { s8 input; - input = Menu_ProcessInputNoWrapAround(); + input = Menu_ProcessInputNoWrap(); switch (input) { case -1: @@ -1031,7 +1031,7 @@ void sub_80E9FFC(u8 taskId) void sub_80EA06C(u8 taskId) { - sub_8197930(); + DisplayYesNoMenu(); sub_8121F68(taskId, &gUnknown_0858D058); } diff --git a/src/shop.c b/src/shop.c index 510c9f4f7..053fd10a4 100755 --- a/src/shop.c +++ b/src/shop.c @@ -325,7 +325,7 @@ static void SetShopItemsForSale(const u16 *items) static void Task_ShopMenu(u8 taskId) { - s8 inputCode = Menu_ProcessInputNoWrapAround(); + s8 inputCode = Menu_ProcessInputNoWrap(); switch (inputCode) { case LIST_B_PRESSED: diff --git a/src/slot_machine.c b/src/slot_machine.c index f92ebd168..d7557af95 100644 --- a/src/slot_machine.c +++ b/src/slot_machine.c @@ -1269,7 +1269,7 @@ void PlaySlotMachine(u8 arg0, MainCallback cb) /*static */bool8 sub_8102344(struct Task *task) { - s8 input = Menu_ProcessInputNoWrap_(); + s8 input = Menu_ProcessInputNoWrapClearOnChoose(); if (input == 0) { sub_8197434(0, TRUE); diff --git a/src/start_menu.c b/src/start_menu.c index dcb2c4154..1b9294e1c 100644 --- a/src/start_menu.c +++ b/src/start_menu.c @@ -977,14 +977,14 @@ static u8 SaveConfirmSaveCallback(void) static u8 SaveYesNoCallback(void) { - sub_8197930(); // Show Yes/No menu + DisplayYesNoMenu(); // Show Yes/No menu sSaveDialogCallback = SaveConfirmInputCallback; return SAVE_IN_PROGRESS; } static u8 SaveConfirmInputCallback(void) { - switch (Menu_ProcessInputNoWrap_()) + switch (Menu_ProcessInputNoWrapClearOnChoose()) { case 0: // Yes switch (gSaveFileStatus) @@ -1037,14 +1037,14 @@ static u8 SaveConfirmOverwriteNoCallback(void) static u8 SaveConfirmOverwriteCallback(void) { - sub_8197930(); // Show Yes/No menu + DisplayYesNoMenu(); // Show Yes/No menu sSaveDialogCallback = SaveOverwriteInputCallback; return SAVE_IN_PROGRESS; } static u8 SaveOverwriteInputCallback(void) { - switch (Menu_ProcessInputNoWrap_()) + switch (Menu_ProcessInputNoWrapClearOnChoose()) { case 0: // Yes sSaveDialogCallback = SaveSavingMessageCallback; @@ -1168,7 +1168,7 @@ static u8 BattlePyramidRetireYesNoCallback(void) static u8 BattlePyramidRetireInputCallback(void) { - switch (Menu_ProcessInputNoWrap_()) + switch (Menu_ProcessInputNoWrapClearOnChoose()) { case 0: // Yes return SAVE_CANCELED; diff --git a/src/starter_choose.c b/src/starter_choose.c index 179d9a05a..56ae9924b 100644 --- a/src/starter_choose.c +++ b/src/starter_choose.c @@ -534,7 +534,7 @@ static void Task_StarterChoose5(u8 taskId) { u8 spriteId; - switch (Menu_ProcessInputNoWrap_()) + switch (Menu_ProcessInputNoWrapClearOnChoose()) { case 0: // YES // Return the starter choice and exit. diff --git a/src/trader.c b/src/trader.c index f081d7e95..e23efb4ce 100644 --- a/src/trader.c +++ b/src/trader.c @@ -109,7 +109,7 @@ void sub_8133BE4(u8 taskId, u8 decorationId) void Task_HandleGetDecorationMenuInput(u8 taskId) { struct MauvilleOldManTrader *trader = &gSaveBlock1Ptr->oldMan.trader; - s8 input = ProcessMenuInput(); + s8 input = Menu_ProcessInput(); switch (input) { diff --git a/src/wallclock.c b/src/wallclock.c index 6bcfa1717..ffa74cd50 100644 --- a/src/wallclock.c +++ b/src/wallclock.c @@ -792,7 +792,7 @@ static void Task_SetClock3(u8 taskId) static void Task_SetClock4(u8 taskId) { - switch (Menu_ProcessInputNoWrap_()) + switch (Menu_ProcessInputNoWrapClearOnChoose()) { case 0: PlaySE(SE_SELECT);