diff options
author | Slawter666 <38655737+Slawter666@users.noreply.github.com> | 2018-11-12 14:14:50 +0000 |
---|---|---|
committer | Slawter666 <38655737+Slawter666@users.noreply.github.com> | 2018-11-12 14:14:50 +0000 |
commit | 1b895ff52c011d51a9516791148cd5088ba411b5 (patch) | |
tree | 3f1dee86f96098d38131426e11a0f9c39a1244fe /include/text.h | |
parent | be33878b94cc38913447682d3e34e674df68619f (diff) | |
parent | 65f053fd89e09b13e407ac53488043b728660e6e (diff) |
Merge branch 'master' of https://github.com/pret/pokeemerald into synchronise
Diffstat (limited to 'include/text.h')
-rw-r--r-- | include/text.h | 77 |
1 files changed, 39 insertions, 38 deletions
diff --git a/include/text.h b/include/text.h index f677f2ced..4946f1c5f 100644 --- a/include/text.h +++ b/include/text.h @@ -114,7 +114,7 @@ enum { FONTATTR_MAX_LETTER_HEIGHT, FONTATTR_LETTER_SPACING, FONTATTR_LINE_SPACING, - FONTATTR_COLOR_LOWNIBBLE, // dunno what this is yet + FONTATTR_UNKNOWN, // dunno what this is yet FONTATTR_COLOR_FOREGROUND, FONTATTR_COLOR_BACKGROUND, FONTATTR_COLOR_SHADOW @@ -122,23 +122,18 @@ enum { 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; + u8 glyphId:4; // 0x14 + bool8 hasPrintBeenSpedUp:1; + u8 unk:3; + u8 downArrowDelay:5; + u8 downArrowYPosIdx:2; + bool8 hasGlyphIdBeenSet:1; + u8 autoScrollDelay; }; -struct TextSubPrinter // TODO: Better name +struct TextPrinterTemplate { - const u8* current_text_offset; + const u8* currentChar; u8 windowId; u8 fontId; u8 x; @@ -147,7 +142,7 @@ struct TextSubPrinter // TODO: Better name u8 currentY; u8 letterSpacing; u8 lineSpacing; - u8 fontColor_l:4; // 0xC + u8 unk:4; // 0xC u8 fgColor:4; u8 bgColor:4; u8 shadowColor:4; @@ -155,18 +150,18 @@ struct TextSubPrinter // TODO: Better name struct TextPrinter { - struct TextSubPrinter subPrinter; + struct TextPrinterTemplate printerTemplate; - void (*callback)(struct TextSubPrinter *, u16); // 0x10 + void (*callback)(struct TextPrinterTemplate *, u16); // 0x10 - union { + union __attribute__((packed)) { struct TextPrinterSubStruct sub; + u8 fields[7]; + } subUnion; - u8 sub_fields[8]; - } sub_union; - + u8 active; u8 state; // 0x1C - u8 text_speed; + u8 textSpeed; u8 delayCounter; u8 scrollDistance; u8 minLetterSpacing; // 0x20 @@ -180,7 +175,7 @@ struct FontInfo u8 maxLetterHeight; u8 letterSpacing; u8 lineSpacing; - u8 fontColor_l:4; + u8 unk:4; u8 fgColor:4; u8 bgColor:4; u8 shadowColor:4; @@ -190,24 +185,34 @@ extern const struct FontInfo *gFonts; struct GlyphWidthFunc { - u32 font_id; + u32 fontId; u32 (*func)(u16 glyphId, bool32 isJapanese); }; struct KeypadIcon { - u16 tile_offset; + u16 tileOffset; u8 width; u8 height; }; typedef struct { - u8 flag_0:1; - u8 flag_1:1; - u8 flag_2:1; - u8 flag_3:1; + bool8 canABSpeedUpPrint:1; + bool8 useAlternateDownArrow:1; + bool8 autoScroll:1; + bool8 forceMidTextSpeed:1; } TextFlags; +struct Struct_03002F90 +{ + u8 unk0[0x20]; + u8 unk20[0x20]; + u8 unk40[0x20]; + u8 unk60[0x20]; + u8 unk80; + u8 unk81; +}; + extern TextFlags gTextFlags; extern u8 gStringVar1[]; @@ -215,17 +220,13 @@ 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]; +extern u8 gUnknown_03002F84; +extern struct Struct_03002F90 gUnknown_03002F90; void SetFontsPointer(const struct FontInfo *fonts); void DeactivateAllTextPrinters(void); -u16 AddTextPrinterParameterized(u8 windowId, u8 fontId, const 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)); +u16 AddTextPrinterParameterized(u8 windowId, u8 fontId, const u8 *str, u8 x, u8 y, u8 speed, void (*callback)(struct TextPrinterTemplate *, u16)); +bool16 AddTextPrinter(struct TextPrinterTemplate *template, u8 speed, void (*callback)(struct TextPrinterTemplate *, u16)); void RunTextPrinters(void); bool16 IsTextPrinterActive(u8 id); u32 RenderFont(struct TextPrinter *textPrinter); |