1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2024-12-27 23:36:22 +00:00

z_fishing partially documented (#1424)

* Document z_Fishing

Document code and data RE: Fishing minigame.

* More z_fishing.c progress

Id's more values, added flag for "High score" entries

* moved and renamed Fishing flags

Flags moved outside z_fishing.c - ending sequence checks for "hat stolen" flag.

* more fishing.c Id'ing

added more id's and clarification.

* Update z_fishing.h

clarified not about fish weight.

* more z_fishing.c documenting

missed a bitfeiled in the fishing "highScores" that kept track of your number of fishing trips

* Update z64save.h

a #define got lost for the "fishing games played" increment

* z_fishing: a few formatting and naming changes based on feedback

- removed comments summing textboxes as it was deemed redundant
- tried to unify fish measurment as "length"
- clarified a few vars based on name
- formatted single-line comments to have one space.

* Update z_fishing.c

ran format.py and fixle.sh

* Update z_fishing.c

changed code around a few bools that was still matching.

* `z_en_Fishing`: changes from feedback, id'd rotate phase fields.

* Update z_fishing.c

merge fix

* `z_fishing`: More doc'ing.

* `z_fishing`: changes based on feedback

* `z_fishing`: fixed typo

* `z_fishing`: merge with master

* Update z_fishing.c

sSinkingLureLocationPos was too redundant

* Merge fix, added more comments, #defines, id's

* Update z_fishing.c

adding EN_FISH_PARAM may have led to mismatch.

* `z_fishing`: fixed compare mismatch

* Update z64save.h

fix typo

* Update z_fishing.c

a few more id's
This commit is contained in:
blackgamma7 2023-09-06 10:58:17 -04:00 committed by GitHub
parent 8913c4fa0d
commit 475b8a1eba
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 1446 additions and 1399 deletions

View file

@ -324,6 +324,18 @@ typedef enum {
/* 0x06 */ HS_DAMPE_RACE /* 0x06 */ HS_DAMPE_RACE
} HighScores; } HighScores;
// the score value for the fishing minigame also stores many flags.
#define HS_FISH_LENGTH_CHILD 0x7F // mask for record length of catch as child.
#define HS_FISH_LENGTH_ADULT 0x7F000000 // mask for record length of catch as adult.
#define HS_FISH_PLAYED_CHILD 0x100 // set when first talking to owner as child
#define HS_FISH_PLAYED_ADULT 0x200 // set when first talking to owner as adult
#define HS_FISH_PRIZE_CHILD 0x400 // won the Piece of Heart
#define HS_FISH_PRIZE_ADULT 0x800 // won the Golden Scale
#define HS_FISH_STOLE_HAT 0x1000 // Pond owner is visibly bald as Adult Link.
#define HS_FISH_CHEAT_CHILD 0x80 // used Sinking Lure as child to catch record fish
#define HS_FISH_CHEAT_ADULT 0x80000000 // used Sinking Lure as adult to catch record fish
#define HS_FISH_PLAYED 0x10000 // incremented for every play. controls weather.
typedef enum { typedef enum {
/* 0 */ SUNSSONG_INACTIVE, /* 0 */ SUNSSONG_INACTIVE,
/* 1 */ SUNSSONG_START, // the suns ocarina effect signals that the song has finished playing /* 1 */ SUNSSONG_START, // the suns ocarina effect signals that the song has finished playing

View file

@ -1083,7 +1083,7 @@ void DemoEc_UpdateFishingOwner(DemoEc* this, PlayState* play) {
void DemoEc_FishingOwnerPostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, void* thisx, Gfx** gfx) { void DemoEc_FishingOwnerPostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, void* thisx, Gfx** gfx) {
DemoEc* this = (DemoEc*)thisx; DemoEc* this = (DemoEc*)thisx;
if ((limbIndex == 8) && !(HIGH_SCORE(HS_FISHING) & 0x1000)) { if ((limbIndex == 8) && !(HIGH_SCORE(HS_FISHING) & HS_FISH_STOLE_HAT)) {
gSPDisplayList((*gfx)++, SEGMENTED_TO_VIRTUAL(gFishingOwnerHatDL)); gSPDisplayList((*gfx)++, SEGMENTED_TO_VIRTUAL(gFishingOwnerHatDL));
} }
} }

File diff suppressed because it is too large Load diff

View file

@ -9,50 +9,48 @@ struct Fishing;
typedef struct Fishing { typedef struct Fishing {
/* 0x0000 */ Actor actor; /* 0x0000 */ Actor actor;
/* 0x014C */ char unk_14C[0x004]; /* 0x014C */ char unk_14C[0x004];
/* 0x0150 */ u8 unk_150; /* 0x0150 */ u8 isLoach;
/* 0x0151 */ u8 unk_151; /* 0x0151 */ u8 lilyTimer; // if near lily and >0, lily moves. Move more if >20
/* 0x0152 */ u8 unk_152; /* 0x0152 */ u8 unk_152;
/* 0x0154 */ s16 unk_154; /* 0x0154 */ s16 unk_154;
/* 0x0156 */ u8 unk_156; /* 0x0156 */ u8 unk_156;
/* 0x0157 */ u8 unk_157; /* 0x0157 */ u8 unk_157;
/* 0x0158 */ s16 unk_158; /* 0x0158 */ s16 fishState; // negative index for loach behavior
/* 0x015A */ s16 unk_15A; /* 0x015A */ s16 fishStateNext;
/* 0x015C */ s16 unk_15C; /* 0x015C */ s16 stateAndTimer; // fish use as timer that's AND'd, owner as talking state
/* 0x015E */ s16 unk_15E; /* 0x015E */ s16 unk_15E;
/* 0x0160 */ s16 unk_160; /* 0x0160 */ s16 unk_160; // fish use as rotateX, owner as index of eye texture
/* 0x0162 */ s16 unk_162; /* 0x0162 */ s16 unk_162; // fish use as rotateY, owner as index of eye texture
/* 0x0164 */ s16 unk_164; /* 0x0164 */ s16 unk_164; // fish use as rotateZ, owner as rotation of head
/* 0x0166 */ s16 unk_166; /* 0x0166 */ Vec3s rotationTarget;
/* 0x0168 */ s16 unk_168; /* 0x016C */ s16 fishLimb23RotYDelta;
/* 0x016A */ s16 unk_16A;
/* 0x016C */ s16 unk_16C;
/* 0x016E */ s16 unk_16E; /* 0x016E */ s16 unk_16E;
/* 0x0170 */ s16 unk_170; /* 0x0170 */ s16 fishLimbDRotZDelta;
/* 0x0172 */ s16 unk_172; /* 0x0172 */ s16 fishLimbEFRotYDelta;
/* 0x0174 */ s16 unk_174; /* 0x0174 */ s16 fishLimb89RotYDelta;
/* 0x0176 */ s16 unk_176; /* 0x0176 */ s16 fishLimb4RotYDelta;
/* 0x0178 */ s16 unk_178; /* 0x0178 */ s16 unk_178;
/* 0x017A */ s16 unk_17A[4]; /* 0x017A */ s16 timerArray[4];
/* 0x0184 */ f32 unk_184; /* 0x0184 */ f32 unk_184;
/* 0x0188 */ f32 unk_188; /* 0x0188 */ f32 speedTarget;
/* 0x018C */ f32 unk_18C; /* 0x018C */ f32 fishLimbRotPhase;
/* 0x0190 */ f32 unk_190; /* 0x0190 */ f32 unk_190; // fishLimbRotPhaseStep target
/* 0x0194 */ f32 unk_194; /* 0x0194 */ f32 unk_194; // fishLimbRotPhaseMag target
/* 0x0198 */ f32 unk_198; /* 0x0198 */ f32 fishLimbRotPhaseStep;
/* 0x019C */ f32 unk_19C; /* 0x019C */ f32 fishLimbRotPhaseMag;
/* 0x01A0 */ s16 unk_1A0; /* 0x01A0 */ s16 bumpTimer; // set when hitting a wall.
/* 0x01A2 */ s16 unk_1A2; /* 0x01A2 */ s16 unk_1A2; // "scared" timer?
/* 0x01A4 */ s16 unk_1A4; /* 0x01A4 */ s16 unk_1A4; // "scared" timer? set at same time as above
/* 0x01A8 */ f32 unk_1A8; /* 0x01A8 */ f32 perception; // how easily they are drawn to the lure.
/* 0x01AC */ f32 unk_1AC; /* 0x01AC */ f32 fishLength; // fish are (x^2*.0036+.5) lbs, loach double that.
/* 0x01B0 */ f32 unk_1B0; /* 0x01B0 */ f32 rotationStep;
/* 0x01B4 */ Vec3f unk_1B4; /* 0x01B4 */ Vec3f fishTargetPos;
/* 0x01C0 */ Vec3f fishMouthPos; /* 0x01C0 */ Vec3f fishMouthPos;
/* 0x01CC */ s16 unk_1CC[3]; /* 0x01CC */ s16 loachRotYDelta[3]; // adds rotation to the loach limb 3-5.
/* 0x01D2 */ u8 unk_1D2; /* 0x01D2 */ u8 bubbleTime; // spawn bubbles while >0
/* 0x01D3 */ u8 unk_1D3; /* 0x01D3 */ u8 isAquariumMessage;
/* 0x01D4 */ u8 unk_1D4; /* 0x01D4 */ u8 aquariumWaitTimer;
/* 0x01D5 */ u8 unk_1D5; /* 0x01D5 */ u8 keepState; // case-switch and keeping or releasing a fish
/* 0x01D8 */ SkelAnime skelAnime; /* 0x01D8 */ SkelAnime skelAnime;
/* 0x021C */ LightNode* lightNode; /* 0x021C */ LightNode* lightNode;
/* 0x0220 */ LightInfo lightInfo; /* 0x0220 */ LightInfo lightInfo;
@ -60,4 +58,8 @@ typedef struct Fishing {
/* 0x0250 */ ColliderJntSphElement colliderElements[12]; /* 0x0250 */ ColliderJntSphElement colliderElements[12];
} Fishing; // size = 0x0550 } Fishing; // size = 0x0550
#define EN_FISH_OWNER 1 // param for owner of pond. default if params<100
#define EN_FISH_PARAM 100 // param base for fish in pond.
#define EN_FISH_AQUARIUM 200 // param for record fish in tank.
#endif #endif