r5/r6 swap on sub_80E2578

This commit is contained in:
Diegoisawesome 2018-11-05 14:45:54 -06:00
parent 645830624d
commit 7dd4ed7060
38 changed files with 719 additions and 1138 deletions

View File

@ -369,7 +369,7 @@ _0811AF86:
thumb_func_start sub_811AF8C thumb_func_start sub_811AF8C
sub_811AF8C: @ 811AF8C sub_811AF8C: @ 811AF8C
push {lr} push {lr}
bl Menu_ProcessInputNoWrap_ bl Menu_ProcessInputNoWrapClearOnChoose
lsls r0, 24 lsls r0, 24
asrs r1, r0, 24 asrs r1, r0, 24
cmp r1, 0 cmp r1, 0
@ -418,7 +418,7 @@ _0811AFE6:
thumb_func_start sub_811AFEC thumb_func_start sub_811AFEC
sub_811AFEC: @ 811AFEC sub_811AFEC: @ 811AFEC
push {r4,lr} push {r4,lr}
bl Menu_ProcessInputNoWrap_ bl Menu_ProcessInputNoWrapClearOnChoose
lsls r0, 24 lsls r0, 24
asrs r1, r0, 24 asrs r1, r0, 24
cmp r1, 0 cmp r1, 0
@ -461,7 +461,7 @@ _0811B03A:
thumb_func_start sub_811B040 thumb_func_start sub_811B040
sub_811B040: @ 811B040 sub_811B040: @ 811B040
push {lr} push {lr}
bl Menu_ProcessInputNoWrap_ bl Menu_ProcessInputNoWrapClearOnChoose
lsls r0, 24 lsls r0, 24
asrs r1, r0, 24 asrs r1, r0, 24
cmp r1, 0 cmp r1, 0
@ -566,7 +566,7 @@ sub_811B0E8: @ 811B0E8
thumb_func_start sub_811B0F8 thumb_func_start sub_811B0F8
sub_811B0F8: @ 811B0F8 sub_811B0F8: @ 811B0F8
push {r4,lr} push {r4,lr}
bl Menu_ProcessInputNoWrap_ bl Menu_ProcessInputNoWrapClearOnChoose
lsls r0, 24 lsls r0, 24
asrs r1, r0, 24 asrs r1, r0, 24
cmp r1, 0 cmp r1, 0

View File

