1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2024-11-13 04:39:36 +00:00

Misc Cleanup 2 (#1007)

* Cleanup `UNK_TYPE`, `UNK_PTR` usage

* Add some missing empty lines after declarations

* Remove some legacy comments from non-matching times

* Fix some grammar (mostly "it's"/"its")

* Use proper names for two symbols after ZAPD bugfix

* Cleanup `place_title_cards.xml`

* Use `NULL` to check against `D_8012D260` pointer

* Parentheses around some macro arguments

* wip proofread headers up to z64animation.h
This commit is contained in:
Dragorn421 2021-12-01 00:40:42 +01:00 committed by GitHub
parent 04a9d51e90
commit 669732abbe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
104 changed files with 217 additions and 92 deletions

View file

@ -2,8 +2,7 @@
<File Name="spot02_scene" Segment="2">
<Scene Name="spot02_scene" Offset="0x0"/>
<!-- This symbol should be named spot02_scene_Cs_003C80 but a ZAPD bug prevents it -->
<Cutscene Name="spot02_sceneCutsceneData0x003C80" Offset="0x3C80"/>
<Cutscene Name="spot02_scene_Cs_003C80" Offset="0x3C80"/>
<Cutscene Name="spot02_scene_Cs_005020" Offset="0x5020"/>
<Cutscene Name="gGraveyardIntroCs" Offset="0x70C0"/>

View file

@ -2,8 +2,7 @@
<File Name="spot05_scene" Segment="2">
<Cutscene Name="gMinuetCs" Offset="0x3F80"/>
<!-- This symbol should be named spot05_scene_Cs_005730 but a ZAPD bug prevents it -->
<Cutscene Name="spot05_sceneCutsceneData0x005730" Offset="0x5730"/>
<Cutscene Name="spot05_scene_Cs_005730" Offset="0x5730"/>
<Path Name="gSpot05Path_0069D8" Offset="0x69D8"/>
<Path Name="gSpot05Path_0069E0" Offset="0x69E0"/>

View file

@ -1,5 +1,5 @@
<Root>
<File Name="g_pn_01" >
<File Name="g_pn_01">
<Texture Name="gForestTempleTitleCardENGTex" OutName="forest_temple_eng" Format="ia8" Width="144" Height="24" Offset="0x0"/>
<Texture Name="gForestTempleTitleCardGERTex" OutName="forest_temple_ger" Format="ia8" Width="144" Height="24" Offset="0xD80"/>
<Texture Name="gForestTempleTitleCardFRATex" OutName="forest_temple_fra" Format="ia8" Width="144" Height="24" Offset="0x1B00"/>
@ -64,7 +64,7 @@
<Texture Name="gGreatFairysFountainTitleCardGERTex" OutName="great_fairys_fountain_ger" Format="ia8" Width="144" Height="24" Offset="0xD80"/>
<Texture Name="gGreatFairysFountainTitleCardFRATex" OutName="great_fairys_fountain_fra" Format="ia8" Width="144" Height="24" Offset="0x1B00"/>
</File>
<File Name="g_pn_14">
<File Name="g_pn_14">
<Texture Name="gChamberOfTheSagesTitleCardENGTex" OutName="chamber_of_the_sages_eng" Format="ia8" Width="144" Height="24" Offset="0x0"/>
<Texture Name="gChamberOfTheSagesTitleCardGERTex" OutName="chamber_of_the_sages_ger" Format="ia8" Width="144" Height="24" Offset="0xD80"/>
<Texture Name="gChamberOfTheSagesTitleCardFRATex" OutName="chamber_of_the_sages_fra" Format="ia8" Width="144" Height="24" Offset="0x1B00"/>

View file

@ -154,7 +154,7 @@ typedef struct EnJj {
} EnJj; // size = 0x0314
```
We can eliminate the temp since it's use in a simple way one after the other. `this->unk308 = (s16) (this->unk308 - 0x66);` can be written as `this->unk308 -= 0x66;`.
We can eliminate the temp since it's used in a simple way one after the other. `this->unk308 = (s16) (this->unk308 - 0x66);` can be written as `this->unk308 -= 0x66;`.
In the `func_8003EBF8` we see that we should have at least made `this->childActor` a `DynaPolyActor*`, so that the last argument is its `bgId`. To avoid compiler warnings, we also need to cast the `Actor_SpawnAsChild` as such in Init,
```C

View file

@ -3,7 +3,7 @@
/**
* Command Base macros intended for use in designing of more specific command macros
* Each macro packs bytes (B), halfowrds (H) and words (W, for consistency) into a single word
* Each macro packs bytes (B), halfwords (H) and words (W, for consistency) into a single word
*/
#define CMD_BBBB(a, b, c, d) (_SHIFTL(a, 24, 8) | _SHIFTL(b, 16, 8) | _SHIFTL(c, 8, 8) | _SHIFTL(d, 0, 8))

View file

@ -21,9 +21,11 @@
#define CLAMP(x, min, max) ((x) < (min) ? (min) : (x) > (max) ? (max) : (x))
#define CLAMP_MAX(x, max) ((x) > (max) ? (max) : (x))
#define CLAMP_MIN(x, min) ((x) < (min) ? (min) : (x))
#define MEDIAN3(a1, a2, a3) ((a2 >= a1) ? ((a3 >= a2) ? a2 : ((a1 >= a3) ? a1 : a3)) : ((a2 >= a3) ? a2 : ((a3 >= a1) ? a1 : a3)))
#define MEDIAN3(a1, a2, a3) \
(((a2) >= (a1)) ? (((a3) >= (a2)) ? (a2) : (((a1) >= (a3)) ? (a1) : (a3))) \
: (((a2) >= (a3)) ? (a2) : (((a3) >= (a1)) ? (a1) : (a3))))
#define RGBA8(r, g, b, a) (((r & 0xFF) << 24) | ((g & 0xFF) << 16) | ((b & 0xFF) << 8) | ((a & 0xFF) << 0))
#define RGBA8(r, g, b, a) ((((r) & 0xFF) << 24) | (((g) & 0xFF) << 16) | (((b) & 0xFF) << 8) | (((a) & 0xFF) << 0))
#define GET_PLAYER(globalCtx) ((Player*)(globalCtx)->actorCtx.actorLists[ACTORCAT_PLAYER].head)
@ -68,8 +70,8 @@
? ITEM_SWORD_BGS \
: gSaveContext.equips.buttonItems[0])
#define C_BTN_ITEM(button) ((gSaveContext.buttonStatus[button + 1] != BTN_DISABLED) \
? gSaveContext.equips.buttonItems[button + 1] \
#define C_BTN_ITEM(button) ((gSaveContext.buttonStatus[(button) + 1] != BTN_DISABLED) \
? gSaveContext.equips.buttonItems[(button) + 1] \
: ITEM_NONE)
#define CHECK_BTN_ALL(state, combo) (~((state) | ~(combo)) == 0)

View file

