summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--asm/battle_frontier_2.s64
-rw-r--r--asm/menu.s196
-rw-r--r--data/berry_tag_screen.s2
-rw-r--r--data/link.s4
-rw-r--r--include/graphics.h6
-rw-r--r--include/menu.h19
-rw-r--r--include/menu_helpers.h2
-rw-r--r--include/new_menu_helpers.h21
-rw-r--r--include/region_map.h1
-rw-r--r--include/strings.h3
-rw-r--r--include/text.h18
-rw-r--r--ld_script.txt3
-rw-r--r--src/battle_bg.c2
-rw-r--r--src/battle_interface.c10
-rw-r--r--src/berry_blender.c25
-rw-r--r--src/coins.c1
-rw-r--r--src/decoration.c2
-rw-r--r--src/diploma.c11
-rw-r--r--src/egg_hatch.c10
-rw-r--r--src/hall_of_fame.c1
-rw-r--r--src/menu.c632
-rw-r--r--src/naming_screen.c32
-rw-r--r--src/new_menu_helpers.c437
-rw-r--r--src/pokeblock.c5
-rw-r--r--src/pokeblock_feed.c1
-rw-r--r--src/pokemon_storage_system.c2
-rw-r--r--src/pokemon_summary_screen.c6
-rw-r--r--src/save_failed_screen.c10
-rw-r--r--src/scrcmd.c1
-rw-r--r--src/secret_base.c1
-rw-r--r--src/window.c2
-rw-r--r--sym_ewram.txt26
32 files changed, 707 insertions, 849 deletions
diff --git a/asm/battle_frontier_2.s b/asm/battle_frontier_2.s
index eece3988a..417fa8ffa 100644
--- a/asm/battle_frontier_2.s
+++ b/asm/battle_frontier_2.s
@@ -5,6 +5,70 @@
.text
+ thumb_func_start sub_819A44C
+sub_819A44C: @ 819A44C
+ push {r4,r5,lr}
+ adds r5, r0, 0
+ ldrb r4, [r5, 0x5]
+ lsrs r4, 4
+ movs r0, 0x65
+ bl IndexOfSpritePaletteTag
+ lsls r0, 24
+ lsls r4, 16
+ lsrs r4, 16
+ lsrs r0, 24
+ cmp r4, r0
+ bne _0819A4BA
+ adds r0, r5, 0
+ adds r0, 0x3F
+ ldrb r1, [r0]
+ movs r0, 0x10
+ ands r0, r1
+ cmp r0, 0
+ beq _0819A4B0
+ ldrh r1, [r5, 0x2E]
+ movs r2, 0x2E
+ ldrsh r0, [r5, r2]
+ cmp r0, 0
+ beq _0819A484
+ subs r0, r1, 0x1
+ strh r0, [r5, 0x2E]
+ b _0819A4C2
+_0819A484:
+ bl Random
+ lsls r0, 16
+ lsrs r0, 16
+ movs r1, 0x5
+ bl __umodsi3
+ lsls r0, 16
+ cmp r0, 0
+ bne _0819A4A6
+ adds r0, r5, 0
+ movs r1, 0
+ bl StartSpriteAnim
+ movs r0, 0x20
+ strh r0, [r5, 0x2E]
+ b _0819A4C2
+_0819A4A6:
+ adds r0, r5, 0
+ movs r1, 0x1
+ bl StartSpriteAnim
+ b _0819A4C2
+_0819A4B0:
+ adds r0, r5, 0
+ movs r1, 0x1
+ bl StartSpriteAnimIfDifferent
+ b _0819A4C2
+_0819A4BA:
+ adds r0, r5, 0
+ movs r1, 0
+ bl StartSpriteAnimIfDifferent
+_0819A4C2:
+ pop {r4,r5}
+ pop {r0}
+ bx r0
+ thumb_func_end sub_819A44C
+
thumb_func_start sub_819A4C8
sub_819A4C8: @ 819A4C8
push {lr}
diff --git a/asm/menu.s b/asm/menu.s
deleted file mode 100644
index 33be67990..000000000
--- a/asm/menu.s
+++ /dev/null
@@ -1,196 +0,0 @@
- .include "asm/macros.inc"
- .include "constants/constants.inc"
-
- .syntax unified
-
- .text
-
- thumb_func_start sub_819A344
-sub_819A344: @ 819A344
- push {r4-r7,lr}
- lsls r0, 24
- lsrs r3, r0, 24
- lsls r2, 24
- lsrs r2, 24
- adds r5, r1, 0
- movs r1, 0xFC
- strb r1, [r5]
- adds r5, 0x1
- movs r0, 0x1
- strb r0, [r5]
- adds r5, 0x1
- strb r2, [r5]
- adds r5, 0x1
- strb r1, [r5]
- adds r5, 0x1
- movs r0, 0x3
- strb r0, [r5]
- adds r5, 0x1
- adds r2, 0x1
- strb r2, [r5]
- adds r5, 0x1
- cmp r3, 0x4
- bhi _0819A43C
- lsls r0, r3, 2
- ldr r1, =_0819A384
- adds r0, r1
- ldr r0, [r0]
- mov pc, r0
- .pool
- .align 2, 0
-_0819A384:
- .4byte _0819A398
- .4byte _0819A3A8
- .4byte _0819A3D6
- .4byte _0819A404
- .4byte _0819A414
-_0819A398:
- ldr r0, =gSaveBlock2Ptr
- ldr r1, [r0]
- adds r0, r5, 0
- bl StringCopy
- b _0819A43C
- .pool
-_0819A3A8:
- bl IsNationalPokedexEnabled
- cmp r0, 0
- beq _0819A3B8
- movs r0, 0x1
- bl pokedex_count
- b _0819A3BE
-_0819A3B8:
- movs r0, 0x1
- bl sub_80C0844
-_0819A3BE:
- adds r1, r0, 0
- lsls r1, 16
- lsrs r1, 16
- adds r0, r5, 0
- movs r2, 0
- movs r3, 0x3
- bl ConvertIntToDecimalStringN
- adds r5, r0, 0
- movs r0, 0xFF
- strb r0, [r5]
- b _0819A43C
-_0819A3D6:
- ldr r4, =gSaveBlock2Ptr
- ldr r0, [r4]
- ldrh r1, [r0, 0xE]
- adds r0, r5, 0
- movs r2, 0
- movs r3, 0x3
- bl ConvertIntToDecimalStringN
- adds r5, r0, 0
- movs r0, 0xF0
- strb r0, [r5]
- adds r5, 0x1
- ldr r0, [r4]
- ldrb r1, [r0, 0x10]
- adds r0, r5, 0
- movs r2, 0x2
- movs r3, 0x2
- bl ConvertIntToDecimalStringN
- b _0819A43C
- .pool
-_0819A404:
- ldr r0, =gMapHeader
- ldrb r1, [r0, 0x14]
- adds r0, r5, 0
- bl sub_81245DC
- b _0819A43C
- .pool
-_0819A414:
- ldr r4, =0x00000867
- movs r6, 0
- adds r7, r5, 0x1
-_0819A41A:
- lsls r0, r4, 16
- lsrs r0, 16
- bl FlagGet
- lsls r0, 24
- cmp r0, 0
- beq _0819A42A
- adds r6, 0x1
-_0819A42A:
- adds r4, 0x1
- ldr r0, =0x0000086e
- cmp r4, r0
- ble _0819A41A
- adds r0, r6, 0
- subs r0, 0x5F
- strb r0, [r5]
- movs r0, 0xFF
- strb r0, [r7]
-_0819A43C:
- pop {r4-r7}
- pop {r0}
- bx r0
- .pool
- thumb_func_end sub_819A344
-
- thumb_func_start sub_819A44C
-sub_819A44C: @ 819A44C
- push {r4,r5,lr}
- adds r5, r0, 0
- ldrb r4, [r5, 0x5]
- lsrs r4, 4
- movs r0, 0x65
- bl IndexOfSpritePaletteTag
- lsls r0, 24
- lsls r4, 16
- lsrs r4, 16
- lsrs r0, 24
- cmp r4, r0
- bne _0819A4BA
- adds r0, r5, 0
- adds r0, 0x3F
- ldrb r1, [r0]
- movs r0, 0x10
- ands r0, r1
- cmp r0, 0
- beq _0819A4B0
- ldrh r1, [r5, 0x2E]
- movs r2, 0x2E
- ldrsh r0, [r5, r2]
- cmp r0, 0
- beq _0819A484
- subs r0, r1, 0x1
- strh r0, [r5, 0x2E]
- b _0819A4C2
-_0819A484:
- bl Random
- lsls r0, 16
- lsrs r0, 16
- movs r1, 0x5
- bl __umodsi3
- lsls r0, 16
- cmp r0, 0
- bne _0819A4A6
- adds r0, r5, 0
- movs r1, 0
- bl StartSpriteAnim
- movs r0, 0x20
- strh r0, [r5, 0x2E]
- b _0819A4C2
-_0819A4A6:
- adds r0, r5, 0
- movs r1, 0x1
- bl StartSpriteAnim
- b _0819A4C2
-_0819A4B0:
- adds r0, r5, 0
- movs r1, 0x1
- bl StartSpriteAnimIfDifferent
- b _0819A4C2
-_0819A4BA:
- adds r0, r5, 0
- movs r1, 0
- bl StartSpriteAnimIfDifferent
-_0819A4C2:
- pop {r4,r5}
- pop {r0}
- bx r0
- thumb_func_end sub_819A44C
-
- .align 2, 0 @ Don't pad with nop.
diff --git a/data/berry_tag_screen.s b/data/berry_tag_screen.s
index 13078e8e5..cacc023b4 100644
--- a/data/berry_tag_screen.s
+++ b/data/berry_tag_screen.s
@@ -12,7 +12,7 @@ gUnknown_085EFD00:: @ 85EFD00
.incbin "graphics/interface/berry_tag_screen.gbapal"
.align 2
-gUnknown_085EFD20:: @ 85EFD20 struct TextColor
+gUnknown_085EFD20:: @ 85EFD20
.byte 0x00, 0x02, 0x03
.byte 0x0F, 0x0E, 0x0D
diff --git a/data/link.s b/data/link.s
index e458ad5de..39f97644f 100644
--- a/data/link.s
+++ b/data/link.s
@@ -2004,14 +2004,14 @@ gUnknown_082F06F8:: @ 82F06F8
.4byte gText_ReturnToTitle
.align 2
-gUnknown_082F0720:: @ 82F0720 struct TextColor
+gUnknown_082F0720:: @ 82F0720
.byte 0x00, 0x01, 0x02
.align 2
.byte 0x00, 0x01, 0x02
.align 2
-gUnknown_082F0728:: @ 82F0728 struct TextColor
+gUnknown_082F0728:: @ 82F0728
.byte 0x01, 0x02, 0x03
.align 2
diff --git a/include/graphics.h b/include/graphics.h
index 5917e9d2a..bebf1724b 100644
--- a/include/graphics.h
+++ b/include/graphics.h
@@ -2679,4 +2679,10 @@ extern const u8 gRaySceneKyogreRight_Pal[];
extern const u8 gRaySceneRayquazaHover_Pal[];
extern const u8 gRaySceneSplash_Pal[];
+//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 6c4a069e3..98b323e42 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,7 +17,21 @@ struct MenuAction
} func;
};
-void box_print(u8 windowId, u8 fontId, u8 left, u8 top, const struct TextColor *color, s8 speed, const u8 *str);
+void sub_81971D0(void);
+void sub_8197200(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);
@@ -35,7 +50,7 @@ void CreateYesNoMenu(const struct WindowTemplate *windowTemplate, u16 borderFirs
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 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);
diff --git a/include/menu_helpers.h b/include/menu_helpers.h
index 047adaf2a..7fae43e9c 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
diff --git a/include/new_menu_helpers.h b/include/new_menu_helpers.h
deleted file mode 100644
index fb9a727dc..000000000
--- a/include/new_menu_helpers.h
+++ /dev/null
@@ -1,21 +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 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);
-
-#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 806a2e405..3bd69bb12 100644
--- a/include/strings.h
+++ b/include/strings.h
@@ -202,4 +202,7 @@ 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[];
+
#endif //GUARD_STRINGS_H
diff --git a/include/text.h b/include/text.h
index b10b27f1e..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
@@ -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/ld_script.txt b/ld_script.txt
index 22de4292e..61ea86a3e 100644
--- a/ld_script.txt
+++ b/ld_script.txt
@@ -247,9 +247,7 @@ SECTIONS {
src/battle_dome_cards.o(.text);
src/lilycove_lady.o(.text);
asm/battle_frontier_1.o(.text);
- src/new_menu_helpers.o(.text);
src/menu.o(.text);
- asm/menu.o(.text);
asm/battle_frontier_2.o(.text);
asm/item_menu.o(.text);
asm/list_menu.o(.text);
@@ -521,7 +519,6 @@ SECTIONS {
src/battle_dome_cards.o(.rodata);
src/lilycove_lady.o(.rodata);
data/battle_frontier_1.o(.rodata);
- src/new_menu_helpers.o(.rodata);
src/menu.o(.rodata);
data/battle_frontier_2.o(.rodata);
data/item_menu.o(.rodata);
diff --git a/src/battle_bg.c b/src/battle_bg.c
index 5d5bbf0e9..a67f56fd8 100644
--- a/src/battle_bg.c
+++ b/src/battle_bg.c
@@ -17,7 +17,7 @@
#include "strings.h"
#include "window.h"
#include "text_window.h"
-#include "new_menu_helpers.h"
+#include "menu.h"
struct BattleBackground
{
diff --git a/src/battle_interface.c b/src/battle_interface.c
index 2338682e2..0917f0cfc 100644
--- a/src/battle_interface.c
+++ b/src/battle_interface.c
@@ -2565,17 +2565,17 @@ u8 GetHPBarLevel(s16 hp, s16 maxhp)
static u8* AddTextPrinterAndCreateWindowOnHealthbox(const u8 *str, u32 x, u32 y, u32 arg3, u32 *windowId)
{
u16 winId;
- struct TextColor color;
+ u8 color[3];
struct WindowTemplate winTemplate = sHealthboxWindowTemplate;
winId = AddWindow(&winTemplate);
FillWindowPixelBuffer(winId, (arg3 << 4) | (arg3));
- color.fgColor = arg3;
- color.bgColor = 1;
- color.shadowColor = 3;
+ color[0] = arg3;
+ color[1] = 1;
+ color[2] = 3;
- AddTextPrinterParameterized2(winId, 0, x, y, 0, 0, &color, -1, str);
+ AddTextPrinterParameterized2(winId, 0, x, y, 0, 0, color, -1, str);
*windowId = winId;
return (u8*)(GetWindowAttribute(winId, WINDOW_TILE_DATA));
diff --git a/src/berry_blender.c b/src/berry_blender.c
index 3494492de..45e3acd24 100644
--- a/src/berry_blender.c
+++ b/src/berry_blender.c
@@ -18,7 +18,6 @@
#include "event_data.h"
#include "main.h"
#include "link.h"
-#include "new_menu_helpers.h"
#include "item_menu_icons.h"
#include "berry.h"
#include "item.h"
@@ -3574,35 +3573,35 @@ static bool32 TryAddContestLinkTvShow(struct Pokeblock *pokeblock, struct TvBlen
static void Blender_AddTextPrinter(u8 windowId, const u8 *string, u8 x, u8 y, s32 speed, s32 caseId)
{
- struct TextColor txtColor;
+ u8 txtColor[3];
u32 letterSpacing = 0;
switch (caseId)
{
case 0:
case 3:
- txtColor.fgColor = 1;
- txtColor.bgColor = 2;
- txtColor.shadowColor = 3;
+ txtColor[0] = 1;
+ txtColor[1] = 2;
+ txtColor[2] = 3;
break;
case 1:
- txtColor.fgColor = 0;
- txtColor.bgColor = 2;
- txtColor.shadowColor = 3;
+ txtColor[0] = 0;
+ txtColor[1] = 2;
+ txtColor[2] = 3;
break;
case 2:
- txtColor.fgColor = 0;
- txtColor.bgColor = 4;
- txtColor.shadowColor = 5;
+ txtColor[0] = 0;
+ txtColor[1] = 4;
+ txtColor[2] = 5;
break;
}
if (caseId != 3)
{
- FillWindowPixelBuffer(windowId, txtColor.fgColor | (txtColor.fgColor << 4));
+ FillWindowPixelBuffer(windowId, txtColor[0] | (txtColor[0] << 4));
}
- AddTextPrinterParameterized2(windowId, 1, x, y, letterSpacing, 1, &txtColor, speed, string);
+ AddTextPrinterParameterized2(windowId, 1, x, y, letterSpacing, 1, txtColor, speed, string);
}
static bool32 Blender_PrintText(s16 *textState, const u8 *string, s32 textSpeed)
diff --git a/src/coins.c b/src/coins.c
index 50c31cac0..12e0bd4ef 100644
--- a/src/coins.c
+++ b/src/coins.c
@@ -4,7 +4,6 @@
#include "window.h"
#include "strings.h"
#include "string_util.h"
-#include "new_menu_helpers.h"
#include "menu.h"
#include "international_string_util.h"
diff --git a/src/decoration.c b/src/decoration.c
index 8fb620b36..885b1b0b0 100644
--- a/src/decoration.c
+++ b/src/decoration.c
@@ -20,7 +20,7 @@
#include "field_map_obj.h"
#include "list_menu.h"
#include "menu_helpers.h"
-#include "new_menu_helpers.h"
+#include "menu.h"
#include "menu_indicators.h"
#include "sound.h"
#include "event_scripts.h"
diff --git a/src/diploma.c b/src/diploma.c
index 24e5e9727..987596227 100644
--- a/src/diploma.c
+++ b/src/diploma.c
@@ -17,7 +17,7 @@ extern int decompress_and_copy_tile_data_to_vram(u8 bg_id, void *src, int size,
extern bool8 free_temp_tile_data_buffers_if_possible(void);
extern void sub_80861E8(void); // rom4
extern bool16 sub_80C0944(void);
-extern void AddTextPrinterParameterized2(u8 windowId, u8 fontId, u8 x, u8 y, u8 letterSpacing, u8 lineSpacing, struct TextColor *color, s8 speed, u8 *str);
+extern void AddTextPrinterParameterized2(u8 windowId, u8 fontId, u8 x, u8 y, u8 letterSpacing, u8 lineSpacing, u8 *color, s8 speed, u8 *str);
extern u16 gUnknown_0860F074[];
@@ -208,12 +208,7 @@ static void InitDiplomaWindow(void)
static void PrintDiplomaText(u8 *text, u8 var1, u8 var2)
{
- struct TextColor color =
- {
- .fgColor = 0,
- .bgColor = 2,
- .shadowColor = 3,
- };
+ u8 color[3] = {0, 2, 3};
- AddTextPrinterParameterized2(0, 1, var1, var2, 0, 0, &color, -1, text);
+ AddTextPrinterParameterized2(0, 1, var1, var2, 0, 0, color, -1, text);
}
diff --git a/src/egg_hatch.c b/src/egg_hatch.c
index 435886638..c78cb2c08 100644
--- a/src/egg_hatch.c
+++ b/src/egg_hatch.c
@@ -41,7 +41,7 @@ struct EggHatchData
u8 unused_9;
u8 unused_A;
u16 species;
- struct TextColor textColor;
+ u8 textColor[3];
};
extern struct SpriteTemplate gUnknown_0202499C;
@@ -863,10 +863,10 @@ static void CreateEggShardSprite(u8 x, u8 y, s16 data1, s16 data2, s16 data3, u8
static void EggHatchPrintMessage(u8 windowId, u8* string, u8 x, u8 y, u8 speed)
{
FillWindowPixelBuffer(windowId, 0xFF);
- sEggHatchData->textColor.fgColor = 0;
- sEggHatchData->textColor.bgColor = 5;
- sEggHatchData->textColor.shadowColor = 6;
- AddTextPrinterParameterized2(windowId, 1, x, y, 0, 0, &sEggHatchData->textColor, speed, string);
+ sEggHatchData->textColor[0] = 0;
+ sEggHatchData->textColor[1] = 5;
+ sEggHatchData->textColor[2] = 6;
+ AddTextPrinterParameterized2(windowId, 1, x, y, 0, 0, sEggHatchData->textColor, speed, string);
}
u8 GetEggStepsToSubtract(void)
diff --git a/src/hall_of_fame.c b/src/hall_of_fame.c
index 85fb518b5..9ac415c32 100644
--- a/src/hall_of_fame.c
+++ b/src/hall_of_fame.c
@@ -82,7 +82,6 @@ extern const u8 gContestConfetti_Gfx[];
extern const u8 gContestConfetti_Pal[];
extern void NewMenuHelpers_DrawDialogueFrame(u8, u8);
-extern u16 AddTextPrinterParameterized(u8 windowId, u8 fontId, const u8 *str, u8 speed, void ( *callback)(u16, struct TextPrinter *), u8 fgColor, u8 bgColor, u8 shadowColor);
extern void sub_8175620(void);
extern u8 TrySavingData(u8);
extern u8 sub_818D3E4(u16 species, u32 trainerId, u32 personality, u8 flags, s16 x, s16 y, u8, u16);
diff --git a/src/menu.c b/src/menu.c
index 675cc6c19..34a689c73 100644
--- a/src/menu.c
+++ b/src/menu.c
@@ -1,5 +1,4 @@
#include "global.h"
-#include "new_menu_helpers.h"
#include "bg.h"
#include "window.h"
#include "palette.h"
@@ -13,8 +12,20 @@
#include "dma3.h"
#include "string_util.h"
#include "pokemon_icon.h"
+#include "constants/flags.h"
+#include "event_data.h"
+#include "pokedex.h"
+#include "region_map.h"
+#include "text_window.h"
+#include "strings.h"
+#include "graphics.h"
-struct SomeUnkStruct
+#define DLG_WINDOW_PALETTE_NUM 15
+#define DLG_WINDOW_BASE_TILE_NUM 0x200
+#define STD_WINDOW_PALETTE_NUM 14
+#define STD_WINDOW_BASE_TILE_NUM 0x214
+
+struct SomeUnkStruct_60F0D4
{
u8 unk1;
u8 unk2;
@@ -37,18 +48,35 @@ struct Menu
bool8 APressMuted;
};
-extern EWRAM_DATA struct Menu gUnknown_0203CD90;
-extern EWRAM_DATA u16 gUnknown_0203CD9C;
-extern EWRAM_DATA u8 gUnknown_0203CD9E;
-extern EWRAM_DATA u8 gUnknown_0203CD9F;
-extern EWRAM_DATA u8 gUnknown_0203CDA0;
-extern EWRAM_DATA bool8 gUnknown_0203CDA4[4];
-extern EWRAM_DATA u16 gUnknown_0203CDA8;
-extern EWRAM_DATA void *gUnknown_0203CDAC[0x20];
+static EWRAM_DATA u8 gUnknown_0203CD8C = 0;
+static EWRAM_DATA u8 gUnknown_0203CD8D = 0;
+static EWRAM_DATA struct Menu gUnknown_0203CD90 = {0};
+static EWRAM_DATA u16 gUnknown_0203CD9C = 0;
+static EWRAM_DATA u8 gUnknown_0203CD9E = 0;
+static EWRAM_DATA u8 gUnknown_0203CD9F = 0;
+static EWRAM_DATA u8 gUnknown_0203CDA0 = 0;
+static EWRAM_DATA u16 sFiller = 0; // needed to align
+static EWRAM_DATA bool8 gUnknown_0203CDA4[4] = {FALSE};
+static EWRAM_DATA u16 gUnknown_0203CDA8 = 0;
+static EWRAM_DATA void *gUnknown_0203CDAC[0x20] = {NULL};
+
+const u16 gUnknown_0860F074[] = INCBIN_U16("graphics/interface/860F074.gbapal");
+static const u8 gUnknown_0860F094[] = { 8, 4, 1 };
+
+static const struct WindowTemplate gUnknown_0860F098[] =
+{
+ { 0x00, 0x02, 0x0F, 0x1B, 0x04, 0x0F, 0x194 },
+ DUMMY_WIN_TEMPLATE
+};
+
+static const struct WindowTemplate gUnknown_0860F0A8 =
+{
+ 0x00, 0x15, 0x09, 0x05, 0x04, 0x0F, 0x125
+};
const u16 gUnknown_0860F0B0[] = INCBIN_U16("graphics/interface/860F0B0.gbapal");
-const struct TextColor gUnknown_0860F0D0[] = { 15, 1, 2 };
-const struct SomeUnkStruct gUnknown_0860F0D4[] =
+const u8 gUnknown_0860F0D0[] = { 15, 1, 2 };
+const struct SomeUnkStruct_60F0D4 gUnknown_0860F0D4[] =
{
{ 12, 12, 0x00 },
{ 32, 12, 0x20 },
@@ -78,13 +106,12 @@ const struct SomeUnkStruct gUnknown_0860F0D4[] =
{ 8, 8, 0xAF },
};
-extern const u8 gText_SelectorArrow3[];
-extern const u8 gText_YesNo[];
-extern const u16 gFireRedMenuElements1_Pal[16];
-extern const u16 gFireRedMenuElements2_Pal[16];
-extern const u16 gFireRedMenuElements3_Pal[16];
-extern const u8 gFireRedMenuElements_Gfx[];
-
+// Forward declarations
+extern void sub_81973A4(void);
+extern void DrawStandardFrame(u8, u8, u8, u8, u8, u8);
+extern void DrawDialogueFrame(u8, u8, u8, u8, u8, u8);
+extern void sub_81977BC(u8, u8, u8, u8, u8, u8);
+extern void sub_8197804(u8, u8, u8, u8, u8, u8);
extern void sub_8197BB4(u8, u8, u8, u8, u8, u8);
extern void sub_8197E30(u8, u8, u8, u8, u8, u8);
extern void DrawWindowBorder(u8, u8, u8, u8, u8, u8);
@@ -95,6 +122,405 @@ extern void sub_8199F74(u8 windowId, u8 fontId, const u8 *str, u8 left, u8 top,
extern void sub_8198C78(void);
extern void task_free_buf_after_copying_tile_data_to_vram(u8 taskId);
+void sub_81971D0(void)
+{
+ InitWindows(gUnknown_0860F098);
+ gUnknown_0203CD8C = 0xFF;
+ gUnknown_0203CD8D = 0xFF;
+}
+
+void sub_81971F4(void)
+{
+ FreeAllWindowBuffers();
+}
+
+void sub_8197200(void)
+{
+ ChangeBgX(0, 0, 0);
+ ChangeBgY(0, 0, 0);
+ DeactivateAllTextPrinters();
+ sub_81973A4();
+}
+
+u16 sub_8197224(void)
+{
+ RunTextPrinters();
+ return IsTextPrinterActive(0);
+}
+
+u16 AddTextPrinterParameterized(u8 windowId, u8 fontId, const u8 *str, u8 speed, void (*callback)(struct TextSubPrinter *, u16), u8 fgColor, u8 bgColor, u8 shadowColor)
+{
+ struct TextSubPrinter printer;
+
+ printer.current_text_offset = str;
+ printer.windowId = windowId;
+ printer.fontId = fontId;
+ printer.x = 0;
+ printer.y = 1;
+ printer.currentX = 0;
+ printer.currentY = 1;
+ printer.letterSpacing = 0;
+ printer.lineSpacing = 0;
+ printer.fontColor_l = 0;
+ printer.fgColor = fgColor;
+ printer.bgColor = bgColor;
+ printer.shadowColor = shadowColor;
+
+ gTextFlags.flag_1 = 0;
+ return AddTextPrinter(&printer, speed, callback);
+}
+
+void AddTextPrinterForMessage(bool8 allowSkippingDelayWithButtonPress)
+{
+ void (*callback)(struct TextSubPrinter *, u16) = NULL;
+ gTextFlags.flag_0 = allowSkippingDelayWithButtonPress;
+ AddTextPrinterParameterized(0, 1, gStringVar4, GetPlayerTextSpeed(), callback, 2, 1, 3);
+}
+
+void AddTextPrinterForMessage_2(bool8 allowSkippingDelayWithButtonPress)
+{
+ gTextFlags.flag_0 = allowSkippingDelayWithButtonPress;
+ AddTextPrinterParameterized(0, 1, gStringVar4, GetPlayerTextSpeed(), NULL, 2, 1, 3);
+}
+
+void AddTextPrinterWithCustomSpeedForMessage(bool8 allowSkippingDelayWithButtonPress, u8 speed)
+{
+ gTextFlags.flag_0 = allowSkippingDelayWithButtonPress;
+ AddTextPrinterParameterized(0, 1, gStringVar4, speed, NULL, 2, 1, 3);
+}
+
+void sub_81973A4(void)
+{
+ copy_textbox_border_tile_patterns_to_vram(0, DLG_WINDOW_BASE_TILE_NUM, DLG_WINDOW_PALETTE_NUM * 0x10);
+ sub_809882C(0, STD_WINDOW_BASE_TILE_NUM, STD_WINDOW_PALETTE_NUM * 0x10);
+}
+
+void NewMenuHelpers_DrawDialogueFrame(u8 windowId, bool8 copyToVram)
+{
+ CallWindowFunction(windowId, DrawDialogueFrame);
+ FillWindowPixelBuffer(windowId, 0x11);
+ PutWindowTilemap(windowId);
+ if (copyToVram == TRUE)
+ CopyWindowToVram(windowId, 3);
+}
+
+void NewMenuHelpers_DrawStdWindowFrame(u8 windowId, bool8 copyToVram)
+{
+ CallWindowFunction(windowId, DrawStandardFrame);
+ FillWindowPixelBuffer(windowId, 0x11);
+ PutWindowTilemap(windowId);
+ if (copyToVram == TRUE)
+ CopyWindowToVram(windowId, 3);
+}
+
+void sub_8197434(u8 windowId, bool8 copyToVram)
+{
+ CallWindowFunction(windowId, sub_8197804);
+ FillWindowPixelBuffer(windowId, 0x11);
+ ClearWindowTilemap(windowId);
+ if (copyToVram == TRUE)
+ CopyWindowToVram(windowId, 3);
+}
+
+void sub_819746C(u8 windowId, bool8 copyToVram)
+{
+ CallWindowFunction(windowId, sub_81977BC);
+ FillWindowPixelBuffer(windowId, 0x11);
+ ClearWindowTilemap(windowId);
+ if (copyToVram == TRUE)
+ CopyWindowToVram(windowId, 3);
+}
+
+void DrawStandardFrame(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 paletteNum)
+{
+ int i;
+
+ FillBgTilemapBufferRect(bg,
+ STD_WINDOW_BASE_TILE_NUM + 0,
+ tilemapLeft - 1,
+ tilemapTop - 1,
+ 1,
+ 1,
+ STD_WINDOW_PALETTE_NUM);
+ FillBgTilemapBufferRect(bg,
+ STD_WINDOW_BASE_TILE_NUM + 1,
+ tilemapLeft,
+ tilemapTop - 1,
+ width,
+ 1,
+ STD_WINDOW_PALETTE_NUM);
+ FillBgTilemapBufferRect(bg,
+ STD_WINDOW_BASE_TILE_NUM + 2,
+ tilemapLeft + width,
+ tilemapTop - 1,
+ 1,
+ 1,
+ STD_WINDOW_PALETTE_NUM);
+
+ for (i = tilemapTop; i < tilemapTop + height; i++)
+ {
+ FillBgTilemapBufferRect(bg,
+ STD_WINDOW_BASE_TILE_NUM + 3,
+ tilemapLeft - 1,
+ i,
+ 1,
+ 1,
+ STD_WINDOW_PALETTE_NUM);
+ FillBgTilemapBufferRect(bg,
+ STD_WINDOW_BASE_TILE_NUM + 5,
+ tilemapLeft + width,
+ i,
+ 1,
+ 1,
+ STD_WINDOW_PALETTE_NUM);
+ }
+
+ FillBgTilemapBufferRect(bg,
+ STD_WINDOW_BASE_TILE_NUM + 6,
+ tilemapLeft - 1,
+ tilemapTop + height,
+ 1,
+ 1,
+ STD_WINDOW_PALETTE_NUM);
+ FillBgTilemapBufferRect(bg,
+ STD_WINDOW_BASE_TILE_NUM + 7,
+ tilemapLeft,
+ tilemapTop + height,
+ width,
+ 1,
+ STD_WINDOW_PALETTE_NUM);
+ FillBgTilemapBufferRect(bg,
+ STD_WINDOW_BASE_TILE_NUM + 8,
+ tilemapLeft + width,
+ tilemapTop + height,
+ 1,
+ 1,
+ STD_WINDOW_PALETTE_NUM);
+}
+
+void DrawDialogueFrame(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 paletteNum)
+{
+ FillBgTilemapBufferRect(bg,
+ DLG_WINDOW_BASE_TILE_NUM + 1,
+ tilemapLeft - 2,
+ tilemapTop - 1,
+ 1,
+ 1,
+ DLG_WINDOW_PALETTE_NUM);
+ FillBgTilemapBufferRect(bg,
+ DLG_WINDOW_BASE_TILE_NUM + 3,
+ tilemapLeft - 1,
+ tilemapTop - 1,
+ 1,
+ 1,
+ DLG_WINDOW_PALETTE_NUM);
+ FillBgTilemapBufferRect(bg,
+ DLG_WINDOW_BASE_TILE_NUM + 4,
+ tilemapLeft,
+ tilemapTop - 1,
+ width - 1,
+ 1,
+ DLG_WINDOW_PALETTE_NUM);
+ FillBgTilemapBufferRect(bg,
+ DLG_WINDOW_BASE_TILE_NUM + 5,
+ tilemapLeft + width - 1,
+ tilemapTop - 1,
+ 1,
+ 1,
+ DLG_WINDOW_PALETTE_NUM);
+ FillBgTilemapBufferRect(bg,
+ DLG_WINDOW_BASE_TILE_NUM + 6,
+ tilemapLeft + width,
+ tilemapTop - 1,
+ 1,
+ 1,
+ DLG_WINDOW_PALETTE_NUM);
+ FillBgTilemapBufferRect(bg,
+ DLG_WINDOW_BASE_TILE_NUM + 7,
+ tilemapLeft - 2,
+ tilemapTop,
+ 1,
+ 5,
+ DLG_WINDOW_PALETTE_NUM);
+ FillBgTilemapBufferRect(bg,
+ DLG_WINDOW_BASE_TILE_NUM + 9,
+ tilemapLeft - 1,
+ tilemapTop,
+ width + 1,
+ 5,
+ DLG_WINDOW_PALETTE_NUM);
+ FillBgTilemapBufferRect(bg,
+ DLG_WINDOW_BASE_TILE_NUM + 10,
+ tilemapLeft + width,
+ tilemapTop,
+ 1,
+ 5,
+ DLG_WINDOW_PALETTE_NUM);
+ FillBgTilemapBufferRect(bg,
+ BG_TILE_V_FLIP(DLG_WINDOW_BASE_TILE_NUM + 1),
+ tilemapLeft - 2,
+ tilemapTop + height,
+ 1,
+ 1,
+ DLG_WINDOW_PALETTE_NUM);
+ FillBgTilemapBufferRect(bg,
+ BG_TILE_V_FLIP(DLG_WINDOW_BASE_TILE_NUM + 3),
+ tilemapLeft - 1,
+ tilemapTop + height,
+ 1,
+ 1,
+ DLG_WINDOW_PALETTE_NUM);
+ FillBgTilemapBufferRect(bg,
+ BG_TILE_V_FLIP(DLG_WINDOW_BASE_TILE_NUM + 4),
+ tilemapLeft,
+ tilemapTop + height,
+ width - 1,
+ 1,
+ DLG_WINDOW_PALETTE_NUM);
+ FillBgTilemapBufferRect(bg,
+ BG_TILE_V_FLIP(DLG_WINDOW_BASE_TILE_NUM + 5),
+ tilemapLeft + width - 1,
+ tilemapTop + height,
+ 1,
+ 1,
+ DLG_WINDOW_PALETTE_NUM);
+ FillBgTilemapBufferRect(bg,
+ BG_TILE_V_FLIP(DLG_WINDOW_BASE_TILE_NUM + 6),
+ tilemapLeft + width,
+ tilemapTop + height,
+ 1,
+ 1,
+ DLG_WINDOW_PALETTE_NUM);
+}
+
+void sub_81977BC(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 paletteNum)
+{
+ FillBgTilemapBufferRect(bg, 0, tilemapLeft - 1, tilemapTop - 1, width + 2, height + 2, STD_WINDOW_PALETTE_NUM);
+}
+
+void sub_8197804(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 paletteNum)
+{
+ FillBgTilemapBufferRect(bg, 0, tilemapLeft - 3, tilemapTop - 1, width + 6, height + 2, STD_WINDOW_PALETTE_NUM);
+}
+
+void SetStandardWindowBorderStyle(u8 windowId, bool8 copyToVram)
+{
+ SetWindowBorderStyle(windowId, copyToVram, STD_WINDOW_BASE_TILE_NUM, STD_WINDOW_PALETTE_NUM);
+}
+
+void sub_819786C(u8 windowId, bool8 copyToVram)
+{
+ copy_textbox_border_tile_patterns_to_vram(windowId, DLG_WINDOW_BASE_TILE_NUM, DLG_WINDOW_PALETTE_NUM * 0x10);
+ sub_8197B1C(windowId, copyToVram, DLG_WINDOW_BASE_TILE_NUM, 0xF);
+}
+
+void sub_819789C(void)
+{
+ LoadPalette(gUnknown_0860F074, STD_WINDOW_PALETTE_NUM * 0x10, 0x14);
+}
+
+void sub_81978B0(u16 offset)
+{
+ LoadPalette(gUnknown_0860F074, offset, 0x14);
+}
+
+const u16 *sub_81978C8(void)
+{
+ return gUnknown_0860F074;
+}
+
+u16 sub_81978D0(u8 colorNum)
+{
+ if (colorNum > 15)
+ colorNum = 0;
+ return gUnknown_0860F074[colorNum];
+}
+
+void DisplayItemMessageOnField(u8 taskId, const u8 *string, TaskFunc callback)
+{
+ sub_81973A4();
+ DisplayMessageAndContinueTask(taskId, 0, DLG_WINDOW_BASE_TILE_NUM, DLG_WINDOW_PALETTE_NUM, 1, GetPlayerTextSpeed(), string, callback);
+ CopyWindowToVram(0, 3);
+}
+
+void sub_8197930(void)
+{
+ CreateYesNoMenu(&gUnknown_0860F0A8, STD_WINDOW_BASE_TILE_NUM, STD_WINDOW_PALETTE_NUM, 0);
+}
+
+void sub_8197948(u8 initialCursorPos)
+{
+ CreateYesNoMenu(&gUnknown_0860F0A8, STD_WINDOW_BASE_TILE_NUM, STD_WINDOW_PALETTE_NUM, initialCursorPos);
+}
+
+u32 sub_8197964(void)
+{
+ if (gTextFlags.flag_3)
+ return 1;
+ return gSaveBlock2Ptr->optionsTextSpeed;
+}
+
+u8 GetPlayerTextSpeed(void)
+{
+ u32 speed;
+ if (gSaveBlock2Ptr->optionsTextSpeed > 2)
+ gSaveBlock2Ptr->optionsTextSpeed = 1;
+ speed = sub_8197964();
+ return gUnknown_0860F094[speed];
+}
+
+u8 sub_81979C4(u8 a1)
+{
+ if (gUnknown_0203CD8C == 0xFF)
+ gUnknown_0203CD8C = sub_8198AA4(0, 0x16, 1, 7, (a1 * 2) + 2, 0xF, 0x139);
+ return gUnknown_0203CD8C;
+}
+
+u8 GetStartMenuWindowId(void)
+{
+ return gUnknown_0203CD8C;
+}
+
+void remove_start_menu_window_maybe(void)
+{
+ if (gUnknown_0203CD8C != 0xFF)
+ {
+ RemoveWindow(gUnknown_0203CD8C);
+ gUnknown_0203CD8C = 0xFF;
+ }
+}
+
+u16 sub_8197A30(void)
+{
+ return DLG_WINDOW_BASE_TILE_NUM;
+}
+
+u16 sub_8197A38(void)
+{
+ return STD_WINDOW_BASE_TILE_NUM;
+}
+
+u8 AddMapNamePopUpWindow(void)
+{
+ if (gUnknown_0203CD8D == 0xFF)
+ gUnknown_0203CD8D = sub_8198AA4(0, 1, 1, 10, 3, 14, 0x107);
+ return gUnknown_0203CD8D;
+}
+
+u8 GetMapNamePopUpWindowId(void)
+{
+ return gUnknown_0203CD8D;
+}
+
+void RemoveMapNamePopUpWindow(void)
+{
+ if (gUnknown_0203CD8D != 0xFF)
+ {
+ RemoveWindow(gUnknown_0203CD8D);
+ gUnknown_0203CD8D = 0xFF;
+ }
+}
+
void AddTextPrinterWithCallbackForMessage(bool8 a1, void (*callback)(struct TextSubPrinter *, u16))
{
gTextFlags.flag_0 = a1;
@@ -386,22 +812,22 @@ void sub_8198180(const u8 *string, u8 a2, bool8 copyToVram)
void sub_8198204(const u8 *string, const u8 *string2, u8 a3, u8 a4, bool8 copyToVram)
{
- struct TextColor color;
+ u8 color[3];
u16 width = 0;
if (gUnknown_0203CDA0 != 0xFF)
{
if (a3 != 0)
{
- color.fgColor = 0;
- color.bgColor = 1;
- color.shadowColor = 2;
+ color[0] = 0;
+ color[1] = 1;
+ color[2] = 2;
}
else
{
- color.fgColor = 15;
- color.bgColor = 1;
- color.shadowColor = 2;
+ color[0] = 15;
+ color[1] = 1;
+ color[2] = 2;
}
PutWindowTilemap(gUnknown_0203CDA0);
FillWindowPixelBuffer(gUnknown_0203CDA0, 0xFF);
@@ -412,11 +838,11 @@ void sub_8198204(const u8 *string, const u8 *string2, u8 a3, u8 a4, bool8 copyTo
0,
0xEC - (GetWindowAttribute(gUnknown_0203CDA0, WINDOW_TILEMAP_LEFT) * 8) - a4 - width,
1,
- &color,
+ color,
0,
string2);
}
- AddTextPrinterParameterized2(gUnknown_0203CDA0, 1, 4, 1, 0, 0, &color, 0, string);
+ AddTextPrinterParameterized2(gUnknown_0203CDA0, 1, 4, 1, 0, 0, color, 0, string);
if (copyToVram)
CopyWindowToVram(gUnknown_0203CDA0, 3);
}
@@ -541,22 +967,22 @@ s8 ProcessMenuInput(void)
}
else if (gMain.newKeys & B_BUTTON)
{
- return -1;
+ return MENU_B_PRESSED;
}
else if (gMain.newKeys & DPAD_UP)
{
PlaySE(SE_SELECT);
MoveMenuCursor(-1);
- return -2;
+ return MENU_NOTHING_CHOSEN;
}
else if (gMain.newKeys & DPAD_DOWN)
{
PlaySE(SE_SELECT);
MoveMenuCursor(1);
- return -2;
+ return MENU_NOTHING_CHOSEN;
}
- return -2;
+ return MENU_NOTHING_CHOSEN;
}
s8 ProcessMenuInputNoWrapAround(void)
@@ -571,22 +997,22 @@ s8 ProcessMenuInputNoWrapAround(void)
}
else if (gMain.newKeys & B_BUTTON)
{
- return -1;
+ return MENU_B_PRESSED;
}
else if (gMain.newKeys & DPAD_UP)
{
if (oldPos != MoveMenuCursorNoWrapAround(-1))
PlaySE(SE_SELECT);
- return -2;
+ return MENU_NOTHING_CHOSEN;
}
else if (gMain.newKeys & DPAD_DOWN)
{
if (oldPos != MoveMenuCursorNoWrapAround(1))
PlaySE(SE_SELECT);
- return -2;
+ return MENU_NOTHING_CHOSEN;
}
- return -2;
+ return MENU_NOTHING_CHOSEN;
}
s8 ProcessMenuInput_other(void)
@@ -599,22 +1025,22 @@ s8 ProcessMenuInput_other(void)
}
else if (gMain.newKeys & B_BUTTON)
{
- return -1;
+ return MENU_B_PRESSED;
}
else if ((gMain.newAndRepeatedKeys & DPAD_ANY) == DPAD_UP)
{
PlaySE(SE_SELECT);
MoveMenuCursor(-1);
- return -2;
+ return MENU_NOTHING_CHOSEN;
}
else if ((gMain.newAndRepeatedKeys & DPAD_ANY) == DPAD_DOWN)
{
PlaySE(SE_SELECT);
MoveMenuCursor(1);
- return -2;
+ return MENU_NOTHING_CHOSEN;
}
- return -2;
+ return MENU_NOTHING_CHOSEN;
}
s8 ProcessMenuInputNoWrapAround_other(void)
@@ -629,22 +1055,22 @@ s8 ProcessMenuInputNoWrapAround_other(void)
}
else if (gMain.newKeys & B_BUTTON)
{
- return -1;
+ return MENU_B_PRESSED;
}
else if ((gMain.newAndRepeatedKeys & DPAD_ANY) == DPAD_UP)
{
if (oldPos != MoveMenuCursorNoWrapAround(-1))
PlaySE(SE_SELECT);
- return -2;
+ return MENU_NOTHING_CHOSEN;
}
else if ((gMain.newAndRepeatedKeys & DPAD_ANY) == DPAD_DOWN)
{
if (oldPos != MoveMenuCursorNoWrapAround(1))
PlaySE(SE_SELECT);
- return -2;
+ return MENU_NOTHING_CHOSEN;
}
- return -2;
+ return MENU_NOTHING_CHOSEN;
}
void PrintTextArray(u8 windowId, u8 fontId, u8 left, u8 top, u8 lineHeight, u8 itemCount, const struct MenuAction *strs)
@@ -763,7 +1189,7 @@ void sub_8198C34(const struct WindowTemplate *window, u8 fontId, u16 baseTileNum
s8 ProcessMenuInputNoWrap_(void)
{
s8 result = ProcessMenuInputNoWrapAround();
- if (result != -2)
+ if (result != MENU_NOTHING_CHOSEN)
sub_8198C78();
return result;
}
@@ -976,34 +1402,34 @@ s8 sub_8199284(void)
}
else if (gMain.newKeys & B_BUTTON)
{
- return -1;
+ return MENU_B_PRESSED;
}
else if (gMain.newKeys & DPAD_UP)
{
PlaySE(SE_SELECT);
sub_8199134(0, -1);
- return -2;
+ return MENU_NOTHING_CHOSEN;
}
else if (gMain.newKeys & DPAD_DOWN)
{
PlaySE(SE_SELECT);
sub_8199134(0, 1);
- return -2;
+ return MENU_NOTHING_CHOSEN;
}
else if (gMain.newKeys & DPAD_LEFT || GetLRKeysState() == 1)
{
PlaySE(SE_SELECT);
sub_8199134(-1, 0);
- return -2;
+ return MENU_NOTHING_CHOSEN;
}
else if (gMain.newKeys & DPAD_RIGHT || GetLRKeysState() == 2)
{
PlaySE(SE_SELECT);
sub_8199134(1, 0);
- return -2;
+ return MENU_NOTHING_CHOSEN;
}
- return -2;
+ return MENU_NOTHING_CHOSEN;
}
s8 sub_8199334(void)
@@ -1017,34 +1443,34 @@ s8 sub_8199334(void)
}
else if (gMain.newKeys & B_BUTTON)
{
- return -1;
+ return MENU_B_PRESSED;
}
else if (gMain.newKeys & DPAD_UP)
{
if (oldPos != sub_81991F8(0, -1))
PlaySE(SE_SELECT);
- return -2;
+ return MENU_NOTHING_CHOSEN;
}
else if (gMain.newKeys & DPAD_DOWN)
{
if (oldPos != sub_81991F8(0, 1))
PlaySE(SE_SELECT);
- return -2;
+ return MENU_NOTHING_CHOSEN;
}
else if (gMain.newKeys & DPAD_LEFT || GetLRKeysState() == 1)
{
if (oldPos != sub_81991F8(-1, 0))
PlaySE(SE_SELECT);
- return -2;
+ return MENU_NOTHING_CHOSEN;
}
else if (gMain.newKeys & DPAD_RIGHT || GetLRKeysState() == 2)
{
if (oldPos != sub_81991F8(1, 0))
PlaySE(SE_SELECT);
- return -2;
+ return MENU_NOTHING_CHOSEN;
}
- return -2;
+ return MENU_NOTHING_CHOSEN;
}
s8 sub_81993D8(void)
@@ -1056,34 +1482,34 @@ s8 sub_81993D8(void)
}
else if (gMain.newKeys & B_BUTTON)
{
- return -1;
+ return MENU_B_PRESSED;
}
else if ((gMain.newAndRepeatedKeys & DPAD_ANY) == DPAD_UP)
{
PlaySE(SE_SELECT);
sub_8199134(0, -1);
- return -2;
+ return MENU_NOTHING_CHOSEN;
}
else if ((gMain.newAndRepeatedKeys & DPAD_ANY) == DPAD_DOWN)
{
PlaySE(SE_SELECT);
sub_8199134(0, 1);
- return -2;
+ return MENU_NOTHING_CHOSEN;
}
else if ((gMain.newAndRepeatedKeys & DPAD_ANY) == DPAD_LEFT || sub_812210C() == 1)
{
PlaySE(SE_SELECT);
sub_8199134(-1, 0);
- return -2;
+ return MENU_NOTHING_CHOSEN;
}
else if ((gMain.newAndRepeatedKeys & DPAD_ANY) == DPAD_RIGHT || sub_812210C() == 2)
{
PlaySE(SE_SELECT);
sub_8199134(1, 0);
- return -2;
+ return MENU_NOTHING_CHOSEN;
}
- return -2;
+ return MENU_NOTHING_CHOSEN;
}
s8 sub_8199484(void)
@@ -1097,34 +1523,34 @@ s8 sub_8199484(void)
}
else if (gMain.newKeys & B_BUTTON)
{
- return -1;
+ return MENU_B_PRESSED;
}
else if ((gMain.newAndRepeatedKeys & DPAD_ANY) == DPAD_UP)
{
if (oldPos != sub_81991F8(0, -1))
PlaySE(SE_SELECT);
- return -2;
+ return MENU_NOTHING_CHOSEN;
}
else if ((gMain.newAndRepeatedKeys & DPAD_ANY) == DPAD_DOWN)
{
if (oldPos != sub_81991F8(0, 1))
PlaySE(SE_SELECT);
- return -2;
+ return MENU_NOTHING_CHOSEN;
}
else if ((gMain.newAndRepeatedKeys & DPAD_ANY) == DPAD_LEFT || sub_812210C() == 1)
{
if (oldPos != sub_81991F8(-1, 0))
PlaySE(SE_SELECT);
- return -2;
+ return MENU_NOTHING_CHOSEN;
}
else if ((gMain.newAndRepeatedKeys & DPAD_ANY) == DPAD_RIGHT || sub_812210C() == 2)
{
if (oldPos != sub_81991F8(1, 0))
PlaySE(SE_SELECT);
- return -2;
+ return MENU_NOTHING_CHOSEN;
}
- return -2;
+ return MENU_NOTHING_CHOSEN;
}
u8 InitMenuInUpperLeftCorner(u8 windowId, u8 itemCount, u8 initialCursorPos, bool8 APressMuted)
@@ -1498,7 +1924,7 @@ void sub_8199DF0(u32 bg, u8 a1, int a2, int a3)
RequestDma3Fill(a1 << 24 | a1 << 16 | a1 << 8 | a1, addr + VRAM, a3 * temp, 1);
}
-void box_print(u8 windowId, u8 fontId, u8 left, u8 top, const struct TextColor *color, s8 speed, const u8 *str)
+void box_print(u8 windowId, u8 fontId, u8 left, u8 top, const u8 *color, s8 speed, const u8 *str)
{
struct TextSubPrinter printer;
@@ -1512,14 +1938,14 @@ void box_print(u8 windowId, u8 fontId, u8 left, u8 top, const struct TextColor *
printer.letterSpacing = GetFontAttribute(fontId, 2);
printer.lineSpacing = GetFontAttribute(fontId, 3);
printer.fontColor_l = 0;
- printer.fgColor = color->bgColor;
- printer.bgColor = color->fgColor;
- printer.shadowColor = color->shadowColor;
-
+ printer.fgColor = color[1];
+ printer.bgColor = color[0];
+ printer.shadowColor = color[2];
+
AddTextPrinter(&printer, speed, NULL);
}
-void AddTextPrinterParameterized2(u8 windowId, u8 fontId, u8 left, u8 top, u8 letterSpacing, u8 lineSpacing, const struct TextColor *color, s8 speed, const u8 *str)
+void AddTextPrinterParameterized2(u8 windowId, u8 fontId, u8 left, u8 top, u8 letterSpacing, u8 lineSpacing, const u8 *color, s8 speed, const u8 *str)
{
struct TextSubPrinter printer;
@@ -1533,10 +1959,10 @@ void AddTextPrinterParameterized2(u8 windowId, u8 fontId, u8 left, u8 top, u8 le
printer.letterSpacing = letterSpacing;
printer.lineSpacing = lineSpacing;
printer.fontColor_l = 0;
- printer.fgColor = color->bgColor;
- printer.bgColor = color->fgColor;
- printer.shadowColor = color->shadowColor;
-
+ printer.fgColor = color[1];
+ printer.bgColor = color[0];
+ printer.shadowColor = color[2];
+
AddTextPrinter(&printer, speed, NULL);
}
@@ -1653,7 +2079,7 @@ void sub_819A080(struct UnkStruct_819A080 *a0, struct UnkStruct_819A080 *a1, u16
}
#else
__attribute__((naked))
-void sub_819A080(truct UnkStruct_819A080 *a0, struct UnkStruct_819A080 *a1, u16 a2, u16 a3, u16 a4, u16 a5, u16 a6, u16 a7)
+void sub_819A080(struct UnkStruct_819A080 *a0, struct UnkStruct_819A080 *a1, u16 a2, u16 a3, u16 a4, u16 a5, u16 a6, u16 a7)
{
asm("push {r4-r7,lr}\n\
mov r7, r10\n\
@@ -1940,3 +2366,49 @@ void blit_move_info_icon(u8 windowId, u8 iconId, u16 x, u16 y)
{
BlitBitmapRectToWindow(windowId, gFireRedMenuElements_Gfx + gUnknown_0860F0D4[iconId].unk3 * 32, 0, 0, 128, 128, x, y, gUnknown_0860F0D4[iconId].unk1, gUnknown_0860F0D4[iconId].unk2);
}
+
+void sub_819A344(u8 a0, u8 *a1, u8 a2)
+{
+ s32 curFlag;
+ s32 flagCount;
+ u8 *endOfString;
+ u8 *string = a1;
+
+ *(string++) = EXT_CTRL_CODE_BEGIN;
+ *(string++) = EXT_CTRL_CODE_COLOR;
+ *(string++) = a2;
+ *(string++) = EXT_CTRL_CODE_BEGIN;
+ *(string++) = EXT_CTRL_CODE_SHADOW;
+ *(string++) = a2 + 1;
+
+ switch (a0)
+ {
+ case 0:
+ StringCopy(string, gSaveBlock2Ptr->playerName);
+ break;
+ case 1:
+ if (IsNationalPokedexEnabled())
+ string = ConvertIntToDecimalStringN(string, pokedex_count(1), 0, 3);
+ else
+ string = ConvertIntToDecimalStringN(string, sub_80C0844(1), 0, 3);
+ *string = EOS;
+ break;
+ case 2:
+ string = ConvertIntToDecimalStringN(string, gSaveBlock2Ptr->playTimeHours, 0, 3);
+ *(string++) = CHAR_COLON;
+ ConvertIntToDecimalStringN(string, gSaveBlock2Ptr->playTimeMinutes, 2, 2);
+ break;
+ case 3:
+ sub_81245DC(string, gMapHeader.regionMapSectionId);
+ break;
+ case 4:
+ for (curFlag = FLAG_BADGE01_GET, flagCount = 0, endOfString = string + 1; curFlag <= FLAG_BADGE08_GET; curFlag++)
+ {
+ if (FlagGet(curFlag))
+ flagCount++;
+ }
+ *string = flagCount + CHAR_0;
+ *endOfString = EOS;
+ break;
+ }
+}
diff --git a/src/naming_screen.c b/src/naming_screen.c
index 9a5cec1e0..47d8b8ad1 100644
--- a/src/naming_screen.c
+++ b/src/naming_screen.c
@@ -5,7 +5,6 @@
#include "task.h"
#include "sprite.h"
#include "string_util.h"
-#include "new_menu_helpers.h"
#include "window.h"
#include "bg.h"
#include "gpu_regs.h"
@@ -1496,7 +1495,7 @@ static void TaskDummy3(void)
}
-static const struct TextColor sGenderColors[2] =
+static const u8 sGenderColors[2][3] =
{
{0, 9, 8},
{0, 5, 4}
@@ -1516,7 +1515,7 @@ static void sub_80E49BC(void)
StringCopy(genderSymbol, gText_FemaleSymbol);
isFemale = TRUE;
}
- box_print(gNamingScreenData->windows[2], 1, 0x68, 1, &sGenderColors[isFemale], -1, genderSymbol);
+ box_print(gNamingScreenData->windows[2], 1, 0x68, 1, sGenderColors[isFemale], -1, genderSymbol);
}
}
@@ -1661,19 +1660,18 @@ static void sub_80E4D10(void)
PutWindowTilemap(gNamingScreenData->windows[2]);
}
-static const struct AlignedTextColor sUnkColor1 =
+struct TextColorThing // needed because of alignment... it's so stupid
{
- 13, 1, 2
+ u8 colors[3][4];
};
-static const struct AlignedTextColor sUnkColor2 =
+static const struct TextColorThing sUnkColorStruct =
{
- 14, 1, 2
-};
-
-static const struct AlignedTextColor sUnkColor3 =
-{
- 15, 1, 2
+ {
+ {13, 1, 2},
+ {14, 1, 2},
+ {15, 1, 2}
+ }
};
static const u8 sFillValues[3] =
@@ -1681,11 +1679,11 @@ static const u8 sFillValues[3] =
0xEE, 0xDD, 0xFF
};
-static const struct AlignedTextColor *const sUnkColors[3] =
+static const u8 *const sUnkColors[3] =
{
- &sUnkColor2,
- &sUnkColor1,
- &sUnkColor3
+ sUnkColorStruct.colors[1],
+ sUnkColorStruct.colors[0],
+ sUnkColorStruct.colors[2]
};
static void sub_80E4DE4(u8 window, u8 a1)
@@ -1738,7 +1736,7 @@ static void sub_80E4E5C(void)
static void sub_80E4EF0(void)
{
- const struct TextColor color[] = { 15, 1, 2 };
+ const u8 color[3] = { 15, 1, 2 };
FillWindowPixelBuffer(gNamingScreenData->windows[4], 0xFF);
box_print(gNamingScreenData->windows[4], 0, 2, 1, color, 0, gText_MoveOkBack);
diff --git a/src/new_menu_helpers.c b/src/new_menu_helpers.c
deleted file mode 100644
index a4aad4058..000000000
--- a/src/new_menu_helpers.c
+++ /dev/null
@@ -1,437 +0,0 @@
-#include "global.h"
-#include "bg.h"
-#include "palette.h"
-#include "window.h"
-#include "text.h"
-#include "new_menu_helpers.h"
-#include "text_window.h"
-#include "menu.h"
-#include "menu_helpers.h"
-
-#define STD_WINDOW_PALETTE_NUM 14
-#define STD_WINDOW_BASE_TILE_NUM 0x214
-#define DLG_WINDOW_PALETTE_NUM 15
-#define DLG_WINDOW_BASE_TILE_NUM 0x200
-
-static EWRAM_DATA u8 gUnknown_0203CD8C = 0;
-static EWRAM_DATA u8 gUnknown_0203CD8D = 0;
-
-const u16 gUnknown_0860F074[] = INCBIN_U16("graphics/interface/860F074.gbapal");
-static const u8 gUnknown_0860F094[] = { 8, 4, 1 };
-
-static const struct WindowTemplate gUnknown_0860F098[] =
-{
- { 0x00, 0x02, 0x0F, 0x1B, 0x04, 0x0F, 0x194 },
- DUMMY_WIN_TEMPLATE
-};
-
-static const struct WindowTemplate gUnknown_0860F0A8 =
-{
- 0x00, 0x15, 0x09, 0x05, 0x04, 0x0F, 0x125
-};
-
-// Forward declarations
-extern void sub_81973A4(void);
-extern void DrawStandardFrame(u8, u8, u8, u8, u8, u8);
-extern void DrawDialogueFrame(u8, u8, u8, u8, u8, u8);
-extern void sub_81977BC(u8, u8, u8, u8, u8, u8);
-extern void sub_8197804(u8, u8, u8, u8, u8, u8);
-
-void sub_81971D0(void)
-{
- InitWindows(gUnknown_0860F098);
- gUnknown_0203CD8C = 0xFF;
- gUnknown_0203CD8D = 0xFF;
-}
-
-void sub_81971F4(void)
-{
- FreeAllWindowBuffers();
-}
-
-void sub_8197200(void)
-{
- ChangeBgX(0, 0, 0);
- ChangeBgY(0, 0, 0);
- DeactivateAllTextPrinters();
- sub_81973A4();
-}
-
-u16 sub_8197224(void)
-{
- RunTextPrinters();
- return IsTextPrinterActive(0);
-}
-
-u16 AddTextPrinterParameterized(u8 windowId, u8 fontId, const u8 *str, u8 speed, void (*callback)(struct TextSubPrinter *, u16), u8 fgColor, u8 bgColor, u8 shadowColor)
-{
- struct TextSubPrinter printer;
-
- printer.current_text_offset = str;
- printer.windowId = windowId;
- printer.fontId = fontId;
- printer.x = 0;
- printer.y = 1;
- printer.currentX = 0;
- printer.currentY = 1;
- printer.letterSpacing = 0;
- printer.lineSpacing = 0;
- printer.fontColor_l = 0;
- printer.fgColor = fgColor;
- printer.bgColor = bgColor;
- printer.shadowColor = shadowColor;
-
- gTextFlags.flag_1 = 0;
- return AddTextPrinter(&printer, speed, callback);
-}
-
-void AddTextPrinterForMessage(bool8 allowSkippingDelayWithButtonPress)
-{
- void (*callback)(struct TextSubPrinter *, u16) = NULL;
- gTextFlags.flag_0 = allowSkippingDelayWithButtonPress;
- AddTextPrinterParameterized(0, 1, gStringVar4, GetPlayerTextSpeed(), callback, 2, 1, 3);
-}
-
-void AddTextPrinterForMessage_2(bool8 allowSkippingDelayWithButtonPress)
-{
- gTextFlags.flag_0 = allowSkippingDelayWithButtonPress;
- AddTextPrinterParameterized(0, 1, gStringVar4, GetPlayerTextSpeed(), NULL, 2, 1, 3);
-}
-
-void AddTextPrinterWithCustomSpeedForMessage(bool8 allowSkippingDelayWithButtonPress, u8 speed)
-{
- gTextFlags.flag_0 = allowSkippingDelayWithButtonPress;
- AddTextPrinterParameterized(0, 1, gStringVar4, speed, NULL, 2, 1, 3);
-}
-
-void sub_81973A4(void)
-{
- copy_textbox_border_tile_patterns_to_vram(0, DLG_WINDOW_BASE_TILE_NUM, 0xF0);
- sub_809882C(0, STD_WINDOW_BASE_TILE_NUM, 0xE0);
-}
-
-void NewMenuHelpers_DrawDialogueFrame(u8 windowId, bool8 copyToVram)
-{
- CallWindowFunction(windowId, DrawDialogueFrame);
- FillWindowPixelBuffer(windowId, 0x11);
- PutWindowTilemap(windowId);
- if (copyToVram == TRUE)
- CopyWindowToVram(windowId, 3);
-}
-
-void NewMenuHelpers_DrawStdWindowFrame(u8 windowId, bool8 copyToVram)
-{
- CallWindowFunction(windowId, DrawStandardFrame);
- FillWindowPixelBuffer(windowId, 0x11);
- PutWindowTilemap(windowId);
- if (copyToVram == TRUE)
- CopyWindowToVram(windowId, 3);
-}
-
-void sub_8197434(u8 windowId, bool8 copyToVram)
-{
- CallWindowFunction(windowId, sub_8197804);
- FillWindowPixelBuffer(windowId, 0x11);
- ClearWindowTilemap(windowId);
- if (copyToVram == TRUE)
- CopyWindowToVram(windowId, 3);
-}
-
-void sub_819746C(u8 windowId, bool8 copyToVram)
-{
- CallWindowFunction(windowId, sub_81977BC);
- FillWindowPixelBuffer(windowId, 0x11);
- ClearWindowTilemap(windowId);
- if (copyToVram == TRUE)
- CopyWindowToVram(windowId, 3);
-}
-
-void DrawStandardFrame(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 paletteNum)
-{
- int i;
-
- FillBgTilemapBufferRect(bg,
- STD_WINDOW_BASE_TILE_NUM + 0,
- tilemapLeft - 1,
- tilemapTop - 1,
- 1,
- 1,
- STD_WINDOW_PALETTE_NUM);
- FillBgTilemapBufferRect(bg,
- STD_WINDOW_BASE_TILE_NUM + 1,
- tilemapLeft,
- tilemapTop - 1,
- width,
- 1,
- STD_WINDOW_PALETTE_NUM);
- FillBgTilemapBufferRect(bg,
- STD_WINDOW_BASE_TILE_NUM + 2,
- tilemapLeft + width,
- tilemapTop - 1,
- 1,
- 1,
- STD_WINDOW_PALETTE_NUM);
-
- for (i = tilemapTop; i < tilemapTop + height; i++)
- {
- FillBgTilemapBufferRect(bg,
- STD_WINDOW_BASE_TILE_NUM + 3,
- tilemapLeft - 1,
- i,
- 1,
- 1,
- STD_WINDOW_PALETTE_NUM);
- FillBgTilemapBufferRect(bg,
- STD_WINDOW_BASE_TILE_NUM + 5,
- tilemapLeft + width,
- i,
- 1,
- 1,
- STD_WINDOW_PALETTE_NUM);
- }
-
- FillBgTilemapBufferRect(bg,
- STD_WINDOW_BASE_TILE_NUM + 6,
- tilemapLeft - 1,
- tilemapTop + height,
- 1,
- 1,
- STD_WINDOW_PALETTE_NUM);
- FillBgTilemapBufferRect(bg,
- STD_WINDOW_BASE_TILE_NUM + 7,
- tilemapLeft,
- tilemapTop + height,
- width,
- 1,
- STD_WINDOW_PALETTE_NUM);
- FillBgTilemapBufferRect(bg,
- STD_WINDOW_BASE_TILE_NUM + 8,
- tilemapLeft + width,
- tilemapTop + height,
- 1,
- 1,
- STD_WINDOW_PALETTE_NUM);
-}
-
-void DrawDialogueFrame(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 paletteNum)
-{
- FillBgTilemapBufferRect(bg,
- DLG_WINDOW_BASE_TILE_NUM + 1,
- tilemapLeft - 2,
- tilemapTop - 1,
- 1,
- 1,
- DLG_WINDOW_PALETTE_NUM);
- FillBgTilemapBufferRect(bg,
- DLG_WINDOW_BASE_TILE_NUM + 3,
- tilemapLeft - 1,
- tilemapTop - 1,
- 1,
- 1,
- DLG_WINDOW_PALETTE_NUM);
- FillBgTilemapBufferRect(bg,
- DLG_WINDOW_BASE_TILE_NUM + 4,
- tilemapLeft,
- tilemapTop - 1,
- width - 1,
- 1,
- DLG_WINDOW_PALETTE_NUM);
- FillBgTilemapBufferRect(bg,
- DLG_WINDOW_BASE_TILE_NUM + 5,
- tilemapLeft + width - 1,
- tilemapTop - 1,
- 1,
- 1,
- DLG_WINDOW_PALETTE_NUM);
- FillBgTilemapBufferRect(bg,
- DLG_WINDOW_BASE_TILE_NUM + 6,
- tilemapLeft + width,
- tilemapTop - 1,
- 1,
- 1,
- DLG_WINDOW_PALETTE_NUM);
- FillBgTilemapBufferRect(bg,
- DLG_WINDOW_BASE_TILE_NUM + 7,
- tilemapLeft - 2,
- tilemapTop,
- 1,
- 5,
- DLG_WINDOW_PALETTE_NUM);
- FillBgTilemapBufferRect(bg,
- DLG_WINDOW_BASE_TILE_NUM + 9,
- tilemapLeft - 1,
- tilemapTop,
- width + 1,
- 5,
- DLG_WINDOW_PALETTE_NUM);
- FillBgTilemapBufferRect(bg,
- DLG_WINDOW_BASE_TILE_NUM + 10,
- tilemapLeft + width,
- tilemapTop,
- 1,
- 5,
- DLG_WINDOW_PALETTE_NUM);
- FillBgTilemapBufferRect(bg,
- BG_TILE_V_FLIP(DLG_WINDOW_BASE_TILE_NUM + 1),
- tilemapLeft - 2,
- tilemapTop + height,
- 1,
- 1,
- DLG_WINDOW_PALETTE_NUM);
- FillBgTilemapBufferRect(bg,
- BG_TILE_V_FLIP(DLG_WINDOW_BASE_TILE_NUM + 3),
- tilemapLeft - 1,
- tilemapTop + height,
- 1,
- 1,
- DLG_WINDOW_PALETTE_NUM);
- FillBgTilemapBufferRect(bg,
- BG_TILE_V_FLIP(DLG_WINDOW_BASE_TILE_NUM + 4),
- tilemapLeft,
- tilemapTop + height,
- width - 1,
- 1,
- DLG_WINDOW_PALETTE_NUM);
- FillBgTilemapBufferRect(bg,
- BG_TILE_V_FLIP(DLG_WINDOW_BASE_TILE_NUM + 5),
- tilemapLeft + width - 1,
- tilemapTop + height,
- 1,
- 1,
- DLG_WINDOW_PALETTE_NUM);
- FillBgTilemapBufferRect(bg,
- BG_TILE_V_FLIP(DLG_WINDOW_BASE_TILE_NUM + 6),
- tilemapLeft + width,
- tilemapTop + height,
- 1,
- 1,
- DLG_WINDOW_PALETTE_NUM);
-}
-
-void sub_81977BC(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 paletteNum)
-{
- FillBgTilemapBufferRect(bg, 0, tilemapLeft - 1, tilemapTop - 1, width + 2, height + 2, STD_WINDOW_PALETTE_NUM);
-}
-
-void sub_8197804(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 paletteNum)
-{
- FillBgTilemapBufferRect(bg, 0, tilemapLeft - 3, tilemapTop - 1, width + 6, height + 2, STD_WINDOW_PALETTE_NUM);
-}
-
-void SetStandardWindowBorderStyle(u8 windowId, bool8 copyToVram)
-{
- SetWindowBorderStyle(windowId, copyToVram, STD_WINDOW_BASE_TILE_NUM, STD_WINDOW_PALETTE_NUM);
-}
-
-void sub_819786C(u8 windowId, bool8 copyToVram)
-{
- copy_textbox_border_tile_patterns_to_vram(windowId, DLG_WINDOW_BASE_TILE_NUM, 0xF0);
- sub_8197B1C(windowId, copyToVram, DLG_WINDOW_BASE_TILE_NUM, 0xF);
-}
-
-void sub_819789C(void)
-{
- LoadPalette(gUnknown_0860F074, 0xE0, 0x14);
-}
-
-void sub_81978B0(u16 offset)
-{
- LoadPalette(gUnknown_0860F074, offset, 0x14);
-}
-
-const u16 *sub_81978C8(void)
-{
- return gUnknown_0860F074;
-}
-
-u16 sub_81978D0(u8 colorNum)
-{
- if (colorNum > 15)
- colorNum = 0;
- return gUnknown_0860F074[colorNum];
-}
-
-void DisplayItemMessageOnField(u8 taskId, const u8 *string, TaskFunc callback)
-{
- sub_81973A4();
- DisplayMessageAndContinueTask(taskId, 0, DLG_WINDOW_BASE_TILE_NUM, DLG_WINDOW_PALETTE_NUM, 1, GetPlayerTextSpeed(), string, callback);
- CopyWindowToVram(0, 3);
-}
-
-void sub_8197930(void)
-{
- CreateYesNoMenu(&gUnknown_0860F0A8, STD_WINDOW_BASE_TILE_NUM, STD_WINDOW_PALETTE_NUM, 0);
-}
-
-void sub_8197948(u8 initialCursorPos)
-{
- CreateYesNoMenu(&gUnknown_0860F0A8, STD_WINDOW_BASE_TILE_NUM, STD_WINDOW_PALETTE_NUM, initialCursorPos);
-}
-
-u32 sub_8197964(void)
-{
- if (gTextFlags.flag_3)
- return 1;
- return gSaveBlock2Ptr->optionsTextSpeed;
-}
-
-u8 GetPlayerTextSpeed(void)
-{
- u32 speed;
- if (gSaveBlock2Ptr->optionsTextSpeed > 2)
- gSaveBlock2Ptr->optionsTextSpeed = 1;
- speed = sub_8197964();
- return gUnknown_0860F094[speed];
-}
-
-u8 sub_81979C4(u8 a1)
-{
- if (gUnknown_0203CD8C == 0xFF)
- gUnknown_0203CD8C = sub_8198AA4(0, 0x16, 1, 7, (a1 * 2) + 2, 0xF, 0x139);
- return gUnknown_0203CD8C;
-}
-
-u8 GetStartMenuWindowId(void)
-{
- return gUnknown_0203CD8C;
-}
-
-void remove_start_menu_window_maybe(void)
-{
- if (gUnknown_0203CD8C != 0xFF)
- {
- RemoveWindow(gUnknown_0203CD8C);
- gUnknown_0203CD8C = 0xFF;
- }
-}
-
-u16 sub_8197A30(void)
-{
- return DLG_WINDOW_BASE_TILE_NUM;
-}
-
-u16 sub_8197A38(void)
-{
- return STD_WINDOW_BASE_TILE_NUM;
-}
-
-u8 AddMapNamePopUpWindow(void)
-{
- if (gUnknown_0203CD8D == 0xFF)
- gUnknown_0203CD8D = sub_8198AA4(0, 1, 1, 10, 3, 14, 0x107);
- return gUnknown_0203CD8D;
-}
-
-u8 GetMapNamePopUpWindowId(void)
-{
- return gUnknown_0203CD8D;
-}
-
-void RemoveMapNamePopUpWindow(void)
-{
- if (gUnknown_0203CD8D != 0xFF)
- {
- RemoveWindow(gUnknown_0203CD8D);
- gUnknown_0203CD8D = 0xFF;
- }
-}
diff --git a/src/pokeblock.c b/src/pokeblock.c
index 1a4ce3155..2623e12c4 100644
--- a/src/pokeblock.c
+++ b/src/pokeblock.c
@@ -6,7 +6,6 @@
#include "menu.h"
#include "task.h"
#include "menu_helpers.h"
-#include "new_menu_helpers.h"
#include "pokemon.h"
#include "graphics.h"
#include "malloc.h"
@@ -284,7 +283,7 @@ static const struct SpriteTemplate sSpriteTemplate_PokeblockCase =
SpriteCallbackDummy
};
-static const struct TextColor sTextColorInPokeblockMenu = {0, 2, 3};
+static const u8 sTextColorInPokeblockMenu[3] = {0, 2, 3};
static const struct Pokeblock sFavoritePokeblocksTable[] =
{
@@ -583,7 +582,7 @@ static void HandleInitWindows(void)
static void PrintOnPokeblockWindow(u8 windowId, const u8 *string, s32 x)
{
- AddTextPrinterParameterized2(windowId, 1, x, 1, 0, 0, &sTextColorInPokeblockMenu, 0, string);
+ AddTextPrinterParameterized2(windowId, 1, x, 1, 0, 0, sTextColorInPokeblockMenu, 0, string);
}
static void PutPokeblockInfoText(void)
diff --git a/src/pokeblock_feed.c b/src/pokeblock_feed.c
index d899e54f1..2039808cb 100644
--- a/src/pokeblock_feed.c
+++ b/src/pokeblock_feed.c
@@ -16,7 +16,6 @@
#include "event_data.h"
#include "strings.h"
#include "string_util.h"
-#include "new_menu_helpers.h"
#include "party_menu.h"
#include "m4a.h"
#include "sound.h"
diff --git a/src/pokemon_storage_system.c b/src/pokemon_storage_system.c
index bb196dd27..7f8c24ab7 100644
--- a/src/pokemon_storage_system.c
+++ b/src/pokemon_storage_system.c
@@ -71,7 +71,7 @@ static const union AffineAnimCmd *const sSpriteAffineAnimTable_8571730[] =
sSpriteAffineAnim_8571720
};
-const struct TextColor gUnknown_08571734[] = {4, 0xF, 0xE};
+const u8 gUnknown_08571734[] = {4, 0xF, 0xE};
const u8 gUnknown_08571737[] = _("/30");
// code
diff --git a/src/pokemon_summary_screen.c b/src/pokemon_summary_screen.c
index 4affd830d..e11ba881e 100644
--- a/src/pokemon_summary_screen.c
+++ b/src/pokemon_summary_screen.c
@@ -54,7 +54,7 @@ extern u16 gSummaryScreenWindow_Tilemap[];
extern struct ContestMove gContestMoves[];
extern struct ContestEffect gContestEffects[];
extern struct WindowTemplate gUnknown_0861CC24;
-extern struct TextColor gUnknown_0861CD2C[];
+extern u8 gUnknown_0861CD2C[][3];
extern const u8 gSpeciesNames[][POKEMON_NAME_LENGTH + 1];
extern u8 gText_MaleSymbol[];
extern u8 gText_FemaleSymbol[];
@@ -162,7 +162,7 @@ extern struct BattleMove gBattleMoves[];
extern u32 ChangeBgX(u8 bg, u32 value, u8 op);
extern void sub_8199C30(u8 a, u8 b, u8 c, u8 d, u8 e, u8 f);
-extern void AddTextPrinterParameterized2(u8 windowId, u8 fontId, u8 x, u8 y, u8 letterSpacing, u8 lineSpacing, struct TextColor* colors, s8 speed, u8 *str);
+extern void AddTextPrinterParameterized2(u8 windowId, u8 fontId, u8 x, u8 y, u8 letterSpacing, u8 lineSpacing, const u8* colors, s8 speed, u8 *str);
extern s32 GetStringCenterAlignXOffset(u8 fontId, u8 *str, s32 totalWidth);
extern s32 GetStringRightAlignXOffset(u8 fontId, u8 *str, s32 totalWidth);
extern bool8 sub_81A6BF4();
@@ -2557,7 +2557,7 @@ void sub_81C2554()
void sub_81C25A4(u8 a, u8 *b, u8 c, u8 d, u8 e, u8 f)
{
- AddTextPrinterParameterized2(a, 1, c, d, 0, e, &gUnknown_0861CD2C[f], 0, b);
+ AddTextPrinterParameterized2(a, 1, c, d, 0, e, gUnknown_0861CD2C[f], 0, b);
}
void sub_81C25E8()
diff --git a/src/save_failed_screen.c b/src/save_failed_screen.c
index 95897e721..b207d7e74 100644
--- a/src/save_failed_screen.c
+++ b/src/save_failed_screen.c
@@ -168,12 +168,12 @@ static bool8 WipeSectors(u32);
// although this is a general text printer, it's only used in this file.
static void SaveFailedScreenTextPrint(u8 *text, u8 var1, u8 var2)
{
- struct TextColor color;
+ u8 color[3];
- color.fgColor = 0;
- color.bgColor = 15;
- color.shadowColor = 3;
- AddTextPrinterParameterized2(gSaveFailedWindowIds[TEXT_WIN_ID], 1, var1 * 8, var2 * 8 + 1, 0, 0, &color, 0, text);
+ color[0] = 0;
+ color[1] = 15;
+ color[2] = 3;
+ AddTextPrinterParameterized2(gSaveFailedWindowIds[TEXT_WIN_ID], 1, var1 * 8, var2 * 8 + 1, 0, 0, color, 0, text);
}
void DoSaveFailedScreen(u8 saveType)
diff --git a/src/scrcmd.c b/src/scrcmd.c
index 5a4cc4591..ffdccdbe1 100644
--- a/src/scrcmd.c
+++ b/src/scrcmd.c
@@ -29,7 +29,6 @@
#include "menu.h"
#include "money.h"
#include "mystery_event_script.h"
-#include "new_menu_helpers.h"
#include "palette.h"
#include "party_menu.h"
#include "pokemon_3.h"
diff --git a/src/secret_base.c b/src/secret_base.c
index bf6bec1f8..359cc7aca 100644
--- a/src/secret_base.c
+++ b/src/secret_base.c
@@ -9,7 +9,6 @@
#include "window.h"
#include "menu.h"
#include "menu_helpers.h"
-#include "new_menu_helpers.h"
#include "menu_indicators.h"
#include "constants/maps.h"
#include "constants/songs.h"
diff --git a/src/window.c b/src/window.c
index 3913b5800..9a892d079 100644
--- a/src/window.c
+++ b/src/window.c
@@ -403,7 +403,7 @@ 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)
{
BlitBitmapRectToWindow(windowId, pixels, 0, 0, width, height, x, y, width, height);
}
diff --git a/sym_ewram.txt b/sym_ewram.txt
index 4765f6730..83b6d8886 100644
--- a/sym_ewram.txt
+++ b/sym_ewram.txt
@@ -1340,33 +1340,9 @@ gUnknown_0203CD80: @ 203CD80
gUnknown_0203CD88: @ 203CD88
.space 0x4
- .include "src/new_menu_helpers.o"
+ .include "src/menu.o"
.align 2
-gUnknown_0203CD90: @ 203CD90
- .space 0xC
-
-gUnknown_0203CD9C: @ 203CD9C
- .space 0x2
-
-gUnknown_0203CD9E: @ 203CD9E
- .space 0x1
-
-gUnknown_0203CD9F: @ 203CD9F
- .space 0x1
-
-gUnknown_0203CDA0: @ 203CDA0
- .space 0x4
-
-gUnknown_0203CDA4: @ 203CDA4
- .space 0x4
-
-gUnknown_0203CDA8: @ 203CDA8
- .space 0x4
-
-gUnknown_0203CDAC: @ 203CDAC
- .space 0x80
-
gUnknown_0203CE2C: @ 203CE2C
.space 0x4