@ -2740,7 +2740,7 @@ sub_81B1708: @ 81B1708
push {r4,lr} push {r4,lr}
lsls r0, 24 lsls r0, 24
lsrs r4, r0, 24 lsrs r4, r0, 24
bl Menu_ProcessInputNoWrap_ bl Menu_ProcessInputNoWrapClearOnChoose
lsls r0, 24 lsls r0, 24
asrs r1, r0, 24 asrs r1, r0, 24
cmp r1, 0 cmp r1, 0
@ -4196,7 +4196,7 @@ sub_81B227C: @ 81B227C
push {r4,lr} push {r4,lr}
lsls r0, 24 lsls r0, 24
lsrs r4, r0, 24 lsrs r4, r0, 24
bl Menu_ProcessInputNoWrap_ bl Menu_ProcessInputNoWrapClearOnChoose
lsls r0, 24 lsls r0, 24
asrs r1, r0, 24 asrs r1, r0, 24
cmp r1, 0 cmp r1, 0
@ -8138,7 +8138,7 @@ sub_81B43DC: @ 81B43DC
push {r4-r6,lr} push {r4-r6,lr}
lsls r0, 24 lsls r0, 24
lsrs r4, r0, 24 lsrs r4, r0, 24
bl Menu_ProcessInputNoWrap_ bl Menu_ProcessInputNoWrapClearOnChoose
lsls r0, 24 lsls r0, 24
asrs r1, r0, 24 asrs r1, r0, 24
cmp r1, 0 cmp r1, 0
@ -8671,7 +8671,7 @@ sub_81B48DC: @ 81B48DC
muls r1, r0 muls r1, r0
ldr r0, =gPlayerParty ldr r0, =gPlayerParty
adds r4, r1, r0 adds r4, r1, r0
bl Menu_ProcessInputNoWrap_ bl Menu_ProcessInputNoWrapClearOnChoose
lsls r0, 24 lsls r0, 24
asrs r1, r0, 24 asrs r1, r0, 24
cmp r1, 0 cmp r1, 0
@ -8963,7 +8963,7 @@ sub_81B4BA0: @ 81B4BA0
push {r4,lr} push {r4,lr}
lsls r0, 24 lsls r0, 24
lsrs r4, r0, 24 lsrs r4, r0, 24
bl Menu_ProcessInputNoWrap_ bl Menu_ProcessInputNoWrapClearOnChoose
lsls r0, 24 lsls r0, 24
asrs r1, r0, 24 asrs r1, r0, 24
cmp r1, 0 cmp r1, 0
@ -9069,7 +9069,7 @@ sub_81B4C94: @ 81B4C94
push {r7} push {r7}
lsls r0, 24 lsls r0, 24
lsrs r5, r0, 24 lsrs r5, r0, 24
bl Menu_ProcessInputNoWrap_ bl Menu_ProcessInputNoWrapClearOnChoose
lsls r0, 24 lsls r0, 24
asrs r1, r0, 24 asrs r1, r0, 24
cmp r1, 0 cmp r1, 0
@ -9877,7 +9877,7 @@ sub_81B5430: @ 81B5430
push {r4,lr} push {r4,lr}
lsls r0, 24 lsls r0, 24
lsrs r4, r0, 24 lsrs r4, r0, 24
bl Menu_ProcessInputNoWrap_ bl Menu_ProcessInputNoWrapClearOnChoose
lsls r0, 24 lsls r0, 24
asrs r1, r0, 24 asrs r1, r0, 24
cmp r1, 0 cmp r1, 0
@ -10171,7 +10171,7 @@ sub_81B56D8: @ 81B56D8
push {r4,lr} push {r4,lr}
lsls r0, 24 lsls r0, 24
lsrs r4, r0, 24 lsrs r4, r0, 24
bl Menu_ProcessInputNoWrap_ bl Menu_ProcessInputNoWrapClearOnChoose
lsls r0, 24 lsls r0, 24
asrs r1, r0, 24 asrs r1, r0, 24
cmp r1, 0 cmp r1, 0
@ -12543,7 +12543,7 @@ ether_effect_related_3: @ 81B6AB4
lsls r0, 24 lsls r0, 24
lsrs r4, r0, 24 lsrs r4, r0, 24
adds r5, r4, 0 adds r5, r4, 0
bl ProcessMenuInput bl Menu_ProcessInput
lsls r0, 24 lsls r0, 24
asrs r1, r0, 24 asrs r1, r0, 24
movs r0, 0x2 movs r0, 0x2
@ -13156,7 +13156,7 @@ sub_81B7028: @ 81B7028
push {r4,lr} push {r4,lr}
lsls r0, 24 lsls r0, 24
lsrs r4, r0, 24 lsrs r4, r0, 24
bl Menu_ProcessInputNoWrap_ bl Menu_ProcessInputNoWrapClearOnChoose
lsls r0, 24 lsls r0, 24
asrs r1, r0, 24 asrs r1, r0, 24
cmp r1, 0 cmp r1, 0
@ -13458,7 +13458,7 @@ sub_81B72C8: @ 81B72C8
muls r1, r0 muls r1, r0
ldr r0, =gPlayerParty ldr r0, =gPlayerParty
adds r4, r1, r0 adds r4, r1, r0
bl Menu_ProcessInputNoWrap_ bl Menu_ProcessInputNoWrapClearOnChoose
lsls r0, 24 lsls r0, 24
asrs r5, r0, 24 asrs r5, r0, 24
cmp r5, 0 cmp r5, 0
@ -15240,7 +15240,7 @@ sub_81B82D4: @ 81B82D4
push {r4-r7,lr} push {r4-r7,lr}
lsls r0, 24 lsls r0, 24
lsrs r5, r0, 24 lsrs r5, r0, 24
bl Menu_ProcessInputNoWrap_ bl Menu_ProcessInputNoWrapClearOnChoose
lsls r0, 24 lsls r0, 24
asrs r1, r0, 24 asrs r1, r0, 24
cmp r1, 0 cmp r1, 0

View File

@ -1904,7 +1904,7 @@ _080C8F0C:
adds r0, 0x1 adds r0, 0x1
strb r0, [r1] strb r0, [r1]
_080C8F22: _080C8F22:
bl Menu_ProcessInputNoWrap_ bl Menu_ProcessInputNoWrapClearOnChoose
lsls r0, 24 lsls r0, 24
asrs r1, r0, 24 asrs r1, r0, 24
cmp r1, 0 cmp r1, 0
@ -2628,7 +2628,7 @@ _080C9584:
b _080C9664 b _080C9664
.pool .pool
_080C95A4: _080C95A4:
bl Menu_ProcessInputNoWrap_ bl Menu_ProcessInputNoWrapClearOnChoose
lsls r0, 24 lsls r0, 24
asrs r1, r0, 24 asrs r1, r0, 24
cmp r1, 0 cmp r1, 0
@ -3422,7 +3422,7 @@ _080C9C78:
b _080C9CAA b _080C9CAA
.pool .pool
_080C9C8C: _080C9C8C:
bl Menu_ProcessInputNoWrap_ bl Menu_ProcessInputNoWrapClearOnChoose
lsls r0, 24 lsls r0, 24
asrs r1, r0, 24 asrs r1, r0, 24
cmp r1, 0 cmp r1, 0
@ -3553,7 +3553,7 @@ _080C9DAC:
b _080C9DE0 b _080C9DE0
.pool .pool
_080C9DC0: _080C9DC0:
bl Menu_ProcessInputNoWrap_ bl Menu_ProcessInputNoWrapClearOnChoose
lsls r0, 24 lsls r0, 24
asrs r1, r0, 24 asrs r1, r0, 24
cmp r1, 0 cmp r1, 0

View File

