diff options
| author | Tharo <17233964+Thar0@users.noreply.github.com> | 2024-07-02 22:47:37 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-07-02 14:47:37 -0700 |
| commit | 6629597f82e8ed74bfe2f35393142d1cb27be6f7 (patch) | |
| tree | 39f99b014814254ebebb70b9c175ee7441b322b2 /include | |
| parent | eccbbd47dc0061f0ffedcb32eaf333be73aeb2cc (diff) | |
`z_parameter.c`: remaining functions, do action documentation, gfx cleanup (#1652)
* Parameter last functions
Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com>
* Documentation for do actions and various gfx
* Suggested changes
* f prefix for texture scale numbers
* Player_SetBButtonAmmo
---------
Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com>
Diffstat (limited to 'include')
| -rw-r--r-- | include/z64interface.h | 85 | ||||
| -rw-r--r-- | include/z64play.h | 2 | ||||
| -rw-r--r-- | include/z64player.h | 2 |
3 files changed, 67 insertions, 22 deletions
diff --git a/include/z64interface.h b/include/z64interface.h index 518927dd2..1865a2442 100644 --- a/include/z64interface.h +++ b/include/z64interface.h @@ -4,6 +4,48 @@ #include "ultra64.h" #include "z64view.h" +// TODO extract this information from the texture definitions themselves +// 8x8 IA8 +#define AMMO_DIGIT_TEX_WIDTH 8 +#define AMMO_DIGIT_TEX_HEIGHT 8 +#define AMMO_DIGIT_TEX_SIZE (AMMO_DIGIT_TEX_WIDTH * AMMO_DIGIT_TEX_HEIGHT) + +// TODO extract this information from the texture definitions themselves +// 32x32 RGBA32 +#define ICON_ITEM_TEX_WIDTH 32 +#define ICON_ITEM_TEX_HEIGHT 32 +#define ICON_ITEM_TEX_SIZE ((ICON_ITEM_TEX_WIDTH * ICON_ITEM_TEX_HEIGHT) * 4) + +// TODO extract this information from the texture definitions themselves +// 48x16 I4 +#define DO_ACTION_TEX_WIDTH 48 +#define DO_ACTION_TEX_HEIGHT 16 +#define DO_ACTION_TEX_SIZE ((DO_ACTION_TEX_WIDTH * DO_ACTION_TEX_HEIGHT) / 2) + +// This do action label slot contains the current do action text +#define DO_ACTION_A_SLOT_ACTIVE 0 +// This do action label slot contains the next do action text for the duration of the A button switching animation +#define DO_ACTION_A_SLOT_NEXT 1 + +// Do action texture offset for the A button's active do action text +#define DO_ACTION_OFFSET_A_ACTIVE (0 * DO_ACTION_TEX_SIZE) +// Do action texture offset for the A button's next do action text +#define DO_ACTION_OFFSET_A_NEXT (1 * DO_ACTION_TEX_SIZE) +// Do action texture offset for the start button in the pause menu +#define DO_ACTION_OFFSET_START (2 * DO_ACTION_TEX_SIZE) +// Do action texture offset for the B button for player actions (masks, transformations) +#define DO_ACTION_OFFSET_B_PLAYER (3 * DO_ACTION_TEX_SIZE) +// Do action texture offset for the B button for the interface (pause menu, pictograph box, ocarina) +#define DO_ACTION_OFFSET_B_INTERFACE (4 * DO_ACTION_TEX_SIZE) +// Following the do action textures is extra space for the day number used by the 3 day clock +#define DO_ACTION_OFFSET_DAY_NUMBER (5 * DO_ACTION_TEX_SIZE) + +// TODO extract this information from the texture definitions themselves +// 48x26 IA8 +#define WEEK_STATIC_TEX_WIDTH 48 +#define WEEK_STATIC_TEX_HEIGHT 27 +#define WEEK_STATIC_TEX_SIZE ((WEEK_STATIC_TEX_WIDTH * WEEK_STATIC_TEX_HEIGHT)) + typedef enum { /* -1 */ EQUIP_SLOT_NONE = -1, /* 0 */ EQUIP_SLOT_B, @@ -14,11 +56,11 @@ typedef enum { } EquipSlot; typedef enum { - /* 0 */ A_BTN_STATE_0, - /* 1 */ A_BTN_STATE_1, - /* 2 */ A_BTN_STATE_2, - /* 3 */ A_BTN_STATE_3, - /* 4 */ A_BTN_STATE_4 + /* 0 */ A_BTN_STATE_IDLE, // Uses ACTIVE slot + /* 1 */ A_BTN_STATE_CHANGE_1_UNPAUSED, // Uses ACTIVE slot + /* 2 */ A_BTN_STATE_CHANGE_2_UNPAUSED, // Uses NEXT slot + /* 3 */ A_BTN_STATE_CHANGE_1_PAUSED, // Uses ACTIVE slot + /* 4 */ A_BTN_STATE_CHANGE_2_PAUSED // Uses NEXT slot } AButtonState; typedef enum { @@ -64,7 +106,10 @@ typedef enum { /* 0x27 */ DO_ACTION_POUND, /* 0x28 */ DO_ACTION_HOOK, /* 0x29 */ DO_ACTION_SHOOT, - /* 0x2A */ DO_ACTION_MAX + /* 0x2A */ DO_ACTION_MAX, + /* 0x2A */ TATL_STATE_2A = DO_ACTION_MAX, + /* 0x2B */ TATL_STATE_2B, + /* 0x2C */ TATL_STATE_2C } DoAction; typedef enum { @@ -131,21 +176,21 @@ typedef struct { /* 0x174 */ u8* doActionSegment; /* 0x178 */ u8* iconItemSegment; /* 0x17C */ u8* mapSegment; - /* 0x180 */ u8* unk_180; // unused segment? + /* 0x180 */ UNK_TYPE4 unk_180; // unused segment? /* 0x184 */ DmaRequest dmaRequest; /* 0x1A4 */ UNK_TYPE1 unk_1A4[0x40]; // likely 2 DmaRequest /* 0x1E4 */ OSMesgQueue loadQueue; /* 0x1FC */ OSMesg loadMsg; /* 0x200 */ Viewport viewport; /* 0x210 */ s16 aButtonState; - /* 0x212 */ u16 unk_212; + /* 0x212 */ u16 aButtonDoActionDelayed; // Like aButtonDoAction, but does not update until the A button animation is complete /* 0x214 */ u16 aButtonDoAction; /* 0x218 */ f32 aButtonRoll; - /* 0x21C */ s16 unk_21C; - /* 0x21E */ s16 bButtonDoAction; + /* 0x21C */ s16 bButtonPlayerDoActionActive; + /* 0x21E */ s16 bButtonPlayerDoAction; /* 0x220 */ s16 tatlCalling; - /* 0x222 */ s16 unk_222; - /* 0x224 */ s16 unk_224; + /* 0x222 */ s16 bButtonInterfaceDoActionActive; + /* 0x224 */ s16 bButtonInterfaceDoAction; /* 0x226 */ s16 lifeColorChange; /* 0x228 */ s16 lifeColorChangeDirection; /* 0x22A */ s16 beatingHeartPrim[3]; @@ -160,7 +205,7 @@ typedef struct { /* 0x250 */ s16 healthTimer; /* 0x252 */ s16 lifeSizeChange; /* 0x254 */ s16 lifeSizeChangeDirection; // 1 means shrinking, 0 growing - /* 0x256 */ s16 unk_256; + /* 0x256 */ UNK_TYPE2 unk_256; /* 0x258 */ s16 magicConsumptionTimer; // For certain magic states, 1 unit of magic is consumed every time the timer reaches 0 /* 0x25A */ u8 numHorseBoosts; /* 0x25C */ u16 minigamePoints; // Points to add to the minigame score. Reset to 0 every frame. @@ -177,11 +222,11 @@ typedef struct { /* 0x272 */ s16 magicAlpha; /* 0x274 */ s16 minimapAlpha; /* 0x276 */ s16 startAlpha; - /* 0x278 */ s16 unk_278; + /* 0x278 */ s16 unk_278; // Set in Map_Init, never read /* 0x27A */ s16 dungeonSceneIndex; /* 0x27C */ s16 mapRoomNum; - /* 0x27E */ u8 unk_27E; - /* 0x27F */ u8 unk_27F; + /* 0x27E */ u8 fishingHUDControl; // Left over from OoT + /* 0x27F */ UNK_TYPE1 unk_27F; /* 0x280 */ u8 minigameState; /* 0x282 */ s16 minigameCountdownAlpha; /* 0x284 */ s16 minigameCountdownScale; @@ -249,10 +294,10 @@ s32 Inventory_HasItemInBottle(u8 item); void Inventory_UpdateBottleItem(struct PlayState* play, u8 item, u8 btn); s32 Inventory_ConsumeFairy(struct PlayState* play); void Inventory_UpdateItem(struct PlayState* play, s16 slot, s16 item); -void func_8011552C(struct PlayState* play, u16 arg1); -void func_801155B4(struct PlayState* play, s16 arg1); -void func_80115764(struct PlayState* play, UNK_TYPE arg1); -void func_80115844(struct PlayState* play, s16 doAction); +void Interface_SetAButtonDoAction(struct PlayState* play, u16 aButtonDoAction); +void Interface_SetBButtonPlayerDoAction(struct PlayState* play, s16 bButtonDoAction); +void Interface_SetTatlCall(struct PlayState* play, u16 tatlCallState); +void Interface_SetBButtonInterfaceDoAction(struct PlayState* play, s16 bButtonDoAction); s32 Health_ChangeBy(struct PlayState* play, s16 healthChange); void Health_GiveHearts(s16 hearts); void Rupees_ChangeBy(s16 rupeeChange); diff --git a/include/z64play.h b/include/z64play.h index b5f78f702..f1d51034c 100644 --- a/include/z64play.h +++ b/include/z64play.h @@ -103,7 +103,7 @@ typedef struct PlayState { /* 0x18876 */ s16 worldCoverAlpha; /* 0x18878 */ s16 bgCoverAlpha; /* 0x1887A */ u16 nextEntrance; - /* 0x1887C */ s8 unk_1887C; // shootingGalleryStatus? + /* 0x1887C */ s8 bButtonAmmoPlusOne; /* 0x1887D */ s8 unk_1887D; /* 0x1887E */ s8 unk_1887E; /* 0x1887F */ u8 transitionType; // fadeTransition diff --git a/include/z64player.h b/include/z64player.h index c3d4e9095..67eda81f2 100644 --- a/include/z64player.h +++ b/include/z64player.h @@ -1388,7 +1388,7 @@ void Player_UpdateBottleHeld(struct PlayState* play, Player* player, ItemId item void Player_Untarget(Player* player); void func_80123DC0(Player* player); void func_80123E90(struct PlayState* play, Actor* actor); -s32 func_80123F2C(struct PlayState* play, s32 ammo); +s32 Player_SetBButtonAmmo(struct PlayState* play, s32 ammo); bool Player_IsBurningStickInRange(struct PlayState* play, Vec3f* pos, f32 xzRange, f32 yRange); u8 Player_GetStrength(void); PlayerMask Player_GetMask(struct PlayState* play); |
