From 3c5abbd9b2fed88f8dcdc4cf0fdec2997de1bd5b Mon Sep 17 00:00:00 2001 From: JCog <42006114+JCog@users.noreply.github.com> Date: Wed, 2 Oct 2024 13:31:22 -0500 Subject: [PATCH] use ASSERT_FX for effects --- include/effect_shims.h | 2 ++ include/effects_internal.h | 6 ++++-- include/functions.h | 2 +- src/crash_screen.c | 13 ++++++++++++- src/effect_shims.yaml | 1 + src/effects.c | 3 +-- src/effects/attack_result_text.c | 2 +- src/effects/aura.c | 2 +- src/effects/balloon.c | 2 +- src/effects/big_smoke_puff.c | 2 +- src/effects/big_snowflakes.c | 2 +- src/effects/blast.c | 2 +- src/effects/bombette_breaking.c | 2 +- src/effects/breaking_junk.c | 2 +- src/effects/bulb_glow.c | 2 +- src/effects/butterflies.c | 2 +- src/effects/chapter_change.c | 2 +- src/effects/chomp_drop.c | 2 +- src/effects/cloud_puff.c | 2 +- src/effects/cloud_trail.c | 2 +- src/effects/cold_breath.c | 2 +- src/effects/confetti.c | 2 +- src/effects/damage_indicator.c | 2 +- src/effects/damage_stars.c | 2 +- src/effects/debuff.c | 2 +- src/effects/disable_x.c | 2 +- src/effects/drop_leaves.c | 2 +- src/effects/dust.c | 2 +- src/effects/effect_3D.c | 2 +- src/effects/effect_46.c | 2 +- src/effects/effect_63.c | 2 +- src/effects/effect_65.c | 2 +- src/effects/effect_75.c | 2 +- src/effects/effect_86.c | 2 +- src/effects/embers.c | 2 +- src/effects/emote.c | 2 +- src/effects/ending_decals.c | 2 +- src/effects/energy_in_out.c | 2 +- src/effects/energy_orb_wave.c | 2 +- src/effects/energy_shockwave.c | 2 +- src/effects/explosion.c | 2 +- src/effects/falling_leaves.c | 2 +- src/effects/fire_breath.c | 2 +- src/effects/fire_flower.c | 2 +- src/effects/firework.c | 2 +- src/effects/firework_rocket.c | 2 +- src/effects/flame.c | 2 +- src/effects/flashing_box_shockwave.c | 2 +- src/effects/floating_cloud_puff.c | 2 +- src/effects/floating_flower.c | 2 +- src/effects/floating_rock.c | 2 +- src/effects/flower_splash.c | 2 +- src/effects/flower_trail.c | 2 +- src/effects/footprint.c | 2 +- src/effects/fright_jar.c | 2 +- src/effects/gather_magic.c | 2 +- src/effects/got_item_outline.c | 2 +- src/effects/green_impact.c | 2 +- src/effects/hieroglyphs.c | 2 +- src/effects/huff_puff_breath.c | 2 +- src/effects/ice_pillar.c | 2 +- src/effects/ice_shard.c | 2 +- src/effects/landing_dust.c | 2 +- src/effects/lens_flare.c | 2 +- src/effects/light_rays.c | 2 +- src/effects/lightning.c | 2 +- src/effects/lightning_bolt.c | 2 +- src/effects/lil_oink.c | 2 +- src/effects/merlin_house_stars.c | 2 +- src/effects/misc_particles.c | 2 +- src/effects/motion_blur_flame.c | 2 +- src/effects/moving_cloud.c | 2 +- src/effects/music_note.c | 2 +- src/effects/partner_buff.c | 2 +- src/effects/peach_star_beam.c | 2 +- src/effects/pink_sparkles.c | 2 +- src/effects/purple_ring.c | 2 +- src/effects/quizmo_assistant.c | 2 +- src/effects/quizmo_audience.c | 2 +- src/effects/quizmo_stage.c | 2 +- src/effects/radial_shimmer.c | 2 +- src/effects/radiating_energy_orb.c | 2 +- src/effects/recover.c | 2 +- src/effects/red_impact.c | 2 +- src/effects/ring_blast.c | 2 +- src/effects/rising_bubble.c | 2 +- src/effects/shape_spell.c | 2 +- src/effects/shattering_stones.c | 2 +- src/effects/shimmer_burst.c | 2 +- src/effects/shimmer_wave.c | 2 +- src/effects/shiny_flare.c | 2 +- src/effects/shockwave.c | 2 +- src/effects/sleep_bubble.c | 2 +- src/effects/small_gold_sparkle.c | 2 +- src/effects/smoke_burst.c | 2 +- src/effects/smoke_impact.c | 2 +- src/effects/smoke_ring.c | 2 +- src/effects/snaking_static.c | 2 +- src/effects/snowfall.c | 2 +- src/effects/snowflake.c | 2 +- src/effects/snowman_doll.c | 2 +- src/effects/something_rotating.c | 2 +- src/effects/sparkles.c | 2 +- src/effects/spiky_white_aura.c | 2 +- src/effects/spirit_card.c | 2 +- src/effects/squirt.c | 2 +- src/effects/star.c | 2 +- src/effects/star_outline.c | 2 +- src/effects/star_spirits_energy.c | 2 +- src/effects/stars_burst.c | 2 +- src/effects/stars_orbiting.c | 2 +- src/effects/stars_shimmer.c | 2 +- src/effects/stars_spread.c | 2 +- src/effects/stat_change.c | 2 +- src/effects/static_status.c | 2 +- src/effects/steam_burst.c | 2 +- src/effects/stop_watch.c | 2 +- src/effects/sun.c | 2 +- src/effects/sweat.c | 2 +- src/effects/tattle_window.c | 2 +- src/effects/throw_spiny.c | 2 +- src/effects/thunderbolt_ring.c | 2 +- src/effects/tubba_heart_attack.c | 2 +- src/effects/underwater.c | 2 +- src/effects/walking_dust.c | 2 +- src/effects/water_block.c | 2 +- src/effects/water_fountain.c | 2 +- src/effects/water_splash.c | 2 +- src/effects/waterfall.c | 2 +- src/effects/whirlwind.c | 2 +- src/effects/windy_leaves.c | 2 +- src/main_loop.c | 3 ++- tools/build/configure.py | 2 +- 133 files changed, 149 insertions(+), 133 deletions(-) diff --git a/include/effect_shims.h b/include/effect_shims.h index 5d1e9d199d..80efbc4ae6 100644 --- a/include/effect_shims.h +++ b/include/effect_shims.h @@ -38,6 +38,7 @@ s32 shim_get_msg_width(s32, u16); void shim_mdl_get_shroud_tint_params(u8* r, u8* g, u8* b, u8* a); void shim_sfx_play_sound_at_position(s32 soundID, s32 value2, f32 posX, f32 posY, f32 posZ); void shim_is_debug_panic(const char* message, const char* file, u32 line, const char* func); +int shim_sprintf(char *s, const char *fmt, ...); #define guRotateF shim_guRotateF #define guTranslateF shim_guTranslateF @@ -72,5 +73,6 @@ void shim_is_debug_panic(const char* message, const char* file, u32 line, const #define mdl_get_shroud_tint_params shim_mdl_get_shroud_tint_params #define sfx_play_sound_at_position shim_sfx_play_sound_at_position #define is_debug_panic shim_is_debug_panic +#define sprintf shim_sprintf #endif diff --git a/include/effects_internal.h b/include/effects_internal.h index 3718f55777..f0989fc368 100644 --- a/include/effects_internal.h +++ b/include/effects_internal.h @@ -4,9 +4,11 @@ #include "effects.h" // slimmed down assert so that all effects still fit under the TLB page size limit of 0x1000 bytes -#define ASSERT(condition) \ +#define ASSERT_FX(condition, effectId) \ if (!(condition)) { \ - IS_DEBUG_PANIC("Assert", __FILE__, __LINE__, NULL); \ + char assertMsg[11]; \ + sprintf(assertMsg, "FX err 0x%02X", effectId); \ + IS_DEBUG_PANIC(assertMsg, NULL, 0, NULL); \ } s32 effect_rand_int(s32); diff --git a/include/functions.h b/include/functions.h index ae221073f1..94ca329d78 100644 --- a/include/functions.h +++ b/include/functions.h @@ -1069,7 +1069,7 @@ void clear_character_set(void); void clear_trigger_data(void); void clear_script_list(void); void clear_entity_data(b32); -void init_effect_data(void); +void check_effect_sizes(void); void clear_effect_data(void); void clear_saved_variables(void); diff --git a/src/crash_screen.c b/src/crash_screen.c index 61bb8b35f0..db35494945 100644 --- a/src/crash_screen.c +++ b/src/crash_screen.c @@ -68,7 +68,18 @@ char crashScreenAssertLocation[0x30] = {0}; void crash_screen_set_assert_info(const char* message, const char* file, u32 line, const char* func) { strncpy(crashScreenAssertMessage, message, sizeof(crashScreenAssertMessage)); crashScreenAssertMessage[sizeof(crashScreenAssertMessage) - 1] = '\0'; - sprintf(crashScreenAssertLocation, "%s (%s:%d)", func == NULL ? "Unknown" : func, file, line); + + // To make file consistent with standard exceptions, grab only the filename, not the full path. + if (file != NULL) { + const char* slash; + while (slash = strchr(file, '/')) { + if (slash[1] == '\0') { + break; + } + file = slash + 1; + } + } + sprintf(crashScreenAssertLocation, "%s (%s:%d)", func == NULL ? "Unknown" : func, file == NULL ? "Unknown" : file, line); } void crash_screen_sleep(s32 ms) { diff --git a/src/effect_shims.yaml b/src/effect_shims.yaml index 81a5675f31..43ad46f5d4 100644 --- a/src/effect_shims.yaml +++ b/src/effect_shims.yaml @@ -39,3 +39,4 @@ - shim_mdl_get_shroud_tint_params - shim_sfx_play_sound_at_position - shim_is_debug_panic +- shim_sprintf \ No newline at end of file diff --git a/src/effects.c b/src/effects.c index 242522129d..796ec20033 100644 --- a/src/effects.c +++ b/src/effects.c @@ -32,14 +32,13 @@ void set_effect_pos_offset(EffectInstance* effect, f32 x, f32 y, f32 z) { ((f32*)data)[3] = z; } -void init_effect_data(void) { +void check_effect_sizes(void) { s32 i; for (i = 0; i < ARRAY_COUNT(gEffectTable); i++) { s32 size = gEffectTable[i].dmaEnd - gEffectTable[i].dmaStart; ASSERT_MSG(size <= 0x1000, "Effect 0x%x == 0x%x bytes (0x1000 limit)", i, size); } - clear_effect_data(); } void clear_effect_data(void) { diff --git a/src/effects/attack_result_text.c b/src/effects/attack_result_text.c index afe7af4d0b..e80cb064af 100644 --- a/src/effects/attack_result_text.c +++ b/src/effects/attack_result_text.c @@ -52,7 +52,7 @@ EffectInstance* attack_result_text_main(s32 type, f32 posX, f32 posY, f32 posZ, data = effect->data.attackResultText = general_heap_malloc(effect->numParts * sizeof(*data)); - ASSERT(data != NULL); + ASSERT_FX(data != NULL, EFFECT_ATTACK_RESULT_TEXT) data->isVisible = TRUE; data->unk_20 = 0; diff --git a/src/effects/aura.c b/src/effects/aura.c index 42c1d02fab..dbabc384ab 100644 --- a/src/effects/aura.c +++ b/src/effects/aura.c @@ -73,7 +73,7 @@ void aura_main(s32 type, f32 posX, f32 posY, f32 posZ, f32 scale, EffectInstance part = effect->data.aura = general_heap_malloc(numParts * sizeof(*part)); - ASSERT(effect->data.aura != NULL); + ASSERT_FX(effect->data.aura != NULL, EFFECT_AURA) part->renderYaw = 0.0f; diff --git a/src/effects/balloon.c b/src/effects/balloon.c index 4c8fd93a4b..03cf9774d8 100644 --- a/src/effects/balloon.c +++ b/src/effects/balloon.c @@ -34,7 +34,7 @@ EffectInstance* balloon_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, s effect->data.balloon = data; part = data; - ASSERT(data != NULL); + ASSERT_FX(data != NULL, EFFECT_BALLOON) part->unk_00 = arg0; part->unk_04 = arg1; diff --git a/src/effects/big_smoke_puff.c b/src/effects/big_smoke_puff.c index 84d43af3a5..b5d8a436d4 100644 --- a/src/effects/big_smoke_puff.c +++ b/src/effects/big_smoke_puff.c @@ -48,7 +48,7 @@ void big_smoke_puff_main(f32 x, f32 y, f32 z) { data = general_heap_malloc(effect->numParts * sizeof(*data)); effect->data.bigSmokePuff = data; - ASSERT(data != NULL); + ASSERT_FX(data != NULL, EFFECT_BIG_SMOKE_PUFF) for (i = 0; i < effect->numParts; i++, data++) { data->unk_00 = 0; diff --git a/src/effects/big_snowflakes.c b/src/effects/big_snowflakes.c index afc780578e..f033392e0c 100644 --- a/src/effects/big_snowflakes.c +++ b/src/effects/big_snowflakes.c @@ -33,7 +33,7 @@ void big_snowflakes_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3) { data = general_heap_malloc(effect->numParts * sizeof(*data)); effect->data.bigSnowflakes = data; - ASSERT(data != NULL); + ASSERT_FX(data != NULL, EFFECT_BIG_SNOWFLAKES) mem_clear(data, numParts * sizeof(*data)); data->unk_00 = arg0; diff --git a/src/effects/blast.c b/src/effects/blast.c index 062601a73c..84335ffeee 100644 --- a/src/effects/blast.c +++ b/src/effects/blast.c @@ -44,7 +44,7 @@ void blast_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, s32 arg5) { part = effect->data.blast = general_heap_malloc(numParts * sizeof(*part)); - ASSERT(effect->data.blast != NULL); + ASSERT_FX(effect->data.blast != NULL, EFFECT_BLAST) mem_clear(part, numParts * sizeof(*part)); diff --git a/src/effects/bombette_breaking.c b/src/effects/bombette_breaking.c index f9b0c77b43..f8c970cf90 100644 --- a/src/effects/bombette_breaking.c +++ b/src/effects/bombette_breaking.c @@ -73,7 +73,7 @@ EffectInstance* bombette_breaking_main(s32 type, s32 modelID, s32 treeIndex, f32 effect = create_effect_instance(bpPtr); effect->numParts = numParts; effect->data.bombetteBreaking = data = general_heap_malloc(numParts * sizeof(*data)); - ASSERT(data != NULL); + ASSERT_FX(data != NULL, EFFECT_BOMBETTE_BREAKING) data->unk_04 = -sizeY * 0.5; data->timeLeft = time; diff --git a/src/effects/breaking_junk.c b/src/effects/breaking_junk.c index a92f5456cf..0da3fe2eaf 100644 --- a/src/effects/breaking_junk.c +++ b/src/effects/breaking_junk.c @@ -37,7 +37,7 @@ EffectInstance* breaking_junk_main(s32 arg0, f32 x, f32 y, f32 z, f32 scale, s32 data = effect->data.breakingJunk = general_heap_malloc(numParts * sizeof(*data)); - ASSERT(effect->data.breakingJunk != NULL); + ASSERT_FX(effect->data.breakingJunk != NULL, EFFECT_BREAKING_JUNK) data->unk_00 = arg0; data->lifeTime = 0; diff --git a/src/effects/bulb_glow.c b/src/effects/bulb_glow.c index 404fcb0ae0..64029c76d0 100644 --- a/src/effects/bulb_glow.c +++ b/src/effects/bulb_glow.c @@ -63,7 +63,7 @@ void bulb_glow_main(s32 arg0, f32 posX, f32 posY, f32 posZ, f32 arg4, EffectInst effect = create_effect_instance(&bp); effect->numParts = numParts; data = effect->data.bulbGlow = general_heap_malloc(numParts * sizeof(*data)); - ASSERT(effect->data.bulbGlow != NULL); + ASSERT_FX(effect->data.bulbGlow != NULL, EFFECT_BULB_GLOW) data->type = arg0 & 255; if (arg0 < 256) { diff --git a/src/effects/butterflies.c b/src/effects/butterflies.c index 0de39eba67..db7cafb003 100644 --- a/src/effects/butterflies.c +++ b/src/effects/butterflies.c @@ -46,7 +46,7 @@ EffectInstance* butterflies_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3) { effect = create_effect_instance(&bp); effect->numParts = numParts; part = effect->data.butterflies = general_heap_malloc(numParts * sizeof(*part)); - ASSERT(effect->data.butterflies != NULL); + ASSERT_FX(effect->data.butterflies != NULL, EFFECT_BUTTERFLIES) part->unk_04 = 1000; part->unk_00 = arg0; diff --git a/src/effects/chapter_change.c b/src/effects/chapter_change.c index b4898180fb..545568d963 100644 --- a/src/effects/chapter_change.c +++ b/src/effects/chapter_change.c @@ -189,7 +189,7 @@ EffectInstance* chapter_change_main(s32 arg0, f32 posX, f32 posY, f32 arg3, f32 effect = create_effect_instance(&bp); effect->numParts = numParts; data = effect->data.chapterChange = general_heap_malloc(numParts * sizeof(*data)); - ASSERT(effect->data.chapterChange != NULL); + ASSERT_FX(effect->data.chapterChange != NULL, EFFECT_CHAPTER_CHANGE) data->unk_00 = arg0; data->lifetime = 0; diff --git a/src/effects/chomp_drop.c b/src/effects/chomp_drop.c index 64ce7a903a..8e60d313d6 100644 --- a/src/effects/chomp_drop.c +++ b/src/effects/chomp_drop.c @@ -28,7 +28,7 @@ EffectInstance* chomp_drop_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4 effect = create_effect_instance(&bp); effect->numParts = numParts; data = effect->data.chompDrop = general_heap_malloc(numParts * sizeof(*data)); - ASSERT(effect->data.chompDrop != NULL); + ASSERT_FX(effect->data.chompDrop != NULL, EFFECT_CHOMP_DROP) data->unk_00 = arg0; data->unk_04 = arg1; diff --git a/src/effects/cloud_puff.c b/src/effects/cloud_puff.c index 22b37c31f2..df3bed57e0 100644 --- a/src/effects/cloud_puff.c +++ b/src/effects/cloud_puff.c @@ -28,7 +28,7 @@ void cloud_puff_main(f32 x, f32 y, f32 z, f32 angle) { effect->numParts = numParts; part = general_heap_malloc(numParts * sizeof(*part)); effect->data.cloudPuff = part; - ASSERT(effect->data.cloudPuff != NULL); + ASSERT_FX(effect->data.cloudPuff != NULL, EFFECT_CLOUD_PUFF) mem_clear(part, numParts * sizeof(*part)); diff --git a/src/effects/cloud_trail.c b/src/effects/cloud_trail.c index c42d1c5647..52afba9463 100644 --- a/src/effects/cloud_trail.c +++ b/src/effects/cloud_trail.c @@ -28,7 +28,7 @@ void cloud_trail_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3) { part = general_heap_malloc(numParts * sizeof(*part)); effect->data.cloudTrail = part; - ASSERT(effect->data.cloudTrail != NULL); + ASSERT_FX(effect->data.cloudTrail != NULL, EFFECT_CLOUD_TRAIL) mem_clear(part, numParts * sizeof(*part)); diff --git a/src/effects/cold_breath.c b/src/effects/cold_breath.c index 35efa7cfcc..a61571cc57 100644 --- a/src/effects/cold_breath.c +++ b/src/effects/cold_breath.c @@ -92,7 +92,7 @@ EffectInstance* cold_breath_main(s32 type, f32 posX, f32 posY, f32 posZ, f32 sca effect = create_effect_instance(&bp); effect->numParts = numParts; data = effect->data.coldBreath = general_heap_malloc(numParts * sizeof(*data)); - ASSERT(effect->data.coldBreath != NULL); + ASSERT_FX(effect->data.coldBreath != NULL, EFFECT_COLD_BREATH) data->type = type; data->lifetime = 0; diff --git a/src/effects/confetti.c b/src/effects/confetti.c index 962cb44ce5..103d17680b 100644 --- a/src/effects/confetti.c +++ b/src/effects/confetti.c @@ -111,7 +111,7 @@ EffectInstance* confetti_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, effect = create_effect_instance(bpPtr); effect->numParts = numParts; data = effect->data.confetti = (ConfettiFXData*)general_heap_malloc(numParts * sizeof(*data)); - ASSERT(effect->data.confetti != NULL); + ASSERT_FX(effect->data.confetti != NULL, EFFECT_CONFETTI) data->unk_04 = arg1; data->unk_08 = arg2; diff --git a/src/effects/damage_indicator.c b/src/effects/damage_indicator.c index 1531f0f928..0786e85dab 100644 --- a/src/effects/damage_indicator.c +++ b/src/effects/damage_indicator.c @@ -98,7 +98,7 @@ void damage_indicator_main(s32 arg0, f32 posX, f32 posY, f32 posZ, f32 starsRadi effect->numParts = damageAmt; effect->data.damageIndicator = part = general_heap_malloc(damageAmt * sizeof(*part)); - ASSERT(effect->data.damageIndicator != NULL); + ASSERT_FX(effect->data.damageIndicator != NULL, EFFECT_DAMAGE_INDICATOR) part->unk_00 = arg0; part->basePos.x = posX; diff --git a/src/effects/damage_stars.c b/src/effects/damage_stars.c index 5e55044b99..6bf977fe64 100644 --- a/src/effects/damage_stars.c +++ b/src/effects/damage_stars.c @@ -93,7 +93,7 @@ void damage_stars_main(s32 type, f32 x, f32 y, f32 z, f32 rotAxisX, f32 rotAxisY effect = create_effect_instance(bpPtr); effect->numParts = number; part = effect->data.damageStars = general_heap_malloc(number * sizeof(*part)); - ASSERT(effect->data.damageStars != NULL); + ASSERT_FX(effect->data.damageStars != NULL, EFFECT_DAMAGE_STARS) for (i = 0; i < number; i++, part++) { part->type = type; diff --git a/src/effects/debuff.c b/src/effects/debuff.c index 2c2c330752..493db160d2 100644 --- a/src/effects/debuff.c +++ b/src/effects/debuff.c @@ -31,7 +31,7 @@ EffectInstance* debuff_main(s32 type, f32 x, f32 y, f32 z) { effect->data.debuff = data = general_heap_malloc(numParts * sizeof(*data)); - ASSERT(data != NULL); + ASSERT_FX(data != NULL, EFFECT_DEBUFF) mem_clear(data, numParts * sizeof(*data)); diff --git a/src/effects/disable_x.c b/src/effects/disable_x.c index dbf8aadee7..c54df248a8 100644 --- a/src/effects/disable_x.c +++ b/src/effects/disable_x.c @@ -51,7 +51,7 @@ EffectInstance* disable_x_main(s32 type, f32 x, f32 y, f32 z, s32 arg4) { effect->numParts = numParts; data = general_heap_malloc(numParts * sizeof(*data)); effect->data.disableX = data; - ASSERT(effect->data.disableX != NULL); + ASSERT_FX(effect->data.disableX != NULL, EFFECT_DISABLE_X) data->type = type; data->scale = 1.0f; diff --git a/src/effects/drop_leaves.c b/src/effects/drop_leaves.c index 5afa1afbc3..8294083edd 100644 --- a/src/effects/drop_leaves.c +++ b/src/effects/drop_leaves.c @@ -26,7 +26,7 @@ void drop_leaves_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, s32 arg4) { effect = create_effect_instance(&bp); effect->numParts = numParts; part = effect->data.dropLeaves = general_heap_malloc(numParts * sizeof(*part)); - ASSERT(effect->data.dropLeaves != NULL); + ASSERT_FX(effect->data.dropLeaves != NULL, EFFECT_DROP_LEAVES) part->unk_00 = arg0; part->unk_04 = arg1; diff --git a/src/effects/dust.c b/src/effects/dust.c index 41716c6bd5..bb3c86ca8a 100644 --- a/src/effects/dust.c +++ b/src/effects/dust.c @@ -36,7 +36,7 @@ EffectInstance* dust_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, s32 arg4) { effect = create_effect_instance(bpPtr); effect->numParts = numParts; part = effect->data.dust = general_heap_malloc(numParts * sizeof(*part)); - ASSERT(effect->data.dust != NULL); + ASSERT_FX(effect->data.dust != NULL, EFFECT_DUST) part->unk_00 = arg0; part->unk_04 = arg1; diff --git a/src/effects/effect_3D.c b/src/effects/effect_3D.c index b053fe2538..ee2066b79e 100644 --- a/src/effects/effect_3D.c +++ b/src/effects/effect_3D.c @@ -71,7 +71,7 @@ void effect_3D_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, effect = create_effect_instance(bpPtr); effect->numParts = arg7; part = effect->data.unk_3D = general_heap_malloc(arg7 * sizeof(*part)); - ASSERT(effect->data.unk_3D != NULL); + ASSERT_FX(effect->data.unk_3D != NULL, EFFECT_3D) part->unk_04 = 0; part->unk_00 = arg0; diff --git a/src/effects/effect_46.c b/src/effects/effect_46.c index 6e55f9beec..a79529f38e 100644 --- a/src/effects/effect_46.c +++ b/src/effects/effect_46.c @@ -38,7 +38,7 @@ EffectInstance* effect_46_main(s32 type, PlayerStatus* player, f32 scale, s32 du effect = create_effect_instance(&bp); effect->numParts = numParts; part = effect->data.spin = general_heap_malloc(numParts * sizeof(*part)); - ASSERT(effect->data.spin != NULL); + ASSERT_FX(effect->data.spin != NULL, EFFECT_46) part->type = type; part->player = player; diff --git a/src/effects/effect_63.c b/src/effects/effect_63.c index e608833921..6183198512 100644 --- a/src/effects/effect_63.c +++ b/src/effects/effect_63.c @@ -53,7 +53,7 @@ EffectInstance* effect_63_main( effect = create_effect_instance(bpPtr); effect->numParts = numParts; part = effect->data.unk_63 = general_heap_malloc(numParts * sizeof(*part)); - ASSERT(effect->data.unk_63 != NULL); + ASSERT_FX(effect->data.unk_63 != NULL, EFFECT_63) if (arg9 <= 0) { part->unk_20 = 1000; diff --git a/src/effects/effect_65.c b/src/effects/effect_65.c index 48c85898cb..9e9c3ff471 100644 --- a/src/effects/effect_65.c +++ b/src/effects/effect_65.c @@ -37,7 +37,7 @@ EffectInstance* effect_65_main( effect = create_effect_instance(&bp); effect->numParts = numParts; data = effect->data.unk_65 = general_heap_malloc(numParts * sizeof(*data)); - ASSERT(effect->data.unk_65 != NULL); + ASSERT_FX(effect->data.unk_65 != NULL, EFFECT_65) data->variation = variation; data->lifeTime = 0; diff --git a/src/effects/effect_75.c b/src/effects/effect_75.c index 144369b671..845cdf4e8f 100644 --- a/src/effects/effect_75.c +++ b/src/effects/effect_75.c @@ -30,7 +30,7 @@ EffectInstance* effect_75_main(s32 arg0, f32 posX, f32 posY, f32 posZ, f32 scale effect = create_effect_instance(&bp); effect->numParts = numParts; data = effect->data.unk_75 = general_heap_malloc(numParts * sizeof(*data)); - ASSERT(effect->data.unk_75 != NULL); + ASSERT_FX(effect->data.unk_75 != NULL, EFFECT_75) data->type = arg0; data->unk_14 = 0; diff --git a/src/effects/effect_86.c b/src/effects/effect_86.c index 847911115a..74bfe8d493 100644 --- a/src/effects/effect_86.c +++ b/src/effects/effect_86.c @@ -49,7 +49,7 @@ EffectInstance* effect_86_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, effect->data.unk_86 = data; part = data; - ASSERT(data != NULL); + ASSERT_FX(data != NULL, EFFECT_86) part->unk_00 = arg0; part->unk_14 = 0; diff --git a/src/effects/embers.c b/src/effects/embers.c index f57bc2d302..e9c7d7a5ba 100644 --- a/src/effects/embers.c +++ b/src/effects/embers.c @@ -51,7 +51,7 @@ EffectInstance* embers_main( effect = create_effect_instance(&bp); effect->numParts = arg7; part = effect->data.embers = general_heap_malloc(arg7 * sizeof(*part)); - ASSERT(effect->data.embers != NULL); + ASSERT_FX(effect->data.embers != NULL, EFFECT_EMBERS) part->unk_00 = arg0; part->lifetime = 0; diff --git a/src/effects/emote.c b/src/effects/emote.c index af46fe4a81..51a29cb0e2 100644 --- a/src/effects/emote.c +++ b/src/effects/emote.c @@ -109,7 +109,7 @@ void emote_main(s32 arg0, Npc* arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 effect->numParts = numParts; data = effect->data.emote = general_heap_malloc(numParts * sizeof(*data)); - ASSERT(effect->data.emote != NULL); + ASSERT_FX(effect->data.emote != NULL, EFFECT_EMOTE) data->unk_3C = arg1; data->unk_00 = arg0; data->unk_30 = arg0; diff --git a/src/effects/ending_decals.c b/src/effects/ending_decals.c index 1723c337f5..d0625ae24d 100644 --- a/src/effects/ending_decals.c +++ b/src/effects/ending_decals.c @@ -44,7 +44,7 @@ void ending_decals_main(s32 type, f32 posX, f32 posY, f32 posZ, f32 arg4, Effect effect = create_effect_instance(&bp); effect->numParts = numParts; data = effect->data.endingDecals = general_heap_malloc(numParts * sizeof(*data)); - ASSERT(effect->data.endingDecals != NULL); + ASSERT_FX(effect->data.endingDecals != NULL, EFFECT_ENDING_DECALS) data->type = type; data->pos.x = posX; diff --git a/src/effects/energy_in_out.c b/src/effects/energy_in_out.c index 6d2f1620c2..e7f24e5da4 100644 --- a/src/effects/energy_in_out.c +++ b/src/effects/energy_in_out.c @@ -51,7 +51,7 @@ EffectInstance* energy_in_out_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 a effect = create_effect_instance(&bp); effect->numParts = numParts; firstPart = part = effect->data.energyInOut = general_heap_malloc(numParts * sizeof(*part)); - ASSERT(effect->data.energyInOut != NULL); + ASSERT_FX(effect->data.energyInOut != NULL, EFFECT_ENERGY_IN_OUT) part->unk_00 = arg0; part->unk_14 = 0; diff --git a/src/effects/energy_orb_wave.c b/src/effects/energy_orb_wave.c index 4cdbd9e57a..9af87532f6 100644 --- a/src/effects/energy_orb_wave.c +++ b/src/effects/energy_orb_wave.c @@ -28,7 +28,7 @@ EffectInstance* energy_orb_wave_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 effect = create_effect_instance(&bp); effect->numParts = numParts; data = effect->data.energyOrbWave = general_heap_malloc(numParts * sizeof(*data)); - ASSERT(effect->data.energyOrbWave != NULL); + ASSERT_FX(effect->data.energyOrbWave != NULL, EFFECT_ENERGY_ORB_WAVE) data->unk_00 = arg0; data->unk_14 = 0; diff --git a/src/effects/energy_shockwave.c b/src/effects/energy_shockwave.c index 19941e7559..cfaec2f594 100644 --- a/src/effects/energy_shockwave.c +++ b/src/effects/energy_shockwave.c @@ -32,7 +32,7 @@ void energy_shockwave_main( effect = create_effect_instance(&bp); effect->numParts = numParts; data = effect->data.energyShockwave = general_heap_malloc(numParts * sizeof(*data)); - ASSERT(effect->data.energyShockwave != NULL); + ASSERT_FX(effect->data.energyShockwave != NULL, EFFECT_ENERGY_SHOCKWAVE) data->unk_00 = arg0; data->unk_04 = arg1; diff --git a/src/effects/explosion.c b/src/effects/explosion.c index d586d783c3..7949ba1858 100644 --- a/src/effects/explosion.c +++ b/src/effects/explosion.c @@ -43,7 +43,7 @@ void explosion_main(s32 type, f32 x, f32 y, f32 z) { effect = create_effect_instance(bpPtr); effect->numParts = numParts; effect->data.explosion = data = general_heap_malloc(effect->numParts * sizeof(*data)); - ASSERT(effect->data.explosion != NULL); + ASSERT_FX(effect->data.explosion != NULL, EFFECT_EXPLOSION) data->pos.x = x; data->pos.y = y; diff --git a/src/effects/falling_leaves.c b/src/effects/falling_leaves.c index 9690e125c5..9900590dfa 100644 --- a/src/effects/falling_leaves.c +++ b/src/effects/falling_leaves.c @@ -26,7 +26,7 @@ void falling_leaves_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3) { effect = create_effect_instance(&bp); effect->numParts = numParts; part = effect->data.fallingLeaves = general_heap_malloc(numParts * sizeof(*part)); - ASSERT(effect->data.fallingLeaves != NULL); + ASSERT_FX(effect->data.fallingLeaves != NULL, EFFECT_FALLING_LEAVES) part->unk_00 = arg0; part->unk_04 = arg1; diff --git a/src/effects/fire_breath.c b/src/effects/fire_breath.c index 34c04218c2..6f6940b572 100644 --- a/src/effects/fire_breath.c +++ b/src/effects/fire_breath.c @@ -37,7 +37,7 @@ EffectInstance* fire_breath_main( effect = create_effect_instance(&bp); effect->numParts = numParts; data = effect->data.fireBreath = general_heap_malloc(numParts * sizeof(*data)); - ASSERT(effect->data.fireBreath != NULL); + ASSERT_FX(effect->data.fireBreath != NULL, EFFECT_FIRE_BREATH) data->type = type; data->numChildren = numExtra; diff --git a/src/effects/fire_flower.c b/src/effects/fire_flower.c index 1a59238060..d3c3ad638d 100644 --- a/src/effects/fire_flower.c +++ b/src/effects/fire_flower.c @@ -36,7 +36,7 @@ EffectInstance* fire_flower_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, s32 arg part = general_heap_malloc(numParts * sizeof(*part)); effect->data.fireFlower = part; - ASSERT(effect->data.fireFlower != NULL); + ASSERT_FX(effect->data.fireFlower != NULL, EFFECT_FIRE_FLOWER) part->unk_04 = 0; part->unk_00 = arg0; diff --git a/src/effects/firework.c b/src/effects/firework.c index ac2a93542b..bd9cfd4a09 100644 --- a/src/effects/firework.c +++ b/src/effects/firework.c @@ -64,7 +64,7 @@ EffectInstance* firework_main( effect = create_effect_instance(&bp); effect->numParts = numParts; part = effect->data.firework = general_heap_malloc(numParts * sizeof(*part)); - ASSERT(effect->data.firework != NULL); + ASSERT_FX(effect->data.firework != NULL, EFFECT_FIREWORK) part->unk_00 = arg0; part->unk_04 = arg1; diff --git a/src/effects/firework_rocket.c b/src/effects/firework_rocket.c index 46e662f593..17f69b1056 100644 --- a/src/effects/firework_rocket.c +++ b/src/effects/firework_rocket.c @@ -97,7 +97,7 @@ EffectInstance* firework_rocket_main(s32 variation, f32 centerX, f32 centerY, f3 effect = create_effect_instance(&bp); effect->numParts = numParts; data = effect->data.fireworkRocket = general_heap_malloc(numParts * sizeof(*data)); - ASSERT(effect->data.fireworkRocket != NULL); + ASSERT_FX(effect->data.fireworkRocket != NULL, EFFECT_FIREWORK_ROCKET) data->variation = variation; data->lifeTime = 0; diff --git a/src/effects/flame.c b/src/effects/flame.c index 12a764014f..c2d6025a1a 100644 --- a/src/effects/flame.c +++ b/src/effects/flame.c @@ -86,7 +86,7 @@ void flame_main( effect = create_effect_instance(bpPtr); effect->numParts = numParts; data = effect->data.flame = general_heap_malloc(numParts * sizeof(*data)); - ASSERT(effect->data.flame != NULL); + ASSERT_FX(effect->data.flame != NULL, EFFECT_FLAME) data->type = type; data->unk_18 = 0; diff --git a/src/effects/flashing_box_shockwave.c b/src/effects/flashing_box_shockwave.c index fade8aa653..b25a0fbd6b 100644 --- a/src/effects/flashing_box_shockwave.c +++ b/src/effects/flashing_box_shockwave.c @@ -34,7 +34,7 @@ EffectInstance* flashing_box_shockwave_main( effect = create_effect_instance(&bp); effect->numParts = numParts; data = effect->data.flashingBoxShockwave = general_heap_malloc(numParts * sizeof(*data)); - ASSERT(effect->data.flashingBoxShockwave != NULL); + ASSERT_FX(effect->data.flashingBoxShockwave != NULL, EFFECT_FLASHING_BOX_SHOCKWAVE) data->type = type; data->pos.x = posX; diff --git a/src/effects/floating_cloud_puff.c b/src/effects/floating_cloud_puff.c index f3732c5d25..9043e72904 100644 --- a/src/effects/floating_cloud_puff.c +++ b/src/effects/floating_cloud_puff.c @@ -35,7 +35,7 @@ EffectInstance* floating_cloud_puff_main( effect = create_effect_instance(&bp); effect->numParts = numParts; data = effect->data.floatingCloudPuff = general_heap_malloc(numParts * sizeof(*data)); - ASSERT(effect->data.floatingCloudPuff != NULL); + ASSERT_FX(effect->data.floatingCloudPuff != NULL, EFFECT_FLOATING_CLOUD_PUFF) data->unk_00 = arg0; data->unk_14 = 0; diff --git a/src/effects/floating_flower.c b/src/effects/floating_flower.c index 4be78ed89a..9226c17008 100644 --- a/src/effects/floating_flower.c +++ b/src/effects/floating_flower.c @@ -28,7 +28,7 @@ void floating_flower_main(s32 type, f32 posX, f32 posY, f32 posZ, s32 duration) effect->numParts = 1; part = effect->data.floatingFlower = general_heap_malloc(numParts * sizeof(*part)); - ASSERT(effect->data.floatingFlower != NULL); + ASSERT_FX(effect->data.floatingFlower != NULL, EFFECT_FLOATING_FLOWER) part->type = type; part->pos.x = posX; diff --git a/src/effects/floating_rock.c b/src/effects/floating_rock.c index e9a5c6e465..11454f022f 100644 --- a/src/effects/floating_rock.c +++ b/src/effects/floating_rock.c @@ -32,7 +32,7 @@ EffectInstance* floating_rock_main(s32 type, f32 posX, f32 posY, f32 posZ, f32 f effect = create_effect_instance(&bp); effect->numParts = numParts; data = effect->data.floatingRock = general_heap_malloc(numParts * sizeof(*data)); - ASSERT(effect->data.floatingRock != NULL); + ASSERT_FX(effect->data.floatingRock != NULL, EFFECT_FLOATING_ROCK) data->type = type; data->pos.x = posX; diff --git a/src/effects/flower_splash.c b/src/effects/flower_splash.c index fceed4ba70..ea8974dddf 100644 --- a/src/effects/flower_splash.c +++ b/src/effects/flower_splash.c @@ -62,7 +62,7 @@ void flower_splash_main(f32 posX, f32 posY, f32 posZ, f32 angle) { effect->numParts = numParts; part = effect->data.flowerSplash = general_heap_malloc(numParts * sizeof(*part)); - ASSERT(effect->data.flowerSplash != NULL); + ASSERT_FX(effect->data.flowerSplash != NULL, EFFECT_FLOWER_SPLASH) mem_clear(part, numParts * sizeof(*part)); diff --git a/src/effects/flower_trail.c b/src/effects/flower_trail.c index e80f773bae..ab77e01de8 100644 --- a/src/effects/flower_trail.c +++ b/src/effects/flower_trail.c @@ -64,7 +64,7 @@ void flower_trail_main(s32 triggeredByNpc, f32 posX, f32 posY, f32 posZ, f32 ang effect->numParts = numParts; part = effect->data.flowerTrail = general_heap_malloc(numParts * sizeof(*part)); - ASSERT(effect->data.flowerTrail != NULL); + ASSERT_FX(effect->data.flowerTrail != NULL, EFFECT_FLOWER_TRAIL) mem_clear(part, numParts * sizeof(*part)); diff --git a/src/effects/footprint.c b/src/effects/footprint.c index a0874baa52..2e0c4a3623 100644 --- a/src/effects/footprint.c +++ b/src/effects/footprint.c @@ -41,7 +41,7 @@ void footprint_main(f32 x, f32 y, f32 z, f32 angle, b32 isLeft) { part = general_heap_malloc(numParts * sizeof(*part)); effect->data.footprint = part; - ASSERT(effect->data.footprint != NULL); + ASSERT_FX(effect->data.footprint != NULL, EFFECT_FOOTPRINT) mem_clear(part, numParts * sizeof(*part)); diff --git a/src/effects/fright_jar.c b/src/effects/fright_jar.c index bdc8f8cadc..9056f8a333 100644 --- a/src/effects/fright_jar.c +++ b/src/effects/fright_jar.c @@ -39,7 +39,7 @@ EffectInstance* fright_jar_main( effect = create_effect_instance(&bp); effect->numParts = numParts; data = effect->data.frightJar = general_heap_malloc(numParts * sizeof(*data)); - ASSERT(effect->data.frightJar != NULL); + ASSERT_FX(effect->data.frightJar != NULL, EFFECT_FRIGHT_JAR) data->unk_00 = arg0; data->unk_14 = 0; diff --git a/src/effects/gather_magic.c b/src/effects/gather_magic.c index fd9dadc1ce..0c8f581784 100644 --- a/src/effects/gather_magic.c +++ b/src/effects/gather_magic.c @@ -30,7 +30,7 @@ EffectInstance* gather_magic_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 ar effect->numParts = numParts; data = general_heap_malloc(numParts * sizeof(*data)); effect->data.gatherMagic = data; - ASSERT(effect->data.gatherMagic != NULL); + ASSERT_FX(effect->data.gatherMagic != NULL, EFFECT_GATHER_MAGIC) data->unk_04 = arg0; data->unk_1C = 0; diff --git a/src/effects/got_item_outline.c b/src/effects/got_item_outline.c index 4cac7886f1..dd11a381bc 100644 --- a/src/effects/got_item_outline.c +++ b/src/effects/got_item_outline.c @@ -44,7 +44,7 @@ void got_item_outline_main( effect = create_effect_instance(&bp); effect->numParts = numParts; data = effect->data.gotItemOutline = general_heap_malloc(numParts * sizeof(*data)); - ASSERT(effect->data.gotItemOutline != NULL); + ASSERT_FX(effect->data.gotItemOutline != NULL, EFFECT_GOT_ITEM_OUTLINE) data->timeLeft = 100; data->type = type; diff --git a/src/effects/green_impact.c b/src/effects/green_impact.c index 1af70ce493..18af18dbc0 100644 --- a/src/effects/green_impact.c +++ b/src/effects/green_impact.c @@ -38,7 +38,7 @@ EffectInstance* green_impact_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 ar effect = create_effect_instance(bpPtr); effect->numParts = numParts; part = effect->data.greenImpact = general_heap_malloc(numParts * sizeof(*part)); - ASSERT(effect->data.greenImpact != NULL); + ASSERT_FX(effect->data.greenImpact != NULL, EFFECT_GREEN_IMPACT) mem_clear(part, numParts * sizeof(*part)); diff --git a/src/effects/hieroglyphs.c b/src/effects/hieroglyphs.c index 5ed896773e..dc7c57e170 100644 --- a/src/effects/hieroglyphs.c +++ b/src/effects/hieroglyphs.c @@ -43,7 +43,7 @@ EffectInstance* hieroglyphs_main(s32 arg0, f32 posX, f32 posY, f32 posZ, f32 arg effect->numParts = numParts; data = effect->data.hieroglyphs = general_heap_malloc(numParts * sizeof(*data)); - ASSERT(data != NULL); + ASSERT_FX(data != NULL, EFFECT_HIEROGLYPHS) data->unk_00 = arg0; data->lifeTime = 0; diff --git a/src/effects/huff_puff_breath.c b/src/effects/huff_puff_breath.c index 7c0a9cfb35..3b80e82a31 100644 --- a/src/effects/huff_puff_breath.c +++ b/src/effects/huff_puff_breath.c @@ -30,7 +30,7 @@ EffectInstance* huff_puff_breath_main(s32 type, f32 posX, f32 posY, f32 posZ, f3 effect->numParts = numParts; data = effect->data.huffPuffBreath = general_heap_malloc(numParts * sizeof(*data)); - ASSERT(data != NULL); + ASSERT_FX(data != NULL, EFFECT_HUFF_PUFF_BREATH) data->type = type; data->lifeTime = 0; diff --git a/src/effects/ice_pillar.c b/src/effects/ice_pillar.c index 9fa2e9375d..733162d39b 100644 --- a/src/effects/ice_pillar.c +++ b/src/effects/ice_pillar.c @@ -36,7 +36,7 @@ EffectInstance* ice_pillar_main(s32 arg0, f32 x, f32 y, f32 z, f32 scale, s32 ar effect->numParts = numParts; data = effect->data.icePillar = general_heap_malloc(numParts * sizeof(*data)); - ASSERT(data != NULL); + ASSERT_FX(data != NULL, EFFECT_ICE_PILLAR) data->unk_00 = arg0; data->lifeTime = 0; diff --git a/src/effects/ice_shard.c b/src/effects/ice_shard.c index 01ba8e640f..9bdca29fe4 100644 --- a/src/effects/ice_shard.c +++ b/src/effects/ice_shard.c @@ -36,7 +36,7 @@ EffectInstance* ice_shard_main( effect = create_effect_instance(&bp); effect->numParts = numParts; data = effect->data.iceShard = general_heap_malloc(numParts * sizeof(*data)); - ASSERT(effect->data.iceShard != NULL); + ASSERT_FX(effect->data.iceShard != NULL, EFFECT_ICE_SHARD) data->type = type; data->lifetime = 0; diff --git a/src/effects/landing_dust.c b/src/effects/landing_dust.c index 7851ff9346..9931c34065 100644 --- a/src/effects/landing_dust.c +++ b/src/effects/landing_dust.c @@ -106,7 +106,7 @@ void landing_dust_main(s32 type, f32 x, f32 y, f32 z, f32 angle) { data = general_heap_malloc(numParts * sizeof(*data)); effect->data.landingDust = data; - ASSERT(effect->data.landingDust != NULL); + ASSERT_FX(effect->data.landingDust != NULL, EFFECT_LANDING_DUST) mem_clear(data, numParts * sizeof(*data)); diff --git a/src/effects/lens_flare.c b/src/effects/lens_flare.c index 688957bad6..63e46a0941 100644 --- a/src/effects/lens_flare.c +++ b/src/effects/lens_flare.c @@ -39,7 +39,7 @@ void lens_flare_main(s32 type, f32 posX, f32 posY, f32 posZ, s32 duration) { effect = create_effect_instance(&bp); effect->numParts = numParts; data = effect->data.lensFlare = general_heap_malloc(numParts * sizeof(*data)); - ASSERT(effect->data.lensFlare != NULL); + ASSERT_FX(effect->data.lensFlare != NULL, EFFECT_LENS_FLARE) data->type = type; data->pos.x = posX; diff --git a/src/effects/light_rays.c b/src/effects/light_rays.c index fb23bf8325..3c714483e3 100644 --- a/src/effects/light_rays.c +++ b/src/effects/light_rays.c @@ -110,7 +110,7 @@ void light_rays_main( effect = create_effect_instance(bpPtr); effect->numParts = numParts; part = effect->data.lightRays = general_heap_malloc(numParts * sizeof(*part)); - ASSERT(effect->data.lightRays != NULL); + ASSERT_FX(effect->data.lightRays != NULL, EFFECT_LIGHT_RAYS) part->type = type; part->timeLeft = 100; diff --git a/src/effects/lightning.c b/src/effects/lightning.c index 42e3b0b2ae..10cea78a2e 100644 --- a/src/effects/lightning.c +++ b/src/effects/lightning.c @@ -53,7 +53,7 @@ EffectInstance* lightning_main( effect = create_effect_instance(&bp); effect->numParts = numParts; data = effect->data.lightning = general_heap_malloc(numParts * sizeof(*data)); - ASSERT(effect->data.lightning != NULL); + ASSERT_FX(effect->data.lightning != NULL, EFFECT_LIGHTNING) data->unk_00 = arg0; data->unk_18 = 0; diff --git a/src/effects/lightning_bolt.c b/src/effects/lightning_bolt.c index 6a9c24742c..e58e8b96d0 100644 --- a/src/effects/lightning_bolt.c +++ b/src/effects/lightning_bolt.c @@ -70,7 +70,7 @@ EffectInstance* lightning_bolt_main( effect = create_effect_instance(&bp); effect->numParts = numParts; data = effect->data.lightningBolt = general_heap_malloc(numParts * sizeof(*data)); - ASSERT(effect->data.lightningBolt != NULL); + ASSERT_FX(effect->data.lightningBolt != NULL, EFFECT_LIGHTNING_BOLT) data->type = type; data->lifetime = 0; diff --git a/src/effects/lil_oink.c b/src/effects/lil_oink.c index f5e1c302ec..6c23160568 100644 --- a/src/effects/lil_oink.c +++ b/src/effects/lil_oink.c @@ -66,7 +66,7 @@ EffectInstance* lil_oink_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, effect = create_effect_instance(&bp); effect->numParts = numParts; data = effect->data.lilOink = general_heap_malloc(numParts * sizeof(*data)); - ASSERT(data != NULL); + ASSERT_FX(data != NULL, EFFECT_LIL_OINK) data->lifetime = 0; data->timeLeft = 1000; diff --git a/src/effects/merlin_house_stars.c b/src/effects/merlin_house_stars.c index 68a452dc4e..0f69efb64a 100644 --- a/src/effects/merlin_house_stars.c +++ b/src/effects/merlin_house_stars.c @@ -25,7 +25,7 @@ EffectInstance* merlin_house_stars_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3) effect = create_effect_instance(&bp); effect->numParts = numParts; data = effect->data.merlinHouseStars = general_heap_malloc(numParts * sizeof(*data)); - ASSERT(effect->data.merlinHouseStars != NULL); + ASSERT_FX(effect->data.merlinHouseStars != NULL, EFFECT_MERLIN_HOUSE_STARS) data->unk_04 = 100; data->unk_00 = arg0; diff --git a/src/effects/misc_particles.c b/src/effects/misc_particles.c index 538a63e69b..bc5bf655bc 100644 --- a/src/effects/misc_particles.c +++ b/src/effects/misc_particles.c @@ -72,7 +72,7 @@ EffectInstance* misc_particles_main( effect = create_effect_instance(&bp); effect->numParts = numParticles; part = effect->data.miscParticles = general_heap_malloc(numParticles * sizeof(*part)); - ASSERT(effect->data.miscParticles != NULL); + ASSERT_FX(effect->data.miscParticles != NULL, EFFECT_MISC_PARTICLES) part->variation = variation; part->lifetime = 0; diff --git a/src/effects/motion_blur_flame.c b/src/effects/motion_blur_flame.c index d21c29086d..4f97cf7d73 100644 --- a/src/effects/motion_blur_flame.c +++ b/src/effects/motion_blur_flame.c @@ -47,7 +47,7 @@ EffectInstance* motion_blur_flame_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f effect = create_effect_instance(&bp); effect->numParts = numParts; data = effect->data.motionBlurFlame = general_heap_malloc(numParts * sizeof(*data)); - ASSERT(effect->data.motionBlurFlame != NULL); + ASSERT_FX(effect->data.motionBlurFlame != NULL, EFFECT_MOTION_BLUR_FLAME) data->unk_00 = arg0; if (arg5 < 0) { diff --git a/src/effects/moving_cloud.c b/src/effects/moving_cloud.c index 0a6f7189e5..39a7524c5e 100644 --- a/src/effects/moving_cloud.c +++ b/src/effects/moving_cloud.c @@ -43,7 +43,7 @@ EffectInstance* moving_cloud_main( effect = create_effect_instance(&bp); effect->numParts = numParts; data = effect->data.movingCloud = general_heap_malloc(numParts * sizeof(*data)); - ASSERT(effect->data.movingCloud != NULL); + ASSERT_FX(effect->data.movingCloud != NULL, EFFECT_MOVING_CLOUD) data->unk_00 = arg0; data->unk_20 = 0; diff --git a/src/effects/music_note.c b/src/effects/music_note.c index 2d3dffbdac..75f5c97811 100644 --- a/src/effects/music_note.c +++ b/src/effects/music_note.c @@ -53,7 +53,7 @@ void music_note_main(s32 type, f32 posX, f32 posY, f32 posZ) { part = effect->data.musicNote = general_heap_malloc(numParts * sizeof(*part)); - ASSERT(effect->data.musicNote != NULL); + ASSERT_FX(effect->data.musicNote != NULL, EFFECT_MUSIC_NOTE) part->type = type; part->pos.x = posX; diff --git a/src/effects/partner_buff.c b/src/effects/partner_buff.c index d21f00f10f..095c99bc81 100644 --- a/src/effects/partner_buff.c +++ b/src/effects/partner_buff.c @@ -52,7 +52,7 @@ EffectInstance* partner_buff_main(s32 useRandomValues, f32 arg1, f32 arg2, f32 a effect = create_effect_instance(&bp); effect->numParts = numParts; part = effect->data.partnerBuff = general_heap_malloc(numParts * sizeof(*part)); - ASSERT(effect->data.partnerBuff != NULL); + ASSERT_FX(effect->data.partnerBuff != NULL, EFFECT_PARTNER_BUFF) part->useRandomValues = useRandomValues; part->lifeTime = 0; diff --git a/src/effects/peach_star_beam.c b/src/effects/peach_star_beam.c index 3ff1bd93e4..8e14216e8f 100644 --- a/src/effects/peach_star_beam.c +++ b/src/effects/peach_star_beam.c @@ -51,7 +51,7 @@ EffectInstance* peach_star_beam_main(s32 type, f32 x, f32 y, f32 z, f32 arg4, s3 effect = create_effect_instance(&bp); effect->numParts = numParts; data = effect->data.peachStarBeam = general_heap_malloc(sizeof(*data)); - ASSERT(effect->data.peachStarBeam != NULL); + ASSERT_FX(effect->data.peachStarBeam != NULL, EFFECT_PEACH_STAR_BEAM) data->type = type; data->lifetime = 0; diff --git a/src/effects/pink_sparkles.c b/src/effects/pink_sparkles.c index dec62f3f31..ae4a2535e7 100644 --- a/src/effects/pink_sparkles.c +++ b/src/effects/pink_sparkles.c @@ -116,7 +116,7 @@ EffectInstance* pink_sparkles_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 a effect = create_effect_instance(&bp); effect->numParts = numParts; part = effect->data.pinkSparkles = general_heap_malloc(numParts * sizeof(*part)); - ASSERT(effect->data.pinkSparkles != NULL); + ASSERT_FX(effect->data.pinkSparkles != NULL, EFFECT_PINK_SPARKLES) part->unk_04 = arg1; part->unk_08 = arg2; diff --git a/src/effects/purple_ring.c b/src/effects/purple_ring.c index dc1986e859..b51a3f14c9 100644 --- a/src/effects/purple_ring.c +++ b/src/effects/purple_ring.c @@ -95,7 +95,7 @@ EffectInstance* purple_ring_main( effect = create_effect_instance(bpPtr); effect->numParts = numParts; data = effect->data.purpleRing = general_heap_malloc(numParts * sizeof(*data)); - ASSERT(effect->data.purpleRing != NULL); + ASSERT_FX(effect->data.purpleRing != NULL, EFFECT_PURPLE_RING) data->unk_00 = arg0; data->unk_04 = arg1; diff --git a/src/effects/quizmo_assistant.c b/src/effects/quizmo_assistant.c index 713d7ac4d3..1b24a333f9 100644 --- a/src/effects/quizmo_assistant.c +++ b/src/effects/quizmo_assistant.c @@ -39,7 +39,7 @@ EffectInstance* quizmo_assistant_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f3 effect = create_effect_instance(&bp); effect->numParts = numParts; data = effect->data.quizmoAssistant = general_heap_malloc(numParts * sizeof(*data)); - ASSERT(effect->data.quizmoAssistant != NULL); + ASSERT_FX(effect->data.quizmoAssistant != NULL, EFFECT_QUIZMO_ASSISTANT) data->unk_00 = arg0; data->lifetime = 0; diff --git a/src/effects/quizmo_audience.c b/src/effects/quizmo_audience.c index 0d9e22277b..3078d90753 100644 --- a/src/effects/quizmo_audience.c +++ b/src/effects/quizmo_audience.c @@ -93,7 +93,7 @@ EffectInstance* quizmo_audience_main(s32 arg0, f32 posX, f32 posY, f32 posZ) { effect->numParts = numParts; data = effect->data.quizmoAudience = general_heap_malloc(numParts * sizeof(*data)); - ASSERT(data != NULL); + ASSERT_FX(data != NULL, EFFECT_QUIZMO_AUDIENCE) data->timeLeft = 100; data->unk_00 = arg0; diff --git a/src/effects/quizmo_stage.c b/src/effects/quizmo_stage.c index 9093f155c7..cb82614a0c 100644 --- a/src/effects/quizmo_stage.c +++ b/src/effects/quizmo_stage.c @@ -37,7 +37,7 @@ EffectInstance* quizmo_stage_main(s32 arg0, f32 posX, f32 posY, f32 posZ) { effect->numParts = numParts; data = effect->data.quizmoStage = general_heap_malloc(numParts * sizeof(*data)); - ASSERT(data != NULL); + ASSERT_FX(data != NULL, EFFECT_QUIZMO_STAGE) data->vanishTimer = 100; data->microphoneRaiseAmt = 255; diff --git a/src/effects/radial_shimmer.c b/src/effects/radial_shimmer.c index 25b1c0277e..89dca9188e 100644 --- a/src/effects/radial_shimmer.c +++ b/src/effects/radial_shimmer.c @@ -49,7 +49,7 @@ EffectInstance* radial_shimmer_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 effect = create_effect_instance(&bp); effect->numParts = numParts; data = effect->data.radialShimmer = general_heap_malloc(numParts * sizeof(*data)); - ASSERT(effect->data.radialShimmer != NULL); + ASSERT_FX(effect->data.radialShimmer != NULL, EFFECT_RADIAL_SHIMMER) data->unk_00 = arg0; data->timeLeft = arg5_2; diff --git a/src/effects/radiating_energy_orb.c b/src/effects/radiating_energy_orb.c index 42af6b70b5..820ace74b2 100644 --- a/src/effects/radiating_energy_orb.c +++ b/src/effects/radiating_energy_orb.c @@ -43,7 +43,7 @@ EffectInstance* radiating_energy_orb_main( effect = create_effect_instance(&bp); effect->numParts = numParts; part = effect->data.radiatingEnergyOrb = general_heap_malloc(numParts * sizeof(*part)); - ASSERT(effect->data.radiatingEnergyOrb != NULL); + ASSERT_FX(effect->data.radiatingEnergyOrb != NULL, EFFECT_RADIATING_ENERGY_ORB) part->unk_04 = arg0; part->unk_1C = 0; diff --git a/src/effects/recover.c b/src/effects/recover.c index 7b4aff2a5b..6de9453175 100644 --- a/src/effects/recover.c +++ b/src/effects/recover.c @@ -58,7 +58,7 @@ EffectInstance* recover_main(s32 type, f32 posX, f32 posY, f32 posZ, s32 duratio effect = create_effect_instance(&bp); effect->numParts = numParts; part = effect->data.recover = general_heap_malloc(numParts * sizeof(*part)); - ASSERT(effect->data.recover != NULL); + ASSERT_FX(effect->data.recover != NULL, EFFECT_RECOVER) part->type = type; part->pos.x = posX; diff --git a/src/effects/red_impact.c b/src/effects/red_impact.c index 02a5d6f6af..2ee7fc3533 100644 --- a/src/effects/red_impact.c +++ b/src/effects/red_impact.c @@ -39,7 +39,7 @@ EffectInstance* red_impact_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4 effect = create_effect_instance(bpPtr); effect->numParts = numParts; part = effect->data.redImpact = general_heap_malloc(numParts * sizeof(*part)); - ASSERT(effect->data.redImpact != NULL); + ASSERT_FX(effect->data.redImpact != NULL, EFFECT_RED_IMPACT) part->unk_2C = 0; part->unk_00 = arg0; diff --git a/src/effects/ring_blast.c b/src/effects/ring_blast.c index 6df7a1e55f..c28867c600 100644 --- a/src/effects/ring_blast.c +++ b/src/effects/ring_blast.c @@ -29,7 +29,7 @@ void ring_blast_main(s32 arg0, f32 posX, f32 posY, f32 posZ, f32 arg4, s32 arg5) effect->numParts = numParts; data = effect->data.ringBlast = general_heap_malloc(numParts * sizeof(*data)); - ASSERT(data != NULL); + ASSERT_FX(data != NULL, EFFECT_RING_BLAST) mem_clear(data, numParts * sizeof(*data)); data->timeLeft = arg5; diff --git a/src/effects/rising_bubble.c b/src/effects/rising_bubble.c index 19fa80e9f2..e979a285d1 100644 --- a/src/effects/rising_bubble.c +++ b/src/effects/rising_bubble.c @@ -38,7 +38,7 @@ void rising_bubble_main(s32 arg0, f32 posX, f32 posY, f32 posZ, f32 arg4) { effect = create_effect_instance(&effectBp); effect->numParts = numParts; data = effect->data.risingBubble = general_heap_malloc(numParts * sizeof(*data)); - ASSERT(data != NULL); + ASSERT_FX(data != NULL, EFFECT_RISING_BUBBLE) data->unk_00 = arg0; data->pos.x = posX; diff --git a/src/effects/shape_spell.c b/src/effects/shape_spell.c index 9af181ab14..39d41a0ae3 100644 --- a/src/effects/shape_spell.c +++ b/src/effects/shape_spell.c @@ -47,7 +47,7 @@ EffectInstance* shape_spell_main(s32 isChild, f32 x, f32 y, f32 z, f32 arg4, f32 effect->numParts = numParts; part = effect->data.shapeSpell = general_heap_malloc(numParts * sizeof(*part)); - ASSERT(effect->data.shapeSpell != NULL); + ASSERT_FX(effect->data.shapeSpell != NULL, EFFECT_SHAPE_SPELL) part->unk_2C = 0; part->isChild = isChild; diff --git a/src/effects/shattering_stones.c b/src/effects/shattering_stones.c index 60f751e78f..0cba7d4f91 100644 --- a/src/effects/shattering_stones.c +++ b/src/effects/shattering_stones.c @@ -55,7 +55,7 @@ void shattering_stones_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4) { effect = create_effect_instance(&bp); effect->numParts = numParts; part = effect->data.shatteringStones = general_heap_malloc(numParts * sizeof(*part)); - ASSERT(effect->data.shatteringStones != NULL); + ASSERT_FX(effect->data.shatteringStones != NULL, EFFECT_SHATTERING_STONES) part->unk_24 = 0; part->unk_00 = arg1; diff --git a/src/effects/shimmer_burst.c b/src/effects/shimmer_burst.c index dd63f9e812..b0fcc82360 100644 --- a/src/effects/shimmer_burst.c +++ b/src/effects/shimmer_burst.c @@ -49,7 +49,7 @@ EffectInstance* shimmer_burst_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 a effect = create_effect_instance(&bp); effect->numParts = numParts; part = effect->data.shimmerBurst = general_heap_malloc(numParts * sizeof(*part)); - ASSERT(effect->data.shimmerBurst != NULL); + ASSERT_FX(effect->data.shimmerBurst != NULL, EFFECT_SHIMMER_BURST) part->unk_00 = arg0; part->unk_3C = 0; diff --git a/src/effects/shimmer_wave.c b/src/effects/shimmer_wave.c index 209c85f55d..5983e6777c 100644 --- a/src/effects/shimmer_wave.c +++ b/src/effects/shimmer_wave.c @@ -59,7 +59,7 @@ EffectInstance* shimmer_wave_main( effect = create_effect_instance(&bp); effect->numParts = arg6; part = effect->data.shimmerWave = general_heap_malloc(arg6 * sizeof(*part)); - ASSERT(effect->data.shimmerWave != NULL); + ASSERT_FX(effect->data.shimmerWave != NULL, EFFECT_SHIMMER_WAVE) part->unk_00 = arg0; part->unk_3C = 0; diff --git a/src/effects/shiny_flare.c b/src/effects/shiny_flare.c index 4530d33331..b1581ebf58 100644 --- a/src/effects/shiny_flare.c +++ b/src/effects/shiny_flare.c @@ -36,7 +36,7 @@ EffectInstance* shiny_flare_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg effect->numParts = numParts; data = effect->data.shinyFlare = general_heap_malloc(numParts * sizeof(*data)); - ASSERT(data != NULL); + ASSERT_FX(data != NULL, EFFECT_SHINY_FLARE) data->unk_00 = arg0; data->lifeTime = 0; diff --git a/src/effects/shockwave.c b/src/effects/shockwave.c index ec67535e00..6e0468922e 100644 --- a/src/effects/shockwave.c +++ b/src/effects/shockwave.c @@ -65,7 +65,7 @@ void shockwave_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3) { effect = create_effect_instance(bpPtr); effect->numParts = numParts; part = effect->data.shockwave = general_heap_malloc(numParts * sizeof(*part)); - ASSERT(effect->data.shockwave != NULL); + ASSERT_FX(effect->data.shockwave != NULL, EFFECT_SHOCKWAVE) mem_clear(part, numParts * sizeof(*part)); diff --git a/src/effects/sleep_bubble.c b/src/effects/sleep_bubble.c index bab33aa20a..38f48ef91b 100644 --- a/src/effects/sleep_bubble.c +++ b/src/effects/sleep_bubble.c @@ -36,7 +36,7 @@ void sleep_bubble_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg effect->numParts = numParts; part = effect->data.sleepBubble = general_heap_malloc(numParts * sizeof(*part)); - ASSERT(effect->data.sleepBubble != NULL); + ASSERT_FX(effect->data.sleepBubble != NULL, EFFECT_SLEEP_BUBBLE) part->unk_00 = arg0; part->pos.x = arg1; diff --git a/src/effects/small_gold_sparkle.c b/src/effects/small_gold_sparkle.c index 9b22742141..703e75090c 100644 --- a/src/effects/small_gold_sparkle.c +++ b/src/effects/small_gold_sparkle.c @@ -45,7 +45,7 @@ EffectInstance* small_gold_sparkle_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, effect->data.smallGoldSparkle = data; part = data; - ASSERT(data != NULL); + ASSERT_FX(data != NULL, EFFECT_SMALL_GOLD_SPARKLE) part->unk_00 = arg0; part->unk_18 = 0; diff --git a/src/effects/smoke_burst.c b/src/effects/smoke_burst.c index 59477baefa..4316f0fd25 100644 --- a/src/effects/smoke_burst.c +++ b/src/effects/smoke_burst.c @@ -35,7 +35,7 @@ void smoke_burst_main(s32 arg0, f32 posX, f32 posY, f32 posZ, f32 arg4, s32 time effect->numParts = numParts; data = effect->data.smokeBurst = general_heap_malloc(numParts * sizeof(*data)); - ASSERT(data != NULL); + ASSERT_FX(data != NULL, EFFECT_SMOKE_BURST) mem_clear(data, numParts * sizeof(*data)); data->timeLeft = timeLeft; diff --git a/src/effects/smoke_impact.c b/src/effects/smoke_impact.c index 0fecf8fa66..0eac743fe2 100644 --- a/src/effects/smoke_impact.c +++ b/src/effects/smoke_impact.c @@ -45,7 +45,7 @@ void smoke_impact_main( effect = create_effect_instance(&bp); effect->numParts = arg5; part = effect->data.smokeImpact = general_heap_malloc(arg5 * sizeof(*part)); - ASSERT(effect->data.smokeImpact != NULL); + ASSERT_FX(effect->data.smokeImpact != NULL, EFFECT_SMOKE_IMPACT) mem_clear(part, arg5 * sizeof(*part)); diff --git a/src/effects/smoke_ring.c b/src/effects/smoke_ring.c index 439c2900b5..1271c8cb76 100644 --- a/src/effects/smoke_ring.c +++ b/src/effects/smoke_ring.c @@ -51,7 +51,7 @@ void smoke_ring_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3) { effect = create_effect_instance(bpPtr); effect->numParts = numParts; part = effect->data.smokeRing = general_heap_malloc(numParts * sizeof(*part)); - ASSERT(effect->data.smokeRing != NULL); + ASSERT_FX(effect->data.smokeRing != NULL, EFFECT_SMOKE_RING) mem_clear(part, numParts * sizeof(*part)); diff --git a/src/effects/snaking_static.c b/src/effects/snaking_static.c index c0fbe0bf89..ac2835c668 100644 --- a/src/effects/snaking_static.c +++ b/src/effects/snaking_static.c @@ -27,7 +27,7 @@ EffectInstance* snaking_static_main(s32 type, f32 posX, f32 posY, f32 posZ, f32 effect->numParts = numParts; data = effect->data.snakingStatic = general_heap_malloc(numParts * sizeof(*data)); - ASSERT(data != NULL); + ASSERT_FX(data != NULL, EFFECT_SNAKING_STATIC) data->type = type; data->lifeTime = 0; diff --git a/src/effects/snowfall.c b/src/effects/snowfall.c index 742aa56566..bb7c2b3d4b 100644 --- a/src/effects/snowfall.c +++ b/src/effects/snowfall.c @@ -41,7 +41,7 @@ EffectInstance* snowfall_main(s32 arg0, s32 arg1) { effect->numParts = numParts; data = effect->data.snowfall = general_heap_malloc(numParts * sizeof(*data)); - ASSERT(data != NULL); + ASSERT_FX(data != NULL, EFFECT_SNOWFALL) data->timeLeft = 100; data->lifeTime = 0; diff --git a/src/effects/snowflake.c b/src/effects/snowflake.c index 316cf563a0..f7b19275fe 100644 --- a/src/effects/snowflake.c +++ b/src/effects/snowflake.c @@ -29,7 +29,7 @@ void snowflake_main(f32 x, f32 y, f32 z, s32 arg3) { effect->numParts = 1; part = effect->data.snowflake = general_heap_malloc(numParts * sizeof(*part)); - ASSERT(effect->data.snowflake != NULL); + ASSERT_FX(effect->data.snowflake != NULL, EFFECT_SNOWFLAKE) part->pos.x = x; part->pos.y = y; diff --git a/src/effects/snowman_doll.c b/src/effects/snowman_doll.c index 5298f7d386..8abbcf1dae 100644 --- a/src/effects/snowman_doll.c +++ b/src/effects/snowman_doll.c @@ -84,7 +84,7 @@ EffectInstance* snowman_doll_main( effect = create_effect_instance(&bp); effect->numParts = numParts; data = effect->data.snowmanDoll = general_heap_malloc(numParts * sizeof(*data)); - ASSERT(effect->data.snowmanDoll != NULL); + ASSERT_FX(effect->data.snowmanDoll != NULL, EFFECT_SNOWMAN_DOLL) data->unk_00 = arg0; data->unk_14 = 0; diff --git a/src/effects/something_rotating.c b/src/effects/something_rotating.c index 156e6c9fe5..5f30832015 100644 --- a/src/effects/something_rotating.c +++ b/src/effects/something_rotating.c @@ -97,7 +97,7 @@ EffectInstance* something_rotating_main( effect = create_effect_instance(&bp); effect->numParts = numParts; part = effect->data.somethingRotating = general_heap_malloc(numParts * sizeof(*part)); - ASSERT(effect->data.somethingRotating != NULL); + ASSERT_FX(effect->data.somethingRotating != NULL, EFFECT_SOMETHING_ROTATING) part->unk_00 = arg0; part->unk_14 = 0; diff --git a/src/effects/sparkles.c b/src/effects/sparkles.c index 958bb69411..5e6c6b4364 100644 --- a/src/effects/sparkles.c +++ b/src/effects/sparkles.c @@ -86,7 +86,7 @@ void sparkles_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4) { effect = create_effect_instance(bpPtr); effect->numParts = numParts; part = effect->data.sparkles = general_heap_malloc(numParts * sizeof(*part)); - ASSERT(effect->data.sparkles != NULL); + ASSERT_FX(effect->data.sparkles != NULL, EFFECT_SPARKLES) part->unk_04 = arg1; part->unk_08 = arg2; diff --git a/src/effects/spiky_white_aura.c b/src/effects/spiky_white_aura.c index 61c7178aa8..7f2e4d4574 100644 --- a/src/effects/spiky_white_aura.c +++ b/src/effects/spiky_white_aura.c @@ -84,7 +84,7 @@ void spiky_white_aura_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, s32 arg4) { effect = create_effect_instance(bpPtr); effect->numParts = numParts; part = effect->data.spikyWhiteAura = general_heap_malloc(numParts * sizeof(*part)); - ASSERT(effect->data.spikyWhiteAura != NULL); + ASSERT_FX(effect->data.spikyWhiteAura != NULL, EFFECT_SPIKY_WHITE_AURA) for (i = 0; i < numParts; i++, part++) { Camera* camera = &gCameras[gCurrentCameraID]; // required to match diff --git a/src/effects/spirit_card.c b/src/effects/spirit_card.c index 42f000ee54..cfb5ffec70 100644 --- a/src/effects/spirit_card.c +++ b/src/effects/spirit_card.c @@ -52,7 +52,7 @@ EffectInstance* spirit_card_main( effect = create_effect_instance(&bp); effect->numParts = numParts; data = effect->data.spiritCard = general_heap_malloc(numParts * sizeof(*data)); - ASSERT(effect->data.spiritCard != NULL); + ASSERT_FX(effect->data.spiritCard != NULL, EFFECT_SPIRIT_CARD) data->unk_00 = arg0; data->unk_14 = 0; diff --git a/src/effects/squirt.c b/src/effects/squirt.c index cbc39e91d6..34dd6d7072 100644 --- a/src/effects/squirt.c +++ b/src/effects/squirt.c @@ -28,7 +28,7 @@ EffectInstance* squirt_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f3 effect = create_effect_instance(&bp); effect->numParts = numParts; data = effect->data.squirt = general_heap_malloc(numParts * sizeof(*data)); - ASSERT(effect->data.squirt != NULL); + ASSERT_FX(effect->data.squirt != NULL, EFFECT_SQUIRT) data->unk_00 = arg0; data->unk_30 = 0; diff --git a/src/effects/star.c b/src/effects/star.c index 6d8112614f..663cd0a3bb 100644 --- a/src/effects/star.c +++ b/src/effects/star.c @@ -43,7 +43,7 @@ EffectInstance* star_main(s32 type, f32 startX, f32 startY, f32 startZ, f32 endX effect->numParts = 1; part = effect->data.star = general_heap_malloc(numParts * sizeof(*part)); - ASSERT(effect->data.star != NULL); + ASSERT_FX(effect->data.star != NULL, EFFECT_STAR) part->canBounce = TRUE; part->pos.x = startX; part->pos.y = startY; diff --git a/src/effects/star_outline.c b/src/effects/star_outline.c index ec97825983..446915106f 100644 --- a/src/effects/star_outline.c +++ b/src/effects/star_outline.c @@ -31,7 +31,7 @@ EffectInstance* star_outline_main(s32 arg0, f32 posX, f32 posY, f32 posZ, f32 ar effect->numParts = numParts; data = effect->data.starOutline = general_heap_malloc(numParts * sizeof(*data)); - ASSERT(data != NULL); + ASSERT_FX(data != NULL, EFFECT_STAR_OUTLINE) data->unk_00 = 1; data->unk_02 = arg0; diff --git a/src/effects/star_spirits_energy.c b/src/effects/star_spirits_energy.c index b9d3383e88..415a83d149 100644 --- a/src/effects/star_spirits_energy.c +++ b/src/effects/star_spirits_energy.c @@ -108,7 +108,7 @@ EffectInstance* star_spirits_energy_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, effect = create_effect_instance(&bp); effect->numParts = numParts; data = effect->data.starSpiritsEnergy = general_heap_malloc(numParts * sizeof(*data)); - ASSERT(effect->data.starSpiritsEnergy != NULL); + ASSERT_FX(effect->data.starSpiritsEnergy != NULL, EFFECT_STAR_SPIRITS_ENERGY) data->unk_00 = arg0 & 0xFF00; arg0 &= 0xFF; diff --git a/src/effects/stars_burst.c b/src/effects/stars_burst.c index 95632fc9ef..f9a35de9bf 100644 --- a/src/effects/stars_burst.c +++ b/src/effects/stars_burst.c @@ -55,7 +55,7 @@ void stars_burst_main( effect = create_effect_instance(bpPtr); effect->numParts = numParts; part = effect->data.starsBurst = general_heap_malloc(numParts * sizeof(*part)); - ASSERT(effect->data.starsBurst != NULL); + ASSERT_FX(effect->data.starsBurst != NULL, EFFECT_STARS_BURST) part->unk_00 = arg0; part->unk_04 = arg1; diff --git a/src/effects/stars_orbiting.c b/src/effects/stars_orbiting.c index 448e6b51ef..2dec753a54 100644 --- a/src/effects/stars_orbiting.c +++ b/src/effects/stars_orbiting.c @@ -39,7 +39,7 @@ void stars_orbiting_main( effect = create_effect_instance(&bp); effect->numParts = numStars; part = effect->data.starsOrbiting = general_heap_malloc(numStars * sizeof(*part)); - ASSERT(effect->data.starsOrbiting != NULL); + ASSERT_FX(effect->data.starsOrbiting != NULL, EFFECT_STARS_ORBITING) mem_clear(part, numStars * sizeof(*part)); diff --git a/src/effects/stars_shimmer.c b/src/effects/stars_shimmer.c index 157597290e..92bca62a16 100644 --- a/src/effects/stars_shimmer.c +++ b/src/effects/stars_shimmer.c @@ -72,7 +72,7 @@ void stars_shimmer_main(s32 type, f32 x, f32 y, f32 z, f32 arg4, f32 arg5, s32 n effect = create_effect_instance(bpPtr); effect->numParts = numParts; part = effect->data.starsShimmer = general_heap_malloc(numParts * sizeof(*part)); - ASSERT(effect->data.starsShimmer != NULL); + ASSERT_FX(effect->data.starsShimmer != NULL, EFFECT_STARS_SHIMMER) if (type == 6) { part->unk_00 = 1; diff --git a/src/effects/stars_spread.c b/src/effects/stars_spread.c index 30bbb2a8e3..850be8c4cc 100644 --- a/src/effects/stars_spread.c +++ b/src/effects/stars_spread.c @@ -34,7 +34,7 @@ void stars_spread_main( effect = create_effect_instance(&bp); effect->numParts = arg4; part = effect->data.starsSpread = general_heap_malloc(arg4 * sizeof(*part)); - ASSERT(effect->data.starsSpread != NULL); + ASSERT_FX(effect->data.starsSpread != NULL, EFFECT_STARS_SPREAD) mem_clear(part, arg4 * sizeof(*part)); diff --git a/src/effects/stat_change.c b/src/effects/stat_change.c index 21505ec90d..bfd625b133 100644 --- a/src/effects/stat_change.c +++ b/src/effects/stat_change.c @@ -156,7 +156,7 @@ EffectInstance* stat_change_main(s32 arg0, f32 x, f32 y, f32 z, f32 scale, s32 t effect->numParts = numParts; part = effect->data.statChange = general_heap_malloc(numParts * sizeof(*part)); - ASSERT(effect->data.statChange != NULL); + ASSERT_FX(effect->data.statChange != NULL, EFFECT_STAT_CHANGE) part->unk_00 = arg0; part->pos.x = x; diff --git a/src/effects/static_status.c b/src/effects/static_status.c index dc0bd84173..17906c9053 100644 --- a/src/effects/static_status.c +++ b/src/effects/static_status.c @@ -62,7 +62,7 @@ EffectInstance* static_status_main( effect = create_effect_instance(&bp); effect->numParts = numBolts; part = effect->data.staticStatus = general_heap_malloc(numBolts * sizeof(*part)); - ASSERT(effect->data.staticStatus != NULL); + ASSERT_FX(effect->data.staticStatus != NULL, EFFECT_STATIC_STATUS) part->type = type; part->lifetime = 0; diff --git a/src/effects/steam_burst.c b/src/effects/steam_burst.c index 360c7029a7..a01ba9ad35 100644 --- a/src/effects/steam_burst.c +++ b/src/effects/steam_burst.c @@ -36,7 +36,7 @@ void steam_burst_main( effect = create_effect_instance(&bp); effect->numParts = numParts; part = effect->data.steamBurst = general_heap_malloc(numParts * sizeof(*part)); - ASSERT(effect->data.steamBurst != NULL); + ASSERT_FX(effect->data.steamBurst != NULL, EFFECT_STEAM_BURST) mem_clear(part, numParts * sizeof(*part)); diff --git a/src/effects/stop_watch.c b/src/effects/stop_watch.c index db630c1d10..95457d4977 100644 --- a/src/effects/stop_watch.c +++ b/src/effects/stop_watch.c @@ -68,7 +68,7 @@ EffectInstance* stop_watch_main( effect = create_effect_instance(&bp); effect->numParts = numParts; data = effect->data.stopWatch = general_heap_malloc(numParts * sizeof(*data)); - ASSERT(effect->data.stopWatch != NULL); + ASSERT_FX(effect->data.stopWatch != NULL, EFFECT_STOP_WATCH) data->unk_00 = arg0; data->unk_14 = 0; diff --git a/src/effects/sun.c b/src/effects/sun.c index 4b74c5cd40..82939de459 100644 --- a/src/effects/sun.c +++ b/src/effects/sun.c @@ -38,7 +38,7 @@ EffectInstance* sun_main(s32 shineFromRight, f32 offsetX, f32 offsetY, f32 offse effect->numParts = numParts; data = effect->data.sun = general_heap_malloc(sizeof(*data)); - ASSERT(data != NULL); + ASSERT_FX(data != NULL, EFFECT_SUN) data->shineFromRight = shineFromRight; data->lifeTime = 0; diff --git a/src/effects/sweat.c b/src/effects/sweat.c index 3469cafd0b..1ecbcbdbec 100644 --- a/src/effects/sweat.c +++ b/src/effects/sweat.c @@ -30,7 +30,7 @@ void sweat_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, s32 effect->numParts = numParts; data = effect->data.sweat = general_heap_malloc(numParts * sizeof(*data)); - ASSERT(data != NULL); + ASSERT_FX(data != NULL, EFFECT_SWEAT) data->unk_00 = arg0; guRotateF(matrix, -arg5, sin_deg(gCameras[gCurrentCameraID].curYaw), 0.0f, -cos_deg(gCameras[gCurrentCameraID].curYaw)); diff --git a/src/effects/tattle_window.c b/src/effects/tattle_window.c index a4551ba6bd..bfefffca47 100644 --- a/src/effects/tattle_window.c +++ b/src/effects/tattle_window.c @@ -76,7 +76,7 @@ EffectInstance* tattle_window_main(s32 type, f32 x, f32 y, f32 z, f32 arg4, s32 effect->numParts = numParts; part = effect->data.tattleWindow = general_heap_malloc(numParts * sizeof(*part)); - ASSERT(effect->data.tattleWindow != NULL); + ASSERT_FX(effect->data.tattleWindow != NULL, EFFECT_TATTLE_WINDOW) part->type = type; part->unk_14 = 0; diff --git a/src/effects/throw_spiny.c b/src/effects/throw_spiny.c index a23437bb83..8fcf115238 100644 --- a/src/effects/throw_spiny.c +++ b/src/effects/throw_spiny.c @@ -36,7 +36,7 @@ EffectInstance* throw_spiny_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg effect = (EffectInstance*)create_effect_instance(bpPtr); effect->numParts = numParts; spinyObject = effect->data.throwSpiny = general_heap_malloc(numParts * sizeof(*spinyObject)); - ASSERT(effect->data.throwSpiny != NULL); + ASSERT_FX(effect->data.throwSpiny != NULL, EFFECT_THROW_SPINY) spinyObject->unk_00 = arg0; spinyObject->lifeDuration = 0; diff --git a/src/effects/thunderbolt_ring.c b/src/effects/thunderbolt_ring.c index 7a0d490762..37eef72176 100644 --- a/src/effects/thunderbolt_ring.c +++ b/src/effects/thunderbolt_ring.c @@ -26,7 +26,7 @@ EffectInstance* thunderbolt_ring_main(s32 arg0, f32 posX, f32 posY, f32 posZ, f3 effect->numParts = numParts; data = effect->data.thunderboltRing = general_heap_malloc(numParts * sizeof(*data)); - ASSERT(data != NULL); + ASSERT_FX(data != NULL, EFFECT_THUNDERBOLT_RING) data->unk_00 = arg0; data->lifeTime = 0; diff --git a/src/effects/tubba_heart_attack.c b/src/effects/tubba_heart_attack.c index 7eb5c96316..30f6090cbd 100644 --- a/src/effects/tubba_heart_attack.c +++ b/src/effects/tubba_heart_attack.c @@ -77,7 +77,7 @@ EffectInstance* tubba_heart_attack_main( effect = create_effect_instance(&bp); effect->numParts = numParts; data = effect->data.tubbaHeartAttack = general_heap_malloc(numParts * sizeof(*data)); - ASSERT(effect->data.tubbaHeartAttack != NULL); + ASSERT_FX(effect->data.tubbaHeartAttack != NULL, EFFECT_TUBBA_HEART_ATTACK) data->type = type; data->lifetime = 0; diff --git a/src/effects/underwater.c b/src/effects/underwater.c index cdc5c3bee9..ee70c9b92e 100644 --- a/src/effects/underwater.c +++ b/src/effects/underwater.c @@ -29,7 +29,7 @@ EffectInstance* underwater_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4 effect = create_effect_instance(&bp); effect->numParts = numParts; data = effect->data.underwater = general_heap_malloc(numParts * sizeof(*data)); - ASSERT(effect->data.underwater != NULL); + ASSERT_FX(effect->data.underwater != NULL, EFFECT_UNDERWATER) data->unk_00 = arg0; data->lifeTime = 0; diff --git a/src/effects/walking_dust.c b/src/effects/walking_dust.c index 8d8586c292..65b79a7b83 100644 --- a/src/effects/walking_dust.c +++ b/src/effects/walking_dust.c @@ -37,7 +37,7 @@ void walking_dust_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg data = general_heap_malloc(numParts * sizeof(*data)); effect->data.walkingDust = data; - ASSERT(effect->data.walkingDust != NULL); + ASSERT_FX(effect->data.walkingDust != NULL, EFFECT_WALKING_DUST) mem_clear(data, numParts * sizeof(*data)); data->unk_6C = arg0 == 2; diff --git a/src/effects/water_block.c b/src/effects/water_block.c index a4b1981001..385403caa2 100644 --- a/src/effects/water_block.c +++ b/src/effects/water_block.c @@ -81,7 +81,7 @@ EffectInstance* water_block_main(s32 type, f32 x, f32 y, f32 z, f32 arg4, s32 du effect = create_effect_instance(bpPtr); effect->numParts = numParts; data = effect->data.waterBlock = general_heap_malloc(sizeof(*data)); - ASSERT(data != NULL); + ASSERT_FX(data != NULL, EFFECT_WATER_BLOCK) data->type = type; data->lifetime = 0; diff --git a/src/effects/water_fountain.c b/src/effects/water_fountain.c index f69da63b5a..74bd63f0cb 100644 --- a/src/effects/water_fountain.c +++ b/src/effects/water_fountain.c @@ -138,7 +138,7 @@ EffectInstance* water_fountain_main(s32 arg0, f32 posX, f32 posY, f32 posZ, f32 effect->numParts = numParts; data = effect->data.waterFountain = general_heap_malloc(numParts * sizeof(*data)); - ASSERT(data != NULL); + ASSERT_FX(data != NULL, EFFECT_WATER_FOUNTAIN) data->unk_00 = arg0; data->lifeTime = 0; diff --git a/src/effects/water_splash.c b/src/effects/water_splash.c index 97658d1ae1..24f796b0c4 100644 --- a/src/effects/water_splash.c +++ b/src/effects/water_splash.c @@ -46,7 +46,7 @@ EffectInstance* water_splash_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 ar effect = create_effect_instance(bpPtr); effect->numParts = numParts; effect->data.waterSplash = part = general_heap_malloc(numParts * sizeof(*part)); - ASSERT(part != NULL); + ASSERT_FX(part != NULL, EFFECT_WATER_SPLASH) part->unk_00 = arg0; part->unk_20 = 0; diff --git a/src/effects/waterfall.c b/src/effects/waterfall.c index b4600fa97d..dca0fe062f 100644 --- a/src/effects/waterfall.c +++ b/src/effects/waterfall.c @@ -32,7 +32,7 @@ EffectInstance* waterfall_main( effect = create_effect_instance(&bp); effect->numParts = numParts; data = effect->data.waterfall = general_heap_malloc(numParts * sizeof(*data)); - ASSERT(effect->data.waterfall != NULL); + ASSERT_FX(effect->data.waterfall != NULL, EFFECT_WATERFALL) data->unk_00 = arg0; data->unk_14 = 0; diff --git a/src/effects/whirlwind.c b/src/effects/whirlwind.c index 500fa8c34f..95de5e1392 100644 --- a/src/effects/whirlwind.c +++ b/src/effects/whirlwind.c @@ -27,7 +27,7 @@ EffectInstance* whirlwind_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, effect = create_effect_instance(bpPtr); effect->numParts = numParts; part = effect->data.whirlwind = general_heap_malloc(effect->numParts * sizeof(*part)); - ASSERT(part != NULL); + ASSERT_FX(part != NULL, EFFECT_WHIRLWIND) part->unk_00 = arg0; part->unk_14 = 0; diff --git a/src/effects/windy_leaves.c b/src/effects/windy_leaves.c index dd79041b14..dfe6597cc9 100644 --- a/src/effects/windy_leaves.c +++ b/src/effects/windy_leaves.c @@ -29,7 +29,7 @@ void windy_leaves_main(s32 type, f32 arg1, f32 arg2, f32 arg3) { effect = create_effect_instance(bpPtr); effect->numParts = numParts; effect->data.windyLeaves = part = general_heap_malloc(numParts * sizeof(*part)); - ASSERT(part != NULL); + ASSERT_FX(part != NULL, EFFECT_WINDY_LEAVES) part->type = type; part->unk_04.x = arg1; diff --git a/src/main_loop.c b/src/main_loop.c index e2c6dd0153..70214cf984 100644 --- a/src/main_loop.c +++ b/src/main_loop.c @@ -330,7 +330,8 @@ void load_engine_data(void) { clear_player_data(); init_encounter_status(); clear_screen_overlays(); - init_effect_data(); + check_effect_sizes(); + clear_effect_data(); clear_saved_variables(); clear_item_entity_data(); bgm_reset_sequence_players(); diff --git a/tools/build/configure.py b/tools/build/configure.py index f8a32a62b9..cf149ed91a 100755 --- a/tools/build/configure.py +++ b/tools/build/configure.py @@ -683,7 +683,7 @@ def build( elif "os" in entry.src_paths[0].parts: # libultra cflags = "" else: # papermario - cflags = f"-fforce-addr -fmacro-prefix-map={str(entry.src_paths[0]).rsplit('/', 1)[0]}/=" + cflags = "-fforce-addr" # c task = "cc"