diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/event_object_movement.h | 2 | ||||
| -rw-r--r-- | include/gba/io_reg.h | 29 | ||||
| -rw-r--r-- | include/link.h | 2 | ||||
| -rw-r--r-- | include/list_menu.h | 66 | ||||
| -rw-r--r-- | include/palette.h | 14 | ||||
| -rw-r--r-- | include/sprite.h | 37 | ||||
| -rw-r--r-- | include/text.h | 11 | ||||
| -rw-r--r-- | include/text_window.h | 4 | 
8 files changed, 107 insertions, 58 deletions
| diff --git a/include/event_object_movement.h b/include/event_object_movement.h index 8a1749b0b..4458f9347 100644 --- a/include/event_object_movement.h +++ b/include/event_object_movement.h @@ -351,7 +351,7 @@ void TrySpawnEventObjects(s16, s16);  u8 sprite_new(u8, u8, s16, s16, u8, u8);  u8 AddPseudoEventObject(u16, void (*)(struct Sprite *), s16, s16, u8);  u8 show_sprite(u8, u8, u8); -u8 SpawnSpecialEventObjectParametrized(u8, u8, u8, s16, s16, u8); +u8 SpawnSpecialEventObjectParameterized(u8, u8, u8, s16, s16, u8);  u8 SpawnSpecialEventObject(struct EventObjectTemplate *);  void sub_8093038(s16, s16, s16 *, s16 *);  void CameraObjectReset1(void); diff --git a/include/gba/io_reg.h b/include/gba/io_reg.h index 03fe505b5..6498c6a99 100644 --- a/include/gba/io_reg.h +++ b/include/gba/io_reg.h @@ -545,6 +545,35 @@  #define BGCNT_AFF512x512        0x8000  #define BGCNT_AFF1024x1024      0xC000 +// WININ/OUT +#define WININ_WIN0_BG0      (1 << 0) +#define WININ_WIN0_BG1      (1 << 1) +#define WININ_WIN0_BG2      (1 << 2) +#define WININ_WIN0_BG3      (1 << 3) +#define WININ_WIN0_OBJ      (1 << 4) +#define WININ_WIN0_CLR      (1 << 5) +#define WININ_WIN1_BG0      (1 << 8) +#define WININ_WIN1_BG1      (1 << 9) +#define WININ_WIN1_BG2      (1 << 10) +#define WININ_WIN1_BG3      (1 << 11) +#define WININ_WIN1_OBJ      (1 << 12) +#define WININ_WIN1_CLR      (1 << 13) + +#define WINOUT_WIN01_BG0    (1 << 0) +#define WINOUT_WIN01_BG1    (1 << 1) +#define WINOUT_WIN01_BG2    (1 << 2) +#define WINOUT_WIN01_BG3    (1 << 3) +#define WINOUT_WIN01_OBJ    (1 << 4) +#define WINOUT_WIN01_CLR    (1 << 5) +#define WINOUT_WINOBJ_BG0   (1 << 8) +#define WINOUT_WINOBJ_BG1   (1 << 9) +#define WINOUT_WINOBJ_BG2   (1 << 10) +#define WINOUT_WINOBJ_BG3   (1 << 11) +#define WINOUT_WINOBJ_OBJ   (1 << 12) +#define WINOUT_WINOBJ_CLR   (1 << 13) + +#define WINHV_COORDS(m, n)     (((m) << 8) | (n)) +  // BLDCNT  // Bits 0-5 select layers for the 1st target  #define BLDCNT_TGT1_BG0      (1 << 0) diff --git a/include/link.h b/include/link.h index 5b3cd26ca..afc5008e6 100644 --- a/include/link.h +++ b/include/link.h @@ -201,7 +201,7 @@ extern u32 gLinkStatus;  void c2_mystery_gift(void);  void sub_801867C(void); -bool8 sub_80093CC(void); +bool8 IsWirelessAdapterConnected(void);  void Task_DestroySelf(u8 taskId);  void OpenLink(void);  void CloseLink(void); diff --git a/include/list_menu.h b/include/list_menu.h index d8b526b61..d38980213 100644 --- a/include/list_menu.h +++ b/include/list_menu.h @@ -3,11 +3,19 @@  #define LIST_NOTHING_CHOSEN -1  #define LIST_B_PRESSED -2 +#define LIST_HEADER -3  #define LIST_NO_MULTIPLE_SCROLL     0  #define LIST_MULTIPLE_SCROLL_DPAD   1  #define LIST_MULTIPLE_SCROLL_L_R    2 +enum { +    SCROLL_ARROW_LEFT, +    SCROLL_ARROW_RIGHT, +    SCROLL_ARROW_UP, +    SCROLL_ARROW_DOWN +}; +  struct ListMenu;  struct ListMenuItem @@ -19,20 +27,20 @@ struct ListMenuItem  struct ListMenuTemplate  {      const struct ListMenuItem *items; -    void (* moveCursorFunc)(s32, bool8, struct ListMenu *); -    void (* unk_08)(u8 windowId, s32 itemId, u8 y); +    void (* moveCursorFunc)(s32 itemIndex, bool8 onInit, struct ListMenu *list); +    void (* itemPrintFunc)(u8 windowId, s32 itemId, u8 y);      u16 totalItems;      u16 maxShowed;      u8 windowId; -    u8 unk_11; -    u8 unk_12; +    u8 header_X; +    u8 item_X;      u8 cursor_X;      u8 upText_Y:4; // x1, x2, x4, x8 = xF      u8 cursorPal:4; // x10, x20, x40, x80 = xF0      u8 fillValue:4; // x1, x2, x4, x8 = xF      u8 cursorShadowPal:4; // x10, x20, x40, x80 = xF0      u8 lettersSpacing:3; -    u8 unk_16_3:3; +    u8 itemVerticalPadding:3;      u8 scrollMultiple:2; // x40, x80 = xC0      u8 fontId:6; // x1, x2, x4, x8, x10, x20 = x3F      u8 cursorKind:2; // x40, x80 @@ -45,11 +53,11 @@ struct ListMenu      u16 selectedRow;      u8 unk_1C;      u8 unk_1D; -    u8 unk_1E; +    u8 taskId;      u8 unk_1F;  }; -struct UnknownListMenuWindowStruct +struct ListMenuWindowRect  {      u8 x;      u8 y; @@ -58,16 +66,16 @@ struct UnknownListMenuWindowStruct      u8 palNum;  }; -struct ArrowStruct +struct ScrollArrowsTemplate  { -    u8 unk0; -    u8 unk1; -    u8 unk2; -    u8 unk3; -    u8 unk4; -    u8 unk5; -    u16 unk6; -    u16 unk8; +    u8 firstArrowType; +    u8 firstX; +    u8 firstY; +    u8 secondArrowType; +    u8 secondX; +    u8 secondY; +    u16 fullyUpThreshold; +    u16 fullyDownThreshold;      u16 tileTag;      u16 palTag;      u8 palNum; @@ -75,36 +83,36 @@ struct ArrowStruct  struct CursorStruct  { -    u8 unk0; -    u8 unk1; -    u16 unk2; -    u16 unk4; +    u8 left; +    u8 top; +    u16 rowWidth; +    u16 rowHeight;      u16 tileTag;      u16 palTag;      u8 palNum;  }; -extern struct ArrowStruct gUnknown_0203CE8C; +extern struct ScrollArrowsTemplate gTempScrollArrowTemplate;  extern struct ListMenuTemplate gMultiuseListMenuTemplate;  s32 DoMysteryGiftListMenu(struct WindowTemplate *windowTemplate, struct ListMenuTemplate *listMenuTemplate, u8 arg2, u16 tileNum, u16 palNum);  u8 ListMenuInit(struct ListMenuTemplate *listMenuTemplate, u16 scrollOffset, u16 selectedRow); -u8 ListMenuInitWithWindows(struct ListMenuTemplate *listMenuTemplate, struct UnknownListMenuWindowStruct *arg1, u16 scrollOffset, u16 selectedRow); +u8 ListMenuInitInRect(struct ListMenuTemplate *listMenuTemplate, struct ListMenuWindowRect *arg1, u16 scrollOffset, u16 selectedRow);  s32 ListMenuHandleInputGetItemId(u8 listTaskId);  void DestroyListMenuTask(u8 listTaskId, u16 *scrollOffset, u16 *selectedRow); -void sub_81AE70C(u8 listTaskId); +void RedrawListMenu(u8 listTaskId);  void ChangeListMenuPals(u8 listTaskId, u8 cursorPal, u8 fillValue, u8 cursorShadowPal);  void ChangeListMenuCoords(u8 listTaskId, u8 x, u8 y);  s32 ListMenuTestInput(struct ListMenuTemplate *template, u32 scrollOffset, u32 selectedRow, u16 keys, u16 *newScrollOffset, u16 *newSelectedRow);  void ListMenuGetCurrentItemArrayId(u8 listTaskId, u16 *arrayId);  void ListMenuGetScrollAndRow(u8 listTaskId, u16 *scrollOffset, u16 *selectedRow);  u16 ListMenuGetYCoordForPrintingArrowCursor(u8 listTaskId); -void sub_81AF028(u8 cursorPal, u8 fillValue, u8 cursorShadowPal); -void sub_81AF078(s32 arg0, u8 arg1, struct ListMenu *list); -s32 sub_81AF08C(u8 taskId, u8 field); -void sub_81AF15C(u8 taskId, u8 field, s32 value); -u8 AddScrollIndicatorArrowPair(const struct ArrowStruct *arrowInfo, u16 *arg1); -u8 AddScrollIndicatorArrowPairParametrized(u32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4, s32 tileTag, s32 palTag, void *arg7); +void ListMenuOverrideSetColors(u8 cursorPal, u8 fillValue, u8 cursorShadowPal); +void ListMenuDefaultCursorMoveFunc(s32 arg0, u8 arg1, struct ListMenu *list); +s32 ListMenuGetUnkIndicatorsStructFields(u8 taskId, u8 field); +void ListMenuSetUnkIndicatorsStructField(u8 taskId, u8 field, s32 value); +u8 AddScrollIndicatorArrowPair(const struct ScrollArrowsTemplate *arrowInfo, u16 *arg1); +u8 AddScrollIndicatorArrowPairParameterized(u32 arrowType, s32 commonPos, s32 firstPos, s32 secondPos, s32 fullyDownThreshold, s32 tileTag, s32 palTag, u16 *currItemPtr);  void RemoveScrollIndicatorArrowPair(u8 taskId);  void Task_ScrollIndicatorArrowPairOnMainMenu(u8 taskId); diff --git a/include/palette.h b/include/palette.h index a1259d327..d14fa1fcd 100644 --- a/include/palette.h +++ b/include/palette.h @@ -24,16 +24,16 @@ struct PaletteFadeControl      u16 y:5; // blend coefficient      u16 targetY:5; // target blend coefficient      u16 blendColor:15; -    u16 active:1; +    bool16 active:1;      u16 multipurpose2:6; -    u16 yDec:1; // whether blend coefficient is decreasing -    u16 bufferTransferDisabled:1; +    bool16 yDec:1; // whether blend coefficient is decreasing +    bool16 bufferTransferDisabled:1;      u16 mode:2; -    u16 shouldResetBlendRegisters:1; -    u16 hardwareFadeFinishing:1; +    bool16 shouldResetBlendRegisters:1; +    bool16 hardwareFadeFinishing:1;      u16 softwareFadeFinishingCounter:5; -    u16 softwareFadeFinishing:1; -    u16 objPaletteToggle:1; +    bool16 softwareFadeFinishing:1; +    bool16 objPaletteToggle:1;      u8 deltaY:4; // rate of change of blend coefficient  }; diff --git a/include/sprite.h b/include/sprite.h index 4723b66e1..f972d09cc 100644 --- a/include/sprite.h +++ b/include/sprite.h @@ -2,6 +2,7 @@  #define GUARD_SPRITE_H  #define MAX_SPRITES 64 +#define SPRITE_INVALID_TAG 0xFFFF  struct SpriteSheet  { @@ -186,29 +187,29 @@ struct Sprite      /*0x2A*/ u8 animNum;      /*0x2B*/ u8 animCmdIndex;      /*0x2C*/ u8 animDelayCounter:6; -             u8 animPaused:1; -             u8 affineAnimPaused:1; +             bool8 animPaused:1; +             bool8 affineAnimPaused:1;      /*0x2D*/ u8 animLoopCounter;      // general purpose data fields      /*0x2E*/ s16 data[8]; -    /*0x3E*/ u16 inUse:1;               //1 -             u16 coordOffsetEnabled:1;  //2 -             u16 invisible:1;           //4 -             u16 flags_3:1;             //8 -             u16 flags_4:1;             //0x10 -             u16 flags_5:1;             //0x20 -             u16 flags_6:1;             //0x40 -             u16 flags_7:1;             //0x80 -    /*0x3F*/ u16 hFlip:1;               //1 -             u16 vFlip:1;               //2 -             u16 animBeginning:1;       //4 -             u16 affineAnimBeginning:1; //8 -             u16 animEnded:1;           //0x10 -             u16 affineAnimEnded:1;     //0x20 -             u16 usingSheet:1;          //0x40 -             u16 flags_f:1;             //0x80 +    /*0x3E*/ bool16 inUse:1;               //1 +             bool16 coordOffsetEnabled:1;  //2 +             bool16 invisible:1;           //4 +             bool16 flags_3:1;             //8 +             bool16 flags_4:1;             //0x10 +             bool16 flags_5:1;             //0x20 +             bool16 flags_6:1;             //0x40 +             bool16 flags_7:1;             //0x80 +    /*0x3F*/ bool16 hFlip:1;               //1 +             bool16 vFlip:1;               //2 +             bool16 animBeginning:1;       //4 +             bool16 affineAnimBeginning:1; //8 +             bool16 animEnded:1;           //0x10 +             bool16 affineAnimEnded:1;     //0x20 +             bool16 usingSheet:1;          //0x40 +             bool16 flags_f:1;             //0x80      /*0x40*/ u16 sheetTileStart; diff --git a/include/text.h b/include/text.h index 2566b51b7..7038149e9 100644 --- a/include/text.h +++ b/include/text.h @@ -98,6 +98,17 @@  #define TEXT_SPEED_FF 0xFF +enum { +    FONTATTR_MAX_LETTER_WIDTH, +    FONTATTR_MAX_LETTER_HEIGHT, +    FONTATTR_LETTER_SPACING, +    FONTATTR_LINE_SPACING, +    FONTATTR_COLOR_LOWNIBBLE,   // dunno what this is yet +    FONTATTR_COLOR_FOREGROUND, +    FONTATTR_COLOR_BACKGROUND, +    FONTATTR_COLOR_SHADOW +}; +  struct TextPrinterSubStruct  {      u8 font_type:4;  // 0x14 diff --git a/include/text_window.h b/include/text_window.h index 2ac13fab7..20eab57c8 100644 --- a/include/text_window.h +++ b/include/text_window.h @@ -14,8 +14,8 @@ extern const u16 gTextWindowFrame1_Pal[];  const struct TilesPal* GetWindowFrameTilesPal(u8 id);  void copy_textbox_border_tile_patterns_to_vram(u8 windowId, u16 destOffset, u8 palOffset); -void sub_809882C(u8 windowId, u16 destOffset, u8 palOffset); -void sub_80987D4(u8 windowId, u8 frameId, u16 destOffset, u8 palOffset); +void LoadUserWindowBorderGfx(u8 windowId, u16 destOffset, u8 palOffset); +void LoadWindowGfx(u8 windowId, u8 frameId, u16 destOffset, u8 palOffset);  void box_border_load_tiles_and_pal(u8 windowId, u16 destOffset, u8 palOffset);  void sub_8098858(u8 windowId, u16 tileNum, u8 palNum);  void sub_80989E0(u8 windowId, u16 tileNum, u8 palNum); | 