@ -2905,7 +2905,7 @@ _080170CA:
negs r0, r0 negs r0, r0
b _08017110 b _08017110
_080170D4: _080170D4:
bl sub_8197930 bl DisplayYesNoMenu
ldrb r0, [r4] ldrb r0, [r4]
adds r0, 0x1 adds r0, 0x1
strb r0, [r4] strb r0, [r4]
@ -2920,7 +2920,7 @@ _080170E0:
negs r0, r0 negs r0, r0
b _08017110 b _08017110
_080170F2: _080170F2:
bl Menu_ProcessInputNoWrap_ bl Menu_ProcessInputNoWrapClearOnChoose
lsls r0, 24 lsls r0, 24
asrs r1, r0, 24 asrs r1, r0, 24
movs r2, 0x80 movs r2, 0x80
@ -6278,7 +6278,7 @@ _08018BD6:
b _08018C3E b _08018C3E
.pool .pool
_08018BE4: _08018BE4:
bl Menu_ProcessInputNoWrap_ bl Menu_ProcessInputNoWrapClearOnChoose
lsls r0, 24 lsls r0, 24
asrs r6, r0, 24 asrs r6, r0, 24
movs r1, 0x80 movs r1, 0x80
@ -16904,7 +16904,7 @@ _0801E16A:
b _0801E23A b _0801E23A
.pool .pool
_0801E17C: _0801E17C:
bl ProcessMenuInput bl Menu_ProcessInput
lsls r0, 24 lsls r0, 24
asrs r0, 8 asrs r0, 8
lsrs r6, r0, 16 lsrs r6, r0, 16
@ -20614,7 +20614,7 @@ _0801FEFE:
thumb_func_start sub_801FF08 thumb_func_start sub_801FF08
sub_801FF08: @ 801FF08 sub_801FF08: @ 801FF08
push {lr} push {lr}
bl ProcessMenuInput bl Menu_ProcessInput
lsls r0, 24 lsls r0, 24
asrs r0, 24 asrs r0, 24
pop {r1} pop {r1}
@ -28887,10 +28887,10 @@ _08024246:
strb r0, [r5, 0xC] strb r0, [r5, 0xC]
b _080242D8 b _080242D8
_0802426A: _0802426A:
bl sub_8197930 bl DisplayYesNoMenu
b _080242D0 b _080242D0
_08024270: _08024270:
bl Menu_ProcessInputNoWrap_ bl Menu_ProcessInputNoWrapClearOnChoose
lsls r0, 24 lsls r0, 24
asrs r4, r0, 24 asrs r4, r0, 24
movs r0, 0x2 movs r0, 0x2
@ -47811,7 +47811,7 @@ _0802DA84:
thumb_func_start sub_802DA8C thumb_func_start sub_802DA8C
sub_802DA8C: @ 802DA8C sub_802DA8C: @ 802DA8C
push {lr} push {lr}
bl Menu_ProcessInputNoWrap_ bl Menu_ProcessInputNoWrapClearOnChoose
lsls r0, 24 lsls r0, 24
asrs r0, 24 asrs r0, 24
pop {r1} pop {r1}

View File

@ -736,7 +736,7 @@ sub_8140914: @ 8140914
adds r4, r0, 0 adds r4, r0, 0
lsls r4, 24 lsls r4, 24
lsrs r4, 24 lsrs r4, 24
bl sub_8197930 bl DisplayYesNoMenu
ldr r5, =gUnknown_0203AB8C ldr r5, =gUnknown_0203AB8C
ldrb r0, [r5] ldrb r0, [r5]
movs r1, 0 movs r1, 0
@ -4502,7 +4502,7 @@ sub_81428C4: @ 81428C4
adds r4, r0, 0 adds r4, r0, 0
lsls r4, 24 lsls r4, 24
lsrs r4, 24 lsrs r4, 24
bl sub_8197930 bl DisplayYesNoMenu
ldr r1, =gUnknown_085B6408 ldr r1, =gUnknown_085B6408
adds r0, r4, 0 adds r0, r4, 0
bl sub_8121F68 bl sub_8121F68

File diff suppressed because it is too large Load Diff

View File

@ -3349,7 +3349,7 @@ sub_8078EF8: @ 8078EF8
sub_8078F50: @ 8078F50 sub_8078F50: @ 8078F50
push {lr} push {lr}
sub sp, 0x4 sub sp, 0x4
bl Menu_ProcessInputNoWrapAround bl Menu_ProcessInputNoWrap
lsls r0, 24 lsls r0, 24
asrs r0, 24 asrs r0, 24
movs r1, 0x1 movs r1, 0x1
@ -3695,7 +3695,7 @@ _0807920E:
thumb_func_start sub_8079218 thumb_func_start sub_8079218
sub_8079218: @ 8079218 sub_8079218: @ 8079218
push {lr} push {lr}
bl Menu_ProcessInputNoWrap_ bl Menu_ProcessInputNoWrapClearOnChoose
lsls r0, 24 lsls r0, 24
asrs r1, r0, 24 asrs r1, r0, 24
cmp r1, 0 cmp r1, 0
@ -3797,7 +3797,7 @@ _080792D8:
thumb_func_start sub_80792E4 thumb_func_start sub_80792E4
sub_80792E4: @ 80792E4 sub_80792E4: @ 80792E4
push {lr} push {lr}
bl Menu_ProcessInputNoWrap_ bl Menu_ProcessInputNoWrapClearOnChoose
lsls r0, 24 lsls r0, 24
asrs r1, r0, 24 asrs r1, r0, 24
cmp r1, 0 cmp r1, 0

View File

