summaryrefslogtreecommitdiff
path: root/src/code
diff options
context:
space:
mode:
authorDragorn421 <Dragorn421@users.noreply.github.com>2022-01-12 21:48:04 +0100
committerGitHub <noreply@github.com>2022-01-12 15:48:04 -0500
commite5ecdfd5599e53127e372b31546c158371eb1e93 (patch)
tree26183b8efff96f2c5bdb399b24615465847185d6 /src/code
parent11917bf640d85250e2336389cec3e79bb5584816 (diff)
Misc. doc/cleanup 5 (#1096)
* `0` -> `CHEST_ANIM_SHORT` in `GET_ITEM` z_player macro * fix typos in z_en_skj Co-authored-by: Yanis42 <yalink88@gmail.com> * `unkSkjStruct` -> `EnSkjUnkStruct` * Use `EFFECT_SS_` enum in all `EffectSs_Spawn` calls * Decimal for all `EffectSs_Spawn` priorities * Use `OBJECT_INVALID` more * `Object_IsLoaded` returns a boolean * Add `@bug` in `DmaMgr_SendRequestImpl` about passing partially uninitialized struct * Fix typo `forc_structure_alignment` -> "force" * Move `CMD_F` to `z64cutscene_commands.h` since it is specifically for cutscene data * Use `ALIGN16` macro more * Use `ALIGN256` macro more * Add `@bug` on two messed up 8-bytes-aligns * Set `gSaveContext.nightFlag` to 0/1 instead of false/true * Use `IS_DAY` macro more * Run formatter Co-authored-by: Yanis42 <yalink88@gmail.com>
Diffstat (limited to 'src/code')
-rw-r--r--src/code/audio_load.c2
-rw-r--r--src/code/z_effect_soft_sprite_old_init.c6
-rw-r--r--src/code/z_kankyo.c12
-rw-r--r--src/code/z_scene.c6
4 files changed, 13 insertions, 13 deletions
diff --git a/src/code/audio_load.c b/src/code/audio_load.c
index e4b1299db..d19fdc853 100644
--- a/src/code/audio_load.c
+++ b/src/code/audio_load.c
@@ -1409,7 +1409,7 @@ AudioAsyncLoad* AudioLoad_StartAsyncLoad(u32 devAddr, void* ramAddr, u32 size, s
} else if (nChunks == 1) {
asyncLoad->chunkSize = size;
} else {
- asyncLoad->chunkSize = (((s32)size / nChunks) + 0xFF) & ~0xFF;
+ asyncLoad->chunkSize = ALIGN256((s32)size / nChunks);
if (asyncLoad->chunkSize < 0x100) {
asyncLoad->chunkSize = 0x100;
}
diff --git a/src/code/z_effect_soft_sprite_old_init.c b/src/code/z_effect_soft_sprite_old_init.c
index adc22e762..8d052a8bf 100644
--- a/src/code/z_effect_soft_sprite_old_init.c
+++ b/src/code/z_effect_soft_sprite_old_init.c
@@ -252,7 +252,7 @@ void EffectSsKiraKira_SpawnDispersed(GlobalContext* globalCtx, Vec3f* pos, Vec3f
initParams.envColor = *envColor;
initParams.alphaStep = (-(255.0f / initParams.life)) + (-(255.0f / initParams.life));
- EffectSs_Spawn(globalCtx, 1, 128, &initParams);
+ EffectSs_Spawn(globalCtx, EFFECT_SS_KIRAKIRA, 128, &initParams);
}
void EffectSsKiraKira_SpawnFocused(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel,
@@ -271,7 +271,7 @@ void EffectSsKiraKira_SpawnFocused(GlobalContext* globalCtx, Vec3f* pos, Vec3f*
Color_RGBA8_Copy(&initParams.envColor, envColor);
initParams.alphaStep = (-(255.0f / initParams.life)) + (-(255.0f / initParams.life));
- EffectSs_Spawn(globalCtx, 1, 128, &initParams);
+ EffectSs_Spawn(globalCtx, EFFECT_SS_KIRAKIRA, 128, &initParams);
}
// EffectSsBomb Spawn Functions
@@ -833,7 +833,7 @@ void EffectSsIcePiece_Spawn(GlobalContext* globalCtx, Vec3f* pos, f32 scale, Vec
Math_Vec3f_Copy(&initParams.accel, accel);
initParams.scale = scale;
initParams.life = life;
- EffectSs_Spawn(globalCtx, 0x1A, 0x80, &initParams);
+ EffectSs_Spawn(globalCtx, EFFECT_SS_ICE_PIECE, 128, &initParams);
}
void EffectSsIcePiece_SpawnBurst(GlobalContext* globalCtx, Vec3f* refPos, f32 scale) {
diff --git a/src/code/z_kankyo.c b/src/code/z_kankyo.c
index e71139e34..d49cae5b8 100644
--- a/src/code/z_kankyo.c
+++ b/src/code/z_kankyo.c
@@ -238,9 +238,9 @@ void Environment_Init(GlobalContext* globalCtx2, EnvironmentContext* envCtx, s32
gSaveContext.sunsSongState = SUNSSONG_INACTIVE;
if (((void)0, gSaveContext.dayTime) > 0xC000 || ((void)0, gSaveContext.dayTime) < 0x4555) {
- ((void)0, gSaveContext.nightFlag = true);
+ ((void)0, gSaveContext.nightFlag = 1);
} else {
- ((void)0, gSaveContext.nightFlag = false);
+ ((void)0, gSaveContext.nightFlag = 0);
}
globalCtx->state.gfxCtx->callback = Environment_GraphCallback;
@@ -820,7 +820,7 @@ void Environment_PrintDebugInfo(GlobalContext* globalCtx, Gfx** gfx) {
GfxPrint_SetColor(&printer, 55, 255, 255, 64);
GfxPrint_SetPos(&printer, 22, 6);
- if (gSaveContext.nightFlag) {
+ if (!IS_DAY) {
GfxPrint_Printf(&printer, "%s", "YORU"); // "night"
} else {
GfxPrint_Printf(&printer, "%s", "HIRU"); // "day"
@@ -881,7 +881,7 @@ void Environment_Update(GlobalContext* globalCtx, EnvironmentContext* envCtx, Li
if ((envCtx->unk_1A == 0) && !FrameAdvance_IsEnabled(globalCtx) &&
(globalCtx->transitionMode == 0 || ((void)0, gSaveContext.gameMode) != 0)) {
- if (!((void)0, gSaveContext.nightFlag) || gTimeIncrement >= 0x190) {
+ if (IS_DAY || gTimeIncrement >= 0x190) {
gSaveContext.dayTime += gTimeIncrement;
} else {
gSaveContext.dayTime += gTimeIncrement * 2; // time moves twice as fast at night
@@ -900,9 +900,9 @@ void Environment_Update(GlobalContext* globalCtx, EnvironmentContext* envCtx, Li
time = gSaveContext.dayTime;
if (time > 0xC000 || time < 0x4555) {
- gSaveContext.nightFlag = true;
+ gSaveContext.nightFlag = 1;
} else {
- gSaveContext.nightFlag = false;
+ gSaveContext.nightFlag = 0;
}
if (SREG(0) != 0 || CREG(2) != 0) {
diff --git a/src/code/z_scene.c b/src/code/z_scene.c
index 6948d09cc..e7d112806 100644
--- a/src/code/z_scene.c
+++ b/src/code/z_scene.c
@@ -113,9 +113,9 @@ s32 Object_GetIndex(ObjectContext* objectCtx, s16 objectId) {
s32 Object_IsLoaded(ObjectContext* objectCtx, s32 bankIndex) {
if (objectCtx->status[bankIndex].id > 0) {
- return 1;
+ return true;
} else {
- return 0;
+ return false;
}
}
@@ -232,7 +232,7 @@ void func_800987F8(GlobalContext* globalCtx, SceneCmd* cmd) {
// Scene Command 0x07: Special Files
void func_8009883C(GlobalContext* globalCtx, SceneCmd* cmd) {
- if (cmd->specialFiles.keepObjectId != 0) {
+ if (cmd->specialFiles.keepObjectId != OBJECT_INVALID) {
globalCtx->objectCtx.subKeepIndex = Object_Spawn(&globalCtx->objectCtx, cmd->specialFiles.keepObjectId);
gSegments[5] = VIRTUAL_TO_PHYSICAL(globalCtx->objectCtx.status[globalCtx->objectCtx.subKeepIndex].segment);
}