summaryrefslogtreecommitdiff
path: root/src/code
diff options
context:
space:
mode:
authorDragorn421 <Dragorn421@users.noreply.github.com>2022-03-16 22:14:56 +0100
committerGitHub <noreply@github.com>2022-03-16 22:14:56 +0100
commitb2a3fb2f7fb84220088d3f7ebc6bd1ac29d24027 (patch)
treee5fa71b8617be6a309a72a48ff2f3e934fdbd4ba /src/code
parent93096a45b61cc872b1ea482feb9753daa8f2b069 (diff)
Fix misc 8 (#1150)
* Use `s32` as type instead of `StackStatus` enum type * `bossLimbDl` -> `bossLimbDL` * Fixup comment refering to `Actor.velocity` by struct offset * Fixup `feetFloorFlags` doc and -> `feetFloorFlag` * Fixup `xyzDistToPlayerSq` comment * Make `SkelAnime.mode` comment refer to `AnimationMode` (<- `AnimationModes`) * Use enum names to refer to anim modes and break long lines in z64animation.h * `EnDha_OverridePostDraw` -> `EnDha_PostLimbDraw` * ichains cleanup * Scene command ids usage cleanup * Properly name unkXXX members as unk_XXX * change `gSceneCmdHandlers` length in variables.h too * Revert Unknown flags to unk0 & unk1 * Remove "current scene" mention from `Flags_*Unknown` as they aren't saved or loaded so not scene-specific * `Struct_8011FAF0`: unk_00, unk_04 * Run formatter * Do not break long lines in headers * Revert "Fixup `feetFloorFlags` doc and -> `feetFloorFlag`" This reverts commit c45b3611e7c8997d27807cfd1c9e1fbdaeb026fe.
Diffstat (limited to 'src/code')
-rw-r--r--src/code/z_actor.c6
-rw-r--r--src/code/z_kankyo.c6
-rw-r--r--src/code/z_scene.c10
3 files changed, 11 insertions, 11 deletions
diff --git a/src/code/z_actor.c b/src/code/z_actor.c
index 816d98d63..5b9309ace 100644
--- a/src/code/z_actor.c
+++ b/src/code/z_actor.c
@@ -544,7 +544,7 @@ void Flags_UnsetSwitch(GlobalContext* globalCtx, s32 flag) {
}
/**
- * Tests if current scene unknown flag is set.
+ * Tests if unknown flag is set.
*/
s32 Flags_GetUnknown(GlobalContext* globalCtx, s32 flag) {
if (flag < 0x20) {
@@ -555,7 +555,7 @@ s32 Flags_GetUnknown(GlobalContext* globalCtx, s32 flag) {
}
/**
- * Sets current scene unknown flag.
+ * Sets unknown flag.
*/
void Flags_SetUnknown(GlobalContext* globalCtx, s32 flag) {
if (flag < 0x20) {
@@ -566,7 +566,7 @@ void Flags_SetUnknown(GlobalContext* globalCtx, s32 flag) {
}
/**
- * Unsets current scene unknown flag.
+ * Unsets unknown flag.
*/
void Flags_UnsetUnknown(GlobalContext* globalCtx, s32 flag) {
if (flag < 0x20) {
diff --git a/src/code/z_kankyo.c b/src/code/z_kankyo.c
index a98196eb6..295dcc251 100644
--- a/src/code/z_kankyo.c
+++ b/src/code/z_kankyo.c
@@ -35,8 +35,8 @@ typedef struct {
} LightningBolt; // size = 0x20
typedef struct {
- /* 0x00 */ s32 unk0;
- /* 0x04 */ s32 unk1;
+ /* 0x00 */ s32 unk_00;
+ /* 0x04 */ s32 unk_04;
} Struct_8011FAF0; // size = 0x8
Struct_8011FAF0 D_8011FAF0[] = {
@@ -213,7 +213,7 @@ u8 sGameOverLightsIntensity;
u16 D_8015FDB0;
s32 func_8006F0A0(s32 a0) {
- s32 ret = ((a0 >> 4 & 0x7FF) << D_8011FAF0[a0 >> 15 & 7].unk0) + D_8011FAF0[a0 >> 15 & 7].unk1;
+ s32 ret = ((a0 >> 4 & 0x7FF) << D_8011FAF0[a0 >> 15 & 7].unk_00) + D_8011FAF0[a0 >> 15 & 7].unk_04;
return ret;
}
diff --git a/src/code/z_scene.c b/src/code/z_scene.c
index 7204dda46..b0b5b7c63 100644
--- a/src/code/z_scene.c
+++ b/src/code/z_scene.c
@@ -166,11 +166,11 @@ s32 Scene_ExecuteCommands(GlobalContext* globalCtx, SceneCmd* sceneCmd) {
osSyncPrintf("*** Scene_Word = { code=%d, data1=%02x, data2=%04x } ***\n", cmdCode, sceneCmd->base.data1,
sceneCmd->base.data2);
- if (cmdCode == 0x14) {
+ if (cmdCode == SCENE_CMD_ID_END) {
break;
}
- if (cmdCode <= 0x19) {
+ if (cmdCode < ARRAY_COUNT(gSceneCmdHandlers)) {
gSceneCmdHandlers[cmdCode](globalCtx, sceneCmd);
} else {
osSyncPrintf(VT_FGCOL(RED));
@@ -443,7 +443,7 @@ void func_800991A0(GlobalContext* globalCtx, SceneCmd* cmd) {
if (altHeader != NULL) {
Scene_ExecuteCommands(globalCtx, SEGMENTED_TO_VIRTUAL(altHeader));
- (cmd + 1)->base.code = 0x14;
+ (cmd + 1)->base.code = SCENE_CMD_ID_END;
} else {
// "Coughh! There is no specified dataaaaa!"
osSyncPrintf("\nげぼはっ! 指定されたデータがないでええっす!");
@@ -457,7 +457,7 @@ void func_800991A0(GlobalContext* globalCtx, SceneCmd* cmd) {
if (altHeader != NULL) {
Scene_ExecuteCommands(globalCtx, SEGMENTED_TO_VIRTUAL(altHeader));
- (cmd + 1)->base.code = 0x14;
+ (cmd + 1)->base.code = SCENE_CMD_ID_END;
}
}
}
@@ -491,7 +491,7 @@ void func_800993C0(GlobalContext* globalCtx, SceneCmd* cmd) {
}
}
-void (*gSceneCmdHandlers[])(GlobalContext*, SceneCmd*) = {
+void (*gSceneCmdHandlers[SCENE_CMD_ID_MAX])(GlobalContext*, SceneCmd*) = {
func_80098508, func_800985DC, func_80098630, func_80098674, func_800987A4, func_80099090, func_800987F8,
func_8009883C, func_80098904, func_80099134, func_80098958, func_8009899C, func_80098B74, func_80098C24,
func_80098C68, func_80098CC8, func_80098D80, func_80098D1C, func_80098D5C, func_800990F0, NULL,