diff options
| author | engineer124 <47598039+engineer124@users.noreply.github.com> | 2022-11-19 12:13:05 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-11-19 14:13:05 -0300 |
| commit | 1792268c9471d3b33c3166c44500a15dcc3c9b5e (patch) | |
| tree | 5f26cb5ca8c4ca79bb265e94e3feafb0c06c1b85 /include | |
| parent | eafc5bb4c1a3612bd32923e91a3f41a53d82241e (diff) | |
`z_parameter`: Minigames (#1131)
* minigame docs
* cleanup
* vertices and cleanup
* fix bss
* change to perfectLetters
* fix parameter static
* more PR, namefixer
* PR Suggestions
Diffstat (limited to 'include')
| -rw-r--r-- | include/functions.h | 30 | ||||
| -rw-r--r-- | include/variables.h | 18 | ||||
| -rw-r--r-- | include/z64.h | 41 | ||||
| -rw-r--r-- | include/z64interface.h | 41 | ||||
| -rw-r--r-- | include/z64save.h | 10 |
5 files changed, 76 insertions, 64 deletions
diff --git a/include/functions.h b/include/functions.h index 1e9d7b4c8..19d0c8ad9 100644 --- a/include/functions.h +++ b/include/functions.h @@ -1705,7 +1705,6 @@ Gfx* Gfx_DrawTexRectI8(Gfx* gfx, TexturePtr texture, s16 textureWidth, s16 textu Gfx* Gfx_DrawTexQuadIA8(Gfx* gfx, TexturePtr texture, s16 textureWidth, s16 textureHeight, u16 point); Gfx* Gfx_DrawTexQuad4b(Gfx* gfx, TexturePtr texture, s32 fmt, s16 textureWidth, s16 textureHeight, u16 point); -// void func_8010E028(void); void Interface_StartTimer(s16 timerId, s16 seconds); void Interface_StartPostmanTimer(s16 seconds, s16 bunnyHoodState); void func_8010EE74(PlayState* play, s32 day); @@ -1713,7 +1712,7 @@ void Interface_SetHudVisibility(u16 hudVisibility); void func_80110038(PlayState* play); // void func_80111CB4(void); // void func_801129E4(void); -void func_80112AFC(PlayState* play); +void Interface_InitMinigame(PlayState* play); void Interface_LoadItemIconImpl(PlayState* play, u8 btn); void Interface_LoadItemIcon(PlayState* play, u8 btn); void func_80112C0C(PlayState* play, u16 flag); @@ -1741,30 +1740,13 @@ void Inventory_ChangeAmmo(s16 item, s16 ammoChange); void Magic_Add(PlayState* play, s16 magicToAdd); void Magic_Reset(PlayState* play); s32 Magic_Consume(PlayState* play, s16 magicToConsume, s16 type); -// void func_80116FD8(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5); -// void func_801170B8(void); -// void func_80117100(void); -// void func_80117A20(void); -// void func_80117BD0(void); -// void func_80118084(void); -// void func_80118890(void); -// void func_80118BA4(void); -// void func_80119030(void); -// void func_80119610(void); -void func_8011B4E0(PlayState* play, s32 arg1); -// void func_8011B5C0(void); -// void func_8011B9E0(void); -// void func_8011BF70(void); -// void func_8011C4C4(void); +void Interface_SetPerfectLetters(PlayState* play, s16 perfectLettersType); void Interface_StartMoonCrash(PlayState* play); -// void func_8011E730(void); -// void func_8011F0E0(UNK_TYPE4 ctxt); -// void func_80120F90(void); -// void func_80121000(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6, UNK_TYPE4 param_7, UNK_TYPE1 param_8, UNK_TYPE1 param_9, UNK_TYPE1 param_10, UNK_TYPE4 param_11, UNK_TYPE4 param_12, UNK_TYPE4 param_13, UNK_TYPE4 param_14); -// void func_80121064(void); -// void func_801210E0(void); +void Interface_Draw(PlayState* play); +void Interface_Update(PlayState* play); void Interface_Destroy(PlayState* play); -void func_80121FC4(PlayState* play); +void Interface_Init(PlayState* play); + Path* Path_GetByIndex(PlayState* play, s16 index, s16 max); f32 Path_OrientAndGetDistSq(Actor* actor, Path* path, s16 waypoint, s16* yaw); void Path_CopyLastPoint(Path* path, Vec3f* dest); diff --git a/include/variables.h b/include/variables.h index a96dc8173..0d3bbf5d1 100644 --- a/include/variables.h +++ b/include/variables.h @@ -690,13 +690,6 @@ extern UNK_PTR D_801BF5C0; // extern UNK_TYPE2 D_801BF9F8; // extern UNK_TYPE2 D_801BF9FC; // extern UNK_TYPE2 D_801BFA00; -// extern UNK_TYPE2 D_801BFA04; -// extern UNK_TYPE2 D_801BFA1C; -// extern UNK_TYPE2 D_801BFA34; -// extern UNK_TYPE2 D_801BFA4C; -// extern UNK_TYPE2 D_801BFA64; -// extern UNK_TYPE2 D_801BFA74; -// extern UNK_TYPE4 sPostmanTimerInputBtnAPressed; // extern UNK_TYPE1 D_801BFAB0; // extern UNK_TYPE1 D_801BFAB8; // extern UNK_TYPE1 D_801BFAC4; @@ -737,17 +730,6 @@ extern UNK_PTR D_801BF5C0; // extern UNK_TYPE1 D_801BFC10; // extern UNK_TYPE1 D_801BFC14; // extern UNK_TYPE1 D_801BFC40; -// extern UNK_TYPE2 D_801BFC50; -// extern UNK_TYPE2 D_801BFC60; -// extern UNK_TYPE2 D_801BFC62; -// extern UNK_TYPE2 D_801BFC64; -// extern UNK_TYPE2 D_801BFC6C; -// extern UNK_TYPE2 D_801BFC7C; -// extern UNK_TYPE1 D_801BFC8C; -// extern UNK_TYPE2 D_801BFC98; -// extern UNK_TYPE2 D_801BFCA8; -// extern UNK_TYPE1 D_801BFCB8; -// extern UNK_TYPE4 D_801BFCC4; // extern UNK_TYPE2 sTimerStateTimer; // extern UNK_TYPE2 sTimerDigits; // extern UNK_TYPE2 D_801BFCEA; diff --git a/include/z64.h b/include/z64.h index 922f5eeb7..eabda7d4e 100644 --- a/include/z64.h +++ b/include/z64.h @@ -35,6 +35,7 @@ #include "z64cutscene.h" #include "z64dma.h" #include "z64effect.h" +#include "z64interface.h" #include "z64item.h" #include "z64light.h" #include "z64map.h" @@ -506,10 +507,10 @@ typedef struct { /* 0x256 */ s16 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 unk_25C; - /* 0x25E */ u16 unk_25E; - /* 0x260 */ u16 hbaAmmo; - /* 0x262 */ u16 unk_262; + /* 0x25C */ u16 minigamePoints; // Points to add to the minigame score. Reset to 0 every frame. + /* 0x25E */ u16 minigameHiddenPoints; // Points to add to the secondary set of minigame points not displayed. Reset to 0 every frame. + /* 0x260 */ u16 minigameAmmo; + /* 0x262 */ u16 minigameUnusedPoints; // Associated with other minigame points, unused /* 0x264 */ s16 unk_264; /* 0x266 */ s16 aAlpha; /* 0x268 */ s16 bAlpha; @@ -525,22 +526,22 @@ typedef struct { /* 0x27C */ s16 mapRoomNum; /* 0x27E */ u8 unk_27E; /* 0x27F */ u8 unk_27F; - /* 0x280 */ u8 unk_280; - /* 0x282 */ s16 unk_282; - /* 0x284 */ s16 unk_284; - /* 0x286 */ s16 unk_286; - /* 0x288 */ s16 unk_288; - /* 0x28A */ s16 unk_28A[8]; - /* 0x29A */ u16 unk_29A[8]; - /* 0x2AA */ s16 unk_2AA[8]; - /* 0x2BC */ f32 unk_2BC[8]; - /* 0x2DC */ f32 unk_2DC[8]; - /* 0x2FC */ s16 unk_2FC[4]; - /* 0x304 */ s16 unk_304; - /* 0x306 */ s16 unk_306; - /* 0x308 */ s16 unk_308; - /* 0x30A */ s16 unk_30A; - /* 0x30C */ s16 unk_30C; + /* 0x280 */ u8 minigameState; + /* 0x282 */ s16 minigameCountdownAlpha; + /* 0x284 */ s16 minigameCountdownScale; + /* 0x286 */ s16 perfectLettersOn; + /* 0x288 */ s16 perfectLettersType; + /* 0x28A */ s16 perfectLettersState[PERFECT_LETTERS_NUM_LETTERS]; + /* 0x29A */ u16 perfectLettersAngles[PERFECT_LETTERS_NUM_LETTERS]; // Angle that follows the projectory of an ellipse + /* 0x2AA */ s16 perfectLettersOffsetX[PERFECT_LETTERS_NUM_LETTERS]; + /* 0x2BC */ f32 perfectLettersSemiAxisX[PERFECT_LETTERS_NUM_LETTERS]; + /* 0x2DC */ f32 perfectLettersSemiAxisY[PERFECT_LETTERS_NUM_LETTERS]; + /* 0x2FC */ s16 perfectLettersPrimColor[4]; + /* 0x304 */ s16 perfectLettersCount; + /* 0x306 */ s16 perfectLettersUnused; + /* 0x308 */ s16 perfectLettersColorIndex; + /* 0x30A */ s16 perfectLettersColorTimer; + /* 0x30C */ s16 perfectLettersTimer; struct { /* 0x30E */ u8 unk_30E; // "h_gauge" /* 0x30F */ u8 bButton; diff --git a/include/z64interface.h b/include/z64interface.h new file mode 100644 index 000000000..4c27a25fc --- /dev/null +++ b/include/z64interface.h @@ -0,0 +1,41 @@ +#ifndef Z64INTERFACE_H +#define Z64INTERFACE_H + +#include "ultra64.h" + +typedef enum { + /* 0 */ MINIGAME_STATE_NONE, + /* 1 */ MINIGAME_STATE_COUNTDOWN_SETUP_3, + /* 2 */ MINIGAME_STATE_COUNTDOWN_3, + /* 3 */ MINIGAME_STATE_COUNTDOWN_SETUP_2, + /* 4 */ MINIGAME_STATE_COUNTDOWN_2, + /* 5 */ MINIGAME_STATE_COUNTDOWN_SETUP_1, + /* 6 */ MINIGAME_STATE_COUNTDOWN_1, + /* 7 */ MINIGAME_STATE_COUNTDOWN_SETUP_GO, + /* 8 */ MINIGAME_STATE_COUNTDOWN_GO, + /* 20 */ MINIGAME_STATE_NO_COUNTDOWN_SETUP = 20, + /* 21 */ MINIGAME_STATE_NO_COUNTDOWN, + /* 30 */ MINIGAME_STATE_PLAYING = 30 +} MinigameState; + +typedef enum { + /* 0 */ PERFECT_LETTERS_TYPE_OFF, + /* 1 */ PERFECT_LETTERS_TYPE_1, + /* 2 */ PERFECT_LETTERS_TYPE_2, + /* 3 */ PERFECT_LETTERS_TYPE_3 +} PerfectLettersType; + +typedef enum { + /* 0 */ PERFECT_LETTERS_STATE_OFF, + /* 1 */ PERFECT_LETTERS_STATE_INIT, + /* 2 */ PERFECT_LETTERS_STATE_ENTER, + /* 3 */ PERFECT_LETTERS_STATE_STATIONARY, // Display for type 1 + /* 4 */ PERFECT_LETTERS_STATE_SPREAD, // Exit for type 1 + /* 5 */ PERFECT_LETTERS_STATE_DISPLAY, + /* 6 */ PERFECT_LETTERS_STATE_EXIT +} PerfectLettersState; + +#define PERFECT_LETTERS_NUM_LETTERS 8 +#define PERFECT_LETTERS_ANGLE_PER_LETTER (0x10000 / PERFECT_LETTERS_NUM_LETTERS) + +#endif diff --git a/include/z64save.h b/include/z64save.h index 56468af67..a742f6b0b 100644 --- a/include/z64save.h +++ b/include/z64save.h @@ -106,6 +106,12 @@ typedef enum { } BottleTimerState; typedef enum { + /* 0 */ MINIGAME_STATUS_INACTIVE, + /* 1 */ MINIGAME_STATUS_ACTIVE, + /* 3 */ MINIGAME_STATUS_END = 3 +} MinigameStatus; + +typedef enum { /* 0 */ HUD_VISIBILITY_IDLE, /* 1 */ HUD_VISIBILITY_NONE, /* 2 */ HUD_VISIBILITY_NONE_ALT, // Identical to HUD_VISIBILITY_NONE @@ -343,9 +349,9 @@ typedef struct SaveContext { /* 0x3F32 */ s16 magicToConsume; // accumulated magic that is requested to be consumed "magic_used" /* 0x3F34 */ s16 magicToAdd; // accumulated magic that is requested to be added "magic_recovery" /* 0x3F36 */ u16 mapIndex; // "scene_ID" - /* 0x3F38 */ u16 minigameState; // "yabusame_mode" + /* 0x3F38 */ u16 minigameStatus; // "yabusame_mode" /* 0x3F3A */ u16 minigameScore; // "yabusame_total" - /* 0x3F3C */ u16 unk_3F3C; // "yabusame_out_ct" + /* 0x3F3C */ u16 minigameHiddenScore; // "yabusame_out_ct" /* 0x3F3E */ u8 unk_3F3E; // "no_save" /* 0x3F3F */ u8 unk_3F3F; // "flash_flag" /* 0x3F40 */ SaveOptions options; |
