From c5dddf41f58446139b52d3b60cb8738052e4a084 Mon Sep 17 00:00:00 2001 From: scnorton Date: Mon, 18 Sep 2017 11:26:45 -0400 Subject: sub_81BF5A4 --- include/text.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include/text.h') diff --git a/include/text.h b/include/text.h index 73e6e5437..c61f6cc98 100644 --- a/include/text.h +++ b/include/text.h @@ -186,9 +186,9 @@ bool8 TextPrinterWaitWithDownArrow(struct TextPrinter *textPrinter); bool8 TextPrinterWait(struct TextPrinter *textPrinter); void DrawDownArrow(u8 windowId, u16 x, u16 y, u8 bgColor, bool8 drawArrow, u8 *counter, u8 *yCoordIndex); u16 RenderText(struct TextPrinter *textPrinter); -u32 GetStringWidthFixedWidthFont(u8 *str, u8 fontId, u8 letterSpacing); +u32 GetStringWidthFixedWidthFont(const u8 *str, u8 fontId, u8 letterSpacing); u32 (*GetFontWidthFunc(u8 glyphId))(u16, bool32); -s32 GetStringWidth(u8 fontId, u8 *str, s16 letterSpacing); +u32 GetStringWidth(u8 fontId, const u8 *str, s16 letterSpacing); u8 RenderTextFont9(u8 *pixels, u8 fontId, u8 *str); u8 DrawKeypadIcon(u8 windowId, u8 keypadIconId, u16 x, u16 y); u8 GetKeypadIconTileOffset(u8 keypadIconId); -- cgit v1.2.3 From c253bf5e75796c462fe5e389c7e8f6040f826c0f Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Mon, 18 Sep 2017 18:36:05 +0200 Subject: add important headers, const ptrs and egg hatch start --- include/text.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/text.h') diff --git a/include/text.h b/include/text.h index 73e6e5437..5aadaac32 100644 --- a/include/text.h +++ b/include/text.h @@ -155,7 +155,7 @@ extern u8 gStringVar3[]; extern u8 gStringVar4[]; void SetFontsPointer(const struct FontInfo *fonts); -void DeactivateAllTextPrinters (void); +void DeactivateAllTextPrinters(void); u16 PrintTextOnWindow(u8 windowId, u8 fontId, u8 *str, u8 x, u8 y, u8 speed, void (*callback)(struct TextSubPrinter *, u16)); bool16 AddTextPrinter(struct TextSubPrinter *textSubPrinter, u8 speed, void (*callback)(struct TextSubPrinter *, u16)); void RunTextPrinters(void); -- cgit v1.2.3 From 2e7127284f98cb4c8c02b1a41a19fdc73ed4eb79 Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Mon, 18 Sep 2017 23:48:47 +0200 Subject: egg hatch almost decompiled --- include/text.h | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'include/text.h') diff --git a/include/text.h b/include/text.h index 5aadaac32..f584b61ea 100644 --- a/include/text.h +++ b/include/text.h @@ -138,17 +138,26 @@ struct FontInfo u8 shadowColor:4; }; -struct GlyphWidthFunc{ +struct GlyphWidthFunc +{ u32 font_id; u32 (*func)(u16 glyphId, bool32 isJapanese); }; -struct KeypadIcon { +struct KeypadIcon +{ u16 tile_offset; u8 width; u8 height; }; +struct __attribute__((packed)) TextColor +{ + u8 fgColor; + u8 bgColor; + u8 shadowColor; +}; + extern u8 gStringVar1[]; extern u8 gStringVar2[]; extern u8 gStringVar3[]; @@ -159,7 +168,7 @@ void DeactivateAllTextPrinters(void); u16 PrintTextOnWindow(u8 windowId, u8 fontId, u8 *str, u8 x, u8 y, u8 speed, void (*callback)(struct TextSubPrinter *, u16)); bool16 AddTextPrinter(struct TextSubPrinter *textSubPrinter, u8 speed, void (*callback)(struct TextSubPrinter *, u16)); void RunTextPrinters(void); -bool8 IsTextPrinterActive(u8 id); +bool16 IsTextPrinterActive(u8 id); u32 RenderFont(struct TextPrinter *textPrinter); void GenerateFontHalfRowLookupTable(u8 fgColor, u8 bgColor, u8 shadowColor); void SaveTextColors(u8 *fgColor, u8 *bgColor, u8 *shadowColor); -- cgit v1.2.3 From 15212c4f8d80b4e15b20d0594d890fe1e803bc0e Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Thu, 21 Sep 2017 23:43:13 -0400 Subject: Font6Func --- include/text.h | 52 ++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 36 insertions(+), 16 deletions(-) (limited to 'include/text.h') diff --git a/include/text.h b/include/text.h index c61f6cc98..a7a79da7a 100644 --- a/include/text.h +++ b/include/text.h @@ -78,6 +78,22 @@ #define NUM_TEXT_PRINTERS 32 +struct TextPrinterSubStruct +{ + u8 font_type:4; // 0x14 + u8 font_type_upper:1; + u8 font_type_5:3; + u8 field_1:5; + u8 field_1_upmid:2; + u8 field_1_top:1; + u8 frames_visible_counter; + u8 field_3; + u8 field_4; // 0x18 + u8 field_5; + u8 field_6; + u8 active; +}; + struct TextPrinter { struct TextSubPrinter { // TODO: Better name @@ -99,20 +115,7 @@ struct TextPrinter void (*callback)(struct TextSubPrinter *, u16); // 0x10 union { - struct TextPrinterSubStruct - { - u8 font_type:4; // 0x14 - u8 font_type_upper:4; - u8 field_1:5; - u8 field_1_upmid:2; - u8 field_1_top:1; - u8 frames_visible_counter; - u8 field_3; - u8 field_4; // 0x18 - u8 field_5; - u8 field_6; - u8 active; - } sub; + struct TextPrinterSubStruct sub; u8 sub_fields[8]; } sub_union; @@ -138,6 +141,8 @@ struct FontInfo u8 shadowColor:4; }; +extern const struct FontInfo *gFonts; + struct GlyphWidthFunc{ u32 font_id; u32 (*func)(u16 glyphId, bool32 isJapanese); @@ -149,11 +154,26 @@ struct KeypadIcon { u8 height; }; +typedef struct { + u8 flag_0:1; + u8 flag_1:1; + u8 flag_2:1; +} TextFlags; + +extern TextFlags gTextFlags; + extern u8 gStringVar1[]; extern u8 gStringVar2[]; extern u8 gStringVar3[]; extern u8 gStringVar4[]; +u8 gUnknown_03002F84; +u8 gUnknown_03002F90[0x20]; +u8 gUnknown_03002FB0[0x20]; +u8 gUnknown_03002FD0[0x20]; +u8 gUnknown_03002FF0[0x20]; +u8 gGlyphDimensions[0x2]; + void SetFontsPointer(const struct FontInfo *fonts); void DeactivateAllTextPrinters (void); u16 PrintTextOnWindow(u8 windowId, u8 fontId, u8 *str, u8 x, u8 y, u8 speed, void (*callback)(struct TextSubPrinter *, u16)); @@ -182,8 +202,8 @@ void TextPrinterInitDownArrowCounters(struct TextPrinter *textPrinter); void TextPrinterDrawDownArrow(struct TextPrinter *textPrinter); void TextPrinterClearDownArrow(struct TextPrinter *textPrinter); bool8 TextPrinterWaitAutoMode(struct TextPrinter *textPrinter); -bool8 TextPrinterWaitWithDownArrow(struct TextPrinter *textPrinter); -bool8 TextPrinterWait(struct TextPrinter *textPrinter); +bool16 TextPrinterWaitWithDownArrow(struct TextPrinter *textPrinter); +bool16 TextPrinterWait(struct TextPrinter *textPrinter); void DrawDownArrow(u8 windowId, u16 x, u16 y, u8 bgColor, bool8 drawArrow, u8 *counter, u8 *yCoordIndex); u16 RenderText(struct TextPrinter *textPrinter); u32 GetStringWidthFixedWidthFont(const u8 *str, u8 fontId, u8 letterSpacing); -- cgit v1.2.3 From 4cf115000289d10de3408e752b37128446dd261c Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Fri, 22 Sep 2017 21:26:37 -0400 Subject: clion pls --- include/text.h | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) (limited to 'include/text.h') diff --git a/include/text.h b/include/text.h index a7a79da7a..fc8ffa82f 100644 --- a/include/text.h +++ b/include/text.h @@ -94,23 +94,25 @@ struct TextPrinterSubStruct u8 active; }; +struct TextSubPrinter { // TODO: Better name + u8* current_text_offset; + u8 windowId; + u8 fontId; + u8 x; + u8 y; + u8 currentX; // 0x8 + u8 currentY; + u8 letterSpacing; + u8 lineSpacing; + u8 fontColor_l:4; // 0xC + u8 fontColor_h:4; + u8 bgColor:4; + u8 shadowColor:4; +}; + struct TextPrinter { - struct TextSubPrinter { // TODO: Better name - u8* current_text_offset; - u8 windowId; - u8 fontId; - u8 x; - u8 y; - u8 currentX; // 0x8 - u8 currentY; - u8 letterSpacing; - u8 lineSpacing; - u8 fontColor_l:4; // 0xC - u8 fontColor_h:4; - u8 bgColor:4; - u8 shadowColor:4; - } subPrinter; + struct TextSubPrinter subPrinter; void (*callback)(struct TextSubPrinter *, u16); // 0x10 -- cgit v1.2.3 From 52a951276f8d4b79195a0d4889503e4a7f096024 Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Mon, 25 Sep 2017 00:09:13 +0200 Subject: battle 4, up to x69 --- include/text.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'include/text.h') diff --git a/include/text.h b/include/text.h index dba409f37..f0c85b978 100644 --- a/include/text.h +++ b/include/text.h @@ -71,7 +71,9 @@ #define EXT_CTRL_CODE_BEGIN 0xFC // extended control code #define PLACEHOLDER_BEGIN 0xFD // string placeholder #define CHAR_NEWLINE 0xFE -#define EOS 0xFF // end of string +#define EOS 0xFF // end of string + +// battle placeholders are located in battle_message.h #define EXT_CTRL_CODE_JPN 0x15 #define EXT_CTRL_CODE_ENG 0x16 -- cgit v1.2.3 From d769ec137447c52062b48153851bd2824055b6df Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Tue, 26 Sep 2017 22:39:59 +0200 Subject: battle 4 up to a8 --- include/text.h | 38 +++++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 15 deletions(-) (limited to 'include/text.h') diff --git a/include/text.h b/include/text.h index f0c85b978..88f2cc0e2 100644 --- a/include/text.h +++ b/include/text.h @@ -65,6 +65,7 @@ #define CHAR_x 0xEC #define CHAR_y 0xED #define CHAR_z 0xEE +#define CHAR_SPECIAL_F9 0xF9 #define CHAR_COLON 0xF0 #define CHAR_PROMPT_SCROLL 0xFA // waits for button press and scrolls dialog #define CHAR_PROMPT_CLEAR 0xFB // waits for button press and clears dialog @@ -73,6 +74,10 @@ #define CHAR_NEWLINE 0xFE #define EOS 0xFF // end of string +#define TEXT_COLOR_TRANSPARENT 0x0 +#define TEXT_COLOR_WHITE 0x1 +#define TEXT_COLOR_DARK_GREY 0x2 + // battle placeholders are located in battle_message.h #define EXT_CTRL_CODE_JPN 0x15 @@ -80,23 +85,26 @@ #define NUM_TEXT_PRINTERS 32 +struct TextSubPrinter // TODO: Better name +{ + u8* current_text_offset; + u8 windowId; + u8 fontId; + u8 x; + u8 y; + u8 currentX; // 0x8 + u8 currentY; + u8 letterSpacing; + u8 lineSpacing; + u8 fontColor_l:4; // 0xC + u8 fontColor_h:4; + u8 bgColor:4; + u8 shadowColor:4; +}; + struct TextPrinter { - struct TextSubPrinter { // TODO: Better name - u8* current_text_offset; - u8 windowId; - u8 fontId; - u8 x; - u8 y; - u8 currentX; // 0x8 - u8 currentY; - u8 letterSpacing; - u8 lineSpacing; - u8 fontColor_l:4; // 0xC - u8 fontColor_h:4; - u8 bgColor:4; - u8 shadowColor:4; - } subPrinter; + struct TextSubPrinter subPrinter; void (*callback)(struct TextSubPrinter *, u16); // 0x10 -- cgit v1.2.3