diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/battle_frontier_1.h | 7 | ||||
| -rw-r--r-- | include/dma3.h | 2 | ||||
| -rw-r--r-- | include/gba/defines.h | 3 | ||||
| -rw-r--r-- | include/global.h | 2 | ||||
| -rw-r--r-- | include/graphics.h | 6 | ||||
| -rw-r--r-- | include/menu.h | 34 | ||||
| -rw-r--r-- | include/menu_helpers.h | 4 | ||||
| -rw-r--r-- | include/new_menu_helpers.h | 25 | ||||
| -rw-r--r-- | include/region_map.h | 1 | ||||
| -rw-r--r-- | include/strings.h | 3 | ||||
| -rw-r--r-- | include/text.h | 22 | ||||
| -rw-r--r-- | include/window.h | 2 | 
12 files changed, 60 insertions, 51 deletions
| diff --git a/include/battle_frontier_1.h b/include/battle_frontier_1.h new file mode 100644 index 000000000..5483b28ef --- /dev/null +++ b/include/battle_frontier_1.h @@ -0,0 +1,7 @@ +#ifndef GUARD_BATTLE_FRONTIER_1_H +#define GUARD_BATTLE_FRONTIER_1_H + +bool32 sub_8196094(void); +void sub_8196080(const u8 *str); + +#endif // GUARD_BATTLE_FRONTIER_1_H diff --git a/include/dma3.h b/include/dma3.h index d58e41850..19a69ea80 100644 --- a/include/dma3.h +++ b/include/dma3.h @@ -5,6 +5,6 @@ void ClearDma3Requests(void);  void ProcessDma3Requests(void);  s16 RequestDma3Copy(const void *src, void *dest, u16 size, u8 mode);  s16 RequestDma3Fill(s32 value, void *dest, u16 size, u8 mode); -int CheckForSpaceForDma3Request(s16 index); +s16 CheckForSpaceForDma3Request(s16 index);  #endif // GUARD_DMA3_H diff --git a/include/gba/defines.h b/include/gba/defines.h index 5c07347ce..1eed6303d 100644 --- a/include/gba/defines.h +++ b/include/gba/defines.h @@ -39,6 +39,9 @@  #define BG_CHAR_ADDR(n)   (BG_VRAM + (BG_CHAR_SIZE * (n)))  #define BG_SCREEN_ADDR(n) (BG_VRAM + (BG_SCREEN_SIZE * (n))) +#define BG_TILE_H_FLIP(n) (0x400 + (n)) +#define BG_TILE_V_FLIP(n) (0x800 + (n)) +  // text-mode BG  #define OBJ_VRAM0      (VRAM + 0x10000)  #define OBJ_VRAM0_SIZE 0x8000 diff --git a/include/global.h b/include/global.h index c575d40cd..0e5615eb0 100644 --- a/include/global.h +++ b/include/global.h @@ -24,7 +24,7 @@  #define INCBIN_S32 {0}  #endif // __APPLE__ -#define ARRAY_COUNT(array) (sizeof(array) / sizeof((array)[0])) +#define ARRAY_COUNT(array) (size_t)(sizeof(array) / sizeof((array)[0]))  // useful math macros diff --git a/include/graphics.h b/include/graphics.h index 0635ef5cc..39662c8c1 100644 --- a/include/graphics.h +++ b/include/graphics.h @@ -2713,4 +2713,10 @@ extern const u8 gRaySceneHushBg_Pal[];  extern const u8 gRaySceneHushBg_Gfx[];  extern const u8 gRaySceneHushRing_Gfx[]; +//menu graphics +extern const u16 gFireRedMenuElements1_Pal[16]; +extern const u16 gFireRedMenuElements2_Pal[16]; +extern const u16 gFireRedMenuElements3_Pal[16]; +extern const u8 gFireRedMenuElements_Gfx[]; +  #endif //GUARD_GRAPHICS_H diff --git a/include/menu.h b/include/menu.h index e5f705cae..2046f7d2b 100644 --- a/include/menu.h +++ b/include/menu.h @@ -1,6 +1,7 @@  #ifndef GUARD_MENU_H  #define GUARD_MENU_H +#include "task.h"  #include "text.h"  #include "window.h" @@ -16,28 +17,47 @@ struct MenuAction      } func;  }; -void box_print(u8, u8, u8, u8, const void *, s8, const u8 *); +void sub_81971D0(void); +void sub_8197200(void); +u16 sub_8197224(void); +void sub_81973A4(void); +void NewMenuHelpers_DrawDialogueFrame(u8, u8); +void sub_819746C(u8 windowId, bool8 copyToVram); +void NewMenuHelpers_DrawStdWindowFrame(u8, u8); +u16 AddTextPrinterParameterized(u8 windowId, u8 fontId, const u8 *str, u8 speed, void (*callback)(struct TextSubPrinter *, u16), u8 fgColor, u8 bgColor, u8 shadowColor); +void DisplayItemMessageOnField(u8 taskId, const u8 *src, TaskFunc callback); +void sub_8197434(u8 a0, u8 a1); +void SetStandardWindowBorderStyle(u8 a0, u8 a1); +void sub_8197930(void); +u8 GetPlayerTextSpeed(void); +void sub_81978B0(u16 arg0); + +void box_print(u8 windowId, u8 fontId, u8 left, u8 top, const u8 *color, s8 speed, const u8 *str);  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);  void schedule_bg_copy_tilemap_to_vram(u8 bgNum); -void PrintMenuTable(u8 idx, u8 nstrs, const struct MenuAction *strs); -void InitMenuInUpperLeftCornerPlaySoundWhenAPressed(u8 idx, u8 nstrs,u8); +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 ProcessMenuInputNoWrapAround(void);  void blit_move_info_icon(u8 winId, u8 a2, u16 x, u16 y);  void reset_temp_tile_data_buffers(void); -int decompress_and_copy_tile_data_to_vram(u8 bg_id, 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);  bool8 free_temp_tile_data_buffers_if_possible(void); -u64 sub_8198A50(struct WindowTemplate*, u8, u8, u8, u8, u8, u8, u16); // returns something but it isn't used, fix when menu.s is decomp'd +struct WindowTemplate sub_8198A50(u8, u8, u8, u8, u8, u8, u16);  void CreateYesNoMenu(const struct WindowTemplate *windowTemplate, u16 borderFirstTileNum, u8 borderPalette, u8 initialCursorPos);  s8 ProcessMenuInputNoWrap_(void);  void do_scheduled_bg_tilemap_copies_to_vram(void);  void clear_scheduled_bg_copies_to_vram(void); -void AddTextPrinterParameterized2(u8 windowId, u8 fontId, u8 x, u8 y, u8 letterSpacing, u8 lineSpacing, const struct TextColor *color, s8 speed, const u8 *str); -void sub_8197B1C(u8 windowId, bool8 copyToVram, u16 a2, u16 a3); +void AddTextPrinterParameterized2(u8 windowId, u8 fontId, u8 x, u8 y, u8 letterSpacing, u8 lineSpacing, const u8 *color, s8 speed, const u8 *str); +void sub_8197B1C(u8 windowId, bool8 copyToVram, u16 a2, u8 a3);  void sub_81995E4(u8 windowId, u8 optionsNo, const struct MenuAction *actions, const u8 *actionIds);  void sub_8197DF8(u8 windowId, bool8 copyToVram); +u16 sub_8198AA4(u8, u8, u8, u8, u8, u8, u16); +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);  #endif // GUARD_MENU_H diff --git a/include/menu_helpers.h b/include/menu_helpers.h index a91c89645..048a4aa43 100644 --- a/include/menu_helpers.h +++ b/include/menu_helpers.h @@ -1,6 +1,8 @@  #ifndef GUARD_MENU_HELPERS_H  #define GUARD_MENU_HELPERS_H +#include "task.h" +  // Exported type declarations  struct YesNoFuncTable @@ -28,5 +30,7 @@ void sub_81223FC(u8 *a0, u8 count, u8 a2);  void sub_8122448(u8 *a0, u8 count, u16 x, u16 y);  void DisplayMessageAndContinueTask(u8 taskId, u8 arg1, u16 arg2, u8 arg3, u8 arg4, u8 textSpeed, const u8 *string, void *taskFunc);  void CreateYesNoMenuWithCallbacks(u8 taskId, const struct WindowTemplate *template, u8 arg2, u8 arg3, u8 arg4, u16 tileStart, u8 palette, const struct YesNoFuncTable *yesNo); +u8 GetLRKeysState(void); +u8 sub_812210C(void);  #endif //GUARD_MENU_HELPERS_H diff --git a/include/new_menu_helpers.h b/include/new_menu_helpers.h deleted file mode 100644 index bcbb1147d..000000000 --- a/include/new_menu_helpers.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef GUARD_NEW_MENU_HELPERS_H -#define GUARD_NEW_MENU_HELPERS_H - -#include "text.h" -#include "task.h" - -void sub_81971D0(void); -void sub_8197200(void); -void sub_81973A4(void); -void sub_81973C4(u8, u8); -void sub_819746C(u8 windowId, bool8 copyToVram); -void sub_81973FC(u8, u8); -u16 AddTextPrinterParameterized(u8 windowId, u8 fontId, const u8 *str, u8 speed, void ( *callback)(u16, struct TextPrinter *), u8 fgColor, u8 bgColor, u8 shadowColor); -void DisplayItemMessageOnField(u8 taskId, const u8 *src, TaskFunc callback); -void sub_8197434(u8 a0, u8 a1); -void SetStandardWindowBorderStyle(u8 a0, u8 a1); -void sub_8197930(void); -u8 GetPlayerTextSpeed(void); -void sub_81978B0(u16 arg0); -u16 sub_8197224(void); -int sub_8196094(void); -void sub_8196080(u8*); -void AddTextPrinterForMessage(u8); - -#endif // GUARD_NEW_MENU_HELPERS_H diff --git a/include/region_map.h b/include/region_map.h index e8cc80f82..af331ad81 100644 --- a/include/region_map.h +++ b/include/region_map.h @@ -93,5 +93,6 @@ void CreateRegionMapPlayerIcon(u16 x, u16 y);  void CreateRegionMapCursor(u16 tileTag, u16 paletteTag);  u8 *GetMapName(u8 *, u16, u16);  bool32 sub_8124668(u8 mapSecId); +u8 *sub_81245DC(u8 *dest, u16 mapSecId);  #endif //GUARD_REGION_MAP_H diff --git a/include/strings.h b/include/strings.h index a8ea7ee46..6d569e57a 100644 --- a/include/strings.h +++ b/include/strings.h @@ -215,6 +215,9 @@ extern const u8 gText_ButtonMode[];  extern const u8 gText_MaleSymbol[];  extern const u8 gText_FemaleSymbol[]; +extern const u8 gText_SelectorArrow3[]; +extern const u8 gText_YesNo[]; +  // mystery event menu text  extern const u8 gText_EventSafelyLoaded[];  extern const u8 gText_LoadErrorEndingSession[]; diff --git a/include/text.h b/include/text.h index b5fc5b58a..e073c3762 100644 --- a/include/text.h +++ b/include/text.h @@ -75,6 +75,10 @@  #define CHAR_NEWLINE        0xFE  #define EOS                 0xFF // end of string +#define EXT_CTRL_CODE_COLOR     0x1 +#define EXT_CTRL_CODE_HIGHLIGHT 0x2 +#define EXT_CTRL_CODE_SHADOW    0x3 +  #define TEXT_COLOR_TRANSPARENT  0x0  #define TEXT_COLOR_WHITE        0x1  #define TEXT_COLOR_DARK_GREY    0x2 @@ -116,7 +120,7 @@ struct TextSubPrinter // TODO: Better name      u8 letterSpacing;      u8 lineSpacing;      u8 fontColor_l:4;   // 0xC -    u8 fontColor_h:4; +    u8 fgColor:4;      u8 bgColor:4;      u8 shadowColor:4;  }; @@ -149,7 +153,7 @@ struct FontInfo      u8 letterSpacing;      u8 lineSpacing;      u8 fontColor_l:4; -    u8 fontColor_h:4; +    u8 fgColor:4;      u8 bgColor:4;      u8 shadowColor:4;  }; @@ -178,20 +182,6 @@ typedef struct {  extern TextFlags gTextFlags; -struct __attribute__((packed)) TextColor -{ -    u8 fgColor; -    u8 bgColor; -    u8 shadowColor; -}; - -struct AlignedTextColor // because sometimes it's necessary -{ -    u8 fgColor; -    u8 bgColor; -    u8 shadowColor; -}; -  extern u8 gStringVar1[];  extern u8 gStringVar2[];  extern u8 gStringVar3[]; diff --git a/include/window.h b/include/window.h index b630cd316..07c642a09 100644 --- a/include/window.h +++ b/include/window.h @@ -52,7 +52,7 @@ void PutWindowTilemap(u8 windowId);  void PutWindowRectTilemapOverridePalette(u8 windowId, u8 x, u8 y, u8 width, u8 height, u8 palette);  void ClearWindowTilemap(u8 windowId);  void PutWindowRectTilemap(u8 windowId, u8 x, u8 y, u8 width, u8 height); -void BlitBitmapToWindow(u8 windowId, u8 *pixels, u16 x, u16 y, u16 width, u16 height); +void BlitBitmapToWindow(u8 windowId, const u8 *pixels, u16 x, u16 y, u16 width, u16 height);  void BlitBitmapRectToWindow(u8 windowId, const u8 *pixels, u16 srcX, u16 srcY, u16 srcWidth, int srcHeight, u16 destX, u16 destY, u16 rectWidth, u16 rectHeight);  void FillWindowPixelRect(u8 windowId, u8 fillValue, u16 x, u16 y, u16 width, u16 height);  void CopyToWindowPixelBuffer(u8 windowId, const u8 *src, u16 size, u16 tileOffset); | 
