Skip to content

Commit

Permalink
Identify extern functions in menu.h
Browse files Browse the repository at this point in the history
  • Loading branch information
lhearachel committed Oct 26, 2024
1 parent aed4502 commit 03f85a6
Show file tree
Hide file tree
Showing 66 changed files with 490 additions and 494 deletions.
32 changes: 17 additions & 15 deletions include/menu.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#include "colored_arrow.h"
#include "string_list.h"

#define MENU_DUMMY -3

typedef struct MenuTemplate {
const StringList *choices;
Window *window;
Expand All @@ -31,20 +33,20 @@ typedef struct Menu {
u8 heapID;
} Menu;

Menu *sub_02001AF4(const MenuTemplate *param0, u8 param1, u8 param2, u8 param3, u8 param4, u32 param5);
Menu *sub_02001B7C(const MenuTemplate *param0, u8 param1, u8 param2, u8 param3, u8 param4, u32 param5);
Menu *sub_02001B9C(const MenuTemplate *param0, u8 param1, u8 param2);
void sub_02001BC4(Menu *param0, u8 *param1);
u32 sub_02001BE0(Menu *param0);
u32 sub_02001C94(Menu *param0, u16 param1);
u32 sub_02001D44(Menu *param0, u8 param1);
u8 sub_02001DC4(Menu *param0);
u8 sub_02001DC8(Menu *param0);
Menu *sub_02002054(BgConfig *param0, const WindowTemplate *param1, u16 param2, u8 param3, u8 param4, u32 param5);
Menu *sub_02002100(BgConfig *param0, const WindowTemplate *param1, u16 param2, u8 param3, u32 param4);
u32 sub_02002114(Menu *param0, u32 param1);
u32 sub_02002134(Menu *param0, u8 param1, u32 param2);
void sub_02002154(Menu *param0, u32 param1);
void sub_02002180(Window *param0, u32 param1, u32 param2);
Menu *Menu_New(const MenuTemplate *param0, u8 param1, u8 param2, u8 param3, u8 param4, u32 param5);
Menu *Menu_NewAndCopyToVRAM(const MenuTemplate *param0, u8 param1, u8 param2, u8 param3, u8 param4, u32 param5);
Menu *Menu_NewSimple(const MenuTemplate *param0, u8 param1, u8 param2);
void Menu_Free(Menu *param0, u8 *param1);
u32 Menu_ProcessInput(Menu *param0);
u32 Menu_ProcessInputWithSound(Menu *param0, u16 param1);
u32 Menu_ProcessExternalInput(Menu *param0, u8 param1);
u8 Menu_GetCursorPos(Menu *param0);
u8 Menu_GetLastAction(Menu *param0);
Menu *Menu_MakeYesNoChoiceWithCursorAt(BgConfig *param0, const WindowTemplate *param1, u16 param2, u8 param3, u8 param4, u32 param5);
Menu *Menu_MakeYesNoChoice(BgConfig *param0, const WindowTemplate *param1, u16 param2, u8 param3, u32 param4);
u32 Menu_ProcessInputAndHandleExit(Menu *param0, u32 param1);
u32 Menu_ProcessExternalInputAndHandleExit(Menu *param0, u8 param1, u32 param2);
void Menu_DestroyForExit(Menu *param0, u32 param1);
void Menu_DrawCursorBitmap(Window *param0, u32 param1, u32 param2);

#endif // POKEPLATINUM_MENU_H
4 changes: 2 additions & 2 deletions src/choose_starter/choose_starter_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -1253,12 +1253,12 @@ static void ov78_021D1E44(ChooseStarterApp *param0, int param1)
break;
case 2:
ov78_021D1FB4(param0->messageWindow, param1, 360, 1 + param0->cursorPosition, TEXT_COLOR(1, 2, 15), TEXT_SPEED_NO_TRANSFER);
param0->unk_B8 = sub_02002100(param0->bgl, &param0->unk_B0, (512 + (18 + 12) + 128), 1, param1);
param0->unk_B8 = Menu_MakeYesNoChoice(param0->bgl, &param0->unk_B0, (512 + (18 + 12) + 128), 1, param1);
param0->unk_08 = 0;
param0->unk_04++;
break;
case 3:
v0 = sub_02002114(param0->unk_B8, param1);
v0 = Menu_ProcessInputAndHandleExit(param0->unk_B8, param1);

switch (v0) {
case 0xffffffff:
Expand Down
4 changes: 2 additions & 2 deletions src/field_map_change.c
Original file line number Diff line number Diff line change
Expand Up @@ -1152,12 +1152,12 @@ BOOL FieldTask_MapChangeToUnderground(TaskManager *taskMan)
if (FieldMessage_FinishedPrinting(mapChangeUndergroundData->unk_38) == 1) {
Strbuf_Free(mapChangeUndergroundData->unk_34);
sub_0200DAA4(fieldSystem->unk_08, 3, 1024 - (18 + 12) - 9, 11, 0, 11);
mapChangeUndergroundData->unk_3C = sub_02002100(fieldSystem->unk_08, &Unk_020EC3A0, 1024 - (18 + 12) - 9, 11, 11);
mapChangeUndergroundData->unk_3C = Menu_MakeYesNoChoice(fieldSystem->unk_08, &Unk_020EC3A0, 1024 - (18 + 12) - 9, 11, 11);
mapChangeUndergroundData->state = 2;
}
break;
case 2:
switch (sub_02002114(mapChangeUndergroundData->unk_3C, 11)) {
switch (Menu_ProcessInputAndHandleExit(mapChangeUndergroundData->unk_3C, 11)) {
case 0:
sub_0200E084(&mapChangeUndergroundData->unk_24, 0);
Window_Remove(&mapChangeUndergroundData->unk_24);
Expand Down
10 changes: 5 additions & 5 deletions src/field_menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ static void sub_0203ADFC(TaskManager *taskMan)
v3.loopAround = FALSE;
}

menu->unk_20 = sub_02001AF4(&v3, 28, 4, menu->unk_28, 11, PAD_BUTTON_B | PAD_BUTTON_X);
menu->unk_20 = Menu_New(&v3, 28, 4, menu->unk_28, 11, PAD_BUTTON_B | PAD_BUTTON_X);

Window_ScheduleCopyToVRAM(&menu->unk_00);
sub_0203B318(menu, menu->unk_30, v5, TrainerInfo_Gender(SaveData_GetTrainerInfo(fieldSystem->saveData)));
Expand Down Expand Up @@ -641,7 +641,7 @@ static u32 FieldMenu_MakeList(FieldMenu *menu, u8 *ret)
static void FieldMenu_Close(FieldMenu *menu)
{
sub_0203B4E8(menu);
sub_02001BC4(menu->unk_20, NULL);
Menu_Free(menu->unk_20, NULL);
StringList_Free(menu->unk_24);

menu->unk_20 = NULL;
Expand Down Expand Up @@ -732,10 +732,10 @@ static BOOL FieldMenu_Select(TaskManager *taskMan)

fieldSystem = TaskManager_FieldSystem(taskMan);
menu = TaskManager_Environment(taskMan);
v2 = sub_02001DC4(menu->unk_20);
v2 = Menu_GetCursorPos(menu->unk_20);

menu->unk_2C = sub_02001C94(menu->unk_20, 1504);
menu->unk_28 = sub_02001DC4(menu->unk_20);
menu->unk_2C = Menu_ProcessInputWithSound(menu->unk_20, 1504);
menu->unk_28 = Menu_GetCursorPos(menu->unk_20);

if (v2 != menu->unk_28) {
sub_0203B558(menu->unk_200[0]->unk_00, menu->unk_28);
Expand Down
Loading

0 comments on commit 03f85a6

Please sign in to comment.