summaryrefslogtreecommitdiff
path: root/src/code
diff options
context:
space:
mode:
authorDerek Hensley <hensley.derek58@gmail.com>2022-01-03 21:50:12 -0800
committerGitHub <noreply@github.com>2022-01-04 05:50:12 +0000
commitd3e4a3368f6c8cb4bd6ca8c404d4f48c25ab7d10 (patch)
treeb5353255aa6f2e0aab430104e05477023ae8db2f /src/code
parent8cd978585e1570383c401d6fcd439d9a3f9440f5 (diff)
Effect_soft_sprite_old_init and particleOverlayTable OK (#520)
* Migrated data * Migrate particleOverlayTable * Import data for effect_soft_sprite, add g to effect table, minor cleanup of z64effect.h * Name data * Comment out static variable in variables.h * Use better macros * PR review and other cleanup * Update bug comment
Diffstat (limited to 'src/code')
-rw-r--r--src/code/z_effect_soft_sprite.c107
-rw-r--r--src/code/z_effect_soft_sprite_dlftbls.c56
-rw-r--r--src/code/z_effect_soft_sprite_old_init.c118
3 files changed, 157 insertions, 124 deletions
diff --git a/src/code/z_effect_soft_sprite.c b/src/code/z_effect_soft_sprite.c
index 47c2202f1..424166f89 100644
--- a/src/code/z_effect_soft_sprite.c
+++ b/src/code/z_effect_soft_sprite.c
@@ -1,20 +1,22 @@
#include "global.h"
+EffectSsInfo sEffectSsInfo = { NULL, 0, 0 };
+
void EffectSS_Init(GlobalContext* globalCtx, s32 numEntries) {
u32 i;
EffectSs* effectsSs;
EffectSsOverlay* overlay;
- EffectSS2Info.data_table = (EffectSs*)THA_AllocEndAlign16(&globalCtx->state.heap, numEntries * sizeof(EffectSs));
- EffectSS2Info.searchIndex = 0;
- EffectSS2Info.size = numEntries;
+ sEffectSsInfo.data_table = (EffectSs*)THA_AllocEndAlign16(&globalCtx->state.heap, numEntries * sizeof(EffectSs));
+ sEffectSsInfo.searchIndex = 0;
+ sEffectSsInfo.size = numEntries;
- for (effectsSs = &EffectSS2Info.data_table[0]; effectsSs < &EffectSS2Info.data_table[EffectSS2Info.size];
+ for (effectsSs = &sEffectSsInfo.data_table[0]; effectsSs < &sEffectSsInfo.data_table[sEffectSsInfo.size];
effectsSs++) {
EffectSS_ResetEntry(effectsSs);
}
- overlay = &particleOverlayTable[0];
+ overlay = &gParticleOverlayTable[0];
for (i = 0; i < EFFECT_SS_MAX; i++) {
overlay->loadedRamAddr = NULL;
overlay++;
@@ -27,30 +29,31 @@ void EffectSS_Clear(GlobalContext* globalCtx) {
EffectSsOverlay* overlay;
void* addr;
- EffectSS2Info.data_table = NULL;
- EffectSS2Info.searchIndex = 0;
- EffectSS2Info.size = 0;
+ sEffectSsInfo.data_table = NULL;
+ sEffectSsInfo.searchIndex = 0;
+ sEffectSsInfo.size = 0;
- // This code is completely useless, as data_table was just set to NULL and size to 0
- for (effectsSs = EffectSS2Info.data_table; effectsSs < EffectSS2Info.data_table + EffectSS2Info.size; effectsSs++) {
+ //! @bug: Effects left in the table are not properly deleted, as data_table was just set to NULL and size to 0
+ for (effectsSs = &sEffectSsInfo.data_table[0]; effectsSs < &sEffectSsInfo.data_table[sEffectSsInfo.size];
+ effectsSs++) {
EffectSS_Delete(effectsSs);
}
// Free memory from loaded particle overlays
- overlay = &particleOverlayTable[0];
+ overlay = &gParticleOverlayTable[0];
for (i = 0; i < EFFECT_SS_MAX; i++) {
addr = overlay->loadedRamAddr;
if (addr != NULL) {
ZeldaArena_Free(addr);
}
- overlay->loadedRamAddr = 0;
+ overlay->loadedRamAddr = NULL;
overlay++;
}
}
EffectSs* EffectSS_GetTable() {
- return EffectSS2Info.data_table;
+ return sEffectSsInfo.data_table;
}
void EffectSS_Delete(EffectSs* effectSs) {
@@ -90,27 +93,27 @@ s32 EffectSS_FindFreeSpace(s32 priority, s32* tableEntry) {
s32 foundFree;
s32 i;
- if (EffectSS2Info.searchIndex >= EffectSS2Info.size) {
- EffectSS2Info.searchIndex = 0;
+ if (sEffectSsInfo.searchIndex >= sEffectSsInfo.size) {
+ sEffectSsInfo.searchIndex = 0;
}
// Search for a unused entry
- i = EffectSS2Info.searchIndex;
+ i = sEffectSsInfo.searchIndex;
foundFree = false;
while (true) {
- if (EffectSS2Info.data_table[i].life == -1) {
+ if (sEffectSsInfo.data_table[i].life == -1) {
foundFree = true;
break;
}
i++;
- if (i >= EffectSS2Info.size) {
+ if (i >= sEffectSsInfo.size) {
i = 0; // Loop around the whole table
}
// After a full loop, break out
- if (i == EffectSS2Info.searchIndex) {
+ if (i == sEffectSsInfo.searchIndex) {
break;
}
}
@@ -122,22 +125,22 @@ s32 EffectSS_FindFreeSpace(s32 priority, s32* tableEntry) {
// If all slots are in use, search for a slot with a lower priority
// Note that a lower priority is representend by a higher value
- i = EffectSS2Info.searchIndex;
+ i = sEffectSsInfo.searchIndex;
while (true) {
// Equal priority should only be considered "lower" if flag 0 is set
- if ((priority <= EffectSS2Info.data_table[i].priority) &&
- !((priority == EffectSS2Info.data_table[i].priority) && (EffectSS2Info.data_table[i].flags & 1))) {
+ if ((priority <= sEffectSsInfo.data_table[i].priority) &&
+ !((priority == sEffectSsInfo.data_table[i].priority) && (sEffectSsInfo.data_table[i].flags & 1))) {
break;
}
i++;
- if (i >= EffectSS2Info.size) {
+ if (i >= sEffectSsInfo.size) {
i = 0; // Loop around the whole table
}
// After a full loop, return 1 to indicate that we failed to find a suitable slot
- if (i == EffectSS2Info.searchIndex) {
+ if (i == sEffectSsInfo.searchIndex) {
return true;
}
}
@@ -151,8 +154,8 @@ void EffectSS_Copy(GlobalContext* globalCtx, EffectSs* effectsSs) {
if (FrameAdvance_IsEnabled(globalCtx) != true) {
if (EffectSS_FindFreeSpace(effectsSs->priority, &index) == 0) {
- EffectSS2Info.searchIndex = index + 1;
- EffectSS2Info.data_table[index] = *effectsSs;
+ sEffectSsInfo.searchIndex = index + 1;
+ sEffectSsInfo.data_table[index] = *effectsSs;
}
}
}
@@ -160,7 +163,7 @@ void EffectSS_Copy(GlobalContext* globalCtx, EffectSs* effectsSs) {
void EffectSs_Spawn(GlobalContext* globalCtx, s32 type, s32 priority, void* initData) {
s32 index;
u32 overlaySize;
- EffectSsOverlay* entry = &particleOverlayTable[type];
+ EffectSsOverlay* entry = &gParticleOverlayTable[type];
EffectSsInit* initInfo;
if (EffectSS_FindFreeSpace(priority, &index) != 0) {
@@ -168,8 +171,8 @@ void EffectSs_Spawn(GlobalContext* globalCtx, s32 type, s32 priority, void* init
return;
}
- EffectSS2Info.searchIndex = index + 1;
- overlaySize = (u32)entry->vramEnd - (u32)entry->vramStart;
+ sEffectSsInfo.searchIndex = index + 1;
+ overlaySize = (uintptr_t)entry->vramEnd - (uintptr_t)entry->vramStart;
if (entry->vramStart == NULL) {
initInfo = entry->initInfo;
@@ -184,27 +187,27 @@ void EffectSs_Spawn(GlobalContext* globalCtx, s32 type, s32 priority, void* init
Load2_LoadOverlay(entry->vromStart, entry->vromEnd, entry->vramStart, entry->vramEnd, entry->loadedRamAddr);
}
- initInfo = (void*)(u32)(
- entry->initInfo != NULL
- ? (EffectSsInit*)(-((u32)entry->vramStart - (u32)entry->loadedRamAddr) + (u32)entry->initInfo)
- : NULL);
+ initInfo = (u32)((entry->initInfo != NULL)
+ ? (EffectSsInit*)(-((uintptr_t)entry->vramStart - (uintptr_t)entry->loadedRamAddr) +
+ (uintptr_t)entry->initInfo)
+ : NULL);
}
if (initInfo->init != NULL) {
// Delete the previous effect in the slot, in case the slot wasn't free
- EffectSS_Delete(&EffectSS2Info.data_table[index]);
+ EffectSS_Delete(&sEffectSsInfo.data_table[index]);
- EffectSS2Info.data_table[index].type = type;
- EffectSS2Info.data_table[index].priority = priority;
+ sEffectSsInfo.data_table[index].type = type;
+ sEffectSsInfo.data_table[index].priority = priority;
- if (initInfo->init(globalCtx, index, &EffectSS2Info.data_table[index], initData) == 0) {
- EffectSS_ResetEntry(&EffectSS2Info.data_table[index]);
+ if (initInfo->init(globalCtx, index, &sEffectSsInfo.data_table[index], initData) == 0) {
+ EffectSS_ResetEntry(&sEffectSsInfo.data_table[index]);
}
}
}
void EffectSS_UpdateParticle(GlobalContext* globalCtx, s32 index) {
- EffectSs* particle = &EffectSS2Info.data_table[index];
+ EffectSs* particle = &sEffectSsInfo.data_table[index];
if (particle->update != NULL) {
particle->velocity.x += particle->accel.x;
@@ -222,23 +225,23 @@ void EffectSS_UpdateParticle(GlobalContext* globalCtx, s32 index) {
void EffectSS_UpdateAllParticles(GlobalContext* globalCtx) {
s32 i;
- for (i = 0; i < EffectSS2Info.size; i++) {
- if (EffectSS2Info.data_table[i].life > -1) {
- EffectSS2Info.data_table[i].life--;
+ for (i = 0; i < sEffectSsInfo.size; i++) {
+ if (sEffectSsInfo.data_table[i].life > -1) {
+ sEffectSsInfo.data_table[i].life--;
- if (EffectSS2Info.data_table[i].life < 0) {
- EffectSS_Delete(&EffectSS2Info.data_table[i]);
+ if (sEffectSsInfo.data_table[i].life < 0) {
+ EffectSS_Delete(&sEffectSsInfo.data_table[i]);
}
}
- if (EffectSS2Info.data_table[i].life > -1) {
+ if (sEffectSsInfo.data_table[i].life > -1) {
EffectSS_UpdateParticle(globalCtx, i);
}
}
}
void EffectSS_DrawParticle(GlobalContext* globalCtx, s32 index) {
- EffectSs* entry = &EffectSS2Info.data_table[index];
+ EffectSs* entry = &sEffectSsInfo.data_table[index];
if (entry->draw != NULL) {
entry->draw(globalCtx, index, entry);
@@ -252,12 +255,12 @@ void EffectSS_DrawAllParticles(GlobalContext* globalCtx) {
Lights_BindAll(lights, globalCtx->lightCtx.listHead, NULL, globalCtx);
Lights_Draw(lights, globalCtx->state.gfxCtx);
- for (i = 0; i < EffectSS2Info.size; i++) {
- if (EffectSS2Info.data_table[i].life > -1) {
- if ((EffectSS2Info.data_table[i].pos.x > 32000.0f) || (EffectSS2Info.data_table[i].pos.x < -32000.0f) ||
- (EffectSS2Info.data_table[i].pos.y > 32000.0f) || (EffectSS2Info.data_table[i].pos.y < -32000.0f) ||
- (EffectSS2Info.data_table[i].pos.z > 32000.0f) || (EffectSS2Info.data_table[i].pos.z < -32000.0f)) {
- EffectSS_Delete(&EffectSS2Info.data_table[i]);
+ for (i = 0; i < sEffectSsInfo.size; i++) {
+ if (sEffectSsInfo.data_table[i].life > -1) {
+ if ((sEffectSsInfo.data_table[i].pos.x > 32000.0f) || (sEffectSsInfo.data_table[i].pos.x < -32000.0f) ||
+ (sEffectSsInfo.data_table[i].pos.y > 32000.0f) || (sEffectSsInfo.data_table[i].pos.y < -32000.0f) ||
+ (sEffectSsInfo.data_table[i].pos.z > 32000.0f) || (sEffectSsInfo.data_table[i].pos.z < -32000.0f)) {
+ EffectSS_Delete(&sEffectSsInfo.data_table[i]);
} else {
EffectSS_DrawParticle(globalCtx, i);
}
diff --git a/src/code/z_effect_soft_sprite_dlftbls.c b/src/code/z_effect_soft_sprite_dlftbls.c
new file mode 100644
index 000000000..e215cdee9
--- /dev/null
+++ b/src/code/z_effect_soft_sprite_dlftbls.c
@@ -0,0 +1,56 @@
+#include "global.h"
+#include "initvars.h"
+
+#define EFFECT_SS_OVERLAY(name) \
+ { \
+ SEGMENT_ROM_START(ovl_##name), SEGMENT_ROM_END(ovl_##name), SEGMENT_START(ovl_##name), \
+ SEGMENT_END(ovl_##name), NULL, &name##_InitVars, 1, \
+ }
+
+#define EFFECT_SS_OVERLAY_INTERNAL(name) \
+ { 0, 0, NULL, NULL, NULL, &name##_InitVars, 1 }
+
+#define EFFECT_SS_OVERLAY_UNSET \
+ { 0 }
+
+EffectSsOverlay gParticleOverlayTable[] = {
+ EFFECT_SS_OVERLAY(Effect_Ss_Dust),
+ EFFECT_SS_OVERLAY(Effect_Ss_Kirakira),
+ EFFECT_SS_OVERLAY_UNSET,
+ EFFECT_SS_OVERLAY(Effect_Ss_Bomb2),
+ EFFECT_SS_OVERLAY(Effect_Ss_Blast),
+ EFFECT_SS_OVERLAY(Effect_Ss_G_Spk),
+ EFFECT_SS_OVERLAY(Effect_Ss_D_Fire),
+ EFFECT_SS_OVERLAY(Effect_Ss_Bubble),
+ EFFECT_SS_OVERLAY_UNSET,
+ EFFECT_SS_OVERLAY(Effect_Ss_G_Ripple),
+ EFFECT_SS_OVERLAY(Effect_Ss_G_Splash),
+ EFFECT_SS_OVERLAY_UNSET,
+ EFFECT_SS_OVERLAY(Effect_Ss_G_Fire),
+ EFFECT_SS_OVERLAY(Effect_Ss_Lightning),
+ EFFECT_SS_OVERLAY(Effect_Ss_Dt_Bubble),
+ EFFECT_SS_OVERLAY(Effect_Ss_Hahen),
+ EFFECT_SS_OVERLAY(Effect_Ss_Stick),
+ EFFECT_SS_OVERLAY(Effect_Ss_Sibuki),
+ EFFECT_SS_OVERLAY_UNSET,
+ EFFECT_SS_OVERLAY_UNSET,
+ EFFECT_SS_OVERLAY(Effect_Ss_Stone1),
+ EFFECT_SS_OVERLAY(Effect_Ss_Hitmark),
+ EFFECT_SS_OVERLAY(Effect_Ss_Fhg_Flash),
+ EFFECT_SS_OVERLAY(Effect_Ss_K_Fire),
+ EFFECT_SS_OVERLAY(Effect_Ss_Solder_Srch_Ball),
+ EFFECT_SS_OVERLAY(Effect_Ss_Kakera),
+ EFFECT_SS_OVERLAY(Effect_Ss_Ice_Piece),
+ EFFECT_SS_OVERLAY(Effect_Ss_En_Ice),
+ EFFECT_SS_OVERLAY(Effect_Ss_Fire_Tail),
+ EFFECT_SS_OVERLAY(Effect_Ss_En_Fire),
+ EFFECT_SS_OVERLAY(Effect_Ss_Extra),
+ EFFECT_SS_OVERLAY_UNSET,
+ EFFECT_SS_OVERLAY(Effect_Ss_Dead_Db),
+ EFFECT_SS_OVERLAY(Effect_Ss_Dead_Dd),
+ EFFECT_SS_OVERLAY(Effect_Ss_Dead_Ds),
+ EFFECT_SS_OVERLAY_UNSET,
+ EFFECT_SS_OVERLAY(Effect_Ss_Ice_Smoke),
+ EFFECT_SS_OVERLAY(Effect_En_Ice_Block),
+ EFFECT_SS_OVERLAY(Effect_Ss_Sbn),
+};
diff --git a/src/code/z_effect_soft_sprite_old_init.c b/src/code/z_effect_soft_sprite_old_init.c
index 4303d3db2..1c69f57f3 100644
--- a/src/code/z_effect_soft_sprite_old_init.c
+++ b/src/code/z_effect_soft_sprite_old_init.c
@@ -124,32 +124,32 @@ void func_800B1054(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f*
EffectSsDust_Spawn(globalCtx, 1, pos, velocity, accel, primColor, envColor, scale, scaleStep, 10, 1);
}
-extern Color_RGBA8 D_801AE3B0;
-extern Color_RGBA8 D_801AE3B4;
+static Color_RGBA8 sDustBrownPrim = { 170, 130, 90, 255 };
+static Color_RGBA8 sDustBrownEnv = { 100, 60, 20, 255 };
void func_800B10C0(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel) {
- EffectSsDust_Spawn(globalCtx, 4, pos, velocity, accel, &D_801AE3B0, &D_801AE3B4, 100, 5, 10, 0);
+ EffectSsDust_Spawn(globalCtx, 4, pos, velocity, accel, &sDustBrownPrim, &sDustBrownEnv, 100, 5, 10, 0);
}
void func_800B1130(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel) {
- EffectSsDust_Spawn(globalCtx, 5, pos, velocity, accel, &D_801AE3B0, &D_801AE3B4, 100, 5, 10, 0);
+ EffectSsDust_Spawn(globalCtx, 5, pos, velocity, accel, &sDustBrownPrim, &sDustBrownEnv, 100, 5, 10, 0);
}
void func_800B11A0(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 scale, s16 scaleStep) {
- EffectSsDust_Spawn(globalCtx, 4, pos, velocity, accel, &D_801AE3B0, &D_801AE3B4, scale, scaleStep, 10, 0);
+ EffectSsDust_Spawn(globalCtx, 4, pos, velocity, accel, &sDustBrownPrim, &sDustBrownEnv, scale, scaleStep, 10, 0);
}
void func_800B1210(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 scale, s16 scaleStep) {
- EffectSsDust_Spawn(globalCtx, 5, pos, velocity, accel, &D_801AE3B0, &D_801AE3B4, scale, scaleStep, 10, 0);
+ EffectSsDust_Spawn(globalCtx, 5, pos, velocity, accel, &sDustBrownPrim, &sDustBrownEnv, scale, scaleStep, 10, 0);
}
void func_800B1280(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 scale, s16 scaleStep,
s16 life) {
- EffectSsDust_Spawn(globalCtx, 4, pos, velocity, accel, &D_801AE3B0, &D_801AE3B4, scale, scaleStep, life, 0);
+ EffectSsDust_Spawn(globalCtx, 4, pos, velocity, accel, &sDustBrownPrim, &sDustBrownEnv, scale, scaleStep, life, 0);
}
void func_800B12F0(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 scale, s16 scaleStep,
s16 life) {
- EffectSsDust_Spawn(globalCtx, 5, pos, velocity, accel, &D_801AE3B0, &D_801AE3B4, scale, scaleStep, life, 0);
+ EffectSsDust_Spawn(globalCtx, 5, pos, velocity, accel, &sDustBrownPrim, &sDustBrownEnv, scale, scaleStep, life, 0);
}
void func_800B1360(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel, Color_RGBA8* primColor,
@@ -206,12 +206,9 @@ void func_800B1598(GlobalContext* globalCtx, f32 randScale, Vec3f* srcPos) {
}
}
-extern Color_RGBA8 D_801AE3B8;
-extern Color_RGBA8 D_801AE3BC;
-
void EffectSsKiraKira_SpawnSmallYellow(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel) {
- Color_RGBA8 primColor = D_801AE3B8;
- Color_RGBA8 envColor = D_801AE3BC;
+ Color_RGBA8 primColor = { 255, 255, 200, 255 };
+ Color_RGBA8 envColor = { 255, 200, 0, 0 };
EffectSsKiraKira_SpawnDispersed(globalCtx, pos, velocity, accel, &primColor, &envColor, 1000, 16);
}
@@ -307,12 +304,12 @@ void EffectSsBlast_Spawn(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity,
EffectSs_Spawn(globalCtx, EFFECT_SS_BLAST, 128, &initParams);
}
-extern Color_RGBA8 D_801AE3C0;
-extern Color_RGBA8 D_801AE3C4;
-
void EffectSsBlast_SpawnWhiteCustomScale(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 scale,
s16 scaleStep, s16 life) {
- EffectSsBlast_Spawn(globalCtx, pos, velocity, accel, &D_801AE3C0, &D_801AE3C4, scale, scaleStep, 35, life);
+ static Color_RGBA8 primColor = { 255, 255, 255, 255 };
+ static Color_RGBA8 envColor = { 200, 200, 200, 0 };
+
+ EffectSsBlast_Spawn(globalCtx, pos, velocity, accel, &primColor, &envColor, scale, scaleStep, 35, life);
}
void EffectSsBlast_SpawnShockwave(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel,
@@ -320,11 +317,11 @@ void EffectSsBlast_SpawnShockwave(GlobalContext* globalCtx, Vec3f* pos, Vec3f* v
EffectSsBlast_Spawn(globalCtx, pos, velocity, accel, primColor, envColor, 100, 375, 35, life);
}
-extern Color_RGBA8 D_801AE3C8;
-extern Color_RGBA8 D_801AE3CC;
-
void EffectSsBlast_SpawnWhiteShockwave(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel) {
- EffectSsBlast_SpawnShockwave(globalCtx, pos, velocity, accel, &D_801AE3C8, &D_801AE3CC, 10);
+ static Color_RGBA8 primColor = { 255, 255, 255, 255 };
+ static Color_RGBA8 envColor = { 200, 200, 200, 0 };
+
+ EffectSsBlast_SpawnShockwave(globalCtx, pos, velocity, accel, &primColor, &envColor, 10);
}
// EffectSsGSpk Spawn Functions
@@ -364,24 +361,18 @@ void EffectSsGSpk_SpawnNoAccel(GlobalContext* globalCtx, Actor* actor, Vec3f* po
EffectSs_Spawn(globalCtx, EFFECT_SS_G_SPK, 128, &initParams);
}
-extern Color_RGBA8 D_801AE3D0;
-extern Color_RGBA8 D_801AE3D4;
-
void EffectSsGSpk_SpawnFuse(GlobalContext* globalCtx, Actor* actor, Vec3f* pos, Vec3f* velocity, Vec3f* accel) {
- Color_RGBA8 primColor = D_801AE3D0;
- Color_RGBA8 envColor = D_801AE3D4;
+ Color_RGBA8 primColor = { 255, 255, 150, 255 };
+ Color_RGBA8 envColor = { 255, 0, 0, 0 };
EffectSsGSpk_SpawnSmall(globalCtx, actor, pos, velocity, accel, &primColor, &envColor);
}
-extern Color_RGBA8 D_801AE3D8;
-extern Color_RGBA8 D_801AE3DC;
-
// unused
void EffectSsGSpk_SpawnRandColor(GlobalContext* globalCtx, Actor* actor, Vec3f* pos, Vec3f* velocity, Vec3f* accel,
s16 scale, s16 scaleStep) {
- Color_RGBA8 primColor = D_801AE3D8;
- Color_RGBA8 envColor = D_801AE3DC;
+ Color_RGBA8 primColor = { 255, 255, 150, 255 };
+ Color_RGBA8 envColor = { 255, 0, 0, 0 };
s32 randOffset = (Rand_ZeroOne() * 20.0f) - 10.0f;
primColor.r += randOffset;
@@ -585,12 +576,10 @@ void EffectSsHahen_SpawnBurst(GlobalContext* globalCtx, Vec3f* pos, f32 burstSca
}
}
-extern Vec3f D_801AE3E0;
-
void func_800B2364(GlobalContext* globalCtx, Vec3f* pos, Gfx* dList) {
- Vec3f posVec = D_801AE3E0;
+ Vec3f accel = { 0.0f, -2.0f, 0.0f };
- EffectSsHahen_Spawn(globalCtx, pos, &gZeroVec3f, &posVec, 1, 5, 1, 10, dList);
+ EffectSsHahen_Spawn(globalCtx, pos, &gZeroVec3f, &accel, 1, 5, 1, 10, dList);
}
// EffectSsStick Spawn Functions
@@ -624,12 +613,9 @@ void EffectSsSibuki_Spawn(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity,
EffectSs_Spawn(globalCtx, EFFECT_SS_SIBUKI, 128, &initParams);
}
-extern Vec3f D_801AE3EC;
-extern Vec3f D_801AE3F8;
-
void EffectSsSibuki_SpawnBurst(GlobalContext* globalCtx, Vec3f* pos) {
s16 i;
- Vec3f zeroVec = D_801AE3EC;
+ Vec3f zeroVec = { 0.0f, 0.0f, 0.0f };
s16 randDirection = Rand_ZeroOne() * 1.99f;
for (i = 0; i < KREG(19) + 30; i++) {
@@ -759,11 +745,6 @@ void EffectSsIcePiece_Spawn(GlobalContext* globalCtx, Vec3f* pos, f32 scale, Vec
EffectSs_Spawn(globalCtx, EFFECT_SS_ICE_PIECE, 128, &initParams);
}
-extern Vec3f D_801AE3F8;
-extern Vec3f D_801AE404[10];
-
-#ifdef NON_MATCHING
-/* needs data migration to match */
void EffectSsIcePiece_SpawnBurst(GlobalContext* globalCtx, Vec3f* refPos, f32 scale) {
static Vec3f accel = { 0.0f, 0.0f, 0.0f };
static Vec3f vecScales[] = {
@@ -799,15 +780,11 @@ void EffectSsIcePiece_SpawnBurst(GlobalContext* globalCtx, Vec3f* refPos, f32 sc
&accel, 25);
}
}
-#else
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_effect_soft_sprite_old_init/EffectSsIcePiece_SpawnBurst.s")
-#endif
// EffectSsEnIce Spawn Functions
void EffectSsEnIce_SpawnFlyingVec3f(GlobalContext* globalCtx, Actor* actor, Vec3f* pos, Color_RGBA8* prim,
Color_RGBA8* env, f32 scale) {
-
EffectSsEnIceInitParams initParams;
initParams.actor = actor;
@@ -824,11 +801,11 @@ void EffectSsEnIce_SpawnFlyingVec3f(GlobalContext* globalCtx, Actor* actor, Vec3
EffectSs_Spawn(globalCtx, EFFECT_SS_EN_ICE, 80, &initParams);
}
-extern Color_RGBA8 D_801AE47C;
-extern Color_RGBA8 D_801AE480;
-
void func_800B2B44(GlobalContext* globalCtx, Actor* actor, Vec3f* pos, f32 scale) {
- EffectSsEnIce_SpawnFlyingVec3f(globalCtx, actor, pos, &D_801AE47C, &D_801AE480, scale);
+ static Color_RGBA8 primColor = { 150, 150, 150, 250 };
+ static Color_RGBA8 envColor = { 235, 245, 255, 255 };
+
+ EffectSsEnIce_SpawnFlyingVec3f(globalCtx, actor, pos, &primColor, &envColor, scale);
}
void func_800B2B7C(GlobalContext* globalCtx, Actor* actor, Vec3s* arg2, f32 scale) {
@@ -874,29 +851,21 @@ void EffectSsFireTail_Spawn(GlobalContext* globalCtx, Actor* actor, Vec3f* pos,
EffectSs_Spawn(globalCtx, EFFECT_SS_FIRE_TAIL, 128, &initParams);
}
-extern Color_RGBA8 D_801AE484;
-extern Color_RGBA8 D_801AE488;
-
-#ifdef NON_MATCHING
-// needs data migration to match
void EffectSsFireTail_SpawnFlame(GlobalContext* globalCtx, Actor* actor, Vec3f* pos, f32 arg3, s16 bodyPart,
f32 colorIntensity) {
+ static Color_RGBA8 primColor = { 255, 255, 0, 255 };
+ static Color_RGBA8 envColor = { 255, 0, 0, 255 };
- D_801AE484.g = (s32)(255.0f * colorIntensity);
- D_801AE484.b = 0;
+ primColor.g = (s32)(255.0f * colorIntensity);
+ primColor.b = 0;
- D_801AE488.g = 0;
- D_801AE488.b = 0;
- D_801AE484.r = D_801AE488.r = (s32)(255.0f * colorIntensity);
+ envColor.g = 0;
+ envColor.b = 0;
+ primColor.r = envColor.r = (s32)(255.0f * colorIntensity);
- EffectSsFireTail_Spawn(globalCtx, actor, pos, arg3, &actor->velocity, 15, &D_801AE484, &D_801AE488,
+ EffectSsFireTail_Spawn(globalCtx, actor, pos, arg3, &actor->velocity, 15, &primColor, &envColor,
(colorIntensity == 1.0f) ? 0 : 1, bodyPart, 1);
}
-#else
-void EffectSsFireTail_SpawnFlame(GlobalContext* globalCtx, Actor* actor, Vec3f* pos, f32 arg3, s16 bodyPart,
- f32 colorIntensity);
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_effect_soft_sprite_old_init/EffectSsFireTail_SpawnFlame.s")
-#endif
void EffectSsFireTail_SpawnFlameOnPlayer(GlobalContext* globalCtx, f32 scale, s16 bodyPart, f32 colorIntensity) {
Player* player = GET_PLAYER(globalCtx);
@@ -982,12 +951,17 @@ void EffectSsDeadDb_Spawn(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity,
EffectSs_Spawn(globalCtx, EFFECT_SS_DEAD_DB, 120, &initParams);
}
-extern Color_RGBA8 D_801AE48C;
-extern Color_RGBA8 D_801AE490[4];
-
void func_800B3030(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 scale, s16 scaleStep,
s32 colorIndex) {
- EffectSsDeadDb_Spawn(globalCtx, pos, velocity, accel, &D_801AE48C, &D_801AE490[colorIndex], scale, scaleStep, 9);
+ static Color_RGBA8 primColor = { 255, 255, 255, 255 };
+ static Color_RGBA8 envColors[] = {
+ { 255, 0, 0, 255 },
+ { 0, 255, 0, 255 },
+ { 0, 0, 255, 255 },
+ { 150, 150, 150, 255 },
+ };
+
+ EffectSsDeadDb_Spawn(globalCtx, pos, velocity, accel, &primColor, &envColors[colorIndex], scale, scaleStep, 9);
}
// EffectSsDeadDd Spawn Functions