summaryrefslogtreecommitdiff
path: root/include/text.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/text.h')
-rw-r--r--include/text.h100
1 files changed, 100 insertions, 0 deletions
diff --git a/include/text.h b/include/text.h
index 030d51188..192190490 100644
--- a/include/text.h
+++ b/include/text.h
@@ -11,6 +11,61 @@
#define PLACEHOLDER_BEGIN 0xFD // string placeholder
#define EOS 0xFF // end of string
+struct WindowConfig
+{
+ u8 bgNum;
+ u8 charBaseBlock;
+ u8 screenBaseBlock;
+ u8 priority;
+ u8 paletteNum;
+ u8 foregroundColor;
+ u8 backgroundColor;
+ u8 shadowColor;
+ u8 fontNum;
+ u8 textMode;
+ u8 spacing;
+ u8 tilemapLeft;
+ u8 tilemapTop;
+ u8 width;
+ u8 height;
+ u8 *tileData;
+ u16 *tilemap;
+ u32 maybeUnused;
+};
+
+struct Window
+{
+ u8 textMode;
+ u8 fontNum;
+ u8 charset;
+ u8 foregroundColor;
+ u8 backgroundColor;
+ u8 shadowColor;
+ u8 paletteNum;
+ u8 tilemapLeft;
+ u8 tilemapTop;
+ u8 width;
+ u8 height;
+ u8 win_field_B;
+ u8 win_field_C;
+ u8 delayCounter;
+ u8 spacing;
+ u8 win_field_F;
+ u8 cursorX;
+ u8 cursorY;
+ u8 left;
+ u16 top;
+ u16 state;
+ u16 downArrowCounter;
+ u16 tileDataStartOffset;
+ u16 tileDataOffset;
+ u16 textIndex;
+ u8 *text;
+ u8 *tileData;
+ u16 *tilemap;
+ struct WindowConfig *config;
+};
+
extern vu16 *const gBGControlRegs[];
extern vu16 *const gBGHOffsetRegs[];
extern vu16 *const gBGVOffsetRegs[];
@@ -75,7 +130,52 @@ extern const struct WindowConfig gWindowConfig_81E725C;
extern const struct WindowConfig gWindowConfig_81E7278;
extern const struct WindowConfig gWindowConfig_81E7294;
+void LoadFontDefaultPalette(const struct WindowConfig *winConfig);
+void SetUpWindowConfig(const struct WindowConfig *winConfig);
+u16 InitWindowTileData(struct Window *win, u16 startOffset);
+u32 MultistepInitWindowTileData(struct Window *win, u16 startOffset);
+bool32 MultistepLoadFont(void);
+void InitWindowFromConfig(struct Window *win, struct WindowConfig *winConfig);
+void InitWindow(struct Window *win, u8 *text, u16 tileDataStartOffset, u8 left, u8 top);
+void sub_8002E4C(struct Window *win, u8 *text, u16 tileDataStartOffset, u8 left, u16 top, u32 a6);
+void sub_8002E90(struct Window *win, u8 *text);
+void sub_8002EB0(struct Window *win, u8 *text, u16 tileDataStartOffset, u8 left, u8 top);
+u8 sub_8002F44(struct Window *win);
+u8 sub_8003418(struct Window *win);
+u8 sub_8003460(struct Window *win, u8 *text, u16 tileDataStartOffset, u8 left, u8 top);
+u8 sub_8003490(struct Window *win, u8 c, u16 tileDataStartOffset, u8 left, u8 top);
+void sub_80034D4(u8 *tileData, u8 *text);
+u8 sub_80034EC(u8 *str);
+u8 *sub_8003504(u8 *dest, s32 value, u8 alignAmount, u8 alignType);
+u8 *sub_8003558(u8 *dest, u8 *src, u8 alignAmount, u8 alignType);
+u8 sub_80035AC(struct Window *win);
+u8 sub_800374C(struct Window *win);
+u8 sub_8003778(struct Window *win);
+u8 sub_80037A0(struct Window *win);
+u8 sub_80037C8(struct Window *win, u8 lineLength);
+void ClearWindowTextLines(struct Window *win);
+u16 GetWindowTilemapEntry(struct Window *win, u8 x, u8 y);
+void DrawWindowRect(struct Window *win, u16 tilemapEntry, u8 left, u8 top, u8 right, u8 bottom);
+void DrawWindowRect_DefaultPalette(struct Window *win, u16 tileNum, u8 left, u8 top, u8 right, u8 bottom);
+void FillWindowRect(struct Window *win, u16 tilemapEntry, u8 left, u8 top, u8 right, u8 bottom);
+void FillWindowRect_DefaultPalette(struct Window *win, u16 tileNum, u8 left, u8 top, u8 right, u8 bottom);
+void ZeroFillWindowRect(struct Window *win, u8 left, u8 top, u8 right, u8 bottom);
+void FillWindowRectWithBlankTile(struct Window *win, u8 left, u8 top, u8 right, u8 bottom);
u8 GetExtCtrlCodeLength(u8 code);
+u8 *AlignInt1(struct Window *win, u8 *dest, s32 value, u8 alignAmount, u8 alignType);
+u8 *AlignInt2(struct Window *win, u8 *dest, s32 value, u8 alignAmount, u8 alignType);
+u8 *AlignString(struct Window *win, u8 *dest, u8 *src, u8 alignAmount, u8 alignType);
+u8 GetStringWidth(struct Window *win, u8 *s);
+u8 sub_8004D04(struct Window *win, u8 *text, u16 tileDataStartOffset, u8 left, u16 top, u32 a6);
+u8 sub_8004D38(struct Window *win, u8 *text, u16 tileDataStartOffset, u8 left, u8 top);
+u8 sub_8004DB0(struct Window *win, u8 *text, u16 tileDataStartOffset, u8 left, u8 top, u16 a6);
+u8 sub_8004E24(struct Window *win);
+void sub_8004E28(struct Window *win, u8 *foreground, u8 *background, u8 *shadow);
+void sub_8004E3C(struct WindowConfig *winConfig, u8 *tileData, u8 *text);
+u8 GetStringWidthGivenWindowConfig(struct WindowConfig *winConfig, u8 *s);
void ConvertInternationalString(u8 *s, u8 language);
+void SkipExtCtrlCodes(u8 *str);
+s32 StringCompareWithoutExtCtrlCodes(u8 *str1, u8 *str2);
+u8 sub_8004FD0(struct Window *win, u8 *dest, u8 *src, u16 tileDataStartOffset, u8 left, u16 top, u8 a7, u32 a8);
#endif // GUARD_TEXT_H