@ -900,7 +900,7 @@ sub_8166D44: @ 8166D44
thumb_func_start sub_8166DE4 thumb_func_start sub_8166DE4
sub_8166DE4: @ 8166DE4 sub_8166DE4: @ 8166DE4
push {r4,lr} push {r4,lr}
bl Menu_ProcessInputNoWrap_ bl Menu_ProcessInputNoWrapClearOnChoose
lsls r0, 24 lsls r0, 24
lsrs r4, r0, 24 lsrs r4, r0, 24
asrs r1, r0, 24 asrs r1, r0, 24

View File

@ -1771,7 +1771,7 @@ EventScript_PC:: @ 8271D92
end end
EventScript_271DAC:: @ 8271DAC EventScript_271DAC:: @ 8271DAC
message gUnknown_0827266F message gText_WhichPCShouldBeAccessed
waitmessage waitmessage
special ScrSpecial_CreatePCMenu special ScrSpecial_CreatePCMenu
waitstate waitstate
@ -3112,7 +3112,7 @@ Text_272640: @ 8272640
Text_27265A: @ 827265A Text_27265A: @ 827265A
.string "{PLAYER} booted up the PC.$" .string "{PLAYER} booted up the PC.$"
gUnknown_0827266F:: @ 827266F gText_WhichPCShouldBeAccessed:: @ 827266F
.string "Which PC should be accessed?$" .string "Which PC should be accessed?$"
gUnknown_0827268C:: @ 827268C gUnknown_0827268C:: @ 827268C

View File

@ -577,7 +577,7 @@ gUnknown_0858B758:: @ 58B758
.4byte gText_Exit, 0 .4byte gText_Exit, 0
gUnknown_0858B760:: @ 858B760 gMultichoiceLists:: @ 858B760
.4byte gUnknown_0858ABD8, 3 .4byte gUnknown_0858ABD8, 3
.4byte gUnknown_0858B758, 1 .4byte gUnknown_0858B758, 1
.4byte gUnknown_0858ABF0, 3 .4byte gUnknown_0858ABF0, 3
@ -729,7 +729,7 @@ gUnknown_0858BB68:: @ 858BB68
.byte 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F .byte 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F
.align 2 .align 2
gUnknown_0858BB70:: @ 858BB70 sPCNameStrings:: @ 858BB70
.4byte gText_SomeonesPC .4byte gText_SomeonesPC
.4byte gText_LanettesPC .4byte gText_LanettesPC
.4byte gText_PlayersPC .4byte gText_PlayersPC

View File

@ -15,5 +15,6 @@ bool32 sub_8138168(void);
bool32 sub_81381B0(void); bool32 sub_81381B0(void);
bool32 sub_81381F8(void); bool32 sub_81381F8(void);
bool32 CountSSTidalStep(u16 delta); bool32 CountSSTidalStep(u16 delta);
void sub_813A128(void);
#endif // GUARD_FIELD_SPECIALS_H #endif // GUARD_FIELD_SPECIALS_H

View File

