diff options
| author | fig02 <fig02srl@gmail.com> | 2020-07-19 09:54:24 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-07-19 09:54:24 -0400 |
| commit | 5f7bce6e2e87cdb772ab3da92212f860f428d72d (patch) | |
| tree | c35378dd511a02057dbb2cc65ea84627f2fd7184 /src/code | |
| parent | 66e9475b25b0809ffca5cffba932fab3e13b5596 (diff) | |
Bg_Heavy_Block and Eff_Ss_Dust (#258)
* heavy_rock progress
* heavy block progress, 2 functions left
* progress
* progress
* heavy_block OK
* comments
* heavy block done
* eff ss dust ok
* naming
* done i think
* comment
* clean up dust usages
* remove docs
* remove reloc
* move enum and rename flag
* effect enum
Diffstat (limited to 'src/code')
| -rw-r--r-- | src/code/z_actor.c | 52 | ||||
| -rw-r--r-- | src/code/z_effect_soft_sprite.c | 2 | ||||
| -rw-r--r-- | src/code/z_effect_soft_sprite_old_init.c | 145 |
3 files changed, 153 insertions, 46 deletions
diff --git a/src/code/z_actor.c b/src/code/z_actor.c index db059634d..d79e96003 100644 --- a/src/code/z_actor.c +++ b/src/code/z_actor.c @@ -3173,56 +3173,56 @@ s32 func_8003305C(Actor* actor, struct_80032E24* arg1, GlobalContext* globalCtx, return 1; } -void func_80033260(GlobalContext* globalCtx, Actor* actor, Vec3f* arg2, f32 arg3, s32 arg4, f32 arg5, s16 arg6, - s16 arg7, u8 arg8) { - Vec3f sp9C; - Vec3f sp90 = { 0.0f, 0.0f, 0.0f }; - Vec3f sp84 = { 0.0f, 0.3f, 0.0f }; +void func_80033260(GlobalContext* globalCtx, Actor* actor, Vec3f* arg2, f32 arg3, s32 arg4, f32 arg5, s16 scale, + s16 scaleStep, u8 arg8) { + Vec3f pos; + Vec3f velocity = { 0.0f, 0.0f, 0.0f }; + Vec3f accel = { 0.0f, 0.3f, 0.0f }; f32 var; s32 i; var = (Math_Rand_ZeroOne() - 0.5f) * 6.28f; - sp9C.y = actor->groundY; - sp84.y += (Math_Rand_ZeroOne() - 0.5f) * 0.2f; + pos.y = actor->groundY; + accel.y += (Math_Rand_ZeroOne() - 0.5f) * 0.2f; for (i = arg4; i >= 0; i--) { - sp9C.x = (func_800CA720(var) * arg3) + arg2->x; - sp9C.z = (func_800CA774(var) * arg3) + arg2->z; - sp84.x = (Math_Rand_ZeroOne() - 0.5f) * arg5; - sp84.z = (Math_Rand_ZeroOne() - 0.5f) * arg5; + pos.x = (func_800CA720(var) * arg3) + arg2->x; + pos.z = (func_800CA774(var) * arg3) + arg2->z; + accel.x = (Math_Rand_ZeroOne() - 0.5f) * arg5; + accel.z = (Math_Rand_ZeroOne() - 0.5f) * arg5; - if (arg6 == 0) { - func_8002857C(globalCtx, &sp9C, &sp90, &sp84); + if (scale == 0) { + func_8002857C(globalCtx, &pos, &velocity, &accel); } else if (arg8 != 0) { - func_800286CC(globalCtx, &sp9C, &sp90, &sp84, arg6, arg7); + func_800286CC(globalCtx, &pos, &velocity, &accel, scale, scaleStep); } else { - func_8002865C(globalCtx, &sp9C, &sp90, &sp84, arg6, arg7); + func_8002865C(globalCtx, &pos, &velocity, &accel, scale, scaleStep); } var += 6.28f / (arg4 + 1.0f); } } -void func_80033480(GlobalContext* globalCtx, Vec3f* arg1, f32 arg2, s32 arg3, s16 arg4, s16 arg5, u8 arg6) { - Vec3f sp94; - Vec3f sp88 = { 0.0f, 0.0f, 0.0f }; - Vec3f sp7C = { 0.0f, 0.3f, 0.0f }; - s16 var; +void func_80033480(GlobalContext* globalCtx, Vec3f* arg1, f32 arg2, s32 arg3, s16 arg4, s16 scaleStep, u8 arg6) { + Vec3f pos; + Vec3f velocity = { 0.0f, 0.0f, 0.0f }; + Vec3f accel = { 0.0f, 0.3f, 0.0f }; + s16 scale; u32 var2; s32 i; for (i = arg3; i >= 0; i--) { - sp94.x = arg1->x + ((Math_Rand_ZeroOne() - 0.5f) * arg2); - sp94.y = arg1->y + ((Math_Rand_ZeroOne() - 0.5f) * arg2); - sp94.z = arg1->z + ((Math_Rand_ZeroOne() - 0.5f) * arg2); + pos.x = arg1->x + ((Math_Rand_ZeroOne() - 0.5f) * arg2); + pos.y = arg1->y + ((Math_Rand_ZeroOne() - 0.5f) * arg2); + pos.z = arg1->z + ((Math_Rand_ZeroOne() - 0.5f) * arg2); - var = (s16)((Math_Rand_ZeroOne() * arg4) * 0.2f) + arg4; + scale = (s16)((Math_Rand_ZeroOne() * arg4) * 0.2f) + arg4; var2 = arg6; if (var2 != 0) { - func_800286CC(globalCtx, &sp94, &sp88, &sp7C, var, arg5); + func_800286CC(globalCtx, &pos, &velocity, &accel, scale, scaleStep); } else { - func_8002865C(globalCtx, &sp94, &sp88, &sp7C, var, arg5); + func_8002865C(globalCtx, &pos, &velocity, &accel, scale, scaleStep); } } } diff --git a/src/code/z_effect_soft_sprite.c b/src/code/z_effect_soft_sprite.c index 03754d7c4..5ba79f306 100644 --- a/src/code/z_effect_soft_sprite.c +++ b/src/code/z_effect_soft_sprite.c @@ -88,7 +88,7 @@ void EffectSs_Reset(EffectSs* effectSs) { effectSs->priority = 128; effectSs->draw = NULL; effectSs->update = NULL; - effectSs->unk_38 = 0; + effectSs->unk_38 = NULL; effectSs->unk_3C = NULL; for (i = 0; i < ARRAY_COUNT(effectSs->regs); i++) { diff --git a/src/code/z_effect_soft_sprite_old_init.c b/src/code/z_effect_soft_sprite_old_init.c index f06dc4a03..3612c4ad4 100644 --- a/src/code/z_effect_soft_sprite_old_init.c +++ b/src/code/z_effect_soft_sprite_old_init.c @@ -1,50 +1,155 @@ #include <ultra64.h> #include <global.h> +#include "overlays/effects/ovl_Effect_Ss_Dust/z_eff_ss_dust.h" #include "overlays/effects/ovl_Effect_Ss_Solder_Srch_Ball/z_eff_ss_solder_srch_ball.h" #include "overlays/effects/ovl_Effect_Ss_Fhg_Flash/z_eff_ss_fhg_flash.h" +extern Color_RGBA8_n D_801158CC; +extern Color_RGBA8_n D_801158D0; + // Draw utility for some G effects + #pragma GLOBAL_ASM("asm/non_matchings/code/z_effect_soft_sprite_old_init/func_80027F80.s") // EffectSsDust Spawn Functions -#pragma GLOBAL_ASM("asm/non_matchings/code/z_effect_soft_sprite_old_init/func_800281E8.s") +void EffectSsDust_Spawn(GlobalContext* globalCtx, u16 drawFlags, Vec3f* pos, Vec3f* velocity, Vec3f* accel, + Color_RGBA8_n* primColor, Color_RGBA8_n* envColor, s16 scale, s16 scaleStep, s16 life, + u8 updateMode) { + EffectSsDustInitParams initParams; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_effect_soft_sprite_old_init/func_8002829C.s") + Math_Vec3f_Copy(&initParams.pos, pos); + Math_Vec3f_Copy(&initParams.velocity, velocity); + Math_Vec3f_Copy(&initParams.accel, accel); + initParams.primColor = *primColor; + initParams.envColor = *envColor; + initParams.drawFlags = drawFlags; + initParams.scale = scale; + initParams.scaleStep = scaleStep; + initParams.life = life; + initParams.updateMode = updateMode; + EffectSs_Spawn(globalCtx, EFFECT_SS_DUST, 128, &initParams); +} -#pragma GLOBAL_ASM("asm/non_matchings/code/z_effect_soft_sprite_old_init/func_80028304.s") +void func_8002829C(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel, Color_RGBA8_n* primColor, + Color_RGBA8_n* envColor, s16 scale, s16 scaleStep) { + EffectSsDust_Spawn(globalCtx, 0, pos, velocity, accel, primColor, envColor, scale, scaleStep, 10, 0); +} -#pragma GLOBAL_ASM("asm/non_matchings/code/z_effect_soft_sprite_old_init/func_8002836C.s") +void func_80028304(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel, Color_RGBA8_n* primColor, + Color_RGBA8_n* envColor, s16 scale, s16 scaleStep) { + EffectSsDust_Spawn(globalCtx, 1, pos, velocity, accel, primColor, envColor, scale, scaleStep, 10, 0); +} -#pragma GLOBAL_ASM("asm/non_matchings/code/z_effect_soft_sprite_old_init/func_800283D4.s") +void func_8002836C(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel, Color_RGBA8_n* primColor, + Color_RGBA8_n* envColor, s16 scale, s16 scaleStep, s16 life) { + EffectSsDust_Spawn(globalCtx, 0, pos, velocity, accel, primColor, envColor, scale, scaleStep, life, 0); +} -#pragma GLOBAL_ASM("asm/non_matchings/code/z_effect_soft_sprite_old_init/func_8002843C.s") +void func_800283D4(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel, Color_RGBA8_n* primColor, + Color_RGBA8_n* envColor, s16 scale, s16 scaleStep, s16 life) { + EffectSsDust_Spawn(globalCtx, 1, pos, velocity, accel, primColor, envColor, scale, scaleStep, life, 0); +} -#pragma GLOBAL_ASM("asm/non_matchings/code/z_effect_soft_sprite_old_init/func_800284A4.s") +void func_8002843C(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel, Color_RGBA8_n* primColor, + Color_RGBA8_n* envColor, s16 scale, s16 scaleStep, s16 life) { + EffectSsDust_Spawn(globalCtx, 2, pos, velocity, accel, primColor, envColor, scale, scaleStep, life, 0); +} -#pragma GLOBAL_ASM("asm/non_matchings/code/z_effect_soft_sprite_old_init/func_80028510.s") +// unused +void func_800284A4(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel, Color_RGBA8_n* primColor, + Color_RGBA8_n* envColor, s16 scale, s16 scaleStep) { + EffectSsDust_Spawn(globalCtx, 0, pos, velocity, accel, primColor, envColor, scale, scaleStep, 10, 1); +} -#pragma GLOBAL_ASM("asm/non_matchings/code/z_effect_soft_sprite_old_init/func_8002857C.s") +// unused +void func_80028510(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel, Color_RGBA8_n* primColor, + Color_RGBA8_n* envColor, s16 scale, s16 scaleStep) { + EffectSsDust_Spawn(globalCtx, 1, pos, velocity, accel, primColor, envColor, scale, scaleStep, 10, 1); +} -#pragma GLOBAL_ASM("asm/non_matchings/code/z_effect_soft_sprite_old_init/func_800285EC.s") +void func_8002857C(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel) { + EffectSsDust_Spawn(globalCtx, 4, pos, velocity, accel, &D_801158CC, &D_801158D0, 100, 5, 10, 0); +} -#pragma GLOBAL_ASM("asm/non_matchings/code/z_effect_soft_sprite_old_init/func_8002865C.s") +// unused +void func_800285EC(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel) { + EffectSsDust_Spawn(globalCtx, 5, pos, velocity, accel, &D_801158CC, &D_801158D0, 100, 5, 10, 0); +} -#pragma GLOBAL_ASM("asm/non_matchings/code/z_effect_soft_sprite_old_init/func_800286CC.s") +void func_8002865C(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 scale, s16 scaleStep) { + EffectSsDust_Spawn(globalCtx, 4, pos, velocity, accel, &D_801158CC, &D_801158D0, scale, scaleStep, 10, 0); +} -#pragma GLOBAL_ASM("asm/non_matchings/code/z_effect_soft_sprite_old_init/func_8002873C.s") +void func_800286CC(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 scale, s16 scaleStep) { + EffectSsDust_Spawn(globalCtx, 5, pos, velocity, accel, &D_801158CC, &D_801158D0, scale, scaleStep, 10, 0); +} -#pragma GLOBAL_ASM("asm/non_matchings/code/z_effect_soft_sprite_old_init/func_800287AC.s") +void func_8002873C(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 scale, s16 scaleStep, + s16 life) { + EffectSsDust_Spawn(globalCtx, 4, pos, velocity, accel, &D_801158CC, &D_801158D0, scale, scaleStep, life, 0); +} + +void func_800287AC(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 scale, s16 scaleStep, + s16 life) { + EffectSsDust_Spawn(globalCtx, 5, pos, velocity, accel, &D_801158CC, &D_801158D0, scale, scaleStep, life, 0); +} + +void func_8002881C(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel, Color_RGBA8_n* primColor, + Color_RGBA8_n* envColor) { + func_8002829C(globalCtx, pos, velocity, accel, primColor, envColor, 100, 5); +} + +// unused +void func_80028858(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel, Color_RGBA8_n* primColor, + Color_RGBA8_n* envColor) { + func_80028304(globalCtx, pos, velocity, accel, primColor, envColor, 100, 5); +} + +void func_80028894(Vec3f* srcPos, f32 randScale, Vec3f* newPos, Vec3f* velocity, Vec3f* accel) { + s16 randAngle; + f32 rand; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_effect_soft_sprite_old_init/func_8002881C.s") + rand = Math_Rand_ZeroOne() * randScale; + randAngle = (Math_Rand_ZeroOne() * 65536.0f); -#pragma GLOBAL_ASM("asm/non_matchings/code/z_effect_soft_sprite_old_init/func_80028858.s") + *newPos = *srcPos; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_effect_soft_sprite_old_init/func_80028894.s") + newPos->x += Math_Sins(randAngle) * rand; + newPos->z += Math_Coss(randAngle) * rand; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_effect_soft_sprite_old_init/func_80028990.s") + velocity->y = 1.0f; + velocity->x = Math_Sins(randAngle); + velocity->z = Math_Coss(randAngle); -#pragma GLOBAL_ASM("asm/non_matchings/code/z_effect_soft_sprite_old_init/func_80028A54.s") + accel->x = 0.0f; + accel->y = 0.0f; + accel->z = 0.0f; +} + +void func_80028990(GlobalContext* globalCtx, f32 randScale, Vec3f* srcPos) { + s32 i; + Vec3f pos; + Vec3f velocity; + Vec3f accel; + + for (i = 0; i < 20; i++) { + func_80028894(srcPos, randScale, &pos, &velocity, &accel); + func_8002873C(globalCtx, &pos, &velocity, &accel, 100, 30, 7); + } +} + +void func_80028A54(GlobalContext* globalCtx, f32 randScale, Vec3f* srcPos) { + s32 i; + Vec3f pos; + Vec3f velocity; + Vec3f accel; + + for (i = 0; i < 20; i++) { + func_80028894(srcPos, randScale, &pos, &velocity, &accel); + func_800287AC(globalCtx, &pos, &velocity, &accel, 100, 30, 7); + } +} // EffectSsKiraKira Spawn Functions @@ -190,6 +295,8 @@ void EffectSsFhgFlash_Spawn2(GlobalContext* globalCtx, Actor* arg1, Vec3f* pos, #pragma GLOBAL_ASM("asm/non_matchings/code/z_effect_soft_sprite_old_init/func_80029DBC.s") +// EffectSsSolderSrchBall Spawn Functions + void EffectSsSolderSrchBall_Spawn(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 arg4, s16* linkDetected) { EffectSsSolderSrchBallInitParams initParams; |