@ -1337,24 +1337,24 @@ typedef struct {
} EntranceInfo; // size = 0x4
typedef struct {
/* 0x00 */ void* loadedRamAddr;
/* 0x04 */ u32 vromStart; // if applicable
/* 0x08 */ u32 vromEnd; // if applicable
/* 0x0C */ void* vramStart; // if applicable
/* 0x10 */ void* vramEnd; // if applicable
/* 0x14 */ UNK_PTR unk_14;
/* 0x18 */ void* init; // initializes and executes the given context
/* 0x1C */ void* destroy; // deconstructs the context, and sets the next context to load
/* 0x20 */ UNK_PTR unk_20;
/* 0x24 */ UNK_PTR unk_24;
/* 0x28 */ UNK_TYPE unk_28;
/* 0x2C */ u32 instanceSize;
/* 0x00 */ void* loadedRamAddr;
/* 0x04 */ u32 vromStart; // if applicable
/* 0x08 */ u32 vromEnd; // if applicable
/* 0x0C */ void* vramStart; // if applicable
/* 0x10 */ void* vramEnd; // if applicable
/* 0x14 */ UNK_PTR unk_14;
/* 0x18 */ void* init; // initializes and executes the given context
/* 0x1C */ void* destroy; // deconstructs the context, and sets the next context to load
/* 0x20 */ UNK_PTR unk_20;
/* 0x24 */ UNK_PTR unk_24;
/* 0x28 */ UNK_TYPE4 unk_28;
/* 0x2C */ u32 instanceSize;
} GameStateOverlay; // size = 0x30
typedef struct PreNMIContext {
/* 0x00 */ GameState state;
/* 0xA4 */ u32 timer;
/* 0xA8 */ UNK_TYPE unk_A8;
/* 0xA4 */ u32 timer;
/* 0xA8 */ UNK_TYPE4 unk_A8;
} PreNMIContext; // size = 0xAC
typedef enum {
@ -1669,11 +1669,11 @@ typedef struct {
/* 0x0234 */ OSScTask* curRDPTask;
/* 0x0238 */ s32 retraceCnt;
/* 0x023C */ s32 doAudio;
/* 0x0240 */ CfbInfo* curBuf;
/* 0x0244 */ CfbInfo* pendingSwapBuf1;
/* 0x0220 */ CfbInfo* pendingSwapBuf2;
/* 0x0220 */ UNK_TYPE unk_24C;
/* 0x0250 */ IrqMgrClient irqClient;
/* 0x0240 */ CfbInfo* curBuf;
/* 0x0244 */ CfbInfo* pendingSwapBuf1;
/* 0x0220 */ CfbInfo* pendingSwapBuf2;
/* 0x0220 */ UNK_TYPE4 unk_24C;
/* 0x0250 */ IrqMgrClient irqClient;
} SchedContext; // size = 0x258
// ========================
@ -1833,7 +1833,7 @@ typedef struct {
/* 0x50 */ u8* symbols;
} JpegHuffmanTable; // size = 0x54
// this struct might be unaccurate but it's not used outside jpegutils.c anyways
// this struct might be inaccurate but it's not used outside jpegutils.c anyways
typedef struct {
/* 0x000 */ u8 codeOffs[16];
/* 0x010 */ u16 dcCodes[120];

View file

@ -91,7 +91,7 @@ typedef struct {
typedef struct {
/* 0x00 */ AnimationHeaderCommon common;
/* 0x04 */ s16* frameData; // "tbl"
/* 0x04 */ s16* frameData; // "tbl"
/* 0x08 */ JointIndex* jointIndices; // "ref_tbl"
/* 0x0C */ u16 staticIndexMax;
} AnimationHeader; // size = 0x10
@ -265,7 +265,7 @@ typedef struct SkelAnime {
/* 0x2C */ f32 morphRate; // Reciprocal of the number of frames in the morph
/* 0x30 */ s32 (*update)(); // Can be Loop, Partial loop, Play once, Morph, or Tapered morph. Link only has Loop, Play once, and Morph
/* 0x34 */ s8 initFlags; // Flags used when initializing Link's skeleton
/* 0x35 */ u8 moveFlags; // Flags used for animations that move the actor in worldspace.
/* 0x35 */ u8 moveFlags; // Flags used for animations that move the actor in worldspace.
/* 0x36 */ s16 prevRot; // Previous rotation in worldspace.
/* 0x38 */ Vec3s prevTransl; // Previous modelspace translation.
/* 0x3E */ Vec3s baseTransl; // Base modelspace translation.

View file

@ -54,6 +54,7 @@ void LogUtils_LogHexDump(void* ptr, s32 size0) {
while (true) {
if (i < rest) {
u8 a = *(addr + i);
osSyncPrintf("%c", (a >= 0x20 && a < 0x7F) ? a : '.');
} else {
osSyncPrintf(" ");
@ -77,6 +78,7 @@ void LogUtils_LogPointer(s32 value, u32 max, void* ptr, const char* name, const
void LogUtils_CheckBoundary(const char* name, s32 value, s32 unk, const char* file, s32 line) {
u32 mask = (unk - 1);
if (value & mask) {
osSyncPrintf(VT_COL(RED, WHITE) "%s %d:%s(%08x) は バウンダリ(%d)違反です\n" VT_RST, file, line, name, value,
unk);

View file

@ -115,6 +115,7 @@ u32 StackCheck_CheckAll(void) {
while (iter) {
u32 state = StackCheck_GetState(iter);
if (state != STACK_STATUS_OK) {
ret = 1;
}

View file

@ -548,6 +548,7 @@ void PreRender_Calc(PreRender* this) {
for (y = 0; y < this->height; y++) {
for (x = 0; x < this->width; x++) {
s32 a = this->cvgSave[x + y * this->width];
a >>= 5;
a++;
if (a != 8) {

View file

@ -1276,6 +1276,7 @@ void AudioHeap_ChangeStorage(StorageChange* change, SoundFontSample* sample) {
if (sample != NULL) {
u32 start = change->oldAddr;
u32 end = change->oldAddr + change->size;
if (start <= (u32)sample->sampleAddr && (u32)sample->sampleAddr < end) {
sample->sampleAddr = sample->sampleAddr - start + change->newAddr;
sample->medium = change->newMedium;

View file

@ -360,12 +360,14 @@ u8 AudioSeq_ScriptReadU8(SeqScriptState* state) {
s16 AudioSeq_ScriptReadS16(SeqScriptState* state) {
s16 ret = *(state->pc++) << 8;
ret = *(state->pc++) | ret;
return ret;
}
u16 AudioSeq_ScriptReadCompressedU16(SeqScriptState* state) {
u16 ret = *(state->pc++);
if (ret & 0x80) {
ret = (ret << 8) & 0x7F00;
ret = *(state->pc++) | ret;
@ -477,6 +479,7 @@ s32 AudioSeq_SeqLayerProcessScriptStep2(SequenceLayer* layer) {
}
if (cmd >= 0xF2) {
u16 arg = AudioSeq_GetScriptControlFlowArgument(state, cmd);
if (AudioSeq_HandleScriptFlowControl(seqPlayer, state, cmd, arg) == 0) {
continue;
}
@ -489,6 +492,7 @@ s32 AudioSeq_SeqLayerProcessScriptStep2(SequenceLayer* layer) {
case 0xCA: // layer_setpan
{
u8 tempByte = *(state->pc++);
if (cmd == 0xC1) {
layer->velocitySquare = (f32)(tempByte * tempByte) / 16129.0f;
} else {
@ -501,6 +505,7 @@ s32 AudioSeq_SeqLayerProcessScriptStep2(SequenceLayer* layer) {
case 0xC2: // layer_transpose; set transposition in semitones
{
u8 tempByte = *(state->pc++);
if (cmd == 0xC9) {
layer->gateTime = tempByte;
} else {

View file

@ -1100,6 +1100,7 @@ void Audio_OcaPlayback(void) {
if (sDisplayedNoteValue != sPlaybackSong[sPlaybackNotePos].noteIdx) {
u8 tmp = sPlaybackSong[sPlaybackNotePos].noteIdx;
if (tmp == 0xA) {
sDisplayedNoteValue = tmp + sPlaybackSong[sPlaybackNotePos].semitone;
} else {

View file

@ -6,6 +6,7 @@ s32 gUseAtanContFrac;
f32 Math_FTanF(f32 x) {
f32 sin = sinf(x);
f32 cos = cosf(x);
return sin / cos;
}

View file

@ -61,6 +61,7 @@ u32 Rand_Next_Variable(u32* rndNum) {
*/
f32 Rand_ZeroOne_Variable(u32* rndNum) {
u32 next = (*rndNum * 1664525) + 1013904223;
// clang-format off
*rndNum = next; sRandFloat = (next >> 9) | 0x3F800000;
// clang-format on
@ -73,6 +74,7 @@ f32 Rand_ZeroOne_Variable(u32* rndNum) {
*/
f32 Rand_Centered_Variable(u32* rndNum) {
u32 next = (*rndNum * 1664525) + 1013904223;
// clang-format off
*rndNum = next; sRandFloat = (next >> 9) | 0x3F800000;
// clang-format on

View file

@ -429,6 +429,7 @@ void DbCamera_PrintPoints(const char* name, s16 count, CutsceneCameraPoint* poin
void DbCamera_PrintF32Bytes(f32 value) {
f32 b = value;
char* a = (char*)&b;
osSyncPrintf("\n@@@%d,%d,%d,%d,", a[0], a[1], a[2], a[3]);
}
@ -436,6 +437,7 @@ void DbCamera_PrintU16Bytes(u16 value) {
u16 pad;
u16 b = value;
char* a = (char*)&b;
osSyncPrintf("\n@@@%d,%d,", a[0], a[1]);
}
@ -443,6 +445,7 @@ void DbCamera_PrintS16Bytes(s16 value) {
u16 pad;
s16 b = value;
char* a = (char*)&b;
osSyncPrintf("\n@@@%d,%d,", a[0], a[1]);
}

View file

@ -124,6 +124,7 @@ void FaultDrawer_DrawChar(char c) {
((sFaultDrawerStruct.charH + cursorY - 1) <= sFaultDrawerStruct.yEnd)) {
for (y = 0; y < sFaultDrawerStruct.charH; y++) {
u32 mask = 0x10000000 << shift;
data = *dataPtr;
for (x = 0; x < sFaultDrawerStruct.charW; x++) {
if (mask & data) {
@ -151,6 +152,7 @@ s32 FaultDrawer_ColorToPrintColor(u16 color) {
void FaultDrawer_UpdatePrintColor() {
s32 idx;
if (sFaultDrawerStruct.osSyncPrintfEnabled) {
osSyncPrintf(VT_RST);
idx = FaultDrawer_ColorToPrintColor(sFaultDrawerStruct.foreColor);

View file

@ -170,7 +170,7 @@ void Graph_TaskSet00(GraphicsContext* gfxCtx) {
LogUtils_LogHexDump(gGfxSPTaskYieldBuffer, sizeof(gGfxSPTaskYieldBuffer));
SREG(6) = -1;
if (D_8012D260 != 0) {
if (D_8012D260 != NULL) {
HREG(80) = 7;
HREG(81) = 1;
HREG(83) = 2;

View file

@ -166,6 +166,7 @@ u16 JpegDecoder_ReadBits(u8 len) {
u8 data;
s32 ret;
u32 temp;
ret = 0; // this is required for some reason
for (byteCount = sJpegBitStreamBitIdx >> 3; byteCount > 0; byteCount--) {

View file

@ -5,6 +5,7 @@ void JpegUtils_ProcessQuantizationTable(u8* dqt, JpegQuantizationTable* qt, u8 c
for (i = 0; i < count; i++) {
u8 j;
dqt++;
for (j = 0; j < 64; j++) {
qt[i].table[j] = *dqt++;
@ -102,6 +103,7 @@ u32 JpegUtils_ProcessHuffmanTable(u8* dht, JpegHuffmanTable* ht, u8* codesLength
for (idx = 0; idx < count; idx++) {
u32 ac = (*dht++ >> 4);
codeCount = JpegUtils_ProcessHuffmanTableImpl(dht, &ht[idx], codesLengths, codes, ac);
if (codeCount == 0) {
return 1;

View file

@ -10,6 +10,7 @@ void MtxConv_F2L(Mtx* m1, MtxF* m2) {
for (i = 0; i < 4; i++) {
for (j = 0; j < 4; j++) {
s32 value = (m2->mf[i][j] * 0x10000);
m1->intPart[i][j] = value >> 16;
m1->fracPart[i][j] = value;
}

View file

@ -19,6 +19,7 @@
u32 UCodeDisas_TranslateAddr(UCodeDisas* this, u32 addr) {
u32 physical = this->segments[SEGMENT_NUMBER(addr)] + SEGMENT_OFFSET(addr);
return PHYSICAL_TO_VIRTUAL(physical);
}
@ -136,6 +137,7 @@ const char* UCodeDisas_ParseCombineAlpha(u32 value, u32 idx) {
void UCodeDisas_Init(UCodeDisas* this) {
u32 i;
bzero(this, sizeof(UCodeDisas));
for (i = 0; i < NUM_SEGMENTS; i++) {
this->segments[i] = gSegments[i];

View file

@ -1438,6 +1438,7 @@ f32 func_8002EFC0(Actor* actor, Player* player, s16 arg2) {
} else {
f32 ret =
actor->xyzDistToPlayerSq - actor->xyzDistToPlayerSq * 0.8f * ((0x4000 - yawTempAbs) * (1.0f / 0x8000));
return ret;
}
}
@ -2879,7 +2880,7 @@ void func_800328D4(GlobalContext* globalCtx, ActorContext* actorCtx, Player* pla
Actor* actor;
Actor* sp84;
CollisionPoly* sp80;
UNK_TYPE sp7C;
s32 sp7C;
Vec3f sp70;
actor = actorCtx->actorLists[actorCategory].head;
@ -3236,7 +3237,7 @@ Actor* Actor_GetProjectileActor(GlobalContext* globalCtx, Actor* refActor, f32 r
//! @bug The projectile actor gets unsafely casted to a hookshot to check its timer, even though
// it can also be an arrow.
// Luckily, the field at the same offset in the arrow actor is the x component of a vector
// which will rarely ever be 0. So its very unlikely for this bug to cause an issue.
// which will rarely ever be 0. So it's very unlikely for this bug to cause an issue.
if ((Math_Vec3f_DistXYZ(&refActor->world.pos, &actor->world.pos) > radius) ||
(((ArmsHook*)actor)->timer == 0)) {
actor = actor->next;
@ -3454,6 +3455,7 @@ void func_80033C30(Vec3f* arg0, Vec3f* arg1, u8 alpha, GlobalContext* globalCtx)
void func_80033DB8(GlobalContext* globalCtx, s16 arg1, s16 arg2) {
s16 var = Quake_Add(&globalCtx->mainCamera, 3);
Quake_SetSpeed(var, 20000);
Quake_SetQuakeValues(var, arg1, 0, 0, 0);
Quake_SetCountdown(var, arg2);
@ -3461,6 +3463,7 @@ void func_80033DB8(GlobalContext* globalCtx, s16 arg1, s16 arg2) {
void func_80033E1C(GlobalContext* globalCtx, s16 arg1, s16 arg2, s16 arg3) {
s16 var = Quake_Add(&globalCtx->mainCamera, 3);
Quake_SetSpeed(var, arg3);
Quake_SetQuakeValues(var, arg1, 0, 0, 0);
Quake_SetCountdown(var, arg2);

View file

@ -1139,6 +1139,7 @@ void BgCheck_GetSubdivisionMinBounds(CollisionContext* colCtx, Vec3f* pos, s32*
f32 dx = pos->x - colCtx->minBounds.x;
f32 dy = pos->y - colCtx->minBounds.y;
f32 dz = pos->z - colCtx->minBounds.z;
*sx = dx * colCtx->subdivLengthInv.x;
*sy = dy * colCtx->subdivLengthInv.y;
*sz = dz * colCtx->subdivLengthInv.z;
@ -1165,6 +1166,7 @@ void BgCheck_GetSubdivisionMaxBounds(CollisionContext* colCtx, Vec3f* pos, s32*
f32 dx = pos->x - colCtx->minBounds.x;
f32 dy = pos->y - colCtx->minBounds.y;
f32 dz = pos->z - colCtx->minBounds.z;
*sx = dx * colCtx->subdivLengthInv.x;
*sy = dy * colCtx->subdivLengthInv.y;
*sz = dz * colCtx->subdivLengthInv.z;
@ -2848,6 +2850,7 @@ void DynaPoly_ExpandSRT(GlobalContext* globalCtx, DynaCollisionContext* dyna, s3
for (i = 0; i < pbgdata->numVertices; i++) {
f32 radiusSq;
newVtx.x = dyna->vtxList[*vtxStartIndex + i].x;
newVtx.y = dyna->vtxList[*vtxStartIndex + i].y;
newVtx.z = dyna->vtxList[*vtxStartIndex + i].z;
@ -2862,6 +2865,7 @@ void DynaPoly_ExpandSRT(GlobalContext* globalCtx, DynaCollisionContext* dyna, s3
for (i = 0; i < pbgdata->numPolygons; i++) {
CollisionPoly* newPoly = &dyna->polyList[*polyStartIndex + i];
f32 newNormMagnitude;
*newPoly = pbgdata->polyList[i];
// Yeah, this is all kinds of fake, but my God, it matches.
@ -4282,6 +4286,7 @@ u16 WaterBox_GetCameraSType(CollisionContext* colCtx, WaterBox* waterBox) {
*/
u32 WaterBox_GetLightSettingIndex(CollisionContext* colCtx, WaterBox* waterBox) {
u32 prop = waterBox->properties >> 8;
return prop & 0x1F;
}

View file

@ -1973,6 +1973,7 @@ s32 Camera_Parallel1(Camera* camera) {
if (RELOAD_PARAMS) {
CameraModeValue* values = sCameraSettings[camera->setting].cameraModes[camera->mode].values;
f32 yNormal = (1.0f + PCT(OREG(46))) - (PCT(OREG(46)) * (68.0f / playerHeight));
para1->unk_00 = NEXTPCT * playerHeight * yNormal;
;
para1->distTarget = NEXTPCT * playerHeight * yNormal;
@ -2181,6 +2182,7 @@ s32 Camera_Jump1(Camera* camera) {
if (RELOAD_PARAMS) {
CameraModeValue* values = sCameraSettings[camera->setting].cameraModes[camera->mode].values;
f32 yNormal = (1.0f + PCT(R_CAM_YOFFSET_NORM)) - (PCT(R_CAM_YOFFSET_NORM) * (68.0f / playerHeight));
jump1->atYOffset = PCT(NEXTSETTING) * playerHeight * yNormal;
jump1->distMin = PCT(NEXTSETTING) * playerHeight * yNormal;
jump1->distMax = PCT(NEXTSETTING) * playerHeight * yNormal;
@ -2721,6 +2723,7 @@ s32 Camera_Battle1(Camera* camera) {
if (RELOAD_PARAMS) {
CameraModeValue* values = sCameraSettings[camera->setting].cameraModes[camera->mode].values;
f32 yNormal = (1.0f + PCT(OREG(46))) - (PCT(OREG(46)) * (68.0f / playerHeight));
batt1->yOffset = NEXTPCT * playerHeight * yNormal;
batt1->distance = NEXTSETTING;
batt1->swingYawInitial = NEXTSETTING;
@ -2954,6 +2957,7 @@ s32 Camera_Battle4(Camera* camera) {
if (RELOAD_PARAMS) {
CameraModeValue* values = sCameraSettings[camera->setting].cameraModes[camera->mode].values;
f32 yNormal = (1.0f + PCT(R_CAM_YOFFSET_NORM)) - (PCT(R_CAM_YOFFSET_NORM) * (68.0f / playerHeight));
batt4->yOffset = NEXTPCT * playerHeight * yNormal;
batt4->rTarget = NEXTPCT * playerHeight * yNormal;
batt4->pitchTarget = DEGF_TO_BINANG(NEXTSETTING);
@ -3062,6 +3066,7 @@ s32 Camera_KeepOn1(Camera* camera) {
if (RELOAD_PARAMS) {
CameraModeValue* values = sCameraSettings[camera->setting].cameraModes[camera->mode].values;
f32 yNormal = (1.0f + PCT(OREG(46))) - (PCT(OREG(46)) * (68.0f / playerHeight));
keep1->unk_00 = NEXTPCT * playerHeight * yNormal;
keep1->unk_04 = NEXTSETTING;
keep1->unk_08 = NEXTSETTING;
@ -3302,6 +3307,7 @@ s32 Camera_KeepOn3(Camera* camera) {
if (RELOAD_PARAMS) {
CameraModeValue* values = sCameraSettings[camera->setting].cameraModes[camera->mode].values;
f32 yNormal = (1.0f + PCT(OREG(46))) - (PCT(OREG(46)) * (68.0f / playerHeight));
keep3->yOffset = NEXTPCT * playerHeight * yNormal;
keep3->minDist = NEXTSETTING;
keep3->maxDist = NEXTSETTING;
@ -3494,6 +3500,7 @@ s32 Camera_KeepOn4(Camera* camera) {
if (RELOAD_PARAMS) {
CameraModeValue* values = sCameraSettings[camera->setting].cameraModes[camera->mode].values;
f32 yNormal = (1.0f + t) - ((68.0f / playerHeight) * t);
keep4->unk_00 = NEXTPCT * playerHeight * yNormal;
keep4->unk_04 = NEXTPCT * playerHeight * yNormal;
keep4->unk_08 = NEXTSETTING;
@ -4652,6 +4659,7 @@ s32 Camera_Unique3(Camera* camera) {
if (RELOAD_PARAMS) {
CameraModeValue* values = sCameraSettings[camera->setting].cameraModes[camera->mode].values;
f32 yNormal = (1.0f + PCT(R_CAM_YOFFSET_NORM)) - (PCT(R_CAM_YOFFSET_NORM) * (68.0f / playerHeight));
params->yOffset = NEXTPCT * playerHeight * yNormal;
params->fov = NEXTSETTING;
params->interfaceFlags = NEXTSETTING;
@ -6670,6 +6678,7 @@ s32 Camera_Special9(Camera* camera) {
spAC = *eye = *eyeNext;
} else {
s16 yaw;
// 0xE38 ~ 20 degrees
eyeAdjustment.pitch = 0xE38;
// 0xAAA ~ 15 degrees.
@ -7535,7 +7544,7 @@ Vec3s Camera_Update(Camera* camera) {
}
/**
* When the camera's timer is 0, change the camera to it's parent
* When the camera's timer is 0, change the camera to its parent
*/
void Camera_Finish(Camera* camera) {
Camera* mainCam = camera->globalCtx->cameraPtrs[MAIN_CAM];
@ -7992,6 +8001,7 @@ s32 Camera_ChangeDoorCam(Camera* camera, Actor* doorActor, s16 camDataIdx, f32 a
osSyncPrintf(".... change default door camera (set %d)\n", CAM_SET_DOORC);
} else {
s32 setting = Camera_GetCamDataSetting(camera, camDataIdx);
camera->unk_14A |= 0x40;
if (Camera_ChangeSetting(camera, setting) >= 0) {

View file

@ -325,6 +325,7 @@ void EffectSs_DrawAll(GlobalContext* globalCtx) {
s16 func_80027DD4(s16 arg0, s16 arg1, s32 arg2) {
s16 ret = (arg2 == 0) ? arg1 : (arg0 + (s32)((arg1 - arg0) / (f32)arg2));
return ret;
}

View file

@ -955,6 +955,7 @@ void EnItem00_Draw(Actor* thisx, GlobalContext* globalCtx) {
if (this->unk_15A < 0) {
if (this->unk_15A == -1) {
s8 bankIndex = Object_GetIndex(&globalCtx->objectCtx, OBJECT_GI_HEART);
if (Object_IsLoaded(&globalCtx->objectCtx, bankIndex)) {
this->actor.objBankIndex = bankIndex;
Actor_SetObjectDependency(globalCtx, &this->actor);

View file

@ -65,5 +65,6 @@ u16 sReactionTextIds[][PLAYER_MASK_MAX] = {
u16 Text_GetFaceReaction(GlobalContext* globalCtx, u32 reactionSet) {
u8 currentMask = Player_GetMask(globalCtx);
return sReactionTextIds[reactionSet][currentMask];
}

View file

@ -844,7 +844,7 @@ void Environment_Update(GlobalContext* globalCtx, EnvironmentContext* envCtx, Li
u16 i;
u16 j;
u16 time;
EnvLightSettings* lightSettingsList = globalCtx->envCtx.lightSettingsList; // 7C
EnvLightSettings* lightSettingsList = globalCtx->envCtx.lightSettingsList;
s32 adjustment;
if ((((void)0, gSaveContext.gameMode) != 0) && (((void)0, gSaveContext.gameMode) != 3)) {
@ -1027,7 +1027,6 @@ void Environment_Update(GlobalContext* globalCtx, EnvironmentContext* envCtx, Li
}
}
} else {
// 3200 (l 1608)
if (!envCtx->blendIndoorLights) {
for (i = 0; i < 3; i++) {
envCtx->lightSettings.ambientColor[i] = lightSettingsList[envCtx->unk_BD].ambientColor[i];
@ -1042,7 +1041,6 @@ void Environment_Update(GlobalContext* globalCtx, EnvironmentContext* envCtx, Li
envCtx->lightSettings.fogFar = lightSettingsList[envCtx->unk_BD].fogFar;
envCtx->unk_D8 = 1.0f;
} else {
// 3344 (l 1689)
u8 blendRate = (lightSettingsList[envCtx->unk_BD].fogNear >> 0xA) * 4;
if (blendRate == 0) {

View file

@ -426,6 +426,7 @@ void Gameplay_Update(GlobalContext* globalCtx) {
osSyncPrintf("RomStart RomEnd Size\n");
for (i = 0; i < gObjectTableSize; i++) {
s32 size = gObjectTable[i].vromEnd - gObjectTable[i].vromStart;
osSyncPrintf("%08x-%08x %08x(%8.3fKB)\n", gObjectTable[i].vromStart, gObjectTable[i].vromEnd, size,
size / 1024.0f);
}
@ -1627,6 +1628,7 @@ s32 Gameplay_CameraSetAtEyeUp(GlobalContext* globalCtx, s16 camId, Vec3f* at, Ve
s32 Gameplay_CameraSetFov(GlobalContext* globalCtx, s16 camId, f32 fov) {
s32 ret = Camera_SetParam(globalCtx->cameraPtrs[camId], 0x20, &fov) & 1;
if (1) {}
return ret;
}

View file

@ -66,6 +66,7 @@ s16 Quake_Callback1(QuakeRequest* req, ShakeInfo* shake) {
if (req->countdown > 0) {
f32 a = Math_SinS(req->speed * req->countdown);
Quake_UpdateShakeInfo(req, shake, a, Rand_ZeroOne() * a);
req->countdown--;
}
@ -75,6 +76,7 @@ s16 Quake_Callback1(QuakeRequest* req, ShakeInfo* shake) {
s16 Quake_Callback5(QuakeRequest* req, ShakeInfo* shake) {
if (req->countdown > 0) {
f32 a = Math_SinS(req->speed * req->countdown);
Quake_UpdateShakeInfo(req, shake, a, a);
req->countdown--;
}
@ -94,6 +96,7 @@ s16 Quake_Callback6(QuakeRequest* req, ShakeInfo* shake) {
s16 Quake_Callback3(QuakeRequest* req, ShakeInfo* shake) {
if (req->countdown > 0) {
f32 a = Math_SinS(req->speed * req->countdown) * ((f32)req->countdown / (f32)req->countdownMax);
Quake_UpdateShakeInfo(req, shake, a, a);
req->countdown--;
}
@ -103,6 +106,7 @@ s16 Quake_Callback3(QuakeRequest* req, ShakeInfo* shake) {
s16 Quake_Callback2(QuakeRequest* req, ShakeInfo* shake) {
if (req->countdown > 0) {
f32 a = Rand_ZeroOne();
Quake_UpdateShakeInfo(req, shake, a, Rand_ZeroOne() * a);
req->countdown--;
}
@ -112,6 +116,7 @@ s16 Quake_Callback2(QuakeRequest* req, ShakeInfo* shake) {
s16 Quake_Callback4(QuakeRequest* req, ShakeInfo* shake) {
if (req->countdown > 0) {
f32 a = Rand_ZeroOne() * ((f32)req->countdown / (f32)req->countdownMax);
Quake_UpdateShakeInfo(req, shake, a, Rand_ZeroOne() * a);
req->countdown--;
}

View file

@ -23,6 +23,7 @@ void Sample_Draw(SampleContext* this) {
{
Mtx* mtx = Graph_Alloc(gfxCtx, sizeof(Mtx));
guPosition(mtx, SREG(37), SREG(38), SREG(39), 1.0f, SREG(40), SREG(41), SREG(42));
gSPMatrix(POLY_OPA_DISP++, mtx, G_MTX_LOAD);
}

View file

@ -144,6 +144,7 @@ void func_800A5F60(GraphicsContext* gfxCtx, PSkinAwb* skin, s32 limbIndex, Gfx*
}
if (gfx != NULL) {
Mtx* mtx = SkinMatrix_MtxFToNewMtx(gfxCtx, &D_801600C0[limbIndex]);
if (mtx != NULL) {
gSPMatrix(POLY_OPA_DISP++, mtx, G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
gSPDisplayList(POLY_OPA_DISP++, gfx);

View file

@ -207,6 +207,7 @@ void ViMode_Destroy(ViMode* viMode) {
void ViMode_ConfigureFeatures(ViMode* viMode, s32 viFeatures) {
u32 ctrl = viMode->customViMode.comRegs.ctrl;
if (viFeatures & OS_VI_GAMMA_ON) {
ctrl |= OS_VI_GAMMA;
}

View file

@ -355,7 +355,7 @@ void func_808806BC(BgHakaTrap* this, GlobalContext* globalCtx) {
f32 tempf20;
f32 temp;
s32 i;
UNK_TYPE sp64;
s32 sp64;
this->dyna.actor.velocity.y *= 1.6f;

View file

@ -214,6 +214,7 @@ void BgHidanSima_Update(Actor* thisx, GlobalContext* globalCtx) {
this->actionFunc(this, globalCtx);
if (this->dyna.actor.params != 0) {
s32 temp = (this->dyna.actor.world.rot.y == this->dyna.actor.shape.rot.y) ? this->timer : (this->timer + 80);
if (this->actionFunc == func_8088E7A8) {
temp += 20;
}

View file

@ -127,6 +127,7 @@ void func_80891DD4(BgIceShutter* this, GlobalContext* globalCtx) {
void BgIceShutter_Update(Actor* thisx, GlobalContext* globalCtx) {
BgIceShutter* this = THIS;
this->actionFunc(this, globalCtx);
}

View file

@ -133,6 +133,7 @@ void BgJyaIronobj_SpawnPillarParticles(BgJyaIronobj* this, GlobalContext* global
coss = Math_CosS(rotY);
for (j = 0; j < 32; j++) {
f32 rand = Rand_ZeroOne();
if (rand < 0.1f) {
unkArg5 = 0x60;
} else if (rand < 0.8f) {
@ -191,6 +192,7 @@ void BgJyaIronobj_SpawnThoneParticles(BgJyaIronobj* this, GlobalContext* arg1, E
for (j = 0; j < 32; j++) {
f32 rand = Rand_ZeroOne();
if (rand < 0.1f) {
unkArg5 = 0x60;
} else if (rand < 0.8f) {

View file

@ -110,6 +110,7 @@ void BgMjin_Draw(Actor* thisx, GlobalContext* globalCtx) {
if (thisx->params != 0) {
// thisx is required
s32 objBankIndex = Object_GetIndex(&globalCtx->objectCtx, sObjectIDs[thisx->params - 1]);
if (objBankIndex >= 0) {
gSegments[6] = VIRTUAL_TO_PHYSICAL(globalCtx->objectCtx.status[objBankIndex].segment);
}

View file

@ -66,6 +66,7 @@ void BgTokiHikari_DoNothing(BgTokiHikari* this, GlobalContext* globalCtx) {
void BgTokiHikari_Update(Actor* thisx, GlobalContext* globalCtx) {
BgTokiHikari* this = THIS;
this->actionFunc(this, globalCtx);
}

View file

@ -109,7 +109,6 @@ void BgVbSima_Update(Actor* thisx, GlobalContext* globalCtx) {
} else {
edgeZ = 80.0f;
if (Rand_ZeroOne() < 0.5f) {
// minus1 = -1.0f; // Not a fake match; the game really does this.
edgeZ = 80.0f * minus1;
}
edgeX = Rand_CenteredFloat(160.0f);

View file

@ -416,6 +416,7 @@ void BgYdanSp_WallWebIdle(BgYdanSp* this, GlobalContext* globalCtx) {
void BgYdanSp_Update(Actor* thisx, GlobalContext* globalCtx) {
BgYdanSp* this = THIS;
this->actionFunc(this, globalCtx);
}

View file

@ -1053,6 +1053,7 @@ s32 BossDodongo_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx**
f32 mtxScaleY;
f32 mtxScaleZ;
BossDodongo* this = THIS;
// required for matching
if ((limbIndex == 6) || (limbIndex == 7)) {
if (this->unk_25C) {}

View file

@ -912,6 +912,7 @@ void BossGoma_Encounter(BossGoma* this, GlobalContext* globalCtx) {
if (this->framesUntilNextAction != 0) {
f32 s = sinf(this->framesUntilNextAction * 3.1415f * 0.5f);
this->subCameraAt.y = this->framesUntilNextAction * s * 0.7f + this->actor.world.pos.y;
} else {
Math_ApproachF(&this->subCameraAt.y, this->actor.focus.pos.y, 0.1f, 10.0f);

View file

@ -407,27 +407,26 @@ void BossMo_SetupTentacle(BossMo* this, GlobalContext* globalCtx) {
}
void BossMo_Tentacle(BossMo* this, GlobalContext* globalCtx) {
// variables marked real are put on the stack and cannot be reordered
s16 tentXrot;
s16 sp1B4 = 0; // real
s16 sp1B4 = 0;
s32 buttons;
Player* player = GET_PLAYER(globalCtx);
s16 indS0;
s16 indS1;
Camera* camera1;
Camera* camera2;
BossMo* otherTent = (BossMo*)this->otherTent; // real
f32 maxSwingRateX; // real
f32 maxSwingLagX; // real
f32 maxSwingSizeX; // real
f32 maxSwingRateZ; // real
f32 maxSwingLagZ; // real
f32 maxSwingSizeZ; // real
f32 swingRateAccel; // real
f32 swingSizeAccel; // real
s16 rippleCount; // real
BossMo* otherTent = (BossMo*)this->otherTent;
f32 maxSwingRateX;
f32 maxSwingLagX;
f32 maxSwingSizeX;
f32 maxSwingRateZ;
f32 maxSwingLagZ;
f32 maxSwingSizeZ;
f32 swingRateAccel;
f32 swingSizeAccel;
s16 rippleCount;
s16 indT5;
Vec3f ripplePos; // real
Vec3f ripplePos;
f32 randAngle;
f32 randFloat;
f32 tempf1;
@ -438,21 +437,21 @@ void BossMo_Tentacle(BossMo* this, GlobalContext* globalCtx) {
f32 dx;
f32 dy;
f32 dz;
Vec3f sp138; // real
Vec3f sp12C; // real
Vec3f sp120; // real
Vec3f sp138;
Vec3f sp12C;
Vec3f sp120;
s32 pad11C;
s32 pad118;
s32 pad114;
s32 pad110;
s32 pad10C;
s32 pad108;
Vec3f spFC; // real
Vec3f spF0; // real
Vec3f spFC;
Vec3f spF0;
f32 padEC;
Vec3f spE0; // real
Vec3f spD4; // real
Vec3f spC8; // real
Vec3f spE0;
Vec3f spD4;
Vec3f spC8;
if (this->work[MO_TENT_ACTION_STATE] <= MO_TENT_DEATH_3) {
this->actor.world.pos.y = MO_WATER_LEVEL(globalCtx);
@ -1117,8 +1116,8 @@ void BossMo_Tentacle(BossMo* this, GlobalContext* globalCtx) {
(this->work[MO_TENT_ACTION_STATE] == MO_TENT_DEATH_2) || (this->work[MO_TENT_ACTION_STATE] == MO_TENT_CURL) ||
(this->work[MO_TENT_ACTION_STATE] == MO_TENT_GRAB)) &&
(Rand_ZeroOne() < 0.8f) && (this->actor.scale.x > 0.001f)) {
Vec3f pos; // real
Vec3f velocity = { 0.0f, 0.0f, 0.0f }; // real
Vec3f pos;
Vec3f velocity = { 0.0f, 0.0f, 0.0f };
f32 scale;
f32 temp;

View file

@ -1093,6 +1093,7 @@ void BossTw_ShootBeam(BossTw* this, GlobalContext* globalCtx) {
case 0:
if (this->timers[0] != 0) {
s32 beamReflection = BossTw_CheckBeamReflection(this, globalCtx);
if (beamReflection == 1) {
Vec3f pos;
Vec3f velocity;

View file

@ -3594,6 +3594,7 @@ void BossVa_DrawEffects(BossVaEffect* effect, GlobalContext* globalCtx) {
for (i = 0, flag = 0; i < ARRAY_COUNT(sVaEffects); i++, effect++) {
if (effect->type == VA_TUMOR) {
BossVa* parent = effect->parent;
if (!flag) {
func_80093D18(globalCtx->state.gfxCtx);
gDPSetEnvColor(POLY_OPA_DISP++, 0, 0, 0, effect->envColor[3]);

View file

@ -886,6 +886,7 @@ void func_8096F544(DemoEc* this, s32 changeAnim) {
void func_8096F578(DemoEc* this, GlobalContext* globalCtx, s32 arg2) {
CsCmdActorAction* npcAction;
s32 sp18;
npcAction = DemoEc_GetNpcAction(globalCtx, arg2);
if (npcAction != NULL) {
sp18 = npcAction->action;

View file

@ -1134,7 +1134,7 @@ void DemoEffect_UpdateLgtShower(DemoEffect* this, GlobalContext* globalCtx) {
* Update action for the God Lgt Din Actor.
* This is the Goddess Din.
* This function moves God Lgt Din based on the current cutscene command.
* This function also spawns a Fireball Actor and sets it's update function to the special InitCreationFireball.
* This function also spawns a Fireball Actor and sets its update function to the special InitCreationFireball.
* The spawned Fireball Actor is also scaled to be smaller than regular by this function.
*/
void DemoEffect_UpdateGodLgtDin(DemoEffect* this, GlobalContext* globalCtx) {

View file

@ -157,6 +157,7 @@ void func_809781FC(DemoGeff* this, GlobalContext* globalCtx) {
void func_809782A0(DemoGeff* this, GlobalContext* globalCtx) {
DemoGt* demoGt = this->demoGt;
s16 params = this->actor.params;
if (demoGt != NULL && (params != 6) && (params != 7) && (params != 8)) {
this->actor.world.pos.x = demoGt->dyna.actor.world.pos.x + this->deltaPosX;
this->actor.world.pos.y = demoGt->dyna.actor.world.pos.y + this->deltaPosY;

View file

@ -107,6 +107,7 @@ void func_8097C9B8(DemoGo* this) {
void func_8097C9DC(DemoGo* this) {
s32 pad[2];
if (Animation_OnFrame(&this->skelAnime, 12.0f) || Animation_OnFrame(&this->skelAnime, 25.0f)) {
func_80078914(&this->actor.projectedPos, NA_SE_EN_MORIBLIN_WALK);
}

View file

@ -648,6 +648,7 @@ void func_809862E0(DemoIm* this, GlobalContext* globalCtx) {
if (npcAction != NULL) {
u32 action = npcAction->action;
u32 unk_274 = this->unk_274;
if (action != unk_274) {
switch (action) {
case 1:

View file

@ -873,6 +873,7 @@ void DemoKankyo_DrawWarpSparkles(Actor* thisx, GlobalContext* globalCtx) {
sWarpSparkleEnvColors[globalCtx->msgCtx.lastPlayedSong].b, 255);
} else {
s8 respawnData = gSaveContext.respawn[1].data;
gDPSetEnvColor(POLY_XLU_DISP++, sWarpSparkleEnvColors[respawnData].r,
sWarpSparkleEnvColors[respawnData].g, sWarpSparkleEnvColors[respawnData].b, 255);
}

View file

@ -96,6 +96,7 @@ void DoorAna_Destroy(Actor* thisx, GlobalContext* globalCtx) {
// update routine for grottos that are currently "hidden"/unopened
void DoorAna_WaitClosed(DoorAna* this, GlobalContext* globalCtx) {
u32 openGrotto = false;
if (!(this->actor.params & 0x200)) {
// opening with song of storms
if (this->actor.xyzDistToPlayerSq < 40000.0f && Flags_GetEnv(globalCtx, 5)) {

View file

@ -37,8 +37,6 @@ static InitChainEntry sInitChain[] = {
ICHAIN_VEC3F(scale, 1, ICHAIN_STOP),
};
extern UNK_TYPE D_80994B70;
void DoorGerudo_Init(Actor* thisx, GlobalContext* globalCtx) {
s32 pad;
DoorGerudo* this = THIS;

View file

@ -234,6 +234,7 @@ void EnAnubiceFire_Draw(Actor* thisx, GlobalContext* globalCtx) {
Matrix_Push();
for (i = this->unk_15E; i < 6; ++i) {
f32 scale = this->actor.scale.x - (i * 0.2f);
if (scale < 0.0f) {
scale = 0.0f;
}

View file

@ -100,6 +100,7 @@ void func_809C1E00(EnBird* this, s16 params) {
void func_809C1E40(EnBird* this, GlobalContext* globalCtx) {
f32 fVar4 = sinf(this->unk_1B4);
this->actor.shape.yOffset += fVar4 * this->unk_1A0;
Math_SmoothStepToF(&this->actor.speedXZ, this->unk_1A8, 0.1f, this->unk_1AC, 0.0f);

View file

@ -166,7 +166,7 @@ void EnBoom_Fly(EnBoom* this, GlobalContext* globalCtx) {
}
}
// Decrement the return timer and check if its 0. If it is, check if Link can catch it and handle accordingly.
// Decrement the return timer and check if it's 0. If it is, check if Link can catch it and handle accordingly.
// Otherwise handle grabbing and colliding.
if (DECR(this->returnTimer) == 0) {
distFromLink = Math_Vec3f_DistXYZ(&this->actor.world.pos, &player->actor.focus.pos);
@ -179,7 +179,7 @@ void EnBoom_Fly(EnBoom* this, GlobalContext* globalCtx) {
Math_Vec3f_Copy(&target->world.pos, &player->actor.world.pos);
// If the grabbed actor is EnItem00 (HP/Key etc) set gravity and flags so it falls in front of Link.
// Otherwise if its a Skulltula Token, just set flags so he collides with it to collect it.
// Otherwise if it's a Skulltula Token, just set flags so he collides with it to collect it.
if (target->id == ACTOR_EN_ITEM00) {
target->gravity = -0.9f;
target->bgCheckFlags &= ~0x03;
@ -202,7 +202,7 @@ void EnBoom_Fly(EnBoom* this, GlobalContext* globalCtx) {
&hitPoint, &this->actor.wallPoly, true, true, true, true, &hitDynaID);
if (collided) {
// If the boomerang collides with something and its is a Jabu Object actor with params equal to 0, then
// If the boomerang collides with something and it's is a Jabu Object actor with params equal to 0, then
// set collided to 0 so that the boomerang will go through the wall.
// Otherwise play a clank sound and keep collided set to bounce back.
if (func_8002F9EC(globalCtx, &this->actor, this->actor.wallPoly, hitDynaID, &hitPoint) != 0 ||

View file

@ -224,6 +224,7 @@ void EnBx_Draw(Actor* thisx, GlobalContext* globalCtx) {
for (i = 3; i >= 0; i--) {
s16 off = (0x2000 * i);
this->unk_184[i].z = this->unk_184[i].x = (Math_CosS(this->unk_14E + off) * 0.0075f) + 0.015f;
this->unk_1B4[i].x = thisx->shape.rot.x;
this->unk_1B4[i].y = thisx->shape.rot.y;

View file

@ -293,6 +293,7 @@ void EnDoor_Open(EnDoor* this, GlobalContext* globalCtx) {
void EnDoor_Update(Actor* thisx, GlobalContext* globalCtx) {
EnDoor* this = THIS;
this->actionFunc(this, globalCtx);
}

View file

@ -76,6 +76,7 @@ void EnEncount2_Wait(EnEncount2* this, GlobalContext* globalCtx) {
}
} else if ((this->actor.xzDistToPlayer < 700.0f) && (Flags_GetSwitch(globalCtx, 0x37))) {
s16 scene = globalCtx->sceneNum;
if (((scene == SCENE_GANON_DEMO) || (scene == SCENE_GANON_FINAL) || (scene == SCENE_GANON_SONOGO) ||
(scene == SCENE_GANONTIKA_SONOGO)) &&
(!this->collapseSpawnerInactive)) {

View file

@ -318,6 +318,7 @@ void EnFireRock_Update(Actor* thisx, GlobalContext* globalCtx) {
if (this->type != FIRE_ROCK_CEILING_SPOT_SPAWNER) {
f32 temp;
this->rockRotation.x += this->angularVelocity.x;
this->rockRotation.y += this->angularVelocity.y;
this->rockRotation.z += this->angularVelocity.z;

View file

@ -232,6 +232,7 @@ void EnFloormas_SetupRun(EnFloormas* this) {
void EnFloormas_SetupTurn(EnFloormas* this) {
s16 rotDelta = this->actionTarget - this->actor.shape.rot.y;
this->actor.speedXZ = 0.0f;
if (rotDelta > 0) {
Animation_MorphToPlayOnce(&this->skelAnime, &gFloormasterTurnAnim, -3.0f);
@ -470,6 +471,7 @@ void EnFloormas_Stand(EnFloormas* this, GlobalContext* globalCtx) {
void EnFloormas_BigWalk(EnFloormas* this, GlobalContext* globalCtx) {
s32 animPastFrame;
SkelAnime_Update(&this->skelAnime);
animPastFrame = Animation_OnFrame(&this->skelAnime, 0.0f);
if (animPastFrame) {
@ -1082,6 +1084,7 @@ void EnFloormas_Update(Actor* thisx, GlobalContext* globalCtx) {
s32 EnFloormas_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot,
void* thisx, Gfx** gfx) {
EnFloormas* this = THIS;
if (limbIndex == 1) {
pos->z += this->zOffset;
}

View file

@ -746,6 +746,7 @@ void EnFr_ChildSong(EnFr* this, GlobalContext* globalCtx) {
void EnFr_ChildSongFirstTime(EnFr* this, GlobalContext* globalCtx) {
EnFr* frog = sEnFrPointers.frogs[sSongToFrog[this->songIndex]];
if (frog->isActive == false) {
this->actor.textId = 0x40A9;
EnFr_SetupReward(this, globalCtx, true);

View file

@ -417,6 +417,7 @@ void EnGoma_Dead(EnGoma* this, GlobalContext* globalCtx) {
if (this->actionTimer == 0 && Math_SmoothStepToF(&this->actor.scale.y, 0.0f, 0.5f, 0.00225f, 0.00001f) <= 0.001f) {
if (this->actor.params < 6) {
BossGoma* parent = (BossGoma*)this->actor.parent;
parent->childrenGohmaState[this->actor.params] = -1;
}
Audio_PlaySoundGeneral(NA_SE_EN_EXTINCT, &this->actor.projectedPos, 4, &D_801333E0, &D_801333E0, &D_801333E8);
@ -659,6 +660,7 @@ void EnGoma_UpdateHit(EnGoma* this, GlobalContext* globalCtx) {
// die if still an egg
if (this->actor.params <= 5) { //! BossGoma only has 3 children
BossGoma* parent = (BossGoma*)this->actor.parent;
parent->childrenGohmaState[this->actor.params] = -1;
}

View file

@ -725,7 +725,7 @@ void EnGoroiwa_Update(Actor* thisx, GlobalContext* globalCtx) {
EnGoroiwa* this = THIS;
Player* player = GET_PLAYER(globalCtx);
s32 pad;
UNK_TYPE sp30;
s32 sp30;
if (!(player->stateFlags1 & 0x300000C0)) {
if (this->collisionDisabledTimer > 0) {

View file

@ -275,6 +275,7 @@ void func_80A56994(EnHeishi4* this, GlobalContext* globalCtx) {
void func_80A56A50(EnHeishi4* this, GlobalContext* globalCtx) {
f32 frames = Animation_GetLastFrame(&gEnHeishiDyingGuardDieAnim);
this->unk_288 = frames;
Animation_Change(&this->skelAnime, &gEnHeishiDyingGuardDieAnim, 1.0f, 0.0f, frames, ANIMMODE_ONCE, -10.0f);
this->actionFunc = func_80A56ACC;

View file

@ -103,6 +103,7 @@ void EnHintnuts_Init(Actor* thisx, GlobalContext* globalCtx) {
void EnHintnuts_Destroy(Actor* thisx, GlobalContext* globalCtx) {
EnHintnuts* this = THIS;
if (this->actor.params != 0xA) {
Collider_DestroyCylinder(globalCtx, &this->collider);
}

View file

@ -317,6 +317,7 @@ void EnHoll_NextAction(EnHoll* this, GlobalContext* globalCtx) {
void EnHoll_Update(Actor* thisx, GlobalContext* globalCtx) {
EnHoll* this = THIS;
this->actionFunc(this, globalCtx);
}

View file

@ -472,6 +472,7 @@ s32 EnHorse_BgCheckBridgeJumpPoint(EnHorse* this, GlobalContext* globalCtx) {
xMax = (xMin + sBridgeJumps[i].xMax) + sBridgeJumps[i].xOffset;
if (xMax < xMin) {
f32 temp = xMin;
xMin = xMax;
xMax = temp;
}
@ -504,6 +505,7 @@ s32 EnHorse_CheckBridgeJumps(EnHorse* this, GlobalContext* globalCtx) {
if (xMax < xMin) {
f32 temp = xMin;
xMin = xMax;
xMax = temp;
}
@ -987,6 +989,7 @@ void EnHorse_UpdateSpeed(EnHorse* this, GlobalContext* globalCtx, f32 brakeDecel
f32 temp_f12;
f32 traction;
s16 turn;
if (!EnHorse_PlayerCanMove(this, globalCtx)) {
if (this->actor.speedXZ > 8) {
this->actor.speedXZ -= decel;

View file

@ -609,6 +609,7 @@ s32 func_80A6AD84(Actor* thisx, GlobalContext* globalCtx, s32 arg2, PSkinAwb* ar
if (arg2 == 0xD) {
u8 index = sEyeIndexOrder[this->eyeTexIndex];
gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sEyeTextures[index]));
}

View file

@ -1171,6 +1171,7 @@ void EnIk_PostLimbDraw2(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Ve
switch (limbIndex) {
case 13: {
EnIk* this = THIS;
if (EnIk_curFrame(&this->actor) < 30.0f) {
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx, "../z_en_ik_inAwake.c", 267),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
@ -1189,9 +1190,8 @@ void EnIk_PostLimbDraw2(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Ve
break;
case 26: {
EnIk* this = THIS;
if (EnIk_curFrame(&this->actor) < 30.0f) {
// s32 pad;
if (EnIk_curFrame(&this->actor) < 30.0f) {
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx, "../z_en_ik_inAwake.c", 288),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_XLU_DISP++, object_ik_DL_016BE0);
@ -1199,9 +1199,8 @@ void EnIk_PostLimbDraw2(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Ve
} break;
case 27: {
EnIk* this = THIS;
if (EnIk_curFrame(&this->actor) < 30.0f) {
// s32 pad;
if (EnIk_curFrame(&this->actor) < 30.0f) {
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx, "../z_en_ik_inAwake.c", 297),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_XLU_DISP++, object_ik_DL_016CD8);

View file

@ -324,6 +324,7 @@ void func_80A89A6C(EnJsjutan* this, GlobalContext* globalCtx) {
f32 rotX;
f32 rotZ;
s32 pad;
// Carpet size is 12x12.
if ((i % 12) == 11) { // Last column.
j = i - 1;

View file

@ -544,6 +544,7 @@ s16 func_80A97738(GlobalContext* globalCtx, Actor* thisx) {
s32 EnKo_GetForestQuestState(EnKo* this) {
s32 result;
if (!LINK_IS_ADULT) {
// Obtained Zelda's Letter
if (gSaveContext.eventChkInf[4] & 1) {

View file

@ -85,6 +85,7 @@ static void* sEyeTextures[] = {
u16 EnMa1_GetText(GlobalContext* globalCtx, Actor* thisx) {
u16 faceReaction = Text_GetFaceReaction(globalCtx, 0x17);
if (faceReaction != 0) {
return faceReaction;
}

View file

@ -64,6 +64,7 @@ static struct_D_80AA1678 sAnimationInfo[] = {
u16 func_80AA19A0(GlobalContext* globalCtx, Actor* thisx) {
u16 faceReaction = Text_GetFaceReaction(globalCtx, 23);
if (faceReaction != 0) {
return faceReaction;
}

View file

@ -1166,11 +1166,13 @@ void func_80AB36DC(EnNb* this, GlobalContext* globalCtx) {
if ((((u16)((u16)(kREG(17) + 25) - 4))) > moveTime) {
s16 invScale = 4 - moveTime;
if (invScale > 0) {
Math_SmoothStepToS(&this->actor.shape.rot.y, this->pathYaw, invScale, 6200, 100);
}
} else {
s16 invScale = (u16)(kREG(17) + 25) - moveTime;
if (invScale > 0) {
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.home.rot.y, invScale, 6200, 100);
}

View file

@ -552,6 +552,7 @@ void EnNy_Draw(Actor* thisx, GlobalContext* globalCtx) {
Vec3f tempVec;
Vec3f* fireOffset;
s16 temp;
temp = this->unk_1CA - 1;
this->actor.colorFilterTimer++;
if (temp == 0) {

View file

@ -254,7 +254,7 @@ void func_80ABF4C8(EnOkarinaTag* this, GlobalContext* globalCtx) {
gSaveContext.cutsceneTrigger = 1;
break;
case 6:
globalCtx->csCtx.segment = LINK_IS_ADULT ? SEGMENTED_TO_VIRTUAL(&spot02_sceneCutsceneData0x003C80)
globalCtx->csCtx.segment = LINK_IS_ADULT ? SEGMENTED_TO_VIRTUAL(&spot02_scene_Cs_003C80)
: SEGMENTED_TO_VIRTUAL(&spot02_scene_Cs_005020);
gSaveContext.cutsceneTrigger = 1;
gSaveContext.eventChkInf[1] |= 0x2000;

View file

@ -120,7 +120,7 @@ void EnOkuta_Init(Actor* thisx, GlobalContext* globalCtx) {
s32 pad;
WaterBox* outWaterBox;
f32 ySurface;
UNK_TYPE sp30;
s32 sp30;
Actor_ProcessInitChain(thisx, sInitChain);
this->numShots = (thisx->params >> 8) & 0xFF;

View file

@ -455,6 +455,7 @@ void EnOssan_UpdateShopOfferings(EnOssan* this, GlobalContext* globalCtx) {
shopItem = &storeItems[i];
if (shopItem->shopItemIndex >= 0 && this->shelfSlots[i] == NULL) {
s16 params = sShopItemReplaceFunc[shopItem->shopItemIndex](shopItem->shopItemIndex);
if (params >= 0) {
this->shelfSlots[i] = (EnGirlA*)Actor_Spawn(
&globalCtx->actorCtx, globalCtx, ACTOR_EN_GIRLA,

View file

@ -591,6 +591,7 @@ void func_80ACB148(EnOwl* this, GlobalContext* globalCtx) {
void EnOwl_WaitHyliaShortcut(EnOwl* this, GlobalContext* globalCtx) {
u16 textId = (gSaveContext.infTable[25] & 0x20) ? 0x4004 : 0x4003;
// Spoke to Owl in Lake Hylia
EnOwl_LookAtLink(this, globalCtx);
if (func_80ACA558(this, globalCtx, textId)) {

View file

@ -183,6 +183,7 @@ void func_80ACE5C8(EnPart* this, GlobalContext* globalCtx) {
if (sqrt(this->actor.xyzDistToPlayerSq) <= 40.0f) {
u8 prevInvincibilityTimer = player->invincibilityTimer;
if (player->invincibilityTimer <= 0) {
if (player->invincibilityTimer <= -40) {
player->invincibilityTimer = 0;
@ -217,6 +218,7 @@ void func_80ACE7E8(EnPart* this, GlobalContext* globalCtx) {
if (this->timer == 0) {
f32 diffsSum = Math_SmoothStepToF(&this->actor.world.pos.x, this->actor.home.pos.x, 1.0f, 5.0f, 0.0f);
diffsSum += Math_SmoothStepToF(&this->actor.world.pos.y, this->actor.home.pos.y, 1.0f, 5.0f, 0.0f);
diffsSum += Math_SmoothStepToF(&this->actor.world.pos.z, this->actor.home.pos.z, 1.0f, 5.0f, 0.0f);
diffsSum += Math_SmoothStepToF(&this->rotZ, 0.0f, 1.0f, 0.25f, 0.0f);

View file

@ -284,6 +284,7 @@ void EnPeehat_HitWhenGrounded(EnPeehat* this, GlobalContext* globalCtx) {
this->colCylinder.base.acFlags &= ~AC_HIT;
if ((globalCtx->gameplayFrames & 0xF) == 0) {
Vec3f itemDropPos = this->actor.world.pos;
itemDropPos.y += 70.0f;
Item_DropCollectibleRandom(globalCtx, &this->actor, &itemDropPos, 0x40);
Item_DropCollectibleRandom(globalCtx, &this->actor, &itemDropPos, 0x40);
@ -291,6 +292,7 @@ void EnPeehat_HitWhenGrounded(EnPeehat* this, GlobalContext* globalCtx) {
this->unk2D4 = 240;
} else {
s32 i;
this->colCylinder.base.acFlags &= ~AC_HIT;
for (i = MAX_LARVA - this->unk2FA; i > 0; i--) {
Actor* larva =
@ -298,6 +300,7 @@ void EnPeehat_HitWhenGrounded(EnPeehat* this, GlobalContext* globalCtx) {
Rand_CenteredFloat(25.0f) + this->actor.world.pos.x,
Rand_CenteredFloat(25.0f) + (this->actor.world.pos.y + 50.0f),
Rand_CenteredFloat(25.0f) + this->actor.world.pos.z, 0, 0, 0, PEAHAT_TYPE_LARVA);
if (larva != NULL) {
larva->velocity.y = 6.0f;
larva->shape.rot.y = larva->world.rot.y = Rand_CenteredFloat(0xFFFF);

View file

@ -977,6 +977,7 @@ void func_80ADB770(EnPoSisters* this, GlobalContext* globalCtx) {
}
} else if (this->unk_195 != 0) {
EnPoSisters* realMeg = (EnPoSisters*)this->actor.parent;
if (realMeg->actionFunc == func_80ADAAA4) {
func_80AD95D8(this);
}
@ -1195,7 +1196,7 @@ void EnPoSisters_Update(Actor* thisx, GlobalContext* globalCtx) {
Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 20.0f, 20.0f, 0.0f, 5);
} else {
Vec3f vec;
UNK_TYPE sp34;
s32 sp34;
vec.x = this->actor.world.pos.x;
vec.y = this->actor.world.pos.y + 10.0f;

View file

@ -990,7 +990,7 @@ void EnPoh_UpdateLiving(Actor* thisx, GlobalContext* globalCtx) {
EnPoh* this = THIS;
s32 pad;
Vec3f vec;
UNK_TYPE sp38;
s32 sp38;
if (this->colliderSph.base.atFlags & AT_HIT) {
this->colliderSph.base.atFlags &= ~AT_HIT;
@ -1180,6 +1180,7 @@ void EnPoh_DrawSoul(Actor* thisx, GlobalContext* globalCtx) {
if (this->infoIdx == EN_POH_INFO_COMPOSER) {
Color_RGBA8* envColor = (this->actor.params == EN_POH_SHARP) ? &D_80AE1B4C : &D_80AE1B50;
s32 pad;
gSPDisplayList(POLY_OPA_DISP++, gPoeComposerLanternBottomDL);
gDPPipeSync(POLY_OPA_DISP++);
gDPSetEnvColor(POLY_OPA_DISP++, envColor->r, envColor->g, envColor->b, 255);

View file

@ -482,6 +482,7 @@ void func_80AEB7D0(EnRu1* this) {
f32 func_80AEB7E0(CsCmdActorAction* csCmdNPCAction, GlobalContext* globalCtx) {
s32 csCtxFrames = globalCtx->csCtx.frames;
if ((csCtxFrames < csCmdNPCAction->endFrame) && (csCmdNPCAction->endFrame - csCmdNPCAction->startFrame > 0)) {
return (Math_CosS(((csCtxFrames - csCmdNPCAction->startFrame) /
(f32)(csCmdNPCAction->endFrame - csCmdNPCAction->startFrame)) *
@ -548,6 +549,7 @@ void func_80AEBA2C(EnRu1* this, GlobalContext* globalCtx) {
f32 temp_ret_2;
CsCmdActorAction* csCmdNPCAction = func_80AEB438(globalCtx);
s32 pad2;
if (csCmdNPCAction != NULL) {
temp_ret_2 = func_80AEB7E0(csCmdNPCAction, globalCtx);
thisPos = &this->actor.world.pos;
@ -1513,6 +1515,7 @@ s32 func_80AEE264(EnRu1* this, GlobalContext* globalCtx) {
void func_80AEE2F8(EnRu1* this, GlobalContext* globalCtx) {
DynaPolyActor* dynaPolyActor;
s32 floorBgId;
if ((this->actor.bgCheckFlags & 1) && (this->actor.floorBgId != BGCHECK_SCENE)) {
floorBgId = this->actor.floorBgId;
dynaPolyActor = DynaPoly_GetActor(&globalCtx->colCtx, floorBgId);

View file

@ -314,7 +314,7 @@ void func_80AF2BC0(EnRu2* this, GlobalContext* globalCtx) {
}
}
void func_80AF2C54(EnRu2* this, UNK_TYPE arg1) {
void func_80AF2C54(EnRu2* this, s32 arg1) {
if (arg1 != 0) {
this->action = 5;
}
@ -355,7 +355,7 @@ void func_80AF2D2C(EnRu2* this, GlobalContext* globalCtx) {
}
void func_80AF2D6C(EnRu2* this, GlobalContext* globalCtx) {
UNK_TYPE something;
s32 something;
func_80AF2744(this, globalCtx);
something = EnRu2_UpdateSkelAnime(this);
@ -531,7 +531,7 @@ void func_80AF34F0(EnRu2* this) {
this->action = 13;
}
void func_80AF3530(EnRu2* this, UNK_TYPE arg1) {
void func_80AF3530(EnRu2* this, s32 arg1) {
if (arg1 != 0) {
func_80AF28E8(this, &gAdultRutoLookingDownLeftAnim, 0, 0.0f, 0);
}
@ -583,7 +583,7 @@ void func_80AF366C(EnRu2* this, GlobalContext* globalCtx) {
}
void func_80AF36AC(EnRu2* this, GlobalContext* globalCtx) {
UNK_TYPE something;
s32 something;
func_80AF2744(this, globalCtx);
something = EnRu2_UpdateSkelAnime(this);

View file

@ -591,7 +591,7 @@ void func_80AF683C(EnSa* this, GlobalContext* globalCtx) {
Player* player = GET_PLAYER(globalCtx);
if (!(player->actor.world.pos.z >= -2220.0f) && !Gameplay_InCsMode(globalCtx)) {
globalCtx->csCtx.segment = SEGMENTED_TO_VIRTUAL(spot05_sceneCutsceneData0x005730);
globalCtx->csCtx.segment = SEGMENTED_TO_VIRTUAL(spot05_scene_Cs_005730);
gSaveContext.cutsceneTrigger = 1;
this->actionFunc = func_80AF68E4;
}

View file

@ -176,6 +176,7 @@ void EnSkb_Init(Actor* thisx, GlobalContext* globalCtx) {
void EnSkb_Destroy(Actor* thisx, GlobalContext* globalCtx) {
EnSkb* this = THIS;
if (this->actor.parent != NULL) {
EnEncount1* spawner = (EnEncount1*)this->actor.parent;
@ -378,6 +379,7 @@ void func_80AFD644(EnSkb* this) {
void func_80AFD6CC(EnSkb* this, GlobalContext* globalCtx) {
// this cast is likely not real, but allows for a match
u8* new_var;
new_var = &this->unk_283;
if ((this->unk_283 != 1) || BodyBreak_SpawnParts(&this->actor, &this->bodyBreak, globalCtx, 1)) {
if ((*new_var) != 0) {

View file

@ -1113,6 +1113,7 @@ void EnSkj_SetupWaitForLandAnimFinish(EnSkj* this) {
void EnSkj_WaitForLandAnimFinish(EnSkj* this, GlobalContext* globalCtx) {
s16 lastFrame = Animation_GetLastFrame(&gSkullKidLandAnim);
if (this->skelAnime.curFrame == lastFrame) {
EnSkj_SetupWalkToPlayer(this);
}

View file

@ -774,6 +774,7 @@ void func_80B1585C(EnTa* this, GlobalContext* globalCtx) {
if (this->superCuccos[i] != NULL) {
EnNiw* niw = this->superCuccos[i];
niw->unk_308 = 1;
niw->actor.gravity = 0.0f;
}
@ -1181,6 +1182,7 @@ s32 EnTa_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList,
this->unk_2E0 &= ~0x8;
} else if ((limbIndex == 8) || (limbIndex == 10) || (limbIndex == 13)) {
s32 limbIdx50 = limbIndex * 50;
rot->y += Math_SinS(globalCtx->state.frames * (limbIdx50 + 0x814)) * 200.0f;
rot->z += Math_CosS(globalCtx->state.frames * (limbIdx50 + 0x940)) * 200.0f;
}

View file

@ -1004,6 +1004,7 @@ void EnTite_Draw(Actor* thisx, GlobalContext* globalCtx) {
if ((this->spawnIceTimer & 3) == 0) {
Vec3f iceChunk;
s32 idx = this->spawnIceTimer >> 2;
iceChunk.x = thisx->world.pos.x + sIceChunks[idx].x;
iceChunk.y = thisx->world.pos.y + sIceChunks[idx].y;
iceChunk.z = thisx->world.pos.z + sIceChunks[idx].z;

View file

@ -288,6 +288,7 @@ s32 EnXc_MinuetCS(EnXc* this, GlobalContext* globalCtx) {
if (this->actor.params == SHEIK_TYPE_MINUET) {
Player* player = GET_PLAYER(globalCtx);
f32 z = player->actor.world.pos.z;
if (z < -2225.0f) {
if (!Gameplay_InCsMode(globalCtx)) {
globalCtx->csCtx.segment = SEGMENTED_TO_VIRTUAL(&gMinuetCs);
@ -347,6 +348,7 @@ s32 EnXc_SerenadeCS(EnXc* this, GlobalContext* globalCtx) {
if (this->actor.params == SHEIK_TYPE_SERENADE) {
Player* player = GET_PLAYER(globalCtx);
s32 stateFlags = player->stateFlags1;
if (CHECK_OWNED_EQUIP(EQUIP_BOOTS, 1) && !(gSaveContext.eventChkInf[5] & 4) && !(stateFlags & 0x20000000) &&
!Gameplay_InCsMode(globalCtx)) {
Cutscene_SetSegment(globalCtx, &gIceCavernSerenadeCs);
@ -491,6 +493,7 @@ void EnXc_SpawnFlame(EnXc* this, GlobalContext* globalCtx) {
f32 xPos = npcAction->startPos.x;
f32 yPos = npcAction->startPos.y;
f32 zPos = npcAction->startPos.z;
this->flameActor = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_LIGHT, xPos, yPos, zPos, 0, 0, 0, 5);
sFlameSpawned = true;
}
@ -526,6 +529,7 @@ void EnXc_InitFlame(EnXc* this, GlobalContext* globalCtx) {
CsCmdActorAction* npcAction = EnXc_GetCsCmd(globalCtx, 0);
if (npcAction != NULL) {
s32 action = npcAction->action;
if (D_80B41DA8 != action) {
if (action != 1) {
EnXc_SpawnFlame(this, globalCtx);
@ -564,6 +568,7 @@ AnimationHeader* EnXc_GetCurrentHarpAnim(GlobalContext* globalCtx, s32 index) {
if (npcAction != NULL) {
u16 action = npcAction->action;
if (action == 11) {
animation = &gSheikPlayingHarp3Anim;
} else if (action == 12) {
@ -1570,6 +1575,7 @@ void EnXc_CalcTriforce(Actor* thisx, GlobalContext* globalCtx) {
if (this->unk_274 == 1) {
if (*timer < kREG(25) + 40.0f) {
f32 div = *timer / (kREG(25) + 40.0f);
prim[2] = -85.0f * div + 255;
prim[3] = 255.0f * div;
env[1] = 100.0f * div + 100;
@ -1584,6 +1590,7 @@ void EnXc_CalcTriforce(Actor* thisx, GlobalContext* globalCtx) {
scale[2] = kREG(21) * 0.1f + 40.0f;
} else if (this->unk_274 == 2) {
f32 maxTime = (kREG(25) + 40.0f) + (kREG(27) + 90.0f);
if (*timer < maxTime) {
f32 div = (*timer - (kREG(25) + 40.0f)) / (kREG(27) + 90.0f);
scale[0] = (kREG(19) * 0.1f + 40.0f) + div * ((kREG(26) + 50.0f) * (kREG(19) * 0.1f + 40.0f));

View file

@ -19,11 +19,11 @@ typedef struct EnZl1 {
/* 0x01E6 */ s16 unk_1E6;
/* 0x01E8 */ s16 unk_1E8;
/* 0x01EA */ char unk_1EA[0x2];
/* 0x01EC */ UNK_PTR unk_1EC;
/* 0x01EC */ void* unk_1EC;
/* 0x01F0 */ char unk_1F0[0x2];
/* 0x01F2 */ s16 unk_1F2;
/* 0x01F4 */ UNK_PTR unk_1F4;
/* 0x01F8 */ UNK_PTR unk_1F8;
/* 0x01F4 */ void* unk_1F4;
/* 0x01F8 */ void* unk_1F8;
/* 0x01FC */ s16 unk_1FC;
/* 0x01FE */ s16 unk_1FE;
/* 0x0200 */ Vec3s unk_200;

View file

@ -2491,6 +2491,7 @@ s32 func_80B59698(EnZl3* this, GlobalContext* globalCtx) {
if (cond) {
u8 curSpawn = globalCtx->curSpawn;
if ((func_80B54DB4(this) == 0x20) && (curSpawn == 0) &&
((gSaveContext.timer2Value <= 0) || (gSaveContext.timer2State == 0))) {
return 1;

View file

@ -82,6 +82,7 @@ void ObjBombiwa_Init(Actor* thisx, GlobalContext* globalCtx) {
CollisionCheck_SetInfo(&thisx->colChkInfo, NULL, &sColChkInfoInit);
if (thisx->shape.rot.y == 0) {
s16 rand = (s16)Rand_ZeroFloat(65536.0f);
thisx->world.rot.y = rand;
thisx->shape.rot.y = rand;
}

View file

@ -70,10 +70,12 @@ u32 ObjTimeblock_CalculateIsVisible(ObjTimeblock* this) {
return this->unk_175;
} else {
u8 temp = ((this->dyna.actor.params >> 15) & 1) ? true : false;
if (this->unk_177 == 1) {
return this->unk_174 ^ temp;
} else {
u8 linkIsYoung = (LINK_AGE_IN_YEARS == YEARS_CHILD) ? true : false;
return this->unk_174 ^ temp ^ linkIsYoung;
}
}
@ -254,6 +256,7 @@ void ObjTimeblock_Normal(ObjTimeblock* this, GlobalContext* globalCtx) {
void func_80BA06AC(ObjTimeblock* this, GlobalContext* globalCtx) {
s32 switchFlag = this->dyna.actor.params & 0x3F;
this->unk_172 = globalCtx->msgCtx.lastPlayedSong;
if (this->demoEffectFirstPartTimer > 0 && --this->demoEffectFirstPartTimer == 0) {

View file

@ -191,6 +191,7 @@ s32 func_80BA228C(ObjWarp2block* this, GlobalContext* globalCtx) {
s32 func_80BA2304(ObjWarp2block* this, GlobalContext* globalCtx) {
s32 ret = this->func_168(this, globalCtx);
this->unk_172 = globalCtx->msgCtx.lastPlayedSong;
return ret;

Some files were not shown because too many files have changed in this diff Show more