@ -32,7 +32,7 @@ void PrintPlayerNameOnWindow(u8, const u8*, u16, u16);
void DisplayItemMessageOnField(u8 taskId, const u8 *src, TaskFunc callback); void DisplayItemMessageOnField(u8 taskId, const u8 *src, TaskFunc callback);
void sub_8197434(u8 windowId, bool8 copyToVram); void sub_8197434(u8 windowId, bool8 copyToVram);
void SetStandardWindowBorderStyle(u8 a0, u8 a1); void SetStandardWindowBorderStyle(u8 a0, u8 a1);
void sub_8197930(void); void DisplayYesNoMenu(void);
u8 GetPlayerTextSpeed(void); u8 GetPlayerTextSpeed(void);
void sub_81978B0(u16 arg0); void sub_81978B0(u16 arg0);
void AddTextPrinterWithCallbackForMessage(bool8 a1, void (*callback)(struct TextSubPrinter *, u16)); 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); void PrintMenuTable(u8 windowId, u8 itemCount, const struct MenuAction *strs);
u8 InitMenuInUpperLeftCornerPlaySoundWhenAPressed(u8 windowId, u8 numItems, u8 initialCursorPos); u8 InitMenuInUpperLeftCornerPlaySoundWhenAPressed(u8 windowId, u8 numItems, u8 initialCursorPos);
u8 GetMenuCursorPos(void); u8 GetMenuCursorPos(void);
s8 ProcessMenuInput(void); s8 Menu_ProcessInput(void);
s8 Menu_ProcessInputNoWrapAround(void); s8 Menu_ProcessInputNoWrap(void);
void blit_move_info_icon(u8 winId, u8 a2, u16 x, u16 y); void blit_move_info_icon(u8 winId, u8 a2, u16 x, u16 y);
void reset_temp_tile_data_buffers(void); 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); 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); 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 CreateYesNoMenu(const struct WindowTemplate *windowTemplate, u16 borderFirstTileNum, u8 borderPalette, u8 initialCursorPos);
void DecompressAndLoadBgGfxUsingHeap(u8 bgId, const void *src, int size, u16 offset, u8 mode); 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); s8 ProcessMenuInput_other(void);
void do_scheduled_bg_tilemap_copies_to_vram(void); void do_scheduled_bg_tilemap_copies_to_vram(void);
void clear_scheduled_bg_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_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_8198204(const u8 *string, const u8 *string2, u8 a3, u8 a4, bool8 copyToVram);
void sub_8197AE8(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 #endif // GUARD_MENU_H

View File

@ -13,6 +13,6 @@ s32 convert_pixel_width_to_tile_width(s32);
u8 CreateWindowFromRect(u8, u8, u8, u8); u8 CreateWindowFromRect(u8, u8, u8, u8);
void sub_80E2A78(u8); void sub_80E2A78(u8);
u32 display_text_and_get_width(const u8*, u32); 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 #endif //GUARD_SCRIPT_MENU_H

View File

@ -877,4 +877,11 @@ extern const u8 gText_PokemonOnHook[];
extern const u8 gText_NotEvenANibble[]; extern const u8 gText_NotEvenANibble[];
extern const u8 gText_ItGotAway[]; 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 #endif //GUARD_STRINGS_H

View File

@ -1570,9 +1570,9 @@ static void Task_ChooseAnswer(u8 taskId)
s16 *data = gTasks[taskId].data; s16 *data = gTasks[taskId].data;
if (!tWrapAround) if (!tWrapAround)
input = Menu_ProcessInputNoWrapAround(); input = Menu_ProcessInputNoWrap();
else else
input = ProcessMenuInput(); input = Menu_ProcessInput();
switch (input) switch (input)
{ {

View File

@ -949,7 +949,7 @@ static void HandleFewMenuActionsInput(u8 taskId)
{ {
if (sub_81221EC() != TRUE) if (sub_81221EC() != TRUE)
{ {
s32 id = Menu_ProcessInputNoWrapAround(); s32 id = Menu_ProcessInputNoWrap();
switch (id) switch (id)
{ {
case -2: case -2:

View File

@ -2499,7 +2499,7 @@ static void CB2_HandleBlenderEndGame(void)
sBerryBlenderData->gameEndState++; sBerryBlenderData->gameEndState++;
break; break;
case 10: case 10:
switch (Menu_ProcessInputNoWrap_()) switch (Menu_ProcessInputNoWrapClearOnChoose())
{ {
case 1: case 1:
case -1: case -1:

View File

@ -86,7 +86,7 @@ static void Task_DoClearSaveDataScreenYesNo(u8 taskId)
static void Task_ClearSaveDataScreenYesNoChoice(u8 taskId) static void Task_ClearSaveDataScreenYesNoChoice(u8 taskId)
{ {
switch(Menu_ProcessInputNoWrap_()) switch(Menu_ProcessInputNoWrapClearOnChoose())
{ {
case 0: case 0:
FillWindowPixelBuffer(0, 17); FillWindowPixelBuffer(0, 17);

View File

@ -520,7 +520,7 @@ void sub_8126B80(u8 taskId)
if (!gPaletteFade.active) if (!gPaletteFade.active)
{ {
menuPos = GetMenuCursorPos(); menuPos = GetMenuCursorPos();
switch (ProcessMenuInput()) switch (Menu_ProcessInput())
{ {
default: default:
PlaySE(SE_SELECT); PlaySE(SE_SELECT);
@ -710,7 +710,7 @@ void sub_8127088(u8 taskId)
if (!gPaletteFade.active) if (!gPaletteFade.active)
{ {
input = ProcessMenuInput(); input = Menu_ProcessInput();
switch (input) switch (input)
{ {
case -1: case -1:
@ -1628,7 +1628,7 @@ void sub_8128950(u8 taskId)
void sub_81289D0(u8 taskId) void sub_81289D0(u8 taskId)
{ {
sub_8197930(); DisplayYesNoMenu();
sub_8121F68(taskId, &gUnknown_085A72C4); sub_8121F68(taskId, &gUnknown_085A72C4);
} }
@ -1693,7 +1693,7 @@ void sub_8128AAC(u8 taskId)
void sub_8128B80(u8 taskId) void sub_8128B80(u8 taskId)
{ {
sub_8197930(); DisplayYesNoMenu();
sub_8121F68(taskId, &gUnknown_085A72CC); sub_8121F68(taskId, &gUnknown_085A72CC);
} }
@ -2588,7 +2588,7 @@ void sub_812A0E8(u8 taskId)
void sub_812A1A0(u8 taskId) void sub_812A1A0(u8 taskId)
{ {
sub_8197930(); DisplayYesNoMenu();
sub_8121F68(taskId, &gUnknown_085A7348); sub_8121F68(taskId, &gUnknown_085A7348);
} }
@ -2601,7 +2601,7 @@ void sub_812A1C0(u8 taskId)
void sub_812A1F0(u8 taskId) void sub_812A1F0(u8 taskId)
{ {
sub_8197930(); DisplayYesNoMenu();
sub_8121F68(taskId, &gUnknown_085A7350); sub_8121F68(taskId, &gUnknown_085A7350);
} }
@ -2725,7 +2725,7 @@ void sub_812A3D4(u8 taskId)
void sub_812A458(u8 taskId) void sub_812A458(u8 taskId)
{ {
sub_8197930(); DisplayYesNoMenu();
sub_8121F68(taskId, &gUnknown_085A741C); sub_8121F68(taskId, &gUnknown_085A741C);
} }

View File

@ -673,7 +673,7 @@ static void CB2_EggHatch_1(void)
} }
break; break;
case 10: case 10:
switch (Menu_ProcessInputNoWrap_()) switch (Menu_ProcessInputNoWrapClearOnChoose())
{ {
case 0: case 0:
GetMonNick(&gPlayerParty[sEggHatchData->eggPartyID], gStringVar3); GetMonNick(&gPlayerParty[sEggHatchData->eggPartyID], gStringVar3);

View File

@ -1218,7 +1218,7 @@ static void Task_TradeEvolutionScene(u8 taskID)
} }
break; break;
case 4: case 4:
switch (Menu_ProcessInputNoWrap_()) switch (Menu_ProcessInputNoWrapClearOnChoose())
{ {
case 0: case 0:
sEvoCursorPos = 0; sEvoCursorPos = 0;

View File

@ -1543,7 +1543,7 @@ void Task_HandleInBattleItemMenuInput(u8 taskId)
{ {
if (sub_81221EC() != TRUE) if (sub_81221EC() != TRUE)
{ {
s8 r4 = Menu_ProcessInputNoWrapAround(); s8 r4 = Menu_ProcessInputNoWrap();
switch (r4) switch (r4)
{ {
case -2: case -2:

View File

@ -377,7 +377,7 @@ static void LearnMoveMain(void)
break; break;
case 9: case 9:
{ {
s8 selection = Menu_ProcessInputNoWrap_(); s8 selection = Menu_ProcessInputNoWrapClearOnChoose();
if (selection == 0) if (selection == 0)
{ {
@ -414,7 +414,7 @@ static void LearnMoveMain(void)
break; break;
case 13: case 13:
{ {
s8 selection = Menu_ProcessInputNoWrap_(); s8 selection = Menu_ProcessInputNoWrapClearOnChoose();
if (selection == 0) if (selection == 0)
{ {
@ -447,7 +447,7 @@ static void LearnMoveMain(void)
break; break;
case 18: case 18:
{ {
s8 var = Menu_ProcessInputNoWrap_(); s8 var = Menu_ProcessInputNoWrapClearOnChoose();
if (var == 0) if (var == 0)
{ {
@ -474,7 +474,7 @@ static void LearnMoveMain(void)
break; break;
case 26: case 26:
{ {
s8 var = Menu_ProcessInputNoWrap_(); s8 var = Menu_ProcessInputNoWrapClearOnChoose();
if (var == 0) if (var == 0)
{ {

View File

@ -1501,7 +1501,7 @@ static void Task_NewGameBirchSpeech_CreateNameYesNo(u8 taskId)
static void Task_NewGameBirchSpeech_ProcessNameYesNoMenu(u8 taskId) static void Task_NewGameBirchSpeech_ProcessNameYesNoMenu(u8 taskId)
{ {
switch (Menu_ProcessInputNoWrap_()) switch (Menu_ProcessInputNoWrapClearOnChoose())
{ {
case 0: case 0:
PlaySE(SE_SELECT); PlaySE(SE_SELECT);
@ -1976,7 +1976,7 @@ static void NewGameBirchSpeech_ShowGenderMenu(void)
static s8 NewGameBirchSpeech_ProcessGenderMenuInput(void) static s8 NewGameBirchSpeech_ProcessGenderMenuInput(void)
{ {
return Menu_ProcessInputNoWrapAround(); return Menu_ProcessInputNoWrap();
} }
static void NewGameBirchSpeech_SetDefaultPlayerName(u8 nameId) static void NewGameBirchSpeech_SetDefaultPlayerName(u8 nameId)

View File

@ -1179,7 +1179,7 @@ static void Task_StoryListMenu(u8 taskId) // Task_StoryListMenu
task->data[0]++; task->data[0]++;
break; break;
case 1: case 1:
selection = ProcessMenuInput(); selection = Menu_ProcessInput();
if (selection == -2) if (selection == -2)
break; break;
if (selection == -1 || selection == GetFreeStorySlot()) if (selection == -1 || selection == GetFreeStorySlot())

View File

@ -458,7 +458,7 @@ void DisplayItemMessageOnField(u8 taskId, const u8 *string, TaskFunc callback)
CopyWindowToVram(0, 3); CopyWindowToVram(0, 3);
} }
void sub_8197930(void) void DisplayYesNoMenu(void)
{ {
CreateYesNoMenu(&gUnknown_0860F0A8, STD_WINDOW_BASE_TILE_NUM, STD_WINDOW_PALETTE_NUM, 0); CreateYesNoMenu(&gUnknown_0860F0A8, STD_WINDOW_BASE_TILE_NUM, STD_WINDOW_PALETTE_NUM, 0);
} }
@ -972,7 +972,7 @@ u8 GetMenuCursorPos(void)
return gUnknown_0203CD90.cursorPos; return gUnknown_0203CD90.cursorPos;
} }
s8 ProcessMenuInput(void) s8 Menu_ProcessInput(void)
{ {
if (gMain.newKeys & A_BUTTON) if (gMain.newKeys & A_BUTTON)
{ {
@ -1000,7 +1000,7 @@ s8 ProcessMenuInput(void)
return MENU_NOTHING_CHOSEN; return MENU_NOTHING_CHOSEN;
} }
s8 Menu_ProcessInputNoWrapAround(void) s8 Menu_ProcessInputNoWrap(void)
{ {
u8 oldPos = gUnknown_0203CD90.cursorPos; 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); 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) if (result != MENU_NOTHING_CHOSEN)
sub_8198C78(); sub_8198C78();
return result; return result;
@ -1447,7 +1447,7 @@ s8 sub_8199284(void)
return MENU_NOTHING_CHOSEN; return MENU_NOTHING_CHOSEN;
} }
s8 sub_8199334(void) s8 Menu_ProcessInputGridLayout(void)
{ {
u8 oldPos = gUnknown_0203CD90.cursorPos; u8 oldPos = gUnknown_0203CD90.cursorPos;

View File

@ -169,7 +169,7 @@ void CreateYesNoMenuWithCallbacks(u8 taskId, const struct WindowTemplate *templa
static void Task_CallYesOrNoCallback(u8 taskId) static void Task_CallYesOrNoCallback(u8 taskId)
{ {
switch (Menu_ProcessInputNoWrap_()) switch (Menu_ProcessInputNoWrapClearOnChoose())
{ {
case 0: case 0:
PlaySE(SE_SELECT); PlaySE(SE_SELECT);

View File

@ -352,9 +352,9 @@ static void PlayerPCProcessMenuInput(u8 taskId)
data = gTasks[taskId].data; data = gTasks[taskId].data;
if(gPcItemMenuOptionsNum > 3) if(gPcItemMenuOptionsNum > 3)
inputOptionId = ProcessMenuInput(); inputOptionId = Menu_ProcessInput();
else else
inputOptionId = Menu_ProcessInputNoWrapAround(); inputOptionId = Menu_ProcessInputNoWrap();
switch(inputOptionId) switch(inputOptionId)
{ {
@ -463,7 +463,7 @@ static void ItemStorageMenuProcessInput(u8 taskId)
s8 inputOptionId; s8 inputOptionId;
r5 = GetMenuCursorPos(); r5 = GetMenuCursorPos();
inputOptionId = ProcessMenuInput(); inputOptionId = Menu_ProcessInput();
r2 = GetMenuCursorPos(); r2 = GetMenuCursorPos();
switch(inputOptionId) switch(inputOptionId)
{ {
@ -762,13 +762,13 @@ static void Mailbox_MoveToBag(u8 taskId)
static void Mailbox_DrawYesNoBeforeMove(u8 taskId) static void Mailbox_DrawYesNoBeforeMove(u8 taskId)
{ {
sub_8197930(); DisplayYesNoMenu();
gTasks[taskId].func = Mailbox_MoveToBagYesNoPrompt; gTasks[taskId].func = Mailbox_MoveToBagYesNoPrompt;
} }
static void Mailbox_MoveToBagYesNoPrompt(u8 taskId) static void Mailbox_MoveToBagYesNoPrompt(u8 taskId)
{ {
switch(Menu_ProcessInputNoWrap_()) switch(Menu_ProcessInputNoWrapClearOnChoose())
{ {
case 0: case 0:
Mailbox_DoMailMoveToBag(taskId); Mailbox_DoMailMoveToBag(taskId);

View File

@ -1139,7 +1139,7 @@ static void Task_HandlePokeblockOptionsInput(u8 taskId)
if (sub_81221EC() == TRUE) if (sub_81221EC() == TRUE)
return; return;
itemId = Menu_ProcessInputNoWrapAround(); itemId = Menu_ProcessInputNoWrap();
if (itemId == MENU_NOTHING_CHOSEN) if (itemId == MENU_NOTHING_CHOSEN)
{ {
return; return;

View File

@ -270,7 +270,7 @@ void Task_PokemonStorageSystem(u8 taskId)
} }
break; break;
case 2: case 2:
task->data[2] = ProcessMenuInput(); task->data[2] = Menu_ProcessInput();
switch(task->data[2]) switch(task->data[2])
{ {
case -2: case -2:

View File

@ -1,10 +1,19 @@
#include "global.h" #include "global.h"
#include "main.h"
#include "event_data.h" #include "event_data.h"
#include "field_specials.h"
#include "item.h"
#include "menu.h" #include "menu.h"
#include "palette.h"
#include "script.h"
#include "script_menu.h" #include "script_menu.h"
#include "sound.h"
#include "string_util.h" #include "string_util.h"
#include "strings.h"
#include "task.h" #include "task.h"
#include "text.h" #include "text.h"
#include "constants/items.h"
#include "constants/songs.h"
struct MultichoiceListStruct struct MultichoiceListStruct
{ {
@ -12,14 +21,24 @@ struct MultichoiceListStruct
u8 count; 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; IWRAM_DATA u32 filler_0300112c;
/*static*/ void Task_HandleMultichoiceInput(u8); /*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 DrawMultichoiceMenu(u8, u8, u8, bool8, u8);
/*static*/ void sub_80E1FBC(u8, u8, u8, 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) 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 right;
u8 bottom; u8 bottom;
u8 windowId; u8 windowId;
int count = gUnknown_0858B760[multichoiceId].count; u8 count = gMultichoiceLists[multichoiceId].count;
const struct MenuAction *actions = gUnknown_0858B760[multichoiceId].list; const struct MenuAction *actions = gMultichoiceLists[multichoiceId].list;
const struct MenuAction *action;
int width = 0; int width = 0;
u8 newWidth; u8 newWidth;
i = count; // Must be a fakematch because come on, seriously
while (0 < i) 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); 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); schedule_bg_copy_tilemap_to_vram(0);
sub_80E1FBC(ignoreBPress, count, windowId, multichoiceId); 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);
}
}

View File

@ -997,7 +997,7 @@ void sub_80E9FB0(u8 taskId)
{ {
s8 input; s8 input;
input = Menu_ProcessInputNoWrapAround(); input = Menu_ProcessInputNoWrap();
switch (input) switch (input)
{ {
case -1: case -1:
@ -1031,7 +1031,7 @@ void sub_80E9FFC(u8 taskId)
void sub_80EA06C(u8 taskId) void sub_80EA06C(u8 taskId)
{ {
sub_8197930(); DisplayYesNoMenu();
sub_8121F68(taskId, &gUnknown_0858D058); sub_8121F68(taskId, &gUnknown_0858D058);
} }

View File

@ -325,7 +325,7 @@ static void SetShopItemsForSale(const u16 *items)
static void Task_ShopMenu(u8 taskId) static void Task_ShopMenu(u8 taskId)
{ {
s8 inputCode = Menu_ProcessInputNoWrapAround(); s8 inputCode = Menu_ProcessInputNoWrap();
switch (inputCode) switch (inputCode)
{ {
case LIST_B_PRESSED: case LIST_B_PRESSED:

View File

@ -1269,7 +1269,7 @@ void PlaySlotMachine(u8 arg0, MainCallback cb)
/*static */bool8 sub_8102344(struct Task *task) /*static */bool8 sub_8102344(struct Task *task)
{ {
s8 input = Menu_ProcessInputNoWrap_(); s8 input = Menu_ProcessInputNoWrapClearOnChoose();
if (input == 0) if (input == 0)
{ {
sub_8197434(0, TRUE); sub_8197434(0, TRUE);

View File

@ -977,14 +977,14 @@ static u8 SaveConfirmSaveCallback(void)
static u8 SaveYesNoCallback(void) static u8 SaveYesNoCallback(void)
{ {
sub_8197930(); // Show Yes/No menu DisplayYesNoMenu(); // Show Yes/No menu
sSaveDialogCallback = SaveConfirmInputCallback; sSaveDialogCallback = SaveConfirmInputCallback;
return SAVE_IN_PROGRESS; return SAVE_IN_PROGRESS;
} }
static u8 SaveConfirmInputCallback(void) static u8 SaveConfirmInputCallback(void)
{ {
switch (Menu_ProcessInputNoWrap_()) switch (Menu_ProcessInputNoWrapClearOnChoose())
{ {
case 0: // Yes case 0: // Yes
switch (gSaveFileStatus) switch (gSaveFileStatus)
@ -1037,14 +1037,14 @@ static u8 SaveConfirmOverwriteNoCallback(void)
static u8 SaveConfirmOverwriteCallback(void) static u8 SaveConfirmOverwriteCallback(void)
{ {
sub_8197930(); // Show Yes/No menu DisplayYesNoMenu(); // Show Yes/No menu
sSaveDialogCallback = SaveOverwriteInputCallback; sSaveDialogCallback = SaveOverwriteInputCallback;
return SAVE_IN_PROGRESS; return SAVE_IN_PROGRESS;
} }
static u8 SaveOverwriteInputCallback(void) static u8 SaveOverwriteInputCallback(void)
{ {
switch (Menu_ProcessInputNoWrap_()) switch (Menu_ProcessInputNoWrapClearOnChoose())
{ {
case 0: // Yes case 0: // Yes
sSaveDialogCallback = SaveSavingMessageCallback; sSaveDialogCallback = SaveSavingMessageCallback;
@ -1168,7 +1168,7 @@ static u8 BattlePyramidRetireYesNoCallback(void)
static u8 BattlePyramidRetireInputCallback(void) static u8 BattlePyramidRetireInputCallback(void)
{ {
switch (Menu_ProcessInputNoWrap_()) switch (Menu_ProcessInputNoWrapClearOnChoose())
{ {
case 0: // Yes case 0: // Yes
return SAVE_CANCELED; return SAVE_CANCELED;

View File

@ -534,7 +534,7 @@ static void Task_StarterChoose5(u8 taskId)
{ {
u8 spriteId; u8 spriteId;
switch (Menu_ProcessInputNoWrap_()) switch (Menu_ProcessInputNoWrapClearOnChoose())
{ {
case 0: // YES case 0: // YES
// Return the starter choice and exit. // Return the starter choice and exit.

View File

@ -109,7 +109,7 @@ void sub_8133BE4(u8 taskId, u8 decorationId)
void Task_HandleGetDecorationMenuInput(u8 taskId) void Task_HandleGetDecorationMenuInput(u8 taskId)
{ {
struct MauvilleOldManTrader *trader = &gSaveBlock1Ptr->oldMan.trader; struct MauvilleOldManTrader *trader = &gSaveBlock1Ptr->oldMan.trader;
s8 input = ProcessMenuInput(); s8 input = Menu_ProcessInput();
switch (input) switch (input)
{ {

View File

@ -792,7 +792,7 @@ static void Task_SetClock3(u8 taskId)
static void Task_SetClock4(u8 taskId) static void Task_SetClock4(u8 taskId)
{ {
switch (Menu_ProcessInputNoWrap_()) switch (Menu_ProcessInputNoWrapClearOnChoose())
{ {
case 0: case 0:
PlaySE(SE_SELECT); PlaySE(SE_SELECT);