pokeemerald/include/menu.h

93 lines
4.7 KiB
C
Raw Normal View History

2018-03-28 00:33:08 +02:00
2017-09-05 13:01:24 +02:00
#ifndef GUARD_MENU_H
#define GUARD_MENU_H
2018-02-07 07:07:42 +01:00
#include "task.h"
2017-11-19 22:48:46 +01:00
#include "text.h"
2017-09-29 00:11:42 +02:00
#include "window.h"
2017-09-05 13:01:24 +02:00
2017-12-16 15:10:29 +01:00
#define MENU_NOTHING_CHOSEN -2
#define MENU_B_PRESSED -1
2017-09-05 13:01:24 +02:00
struct MenuAction
{
const u8 *text;
Decoration + decoration_inventory (#89) * SetDecorationInventoriesPointers * ClearDecorationInventories * CheckHasDecoration * DecorationAdd * DecorationCheckSpace * DecorationRemove * sub_8161A38 * CountDecorations; Funcion renaming * Disassemble decoration data structs, tilemaps, and descriptions * sub_8126968 * sub_81269D4 * through sub_8126A88 * through sub_8126B2C * sub_8126B80 * sub_8126C08 * sub_8126C48 * sub_8126CA4 * sub_8126D10 * sub_8126E44 * sub_8126E8C * sub_8126F68 * sub_8127058 * sub_8127088 * sub_81270E8 * through sub_8127208 * through sub_8127268 * sub_8127284 * through sub_81272F8 * sub_8127330 * through sub_8127480 * sub_81274A0 * sub_8127500; makefile now tells scaninc to scan headers * Actual real fix to mapfile being in build/emerald instead of wd * through sub_812759C * through sub_812764C * through sub_8127744 * through sub_81277BC * sub_81277E8 * sub_8127814 * through sub_81279C4 * through sub_8127ACC * sub_8127B04 * sub_8127B54 * sub_8127B90 * sub_8127D38 * sub_8127E18 * sub_8127F68 * sub_8128060 * ConfigureCameraObjectForPlacingDecoration * SetUpPlacingDecorationPlayerAvatar * sub_812826C * through sub_8128414 * through sub_81284F4 * sub_812853C * sub_8128950 * through sub_8128AAC * through sub_8128BBC * c1_overworld_prev_quest * sub_8128C64 * sub_8128CD4 * sub_8128D10 * sub_8128DB4 * through sub_8128E18 * through sub_8129068 * sub_8129088 * through sub_81291E8 * sub_812925C * sub_81292D0 * sub_81292E8 * gpu_pal_decompress_alloc_tag_and_upload * AddDecorationIconObjectFromIconTable * GetDecorationIconPicOrPalette * AddDecorationIconObjectFromFieldObject * AddDecorationIconObject * through sub_8129708 * sub_81297F8 * sub_81298EC * SetUpPuttingAwayDecorationPlayerAvatar * sub_8129ABC * sub_8129B34 * sub_8129BCC * through sub_8129C74 * through sub_8129D8C * sub_8129E0C * sub_8129E74 * sub_8129F20 * sub_8129FC8 * sub_812A040 * nonmatching sub_812A0E8 * through sub_812A22C * sub_812A25C * sub_812A2C4 * through sub_812A39C * Remaining fns in decoration.s * Decompile decoration headers * Decompile all remaining decoration data that had already been disassembled * Disassemble two data objects * Suggest structure of list menu template * decompile through decoration list menu template * Disassemble decoration icon graphics table * Rip icon gfx * Decompile deco icon table * Decompile more data related to drawing decorations * Decompile gUnknown_085A7250 structs * Decompile two sprite templates * Decompile remaining data in decoration.s * Decompile decoration ewram * deco -> decor
2017-10-23 00:55:07 +02:00
union {
void (*void_u8)(u8);
u8 (*u8_void)(void);
} func;
2017-09-05 13:01:24 +02:00
};
2018-02-12 01:22:06 +01:00
extern const u16 gUnknown_0860F074[];
2018-02-07 07:07:42 +01:00
void sub_81971D0(void);
void sub_8197200(void);
2018-09-14 19:15:46 +02:00
u16 RunTextPrintersAndIsPrinter0Active(void);
2018-02-07 07:07:42 +01:00
void sub_81973A4(void);
void NewMenuHelpers_DrawDialogueFrame(u8, u8);
void sub_819746C(u8 windowId, bool8 copyToVram);
void NewMenuHelpers_DrawStdWindowFrame(u8, u8);
u16 AddTextPrinterParameterized2(u8 windowId, u8 fontId, const u8 *str, u8 speed, void (*callback)(struct TextSubPrinter *, u16), u8 fgColor, u8 bgColor, u8 shadowColor);
2018-03-28 00:33:08 +02:00
void PrintPlayerNameOnWindow(u8, const u8*, u16, u16);
2018-02-07 07:07:42 +01:00
void DisplayItemMessageOnField(u8 taskId, const u8 *src, TaskFunc callback);
2018-03-28 00:33:08 +02:00
void sub_8197434(u8 windowId, bool8 copyToVram);
2018-02-07 07:07:42 +01:00
void SetStandardWindowBorderStyle(u8 a0, u8 a1);
void sub_8197930(void);
u8 GetPlayerTextSpeed(void);
void sub_81978B0(u16 arg0);
2018-02-11 23:19:36 +01:00
void AddTextPrinterWithCallbackForMessage(bool8 a1, void (*callback)(struct TextSubPrinter *, u16));
2018-09-03 22:55:55 +02:00
void AddTextPrinterParameterized3(u8 windowId, u8 fontId, u8 left, u8 top, const u8 *color, s8 speed, const u8 *str);
2017-09-29 00:11:42 +02:00
void sub_8198070(u8 windowId, bool8 copyToVram);
void SetWindowTemplateFields(struct WindowTemplate* template, u8 priority, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 palNum, u16 baseBlock);
void SetWindowBorderStyle(u8 windowId, bool8 copyToVram, u16 tileStart, u8 palette);
Decoration + decoration_inventory (#89) * SetDecorationInventoriesPointers * ClearDecorationInventories * CheckHasDecoration * DecorationAdd * DecorationCheckSpace * DecorationRemove * sub_8161A38 * CountDecorations; Funcion renaming * Disassemble decoration data structs, tilemaps, and descriptions * sub_8126968 * sub_81269D4 * through sub_8126A88 * through sub_8126B2C * sub_8126B80 * sub_8126C08 * sub_8126C48 * sub_8126CA4 * sub_8126D10 * sub_8126E44 * sub_8126E8C * sub_8126F68 * sub_8127058 * sub_8127088 * sub_81270E8 * through sub_8127208 * through sub_8127268 * sub_8127284 * through sub_81272F8 * sub_8127330 * through sub_8127480 * sub_81274A0 * sub_8127500; makefile now tells scaninc to scan headers * Actual real fix to mapfile being in build/emerald instead of wd * through sub_812759C * through sub_812764C * through sub_8127744 * through sub_81277BC * sub_81277E8 * sub_8127814 * through sub_81279C4 * through sub_8127ACC * sub_8127B04 * sub_8127B54 * sub_8127B90 * sub_8127D38 * sub_8127E18 * sub_8127F68 * sub_8128060 * ConfigureCameraObjectForPlacingDecoration * SetUpPlacingDecorationPlayerAvatar * sub_812826C * through sub_8128414 * through sub_81284F4 * sub_812853C * sub_8128950 * through sub_8128AAC * through sub_8128BBC * c1_overworld_prev_quest * sub_8128C64 * sub_8128CD4 * sub_8128D10 * sub_8128DB4 * through sub_8128E18 * through sub_8129068 * sub_8129088 * through sub_81291E8 * sub_812925C * sub_81292D0 * sub_81292E8 * gpu_pal_decompress_alloc_tag_and_upload * AddDecorationIconObjectFromIconTable * GetDecorationIconPicOrPalette * AddDecorationIconObjectFromFieldObject * AddDecorationIconObject * through sub_8129708 * sub_81297F8 * sub_81298EC * SetUpPuttingAwayDecorationPlayerAvatar * sub_8129ABC * sub_8129B34 * sub_8129BCC * through sub_8129C74 * through sub_8129D8C * sub_8129E0C * sub_8129E74 * sub_8129F20 * sub_8129FC8 * sub_812A040 * nonmatching sub_812A0E8 * through sub_812A22C * sub_812A25C * sub_812A2C4 * through sub_812A39C * Remaining fns in decoration.s * Decompile decoration headers * Decompile all remaining decoration data that had already been disassembled * Disassemble two data objects * Suggest structure of list menu template * decompile through decoration list menu template * Disassemble decoration icon graphics table * Rip icon gfx * Decompile deco icon table * Decompile more data related to drawing decorations * Decompile gUnknown_085A7250 structs * Decompile two sprite templates * Decompile remaining data in decoration.s * Decompile decoration ewram * deco -> decor
2017-10-23 00:55:07 +02:00
void schedule_bg_copy_tilemap_to_vram(u8 bgNum);
2018-01-28 00:46:32 +01:00
void PrintMenuTable(u8 windowId, u8 itemCount, const struct MenuAction *strs);
u8 InitMenuInUpperLeftCornerPlaySoundWhenAPressed(u8 windowId, u8 numItems, u8 initialCursorPos);
Decoration + decoration_inventory (#89) * SetDecorationInventoriesPointers * ClearDecorationInventories * CheckHasDecoration * DecorationAdd * DecorationCheckSpace * DecorationRemove * sub_8161A38 * CountDecorations; Funcion renaming * Disassemble decoration data structs, tilemaps, and descriptions * sub_8126968 * sub_81269D4 * through sub_8126A88 * through sub_8126B2C * sub_8126B80 * sub_8126C08 * sub_8126C48 * sub_8126CA4 * sub_8126D10 * sub_8126E44 * sub_8126E8C * sub_8126F68 * sub_8127058 * sub_8127088 * sub_81270E8 * through sub_8127208 * through sub_8127268 * sub_8127284 * through sub_81272F8 * sub_8127330 * through sub_8127480 * sub_81274A0 * sub_8127500; makefile now tells scaninc to scan headers * Actual real fix to mapfile being in build/emerald instead of wd * through sub_812759C * through sub_812764C * through sub_8127744 * through sub_81277BC * sub_81277E8 * sub_8127814 * through sub_81279C4 * through sub_8127ACC * sub_8127B04 * sub_8127B54 * sub_8127B90 * sub_8127D38 * sub_8127E18 * sub_8127F68 * sub_8128060 * ConfigureCameraObjectForPlacingDecoration * SetUpPlacingDecorationPlayerAvatar * sub_812826C * through sub_8128414 * through sub_81284F4 * sub_812853C * sub_8128950 * through sub_8128AAC * through sub_8128BBC * c1_overworld_prev_quest * sub_8128C64 * sub_8128CD4 * sub_8128D10 * sub_8128DB4 * through sub_8128E18 * through sub_8129068 * sub_8129088 * through sub_81291E8 * sub_812925C * sub_81292D0 * sub_81292E8 * gpu_pal_decompress_alloc_tag_and_upload * AddDecorationIconObjectFromIconTable * GetDecorationIconPicOrPalette * AddDecorationIconObjectFromFieldObject * AddDecorationIconObject * through sub_8129708 * sub_81297F8 * sub_81298EC * SetUpPuttingAwayDecorationPlayerAvatar * sub_8129ABC * sub_8129B34 * sub_8129BCC * through sub_8129C74 * through sub_8129D8C * sub_8129E0C * sub_8129E74 * sub_8129F20 * sub_8129FC8 * sub_812A040 * nonmatching sub_812A0E8 * through sub_812A22C * sub_812A25C * sub_812A2C4 * through sub_812A39C * Remaining fns in decoration.s * Decompile decoration headers * Decompile all remaining decoration data that had already been disassembled * Disassemble two data objects * Suggest structure of list menu template * decompile through decoration list menu template * Disassemble decoration icon graphics table * Rip icon gfx * Decompile deco icon table * Decompile more data related to drawing decorations * Decompile gUnknown_085A7250 structs * Decompile two sprite templates * Decompile remaining data in decoration.s * Decompile decoration ewram * deco -> decor
2017-10-23 00:55:07 +02:00
u8 GetMenuCursorPos(void);
s8 ProcessMenuInput(void);
2018-08-12 21:54:07 +02:00
s8 Menu_ProcessInputNoWrapAround(void);
Decoration + decoration_inventory (#89) * SetDecorationInventoriesPointers * ClearDecorationInventories * CheckHasDecoration * DecorationAdd * DecorationCheckSpace * DecorationRemove * sub_8161A38 * CountDecorations; Funcion renaming * Disassemble decoration data structs, tilemaps, and descriptions * sub_8126968 * sub_81269D4 * through sub_8126A88 * through sub_8126B2C * sub_8126B80 * sub_8126C08 * sub_8126C48 * sub_8126CA4 * sub_8126D10 * sub_8126E44 * sub_8126E8C * sub_8126F68 * sub_8127058 * sub_8127088 * sub_81270E8 * through sub_8127208 * through sub_8127268 * sub_8127284 * through sub_81272F8 * sub_8127330 * through sub_8127480 * sub_81274A0 * sub_8127500; makefile now tells scaninc to scan headers * Actual real fix to mapfile being in build/emerald instead of wd * through sub_812759C * through sub_812764C * through sub_8127744 * through sub_81277BC * sub_81277E8 * sub_8127814 * through sub_81279C4 * through sub_8127ACC * sub_8127B04 * sub_8127B54 * sub_8127B90 * sub_8127D38 * sub_8127E18 * sub_8127F68 * sub_8128060 * ConfigureCameraObjectForPlacingDecoration * SetUpPlacingDecorationPlayerAvatar * sub_812826C * through sub_8128414 * through sub_81284F4 * sub_812853C * sub_8128950 * through sub_8128AAC * through sub_8128BBC * c1_overworld_prev_quest * sub_8128C64 * sub_8128CD4 * sub_8128D10 * sub_8128DB4 * through sub_8128E18 * through sub_8129068 * sub_8129088 * through sub_81291E8 * sub_812925C * sub_81292D0 * sub_81292E8 * gpu_pal_decompress_alloc_tag_and_upload * AddDecorationIconObjectFromIconTable * GetDecorationIconPicOrPalette * AddDecorationIconObjectFromFieldObject * AddDecorationIconObject * through sub_8129708 * sub_81297F8 * sub_81298EC * SetUpPuttingAwayDecorationPlayerAvatar * sub_8129ABC * sub_8129B34 * sub_8129BCC * through sub_8129C74 * through sub_8129D8C * sub_8129E0C * sub_8129E74 * sub_8129F20 * sub_8129FC8 * sub_812A040 * nonmatching sub_812A0E8 * through sub_812A22C * sub_812A25C * sub_812A2C4 * through sub_812A39C * Remaining fns in decoration.s * Decompile decoration headers * Decompile all remaining decoration data that had already been disassembled * Disassemble two data objects * Suggest structure of list menu template * decompile through decoration list menu template * Disassemble decoration icon graphics table * Rip icon gfx * Decompile deco icon table * Decompile more data related to drawing decorations * Decompile gUnknown_085A7250 structs * Decompile two sprite templates * Decompile remaining data in decoration.s * Decompile decoration ewram * deco -> decor
2017-10-23 00:55:07 +02:00
void blit_move_info_icon(u8 winId, u8 a2, u16 x, u16 y);
2017-10-13 04:59:01 +02:00
void reset_temp_tile_data_buffers(void);
2018-01-30 00:26:36 +01:00
void *decompress_and_copy_tile_data_to_vram(u8 bgId, const void *src, int size, u16 offset, u8 mode);
2017-10-13 04:59:01 +02:00
bool8 free_temp_tile_data_buffers_if_possible(void);
2018-10-13 23:23:33 +02:00
struct WindowTemplate CreateWindowTemplate(u8 bg, u8 left, u8 top, u8 width, u8 height, u8 paletteNum, u16 baseBlock);
2017-10-22 05:23:03 +02:00
void CreateYesNoMenu(const struct WindowTemplate *windowTemplate, u16 borderFirstTileNum, u8 borderPalette, u8 initialCursorPos);
2018-08-18 00:54:18 +02:00
void DecompressAndLoadBgGfxUsingHeap(u8 bgId, const void *src, int size, u16 offset, u8 mode);
2018-08-12 21:54:07 +02:00
s8 Menu_ProcessInputNoWrap_(void);
2018-03-12 09:26:20 +01:00
s8 ProcessMenuInput_other(void);
2017-10-29 15:38:25 +01:00
void do_scheduled_bg_tilemap_copies_to_vram(void);
void clear_scheduled_bg_copies_to_vram(void);
void AddTextPrinterParameterized4(u8 windowId, u8 fontId, u8 x, u8 y, u8 letterSpacing, u8 lineSpacing, const u8 *color, s8 speed, const u8 *str);
2018-01-27 06:41:52 +01:00
void sub_8197B1C(u8 windowId, bool8 copyToVram, u16 a2, u8 a3);
2017-12-16 15:10:29 +01:00
void sub_81995E4(u8 windowId, u8 optionsNo, const struct MenuAction *actions, const u8 *actionIds);
void sub_8197DF8(u8 windowId, bool8 copyToVram);
2018-01-27 06:41:52 +01:00
u16 sub_8198AA4(u8, u8, u8, u8, u8, u8, u16);
2018-01-30 00:26:36 +01:00
void *malloc_and_decompress(const void *src, int *sizeOut);
u16 copy_decompressed_tile_data_to_vram(u8 bgId, const void *src, u16 size, u16 offset, u8 mode);
void AddTextPrinterForMessage(bool8 allowSkippingDelayWithButtonPress);
2018-08-30 15:01:07 +02:00
void AddItemMenuActionTextPrinters(u8 windowId, u8 fontId, u8 left, u8 top, u8 letterSpacing, u8 lineHeight, u8 itemCount, const struct MenuAction *strs, const u8 *a8);
void sub_8198DBC(u8 windowId, u8 fontId, u8 left, u8 top, u8 a4, u8 itemCount, u8 itemCount2, const struct MenuAction *strs, const u8 *a8);
u8 sub_8199944(u8 windowId, u8 optionWidth, u8 horizontalCount, u8 verticalCount, u8 initialCursorPos);
2018-02-09 03:00:28 +01:00
u8 sub_8199134(s8, s8);
2018-03-28 00:33:08 +02:00
u8 GetStartMenuWindowId(void);
2018-02-09 03:00:28 +01:00
void sub_819A2BC(u8, u8);
2018-03-28 00:33:08 +02:00
u8 MoveMenuCursor(s8 cursorDelta);
void NewMenuHelpers_DrawStdWindowFrame(u8 windowId, bool8 CopyToVram);
u8 sub_81979C4(u8 a1);
u8 sub_81983AC(u8 windowId, u8 fontId, u8 left, u8 top, u8 cursorHeight, u8 numChoices, u8 initialCursorPos);
void sub_819786C(u8 windowId, bool8 copyToVram);
void AddTextPrinterForMessage_2(bool8 allowSkippingDelayWithButtonPress);
2018-03-29 02:16:02 +02:00
void RemoveStartMenuWindow(void);
2018-03-28 00:33:08 +02:00
void sub_8197948(u8 initialCursorPos);
void sub_819A344(u8 a0, u8 *dest, u8 color);
2018-04-09 09:22:28 +02:00
void RemoveMapNamePopUpWindow(void);
u8 GetMapNamePopUpWindowId(void);
u8 AddMapNamePopUpWindow(void);
void AddTextPrinterParameterized5(u8 windowId, u8 fontId, const u8 *str, u8 left, u8 top, u8 speed, void (*callback)(struct TextSubPrinter *, u16), u8 letterSpacing, u8 lineSpacing);
2018-08-15 06:56:11 +02:00
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);
2018-10-13 19:41:10 +02:00
void sub_8197AE8(bool8 copyToVram);
2017-09-18 17:26:45 +02:00
2017-09-05 13:01:24 +02:00
#endif // GUARD_MENU_H