* yaml simplifications

* remove unneeded end markers after c files

* git subrepo pull --force tools/splat

subrepo:
  subdir:   "tools/splat"
  merged:   "7869ef2e51"
upstream:
  origin:   "https://github.com/ethteck/splat.git"
  branch:   "master"
  commit:   "7869ef2e51"
git-subrepo:
  version:  "0.4.5"
  origin:   "https://github.com/ingydotnet/git-subrepo"
  commit:   "aa416e4"

* cleanin

* effect_shims.h

* PRomment
This commit is contained in:
Ethan Roseman 2023-07-19 18:01:28 +09:00 committed by GitHub
parent 4ad11af535
commit 9b765a1f25
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
140 changed files with 6093 additions and 6764 deletions

74
include/effect_shims.h Normal file
View File

@ -0,0 +1,74 @@
#ifndef _EFFECT_SHIMS_H_
#define _EFFECT_SHIMS_H_
void shim_guRotateF(float mf[4][4], float a, float x, float y, float z);
void shim_guTranslateF(float mf[4][4], float x, float y, float z);
void shim_guTranslate(Mtx *m, float x, float y, float z);
void shim_guScaleF(float mf[4][4], float x, float y, float z);
void shim_guMtxCatF(float m[4][4], float n[4][4], float r[4][4]);
void shim_guMtxF2L(float mf[4][4], Mtx *m);
RenderTask* shim_queue_render_task(RenderTask* task);
EffectInstance* shim_create_effect_instance(EffectBlueprint* effectBp);
void shim_remove_effect(EffectInstance*);
void* shim_general_heap_malloc(s32 size);
void shim_mem_clear(void* data, s32 numBytes);
s32 shim_rand_int(s32);
f32 shim_clamp_angle(f32 theta);
f32 shim_sin_deg(f32 x);
f32 shim_cos_deg(f32 x);
f32 shim_atan2(f32 startX, f32 startZ, f32 endX, f32 endZ);
s32 shim_npc_raycast_down_sides(s32, f32*, f32*, f32*, f32*);
s32 shim_load_effect(s32 effectIndex);
float shim_sqrtf(float value);
void shim_mdl_draw_hidden_panel_surface(Gfx**, u16 treeIndex);
s32 shim_is_point_visible(f32, f32, f32, s32, f32*, f32*);
void shim_guPerspectiveF(f32 mf[4][4], u16* perspNorm, f32 fovy, f32 aspect, f32 near, f32 far, f32 scale);
void shim_transform_point(Matrix4f mtx, f32 inX, f32 inY, f32 inZ, f32 inS, f32* outX, f32* outY, f32* outZ, f32* outW);
void shim_guPositionF(float mf[4][4], float r, float p, float h, float s, float x, float y, float z);
void shim_guOrthoF(float mf[4][4], float l, float r, float b, float t, float n, float f, float scale);
void shim_guFrustumF(float mf[4][4], float l, float r, float b, float t, float n, float f, float scale);
void shim_draw_prev_frame_buffer_at_screen_pos(s32, s32, s32, s32, f32);
void shim_draw_box(
s32 flags, WindowStyle windowStyle, s32 posX, s32 posY, s32 posZ, s32 width, s32 height, u8 opacity,
u8 darkening, f32 scaleX, f32 scaleY, f32 rotX, f32 rotY, f32 rotZ, void (*fpDrawContents)(void*),
void* drawContentsArg0, Matrix4f rotScaleMtx, s32 translateX, s32 translateY, f32 (*outMtx)[4]
);
void shim_draw_msg(s32, s32, s32, s32, s32, s32);
s32 shim_get_msg_width(s32, u16);
void shim_get_background_color_blend(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);
#define guRotateF shim_guRotateF
#define guTranslateF shim_guTranslateF
#define guTranslate shim_guTranslate
#define guScaleF shim_guScaleF
#define guMtxCatF shim_guMtxCatF
#define guMtxF2L shim_guMtxF2L
#define queue_render_task shim_queue_render_task
#define create_effect_instance shim_create_effect_instance
#define remove_effect shim_remove_effect
#define general_heap_malloc shim_general_heap_malloc
#define mem_clear shim_mem_clear
#define rand_int shim_rand_int
#define clamp_angle shim_clamp_angle
#define sin_deg shim_sin_deg
#define cos_deg shim_cos_deg
#define atan2 shim_atan2
#define npc_raycast_down_sides shim_npc_raycast_down_sides
#define load_effect shim_load_effect
#define sqrtf shim_sqrtf
#define mdl_draw_hidden_panel_surface shim_mdl_draw_hidden_panel_surface
#define is_point_visible shim_is_point_visible
#define guPerspectiveF shim_guPerspectiveF
#define transform_point shim_transform_point
#define guPositionF shim_guPositionF
#define guOrthoF shim_guOrthoF
#define guFrustumF shim_guFrustumF
#define draw_prev_frame_buffer_at_screen_pos shim_draw_prev_frame_buffer_at_screen_pos
#define draw_box shim_draw_box
#define draw_msg shim_draw_msg
#define get_msg_width shim_get_msg_width
#define get_background_color_blend shim_get_background_color_blend
#define sfx_play_sound_at_position shim_sfx_play_sound_at_position
#endif

View File

@ -2951,4 +2951,132 @@ EffectInstance* fx_86(s32, f32, f32, f32, f32, s32);
void fx_sun_undeclared(s32, s32, s32, s32, s32, s32); void fx_sun_undeclared(s32, s32, s32, s32, s32, s32);
void big_smoke_puff_main(f32 x, f32 y, f32 z);
void landing_dust_main(s32 type, f32 x, f32 y, f32 z, f32);
void walking_dust_main(s32, f32, f32, f32, f32, f32);
void flower_splash_main(f32, f32, f32, f32);
void flower_trail_main(s32, f32, f32, f32, f32, f32);
void cloud_puff_main(f32, f32, f32, f32);
void cloud_trail_main(s32, f32, f32, f32);
void footprint_main(f32, f32, f32, f32, f32, f32, f32, f32);
void floating_flower_main(s32, f32, f32, f32, s32);
void snowflake_main(f32, f32, f32, s32, s32);
EffectInstance* star_main(s32, f32, f32, f32, f32, f32, f32, f32);
void emote_main(s32, Npc*, f32, f32, f32, f32, f32, s32, EffectInstance**);
void sparkles_main(s32, f32, f32, f32, f32);
EffectInstance* shape_spell_main(s32, f32, f32, f32, f32, f32, f32, s32);
void gather_energy_pink_main(s32, f32, f32, f32, f32, s32);
void drop_leaves_main(s32, f32, f32, f32, s32);
EffectInstance* dust_main(s32, f32, f32, f32, s32);
void shattering_stones_main(s32, f32, f32, f32, f32);
void smoke_ring_main(s32, f32, f32, f32);
void damage_stars_main(s32, f32, f32, f32, f32, f32, f32, s32);
void explosion_main(s32, f32, f32, f32);
void lens_flare_main(s32, f32, f32, f32, s32);
void got_item_outline_main(s32, f32, f32, f32, f32, EffectInstance**);
void spiky_white_aura_main(s32, f32, f32, f32, s32);
void smoke_impact_main(s32, f32, f32, f32, f32, s32, f32, s32);
void damage_indicator_main(s32, f32, f32, f32, f32, f32, s32, EffectInstance**);
EffectInstance* purple_ring_main(s32, f32, f32, f32, f32, f32, f32, f32);
void flame_main(s32, f32, f32, f32, f32, EffectInstance**);
void stars_burst_main(s32, f32, f32, f32, f32, f32, s32);
void stars_shimmer_main(s32, f32 x, f32 y, f32 z, f32, f32, s32, s32);
void rising_bubble_main(s32, f32, f32, f32, f32);
void ring_blast_main(s32, f32, f32, f32, f32, s32);
void shockwave_main(s32, f32, f32, f32);
void music_note_main(s32, f32, f32, f32);
void smoke_burst_main(s32, f32, f32, f32, f32, s32);
void sweat_main(s32, f32, f32, f32, f32, f32, s32);
void sleep_bubble_main(s32, f32, f32, f32, f32, f32, EffectInstance**);
void windy_leaves_main(s32, f32, f32, f32);
void falling_leaves_main(s32, f32, f32, f32);
void stars_spread_main(s32, f32, f32, f32, s32, s32);
void steam_burst_main(s32, f32, f32, f32, f32, s32);
void stars_orbiting_main(s32, f32, f32, f32, f32, s32, EffectInstance**);
void big_snowflakes_main(s32, f32, f32, f32);
EffectInstance* debuff_main(s32, f32, f32, f32);
EffectInstance* green_impact_main(s32, f32, f32, f32, f32);
EffectInstance* radial_shimmer_main(s32, f32, f32, f32, f32, s32);
void ending_decals_main(s32, f32, f32, f32, f32, EffectInstance**);
void light_rays_main(s32, f32, f32, f32, f32, EffectInstance**);
EffectInstance* lightning_main(s32, f32, f32, f32, f32, f32);
EffectInstance* fire_breath_main(s32, f32, f32, f32, f32, f32, f32, s32, s32, s32);
EffectInstance* shimmer_burst_main(s32, f32, f32, f32, f32, s32);
void energy_shockwave_main(s32, f32, f32, f32, f32, s32);
EffectInstance* shimmer_wave_main(s32, f32, f32, f32, f32, f32, s32, s32);
void aura_main(s32, f32, f32, f32, f32, EffectInstance**);
void bulb_glow_main(s32, f32, f32, f32, f32, EffectInstance**);
void effect_3D_main(s32, f32, f32, f32, f32, f32, f32, s32, EffectInstance**);
void blast_main(s32, f32, f32, f32, f32, s32);
EffectInstance* fire_flower_main(s32, f32, f32, f32, s32);
EffectInstance* recover_main(s32, f32, f32, f32, s32);
EffectInstance* disable_x_main(s32, f32, f32, f32, s32);
EffectInstance* bombette_breaking_main(s32, s32, s32, f32, s32, s32);
EffectInstance* firework_main(s32, f32, f32, f32, f32, s32);
EffectInstance* confetti_main(s32, f32, f32, f32, f32, s32);
EffectInstance* snowfall_main(s32, s32);
EffectInstance* effect_46_main(s32, PlayerStatus*, f32, s32);
EffectInstance* gather_magic_main(s32, f32, f32, f32, f32, s32);
EffectInstance* attack_result_text_main(s32, f32, f32, f32, f32, s32);
EffectInstance* small_gold_sparkle_main(s32, f32, f32, f32, f32);
EffectInstance* flashing_box_shockwave_main(s32, f32, f32, f32, f32, f32);
EffectInstance* balloon_main(s32, f32, f32, f32, f32, s32);
EffectInstance* floating_rock_main(s32, f32, f32, f32, f32, f32, f32, f32, s32);
EffectInstance* chomp_drop_main(s32, f32, f32, f32, f32, s32, f32, s32, f32, s32);
EffectInstance* quizmo_stage_main(s32, f32, f32, f32);
EffectInstance* radiating_energy_orb_main(s32, f32, f32, f32, f32, s32);
EffectInstance* quizmo_answer_main(s32, f32, f32, f32);
EffectInstance* motion_blur_flame_main(s32, f32, f32, f32, f32, s32);
EffectInstance* energy_orb_wave_main(s32, f32, f32, f32, f32, s32);
EffectInstance* merlin_house_stars_main(s32, f32, f32, f32);
EffectInstance* quizmo_audience_main(s32, f32, f32, f32);
EffectInstance* butterflies_main(s32, f32, f32, f32);
EffectInstance* stat_change_main(s32, f32, f32, f32, f32, s32);
EffectInstance* snaking_static_main(s32, f32, f32, f32, f32, s32);
EffectInstance* thunderbolt_ring_main(s32, f32, f32, f32, f32, s32);
EffectInstance* squirt_main(s32, f32, f32, f32, f32, f32, f32, f32, s32);
EffectInstance* water_block_main(s32, f32, f32, f32, f32, s32);
EffectInstance* waterfall_main(s32, f32, f32, f32, f32, s32);
EffectInstance* water_fountain_main(s32, f32, f32, f32, f32, s32);
EffectInstance* underwater_main(s32, f32, f32, f32, f32, s32);
EffectInstance* lightning_bolt_main(s32, f32, f32, f32, f32, f32, f32, f32, s32);
EffectInstance* water_splash_main(s32, f32, f32, f32, f32, s32);
EffectInstance* snowman_doll_main(s32, f32, f32, f32, f32, s32);
EffectInstance* fright_jar_main(s32, f32, f32, f32, f32, s32);
EffectInstance* stop_watch_main(s32, f32, f32, f32, f32, s32);
EffectInstance* effect_63_main(s32, f32, f32, f32, f32, f32, f32, f32, s32, s32);
EffectInstance* throw_spiny_main(s32, f32, f32, f32, f32, f32, f32, f32, s32);
EffectInstance* effect_65_main(s32, f32, f32, f32, f32, s32);
EffectInstance* tubba_heart_attack_main(s32, f32, f32, f32, f32, s32);
EffectInstance* whirlwind_main(s32, f32, f32, f32, f32, s32);
EffectInstance* red_impact_main(s32, f32, f32, f32, f32);
EffectInstance* floating_cloud_puff_main(s32, f32, f32, f32, f32, s32);
EffectInstance* energy_in_out_main(s32, f32, f32, f32, f32, s32);
EffectInstance* tattle_window_main(s32, f32, f32, f32, f32, s32);
EffectInstance* shiny_flare_main(s32, f32, f32, f32, f32);
EffectInstance* huff_puff_breath_main(s32, f32, f32, f32, f32, f32, f32, s32);
EffectInstance* cold_breath_main(s32, f32, f32, f32, f32, s32);
EffectInstance* embers_main(s32, f32, f32, f32, f32, f32, f32, s32, s32, f32, f32);
EffectInstance* hieroglyphs_main(s32, f32, f32, f32, f32, s32);
EffectInstance *misc_particles_main(s32, f32, f32, f32, f32, f32, f32, s32, s32);
EffectInstance* static_status_main(s32, f32, f32, f32, f32, s32, s32);
EffectInstance* moving_cloud_main(s32, f32, f32, f32, f32, f32, f32, f32, f32);
EffectInstance* effect_75_main(s32, f32, f32, f32, f32, s32);
EffectInstance* firework_rocket_main(s32, f32, f32, f32, f32, f32, f32, f32, s32);
EffectInstance* peach_star_beam_main(s32, f32, f32, f32, f32, s32);
EffectInstance* chapter_change_main(s32, f32, f32, f32, f32, s32);
EffectInstance* ice_shard_main(s32, f32, f32, f32, f32, s32);
EffectInstance* spirit_card_main(s32, f32, f32, f32, f32, s32);
EffectInstance* lil_oink_main(void);
EffectInstance* something_rotating_main(s32, f32, f32, f32, f32, s32);
EffectInstance* breaking_junk_main(s32, f32, f32, f32, f32, s32);
EffectInstance* partner_buff_main(s32, f32, f32, f32, f32, s32);
EffectInstance* quizmo_assistant_main(s32, f32, f32, f32, f32, s32);
EffectInstance* ice_pillar_main(s32 arg0, f32 x, f32 y, f32 z, f32 arg4, s32 arg5);
EffectInstance* sun_main(s32, f32, f32, f32, f32, s32);
EffectInstance* star_spirits_energy_main(s32, f32, f32, f32, f32, s32);
EffectInstance* pink_sparkles_main(s32, f32, f32, f32, f32, f32);
EffectInstance* star_outline_main(s32, f32, f32, f32, f32, s32);
EffectInstance* effect_86_main(s32, f32, f32, f32, f32, s32);
#endif #endif

View File

@ -6,168 +6,6 @@
s32 effect_rand_int(s32); s32 effect_rand_int(s32);
s32 func_E0200044(s32, s32); s32 func_E0200044(s32, s32);
EffectInstance* shim_create_effect_instance(EffectBlueprint* effectBp); #include "effect_shims.h"
s32 shim_load_effect(s32 effectIndex);
void shim_remove_effect(EffectInstance*);
s32 shim_rand_int(s32);
void* shim_general_heap_malloc(s32 size);
RenderTask* shim_queue_render_task(RenderTask* task);
float shim_sqrtf(float value);
f32 shim_atan2(f32 startX, f32 startZ, f32 endX, f32 endZ);
f32 shim_sin_deg(f32 x);
f32 shim_cos_deg(f32 x);
f32 shim_clamp_angle(f32 theta);
void shim_get_background_color_blend(u8* r, u8* g, u8* b, u8* a);
void shim_guMtxF2L(float mf[4][4], Mtx *m);
void shim_guMtxCatF(float m[4][4], float n[4][4], float r[4][4]);
void shim_guScaleF(float mf[4][4], float x, float y, float z);
void shim_guRotateF(float mf[4][4], float a, float x, float y, float z);
void shim_guTranslate(Mtx *m, float x, float y, float z);
void shim_guTranslateF(float mf[4][4], float x, float y, float z);
void shim_guPerspectiveF(f32 mf[4][4], u16* perspNorm, f32 fovy, f32 aspect, f32 near, f32 far, f32 scale);
void shim_guPositionF(float mf[4][4], float r, float p, float h, float s, float x, float y, float z);
void shim_guOrthoF(float mf[4][4], float l, float r, float b, float t, float n, float f, float scale);
void shim_guFrustumF(float mf[4][4], float l, float r, float b, float t, float n, float f, float scale);
void shim_mem_clear(void* data, s32 numBytes);
void shim_transform_point(Matrix4f mtx, f32 inX, f32 inY, f32 inZ, f32 inS, f32* outX, f32* outY, f32* outZ, f32* outW);
s32 shim_npc_raycast_down_sides(s32, f32*, f32*, f32*, f32*);
void shim_sfx_play_sound_at_position(s32 soundID, s32 value2, f32 posX, f32 posY, f32 posZ);
void shim_mdl_draw_hidden_panel_surface(Gfx**, u16 treeIndex);
s32 shim_is_point_visible(f32, f32, f32, s32, f32*, f32*);
void shim_draw_box(s32 flags, WindowStyle windowStyle, s32 posX, s32 posY, s32 posZ, s32 width, s32 height, u8 opacity,
u8 darkening, f32 scaleX, f32 scaleY, f32 rotX, f32 rotY, f32 rotZ, void (*fpDrawContents)(void*),
void* drawContentsArg0, Matrix4f rotScaleMtx, s32 translateX, s32 translateY, f32 (*outMtx)[4]);
// the actual signature is going to be wrong, but it doesn't matter
// TODO remove when every effect's main is sorted out
#define FX_MAIN(name) void name(void);
void big_smoke_puff_main(f32 x, f32 y, f32 z);
void landing_dust_main(s32 type, f32 x, f32 y, f32 z, f32);
void walking_dust_main(s32, f32, f32, f32, f32, f32);
void flower_splash_main(f32, f32, f32, f32);
void flower_trail_main(s32, f32, f32, f32, f32, f32);
void cloud_puff_main(f32, f32, f32, f32);
void cloud_trail_main(s32, f32, f32, f32);
void footprint_main(f32, f32, f32, f32, f32, f32, f32, f32);
void floating_flower_main(s32, f32, f32, f32, s32);
void snowflake_main(f32, f32, f32, s32, s32);
EffectInstance* star_main(s32, f32, f32, f32, f32, f32, f32, f32);
void emote_main(s32, Npc*, f32, f32, f32, f32, f32, s32, EffectInstance**);
void sparkles_main(s32, f32, f32, f32, f32);
EffectInstance* shape_spell_main(s32, f32, f32, f32, f32, f32, f32, s32);
void gather_energy_pink_main(s32, f32, f32, f32, f32, s32);
void drop_leaves_main(s32, f32, f32, f32, s32);
EffectInstance* dust_main(s32, f32, f32, f32, s32);
void shattering_stones_main(s32, f32, f32, f32, f32);
void smoke_ring_main(s32, f32, f32, f32);
void damage_stars_main(s32, f32, f32, f32, f32, f32, f32, s32);
void explosion_main(s32, f32, f32, f32);
void lens_flare_main(s32, f32, f32, f32, s32);
void got_item_outline_main(s32, f32, f32, f32, f32, EffectInstance**);
void spiky_white_aura_main(s32, f32, f32, f32, s32);
void smoke_impact_main(s32, f32, f32, f32, f32, s32, f32, s32);
void damage_indicator_main(s32, f32, f32, f32, f32, f32, s32, EffectInstance**);
EffectInstance* purple_ring_main(s32, f32, f32, f32, f32, f32, f32, f32);
void flame_main(s32, f32, f32, f32, f32, EffectInstance**);
void stars_burst_main(s32, f32, f32, f32, f32, f32, s32);
void stars_shimmer_main(s32, f32 x, f32 y, f32 z, f32, f32, s32, s32);
void rising_bubble_main(s32, f32, f32, f32, f32);
void ring_blast_main(s32, f32, f32, f32, f32, s32);
void shockwave_main(s32, f32, f32, f32);
void music_note_main(s32, f32, f32, f32);
void smoke_burst_main(s32, f32, f32, f32, f32, s32);
void sweat_main(s32, f32, f32, f32, f32, f32, s32);
void sleep_bubble_main(s32, f32, f32, f32, f32, f32, EffectInstance**);
void windy_leaves_main(s32, f32, f32, f32);
void falling_leaves_main(s32, f32, f32, f32);
void stars_spread_main(s32, f32, f32, f32, s32, s32);
void steam_burst_main(s32, f32, f32, f32, f32, s32);
void stars_orbiting_main(s32, f32, f32, f32, f32, s32, EffectInstance**);
void big_snowflakes_main(s32, f32, f32, f32);
EffectInstance* debuff_main(s32, f32, f32, f32);
EffectInstance* green_impact_main(s32, f32, f32, f32, f32);
EffectInstance* radial_shimmer_main(s32, f32, f32, f32, f32, s32);
void ending_decals_main(s32, f32, f32, f32, f32, EffectInstance**);
void light_rays_main(s32, f32, f32, f32, f32, EffectInstance**);
EffectInstance* lightning_main(s32, f32, f32, f32, f32, f32);
EffectInstance* fire_breath_main(s32, f32, f32, f32, f32, f32, f32, s32, s32, s32);
EffectInstance* shimmer_burst_main(s32, f32, f32, f32, f32, s32);
void energy_shockwave_main(s32, f32, f32, f32, f32, s32);
EffectInstance* shimmer_wave_main(s32, f32, f32, f32, f32, f32, s32, s32);
void aura_main(s32, f32, f32, f32, f32, EffectInstance**);
void bulb_glow_main(s32, f32, f32, f32, f32, EffectInstance**);
void effect_3D_main(s32, f32, f32, f32, f32, f32, f32, s32, EffectInstance**);
void blast_main(s32, f32, f32, f32, f32, s32);
EffectInstance* fire_flower_main(s32, f32, f32, f32, s32);
EffectInstance* recover_main(s32, f32, f32, f32, s32);
EffectInstance* disable_x_main(s32, f32, f32, f32, s32);
EffectInstance* bombette_breaking_main(s32, s32, s32, f32, s32, s32);
EffectInstance* firework_main(s32, f32, f32, f32, f32, s32);
EffectInstance* confetti_main(s32, f32, f32, f32, f32, s32);
EffectInstance* snowfall_main(s32, s32);
EffectInstance* effect_46_main(s32, PlayerStatus*, f32, s32);
EffectInstance* gather_magic_main(s32, f32, f32, f32, f32, s32);
EffectInstance* attack_result_text_main(s32, f32, f32, f32, f32, s32);
EffectInstance* small_gold_sparkle_main(s32, f32, f32, f32, f32);
EffectInstance* flashing_box_shockwave_main(s32, f32, f32, f32, f32, f32);
EffectInstance* balloon_main(s32, f32, f32, f32, f32, s32);
EffectInstance* floating_rock_main(s32, f32, f32, f32, f32, f32, f32, f32, s32);
EffectInstance* chomp_drop_main(s32, f32, f32, f32, f32, s32, f32, s32, f32, s32);
EffectInstance* quizmo_stage_main(s32, f32, f32, f32);
EffectInstance* radiating_energy_orb_main(s32, f32, f32, f32, f32, s32);
EffectInstance* quizmo_answer_main(s32, f32, f32, f32);
EffectInstance* motion_blur_flame_main(s32, f32, f32, f32, f32, s32);
EffectInstance* energy_orb_wave_main(s32, f32, f32, f32, f32, s32);
EffectInstance* merlin_house_stars_main(s32, f32, f32, f32);
EffectInstance* quizmo_audience_main(s32, f32, f32, f32);
EffectInstance* butterflies_main(s32, f32, f32, f32);
EffectInstance* stat_change_main(s32, f32, f32, f32, f32, s32);
EffectInstance* snaking_static_main(s32, f32, f32, f32, f32, s32);
EffectInstance* thunderbolt_ring_main(s32, f32, f32, f32, f32, s32);
EffectInstance* squirt_main(s32, f32, f32, f32, f32, f32, f32, f32, s32);
EffectInstance* water_block_main(s32, f32, f32, f32, f32, s32);
EffectInstance* waterfall_main(s32, f32, f32, f32, f32, s32);
EffectInstance* water_fountain_main(s32, f32, f32, f32, f32, s32);
EffectInstance* underwater_main(s32, f32, f32, f32, f32, s32);
EffectInstance* lightning_bolt_main(s32, f32, f32, f32, f32, f32, f32, f32, s32);
EffectInstance* water_splash_main(s32, f32, f32, f32, f32, s32);
EffectInstance* snowman_doll_main(s32, f32, f32, f32, f32, s32);
EffectInstance* fright_jar_main(s32, f32, f32, f32, f32, s32);
EffectInstance* stop_watch_main(s32, f32, f32, f32, f32, s32);
EffectInstance* effect_63_main(s32, f32, f32, f32, f32, f32, f32, f32, s32, s32);
EffectInstance* throw_spiny_main(s32, f32, f32, f32, f32, f32, f32, f32, s32);
EffectInstance* effect_65_main(s32, f32, f32, f32, f32, s32);
EffectInstance* tubba_heart_attack_main(s32, f32, f32, f32, f32, s32);
EffectInstance* whirlwind_main(s32, f32, f32, f32, f32, s32);
EffectInstance* red_impact_main(s32, f32, f32, f32, f32);
EffectInstance* floating_cloud_puff_main(s32, f32, f32, f32, f32, s32);
EffectInstance* energy_in_out_main(s32, f32, f32, f32, f32, s32);
EffectInstance* tattle_window_main(s32, f32, f32, f32, f32, s32);
EffectInstance* shiny_flare_main(s32, f32, f32, f32, f32);
EffectInstance* huff_puff_breath_main(s32, f32, f32, f32, f32, f32, f32, s32);
EffectInstance* cold_breath_main(s32, f32, f32, f32, f32, s32);
EffectInstance* embers_main(s32, f32, f32, f32, f32, f32, f32, s32, s32, f32, f32);
EffectInstance* hieroglyphs_main(s32, f32, f32, f32, f32, s32);
EffectInstance *misc_particles_main(s32, f32, f32, f32, f32, f32, f32, s32, s32);
EffectInstance* static_status_main(s32, f32, f32, f32, f32, s32, s32);
EffectInstance* moving_cloud_main(s32, f32, f32, f32, f32, f32, f32, f32, f32);
EffectInstance* effect_75_main(s32, f32, f32, f32, f32, s32);
EffectInstance* firework_rocket_main(s32, f32, f32, f32, f32, f32, f32, f32, s32);
EffectInstance* peach_star_beam_main(s32, f32, f32, f32, f32, s32);
EffectInstance* chapter_change_main(s32, f32, f32, f32, f32, s32);
EffectInstance* ice_shard_main(s32, f32, f32, f32, f32, s32);
EffectInstance* spirit_card_main(s32, f32, f32, f32, f32, s32);
EffectInstance* lil_oink_main(void);
EffectInstance* something_rotating_main(s32, f32, f32, f32, f32, s32);
EffectInstance* breaking_junk_main(s32, f32, f32, f32, f32, s32);
EffectInstance* partner_buff_main(s32, f32, f32, f32, f32, s32);
EffectInstance* quizmo_assistant_main(s32, f32, f32, f32, f32, s32);
EffectInstance* ice_pillar_main(s32 arg0, f32 x, f32 y, f32 z, f32 arg4, s32 arg5);
EffectInstance* sun_main(s32, f32, f32, f32, f32, s32);
EffectInstance* star_spirits_energy_main(s32, f32, f32, f32, f32, s32);
EffectInstance* pink_sparkles_main(s32, f32, f32, f32, f32, f32);
EffectInstance* star_outline_main(s32, f32, f32, f32, f32, s32);
EffectInstance* effect_86_main(s32, f32, f32, f32, f32, s32);
#endif #endif

View File

@ -1,6 +1,5 @@
#include "common.h" #include "common.h"
#include "effects.h" #include "effects.h"
#include "effects_internal.h"
#include "ld_addrs.h" #include "ld_addrs.h"
typedef s32 TlbEntry[0x1000 / 4]; typedef s32 TlbEntry[0x1000 / 4];

View File

@ -47,10 +47,10 @@ EffectInstance* attack_result_text_main(s32 type, f32 posX, f32 posY, f32 posZ,
bp.renderUI = func_E0090428; bp.renderUI = func_E0090428;
bp.effectID = EFFECT_ATTACK_RESULT_TEXT; bp.effectID = EFFECT_ATTACK_RESULT_TEXT;
effect = shim_create_effect_instance(&bp); effect = create_effect_instance(&bp);
effect->numParts = numParts; effect->numParts = numParts;
data = effect->data.attackResultText = shim_general_heap_malloc(effect->numParts * sizeof(*data)); data = effect->data.attackResultText = general_heap_malloc(effect->numParts * sizeof(*data));
ASSERT(data != NULL); ASSERT(data != NULL);
@ -72,8 +72,8 @@ EffectInstance* attack_result_text_main(s32 type, f32 posX, f32 posY, f32 posZ,
data->pos.x = posX; data->pos.x = posX;
data->pos.y = posY; data->pos.y = posY;
data->pos.z = posZ; data->pos.z = posZ;
data->vel.x = 2.0f * (-shim_sin_deg(30.0f) * appearVel); data->vel.x = 2.0f * (-sin_deg(30.0f) * appearVel);
data->vel.y = 2.0f * (shim_cos_deg(30.0f) * appearVel); data->vel.y = 2.0f * (cos_deg(30.0f) * appearVel);
} else { } else {
data->pos.x = -100.0f; data->pos.x = -100.0f;
data->pos.y = 40.0f; data->pos.y = 40.0f;
@ -107,7 +107,7 @@ void attack_result_text_update(EffectInstance* effect) {
if (data->timeLeft < 0) { if (data->timeLeft < 0) {
data->isVisible = FALSE; data->isVisible = FALSE;
data->timeLeft = -1; data->timeLeft = -1;
shim_remove_effect(effect); remove_effect(effect);
return; return;
} }
@ -192,12 +192,12 @@ void func_E0090444(EffectInstance* effect) {
gDPSetPrimDepth(gMainGfxPos++, z, 0); gDPSetPrimDepth(gMainGfxPos++, z, 0);
if (type < 5) { if (type < 5) {
shim_guTranslateF(mtxA, data->pos.x, data->pos.y, data->pos.z); guTranslateF(mtxA, data->pos.x, data->pos.y, data->pos.z);
shim_guRotateF(mtxB, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); guRotateF(mtxB, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f);
shim_guMtxCatF(mtxB, mtxA, mtxA); guMtxCatF(mtxB, mtxA, mtxA);
shim_guScaleF(mtxB, scale, scale, 1.0f); guScaleF(mtxB, scale, scale, 1.0f);
shim_guMtxCatF(mtxB, mtxA, mtxA); guMtxCatF(mtxB, mtxA, mtxA);
shim_guMtxF2L(mtxA, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(mtxA, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++],
G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gDPSetPrimColor(gMainGfxPos++, 0, 0, 255, 255, 255, data->alpha); gDPSetPrimColor(gMainGfxPos++, 0, 0, 255, 255, 255, data->alpha);

View File

@ -39,10 +39,10 @@ void aura_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, EffectInstance*
bp.renderUI = NULL; bp.renderUI = NULL;
bp.effectID = EFFECT_AURA; bp.effectID = EFFECT_AURA;
effect = shim_create_effect_instance(bpPtr); effect = create_effect_instance(bpPtr);
effect->numParts = numParts; effect->numParts = numParts;
part = effect->data.aura = shim_general_heap_malloc(numParts * sizeof(*part)); part = effect->data.aura = general_heap_malloc(numParts * sizeof(*part));
ASSERT(effect->data.aura != NULL); ASSERT(effect->data.aura != NULL);
@ -177,7 +177,7 @@ void aura_update(EffectInstance* effect) {
} }
if (data->fadeTime < 0) { if (data->fadeTime < 0) {
shim_remove_effect(effect); remove_effect(effect);
return; return;
} }
@ -253,7 +253,7 @@ void aura_render(EffectInstance* effect) {
renderTask.distance = 0; renderTask.distance = 0;
renderTask.renderMode = RENDER_MODE_2D; renderTask.renderMode = RENDER_MODE_2D;
retTask = shim_queue_render_task(&renderTask); retTask = queue_render_task(&renderTask);
retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR;
} }
@ -274,39 +274,39 @@ void aura_appendGfx(void* argEffect) {
gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(effect->graphics->data)); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(effect->graphics->data));
gSPDisplayList(gMainGfxPos++, D_E0076ED0[type]); gSPDisplayList(gMainGfxPos++, D_E0076ED0[type]);
shim_guTranslateF(translateMtx, data->posB.x, data->posB.y, data->posB.z); guTranslateF(translateMtx, data->posB.x, data->posB.y, data->posB.z);
if (type == 2) { if (type == 2) {
shim_guRotateF(tempMtx, data->renderYaw, 0.0f, 1.0f, 0.0f); guRotateF(tempMtx, data->renderYaw, 0.0f, 1.0f, 0.0f);
} else { } else {
shim_guRotateF(tempMtx, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); guRotateF(tempMtx, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f);
} }
shim_guMtxCatF(tempMtx, translateMtx, transformMtx); guMtxCatF(tempMtx, translateMtx, transformMtx);
shim_guScaleF(tempMtx, data->scale.x, data->scale.y, 1.0f); guScaleF(tempMtx, data->scale.x, data->scale.y, 1.0f);
shim_guMtxCatF(tempMtx, transformMtx, transformMtx); guMtxCatF(tempMtx, transformMtx, transformMtx);
if (type == 0) { if (type == 0) {
shim_guTranslateF(tempMtx, (-(data->scale.x - data->unk_24) / data->unk_24) * 10.0f, 0.0f, 0.0f); guTranslateF(tempMtx, (-(data->scale.x - data->unk_24) / data->unk_24) * 10.0f, 0.0f, 0.0f);
shim_guMtxCatF(tempMtx, transformMtx, transformMtx); guMtxCatF(tempMtx, transformMtx, transformMtx);
} }
shim_guMtxF2L(transformMtx, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(transformMtx, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(gMainGfxPos++, D_E0076EC0[type]); gSPDisplayList(gMainGfxPos++, D_E0076EC0[type]);
gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW); gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
shim_guTranslateF(translateMtx, data->posA.x, data->posA.y, data->posA.z); guTranslateF(translateMtx, data->posA.x, data->posA.y, data->posA.z);
if (type == 2) { if (type == 2) {
shim_guRotateF(tempMtx, data->renderYaw, 0.0f, 1.0f, 0.0f); guRotateF(tempMtx, data->renderYaw, 0.0f, 1.0f, 0.0f);
} else { } else {
shim_guRotateF(tempMtx, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); guRotateF(tempMtx, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f);
} }
shim_guMtxCatF(tempMtx, translateMtx, transformMtx); guMtxCatF(tempMtx, translateMtx, transformMtx);
shim_guScaleF(tempMtx, data->scale.x, data->scale.y, 1.0f); guScaleF(tempMtx, data->scale.x, data->scale.y, 1.0f);
shim_guMtxCatF(tempMtx, transformMtx, transformMtx); guMtxCatF(tempMtx, transformMtx, transformMtx);
if (type == 0) { if (type == 0) {
shim_guTranslateF(tempMtx, (-(data->scale.x - data->unk_24) / data->unk_24) * 10.0f, 0.0f, 0.0f); guTranslateF(tempMtx, (-(data->scale.x - data->unk_24) / data->unk_24) * 10.0f, 0.0f, 0.0f);
shim_guMtxCatF(tempMtx, transformMtx, transformMtx); guMtxCatF(tempMtx, transformMtx, transformMtx);
} }
shim_guMtxF2L(transformMtx, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(transformMtx, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(gMainGfxPos++, D_E0076EB0[type]); gSPDisplayList(gMainGfxPos++, D_E0076EB0[type]);

View File

@ -27,10 +27,10 @@ EffectInstance* balloon_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, s
bp.renderUI = NULL; bp.renderUI = NULL;
bp.effectID = EFFECT_BALLOON; bp.effectID = EFFECT_BALLOON;
effect = shim_create_effect_instance(&bp); effect = create_effect_instance(&bp);
effect->numParts = numParts; effect->numParts = numParts;
data = shim_general_heap_malloc(numParts * sizeof(*data)); data = general_heap_malloc(numParts * sizeof(*data));
effect->data.balloon = data; effect->data.balloon = data;
part = data; part = data;
@ -59,7 +59,7 @@ void balloon_update(EffectInstance* effect) {
part->unk_20++; part->unk_20++;
if (part->unk_1C < 0) { if (part->unk_1C < 0) {
shim_remove_effect(effect); remove_effect(effect);
return; return;
} }
@ -79,7 +79,7 @@ void balloon_render(EffectInstance* effect) {
renderTask.distance = 0; renderTask.distance = 0;
renderTask.renderMode = RENDER_MODE_SURFACE_OPA; renderTask.renderMode = RENDER_MODE_SURFACE_OPA;
retTask = shim_queue_render_task(&renderTask); retTask = queue_render_task(&renderTask);
retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR;
} }
@ -92,12 +92,12 @@ void balloon_appendGfx(void* effect) {
gDPPipeSync(gMainGfxPos++); gDPPipeSync(gMainGfxPos++);
gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data));
shim_guTranslateF(sp18, data->unk_04, data->unk_08, data->unk_0C); guTranslateF(sp18, data->unk_04, data->unk_08, data->unk_0C);
shim_guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f);
shim_guMtxCatF(sp58, sp18, sp18); guMtxCatF(sp58, sp18, sp18);
shim_guScaleF(sp58, data->unk_18, data->unk_18, 1.0f); guScaleF(sp58, data->unk_18, data->unk_18, 1.0f);
shim_guMtxCatF(sp58, sp18, sp18); guMtxCatF(sp58, sp18, sp18);
shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++],
G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);

View File

@ -42,10 +42,10 @@ void big_smoke_puff_main(f32 x, f32 y, f32 z) {
bp.renderUI = NULL; bp.renderUI = NULL;
bp.effectID = EFFECT_BIG_SMOKE_PUFF; bp.effectID = EFFECT_BIG_SMOKE_PUFF;
effect = shim_create_effect_instance(&bp); effect = create_effect_instance(&bp);
effect->numParts = numParts; effect->numParts = numParts;
data = shim_general_heap_malloc(effect->numParts * sizeof(*data)); data = general_heap_malloc(effect->numParts * sizeof(*data));
effect->data.bigSmokePuff = data; effect->data.bigSmokePuff = data;
ASSERT(data != NULL); ASSERT(data != NULL);
@ -63,8 +63,8 @@ void big_smoke_puff_main(f32 x, f32 y, f32 z) {
theta = D_E0002760[i] + 90.0f; theta = D_E0002760[i] + 90.0f;
temp_f20 = 2.0 * D_E0002788[i]; temp_f20 = 2.0 * D_E0002788[i];
sinTheta = shim_sin_deg(theta); sinTheta = sin_deg(theta);
cosTheta = shim_cos_deg(theta); cosTheta = cos_deg(theta);
data->unk_20 = temp_f20 * sinTheta; data->unk_20 = temp_f20 * sinTheta;
data->unk_24 = -temp_f20 * cosTheta; data->unk_24 = -temp_f20 * cosTheta;
@ -102,7 +102,7 @@ void big_smoke_puff_update(EffectInstance* effect) {
} }
if (!cond) { if (!cond) {
shim_remove_effect(effect); remove_effect(effect);
} }
} }
@ -115,7 +115,7 @@ void big_smoke_puff_render(EffectInstance* effect) {
renderTask.distance = 0; renderTask.distance = 0;
renderTask.renderMode = RENDER_MODE_2D; renderTask.renderMode = RENDER_MODE_2D;
retTask = shim_queue_render_task(&renderTask); retTask = queue_render_task(&renderTask);
retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR;
} }
@ -128,8 +128,8 @@ void big_smoke_puff_appendGfx(void* effect) {
gDPPipeSync(gMainGfxPos++); gDPPipeSync(gMainGfxPos++);
gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data));
shim_guPositionF(mtx, 0.0f, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, data->x, data->y, data->z); guPositionF(mtx, 0.0f, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, data->x, data->y, data->z);
shim_guMtxF2L(mtx, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(mtx, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, gSPMatrix(gMainGfxPos++,
&gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
@ -145,9 +145,9 @@ void big_smoke_puff_appendGfx(void* effect) {
primAlpha = 16; primAlpha = 16;
} }
shim_guPositionF(mtx, 0.0f, 0.0f, sPartYaws[i], sPartScales[i], data->partX, guPositionF(mtx, 0.0f, 0.0f, sPartYaws[i], sPartScales[i], data->partX,
data->partY, 0.0f); data->partY, 0.0f);
shim_guMtxF2L(mtx, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(mtx, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, gSPMatrix(gMainGfxPos++,
&gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
@ -158,7 +158,7 @@ void big_smoke_puff_appendGfx(void* effect) {
envAlpha = 255; envAlpha = 255;
dlist = sDlists[ARRAY_COUNT(sDlists) - 1]; dlist = sDlists[ARRAY_COUNT(sDlists) - 1];
} else { } else {
f32 temp = shim_sin_deg((((temp_f12 * 7.0f) / data->unk_04) * 90.0f) / 7.0f) * 7.0f; f32 temp = sin_deg((((temp_f12 * 7.0f) / data->unk_04) * 90.0f) / 7.0f) * 7.0f;
envAlpha = (s32)(temp * 255.0f) % 256; envAlpha = (s32)(temp * 255.0f) % 256;
dlist = sDlists[(s32)temp]; dlist = sDlists[(s32)temp];
@ -176,5 +176,5 @@ void big_smoke_puff_appendGfx(void* effect) {
} }
void func_E0002738(EffectInstance* effect) { void func_E0002738(EffectInstance* effect) {
shim_remove_effect(effect); remove_effect(effect);
} }

View File

@ -27,15 +27,15 @@ void big_snowflakes_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3) {
bp.renderUI = NULL; bp.renderUI = NULL;
bp.effectID = EFFECT_BIG_SNOWFLAKES; bp.effectID = EFFECT_BIG_SNOWFLAKES;
effect = shim_create_effect_instance(&bp); effect = create_effect_instance(&bp);
effect->numParts = numParts; effect->numParts = numParts;
data = shim_general_heap_malloc(effect->numParts * sizeof(*data)); data = general_heap_malloc(effect->numParts * sizeof(*data));
effect->data.bigSnowflakes = data; effect->data.bigSnowflakes = data;
ASSERT(data != NULL); ASSERT(data != NULL);
shim_mem_clear(data, numParts * sizeof(*data)); mem_clear(data, numParts * sizeof(*data));
data->unk_00 = arg0; data->unk_00 = arg0;
data->unk_04 = arg1; data->unk_04 = arg1;
data->unk_08 = arg2; data->unk_08 = arg2;
@ -68,7 +68,7 @@ void big_snowflakes_update(EffectInstance* effect) {
data->unk_28--; data->unk_28--;
data->unk_2C++; data->unk_2C++;
if (data->unk_28 < 0) { if (data->unk_28 < 0) {
shim_remove_effect(effect); remove_effect(effect);
return; return;
} }
@ -82,13 +82,13 @@ void big_snowflakes_update(EffectInstance* effect) {
data++; data++;
for (i = 1; i < effect->numParts; i++, data++) { for (i = 1; i < effect->numParts; i++, data++) {
data->unk_10 += (f32) (shim_sin_deg(2.0f * data->unk_18) * 0.2); data->unk_10 += (f32) (sin_deg(2.0f * data->unk_18) * 0.2);
data->unk_14 += -0.05f; data->unk_14 += -0.05f;
data->unk_10 *= 0.92; data->unk_10 *= 0.92;
data->unk_14 += -0.05f; data->unk_14 += -0.05f;
data->unk_1C += func_E0200044(50, unk_28 + (i * 20)) - 25; data->unk_1C += func_E0200044(50, unk_28 + (i * 20)) - 25;
data->unk_18 += shim_sin_deg(data->unk_1C) * 10.0f; data->unk_18 += sin_deg(data->unk_1C) * 10.0f;
data->unk_20 += shim_cos_deg(data->unk_1C * 0.5f) * 10.0f; data->unk_20 += cos_deg(data->unk_1C * 0.5f) * 10.0f;
data->unk_04 += data->unk_10; data->unk_04 += data->unk_10;
data->unk_08 += data->unk_14; data->unk_08 += data->unk_14;
} }
@ -103,7 +103,7 @@ void big_snowflakes_render(EffectInstance* effect) {
renderTask.distance = 0; renderTask.distance = 0;
renderTask.renderMode = RENDER_MODE_2D; renderTask.renderMode = RENDER_MODE_2D;
retTask = shim_queue_render_task(&renderTask); retTask = queue_render_task(&renderTask);
retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR;
} }
@ -119,24 +119,24 @@ void big_snowflakes_appendGfx(void* effect) {
gSPDisplayList(gMainGfxPos++, dlist); gSPDisplayList(gMainGfxPos++, dlist);
gDPSetPrimColor(gMainGfxPos++, 0, 0, 20, 100, 20, data->unk_24); gDPSetPrimColor(gMainGfxPos++, 0, 0, 20, 100, 20, data->unk_24);
shim_guTranslateF(sp18, data->unk_04, data->unk_08, data->unk_0C); guTranslateF(sp18, data->unk_04, data->unk_08, data->unk_0C);
shim_guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f);
shim_guMtxCatF(sp58, sp18, sp98); guMtxCatF(sp58, sp18, sp98);
data++; data++;
for (i = 1; i < ((EffectInstance*)effect)->numParts; i++, data++) { for (i = 1; i < ((EffectInstance*)effect)->numParts; i++, data++) {
Gfx* dlist2 = D_E0060730[i & 1]; // should be able to be i % 2 (ARRAY_COUNT(D_E0060730)) Gfx* dlist2 = D_E0060730[i & 1]; // should be able to be i % 2 (ARRAY_COUNT(D_E0060730))
shim_guTranslateF(sp58, data->unk_04, data->unk_08, data->unk_0C); guTranslateF(sp58, data->unk_04, data->unk_08, data->unk_0C);
shim_guMtxCatF(sp58, sp98, sp18); guMtxCatF(sp58, sp98, sp18);
if (!(i & 1)) { if (!(i & 1)) {
shim_guRotateF(sp58, data->unk_18, 0.0f, 0.0f, 1.0f); guRotateF(sp58, data->unk_18, 0.0f, 0.0f, 1.0f);
shim_guMtxCatF(sp58, sp18, sp18); guMtxCatF(sp58, sp18, sp18);
shim_guRotateF(sp58, data->unk_20, 0.0f, 1.0f, 0.0f); guRotateF(sp58, data->unk_20, 0.0f, 1.0f, 0.0f);
shim_guMtxCatF(sp58, sp18, sp18); guMtxCatF(sp58, sp18, sp18);
} }
shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
gSPDisplayList(gMainGfxPos++, dlist2); gSPDisplayList(gMainGfxPos++, dlist2);

View File

@ -39,14 +39,14 @@ void blast_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, s32 arg5) {
bp.renderUI = NULL; bp.renderUI = NULL;
bp.effectID = EFFECT_BLAST; bp.effectID = EFFECT_BLAST;
effect = shim_create_effect_instance(bpPtr); effect = create_effect_instance(bpPtr);
effect->numParts = numParts; effect->numParts = numParts;
part = effect->data.blast = shim_general_heap_malloc(numParts * sizeof(*part)); part = effect->data.blast = general_heap_malloc(numParts * sizeof(*part));
ASSERT(effect->data.blast != NULL); ASSERT(effect->data.blast != NULL);
shim_mem_clear(part, numParts * sizeof(*part)); mem_clear(part, numParts * sizeof(*part));
part->timeLeft = arg5; part->timeLeft = arg5;
part->unk_18 = 0; part->unk_18 = 0;
@ -72,7 +72,7 @@ void blast_update(EffectInstance* effect) {
part->timeLeft--; part->timeLeft--;
if (part->timeLeft < 0) { if (part->timeLeft < 0) {
shim_remove_effect(effect); remove_effect(effect);
return; return;
} }
@ -88,7 +88,7 @@ void blast_render(EffectInstance* effect) {
renderTask.distance = 0; renderTask.distance = 0;
renderTask.renderMode = RENDER_MODE_28; renderTask.renderMode = RENDER_MODE_28;
retTask = shim_queue_render_task(&renderTask); retTask = queue_render_task(&renderTask);
retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR;
} }
@ -107,14 +107,14 @@ void blast_appendGfx(void *effect) {
gSPDisplayList(gMainGfxPos++, D_09001300_37ECD0); gSPDisplayList(gMainGfxPos++, D_09001300_37ECD0);
gSPDisplayList(gMainGfxPos++, D_E007C510[unk_20]); gSPDisplayList(gMainGfxPos++, D_E007C510[unk_20]);
shim_guTranslateF(sp18, data->pos.x, data->pos.y, data->pos.z); guTranslateF(sp18, data->pos.x, data->pos.y, data->pos.z);
shim_guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f);
shim_guMtxCatF(sp58, sp18, sp98); guMtxCatF(sp58, sp18, sp98);
shim_guScaleF(sp18, data->unk_10, data->unk_10, 1.0f); guScaleF(sp18, data->unk_10, data->unk_10, 1.0f);
shim_guMtxCatF(sp18, sp98, sp98); guMtxCatF(sp18, sp98, sp98);
shim_guRotateF(sp18, data->unk_24, 0.0f, 0.0f, 1.0f); guRotateF(sp18, data->unk_24, 0.0f, 0.0f, 1.0f);
shim_guMtxCatF(sp18, sp98, sp98); guMtxCatF(sp18, sp98, sp98);
shim_guMtxF2L(sp98, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp98, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++],
G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);

View File

@ -70,9 +70,9 @@ EffectInstance* bombette_breaking_main(s32 type, s32 modelID, s32 treeIndex, f32
f40 *= 0.5; f40 *= 0.5;
numParts = (xParts * yParts * zParts) + 1; numParts = (xParts * yParts * zParts) + 1;
effect = shim_create_effect_instance(bpPtr); effect = create_effect_instance(bpPtr);
effect->numParts = numParts; effect->numParts = numParts;
effect->data.bombetteBreaking = data = shim_general_heap_malloc(numParts * sizeof(*data)); effect->data.bombetteBreaking = data = general_heap_malloc(numParts * sizeof(*data));
ASSERT(data != NULL); ASSERT(data != NULL);
data->unk_04 = -sizeY * 0.5; data->unk_04 = -sizeY * 0.5;
@ -152,7 +152,7 @@ void bombette_breaking_update(EffectInstance* effect) {
data->timeLeft--; data->timeLeft--;
if (data->timeLeft < 0) { if (data->timeLeft < 0) {
shim_remove_effect(effect); remove_effect(effect);
return; return;
} }
@ -198,7 +198,7 @@ void bombette_breaking_render(EffectInstance* effect) {
renderTask.distance = 0; renderTask.distance = 0;
renderTask.renderMode = RENDER_MODE_28; renderTask.renderMode = RENDER_MODE_28;
retTask = shim_queue_render_task(&renderTask); retTask = queue_render_task(&renderTask);
retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR;
} }
@ -218,17 +218,17 @@ void bombette_breaking_appendGfx(void* effect) {
gDPPipeSync(gMainGfxPos++); gDPPipeSync(gMainGfxPos++);
gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data));
shim_guTranslateF(sp20, data->center.x, data->center.y, data->center.z); guTranslateF(sp20, data->center.x, data->center.y, data->center.z);
shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
shim_mdl_draw_hidden_panel_surface(&gMainGfxPos, data->treeIndex); mdl_draw_hidden_panel_surface(&gMainGfxPos, data->treeIndex);
data++; data++;
for (i = 1; i < ((EffectInstance*)effect)->numParts; i++, data++) { for (i = 1; i < ((EffectInstance*)effect)->numParts; i++, data++) {
shim_guPositionF(sp20, timeLeft + (130 * i), timeLeft - (40 * i), timeLeft + (80 * i), unk_40, guPositionF(sp20, timeLeft + (130 * i), timeLeft - (40 * i), timeLeft + (80 * i), unk_40,
data->unk_14.x, data->unk_14.y, data->unk_14.z); data->unk_14.x, data->unk_14.y, data->unk_14.z);
shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++],
G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
gSPDisplayList(gMainGfxPos++, D_E0084E1C[type]); gSPDisplayList(gMainGfxPos++, D_E0084E1C[type]);
@ -241,9 +241,9 @@ void bombette_breaking_appendGfx(void* effect) {
data++; data++;
for (i = 1; i < ((EffectInstance*)effect)->numParts; i++, data++) { for (i = 1; i < ((EffectInstance*)effect)->numParts; i++, data++) {
gDPSetPrimColor(gMainGfxPos++, 0, 0, 255, 255, 255, (data->alpha * mainAlpha) / 255); gDPSetPrimColor(gMainGfxPos++, 0, 0, 255, 255, 255, (data->alpha * mainAlpha) / 255);
shim_guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].currentYaw, 0.0f, unk_38, guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].currentYaw, 0.0f, unk_38,
data->center.x, data->center.y, data->center.z); data->center.x, data->center.y, data->center.z);
shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++],
G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
gSPDisplayList(gMainGfxPos++, sp60); gSPDisplayList(gMainGfxPos++, sp60);

View File

@ -32,10 +32,10 @@ EffectInstance* breaking_junk_main(s32 arg0, f32 x, f32 y, f32 z, f32 scale, s32
bp.renderUI = NULL; bp.renderUI = NULL;
bp.effectID = EFFECT_BREAKING_JUNK; bp.effectID = EFFECT_BREAKING_JUNK;
effect = shim_create_effect_instance(bpPtr); effect = create_effect_instance(bpPtr);
effect->numParts = numParts; effect->numParts = numParts;
data = effect->data.breakingJunk = shim_general_heap_malloc(numParts * sizeof(*data)); data = effect->data.breakingJunk = general_heap_malloc(numParts * sizeof(*data));
ASSERT(effect->data.breakingJunk != NULL); ASSERT(effect->data.breakingJunk != NULL);
@ -52,12 +52,12 @@ EffectInstance* breaking_junk_main(s32 arg0, f32 x, f32 y, f32 z, f32 scale, s32
data->pos.x = x; data->pos.x = x;
data->pos.y = y; data->pos.y = y;
data->pos.z = z; data->pos.z = z;
data->vel.x = (shim_rand_int(10) - 5) * 0.5; data->vel.x = (rand_int(10) - 5) * 0.5;
data->vel.y = (shim_rand_int(5) + 1) * 0.8; data->vel.y = (rand_int(5) + 1) * 0.8;
data->vel.z = (shim_rand_int(10) - 5) * 0.5; data->vel.z = (rand_int(10) - 5) * 0.5;
data->scale = scale; data->scale = scale;
data->primR = data->envR = shim_rand_int(255); data->primR = data->envR = rand_int(255);
g = shim_rand_int(255 - data->envR); g = rand_int(255 - data->envR);
data->primG = data->envG = g; data->primG = data->envG = g;
data->primB = data->envB = (255 - g) - data->envR; data->primB = data->envB = (255 - g) - data->envR;
data->primR += 168; data->primR += 168;
@ -75,7 +75,7 @@ EffectInstance* breaking_junk_main(s32 arg0, f32 x, f32 y, f32 z, f32 scale, s32
data->envR = data->envR * 0.6; data->envR = data->envR * 0.6;
data->envG = data->envG * 0.6; data->envG = data->envG * 0.6;
data->envB = data->envB * 0.6; data->envB = data->envB * 0.6;
data->rot = shim_rand_int(359); data->rot = rand_int(359);
} }
return effect; return effect;
} }
@ -97,7 +97,7 @@ void breaking_junk_update(EffectInstance* effect) {
data->lifeTime++; data->lifeTime++;
if (data->timeLeft < 0) { if (data->timeLeft < 0) {
shim_remove_effect(effect); remove_effect(effect);
return; return;
} }
@ -127,7 +127,7 @@ void breaking_junk_render(EffectInstance* effect) {
renderTask.distance = 10; renderTask.distance = 10;
renderTask.renderMode = RENDER_MODE_2D; renderTask.renderMode = RENDER_MODE_2D;
retTask = shim_queue_render_task(&renderTask); retTask = queue_render_task(&renderTask);
retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR;
} }
@ -142,10 +142,10 @@ void breaking_junk_appendGfx(void* effect) {
gSPDisplayList(gMainGfxPos++, D_E01187C0[0]); gSPDisplayList(gMainGfxPos++, D_E01187C0[0]);
for (i = 0; i < ((EffectInstance*)effect)->numParts; i++, data++) { for (i = 0; i < ((EffectInstance*)effect)->numParts; i++, data++) {
shim_guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].currentYaw, 0.0f, data->scale * 0.5, data->pos.x, data->pos.y, data->pos.z); guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].currentYaw, 0.0f, data->scale * 0.5, data->pos.x, data->pos.y, data->pos.z);
shim_guRotateF(sp60, data->rot, 0.0f, 0.0f, 1.0f); guRotateF(sp60, data->rot, 0.0f, 0.0f, 1.0f);
shim_guMtxCatF(sp60, sp20, sp20); guMtxCatF(sp60, sp20, sp20);
shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gDPSetPrimColor(gMainGfxPos++, 0, 0, data->primR, data->primG, data->primB, alpha); gDPSetPrimColor(gMainGfxPos++, 0, 0, data->primR, data->primG, data->primB, alpha);
gDPSetEnvColor(gMainGfxPos++, data->envR, data->envG, data->envB, data->envA); gDPSetEnvColor(gMainGfxPos++, data->envR, data->envG, data->envB, data->envA);

View File

@ -60,9 +60,9 @@ void bulb_glow_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, EffectInst
bp.renderUI = NULL; bp.renderUI = NULL;
bp.effectID = EFFECT_BULB_GLOW; bp.effectID = EFFECT_BULB_GLOW;
effect = shim_create_effect_instance(&bp); effect = create_effect_instance(&bp);
effect->numParts = numParts; effect->numParts = numParts;
data = effect->data.bulbGlow = shim_general_heap_malloc(numParts * sizeof(*data)); data = effect->data.bulbGlow = general_heap_malloc(numParts * sizeof(*data));
ASSERT(effect->data.bulbGlow != NULL); ASSERT(effect->data.bulbGlow != NULL);
data->unk_00 = arg0 & 255; data->unk_00 = arg0 & 255;
@ -83,7 +83,7 @@ void bulb_glow_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, EffectInst
D_E00789A8 = 0; D_E00789A8 = 0;
} }
data->unk_20 = shim_rand_int(7); data->unk_20 = rand_int(7);
*outEffect = effect; *outEffect = effect;
} }
@ -105,7 +105,7 @@ void bulb_glow_update(EffectInstance* effect) {
data->unk_14--; data->unk_14--;
} }
if (data->unk_14 < 0) { if (data->unk_14 < 0) {
shim_remove_effect(effect); remove_effect(effect);
return; return;
} }
@ -144,7 +144,7 @@ void bulb_glow_render(EffectInstance* effect) {
renderTaskPtr->renderMode = RENDER_MODE_2D; renderTaskPtr->renderMode = RENDER_MODE_2D;
} }
retTask = shim_queue_render_task(renderTaskPtr); retTask = queue_render_task(renderTaskPtr);
retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR;
} }
@ -189,7 +189,7 @@ void bulb_glow_appendGfx(void* effect) {
glowExtent = temp_s1->unk_10; glowExtent = temp_s1->unk_10;
rectHeight = temp_s1->unk_14; rectHeight = temp_s1->unk_14;
isPointVisible = shim_is_point_visible(data->pos.x, data->pos.y, data->pos.z, data->unk_1C, &centerX, &centerY); isPointVisible = is_point_visible(data->pos.x, data->pos.y, data->pos.z, data->unk_1C, &centerX, &centerY);
if (temp_s2 == 5) { if (temp_s2 == 5) {
isPointVisible = TRUE; isPointVisible = TRUE;

View File

@ -43,9 +43,9 @@ EffectInstance* butterflies_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3) {
bp.renderUI = NULL; bp.renderUI = NULL;
bp.effectID = EFFECT_BUTTERFLIES; bp.effectID = EFFECT_BUTTERFLIES;
effect = shim_create_effect_instance(&bp); effect = create_effect_instance(&bp);
effect->numParts = numParts; effect->numParts = numParts;
part = effect->data.butterflies = shim_general_heap_malloc(numParts * sizeof(*part)); part = effect->data.butterflies = general_heap_malloc(numParts * sizeof(*part));
ASSERT(effect->data.butterflies != NULL); ASSERT(effect->data.butterflies != NULL);
part->unk_04 = 1000; part->unk_04 = 1000;
@ -93,7 +93,7 @@ void butterflies_update(EffectInstance* effect) {
} }
temp_s0->unk_08 += 1; temp_s0->unk_08 += 1;
if (temp_s0->unk_04 < 0) { if (temp_s0->unk_04 < 0) {
shim_remove_effect(effect); remove_effect(effect);
return; return;
} }
if (temp_s0->unk_04 < 0x10) { if (temp_s0->unk_04 < 0x10) {
@ -104,11 +104,11 @@ void butterflies_update(EffectInstance* effect) {
if (temp_s0->unk_30 <= 0) { if (temp_s0->unk_30 <= 0) {
s32 t; s32 t;
temp_f20 = shim_rand_int(359); temp_f20 = rand_int(359);
temp_f24 = temp_s0->unk_18 + (temp_s0->unk_34 * shim_sin_deg(temp_f20)); temp_f24 = temp_s0->unk_18 + (temp_s0->unk_34 * sin_deg(temp_f20));
temp_f22 = temp_s0->unk_1C + shim_rand_int(temp_s0->unk_38); temp_f22 = temp_s0->unk_1C + rand_int(temp_s0->unk_38);
temp_f20_2 = temp_s0->unk_20 + (temp_s0->unk_34 * shim_cos_deg(temp_f20)); temp_f20_2 = temp_s0->unk_20 + (temp_s0->unk_34 * cos_deg(temp_f20));
t = shim_rand_int(100) + 10; t = rand_int(100) + 10;
temp_f4 = temp_s0->unk_0C; temp_f4 = temp_s0->unk_0C;
temp_f6 = temp_s0->unk_10; temp_f6 = temp_s0->unk_10;
temp_f8 = temp_s0->unk_14; temp_f8 = temp_s0->unk_14;
@ -128,7 +128,7 @@ void butterflies_update(EffectInstance* effect) {
} }
var_f12 = SQ(var_f24) + SQ(var_f22) + SQ(var_f20); var_f12 = SQ(var_f24) + SQ(var_f22) + SQ(var_f20);
if (var_f12 != 0.0f) { if (var_f12 != 0.0f) {
var_f12 = 1.0f / shim_sqrtf(var_f12); var_f12 = 1.0f / sqrtf(var_f12);
} }
var_f24 *= var_f12; var_f24 *= var_f12;
var_f22 *= var_f12; var_f22 *= var_f12;
@ -136,7 +136,7 @@ void butterflies_update(EffectInstance* effect) {
temp_s0->unk_3C = var_f24; temp_s0->unk_3C = var_f24;
temp_s0->unk_40 = var_f22; temp_s0->unk_40 = var_f22;
temp_s0->unk_44 = var_f20; temp_s0->unk_44 = var_f20;
temp_s0->unk_28 = shim_atan2(0.0f, 0.0f, -temp_s0->unk_3C, temp_s0->unk_44); temp_s0->unk_28 = atan2(0.0f, 0.0f, -temp_s0->unk_3C, temp_s0->unk_44);
} }
temp_s0->unk_2C += 3; temp_s0->unk_2C += 3;
if (temp_s0->unk_2C >= 30) { if (temp_s0->unk_2C >= 30) {
@ -156,7 +156,7 @@ void butterflies_render(EffectInstance* effect) {
renderTask.distance = 0; renderTask.distance = 0;
renderTask.renderMode = RENDER_MODE_2D; renderTask.renderMode = RENDER_MODE_2D;
retTask = shim_queue_render_task(&renderTask); retTask = queue_render_task(&renderTask);
retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR;
} }
@ -173,12 +173,12 @@ void butterflies_appendGfx(void* effect) {
gDPPipeSync(gMainGfxPos++); gDPPipeSync(gMainGfxPos++);
gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(effectTemp->graphics->data)); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(effectTemp->graphics->data));
shim_guTranslateF(sp18, data->unk_0C, data->unk_10 + D_E00AA6EC[data->unk_2C] * 0.3f, data->unk_14); guTranslateF(sp18, data->unk_0C, data->unk_10 + D_E00AA6EC[data->unk_2C] * 0.3f, data->unk_14);
shim_guRotateF(sp58, data->unk_28, 0.0f, 1.0f, 0.0f); guRotateF(sp58, data->unk_28, 0.0f, 1.0f, 0.0f);
shim_guMtxCatF(sp58, sp18, sp18); guMtxCatF(sp58, sp18, sp18);
shim_guScaleF(sp58, 0.02f, 0.02f, 0.02f); guScaleF(sp58, 0.02f, 0.02f, 0.02f);
shim_guMtxCatF(sp58, sp18, sp18); guMtxCatF(sp58, sp18, sp18);
shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gDPSetPrimColor(gMainGfxPos++, 0, 0, primColor, primColor, primColor, 255); gDPSetPrimColor(gMainGfxPos++, 0, 0, primColor, primColor, primColor, 255);

View File

@ -105,8 +105,6 @@ void chapter_change_init(EffectInstance* effect);
void chapter_change_update(EffectInstance* effect); void chapter_change_update(EffectInstance* effect);
void chapter_change_render(EffectInstance* effect); void chapter_change_render(EffectInstance* effect);
void chapter_change_appendGfx(void* effect); void chapter_change_appendGfx(void* effect);
void shim_draw_msg(s32, s32, s32, s32, s32, s32);
s32 shim_get_msg_width(s32, u16);
void func_E010E000(ChapterChangeFXData* data, s32 arg1, UnkStruct* arg2) { void func_E010E000(ChapterChangeFXData* data, s32 arg1, UnkStruct* arg2) {
s32 unk_1C = data->lifetime; s32 unk_1C = data->lifetime;
@ -154,9 +152,9 @@ EffectInstance* chapter_change_main(s32 arg0, f32 posX, f32 posY, f32 arg3, f32
bp.renderUI = NULL; bp.renderUI = NULL;
bp.effectID = EFFECT_CHAPTER_CHANGE; bp.effectID = EFFECT_CHAPTER_CHANGE;
effect = shim_create_effect_instance(&bp); effect = create_effect_instance(&bp);
effect->numParts = numParts; effect->numParts = numParts;
data = effect->data.chapterChange = shim_general_heap_malloc(numParts * sizeof(*data)); data = effect->data.chapterChange = general_heap_malloc(numParts * sizeof(*data));
ASSERT(effect->data.chapterChange != NULL); ASSERT(effect->data.chapterChange != NULL);
data->unk_00 = arg0; data->unk_00 = arg0;
@ -186,7 +184,7 @@ EffectInstance* chapter_change_main(s32 arg0, f32 posX, f32 posY, f32 arg3, f32
if (data->unk_54 >= 0) { if (data->unk_54 >= 0) {
data->unk_40 = 160; data->unk_40 = 160;
data->unk_44 = 160; data->unk_44 = 160;
data->unk_48 = shim_get_msg_width(data->unk_54, 0); data->unk_48 = get_msg_width(data->unk_54, 0);
data->unk_4C = 24; data->unk_4C = 24;
} }
@ -211,7 +209,7 @@ void chapter_change_update(EffectInstance* effect) {
data->lifetime++; data->lifetime++;
if (data->timeLeft < 0) { if (data->timeLeft < 0) {
shim_remove_effect(effect); remove_effect(effect);
} }
} }
@ -224,7 +222,7 @@ void chapter_change_render(EffectInstance* effect) {
renderTask.distance = 10; renderTask.distance = 10;
renderTask.renderMode = RENDER_MODE_2D; renderTask.renderMode = RENDER_MODE_2D;
retTask = shim_queue_render_task(&renderTask); retTask = queue_render_task(&renderTask);
retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR;
} }
@ -287,7 +285,7 @@ void chapter_change_appendGfx(void* effect) {
func_E010E000(data, 1, ptr1); func_E010E000(data, 1, ptr1);
if (data->unk_54 >= 0) { if (data->unk_54 >= 0) {
shim_draw_msg(data->unk_54, data->unk_40 - data->unk_48, data->unk_44, 255, 21, 0); draw_msg(data->unk_54, data->unk_40 - data->unk_48, data->unk_44, 255, 21, 0);
} }
gDPPipeSync(gMainGfxPos++); gDPPipeSync(gMainGfxPos++);

View File

@ -25,9 +25,9 @@ EffectInstance* chomp_drop_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4
bp.renderUI = NULL; bp.renderUI = NULL;
bp.effectID = EFFECT_CHOMP_DROP; bp.effectID = EFFECT_CHOMP_DROP;
effect = shim_create_effect_instance(&bp); effect = create_effect_instance(&bp);
effect->numParts = numParts; effect->numParts = numParts;
data = effect->data.chompDrop = shim_general_heap_malloc(numParts * sizeof(*data)); data = effect->data.chompDrop = general_heap_malloc(numParts * sizeof(*data));
ASSERT(effect->data.chompDrop != NULL); ASSERT(effect->data.chompDrop != NULL);
data->unk_00 = arg0; data->unk_00 = arg0;
@ -40,7 +40,7 @@ EffectInstance* chomp_drop_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4
data->unk_18 = arg6; data->unk_18 = arg6;
data->unk_34 = 1.0f; data->unk_34 = 1.0f;
data->unk_20 = arg7; data->unk_20 = arg7;
data->unk_38 = shim_rand_int(0x168); data->unk_38 = rand_int(0x168);
data->unk_40 = arg9; data->unk_40 = arg9;
data->unk_44 = 0; data->unk_44 = 0;
data->unk_3C = arg5; data->unk_3C = arg5;
@ -61,7 +61,7 @@ void chomp_drop_update(EffectInstance* effect) {
data->unk_40--; data->unk_40--;
data->unk_44++; data->unk_44++;
if (data->unk_40 < 0) { if (data->unk_40 < 0) {
shim_remove_effect(effect); remove_effect(effect);
return; return;
} }
@ -96,7 +96,7 @@ void chomp_drop_update(EffectInstance* effect) {
data->unk_08 += data->unk_10; data->unk_08 += data->unk_10;
if (data->unk_08 < 0.0f) { if (data->unk_08 < 0.0f) {
data->unk_08 = 0.0f; data->unk_08 = 0.0f;
shim_load_effect(EFFECT_DUST); load_effect(EFFECT_DUST);
dust_main(2, data->unk_04 + 5.0f, data->unk_08, data->unk_0C, 30); dust_main(2, data->unk_04 + 5.0f, data->unk_08, data->unk_0C, 30);
dust_main(2, data->unk_04 - 5.0f, data->unk_08, data->unk_0C, 30); dust_main(2, data->unk_04 - 5.0f, data->unk_08, data->unk_0C, 30);
data->unk_2C = 4; data->unk_2C = 4;
@ -127,7 +127,7 @@ void chomp_drop_render(EffectInstance* effect) {
renderTask.distance = -10; renderTask.distance = -10;
renderTask.renderMode = RENDER_MODE_SURFACE_XLU_LAYER1; renderTask.renderMode = RENDER_MODE_SURFACE_XLU_LAYER1;
retTask = shim_queue_render_task(&renderTask); retTask = queue_render_task(&renderTask);
retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR;
} }
@ -146,17 +146,17 @@ void chomp_drop_appendGfx(void* effect) {
gDPPipeSync(gMainGfxPos++); gDPPipeSync(gMainGfxPos++);
gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effectTemp)->graphics->data)); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effectTemp)->graphics->data));
shim_guScaleF(sp20, 0.01f, 0.01f, 0.01f); guScaleF(sp20, 0.01f, 0.01f, 0.01f);
shim_guPositionF(sp60, 0.0f, 0.0f, 0.0f, data->unk_24, data->unk_04 * 100.0f, data->unk_08 * 100.0f, data->unk_0C * 100.0f); guPositionF(sp60, 0.0f, 0.0f, 0.0f, data->unk_24, data->unk_04 * 100.0f, data->unk_08 * 100.0f, data->unk_0C * 100.0f);
shim_guMtxCatF(sp60, sp20, sp20); guMtxCatF(sp60, sp20, sp20);
shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++],
G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gDPSetPrimColor( gDPSetPrimColor(
gMainGfxPos++, 0, 0, gMainGfxPos++, 0, 0,
(shim_sin_deg(temp_s6 * 30) * 25.0f) + 225.0f, (sin_deg(temp_s6 * 30) * 25.0f) + 225.0f,
(shim_sin_deg(temp_s6 * 30) * 25.0f) + 225.0f, (sin_deg(temp_s6 * 30) * 25.0f) + 225.0f,
255, 255,
primA primA
); );
@ -181,8 +181,8 @@ void chomp_drop_appendGfx(void* effect) {
for (i = 0; i < 16; i++) { for (i = 0; i < 16; i++) {
Vtx_t* vtx = &vtxTemp[i * 2]; Vtx_t* vtx = &vtxTemp[i * 2];
s32 temp_s1 = shim_sin_deg(((temp_s6 * 10) + (i * 60)) + temp_s7) * 500.0f * temp_f22; s32 temp_s1 = sin_deg(((temp_s6 * 10) + (i * 60)) + temp_s7) * 500.0f * temp_f22;
s32 temp_v0_3 = (i * 400) + (s32) (shim_sin_deg(((temp_s6 * 10) + (i * 6)) + temp_s7) * 200.0f * temp_f22); s32 temp_v0_3 = (i * 400) + (s32) (sin_deg(((temp_s6 * 10) + (i * 6)) + temp_s7) * 200.0f * temp_f22);
vtx->ob[0] = temp_s1 - 3200; vtx->ob[0] = temp_s1 - 3200;
vtx->ob[1] = temp_v0_3; vtx->ob[1] = temp_v0_3;

View File

@ -24,13 +24,13 @@ void cloud_puff_main(f32 arg0, f32 arg1, f32 arg2, f32 arg3) {
bp.renderUI = NULL; bp.renderUI = NULL;
bp.effectID = EFFECT_CLOUD_PUFF; bp.effectID = EFFECT_CLOUD_PUFF;
effect = shim_create_effect_instance(&bp); effect = create_effect_instance(&bp);
effect->numParts = numParts; effect->numParts = numParts;
part = shim_general_heap_malloc(numParts * sizeof(*part)); part = general_heap_malloc(numParts * sizeof(*part));
effect->data.cloudPuff = part; effect->data.cloudPuff = part;
ASSERT(effect->data.cloudPuff != NULL); ASSERT(effect->data.cloudPuff != NULL);
shim_mem_clear(part, numParts * sizeof(*part)); mem_clear(part, numParts * sizeof(*part));
for (i = 0; i < numParts; i++, part++) { for (i = 0; i < numParts; i++, part++) {
part->alive = TRUE; part->alive = TRUE;
@ -42,17 +42,17 @@ void cloud_puff_main(f32 arg0, f32 arg1, f32 arg2, f32 arg3) {
part->unk_1C = 1.0f; part->unk_1C = 1.0f;
part->unk_20 = 1.0f; part->unk_20 = 1.0f;
part->alpha = 255; part->alpha = 255;
part->unk_24 = (shim_rand_int(10) * 0.03) + 1.0; part->unk_24 = (rand_int(10) * 0.03) + 1.0;
part->unk_28 = (shim_rand_int(10) * 0.03) + 1.7; part->unk_28 = (rand_int(10) * 0.03) + 1.7;
part->unk_2C = effect_rand_int(60); part->unk_2C = effect_rand_int(60);
part->timeLeft = 30; part->timeLeft = 30;
part->unk_34 = 0.5f; part->unk_34 = 0.5f;
part->unk_38 = -0.02f; part->unk_38 = -0.02f;
part->unk_3C = 0.00005f; part->unk_3C = 0.00005f;
part->unk_30 = -3.9f; part->unk_30 = -3.9f;
temp_f20 = shim_clamp_angle(arg3 + i * 45); temp_f20 = clamp_angle(arg3 + i * 45);
part->unk_44 = shim_sin_deg(temp_f20); part->unk_44 = sin_deg(temp_f20);
part->unk_48 = shim_cos_deg(temp_f20); part->unk_48 = cos_deg(temp_f20);
} }
} }
@ -71,9 +71,9 @@ void cloud_puff_update(EffectInstance* effect) {
part->alive = FALSE; part->alive = FALSE;
} else { } else {
cond = TRUE; cond = TRUE;
part->unk_2C = shim_clamp_angle(part->unk_2C + 12.0f); part->unk_2C = clamp_angle(part->unk_2C + 12.0f);
part->unk_18 = part->unk_24 + shim_sin_deg(part->unk_2C) * 0.1; part->unk_18 = part->unk_24 + sin_deg(part->unk_2C) * 0.1;
part->unk_1C = part->unk_28 + shim_cos_deg(part->unk_2C) * 0.1; part->unk_1C = part->unk_28 + cos_deg(part->unk_2C) * 0.1;
part->unk_30 *= 0.83; part->unk_30 *= 0.83;
part->unk_0C += part->unk_30 * part->unk_44; part->unk_0C += part->unk_30 * part->unk_44;
part->unk_14 += part->unk_30 * part->unk_48; part->unk_14 += part->unk_30 * part->unk_48;
@ -95,7 +95,7 @@ void cloud_puff_update(EffectInstance* effect) {
} }
if (!cond) { if (!cond) {
shim_remove_effect(effect); remove_effect(effect);
} }
} }
@ -108,7 +108,7 @@ void cloud_puff_render(EffectInstance* effect) {
renderTask.distance = 0; renderTask.distance = 0;
renderTask.renderMode = RENDER_MODE_28; renderTask.renderMode = RENDER_MODE_28;
retTask = shim_queue_render_task(&renderTask); retTask = queue_render_task(&renderTask);
retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR;
} }
@ -125,11 +125,11 @@ void cloud_puff_appendGfx(void* effect) {
for (i = 0; i < effectTemp->numParts; i++, part++) { for (i = 0; i < effectTemp->numParts; i++, part++) {
if (part->alive) { if (part->alive) {
shim_guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f,
part->unk_0C, part->unk_10, part->unk_14); part->unk_0C, part->unk_10, part->unk_14);
shim_guScaleF(sp60, part->unk_18, part->unk_1C, part->unk_20); guScaleF(sp60, part->unk_18, part->unk_1C, part->unk_20);
shim_guMtxCatF(sp60, sp20, sp20); guMtxCatF(sp60, sp20, sp20);
shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]);
gDPSetPrimColor(gMainGfxPos++, 0, 0, 112, 96, 24, part->alpha); gDPSetPrimColor(gMainGfxPos++, 0, 0, 112, 96, 24, part->alpha);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++],

View File

@ -23,14 +23,14 @@ void cloud_trail_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3) {
bp.renderUI = NULL; bp.renderUI = NULL;
bp.effectID = EFFECT_CLOUD_TRAIL; bp.effectID = EFFECT_CLOUD_TRAIL;
effect = shim_create_effect_instance(&bp); effect = create_effect_instance(&bp);
effect->numParts = 1; effect->numParts = 1;
part = shim_general_heap_malloc(numParts * sizeof(*part)); part = general_heap_malloc(numParts * sizeof(*part));
effect->data.cloudTrail = part; effect->data.cloudTrail = part;
ASSERT(effect->data.cloudTrail != NULL); ASSERT(effect->data.cloudTrail != NULL);
shim_mem_clear(part, numParts * sizeof(*part)); mem_clear(part, numParts * sizeof(*part));
for (i = 0; i < numParts; i++, part++) { for (i = 0; i < numParts; i++, part++) {
part->alive = 1; part->alive = 1;
@ -44,8 +44,8 @@ void cloud_trail_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3) {
part->unk_20 = 1.0f; part->unk_20 = 1.0f;
part->unk_24 = 1.0f; part->unk_24 = 1.0f;
part->alpha = -1; part->alpha = -1;
part->unk_28 = (shim_rand_int(10) * 0.03) + 1.4; part->unk_28 = (rand_int(10) * 0.03) + 1.4;
part->unk_2C = (shim_rand_int(10) * 0.03) + 1.5; part->unk_2C = (rand_int(10) * 0.03) + 1.5;
part->unk_30 = effect_rand_int(60); part->unk_30 = effect_rand_int(60);
part->unk_04 = arg0; part->unk_04 = arg0;
part->lifetime = 15; part->lifetime = 15;
@ -71,9 +71,9 @@ void cloud_trail_update(EffectInstance* effect) {
part->alive = FALSE; part->alive = FALSE;
} else { } else {
cond = TRUE; cond = TRUE;
part->unk_30 = shim_clamp_angle(part->unk_30 + 12.0f); part->unk_30 = clamp_angle(part->unk_30 + 12.0f);
part->unk_1C = part->unk_28 + shim_sin_deg(part->unk_30) * 0.1; part->unk_1C = part->unk_28 + sin_deg(part->unk_30) * 0.1;
part->unk_20 = part->unk_2C + shim_cos_deg(part->unk_30) * 0.1; part->unk_20 = part->unk_2C + cos_deg(part->unk_30) * 0.1;
if (part->unk_04 == 0 && (part->lifetime == 5 && gPlayerStatus.actionState == ACTION_STATE_IDLE)) { if (part->unk_04 == 0 && (part->lifetime == 5 && gPlayerStatus.actionState == ACTION_STATE_IDLE)) {
part->lifetime++; part->lifetime++;
@ -96,7 +96,7 @@ void cloud_trail_update(EffectInstance* effect) {
} }
if (!cond) { if (!cond) {
shim_remove_effect(effect); remove_effect(effect);
} }
} }
@ -109,7 +109,7 @@ void cloud_trail_render(EffectInstance* effect) {
renderTask.distance = 0; renderTask.distance = 0;
renderTask.renderMode = RENDER_MODE_28; renderTask.renderMode = RENDER_MODE_28;
retTask = shim_queue_render_task(&renderTask); retTask = queue_render_task(&renderTask);
retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR;
} }
@ -126,13 +126,13 @@ void cloud_trail_appendGfx(void* effect) {
for (i = 0; i < effectTemp->numParts; i++, part++) { for (i = 0; i < effectTemp->numParts; i++, part++) {
if (part->alive) { if (part->alive) {
shim_guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f,
part->unk_0C, part->unk_10, part->unk_14); part->unk_0C, part->unk_10, part->unk_14);
shim_guScaleF(sp60, part->unk_1C, part->unk_20, part->unk_24); guScaleF(sp60, part->unk_1C, part->unk_20, part->unk_24);
shim_guMtxCatF(sp60, sp20, sp20); guMtxCatF(sp60, sp20, sp20);
shim_guRotateF(sp60, part->unk_18, 0.0f, 0.0f, 1.0f); guRotateF(sp60, part->unk_18, 0.0f, 0.0f, 1.0f);
shim_guMtxCatF(sp60, sp20, sp20); guMtxCatF(sp60, sp20, sp20);
shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]);
gDPSetPrimColor(gMainGfxPos++, 0, 0, 112, 96, 24, part->alpha); gDPSetPrimColor(gMainGfxPos++, 0, 0, 112, 96, 24, part->alpha);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++],

View File

@ -89,9 +89,9 @@ EffectInstance* cold_breath_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg
bp.renderUI = NULL; bp.renderUI = NULL;
bp.effectID = EFFECT_COLD_BREATH; bp.effectID = EFFECT_COLD_BREATH;
effect = shim_create_effect_instance(&bp); effect = create_effect_instance(&bp);
effect->numParts = numParts; effect->numParts = numParts;
data = effect->data.coldBreath = shim_general_heap_malloc(numParts * sizeof(*data)); data = effect->data.coldBreath = general_heap_malloc(numParts * sizeof(*data));
ASSERT(effect->data.coldBreath != NULL); ASSERT(effect->data.coldBreath != NULL);
data->unk_00 = arg0; data->unk_00 = arg0;
@ -138,7 +138,7 @@ void cold_breath_update(EffectInstance* effect) {
data->unk_14++; data->unk_14++;
if (data->unk_10 < 0) { if (data->unk_10 < 0) {
shim_remove_effect(effect); remove_effect(effect);
return; return;
} }
if (data->unk_10 < 16) { if (data->unk_10 < 16) {
@ -172,7 +172,7 @@ void cold_breath_render(EffectInstance* effect) {
renderTask.distance = 6; renderTask.distance = 6;
renderTask.renderMode = RENDER_MODE_2D; renderTask.renderMode = RENDER_MODE_2D;
retTask = shim_queue_render_task(&renderTask); retTask = queue_render_task(&renderTask);
retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR;
} }
@ -196,10 +196,10 @@ void cold_breath_appendGfx(void* effect) {
gDPPipeSync(gMainGfxPos++); gDPPipeSync(gMainGfxPos++);
gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data));
shim_guTranslateF(sp20, data->unk_04, data->unk_08, data->unk_0C); guTranslateF(sp20, data->unk_04, data->unk_08, data->unk_0C);
shim_guScaleF(sp60, data->unk_40, data->unk_40, data->unk_40); guScaleF(sp60, data->unk_40, data->unk_40, data->unk_40);
shim_guMtxCatF(sp60, sp20, sp20); guMtxCatF(sp60, sp20, sp20);
shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPMatrix(gMainGfxPos++, camera->unkMatrix, G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, camera->unkMatrix, G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW);
@ -212,8 +212,8 @@ void cold_breath_appendGfx(void* effect) {
temp2 = D_E00DE8B4[unkIndex]; temp2 = D_E00DE8B4[unkIndex];
temp3 = D_E00DE858[unkIndex]; temp3 = D_E00DE858[unkIndex];
shim_guPositionF(sp20, 0.0f, 0.0f, -temp1, temp2 * 0.01f, temp3, 0.0f, 0.0f); guPositionF(sp20, 0.0f, 0.0f, -temp1, temp2 * 0.01f, temp3, 0.0f, 0.0f);
shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
temp_f32 = D_E00DE910[unkIndex] * 5.0f / 256.0f; temp_f32 = D_E00DE910[unkIndex] * 5.0f / 256.0f;

View File

@ -35,12 +35,12 @@ u8 D_E0088D00[] = { 0, 1, 2, 3, 2, 1, 0, 0 };
u8 D_E0088D08[] = { 0, 45, 0, 60 }; u8 D_E0088D08[] = { 0, 45, 0, 60 };
void func_E0088000(ConfettiFXData* part) { void func_E0088000(ConfettiFXData* part) {
part->unk_04 = shim_rand_int(700) * 0.1f - 35.0f; part->unk_04 = rand_int(700) * 0.1f - 35.0f;
part->unk_08 = 0; part->unk_08 = 0;
part->unk_0C = shim_rand_int(300) * 0.1f - 15.0f; part->unk_0C = rand_int(300) * 0.1f - 15.0f;
part->unk_10 = (part->unk_04 + shim_rand_int(100) * 0.1f - 5.0f) * 0.03; part->unk_10 = (part->unk_04 + rand_int(100) * 0.1f - 5.0f) * 0.03;
part->unk_14 = -1.7 - shim_rand_int(800) * 0.1f * 0.01; part->unk_14 = -1.7 - rand_int(800) * 0.1f * 0.01;
part->unk_18 = (shim_rand_int(200) * 0.1f - 10.0f) * 0.05; part->unk_18 = (rand_int(200) * 0.1f - 10.0f) * 0.05;
part->unk_20 = 120; part->unk_20 = 120;
} }
@ -108,9 +108,9 @@ EffectInstance* confetti_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4,
bpPtr->renderUI = NULL; bpPtr->renderUI = NULL;
bpPtr->effectID = EFFECT_CONFETTI; bpPtr->effectID = EFFECT_CONFETTI;
effect = shim_create_effect_instance(bpPtr); effect = create_effect_instance(bpPtr);
effect->numParts = numParts; effect->numParts = numParts;
data = effect->data.confetti = (ConfettiFXData*)shim_general_heap_malloc(numParts * sizeof(*data)); data = effect->data.confetti = (ConfettiFXData*)general_heap_malloc(numParts * sizeof(*data));
ASSERT(effect->data.confetti != NULL); ASSERT(effect->data.confetti != NULL);
data->unk_04 = arg1; data->unk_04 = arg1;
@ -123,7 +123,7 @@ EffectInstance* confetti_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4,
data->unk_28 = 255; data->unk_28 = 255;
data++; data++;
temp_fp = shim_rand_int(360); temp_fp = rand_int(360);
for (i = 0; i < np; i++, data++) { for (i = 0; i < np; i++, data++) {
temp_f30 = sp28 * (effect_rand_int(100) * 0.01f); temp_f30 = sp28 * (effect_rand_int(100) * 0.01f);
@ -147,10 +147,10 @@ EffectInstance* confetti_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4,
data->unk_00 = arg0; data->unk_00 = arg0;
sinTheta = shim_sin_deg(theta); sinTheta = sin_deg(theta);
cosTheta = shim_cos_deg(theta); cosTheta = cos_deg(theta);
sinTheta2 = shim_sin_deg(theta2); sinTheta2 = sin_deg(theta2);
cosTheta2 = shim_cos_deg(theta2); cosTheta2 = cos_deg(theta2);
if (arg0 == 3) { if (arg0 == 3) {
func_E0088000(data); func_E0088000(data);
data->unk_30 = i * 3; data->unk_30 = i * 3;
@ -184,7 +184,7 @@ void confetti_update(EffectInstance* effect) {
part->unk_20--; part->unk_20--;
if (part->unk_20 < 0) { if (part->unk_20 < 0) {
shim_remove_effect(effect); remove_effect(effect);
return; return;
} }
@ -241,7 +241,7 @@ void confetti_render(EffectInstance* effect) {
renderTask.distance = 0; renderTask.distance = 0;
renderTask.renderMode = RENDER_MODE_2D; renderTask.renderMode = RENDER_MODE_2D;
retTask = shim_queue_render_task(&renderTask); retTask = queue_render_task(&renderTask);
} }
void confetti_appendGfx(void* effect) { void confetti_appendGfx(void* effect) {
@ -270,10 +270,10 @@ void confetti_appendGfx(void* effect) {
gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data));
gSPDisplayList(gMainGfxPos++, D_09000940_38C4E0); gSPDisplayList(gMainGfxPos++, D_09000940_38C4E0);
shim_guTranslateF(sp18, part->unk_04, part->unk_08, part->unk_0C); guTranslateF(sp18, part->unk_04, part->unk_08, part->unk_0C);
shim_guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f);
shim_guMtxCatF(sp58, sp18, sp18); guMtxCatF(sp58, sp18, sp18);
shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
savedGfxPos = gMainGfxPos++; savedGfxPos = gMainGfxPos++;
@ -283,8 +283,8 @@ void confetti_appendGfx(void* effect) {
color = &D_E0088CDC[i % 12]; color = &D_E0088CDC[i % 12];
if (part->unk_30 <= 0) { if (part->unk_30 <= 0) {
shim_guTranslateF(sp18, part->unk_04, part->unk_08, part->unk_0C); guTranslateF(sp18, part->unk_04, part->unk_08, part->unk_0C);
shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]);
gDPSetPrimColor(gMainGfxPos++, 0, 0, color->r, color->g, color->b, unk_28); gDPSetPrimColor(gMainGfxPos++, 0, 0, color->r, color->g, color->b, unk_28);

View File

@ -94,10 +94,10 @@ void damage_indicator_main(s32 arg0, f32 posX, f32 posY, f32 posZ, f32 starsRadi
bp.unk_00 = 0; bp.unk_00 = 0;
bp.effectID = EFFECT_DAMAGE_INDICATOR; bp.effectID = EFFECT_DAMAGE_INDICATOR;
effect = shim_create_effect_instance(bpPtr); effect = create_effect_instance(bpPtr);
effect->numParts = damageAmt; effect->numParts = damageAmt;
effect->data.damageIndicator = part = shim_general_heap_malloc(damageAmt * sizeof(*part)); effect->data.damageIndicator = part = general_heap_malloc(damageAmt * sizeof(*part));
ASSERT(effect->data.damageIndicator != NULL); ASSERT(effect->data.damageIndicator != NULL);
part->unk_00 = arg0; part->unk_00 = arg0;
@ -119,8 +119,8 @@ void damage_indicator_main(s32 arg0, f32 posX, f32 posY, f32 posZ, f32 starsRadi
part->curPos.z = part->basePos.z; part->curPos.z = part->basePos.z;
angle = starsAngle + (((s32) ((((i % 2) * 2) - 1) * i) / 2) * (30.0f - damageAmt)); angle = starsAngle + (((s32) ((((i % 2) * 2) - 1) * i) / 2) * (30.0f - damageAmt));
part->scale = 0.2f; part->scale = 0.2f;
part->relPos.x = -shim_sin_deg(angle) * starsRadius * 1.5; part->relPos.x = -sin_deg(angle) * starsRadius * 1.5;
part->relPos.y = shim_cos_deg(angle) * starsRadius * 1.5; part->relPos.y = cos_deg(angle) * starsRadius * 1.5;
part->relPos.z = 0; part->relPos.z = 0;
part->alpha = 255; part->alpha = 255;
} }
@ -147,7 +147,7 @@ void damage_indicator_update(EffectInstance* effect) {
timeLeft = part->timeLeft; timeLeft = part->timeLeft;
if (timeLeft < 0) { if (timeLeft < 0) {
shim_remove_effect(effect); remove_effect(effect);
return; return;
} }
@ -204,10 +204,10 @@ void damage_indicator_render_impl(EffectInstance* effect) {
gDPPipeSync(gMainGfxPos++); gDPPipeSync(gMainGfxPos++);
gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(effect->graphics->data)); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(effect->graphics->data));
shim_guTranslateF(mtxTransform, part->basePos.x, part->basePos.y, part->basePos.z); guTranslateF(mtxTransform, part->basePos.x, part->basePos.y, part->basePos.z);
shim_guRotateF(mtxTemp, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); guRotateF(mtxTemp, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f);
shim_guMtxCatF(mtxTemp, mtxTransform, mtxTransform); guMtxCatF(mtxTemp, mtxTransform, mtxTransform);
shim_guMtxF2L(mtxTransform, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(mtxTransform, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
@ -230,18 +230,18 @@ void damage_indicator_render_impl(EffectInstance* effect) {
gSPDisplayList(gMainGfxPos++, D_09001D40_351F60); gSPDisplayList(gMainGfxPos++, D_09001D40_351F60);
if (i == lastPartIdx) { if (i == lastPartIdx) {
shim_guPositionF(mtxTransform, 0.0f, 0.0f, 0.0f, part->scale, part->curPos.x, part->curPos.y, part->curPos.z); guPositionF(mtxTransform, 0.0f, 0.0f, 0.0f, part->scale, part->curPos.x, part->curPos.y, part->curPos.z);
shim_guMtxF2L(mtxTransform, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(mtxTransform, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
gSPDisplayList(gMainGfxPos++, D_09002150_352370); gSPDisplayList(gMainGfxPos++, D_09002150_352370);
gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW); gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
shim_guPositionF(mtxTransform, 0.0f, 0.0f, 0.0f, part->scale, guPositionF(mtxTransform, 0.0f, 0.0f, 0.0f, part->scale,
(part->curPos.x + part->basePos.x) * 0.5, (part->curPos.x + part->basePos.x) * 0.5,
(part->curPos.y + part->basePos.y) * 0.5, (part->curPos.y + part->basePos.y) * 0.5,
(part->curPos.z + part->basePos.z) * 0.5); (part->curPos.z + part->basePos.z) * 0.5);
shim_guMtxF2L(mtxTransform, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(mtxTransform, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
gSPDisplayList(gMainGfxPos++, D_09002160_352380); gSPDisplayList(gMainGfxPos++, D_09002160_352380);
@ -250,13 +250,13 @@ void damage_indicator_render_impl(EffectInstance* effect) {
gSPDisplayList(gMainGfxPos++, D_09001D40_351F60); gSPDisplayList(gMainGfxPos++, D_09001D40_351F60);
shim_guTranslateF(mtxTransform, part->basePos.x, part->basePos.y, part->basePos.z); guTranslateF(mtxTransform, part->basePos.x, part->basePos.y, part->basePos.z);
shim_guMtxF2L(mtxTransform, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(mtxTransform, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
shim_guScaleF(mtxTransform, part->scale, part->scale, 1.0f); guScaleF(mtxTransform, part->scale, part->scale, 1.0f);
shim_guMtxF2L(mtxTransform, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(mtxTransform, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);

View File

@ -52,7 +52,7 @@ void damage_stars_main(
if (arg7 != 0) { if (arg7 != 0) {
temp_f12 = SQ(arg4) + SQ(arg5) + SQ(arg6); temp_f12 = SQ(arg4) + SQ(arg5) + SQ(arg6);
if (temp_f12 != 0.0f) { if (temp_f12 != 0.0f) {
temp_f12 = -1.0f / shim_sqrtf(temp_f12); temp_f12 = -1.0f / sqrtf(temp_f12);
arg4 *= temp_f12; arg4 *= temp_f12;
arg5 *= temp_f12; arg5 *= temp_f12;
@ -74,7 +74,7 @@ void damage_stars_main(
temp_f12 = SQ(var_f30) + SQ(sp70) + SQ(var_f28); temp_f12 = SQ(var_f30) + SQ(sp70) + SQ(var_f28);
if (temp_f12 != 0) { if (temp_f12 != 0) {
temp_f12 = 1.0f / shim_sqrtf(temp_f12); temp_f12 = 1.0f / sqrtf(temp_f12);
var_f30 *= temp_f12; var_f30 *= temp_f12;
sp70 *= temp_f12; sp70 *= temp_f12;
@ -94,9 +94,9 @@ void damage_stars_main(
bpPtr->renderUI = NULL; bpPtr->renderUI = NULL;
bpPtr->effectID = EFFECT_DAMAGE_STARS; bpPtr->effectID = EFFECT_DAMAGE_STARS;
effect = shim_create_effect_instance(bpPtr); effect = create_effect_instance(bpPtr);
effect->numParts = arg7; effect->numParts = arg7;
part = effect->data.damageStars = shim_general_heap_malloc(arg7 * sizeof(*part)); part = effect->data.damageStars = general_heap_malloc(arg7 * sizeof(*part));
ASSERT(effect->data.damageStars != NULL); ASSERT(effect->data.damageStars != NULL);
for (i = 0; i < arg7; i++, part++) { for (i = 0; i < arg7; i++, part++) {
@ -109,15 +109,15 @@ void damage_stars_main(
case 0: case 0:
case 1: case 1:
case 2: case 2:
shim_guRotateF(sp30, (i * 360) / (arg7 - 1), arg4, arg5, arg6); guRotateF(sp30, (i * 360) / (arg7 - 1), arg4, arg5, arg6);
part->unk_10 = arg4 + sp30[0][0] * var_f30 + sp30[1][0] * sp70 + sp30[2][0] * var_f28; part->unk_10 = arg4 + sp30[0][0] * var_f30 + sp30[1][0] * sp70 + sp30[2][0] * var_f28;
part->unk_14 = arg5 + sp30[0][1] * var_f30 + sp30[1][1] * sp70 + sp30[2][1] * var_f28; part->unk_14 = arg5 + sp30[0][1] * var_f30 + sp30[1][1] * sp70 + sp30[2][1] * var_f28;
part->unk_18 = arg6 + sp30[0][2] * var_f30 + sp30[1][2] * sp70 + sp30[2][2] * var_f28; part->unk_18 = arg6 + sp30[0][2] * var_f30 + sp30[1][2] * sp70 + sp30[2][2] * var_f28;
break; break;
case 3: case 3:
rotateX = shim_sin_deg(gCameras[gCurrentCameraID].currentYaw); rotateX = sin_deg(gCameras[gCurrentCameraID].currentYaw);
rotateZ = -shim_cos_deg(gCameras[gCurrentCameraID].currentYaw); rotateZ = -cos_deg(gCameras[gCurrentCameraID].currentYaw);
shim_guRotateF(sp30, guRotateF(sp30,
(arg7 != 1) ? (i * 100) / (arg7 - 1) - 50 : 0.0f, (arg7 != 1) ? (i * 100) / (arg7 - 1) - 50 : 0.0f,
rotateX, 0.0f, rotateZ); rotateX, 0.0f, rotateZ);
part->unk_10 = sp30[0][0] * arg4 + sp30[1][0] * arg5 + sp30[2][0] * arg6; part->unk_10 = sp30[0][0] * arg4 + sp30[1][0] * arg5 + sp30[2][0] * arg6;
@ -125,9 +125,9 @@ void damage_stars_main(
part->unk_18 = sp30[0][2] * arg4 + sp30[1][2] * arg5 + sp30[2][2] * arg6; part->unk_18 = sp30[0][2] * arg4 + sp30[1][2] * arg5 + sp30[2][2] * arg6;
break; break;
case 4: case 4:
rotateX = shim_sin_deg(gCameras[gCurrentCameraID].currentYaw); rotateX = sin_deg(gCameras[gCurrentCameraID].currentYaw);
rotateZ = -shim_cos_deg(gCameras[gCurrentCameraID].currentYaw); rotateZ = -cos_deg(gCameras[gCurrentCameraID].currentYaw);
shim_guRotateF(sp30, (i * 360.0f) / (arg7 - 1), rotateX, 0.0f, rotateZ); guRotateF(sp30, (i * 360.0f) / (arg7 - 1), rotateX, 0.0f, rotateZ);
part->unk_10 = sp30[0][0] * arg4 + sp30[1][0] * arg5 + sp30[2][0] * arg6; part->unk_10 = sp30[0][0] * arg4 + sp30[1][0] * arg5 + sp30[2][0] * arg6;
part->unk_14 = sp30[0][1] * arg4 + sp30[1][1] * arg5 + sp30[2][1] * arg6; part->unk_14 = sp30[0][1] * arg4 + sp30[1][1] * arg5 + sp30[2][1] * arg6;
part->unk_18 = sp30[0][2] * arg4 + sp30[1][2] * arg5 + sp30[2][2] * arg6; part->unk_18 = sp30[0][2] * arg4 + sp30[1][2] * arg5 + sp30[2][2] * arg6;
@ -184,7 +184,7 @@ void damage_stars_update(EffectInstance* effect) {
part->unk_2C++; part->unk_2C++;
if (part->unk_28 < 0) { if (part->unk_28 < 0) {
shim_remove_effect(effect); remove_effect(effect);
return; return;
} }
@ -193,7 +193,7 @@ void damage_stars_update(EffectInstance* effect) {
for (i = 0; i < effect->numParts; i++, part++) { for (i = 0; i < effect->numParts; i++, part++) {
if (part->unk_00 == 2) { if (part->unk_00 == 2) {
part->unk_14 = shim_cos_deg(unk_2C * 6) * 4.0f; part->unk_14 = cos_deg(unk_2C * 6) * 4.0f;
part->unk_10 *= 0.94; part->unk_10 *= 0.94;
part->unk_18 *= 0.94; part->unk_18 *= 0.94;
if (part->unk_14 < 0.0f) { if (part->unk_14 < 0.0f) {
@ -235,7 +235,7 @@ void damage_stars_render(EffectInstance* effect) {
renderTask.distance = 0; renderTask.distance = 0;
renderTask.renderMode = RENDER_MODE_2D; renderTask.renderMode = RENDER_MODE_2D;
retTask = shim_queue_render_task(&renderTask); retTask = queue_render_task(&renderTask);
retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR;
} }
@ -259,15 +259,15 @@ void damage_stars_appendGfx(void* effect) {
s32 bIdx = baseIdx + 2 + i * 3; s32 bIdx = baseIdx + 2 + i * 3;
gDPSetPrimColor(gMainGfxPos++, 0, 0, D_E0030E90[rIdx % 36], D_E0030E90[gIdx % 36], D_E0030E90[bIdx % 36], part->unk_24); gDPSetPrimColor(gMainGfxPos++, 0, 0, D_E0030E90[rIdx % 36], D_E0030E90[gIdx % 36], D_E0030E90[bIdx % 36], part->unk_24);
shim_guTranslateF(sp18, part->unk_04, part->unk_08, part->unk_0C); guTranslateF(sp18, part->unk_04, part->unk_08, part->unk_0C);
shim_guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f);
shim_guMtxCatF(sp58, sp18, sp18); guMtxCatF(sp58, sp18, sp18);
shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
shim_guRotateF(sp18, part->unk_1C, 0.0f, 0.0f, 1.0f); guRotateF(sp18, part->unk_1C, 0.0f, 0.0f, 1.0f);
shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
gSPDisplayList(gMainGfxPos++, D_090005E0_343620); gSPDisplayList(gMainGfxPos++, D_090005E0_343620);

View File

@ -26,14 +26,14 @@ EffectInstance* debuff_main(s32 type, f32 x, f32 y, f32 z) {
bp.renderUI = NULL; bp.renderUI = NULL;
bp.effectID = EFFECT_DEBUFF; bp.effectID = EFFECT_DEBUFF;
effect = shim_create_effect_instance(&bp); effect = create_effect_instance(&bp);
effect->numParts = numParts; effect->numParts = numParts;
effect->data.debuff = data = shim_general_heap_malloc(numParts * sizeof(*data)); effect->data.debuff = data = general_heap_malloc(numParts * sizeof(*data));
ASSERT(data != NULL); ASSERT(data != NULL);
shim_mem_clear(data, numParts * sizeof(*data)); mem_clear(data, numParts * sizeof(*data));
data->timeLeft = 30; data->timeLeft = 30;
data->lifetime = 0; data->lifetime = 0;
@ -64,8 +64,8 @@ EffectInstance* debuff_main(s32 type, f32 x, f32 y, f32 z) {
s32 angle = ((i - 1) * 360) / (numParts - 1); s32 angle = ((i - 1) * 360) / (numParts - 1);
f32 temp2 = 1.0f; f32 temp2 = 1.0f;
data->pos.x = shim_cos_deg(angle + 90.0f); data->pos.x = cos_deg(angle + 90.0f);
data->pos.y = shim_sin_deg(angle + 90.0f); data->pos.y = sin_deg(angle + 90.0f);
data->pos.z = 0.0f; data->pos.z = 0.0f;
data->unk_10 = 0.0f; data->unk_10 = 0.0f;
data->unk_14 = 0.0f; data->unk_14 = 0.0f;
@ -90,7 +90,7 @@ void debuff_update(EffectInstance* effect) {
data->lifetime++; data->lifetime++;
data->timeLeft--; data->timeLeft--;
if (data->timeLeft < 0) { if (data->timeLeft < 0) {
shim_remove_effect(effect); remove_effect(effect);
return; return;
} }
@ -112,8 +112,8 @@ void debuff_update(EffectInstance* effect) {
data->scaleX += (1.0f - data->scaleX) * 0.1; data->scaleX += (1.0f - data->scaleX) * 0.1;
data->unk_30 += ((10.0f - data->unk_30) * 0.05) * 0.6; data->unk_30 += ((10.0f - data->unk_30) * 0.05) * 0.6;
} }
data->pos.x = shim_cos_deg(data->rotZ + 90.0f) * data->unk_30; data->pos.x = cos_deg(data->rotZ + 90.0f) * data->unk_30;
data->pos.y = shim_sin_deg(data->rotZ + 90.0f) * data->unk_30; data->pos.y = sin_deg(data->rotZ + 90.0f) * data->unk_30;
} }
} }
@ -126,7 +126,7 @@ void debuff_render(EffectInstance* effect) {
renderTask.distance = 0; renderTask.distance = 0;
renderTask.renderMode = RENDER_MODE_28; renderTask.renderMode = RENDER_MODE_28;
retTask = shim_queue_render_task(&renderTask); retTask = queue_render_task(&renderTask);
retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR;
} }
@ -144,10 +144,10 @@ void debuff_appendGfx(void* effect) {
gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(eff->graphics->data)); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(eff->graphics->data));
gSPDisplayList(gMainGfxPos++, dlist2); gSPDisplayList(gMainGfxPos++, dlist2);
shim_guTranslateF(mtxTranslate, data->pos.x, data->pos.y, data->pos.z); guTranslateF(mtxTranslate, data->pos.x, data->pos.y, data->pos.z);
shim_guRotateF(mtxRotate, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); guRotateF(mtxRotate, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f);
shim_guMtxCatF(mtxRotate, mtxTranslate, mtxTransform); guMtxCatF(mtxRotate, mtxTranslate, mtxTransform);
shim_guMtxF2L(mtxTransform, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(mtxTransform, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, gSPMatrix(gMainGfxPos++,
&gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
@ -156,12 +156,12 @@ void debuff_appendGfx(void* effect) {
data++; data++;
for (i = 1; i < eff->numParts; i++, data++) { for (i = 1; i < eff->numParts; i++, data++) {
shim_guTranslateF(mtxTranslate, data->pos.x, data->pos.y, data->pos.z); guTranslateF(mtxTranslate, data->pos.x, data->pos.y, data->pos.z);
shim_guRotateF(mtxRotate, data->rotZ, 0.0f, 0.0f, 1.0f); guRotateF(mtxRotate, data->rotZ, 0.0f, 0.0f, 1.0f);
shim_guMtxCatF(mtxRotate, mtxTranslate, mtxTranslate); guMtxCatF(mtxRotate, mtxTranslate, mtxTranslate);
shim_guScaleF(mtxRotate, data->scaleX, data->scaleY, 1.0f); guScaleF(mtxRotate, data->scaleX, data->scaleY, 1.0f);
shim_guMtxCatF(mtxRotate, mtxTranslate, mtxTranslate); guMtxCatF(mtxRotate, mtxTranslate, mtxTranslate);
shim_guMtxF2L(mtxTranslate, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(mtxTranslate, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, gSPMatrix(gMainGfxPos++,
&gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);

View File

@ -47,9 +47,9 @@ EffectInstance* disable_x_main(s32 type, f32 x, f32 y, f32 z, s32 arg4) {
bp.renderUI = func_E0082528; bp.renderUI = func_E0082528;
bp.effectID = EFFECT_DISABLE_X; bp.effectID = EFFECT_DISABLE_X;
effect = shim_create_effect_instance(&bp); effect = create_effect_instance(&bp);
effect->numParts = numParts; effect->numParts = numParts;
data = shim_general_heap_malloc(numParts * sizeof(*data)); data = general_heap_malloc(numParts * sizeof(*data));
effect->data.disableX = data; effect->data.disableX = data;
ASSERT(effect->data.disableX != NULL); ASSERT(effect->data.disableX != NULL);
@ -121,7 +121,7 @@ void disable_x_update(EffectInstance* effect) {
} }
if (data->unk_28 < 0) { if (data->unk_28 < 0) {
shim_remove_effect(effect); remove_effect(effect);
return; return;
} }
@ -151,10 +151,10 @@ void disable_x_update(EffectInstance* effect) {
data[1].unk_28 = 0; data[1].unk_28 = 0;
data->unk_38++; data->unk_38++;
if (data->pos.y > -500.0f) { if (data->pos.y > -500.0f) {
shim_sfx_play_sound_at_position(SOUND_2107, SOUND_SPACE_MODE_0, data->pos.x, data->pos.y, data->pos.z); sfx_play_sound_at_position(SOUND_2107, SOUND_SPACE_MODE_0, data->pos.x, data->pos.y, data->pos.z);
} }
} else if (unk_3C < unk_38) { } else if (unk_3C < unk_38) {
shim_load_effect(EFFECT_DISABLE_X); load_effect(EFFECT_DISABLE_X);
disable_x_main(10, data->pos.x, data->pos.y + data[1].unk_20, data->pos.z, 0); disable_x_main(10, data->pos.x, data->pos.y + data[1].unk_20, data->pos.z, 0);
data->unk_38--; data->unk_38--;
} }
@ -173,7 +173,7 @@ void disable_x_update(EffectInstance* effect) {
data->unk_30 *= unk_34; data->unk_30 *= unk_34;
if (type < 2) { if (type < 2) {
data->unk_20 = shim_cos_deg(unk_2C * 12) * 4.0f; data->unk_20 = cos_deg(unk_2C * 12) * 4.0f;
} else { } else {
data->unk_20 = 0.0f; data->unk_20 = 0.0f;
} }
@ -215,11 +215,11 @@ void func_E0082528(EffectInstance* effect) {
void func_E0082580(DisableXFXData* data) { void func_E0082580(DisableXFXData* data) {
Matrix4f sp18, sp58; Matrix4f sp18, sp58;
shim_guTranslateF(sp18, data->pos.x, data->pos.y, data->pos.z); guTranslateF(sp18, data->pos.x, data->pos.y, data->pos.z);
shim_guScaleF(sp58, data->scale, data->scale, 1.0f); guScaleF(sp58, data->scale, data->scale, 1.0f);
shim_guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f);
shim_guMtxCatF(sp58, sp18, sp18); guMtxCatF(sp58, sp18, sp18);
shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++],
G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
} }
@ -227,14 +227,14 @@ void func_E0082580(DisableXFXData* data) {
void func_E00826C4(DisableXFXData* data) { void func_E00826C4(DisableXFXData* data) {
Matrix4f sp18, sp58; Matrix4f sp18, sp58;
shim_guTranslateF(sp18, data->pos.x, data->pos.y, data->pos.z); guTranslateF(sp18, data->pos.x, data->pos.y, data->pos.z);
shim_guScaleF(sp58, data->unk_30, data->unk_30, 1.0f); guScaleF(sp58, data->unk_30, data->unk_30, 1.0f);
shim_guMtxCatF(sp58, sp18, sp18); guMtxCatF(sp58, sp18, sp18);
shim_guRotateF(sp58, data->unk_40, 0.0f, 0.0f, 1.0f); guRotateF(sp58, data->unk_40, 0.0f, 0.0f, 1.0f);
shim_guMtxCatF(sp58, sp18, sp18); guMtxCatF(sp58, sp18, sp18);
shim_guTranslateF(sp58, 0.0f, data->unk_20, 0.0f); guTranslateF(sp58, 0.0f, data->unk_20, 0.0f);
shim_guMtxCatF(sp58, sp18, sp18); guMtxCatF(sp58, sp18, sp18);
shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++],
G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);

View File

@ -23,9 +23,9 @@ void drop_leaves_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, s32 arg4) {
bp.renderUI = NULL; bp.renderUI = NULL;
bp.effectID = EFFECT_DROP_LEAVES; bp.effectID = EFFECT_DROP_LEAVES;
effect = shim_create_effect_instance(&bp); effect = create_effect_instance(&bp);
effect->numParts = numParts; effect->numParts = numParts;
part = effect->data.dropLeaves = shim_general_heap_malloc(numParts * sizeof(*part)); part = effect->data.dropLeaves = general_heap_malloc(numParts * sizeof(*part));
ASSERT(effect->data.dropLeaves != NULL); ASSERT(effect->data.dropLeaves != NULL);
part->unk_00 = arg0; part->unk_00 = arg0;
@ -75,7 +75,7 @@ void drop_leaves_update(EffectInstance *effect) {
part->unk_2C++; part->unk_2C++;
if (part->unk_28 < 0) { if (part->unk_28 < 0) {
shim_remove_effect(effect); remove_effect(effect);
return; return;
} }
@ -92,22 +92,22 @@ void drop_leaves_update(EffectInstance *effect) {
part++; part++;
for (i = 1; i < effect->numParts; i++, part++) { for (i = 1; i < effect->numParts; i++, part++) {
temp = shim_sin_deg(2.0f * part->unk_18) * 0.2; temp = sin_deg(2.0f * part->unk_18) * 0.2;
part->unk_14 += -0.05f; part->unk_14 += -0.05f;
part->unk_10 += temp; part->unk_10 += temp;
if (unk_00 == 0) { if (unk_00 == 0) {
part->unk_10 *= 0.94; part->unk_10 *= 0.94;
part->unk_14 *= shim_sin_deg(part->unk_18) * 0.05 + 0.95; part->unk_14 *= sin_deg(part->unk_18) * 0.05 + 0.95;
} else { } else {
part->unk_14 += -0.05f; part->unk_14 += -0.05f;
part->unk_10 *= 0.92; part->unk_10 *= 0.92;
} }
part->unk_1C += func_E0200044(50, unk_2C + i * 20) - 25; part->unk_1C += func_E0200044(50, unk_2C + i * 20) - 25;
part->unk_18 += shim_sin_deg(part->unk_1C) * 10.0f; part->unk_18 += sin_deg(part->unk_1C) * 10.0f;
part->unk_20 += shim_cos_deg(part->unk_1C * 0.5f) * 10.0f; part->unk_20 += cos_deg(part->unk_1C * 0.5f) * 10.0f;
part->unk_04 += part->unk_10; part->unk_04 += part->unk_10;
part->unk_08 += part->unk_14; part->unk_08 += part->unk_14;
} }
@ -122,7 +122,7 @@ void drop_leaves_render(EffectInstance* effect) {
renderTask.distance = 0; renderTask.distance = 0;
renderTask.renderMode = RENDER_MODE_2D; renderTask.renderMode = RENDER_MODE_2D;
retTask = shim_queue_render_task(&renderTask); retTask = queue_render_task(&renderTask);
retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR;
} }
@ -137,19 +137,19 @@ void drop_leaves_appendGfx(void* effect) {
gSPDisplayList(gMainGfxPos++, D_09001180_33E790); gSPDisplayList(gMainGfxPos++, D_09001180_33E790);
gDPSetPrimColor(gMainGfxPos++, 0, 0, 20, 100, 20, part->unk_24); gDPSetPrimColor(gMainGfxPos++, 0, 0, 20, 100, 20, part->unk_24);
shim_guTranslateF(sp18, part->unk_04, part->unk_08, part->unk_0C); guTranslateF(sp18, part->unk_04, part->unk_08, part->unk_0C);
shim_guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f);
shim_guMtxCatF(sp58, sp18, sp98); guMtxCatF(sp58, sp18, sp98);
part++; part++;
for (i = 1; i < ((EffectInstance*)effect)->numParts; i++, part++) { for (i = 1; i < ((EffectInstance*)effect)->numParts; i++, part++) {
shim_guTranslateF(sp58, part->unk_04, part->unk_08, part->unk_0C); guTranslateF(sp58, part->unk_04, part->unk_08, part->unk_0C);
shim_guMtxCatF(sp58, sp98, sp18); guMtxCatF(sp58, sp98, sp18);
shim_guRotateF(sp58, part->unk_18, 0.0f, 0.0f, 1.0f); guRotateF(sp58, part->unk_18, 0.0f, 0.0f, 1.0f);
shim_guMtxCatF(sp58, sp18, sp18); guMtxCatF(sp58, sp18, sp18);
shim_guRotateF(sp58, part->unk_20, 0.0f, 1.0f, 0.0f); guRotateF(sp58, part->unk_20, 0.0f, 1.0f, 0.0f);
shim_guMtxCatF(sp58, sp18, sp18); guMtxCatF(sp58, sp18, sp18);
shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
gSPDisplayList(gMainGfxPos++, D_09001230_33E840); gSPDisplayList(gMainGfxPos++, D_09001230_33E840);

View File

@ -33,9 +33,9 @@ EffectInstance* dust_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, s32 arg4) {
bp.renderUI = NULL; bp.renderUI = NULL;
bp.effectID = EFFECT_DUST; bp.effectID = EFFECT_DUST;
effect = shim_create_effect_instance(bpPtr); effect = create_effect_instance(bpPtr);
effect->numParts = numParts; effect->numParts = numParts;
part = effect->data.dust = shim_general_heap_malloc(numParts * sizeof(*part)); part = effect->data.dust = general_heap_malloc(numParts * sizeof(*part));
ASSERT(effect->data.dust != NULL); ASSERT(effect->data.dust != NULL);
part->unk_00 = arg0; part->unk_00 = arg0;
@ -53,14 +53,14 @@ EffectInstance* dust_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, s32 arg4) {
part++; part++;
for (i = 1; i < numParts; i++, part++) { for (i = 1; i < numParts; i++, part++) {
part->unk_04 = shim_rand_int(200) - 100; part->unk_04 = rand_int(200) - 100;
part->unk_08 = shim_rand_int(50); part->unk_08 = rand_int(50);
part->unk_0C = 0; part->unk_0C = 0;
part->unk_14 = 0; part->unk_14 = 0;
part->unk_1C = 1.0f; part->unk_1C = 1.0f;
part->unk_20 = 1.0f; part->unk_20 = 1.0f;
part->unk_10 = -1.0f; part->unk_10 = -1.0f;
part->unk_24 = shim_rand_int(10) / 200; part->unk_24 = rand_int(10) / 200;
switch (arg0) { switch (arg0) {
case 0: case 0:
part->unk_28 = part->unk_24 * 0.1; part->unk_28 = part->unk_24 * 0.1;
@ -72,8 +72,8 @@ EffectInstance* dust_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, s32 arg4) {
part->unk_24 = 0.4f; part->unk_24 = 0.4f;
part->unk_28 = 0.4f; part->unk_28 = 0.4f;
part->unk_10 = 0; part->unk_10 = 0;
part->unk_04 = (shim_rand_int(40) - 20) * 0.1; part->unk_04 = (rand_int(40) - 20) * 0.1;
part->unk_08 = (shim_rand_int(40) - 20) * 0.1; part->unk_08 = (rand_int(40) - 20) * 0.1;
break; break;
} }
} }
@ -91,7 +91,7 @@ void dust_update(EffectInstance* effect) {
part->unk_2C--; part->unk_2C--;
if (part->unk_2C < 0) { if (part->unk_2C < 0) {
shim_remove_effect(effect); remove_effect(effect);
return; return;
} }
@ -121,7 +121,7 @@ void dust_render(EffectInstance* effect) {
renderTask.distance = 0; renderTask.distance = 0;
renderTask.renderMode = RENDER_MODE_SURFACE_XLU_LAYER1; renderTask.renderMode = RENDER_MODE_SURFACE_XLU_LAYER1;
retTask = shim_queue_render_task(&renderTask); retTask = queue_render_task(&renderTask);
retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR;
} }
@ -139,20 +139,20 @@ void dust_appendGfx(void* effect) {
gDPSetPrimColor(gMainGfxPos++, 0, 0, part->unk_30, part->unk_34, part->unk_38, part->unk_18); gDPSetPrimColor(gMainGfxPos++, 0, 0, part->unk_30, part->unk_34, part->unk_38, part->unk_18);
gDPSetEnvColor(gMainGfxPos++, part->unk_3C, part->unk_40, part->unk_44, 0); gDPSetEnvColor(gMainGfxPos++, part->unk_3C, part->unk_40, part->unk_44, 0);
shim_guTranslateF(sp18, part->unk_04, part->unk_08, part->unk_0C); guTranslateF(sp18, part->unk_04, part->unk_08, part->unk_0C);
shim_guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f);
shim_guMtxCatF(sp58, sp18, sp98); guMtxCatF(sp58, sp18, sp98);
unk_00 = part->unk_00; unk_00 = part->unk_00;
part++; part++;
for (i = 1; i < ((EffectInstance*)effect)->numParts; i++, part++) { for (i = 1; i < ((EffectInstance*)effect)->numParts; i++, part++) {
matrix = &gDisplayContext->matrixStack[gMatrixListPos++]; matrix = &gDisplayContext->matrixStack[gMatrixListPos++];
shim_guScaleF(sp18, part->unk_20, part->unk_1C, part->unk_20); guScaleF(sp18, part->unk_20, part->unk_1C, part->unk_20);
shim_guMtxF2L(sp18, matrix); guMtxF2L(sp18, matrix);
shim_guTranslateF(sp58, part->unk_04, part->unk_08, part->unk_0C); guTranslateF(sp58, part->unk_04, part->unk_08, part->unk_0C);
shim_guMtxCatF(sp58, sp98, sp18); guMtxCatF(sp58, sp98, sp18);
shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
gSPMatrix(gMainGfxPos++, matrix, G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, matrix, G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW);

View File

@ -26,7 +26,7 @@ void effect_3D_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5,
temp_f12 = SQ(arg4) + SQ(arg5) + SQ(arg6); temp_f12 = SQ(arg4) + SQ(arg5) + SQ(arg6);
if (temp_f12 != 0.0f) { if (temp_f12 != 0.0f) {
temp_f12 = -1.0f / shim_sqrtf(temp_f12); temp_f12 = -1.0f / sqrtf(temp_f12);
arg4 *= temp_f12; arg4 *= temp_f12;
arg5 *= temp_f12; arg5 *= temp_f12;
@ -48,7 +48,7 @@ void effect_3D_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5,
temp_f12 = SQ(temp_f30) + SQ(sp70) + SQ(temp_f28); temp_f12 = SQ(temp_f30) + SQ(sp70) + SQ(temp_f28);
if (temp_f12 != 0.0f) { if (temp_f12 != 0.0f) {
temp_f12 = 1.0f / shim_sqrtf(temp_f12); temp_f12 = 1.0f / sqrtf(temp_f12);
temp_f30 *= temp_f12; temp_f30 *= temp_f12;
sp70 *= temp_f12; sp70 *= temp_f12;
@ -68,9 +68,9 @@ void effect_3D_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5,
bpPtr->renderUI = NULL; bpPtr->renderUI = NULL;
bpPtr->effectID = EFFECT_3D; bpPtr->effectID = EFFECT_3D;
effect = shim_create_effect_instance(bpPtr); effect = create_effect_instance(bpPtr);
effect->numParts = arg7; effect->numParts = arg7;
part = effect->data.unk_3D = shim_general_heap_malloc(arg7 * sizeof(*part)); part = effect->data.unk_3D = general_heap_malloc(arg7 * sizeof(*part));
ASSERT(effect->data.unk_3D != NULL); ASSERT(effect->data.unk_3D != NULL);
part->unk_04 = 0; part->unk_04 = 0;
@ -86,7 +86,7 @@ void effect_3D_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5,
part->pos.x = 0; part->pos.x = 0;
part->pos.y = 0; part->pos.y = 0;
part->pos.z = 0; part->pos.z = 0;
shim_guRotateF(sp30, i * 72, arg4, arg5, arg6); guRotateF(sp30, i * 72, arg4, arg5, arg6);
part->unk_14 = part->unk_20 = 2.0f * arg4; part->unk_14 = part->unk_20 = 2.0f * arg4;
part->unk_18 = part->unk_24 = 2.0f * arg5; part->unk_18 = part->unk_24 = 2.0f * arg5;
part->unk_1C = part->unk_28 = 2.0f * arg6; part->unk_1C = part->unk_28 = 2.0f * arg6;
@ -124,7 +124,7 @@ void effect_3D_update(EffectInstance* effect) {
part->unk_5C--; part->unk_5C--;
part->unk_60++; part->unk_60++;
if (part->unk_5C < 0 && unk_04 == 2) { if (part->unk_5C < 0 && unk_04 == 2) {
shim_remove_effect(effect); remove_effect(effect);
return; return;
} }
@ -207,7 +207,7 @@ void effect_3D_render(EffectInstance* effect) {
renderTask.distance = 0; renderTask.distance = 0;
renderTask.renderMode = RENDER_MODE_2D; renderTask.renderMode = RENDER_MODE_2D;
retTask = shim_queue_render_task(&renderTask); retTask = queue_render_task(&renderTask);
retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR;
} }
@ -224,8 +224,8 @@ void effect_3D_appendGfx(void* effect) {
gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data));
gSPDisplayList(gMainGfxPos++, D_09000240_37D3C0); gSPDisplayList(gMainGfxPos++, D_09000240_37D3C0);
shim_guTranslateF(sp18, part->pos.x, part->pos.y, part->pos.z); guTranslateF(sp18, part->pos.x, part->pos.y, part->pos.z);
shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
@ -233,14 +233,14 @@ void effect_3D_appendGfx(void* effect) {
for (i = 1; i < ((EffectInstance*)effect)->numParts; i++, part++) { for (i = 1; i < ((EffectInstance*)effect)->numParts; i++, part++) {
gDPSetPrimColor(gMainGfxPos++, 0, 0, 200, 255, 255, part->unk_58); gDPSetPrimColor(gMainGfxPos++, 0, 0, 200, 255, 255, part->unk_58);
shim_guTranslateF(sp18, part->pos.x, part->pos.y, part->pos.z); guTranslateF(sp18, part->pos.x, part->pos.y, part->pos.z);
shim_guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f);
shim_guMtxCatF(sp58, sp18, sp18); guMtxCatF(sp58, sp18, sp18);
shim_guScaleF(sp58, part->unk_44, part->unk_48, part->unk_44); guScaleF(sp58, part->unk_44, part->unk_48, part->unk_44);
shim_guMtxCatF(sp58, sp18, sp18); guMtxCatF(sp58, sp18, sp18);
shim_guRotateF(sp58, part->unk_4C, 0.0f, 0.0f, 1.0f); guRotateF(sp58, part->unk_4C, 0.0f, 0.0f, 1.0f);
shim_guMtxCatF(sp58, sp18, sp18); guMtxCatF(sp58, sp18, sp18);
shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
gSPDisplayList(gMainGfxPos++, D_090002E8_37D468); gSPDisplayList(gMainGfxPos++, D_090002E8_37D468);

View File

@ -35,9 +35,9 @@ EffectInstance* effect_46_main(s32 type, PlayerStatus* player, f32 scale, s32 du
bp.renderUI = NULL; bp.renderUI = NULL;
bp.effectID = EFFECT_46; bp.effectID = EFFECT_46;
effect = shim_create_effect_instance(&bp); effect = create_effect_instance(&bp);
effect->numParts = numParts; effect->numParts = numParts;
part = effect->data.spin = shim_general_heap_malloc(numParts * sizeof(*part)); part = effect->data.spin = general_heap_malloc(numParts * sizeof(*part));
ASSERT(effect->data.spin != NULL); ASSERT(effect->data.spin != NULL);
part->type = type; part->type = type;
@ -138,7 +138,7 @@ void effect_46_update(EffectInstance* effect) {
part->lifetime++; part->lifetime++;
if (part->timeLeft < 0) { if (part->timeLeft < 0) {
shim_remove_effect(effect); remove_effect(effect);
return; return;
} }
@ -195,7 +195,7 @@ void effect_46_render(EffectInstance* effect) {
renderTask.distance = 0; renderTask.distance = 0;
renderTask.renderMode = RENDER_MODE_2D; renderTask.renderMode = RENDER_MODE_2D;
retTask = shim_queue_render_task(&renderTask); retTask = queue_render_task(&renderTask);
retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR;
} }
@ -215,30 +215,30 @@ void effect_46_appendGfx(void* effect) {
gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data));
gSPDisplayList(gMainGfxPos++, D_09000420_38EDB0); gSPDisplayList(gMainGfxPos++, D_09000420_38EDB0);
shim_guTranslateF(mtxTransform, part->pos.x, part->pos.y, part->pos.z); guTranslateF(mtxTransform, part->pos.x, part->pos.y, part->pos.z);
shim_guRotateF(mtxTemp, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); guRotateF(mtxTemp, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f);
shim_guMtxCatF(mtxTemp, mtxTransform, mtxTransform); guMtxCatF(mtxTemp, mtxTransform, mtxTransform);
shim_guMtxF2L(mtxTransform, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(mtxTransform, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
part++; part++;
for (i = 1; i < ((EffectInstance*)effect)->numParts; i++, part++) { for (i = 1; i < ((EffectInstance*)effect)->numParts; i++, part++) {
shim_guPositionF(mtxTransform, part->rot.x, 0.0f, part->rot.z, curScale * part->scale, part->pos.x, part->pos.y, part->pos.z); guPositionF(mtxTransform, part->rot.x, 0.0f, part->rot.z, curScale * part->scale, part->pos.x, part->pos.y, part->pos.z);
shim_guRotateF(mtxTemp, part->rot.y, 0.0f, 1.0f, 0.0f); guRotateF(mtxTemp, part->rot.y, 0.0f, 1.0f, 0.0f);
shim_guMtxCatF(mtxTemp, mtxTransform, mtxTransform); guMtxCatF(mtxTemp, mtxTransform, mtxTransform);
if (type < 8) { if (type < 8) {
shim_guTranslateF(mtxTemp, 3.0f - (curScale - initialScale) * 3.0f / initialScale, 0.0f, 0.0f); guTranslateF(mtxTemp, 3.0f - (curScale - initialScale) * 3.0f / initialScale, 0.0f, 0.0f);
shim_guMtxCatF(mtxTemp, mtxTransform, mtxTransform); guMtxCatF(mtxTemp, mtxTransform, mtxTransform);
} else { } else {
shim_guTranslateF(mtxTemp, 2.0f, 0.0f, 0.0f); guTranslateF(mtxTemp, 2.0f, 0.0f, 0.0f);
shim_guMtxCatF(mtxTemp, mtxTransform, mtxTransform); guMtxCatF(mtxTemp, mtxTransform, mtxTransform);
} }
gDPSetPrimColor(gMainGfxPos++, 0, 0, part->color.r, part->color.g, part->color.b, alpha); gDPSetPrimColor(gMainGfxPos++, 0, 0, part->color.r, part->color.g, part->color.b, alpha);
shim_guMtxF2L(mtxTransform, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(mtxTransform, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
gSPDisplayList(gMainGfxPos++, D_090003A0_38ED30); gSPDisplayList(gMainGfxPos++, D_090003A0_38ED30);

View File

@ -50,9 +50,9 @@ EffectInstance* effect_63_main(
bpPtr->renderUI = NULL; bpPtr->renderUI = NULL;
bpPtr->effectID = EFFECT_63; bpPtr->effectID = EFFECT_63;
effect = shim_create_effect_instance(bpPtr); effect = create_effect_instance(bpPtr);
effect->numParts = numParts; effect->numParts = numParts;
part = effect->data.unk_63 = shim_general_heap_malloc(numParts * sizeof(*part)); part = effect->data.unk_63 = general_heap_malloc(numParts * sizeof(*part));
ASSERT(effect->data.unk_63 != NULL); ASSERT(effect->data.unk_63 != NULL);
if (arg9 <= 0) { if (arg9 <= 0) {
@ -85,8 +85,8 @@ EffectInstance* effect_63_main(
part->unk_3C = 51; part->unk_3C = 51;
part->unk_40 = 123; part->unk_40 = 123;
part->unk_44 = 255; part->unk_44 = 255;
part->unk_4C = shim_rand_int(64); part->unk_4C = rand_int(64);
part->unk_50 = shim_rand_int(64); part->unk_50 = rand_int(64);
part->unk_54 = 0; part->unk_54 = 0;
part->unk_58 = 0; part->unk_58 = 0;
part->unk_74 = 0; part->unk_74 = 0;
@ -102,16 +102,16 @@ EffectInstance* effect_63_main(
part->unk_3C = 51; part->unk_3C = 51;
part->unk_40 = 123; part->unk_40 = 123;
part->unk_44 = 255; part->unk_44 = 255;
randInt = shim_rand_int(360); randInt = rand_int(360);
for (i = 0; i < numParts; i++, part++) { for (i = 0; i < numParts; i++, part++) {
part->unk_04 = arg1; part->unk_04 = arg1;
part->unk_08 = arg2; part->unk_08 = arg2;
part->unk_0C = arg3; part->unk_0C = arg3;
part->unk_60 = shim_sin_deg(i * 45 + randInt) * 5.0f; part->unk_60 = sin_deg(i * 45 + randInt) * 5.0f;
part->unk_64 = shim_cos_deg(i * 45 + randInt) * 2.0f + 3.0f; part->unk_64 = cos_deg(i * 45 + randInt) * 2.0f + 3.0f;
part->unk_4C = shim_rand_int(64); part->unk_4C = rand_int(64);
part->unk_50 = shim_rand_int(64); part->unk_50 = rand_int(64);
part->unk_70 = 1.0f; part->unk_70 = 1.0f;
part->unk_6C = 1.0f; part->unk_6C = 1.0f;
part->unk_54 = 0; part->unk_54 = 0;
@ -145,12 +145,12 @@ void effect_63_update(EffectInstance* effect) {
part->unk_24++; part->unk_24++;
if (part->unk_20 == 1 && unk_00 == 1) { if (part->unk_20 == 1 && unk_00 == 1) {
shim_load_effect(EFFECT_63); load_effect(EFFECT_63);
effect_63_main(2, part->unk_04, part->unk_08, part->unk_0C, part->unk_10, part->unk_14, part->unk_18, 1.0f, 32, 32); effect_63_main(2, part->unk_04, part->unk_08, part->unk_0C, part->unk_10, part->unk_14, part->unk_18, 1.0f, 32, 32);
} }
if (part->unk_20 < 0) { if (part->unk_20 < 0) {
shim_remove_effect(effect); remove_effect(effect);
return; return;
} }
@ -159,7 +159,7 @@ void effect_63_update(EffectInstance* effect) {
switch (unk_00) { switch (unk_00) {
case 0: case 0:
if (!(unk_24 & (1 | 2))) { if (!(unk_24 & (1 | 2))) {
shim_load_effect(EFFECT_63); load_effect(EFFECT_63);
effect_63_main(1, part->unk_04, part->unk_08, part->unk_0C, part->unk_10, part->unk_14, part->unk_18, 1.0f, part->unk_1C, part->unk_1C); effect_63_main(1, part->unk_04, part->unk_08, part->unk_0C, part->unk_10, part->unk_14, part->unk_18, 1.0f, part->unk_1C, part->unk_1C);
} }
break; break;
@ -203,7 +203,7 @@ void effect_63_render(EffectInstance* effect) {
renderTask.distance = 10; renderTask.distance = 10;
renderTask.renderMode = RENDER_MODE_2D; renderTask.renderMode = RENDER_MODE_2D;
retTask = shim_queue_render_task(&renderTask); retTask = queue_render_task(&renderTask);
retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR;
} }
@ -231,9 +231,9 @@ void effect_63_appendGfx(void* effect) {
part->unk_4C += part->unk_54; part->unk_4C += part->unk_54;
part->unk_50 += part->unk_58; part->unk_50 += part->unk_58;
angle = -shim_atan2(0.0f, 0.0f, part->unk_60, part->unk_64) + part->unk_74; angle = -atan2(0.0f, 0.0f, part->unk_60, part->unk_64) + part->unk_74;
part->unk_54 = shim_sin_deg(angle); part->unk_54 = sin_deg(angle);
part->unk_58 = shim_cos_deg(angle); part->unk_58 = cos_deg(angle);
if (part->unk_4C < 0.0f) { if (part->unk_4C < 0.0f) {
part->unk_4C += 128.0f; part->unk_4C += 128.0f;
@ -246,18 +246,18 @@ void effect_63_appendGfx(void* effect) {
tempX = part->unk_4C * 4.0f; tempX = part->unk_4C * 4.0f;
tempY = part->unk_50 * 4.0f; tempY = part->unk_50 * 4.0f;
shim_guTranslateF(sp18, part->unk_04, part->unk_08, part->unk_0C); guTranslateF(sp18, part->unk_04, part->unk_08, part->unk_0C);
shim_guScaleF(sp58, unk_48, unk_48, unk_48); guScaleF(sp58, unk_48, unk_48, unk_48);
shim_guMtxCatF(sp58, sp18, sp18); guMtxCatF(sp58, sp18, sp18);
shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPMatrix(gMainGfxPos++, camera->unkMatrix, G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, camera->unkMatrix, G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW);
shim_guScaleF(sp18, part->unk_70, part->unk_6C, 1.0f); guScaleF(sp18, part->unk_70, part->unk_6C, 1.0f);
shim_guRotateF(sp58, part->unk_74, 0.0f, 0.0f, 1.0f); guRotateF(sp58, part->unk_74, 0.0f, 0.0f, 1.0f);
shim_guMtxCatF(sp58, sp18, sp18); guMtxCatF(sp58, sp18, sp18);
shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW);
gDPSetTileSize(gMainGfxPos++, 1, tempX, tempY, (tempX + 0x3F) * 4, (tempY + 0xF) * 4); gDPSetTileSize(gMainGfxPos++, 1, tempX, tempY, (tempX + 0x3F) * 4, (tempY + 0xF) * 4);

View File

@ -33,9 +33,9 @@ EffectInstance* effect_65_main(
bp.renderUI = NULL; bp.renderUI = NULL;
bp.effectID = EFFECT_65; bp.effectID = EFFECT_65;
effect = shim_create_effect_instance(&bp); effect = create_effect_instance(&bp);
effect->numParts = numParts; effect->numParts = numParts;
data = effect->data.unk_65 = shim_general_heap_malloc(numParts * sizeof(*data)); data = effect->data.unk_65 = general_heap_malloc(numParts * sizeof(*data));
ASSERT(effect->data.unk_65 != NULL); ASSERT(effect->data.unk_65 != NULL);
data->variation = variation; data->variation = variation;
@ -104,7 +104,7 @@ EffectInstance* effect_65_main(
data->pathPointEnabled[0] = TRUE; data->pathPointEnabled[0] = TRUE;
data->pathTimestamp[0] = 0; data->pathTimestamp[0] = 0;
data->pathLength[0] = 0; data->pathLength[0] = 0;
data->pathJitterX = shim_rand_int(30) + 10; data->pathJitterX = rand_int(30) + 10;
data->pathJitterY = 0; data->pathJitterY = 0;
data->pathJitterZ = 0; data->pathJitterZ = 0;
@ -139,7 +139,7 @@ void effect_65_update(EffectInstance* effect) {
data->lifeTime++; data->lifeTime++;
if (data->timeLeft < 0) { if (data->timeLeft < 0) {
shim_remove_effect(effect); remove_effect(effect);
return; return;
} }
@ -150,8 +150,8 @@ void effect_65_update(EffectInstance* effect) {
} }
if (variation == 3) { if (variation == 3) {
data->pathJitterX += shim_rand_int(10) - 5; data->pathJitterX += rand_int(10) - 5;
data->pathJitterY += shim_rand_int(10) - 5; data->pathJitterY += rand_int(10) - 5;
data->pos.x += data->pathJitterX; data->pos.x += data->pathJitterX;
data->pos.y += data->pathJitterY; data->pos.y += data->pathJitterY;
data->pos.z += data->pathJitterZ; data->pos.z += data->pathJitterZ;
@ -186,7 +186,7 @@ void effect_65_update(EffectInstance* effect) {
dist = SQ(posX - lastPointX) + SQ(posY - lastPointY) + SQ(posZ - lastPointZ); dist = SQ(posX - lastPointX) + SQ(posY - lastPointY) + SQ(posZ - lastPointZ);
if (dist != 0.0f) { if (dist != 0.0f) {
dist = shim_sqrtf(dist); dist = sqrtf(dist);
} }
data->pathLength[idx] = pathLength + dist; data->pathLength[idx] = pathLength + dist;
@ -202,7 +202,7 @@ void effect_65_render(EffectInstance* effect) {
renderTask.distance = 10; renderTask.distance = 10;
renderTask.renderMode = RENDER_MODE_2D; renderTask.renderMode = RENDER_MODE_2D;
retTask = shim_queue_render_task(&renderTask); retTask = queue_render_task(&renderTask);
retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR;
} }
@ -249,8 +249,8 @@ void effect_65_appendGfx(void* effect) {
gDPPipeSync(gMainGfxPos++); gDPPipeSync(gMainGfxPos++);
gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data));
shim_guTranslateF(mtx, 0.0f, 0.0f, 0.0f); guTranslateF(mtx, 0.0f, 0.0f, 0.0f);
shim_guMtxF2L(mtx, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(mtx, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(gMainGfxPos++, D_E00CACB0[variation]); gSPDisplayList(gMainGfxPos++, D_E00CACB0[variation]);
@ -286,7 +286,7 @@ void effect_65_appendGfx(void* effect) {
fadeOutPhase = phase / numPoints; fadeOutPhase = phase / numPoints;
idx = (data->lastPointIndex + a1) % MAX_POINTS; idx = (data->lastPointIndex + a1) % MAX_POINTS;
a = shim_sin_deg(fadeOutPhase) * 255.0f; a = sin_deg(fadeOutPhase) * 255.0f;
if (a > 200) { if (a > 200) {
a = 200; a = 200;
} }
@ -301,7 +301,7 @@ void effect_65_appendGfx(void* effect) {
next = 0; next = 0;
} }
firstPointIdx = i; firstPointIdx = i;
angle = -shim_atan2(data->pathY[next], -data->pathX[next], data->pathY[idx], -data->pathX[idx]); angle = -atan2(data->pathY[next], -data->pathX[next], data->pathY[idx], -data->pathX[idx]);
} else { } else {
if (i != MAX_POINTS - 1) { if (i != MAX_POINTS - 1) {
next = idx + 1; next = idx + 1;
@ -312,8 +312,8 @@ void effect_65_appendGfx(void* effect) {
if (prev < 0) { if (prev < 0) {
prev = MAX_POINTS - 1; prev = MAX_POINTS - 1;
} }
nextAngle = -shim_atan2(data->pathY[next], -data->pathX[next], data->pathY[idx], -data->pathX[idx]); nextAngle = -atan2(data->pathY[next], -data->pathX[next], data->pathY[idx], -data->pathX[idx]);
prevAngle = -shim_atan2(data->pathY[idx], -data->pathX[idx], data->pathY[prev], -data->pathX[prev]); prevAngle = -atan2(data->pathY[idx], -data->pathX[idx], data->pathY[prev], -data->pathX[prev]);
deltaAngle = prevAngle - nextAngle; deltaAngle = prevAngle - nextAngle;
if (deltaAngle > 180.0f) { if (deltaAngle > 180.0f) {
nextAngle += 360.0f; nextAngle += 360.0f;
@ -328,7 +328,7 @@ void effect_65_appendGfx(void* effect) {
pathPointY = data->pathY[idx]; pathPointY = data->pathY[idx];
pathPointZ = data->pathZ[idx]; pathPointZ = data->pathZ[idx];
pathPointLifetime = lifeTime - data->pathTimestamp[idx]; pathPointLifetime = lifeTime - data->pathTimestamp[idx];
width = shim_sin_deg((lifeTime - data->pathTimestamp[idx] * 80) * 4) * 3.0f + 16.0f + pathPointLifetime; width = sin_deg((lifeTime - data->pathTimestamp[idx] * 80) * 4) * 3.0f + 16.0f + pathPointLifetime;
width *= scale; width *= scale;
if (variation >= 0) { if (variation >= 0) {
@ -352,8 +352,8 @@ void effect_65_appendGfx(void* effect) {
} }
} }
deltaX = width * shim_sin_deg(angle); deltaX = width * sin_deg(angle);
deltaY = width * shim_cos_deg(angle); deltaY = width * cos_deg(angle);
deltaZ = 0.0f; deltaZ = 0.0f;
vtx->ob[0] = pathPointX + deltaX; vtx->ob[0] = pathPointX + deltaX;

View File

@ -27,9 +27,9 @@ EffectInstance* effect_75_main(s32 arg0, f32 posX, f32 posY, f32 posZ, f32 scale
bp.renderUI = NULL; bp.renderUI = NULL;
bp.effectID = EFFECT_75; bp.effectID = EFFECT_75;
effect = shim_create_effect_instance(&bp); effect = create_effect_instance(&bp);
effect->numParts = numParts; effect->numParts = numParts;
data = effect->data.unk_75 = shim_general_heap_malloc(numParts * sizeof(*data)); data = effect->data.unk_75 = general_heap_malloc(numParts * sizeof(*data));
ASSERT(effect->data.unk_75 != NULL); ASSERT(effect->data.unk_75 != NULL);
data->type = arg0; data->type = arg0;
@ -94,7 +94,7 @@ void effect_75_update(EffectInstance* effect) {
} }
if (data->unk_10 < 0) { if (data->unk_10 < 0) {
shim_remove_effect(effect); remove_effect(effect);
return; return;
} }
@ -147,7 +147,7 @@ void effect_75_update(EffectInstance* effect) {
} }
data->unk_34 = data->unk_60 data->unk_34 = data->unk_60
+ (shim_sin_deg(unk_14 * 20) * (data->unk_64 - data->unk_60) + (sin_deg(unk_14 * 20) * (data->unk_64 - data->unk_60)
+ (data->unk_64 - data->unk_60)) * 0.5; + (data->unk_64 - data->unk_60)) * 0.5;
} }
@ -162,7 +162,7 @@ void effect_75_render(EffectInstance* effect) {
f32 outZ; f32 outZ;
f32 outS; f32 outS;
shim_transform_point(&gCameras[gCurrentCameraID].perspectiveMatrix[0], transform_point(&gCameras[gCurrentCameraID].perspectiveMatrix[0],
data->pos.x, data->pos.y, data->pos.z, 1.0f, data->pos.x, data->pos.y, data->pos.z, 1.0f,
&outX, &outY, &outZ, &outS); &outX, &outY, &outZ, &outS);
@ -182,7 +182,7 @@ void effect_75_render(EffectInstance* effect) {
renderTaskPtr->appendGfxArg = effect; renderTaskPtr->appendGfxArg = effect;
renderTaskPtr->renderMode = RENDER_MODE_SURFACE_XLU_LAYER1; renderTaskPtr->renderMode = RENDER_MODE_SURFACE_XLU_LAYER1;
retTask = shim_queue_render_task(renderTaskPtr); retTask = queue_render_task(renderTaskPtr);
retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR;
} }
@ -203,14 +203,14 @@ void effect_75_appendGfx(void* effect) {
gDPPipeSync(gMainGfxPos++); gDPPipeSync(gMainGfxPos++);
gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data));
shim_guTranslateF(mtxTransfrom, data->pos.x, data->pos.y, data->pos.z); guTranslateF(mtxTransfrom, data->pos.x, data->pos.y, data->pos.z);
shim_guScaleF(mtxTemp, data->scale, data->scale, data->scale); guScaleF(mtxTemp, data->scale, data->scale, data->scale);
shim_guMtxCatF(mtxTemp, mtxTransfrom, mtxTransfrom); guMtxCatF(mtxTemp, mtxTransfrom, mtxTransfrom);
if (type == 1) { if (type == 1) {
shim_guRotateF(mtxTemp, 180.0f, 0.0f, 0.0f, 1.0f); guRotateF(mtxTemp, 180.0f, 0.0f, 0.0f, 1.0f);
shim_guMtxCatF(mtxTemp, mtxTransfrom, mtxTransfrom); guMtxCatF(mtxTemp, mtxTransfrom, mtxTransfrom);
} }
shim_guMtxF2L(mtxTransfrom, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(mtxTransfrom, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPMatrix(gMainGfxPos++, camera->unkMatrix, G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, camera->unkMatrix, G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW);

View File

@ -42,10 +42,10 @@ EffectInstance* effect_86_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4,
bp.renderUI = NULL; bp.renderUI = NULL;
bp.effectID = EFFECT_86; bp.effectID = EFFECT_86;
effect = shim_create_effect_instance(&bp); effect = create_effect_instance(&bp);
effect->numParts = numParts; effect->numParts = numParts;
data = shim_general_heap_malloc(numParts * sizeof(*data)); data = general_heap_malloc(numParts * sizeof(*data));
effect->data.unk_86 = data; effect->data.unk_86 = data;
part = data; part = data;
@ -90,7 +90,7 @@ void effect_86_update(EffectInstance* effect) {
data->unk_14++; data->unk_14++;
if (data->unk_10 < 0) { if (data->unk_10 < 0) {
shim_remove_effect(effect); remove_effect(effect);
} }
} }
@ -103,7 +103,7 @@ void effect_86_render(EffectInstance* effect) {
renderTask.distance = 10; renderTask.distance = 10;
renderTask.renderMode = RENDER_MODE_2D; renderTask.renderMode = RENDER_MODE_2D;
retTask = shim_queue_render_task(&renderTask); retTask = queue_render_task(&renderTask);
retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR;
} }
@ -118,10 +118,10 @@ void effect_86_appendGfx(void* effect) {
gDPPipeSync(gMainGfxPos++); gDPPipeSync(gMainGfxPos++);
gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data));
shim_guTranslateF(sp10, part->unk_04, part->unk_08, part->unk_0C); guTranslateF(sp10, part->unk_04, part->unk_08, part->unk_0C);
shim_guScaleF(sp50, part->unk_34, part->unk_34, part->unk_34); guScaleF(sp50, part->unk_34, part->unk_34, part->unk_34);
shim_guMtxCatF(sp50, sp10, sp10); guMtxCatF(sp50, sp10, sp10);
shim_guMtxF2L(sp10, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp10, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPMatrix(gMainGfxPos++, camera->unkMatrix, G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, camera->unkMatrix, G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW);

View File

@ -48,9 +48,9 @@ EffectInstance* embers_main(
bp.renderUI = NULL; bp.renderUI = NULL;
bp.effectID = EFFECT_EMBERS; bp.effectID = EFFECT_EMBERS;
effect = shim_create_effect_instance(&bp); effect = create_effect_instance(&bp);
effect->numParts = arg7; effect->numParts = arg7;
part = effect->data.embers = shim_general_heap_malloc(arg7 * sizeof(*part)); part = effect->data.embers = general_heap_malloc(arg7 * sizeof(*part));
ASSERT(effect->data.embers != NULL); ASSERT(effect->data.embers != NULL);
part->unk_00 = arg0; part->unk_00 = arg0;
@ -116,7 +116,7 @@ void embers_update(EffectInstance* effect) {
} }
if (part->timeLeft < 0) { if (part->timeLeft < 0) {
shim_remove_effect(effect); remove_effect(effect);
return; return;
} }
@ -144,17 +144,17 @@ void embers_update(EffectInstance* effect) {
if (part->unk_64 >= 0) { if (part->unk_64 >= 0) {
if (part->unk_64 == 0) { if (part->unk_64 == 0) {
part->unk_04 = shim_rand_int(unk_10) - unk_10 * 0.5; part->unk_04 = rand_int(unk_10) - unk_10 * 0.5;
part->unk_08 = shim_rand_int(unk_14); part->unk_08 = rand_int(unk_14);
part->unk_0C = 0.0f; part->unk_0C = 0.0f;
part->unk_44 = (f32) (shim_rand_int(20) - 10) * 0.05; part->unk_44 = (f32) (rand_int(20) - 10) * 0.05;
part->unk_48 = (shim_rand_int(40) - 1) * unk_68 * 0.05; part->unk_48 = (rand_int(40) - 1) * unk_68 * 0.05;
part->unk_4C = 0.0f; part->unk_4C = 0.0f;
part->unk_50 = (f32) (shim_rand_int(20) - 10) * 0.05; part->unk_50 = (f32) (rand_int(20) - 10) * 0.05;
part->unk_54 = (shim_rand_int(30) - 1) * unk_6C * 0.05; part->unk_54 = (rand_int(30) - 1) * unk_6C * 0.05;
part->unk_58 = 0.0f; part->unk_58 = 0.0f;
part->unk_5C = shim_rand_int(15); part->unk_5C = rand_int(15);
part->unk_60 = shim_rand_int(15); part->unk_60 = rand_int(15);
} }
part->unk_40 = D_E00E0A48[part->unk_64]; part->unk_40 = D_E00E0A48[part->unk_64];
part->unk_04 += part->unk_44; part->unk_04 += part->unk_44;
@ -178,7 +178,7 @@ void embers_render(EffectInstance* effect) {
renderTask.distance = 10; renderTask.distance = 10;
renderTask.renderMode = RENDER_MODE_2D; renderTask.renderMode = RENDER_MODE_2D;
retTask = shim_queue_render_task(&renderTask); retTask = queue_render_task(&renderTask);
retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR;
} }
@ -196,10 +196,10 @@ void embers_appendGfx(void* effect) {
gDPPipeSync(gMainGfxPos++); gDPPipeSync(gMainGfxPos++);
gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data));
shim_guTranslateF(sp10, part->unk_04, part->unk_08, part->unk_0C); guTranslateF(sp10, part->unk_04, part->unk_08, part->unk_0C);
shim_guScaleF(sp50, part->unk_40, part->unk_40, part->unk_40); guScaleF(sp50, part->unk_40, part->unk_40, part->unk_40);
shim_guMtxCatF(sp50, sp10, sp10); guMtxCatF(sp50, sp10, sp10);
shim_guMtxF2L(sp10, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp10, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPMatrix(gMainGfxPos++, camera->unkMatrix, G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, camera->unkMatrix, G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW);
@ -210,8 +210,8 @@ void embers_appendGfx(void* effect) {
part++; part++;
for (i = 1; i < ((EffectInstance*)effect)->numParts; i++, part++) { for (i = 1; i < ((EffectInstance*)effect)->numParts; i++, part++) {
if (part->unk_64 >= 0) { if (part->unk_64 >= 0) {
shim_guTranslateF(sp10, part->unk_04, part->unk_08, part->unk_0C); guTranslateF(sp10, part->unk_04, part->unk_08, part->unk_0C);
shim_guMtxF2L(sp10, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp10, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
gDPSetTileSize(gMainGfxPos++, G_TX_RENDERTILE, 0, (i % 4) * 16 * 4, 15 * 4, ((i % 4) * 16 + 15) * 4); gDPSetTileSize(gMainGfxPos++, G_TX_RENDERTILE, 0, (i % 4) * 16 * 4, 15 * 4, ((i % 4) * 16 + 15) * 4);

View File

@ -63,9 +63,9 @@ void func_E0020000(EmoteFXData* part, s32 arg1) {
f32 sin; f32 sin;
f32 cos; f32 cos;
sin = shim_sin_deg(gCameras[gCurrentCameraID].currentYaw); sin = sin_deg(gCameras[gCurrentCameraID].currentYaw);
cos = shim_cos_deg(gCameras[gCurrentCameraID].currentYaw); cos = cos_deg(gCameras[gCurrentCameraID].currentYaw);
shim_guRotateF(sp18, -(unk_1C - 20.0f + arg1 * 20), sin, 0.0f, -cos); guRotateF(sp18, -(unk_1C - 20.0f + arg1 * 20), sin, 0.0f, -cos);
if (npc == PTR_LIST_END) { if (npc == PTR_LIST_END) {
part->unk_04 = gPlayerStatus.position.x + part->unk_10 + sp18[1][0] * (unk_20 + 16.0f); part->unk_04 = gPlayerStatus.position.x + part->unk_10 + sp18[1][0] * (unk_20 + 16.0f);
@ -105,9 +105,9 @@ void emote_main(s32 arg0, Npc* arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32
bp.renderUI = NULL; bp.renderUI = NULL;
bp.effectID = EFFECT_EMOTE; bp.effectID = EFFECT_EMOTE;
effect = shim_create_effect_instance(bpPtr); effect = create_effect_instance(bpPtr);
effect->numParts = numParts; effect->numParts = numParts;
data = effect->data.emote = shim_general_heap_malloc(numParts * sizeof(*data)); data = effect->data.emote = general_heap_malloc(numParts * sizeof(*data));
ASSERT(effect->data.emote != NULL); ASSERT(effect->data.emote != NULL);
data->unk_3C = arg1; data->unk_3C = arg1;
@ -161,7 +161,7 @@ void emote_update(EffectInstance* effect) {
part->unk_38 = D_E0020D80[part->unk_30][0]; part->unk_38 = D_E0020D80[part->unk_30][0];
part->unk_34 = 1; part->unk_34 = 1;
} else { } else {
shim_remove_effect(effect); remove_effect(effect);
return; return;
} }
} }
@ -171,7 +171,7 @@ void emote_update(EffectInstance* effect) {
} }
if (part->unk_2C < 0) { if (part->unk_2C < 0) {
shim_remove_effect(effect); remove_effect(effect);
return; return;
} }
@ -197,7 +197,7 @@ void emote_render(EffectInstance* effect) {
renderTask.distance = 0; renderTask.distance = 0;
renderTask.renderMode = RENDER_MODE_2D; renderTask.renderMode = RENDER_MODE_2D;
retTask = shim_queue_render_task(&renderTask); retTask = queue_render_task(&renderTask);
retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR;
} }
@ -221,18 +221,18 @@ void emote_appendGfx(void* effect) {
gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data));
if (type != 1) { if (type != 1) {
shim_guTranslateF(sp18, part->unk_04, part->unk_08, part->unk_0C); guTranslateF(sp18, part->unk_04, part->unk_08, part->unk_0C);
shim_guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f);
shim_guMtxCatF(sp58, sp18, sp18); guMtxCatF(sp58, sp18, sp18);
matrix = &gDisplayContext->matrixStack[gMatrixListPos]; matrix = &gDisplayContext->matrixStack[gMatrixListPos];
shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos++]); guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos++]);
shim_guScaleF(sp58, 1.0f, 0.8f, 1.0f); guScaleF(sp58, 1.0f, 0.8f, 1.0f);
shim_guMtxCatF(sp58, sp18, sp18); guMtxCatF(sp58, sp18, sp18);
shim_guRotateF(sp58, part->unk_24, 0.0f, 0.0f, 1.0f); guRotateF(sp58, part->unk_24, 0.0f, 0.0f, 1.0f);
shim_guMtxCatF(sp58, sp18, sp18); guMtxCatF(sp58, sp18, sp18);
shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(gMainGfxPos++, D_09002170_336DE0); gSPDisplayList(gMainGfxPos++, D_09002170_336DE0);
@ -240,14 +240,14 @@ void emote_appendGfx(void* effect) {
} else { } else {
if (part->unk_38 == 0) { if (part->unk_38 == 0) {
for (i = 0; i < 3; i++, part++) { for (i = 0; i < 3; i++, part++) {
shim_guTranslateF(sp18, part->unk_04, part->unk_08, part->unk_0C); guTranslateF(sp18, part->unk_04, part->unk_08, part->unk_0C);
shim_guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f);
shim_guMtxCatF(sp58, sp18, sp18); guMtxCatF(sp58, sp18, sp18);
shim_guRotateF(sp58, part->unk_24, 0.0f, 0.0f, 1.0f); guRotateF(sp58, part->unk_24, 0.0f, 0.0f, 1.0f);
shim_guMtxCatF(sp58, sp18, sp18); guMtxCatF(sp58, sp18, sp18);
shim_guScaleF(sp58, part->unk_28, part->unk_28, 1.0f); guScaleF(sp58, part->unk_28, part->unk_28, 1.0f);
shim_guMtxCatF(sp58, sp18, sp18); guMtxCatF(sp58, sp18, sp18);
shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]);
gDPSetPrimColor(gMainGfxPos++, 0, 0, 235, 28, 0, 255); gDPSetPrimColor(gMainGfxPos++, 0, 0, 235, 28, 0, 255);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);

View File

@ -41,9 +41,9 @@ void ending_decals_main(s32 type, f32 posX, f32 posY, f32 posZ, f32 arg4, Effect
bp.renderUI = NULL; bp.renderUI = NULL;
bp.effectID = EFFECT_ENDING_DECALS; bp.effectID = EFFECT_ENDING_DECALS;
effect = shim_create_effect_instance(&bp); effect = create_effect_instance(&bp);
effect->numParts = numParts; effect->numParts = numParts;
data = effect->data.endingDecals = shim_general_heap_malloc(numParts * sizeof(*data)); data = effect->data.endingDecals = general_heap_malloc(numParts * sizeof(*data));
ASSERT(effect->data.endingDecals != NULL); ASSERT(effect->data.endingDecals != NULL);
data->type = type; data->type = type;
@ -98,7 +98,7 @@ void ending_decals_update(EffectInstance* effect) {
data->unk_20++; data->unk_20++;
if (data->unk_1C < 0) { if (data->unk_1C < 0) {
shim_remove_effect(effect); remove_effect(effect);
return; return;
} }
@ -125,7 +125,7 @@ void ending_decals_render(EffectInstance* effect) {
renderTaskPtr->renderMode = RENDER_MODE_2D; renderTaskPtr->renderMode = RENDER_MODE_2D;
} }
retTask = shim_queue_render_task(renderTaskPtr); retTask = queue_render_task(renderTaskPtr);
retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR;
} }
@ -145,8 +145,8 @@ void ending_decals_appendGfx(void* effect) {
gDPPipeSync(gMainGfxPos++); gDPPipeSync(gMainGfxPos++);
gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data));
shim_guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].currentYaw, 0.0f, data->scale, data->pos.x, data->pos.y, data->pos.z); guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].currentYaw, 0.0f, data->scale, data->pos.x, data->pos.y, data->pos.z);
shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);

View File

@ -48,9 +48,9 @@ EffectInstance* energy_in_out_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 a
bp.renderUI = NULL; bp.renderUI = NULL;
bp.effectID = EFFECT_ENERGY_IN_OUT; bp.effectID = EFFECT_ENERGY_IN_OUT;
effect = shim_create_effect_instance(&bp); effect = create_effect_instance(&bp);
effect->numParts = numParts; effect->numParts = numParts;
firstPart = part = effect->data.energyInOut = shim_general_heap_malloc(numParts * sizeof(*part)); firstPart = part = effect->data.energyInOut = general_heap_malloc(numParts * sizeof(*part));
ASSERT(effect->data.energyInOut != NULL); ASSERT(effect->data.energyInOut != NULL);
part->unk_00 = arg0; part->unk_00 = arg0;
@ -74,7 +74,7 @@ EffectInstance* energy_in_out_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 a
part->unk_44 = 1.0f; part->unk_44 = 1.0f;
part->unk_38 = D_E00D6E84[arg0]; part->unk_38 = D_E00D6E84[arg0];
randAngle = shim_rand_int(360); randAngle = rand_int(360);
part++; part++;
for (i = 1; i < effect->numParts; i++, part++) { for (i = 1; i < effect->numParts; i++, part++) {
@ -84,38 +84,38 @@ EffectInstance* energy_in_out_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 a
case 0: case 0:
case 1: case 1:
case 2: case 2:
part->unk_38 = -(shim_rand_int(10) * 0.2 + 0.2); part->unk_38 = -(rand_int(10) * 0.2 + 0.2);
part->unk_10 = 20; part->unk_10 = 20;
part->unk_40 = 0; part->unk_40 = 0;
part->scale = 1.0 - (i % 3) * 0.1; part->scale = 1.0 - (i % 3) * 0.1;
break; break;
case 3: case 3:
case 5: case 5:
part->unk_38 = shim_rand_int(10) * 0.2 + 0.2; part->unk_38 = rand_int(10) * 0.2 + 0.2;
part->unk_10 = 20; part->unk_10 = 20;
part->unk_40 = 0; part->unk_40 = 0;
part->scale = 1.0 - (i % 3) * 0.1; part->scale = 1.0 - (i % 3) * 0.1;
break; break;
case 6: case 6:
part->unk_38 = -(shim_rand_int(10) + 4); part->unk_38 = -(rand_int(10) + 4);
part->unk_10 = 10; part->unk_10 = 10;
part->unk_40 = 0; part->unk_40 = 0;
part->scale = 1.0 - (i % 3) * 0.3; part->scale = 1.0 - (i % 3) * 0.3;
break; break;
case 7: case 7:
part->unk_38 = -(shim_rand_int(10) + 4); part->unk_38 = -(rand_int(10) + 4);
part->unk_10 = 10; part->unk_10 = 10;
part->unk_40 = 0; part->unk_40 = 0;
part->scale = 1.0 - (i % 3) * 0.3; part->scale = 1.0 - (i % 3) * 0.3;
break; break;
case 8: case 8:
part->unk_38 = shim_rand_int(10) * 0.2 + 0.6; part->unk_38 = rand_int(10) * 0.2 + 0.6;
part->unk_10 = 20; part->unk_10 = 20;
part->unk_40 = -1.0f; part->unk_40 = -1.0f;
part->scale = 1.0 - (i % 3) * 0.3; part->scale = 1.0 - (i % 3) * 0.3;
break; break;
case 9: case 9:
part->unk_38 = -(shim_rand_int(10) * 0.2 + 0.6); part->unk_38 = -(rand_int(10) * 0.2 + 0.6);
part->unk_10 = 20; part->unk_10 = 20;
part->unk_40 = -2.0f; part->unk_40 = -2.0f;
part->scale = 1.0 - (i % 3) * 0.3; part->scale = 1.0 - (i % 3) * 0.3;
@ -127,27 +127,27 @@ EffectInstance* energy_in_out_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 a
firstPart->unk_30 = 10; firstPart->unk_30 = 10;
break; break;
case 10: case 10:
part->unk_38 = shim_rand_int(10) * 0.1 + 2.0; part->unk_38 = rand_int(10) * 0.1 + 2.0;
part->unk_10 = 10; part->unk_10 = 10;
part->unk_40 = 0; part->unk_40 = 0;
part->scale = (1.0 - (i % 3) * 0.3) * 0.5; part->scale = (1.0 - (i % 3) * 0.3) * 0.5;
break; break;
case 11: case 11:
part->unk_38 = shim_rand_int(10) * 0.05 + 0.2; part->unk_38 = rand_int(10) * 0.05 + 0.2;
part->unk_40 = -1.0f; part->unk_40 = -1.0f;
part->unk_10 = 30; part->unk_10 = 30;
part->scale = 1.0 - (i % 3) * 0.3; part->scale = 1.0 - (i % 3) * 0.3;
break; break;
case 4: case 4:
case 12: case 12:
part->unk_38 = shim_rand_int(10) * 0.2 + 0.6; part->unk_38 = rand_int(10) * 0.2 + 0.6;
part->unk_10 = 20; part->unk_10 = 20;
part->unk_40 = -2.0f; part->unk_40 = -2.0f;
part->scale = 1.0 - (i % 3) * 0.3; part->scale = 1.0 - (i % 3) * 0.3;
break; break;
} }
part->unk_14 = -shim_rand_int(part->unk_10); part->unk_14 = -rand_int(part->unk_10);
if (part->unk_38 < 0.0f) { if (part->unk_38 < 0.0f) {
part->pos.x = (part->unk_10 - part->unk_14) * (-part->unk_38); part->pos.x = (part->unk_10 - part->unk_14) * (-part->unk_38);
@ -184,7 +184,7 @@ void energy_in_out_update(EffectInstance* effect) {
part->unk_14++; part->unk_14++;
if (part->unk_10 < 0) { if (part->unk_10 < 0) {
shim_remove_effect(effect); remove_effect(effect);
return; return;
} }
@ -209,7 +209,7 @@ void energy_in_out_update(EffectInstance* effect) {
} else { } else {
part->pos.x = 0.0f; part->pos.x = 0.0f;
} }
part->unk_3C = shim_rand_int(359); part->unk_3C = rand_int(359);
} }
part->pos.x += part->unk_38; part->pos.x += part->unk_38;
@ -219,7 +219,7 @@ void energy_in_out_update(EffectInstance* effect) {
if (angle < 0.0f || angle > 180.0f) { if (angle < 0.0f || angle > 180.0f) {
part->unk_24 = 0; part->unk_24 = 0;
} else { } else {
part->unk_24 = shim_sin_deg(angle) * 255.0f; part->unk_24 = sin_deg(angle) * 255.0f;
} }
} }
} }
@ -233,7 +233,7 @@ void energy_in_out_render(EffectInstance* effect) {
renderTask.distance = 10; renderTask.distance = 10;
renderTask.renderMode = RENDER_MODE_2D; renderTask.renderMode = RENDER_MODE_2D;
retTask = shim_queue_render_task(&renderTask); retTask = queue_render_task(&renderTask);
} }
void func_E00D6978(void) { void func_E00D6978(void) {
@ -255,8 +255,8 @@ void energy_in_out_appendGfx(void* effect) {
gDPPipeSync(gMainGfxPos++); gDPPipeSync(gMainGfxPos++);
gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data));
shim_guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].currentYaw, 0.0f, scale, part->pos.x, part->pos.y, part->pos.z); guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].currentYaw, 0.0f, scale, part->pos.x, part->pos.y, part->pos.z);
shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gDPSetPrimColor(gMainGfxPos++, 0, 0, part->unk_18, part->unk_1C, part->unk_20, unk_24); gDPSetPrimColor(gMainGfxPos++, 0, 0, part->unk_18, part->unk_1C, part->unk_20, unk_24);
@ -269,16 +269,16 @@ void energy_in_out_appendGfx(void* effect) {
gDPSetPrimColor(gMainGfxPos++, 0, 0, unk_18, unk_1C, unk_20, (unk_24 * part->unk_24) / 255); gDPSetPrimColor(gMainGfxPos++, 0, 0, unk_18, unk_1C, unk_20, (unk_24 * part->unk_24) / 255);
shim_guRotateF(sp20, part->unk_3C, 0.0f, 0.0f, 1.0f); guRotateF(sp20, part->unk_3C, 0.0f, 0.0f, 1.0f);
shim_guTranslateF(sp60, part->pos.x + unk_38, 0.0f, 0.0f); guTranslateF(sp60, part->pos.x + unk_38, 0.0f, 0.0f);
shim_guMtxCatF(sp60, sp20, sp20); guMtxCatF(sp60, sp20, sp20);
if (D_E00D6E40[unk_00] == D_09000688_3D65B8 || D_E00D6E40[unk_00] == D_09000808_3D6738) { if (D_E00D6E40[unk_00] == D_09000688_3D65B8 || D_E00D6E40[unk_00] == D_09000808_3D6738) {
shim_guScaleF(sp60, scale, 1.0f, 1.0f); guScaleF(sp60, scale, 1.0f, 1.0f);
} else { } else {
shim_guScaleF(sp60, scale, scale, 1.0f); guScaleF(sp60, scale, scale, 1.0f);
} }
shim_guMtxCatF(sp60, sp20, sp20); guMtxCatF(sp60, sp20, sp20);
shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
gSPDisplayList(gMainGfxPos++, D_E00D6E40[unk_00]); gSPDisplayList(gMainGfxPos++, D_E00D6E40[unk_00]);

View File

@ -25,9 +25,9 @@ EffectInstance* energy_orb_wave_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32
bp.renderUI = NULL; bp.renderUI = NULL;
bp.effectID = EFFECT_ENERGY_ORB_WAVE; bp.effectID = EFFECT_ENERGY_ORB_WAVE;
effect = shim_create_effect_instance(&bp); effect = create_effect_instance(&bp);
effect->numParts = numParts; effect->numParts = numParts;
data = effect->data.energyOrbWave = shim_general_heap_malloc(numParts * sizeof(*data)); data = effect->data.energyOrbWave = general_heap_malloc(numParts * sizeof(*data));
ASSERT(effect->data.energyOrbWave != NULL); ASSERT(effect->data.energyOrbWave != NULL);
data->unk_00 = arg0; data->unk_00 = arg0;
@ -99,7 +99,7 @@ void energy_orb_wave_update(EffectInstance* effect) {
data->unk_14++; data->unk_14++;
if (data->unk_10 < 0) { if (data->unk_10 < 0) {
shim_remove_effect(effect); remove_effect(effect);
return; return;
} }
@ -121,7 +121,7 @@ void energy_orb_wave_update(EffectInstance* effect) {
data->unk_20 = 70; data->unk_20 = 70;
data->unk_24 = 180; data->unk_24 = 180;
data->unk_28 = 120; data->unk_28 = 120;
var_float = shim_sin_deg(unk_14 * 2) * 10.0f + 190.0f; var_float = sin_deg(unk_14 * 2) * 10.0f + 190.0f;
data->unk_2C = ((s32) var_float * var_1) / 255; data->unk_2C = ((s32) var_float * var_1) / 255;
break; break;
case 1: case 1:
@ -135,7 +135,7 @@ void energy_orb_wave_update(EffectInstance* effect) {
data->unk_20 = 170; data->unk_20 = 170;
data->unk_24 = 40; data->unk_24 = 40;
data->unk_28 = 110; data->unk_28 = 110;
var_float = shim_sin_deg(unk_14 * 2) * 10.0f + 190.0f; var_float = sin_deg(unk_14 * 2) * 10.0f + 190.0f;
data->unk_2C = ((s32) var_float * var_1) / 255; data->unk_2C = ((s32) var_float * var_1) / 255;
break; break;
case 3: case 3:
@ -149,7 +149,7 @@ void energy_orb_wave_update(EffectInstance* effect) {
data->unk_20 = 235; data->unk_20 = 235;
data->unk_24 = 235; data->unk_24 = 235;
data->unk_28 = 200; data->unk_28 = 200;
var_float = shim_sin_deg(unk_14 * 2) * 15.0f + 215.0f; var_float = sin_deg(unk_14 * 2) * 15.0f + 215.0f;
data->unk_2C = ((s32) var_float * var_1) / 255; data->unk_2C = ((s32) var_float * var_1) / 255;
break; break;
case 5: case 5:
@ -213,11 +213,11 @@ void energy_orb_wave_render(EffectInstance* effect) {
renderTask.appendGfxArg = effect; renderTask.appendGfxArg = effect;
renderTask.renderMode = RENDER_MODE_2D; renderTask.renderMode = RENDER_MODE_2D;
if (effect82->unk_00 >= 3) { if (effect82->unk_00 >= 3) {
shim_queue_render_task(renderTaskPointer); queue_render_task(renderTaskPointer);
return; return;
} }
retTask = shim_queue_render_task(renderTaskPointer); retTask = queue_render_task(renderTaskPointer);
retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR;
} }
@ -236,10 +236,10 @@ void energy_orb_wave_appendGfx(void* effect) {
gDPPipeSync(gMainGfxPos++); gDPPipeSync(gMainGfxPos++);
gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data));
shim_guTranslateF(sp18, data->pos.x, data->pos.y, data->pos.z); guTranslateF(sp18, data->pos.x, data->pos.y, data->pos.z);
shim_guScaleF(sp58, data->scale, data->scale, data->scale); guScaleF(sp58, data->scale, data->scale, data->scale);
shim_guMtxCatF(sp58, sp18, sp18); guMtxCatF(sp58, sp18, sp18);
shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPMatrix(gMainGfxPos++, camera->unkMatrix, G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, camera->unkMatrix, G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW);
@ -250,16 +250,16 @@ void energy_orb_wave_appendGfx(void* effect) {
if (unk_00 < 3) { if (unk_00 < 3) {
gSPDisplayList(gMainGfxPos++, D_09001000_3A5320); gSPDisplayList(gMainGfxPos++, D_09001000_3A5320);
shim_guRotateF(sp18, unk_14, 0.0f, 0.0f, 1.0f); guRotateF(sp18, unk_14, 0.0f, 0.0f, 1.0f);
shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
gSPDisplayList(gMainGfxPos++, D_090011D0_3A54F0); gSPDisplayList(gMainGfxPos++, D_090011D0_3A54F0);
gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW); gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
gDPSetColorDither(gMainGfxPos++, G_CD_MAGICSQ); gDPSetColorDither(gMainGfxPos++, G_CD_MAGICSQ);
shim_guRotateF(sp18, -unk_14 * 8, 0.0f, 0.0f, 1.0f); guRotateF(sp18, -unk_14 * 8, 0.0f, 0.0f, 1.0f);
shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
gSPDisplayList(gMainGfxPos++, D_090011F0_3A5510); gSPDisplayList(gMainGfxPos++, D_090011F0_3A5510);

View File

@ -29,9 +29,9 @@ void energy_shockwave_main(
bp.renderUI = NULL; bp.renderUI = NULL;
bp.effectID = EFFECT_ENERGY_SHOCKWAVE; bp.effectID = EFFECT_ENERGY_SHOCKWAVE;
effect = shim_create_effect_instance(&bp); effect = create_effect_instance(&bp);
effect->numParts = numParts; effect->numParts = numParts;
data = effect->data.energyShockwave = shim_general_heap_malloc(numParts * sizeof(*data)); data = effect->data.energyShockwave = general_heap_malloc(numParts * sizeof(*data));
ASSERT(effect->data.energyShockwave != NULL); ASSERT(effect->data.energyShockwave != NULL);
data->unk_00 = arg0; data->unk_00 = arg0;
@ -72,15 +72,15 @@ void energy_shockwave_update(EffectInstance* effect) {
unk_2C = data->unk_2C; unk_2C = data->unk_2C;
if (unk_28 < 0) { if (unk_28 < 0) {
shim_remove_effect(effect); remove_effect(effect);
return; return;
} }
if (unk_2C % 2) { if (unk_2C % 2) {
angle = func_E0200044(360, unk_2C); angle = func_E0200044(360, unk_2C);
shim_sin_deg(angle); sin_deg(angle);
shim_cos_deg(angle); cos_deg(angle);
shim_load_effect(EFFECT_SHIMMER_WAVE); load_effect(EFFECT_SHIMMER_WAVE);
shimmer_wave_main(0, data->unk_04, data->unk_08, data->unk_0C, unk_2C * 8, 10.0f, 10, 20); shimmer_wave_main(0, data->unk_04, data->unk_08, data->unk_0C, unk_2C * 8, 10.0f, 10, 20);
} }
@ -131,7 +131,7 @@ void energy_shockwave_render(EffectInstance* effect) {
renderTask.distance = 10; renderTask.distance = 10;
renderTask.renderMode = RENDER_MODE_SURFACE_XLU_LAYER3; renderTask.renderMode = RENDER_MODE_SURFACE_XLU_LAYER3;
retTask = shim_queue_render_task(&renderTask); retTask = queue_render_task(&renderTask);
retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR;
} }
@ -158,10 +158,10 @@ void energy_shockwave_appendGfx(void* effect) {
gDPSetTileSize(gMainGfxPos++, G_TX_RENDERTILE, uls, ult, uls + 252, ult + 252); gDPSetTileSize(gMainGfxPos++, G_TX_RENDERTILE, uls, ult, uls + 252, ult + 252);
gDPSetTileSize(gMainGfxPos++, 1, uls2, ult2, uls2 + 124, ult2 + 124); gDPSetTileSize(gMainGfxPos++, 1, uls2, ult2, uls2 + 124, ult2 + 124);
shim_guTranslateF(sp10, data->unk_04, data->unk_08, data->unk_0C); guTranslateF(sp10, data->unk_04, data->unk_08, data->unk_0C);
shim_guScaleF(sp50, data->unk_1C, data->unk_1C, data->unk_1C); guScaleF(sp50, data->unk_1C, data->unk_1C, data->unk_1C);
shim_guMtxCatF(sp50, sp10, sp10); guMtxCatF(sp50, sp10, sp10);
shim_guMtxF2L(sp10, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp10, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
gSPDisplayList(gMainGfxPos++, D_09000DC0_3762D0); gSPDisplayList(gMainGfxPos++, D_09000DC0_3762D0);

View File

@ -40,9 +40,9 @@ void explosion_main(s32 type, f32 x, f32 y, f32 z) {
bpPtr->effectID = EFFECT_EXPLOSION; bpPtr->effectID = EFFECT_EXPLOSION;
effect = shim_create_effect_instance(bpPtr); effect = create_effect_instance(bpPtr);
effect->numParts = numParts; effect->numParts = numParts;
effect->data.explosion = data = shim_general_heap_malloc(effect->numParts * sizeof(*data)); effect->data.explosion = data = general_heap_malloc(effect->numParts * sizeof(*data));
ASSERT(effect->data.explosion != NULL); ASSERT(effect->data.explosion != NULL);
data->pos.x = x; data->pos.x = x;
@ -100,7 +100,7 @@ void explosion_update(EffectInstance* effect) {
part->unk_30--; part->unk_30--;
if (part->unk_30 < 0) { if (part->unk_30 < 0) {
shim_remove_effect(effect); remove_effect(effect);
return; return;
} }
@ -110,10 +110,10 @@ void explosion_update(EffectInstance* effect) {
unk_34 = part->unk_34; unk_34 = part->unk_34;
if (unk_34 == 7) { if (unk_34 == 7) {
shim_load_effect(EFFECT_SMOKE_RING); load_effect(EFFECT_SMOKE_RING);
smoke_ring_main(unk_00, part->pos.x, part->pos.y, part->pos.z); smoke_ring_main(unk_00, part->pos.x, part->pos.y, part->pos.z);
} else if (unk_34 == 1) { } else if (unk_34 == 1) {
shim_load_effect(EFFECT_CONFETTI); load_effect(EFFECT_CONFETTI);
confetti_main(unk_00 + 4, part->pos.x, part->pos.y, part->pos.z, 1.0f, 50); confetti_main(unk_00 + 4, part->pos.x, part->pos.y, part->pos.z, 1.0f, 50);
} }
@ -156,7 +156,7 @@ void explosion_render(EffectInstance* effect) {
renderTask.distance = 10; renderTask.distance = 10;
renderTask.renderMode = RENDER_MODE_2D; renderTask.renderMode = RENDER_MODE_2D;
retTask = shim_queue_render_task(&renderTask); retTask = queue_render_task(&renderTask);
} }
void explosion_appendGfx(void* effect) { void explosion_appendGfx(void* effect) {
@ -171,10 +171,10 @@ void explosion_appendGfx(void* effect) {
gDPPipeSync(gMainGfxPos++); gDPPipeSync(gMainGfxPos++);
gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data));
shim_guTranslateF(sp18, part->pos.x, part->pos.y, part->pos.z); guTranslateF(sp18, part->pos.x, part->pos.y, part->pos.z);
shim_guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f);
shim_guMtxCatF(sp58, sp18, sp18); guMtxCatF(sp58, sp18, sp18);
shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]);
part++; part++;
@ -183,8 +183,8 @@ void explosion_appendGfx(void* effect) {
if (part->unk_00 != -1) { if (part->unk_00 != -1) {
gSPDisplayList(gMainGfxPos++, D_09000840_3447B0); gSPDisplayList(gMainGfxPos++, D_09000840_3447B0);
shim_guScaleF(sp18, part->unk_20, part->unk_20, 1.0f); guScaleF(sp18, part->unk_20, part->unk_20, 1.0f);
shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]);
gDPSetPrimColor(gMainGfxPos++, 0, 0, 255, 255, 240, part->unk_38); gDPSetPrimColor(gMainGfxPos++, 0, 0, 255, 255, 240, part->unk_38);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
@ -196,10 +196,10 @@ void explosion_appendGfx(void* effect) {
gSPDisplayList(gMainGfxPos++, D_09000910_344880); gSPDisplayList(gMainGfxPos++, D_09000910_344880);
shim_guScaleF(sp18, part->unk_20, part->unk_20, part->unk_20); guScaleF(sp18, part->unk_20, part->unk_20, part->unk_20);
shim_guRotateF(sp58, part->unk_28, 0.0f, 0.0f, 1.0f); guRotateF(sp58, part->unk_28, 0.0f, 0.0f, 1.0f);
shim_guMtxCatF(sp58, sp18, sp18); guMtxCatF(sp58, sp18, sp18);
shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]);
switch (unk_34) { switch (unk_34) {
default: default:

View File

@ -23,9 +23,9 @@ void falling_leaves_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3) {
bp.renderUI = NULL; bp.renderUI = NULL;
bp.effectID = EFFECT_FALLING_LEAVES; bp.effectID = EFFECT_FALLING_LEAVES;
effect = shim_create_effect_instance(&bp); effect = create_effect_instance(&bp);
effect->numParts = numParts; effect->numParts = numParts;
part = effect->data.fallingLeaves = shim_general_heap_malloc(numParts * sizeof(*part)); part = effect->data.fallingLeaves = general_heap_malloc(numParts * sizeof(*part));
ASSERT(effect->data.fallingLeaves != NULL); ASSERT(effect->data.fallingLeaves != NULL);
part->unk_00 = arg0; part->unk_00 = arg0;
@ -38,12 +38,12 @@ void falling_leaves_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3) {
part++; part++;
for (i = 1; i < numParts; i++, part++) { for (i = 1; i < numParts; i++, part++) {
part->unk_04 = shim_rand_int(30) - 15; part->unk_04 = rand_int(30) - 15;
part->unk_08 = 0; part->unk_08 = 0;
part->unk_0C = shim_rand_int(30) - 15; part->unk_0C = rand_int(30) - 15;
part->unk_18 = shim_rand_int(360); part->unk_18 = rand_int(360);
part->unk_20 = shim_rand_int(360); part->unk_20 = rand_int(360);
part->unk_1C = shim_rand_int(100) / 10; part->unk_1C = rand_int(100) / 10;
part->unk_10 = 0; part->unk_10 = 0;
part->unk_14 = 0; part->unk_14 = 0;
} }
@ -73,7 +73,7 @@ void falling_leaves_update(EffectInstance* effect) {
unk_28 = part->unk_28; unk_28 = part->unk_28;
if (unk_28 < 0) { if (unk_28 < 0) {
shim_remove_effect(effect); remove_effect(effect);
return; return;
} }
@ -87,22 +87,22 @@ void falling_leaves_update(EffectInstance* effect) {
part++; part++;
for (i = 1; i < effect->numParts; i++, part++) { for (i = 1; i < effect->numParts; i++, part++) {
temp = shim_sin_deg(2.0f * part->unk_18) * 0.2; temp = sin_deg(2.0f * part->unk_18) * 0.2;
part->unk_14 += -0.05f; part->unk_14 += -0.05f;
part->unk_10 += temp; part->unk_10 += temp;
if (unk_00 == 0) { if (unk_00 == 0) {
part->unk_10 *= 0.94; part->unk_10 *= 0.94;
part->unk_14 *= shim_sin_deg(part->unk_18) * 0.05 + 0.95; part->unk_14 *= sin_deg(part->unk_18) * 0.05 + 0.95;
} else { } else {
part->unk_14 += -0.05f; part->unk_14 += -0.05f;
part->unk_10 *= 0.92; part->unk_10 *= 0.92;
} }
part->unk_1C += shim_rand_int(50) - 25.0f; part->unk_1C += rand_int(50) - 25.0f;
part->unk_18 += shim_sin_deg(part->unk_1C) * 10.0f; part->unk_18 += sin_deg(part->unk_1C) * 10.0f;
part->unk_20 += shim_cos_deg(part->unk_1C * 0.5f) * 10.0f; part->unk_20 += cos_deg(part->unk_1C * 0.5f) * 10.0f;
part->unk_04 += part->unk_10; part->unk_04 += part->unk_10;
part->unk_08 += part->unk_14; part->unk_08 += part->unk_14;
} }
@ -117,7 +117,7 @@ void falling_leaves_render(EffectInstance* effect) {
renderTask.distance = 0; renderTask.distance = 0;
renderTask.renderMode = RENDER_MODE_2D; renderTask.renderMode = RENDER_MODE_2D;
retTask = shim_queue_render_task(&renderTask); retTask = queue_render_task(&renderTask);
retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR;
} }
@ -132,19 +132,19 @@ void falling_leaves_appendGfx(void* effect) {
gSPDisplayList(gMainGfxPos++, D_09001100_3601E0); gSPDisplayList(gMainGfxPos++, D_09001100_3601E0);
gDPSetPrimColor(gMainGfxPos++, 0, 0, 20, 100, 20, part->unk_24); gDPSetPrimColor(gMainGfxPos++, 0, 0, 20, 100, 20, part->unk_24);
shim_guTranslateF(sp18, part->unk_04, part->unk_08, part->unk_0C); guTranslateF(sp18, part->unk_04, part->unk_08, part->unk_0C);
shim_guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f);
shim_guMtxCatF(sp58, sp18, sp98); guMtxCatF(sp58, sp18, sp98);
part++; part++;
for (i = 1; i < ((EffectInstance*)effect)->numParts; i++, part++) { for (i = 1; i < ((EffectInstance*)effect)->numParts; i++, part++) {
shim_guTranslateF(sp58, part->unk_04, part->unk_08, part->unk_0C); guTranslateF(sp58, part->unk_04, part->unk_08, part->unk_0C);
shim_guMtxCatF(sp58, sp98, sp18); guMtxCatF(sp58, sp98, sp18);
shim_guRotateF(sp58, part->unk_18, 0.0f, 0.0f, 1.0f); guRotateF(sp58, part->unk_18, 0.0f, 0.0f, 1.0f);
shim_guMtxCatF(sp58, sp18, sp18); guMtxCatF(sp58, sp18, sp18);
shim_guRotateF(sp58, part->unk_20, 0.0f, 1.0f, 0.0f); guRotateF(sp58, part->unk_20, 0.0f, 1.0f, 0.0f);
shim_guMtxCatF(sp58, sp18, sp18); guMtxCatF(sp58, sp18, sp18);
shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
gSPDisplayList(gMainGfxPos++, D_090011B0_360290); gSPDisplayList(gMainGfxPos++, D_090011B0_360290);

View File

@ -34,9 +34,9 @@ EffectInstance* fire_breath_main(
bp.renderUI = NULL; bp.renderUI = NULL;
bp.effectID = EFFECT_FIRE_BREATH; bp.effectID = EFFECT_FIRE_BREATH;
effect = shim_create_effect_instance(&bp); effect = create_effect_instance(&bp);
effect->numParts = numParts; effect->numParts = numParts;
data = effect->data.fireBreath = shim_general_heap_malloc(numParts * sizeof(*data)); data = effect->data.fireBreath = general_heap_malloc(numParts * sizeof(*data));
ASSERT(effect->data.fireBreath != NULL); ASSERT(effect->data.fireBreath != NULL);
data->type = type; data->type = type;
@ -102,7 +102,7 @@ void fire_breath_update(EffectInstance* effect) {
data->spawnTimer++; data->spawnTimer++;
if (data->timeLeft < 0) { if (data->timeLeft < 0) {
shim_remove_effect(effect); remove_effect(effect);
return; return;
} }
@ -126,7 +126,7 @@ void fire_breath_update(EffectInstance* effect) {
if (spawnTimer == data->spawnDelay + 1 && data->numChildren > 0) { if (spawnTimer == data->spawnDelay + 1 && data->numChildren > 0) {
EffectInstance* spawned; EffectInstance* spawned;
shim_load_effect(EFFECT_FIRE_BREATH); load_effect(EFFECT_FIRE_BREATH);
spawned = fire_breath_main( spawned = fire_breath_main(
data->type, data->initPos.x, data->initPos.y, data->initPos.z, data->endPos.x, data->endPos.y, data->type, data->initPos.x, data->initPos.y, data->initPos.z, data->endPos.x, data->endPos.y,
data->endPos.z, data->numChildren - 1, data->spawnDelay, lifeTime data->endPos.z, data->numChildren - 1, data->spawnDelay, lifeTime
@ -174,7 +174,7 @@ void fire_breath_render(EffectInstance* effect) {
} }
renderTaskPointer->renderMode = RENDER_MODE_2D; renderTaskPointer->renderMode = RENDER_MODE_2D;
retTask = shim_queue_render_task(renderTaskPointer); retTask = queue_render_task(renderTaskPointer);
retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR;
} }
@ -192,10 +192,10 @@ void fire_breath_appendGfx(void* effect) {
gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data));
if (type == FIRE_BREATH_SMALL) { if (type == FIRE_BREATH_SMALL) {
shim_guTranslateF(sp18, data->initPos.x, data->initPos.y, data->initPos.z); guTranslateF(sp18, data->initPos.x, data->initPos.y, data->initPos.z);
shim_guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f);
shim_guMtxCatF(sp58, sp18, sp18); guMtxCatF(sp58, sp18, sp18);
shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++],
G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
@ -210,12 +210,12 @@ void fire_breath_appendGfx(void* effect) {
gDPSetTileSize(gMainGfxPos++, G_TX_RENDERTILE, ((unk_5C * 32) + 0) * 4, 0, ((unk_5C * 32) + 32) * 4, 128); gDPSetTileSize(gMainGfxPos++, G_TX_RENDERTILE, ((unk_5C * 32) + 0) * 4, 0, ((unk_5C * 32) + 32) * 4, 128);
gDPSetTileSize(gMainGfxPos++, 1, ((unk_5C * 32) + 32) * 4, 0, ((unk_5C * 32) + 64) * 4, 128); gDPSetTileSize(gMainGfxPos++, 1, ((unk_5C * 32) + 32) * 4, 0, ((unk_5C * 32) + 64) * 4, 128);
shim_guTranslateF(sp18, data->pos.x, data->pos.y, data->pos.z); guTranslateF(sp18, data->pos.x, data->pos.y, data->pos.z);
shim_guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f);
shim_guMtxCatF(sp58, sp18, sp18); guMtxCatF(sp58, sp18, sp18);
shim_guScaleF(sp58, data->scale, data->scale, 0.0f); guScaleF(sp58, data->scale, data->scale, 0.0f);
shim_guMtxCatF(sp58, sp18, sp18); guMtxCatF(sp58, sp18, sp18);
shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++],
G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);

View File

@ -31,9 +31,9 @@ EffectInstance* fire_flower_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, s32 arg
bp.renderUI = NULL; bp.renderUI = NULL;
bp.effectID = EFFECT_FIRE_FLOWER; bp.effectID = EFFECT_FIRE_FLOWER;
effect = shim_create_effect_instance(&bp); effect = create_effect_instance(&bp);
effect->numParts = numParts; effect->numParts = numParts;
part = shim_general_heap_malloc(numParts * sizeof(*part)); part = general_heap_malloc(numParts * sizeof(*part));
effect->data.fireFlower = part; effect->data.fireFlower = part;
ASSERT(effect->data.fireFlower != NULL); ASSERT(effect->data.fireFlower != NULL);
@ -90,13 +90,13 @@ void fire_flower_update(EffectInstance* effect) {
unk_40X = part->unk_40.x; unk_40X = part->unk_40.x;
if (unk_04 == 7) { if (unk_04 == 7) {
shim_remove_effect(effect); remove_effect(effect);
return; return;
} }
switch (unk_04) { switch (unk_04) {
case 0: case 0:
shim_load_effect(EFFECT_STARS_SPREAD); load_effect(EFFECT_STARS_SPREAD);
stars_spread_main(0, part->pos.x - 10.0f, part->pos.y, part->pos.z, 7, 20); stars_spread_main(0, part->pos.x - 10.0f, part->pos.y, part->pos.z, 7, 20);
part->unk_34 = 0; part->unk_34 = 0;
part->unk_38 = 0; part->unk_38 = 0;
@ -194,7 +194,7 @@ void fire_flower_render(EffectInstance* effect) {
renderTask.distance = 0; renderTask.distance = 0;
renderTask.renderMode = RENDER_MODE_2D; renderTask.renderMode = RENDER_MODE_2D;
retTask = shim_queue_render_task(&renderTask); retTask = queue_render_task(&renderTask);
retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR;
} }
@ -212,18 +212,18 @@ void fire_flower_appendGfx(void* effect) {
gDPPipeSync(gMainGfxPos++); gDPPipeSync(gMainGfxPos++);
gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data));
shim_guTranslateF(sp18, part->pos.x, part->pos.y, part->pos.z); guTranslateF(sp18, part->pos.x, part->pos.y, part->pos.z);
shim_guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f);
shim_guMtxCatF(sp58, sp18, sp18); guMtxCatF(sp58, sp18, sp18);
shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gDPSetPrimColor(gMainGfxPos++, 0, 0, 255, 0, 0, part->unk_3C); gDPSetPrimColor(gMainGfxPos++, 0, 0, 255, 0, 0, part->unk_3C);
gDPSetEnvColor(gMainGfxPos++, 255, 0, 0, part->unk_38); gDPSetEnvColor(gMainGfxPos++, 255, 0, 0, part->unk_38);
if ((u32) (unk_04 - 4) < 3U) { if ((u32) (unk_04 - 4) < 3U) {
shim_guTranslateF(sp18, 0.0f, 16.0f, 0.0f); guTranslateF(sp18, 0.0f, 16.0f, 0.0f);
shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
gSPDisplayList(gMainGfxPos++, D_09000DE0_381180); gSPDisplayList(gMainGfxPos++, D_09000DE0_381180);
@ -231,10 +231,10 @@ void fire_flower_appendGfx(void* effect) {
part++; part++;
for (i = 1; i < ((EffectInstance*)effect)->numParts; i++, part++) { for (i = 1; i < ((EffectInstance*)effect)->numParts; i++, part++) {
if (part->unk_40.z == 0) { if (part->unk_40.z == 0) {
shim_guRotateF(sp18, part->unk_24, 0.0f, 0.0f, 1.0f); guRotateF(sp18, part->unk_24, 0.0f, 0.0f, 1.0f);
shim_guTranslateF(sp58, part->pos.x, part->pos.y, part->pos.z); guTranslateF(sp58, part->pos.x, part->pos.y, part->pos.z);
shim_guMtxCatF(sp58, sp18, sp18); guMtxCatF(sp58, sp18, sp18);
shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
gSPDisplayList(gMainGfxPos++, part->unk_00 != 0 ? D_09000ED8_381278 : D_09000EB8_381258); gSPDisplayList(gMainGfxPos++, part->unk_00 != 0 ? D_09000ED8_381278 : D_09000EB8_381258);
@ -257,12 +257,12 @@ void fire_flower_appendGfx(void* effect) {
G_TX_MIRROR | G_TX_WRAP, G_TX_MIRROR | G_TX_WRAP, G_TX_MIRROR | G_TX_WRAP, G_TX_MIRROR | G_TX_WRAP,
5, 5, G_TX_NOLOD, G_TX_NOLOD); 5, 5, G_TX_NOLOD, G_TX_NOLOD);
shim_guTranslateF(sp18, unk_2C, 0.0f, 0.0f); guTranslateF(sp18, unk_2C, 0.0f, 0.0f);
shim_guScaleF(sp58, unk_30, unk_30, unk_30); guScaleF(sp58, unk_30, unk_30, unk_30);
shim_guMtxCatF(sp58, sp18, sp18); guMtxCatF(sp58, sp18, sp18);
shim_guRotateF(sp58, unk_28, 0.0f, 1.0f, 0.0f); guRotateF(sp58, unk_28, 0.0f, 1.0f, 0.0f);
shim_guMtxCatF(sp58, sp18, sp18); guMtxCatF(sp58, sp18, sp18);
shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
gSPDisplayList(gMainGfxPos++, D_09000EF8_381298); gSPDisplayList(gMainGfxPos++, D_09000EF8_381298);

View File

@ -61,9 +61,9 @@ EffectInstance* firework_main(
bp.renderUI = func_E0086398; bp.renderUI = func_E0086398;
bp.effectID = EFFECT_FIREWORK; bp.effectID = EFFECT_FIREWORK;
effect = shim_create_effect_instance(&bp); effect = create_effect_instance(&bp);
effect->numParts = numParts; effect->numParts = numParts;
part = effect->data.firework = shim_general_heap_malloc(numParts * sizeof(*part)); part = effect->data.firework = general_heap_malloc(numParts * sizeof(*part));
ASSERT(effect->data.firework != NULL); ASSERT(effect->data.firework != NULL);
part->unk_00 = arg0; part->unk_00 = arg0;
@ -105,7 +105,7 @@ EffectInstance* firework_main(
part++; part++;
for (i = 1; i < numParts; i++, part++) { for (i = 1; i < numParts; i++, part++) {
f32 unk_1C = (i * 360) / (numParts - 1); f32 unk_1C = (i * 360) / (numParts - 1);
s32 unk_24 = shim_rand_int(359); s32 unk_24 = rand_int(359);
part->unk_04 = 0; part->unk_04 = 0;
part->unk_08 = 0; part->unk_08 = 0;
@ -137,7 +137,7 @@ void firework_update(EffectInstance* effect) {
part->unk_34++; part->unk_34++;
if (part->unk_30 < 0) { if (part->unk_30 < 0) {
shim_remove_effect(effect); remove_effect(effect);
return; return;
} }
@ -198,8 +198,8 @@ void func_E00863B4(EffectInstance* effect) {
unk_28 = part->unk_28; unk_28 = part->unk_28;
shim_guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].currentYaw, 0.0f, unk_28, part->unk_04, part->unk_08, part->unk_0C); guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].currentYaw, 0.0f, unk_28, part->unk_04, part->unk_08, part->unk_0C);
shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
@ -261,12 +261,12 @@ void func_E00863B4(EffectInstance* effect) {
for (i = 1; i < effect->numParts; i++, part++) { for (i = 1; i < effect->numParts; i++, part++) {
gSPDisplayList(gMainGfxPos++, D_E0086AB4[part->unk_00]); gSPDisplayList(gMainGfxPos++, D_E0086AB4[part->unk_00]);
shim_guRotateF(sp20, part->unk_1C, 0.0f, 0.0f, 1.0f); guRotateF(sp20, part->unk_1C, 0.0f, 0.0f, 1.0f);
shim_guRotateF(sp60, part->unk_24, 0.0f, 1.0f, 0.0f); guRotateF(sp60, part->unk_24, 0.0f, 1.0f, 0.0f);
shim_guMtxCatF(sp60, sp20, sp20); guMtxCatF(sp60, sp20, sp20);
shim_guTranslateF(sp60, part->unk_04, part->unk_08, part->unk_0C); guTranslateF(sp60, part->unk_04, part->unk_08, part->unk_0C);
shim_guMtxCatF(sp60, sp20, sp20); guMtxCatF(sp60, sp20, sp20);
shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
gSPDisplayList(gMainGfxPos++, D_E0086AA0[temp_s32]); gSPDisplayList(gMainGfxPos++, D_E0086AA0[temp_s32]);
@ -280,8 +280,8 @@ void func_E00863B4(EffectInstance* effect) {
gDPSetEnvColor(gMainGfxPos++, envR, envG, engB, envA); gDPSetEnvColor(gMainGfxPos++, envR, envG, engB, envA);
gSPDisplayList(gMainGfxPos++, savedGfxPos + 1); gSPDisplayList(gMainGfxPos++, savedGfxPos + 1);
shim_guRotateF(sp20, 120.0f, 1.0f, 1.0f, 1.0f); guRotateF(sp20, 120.0f, 1.0f, 1.0f, 1.0f);
shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos], G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos], G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW);
gSPDisplayList(gMainGfxPos++, savedGfxPos + 1); gSPDisplayList(gMainGfxPos++, savedGfxPos + 1);

View File

@ -1,8 +1,6 @@
#include "common.h" #include "common.h"
#include "effects_internal.h" #include "effects_internal.h"
void shim_draw_prev_frame_buffer_at_screen_pos(s32, s32, s32, s32, f32);
void firework_rocket_init(EffectInstance* effect); void firework_rocket_init(EffectInstance* effect);
void firework_rocket_render(EffectInstance* effect); void firework_rocket_render(EffectInstance* effect);
void firework_rocket_update(EffectInstance* effect); void firework_rocket_update(EffectInstance* effect);
@ -96,9 +94,9 @@ EffectInstance* firework_rocket_main(s32 variation, f32 centerX, f32 centerY, f3
bp.renderUI = NULL; bp.renderUI = NULL;
bp.effectID = EFFECT_FIREWORK_ROCKET; bp.effectID = EFFECT_FIREWORK_ROCKET;
effect = shim_create_effect_instance(&bp); effect = create_effect_instance(&bp);
effect->numParts = numParts; effect->numParts = numParts;
data = effect->data.fireworkRocket = shim_general_heap_malloc(numParts * sizeof(*data)); data = effect->data.fireworkRocket = general_heap_malloc(numParts * sizeof(*data));
ASSERT(effect->data.fireworkRocket != NULL); ASSERT(effect->data.fireworkRocket != NULL);
data->variation = variation; data->variation = variation;
@ -159,7 +157,7 @@ void firework_rocket_update(EffectInstance* effect) {
data->lifeTime++; data->lifeTime++;
if (data->timeLeft < 0) { if (data->timeLeft < 0) {
shim_remove_effect(effect); remove_effect(effect);
return; return;
} }
@ -185,11 +183,11 @@ void firework_rocket_update(EffectInstance* effect) {
i = lifeTime & 3; i = lifeTime & 3;
data->rocketX[i] = data->pos.x - data->velocity.x * (32 - lifeTime); data->rocketX[i] = data->pos.x - data->velocity.x * (32 - lifeTime);
data->rocketY[i] = data->pos.y - data->velocity.y * (32 - lifeTime) data->rocketY[i] = data->pos.y - data->velocity.y * (32 - lifeTime)
- (80.0f - shim_sin_deg((s32)(lifeTime * 90) >> 5) * 80.0f); - (80.0f - sin_deg((s32)(lifeTime * 90) >> 5) * 80.0f);
data->rocketZ[i] = data->pos.z - data->velocity.z * (32 - lifeTime); data->rocketZ[i] = data->pos.z - data->velocity.z * (32 - lifeTime);
data->rocketVelocityX[i] = (shim_rand_int(10) - 5) * 0.1f; data->rocketVelocityX[i] = (rand_int(10) - 5) * 0.1f;
data->rocketVelocityY[i] = (shim_rand_int(10) - 5) * 0.1f; data->rocketVelocityY[i] = (rand_int(10) - 5) * 0.1f;
data->rocketVelocityZ[i] = (shim_rand_int(10) - 5) * 0.1f; data->rocketVelocityZ[i] = (rand_int(10) - 5) * 0.1f;
for (i = 0; i < 4; i++) { for (i = 0; i < 4; i++) {
data->rocketX[i] += data->rocketVelocityX[i]; data->rocketX[i] += data->rocketVelocityX[i];
@ -216,7 +214,7 @@ void firework_rocket_render(EffectInstance* effect) {
renderTask.distance = 700; renderTask.distance = 700;
renderTask.renderMode = RENDER_MODE_SURFACE_OPA; renderTask.renderMode = RENDER_MODE_SURFACE_OPA;
retTask = shim_queue_render_task(&renderTask); retTask = queue_render_task(&renderTask);
retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR;
} }
@ -241,12 +239,12 @@ void firework_rocket_appendGfx(void* effect) {
s32 i; s32 i;
negYaw = -camera->currentYaw; negYaw = -camera->currentYaw;
sinTheta = shim_sin_deg(negYaw); sinTheta = sin_deg(negYaw);
cosTheta = shim_cos_deg(negYaw); cosTheta = cos_deg(negYaw);
isExploded = data->isExploded; isExploded = data->isExploded;
if (firework_rocket_frame_counter != gGameStatusPtr->frameCounter) { if (firework_rocket_frame_counter != gGameStatusPtr->frameCounter) {
// draw previous frame to create motion blur effect // draw previous frame to create motion blur effect
shim_draw_prev_frame_buffer_at_screen_pos(10, 10, SCREEN_WIDTH - 10, SCREEN_HEIGHT - 10, firework_rocket_blur_alpha * 0.8); draw_prev_frame_buffer_at_screen_pos(10, 10, SCREEN_WIDTH - 10, SCREEN_HEIGHT - 10, firework_rocket_blur_alpha * 0.8);
firework_rocket_frame_counter = gGameStatusPtr->frameCounter; firework_rocket_frame_counter = gGameStatusPtr->frameCounter;
firework_rocket_blur_alpha = 0; firework_rocket_blur_alpha = 0;
} }
@ -293,7 +291,7 @@ void firework_rocket_appendGfx(void* effect) {
for (i = 0; i < numSparks; i++, sparkDir++) { for (i = 0; i < numSparks; i++, sparkDir++) {
if (isExploded == TRUE) { if (isExploded == TRUE) {
// create blinking effect // create blinking effect
if (shim_rand_int(16) < 6) { if (rand_int(16) < 6) {
continue; continue;
} }
x = (sparkDir->x * cosTheta + sparkDir->z * sinTheta) * radius + centerX; x = (sparkDir->x * cosTheta + sparkDir->z * sinTheta) * radius + centerX;

View File

@ -60,9 +60,9 @@ void flame_main(
bpPtr->renderUI = NULL; bpPtr->renderUI = NULL;
bpPtr->effectID = EFFECT_FLAME; bpPtr->effectID = EFFECT_FLAME;
effect = shim_create_effect_instance(bpPtr); effect = create_effect_instance(bpPtr);
effect->numParts = numParts; effect->numParts = numParts;
data = effect->data.flame = shim_general_heap_malloc(numParts * sizeof(*data)); data = effect->data.flame = general_heap_malloc(numParts * sizeof(*data));
ASSERT(effect->data.flame != NULL); ASSERT(effect->data.flame != NULL);
data->unk_00 = arg0; data->unk_00 = arg0;
@ -120,7 +120,7 @@ void flame_render(EffectInstance* effect) {
f32 outZ; f32 outZ;
f32 outW; f32 outW;
shim_transform_point(gCameras[gCurrentCameraID].perspectiveMatrix, data->pos.x, data->pos.y, data->pos.z, 1.0f, transform_point(gCameras[gCurrentCameraID].perspectiveMatrix, data->pos.x, data->pos.y, data->pos.z, 1.0f,
&outX, &outY, &outZ, &outW); &outX, &outY, &outZ, &outW);
outDist = outZ + 5000; outDist = outZ + 5000;
@ -139,7 +139,7 @@ void flame_render(EffectInstance* effect) {
renderTaskPtr->appendGfxArg = effect; renderTaskPtr->appendGfxArg = effect;
renderTaskPtr->renderMode = RENDER_MODE_SURFACE_XLU_LAYER1; renderTaskPtr->renderMode = RENDER_MODE_SURFACE_XLU_LAYER1;
shim_queue_render_task(renderTaskPtr); queue_render_task(renderTaskPtr);
} }
void flame_appendGfx(void* effect) { void flame_appendGfx(void* effect) {
@ -177,12 +177,12 @@ void flame_appendGfx(void* effect) {
gDPSetPrimColor(gMainGfxPos++, 0, 0, unkStruct->unk_07, unkStruct->unk_07, unkStruct->unk_07, 0); gDPSetPrimColor(gMainGfxPos++, 0, 0, unkStruct->unk_07, unkStruct->unk_07, unkStruct->unk_07, 0);
gDPSetEnvColor(gMainGfxPos++, unkStruct->unk_04, unkStruct->unk_05, unkStruct->unk_06, 0); gDPSetEnvColor(gMainGfxPos++, unkStruct->unk_04, unkStruct->unk_05, unkStruct->unk_06, 0);
shim_guTranslateF(sp18, data->pos.x, data->pos.y, data->pos.z); guTranslateF(sp18, data->pos.x, data->pos.y, data->pos.z);
shim_guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f);
shim_guMtxCatF(sp58, sp18, sp98); guMtxCatF(sp58, sp18, sp98);
shim_guScaleF(sp58, data->unk_10 * data->unk_30, data->unk_10 * data->unk_2C, data->unk_10); guScaleF(sp58, data->unk_10 * data->unk_30, data->unk_10 * data->unk_2C, data->unk_10);
shim_guMtxCatF(sp58, sp98, sp98); guMtxCatF(sp58, sp98, sp98);
shim_guMtxF2L(sp98, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp98, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++],
G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);

View File

@ -31,9 +31,9 @@ EffectInstance* flashing_box_shockwave_main(
bp.renderUI = NULL; bp.renderUI = NULL;
bp.effectID = EFFECT_FLASHING_BOX_SHOCKWAVE; bp.effectID = EFFECT_FLASHING_BOX_SHOCKWAVE;
effect = shim_create_effect_instance(&bp); effect = create_effect_instance(&bp);
effect->numParts = numParts; effect->numParts = numParts;
data = effect->data.flashingBoxShockwave = shim_general_heap_malloc(numParts * sizeof(*data)); data = effect->data.flashingBoxShockwave = general_heap_malloc(numParts * sizeof(*data));
ASSERT(effect->data.flashingBoxShockwave != NULL); ASSERT(effect->data.flashingBoxShockwave != NULL);
data->unk_1C = 30; data->unk_1C = 30;
@ -93,7 +93,7 @@ void flashing_box_shockwave_update(EffectInstance* effect) {
data->unk_20++; data->unk_20++;
if (data->unk_1C < 0) { if (data->unk_1C < 0) {
shim_remove_effect(effect); remove_effect(effect);
return; return;
} }
@ -131,7 +131,7 @@ void flashing_box_shockwave_render(EffectInstance* effect) {
renderTask.distance = 10; renderTask.distance = 10;
renderTask.renderMode = RENDER_MODE_SURFACE_XLU_LAYER3; renderTask.renderMode = RENDER_MODE_SURFACE_XLU_LAYER3;
retTask = shim_queue_render_task(&renderTask); retTask = queue_render_task(&renderTask);
} }
void flashing_box_shockwave_appendGfx(void* effect) { void flashing_box_shockwave_appendGfx(void* effect) {
@ -142,22 +142,22 @@ void flashing_box_shockwave_appendGfx(void* effect) {
Matrix4f sp58; Matrix4f sp58;
Matrix4f sp98; Matrix4f sp98;
shim_guRotateF(sp98, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); guRotateF(sp98, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f);
gDPPipeSync(gMainGfxPos++); gDPPipeSync(gMainGfxPos++);
gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data));
shim_guTranslateF(sp18, data->pos.x, data->pos.y, data->pos.z); guTranslateF(sp18, data->pos.x, data->pos.y, data->pos.z);
shim_guMtxCatF(sp98, sp18, sp18); guMtxCatF(sp98, sp18, sp18);
shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gDPSetPrimColor(gMainGfxPos++, 0, 0, data->unk_30, data->unk_34, data->unk_38, data->unk_18); gDPSetPrimColor(gMainGfxPos++, 0, 0, data->unk_30, data->unk_34, data->unk_38, data->unk_18);
gDPSetEnvColor(gMainGfxPos++, data->unk_3C, data->unk_40, data->unk_44, 0); gDPSetEnvColor(gMainGfxPos++, data->unk_3C, data->unk_40, data->unk_44, 0);
if ((unk_00 == 0 || unk_00 == 1) && unk_20 % 2) { if ((unk_00 == 0 || unk_00 == 1) && unk_20 % 2) {
shim_guScaleF(sp18, data->unk_28, data->unk_2C, 15.0f / 14); guScaleF(sp18, data->unk_28, data->unk_2C, 15.0f / 14);
shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
gSPDisplayList(gMainGfxPos++, D_09000600_3936A0); gSPDisplayList(gMainGfxPos++, D_09000600_3936A0);
@ -171,10 +171,10 @@ void flashing_box_shockwave_appendGfx(void* effect) {
gDPSetPrimColor(gMainGfxPos++, 0, 0, 255, 255, 0, data->unk_14); gDPSetPrimColor(gMainGfxPos++, 0, 0, 255, 255, 0, data->unk_14);
} }
shim_guTranslateF(sp18, 0.0f, data->unk_2C, 0.0f); guTranslateF(sp18, 0.0f, data->unk_2C, 0.0f);
shim_guScaleF(sp58, data->unk_24 * 0.25, data->unk_24 * 0.25, 1.0f); guScaleF(sp58, data->unk_24 * 0.25, data->unk_24 * 0.25, 1.0f);
shim_guMtxCatF(sp58, sp18, sp18); guMtxCatF(sp58, sp18, sp18);
shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
gSPDisplayList(gMainGfxPos++, D_09000950_3939F0); gSPDisplayList(gMainGfxPos++, D_09000950_3939F0);

View File

@ -32,9 +32,9 @@ EffectInstance* floating_cloud_puff_main(
bp.renderUI = NULL; bp.renderUI = NULL;
bp.effectID = EFFECT_FLOATING_CLOUD_PUFF; bp.effectID = EFFECT_FLOATING_CLOUD_PUFF;
effect = shim_create_effect_instance(&bp); effect = create_effect_instance(&bp);
effect->numParts = numParts; effect->numParts = numParts;
data = effect->data.floatingCloudPuff = shim_general_heap_malloc(numParts * sizeof(*data)); data = effect->data.floatingCloudPuff = general_heap_malloc(numParts * sizeof(*data));
ASSERT(effect->data.floatingCloudPuff != NULL); ASSERT(effect->data.floatingCloudPuff != NULL);
data->unk_00 = arg0; data->unk_00 = arg0;
@ -78,7 +78,7 @@ void floating_cloud_puff_update(EffectInstance* effect) {
data->unk_14++; data->unk_14++;
if (data->unk_10 < 0) { if (data->unk_10 < 0) {
shim_remove_effect(effect); remove_effect(effect);
return; return;
} }
@ -106,7 +106,7 @@ void floating_cloud_puff_render(EffectInstance* effect) {
renderTask.distance = 10; renderTask.distance = 10;
renderTask.renderMode = RENDER_MODE_2D; renderTask.renderMode = RENDER_MODE_2D;
retTask = shim_queue_render_task(&renderTask); retTask = queue_render_task(&renderTask);
retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR;
} }
@ -124,10 +124,10 @@ void floating_cloud_puff_appendGfx(void* effect) {
gDPPipeSync(gMainGfxPos++); gDPPipeSync(gMainGfxPos++);
gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data));
shim_guTranslateF(sp10, data->unk_04, data->unk_08, data->unk_0C); guTranslateF(sp10, data->unk_04, data->unk_08, data->unk_0C);
shim_guScaleF(sp50, scale, scale, scale); guScaleF(sp50, scale, scale, scale);
shim_guMtxCatF(sp50, sp10, sp10); guMtxCatF(sp50, sp10, sp10);
shim_guMtxF2L(sp10, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp10, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPMatrix(gMainGfxPos++, camera->unkMatrix, G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, camera->unkMatrix, G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW);

View File

@ -24,9 +24,9 @@ void floating_flower_main(s32 type, f32 posX, f32 posY, f32 posZ, s32 duration)
bp.renderUI = NULL; bp.renderUI = NULL;
bp.effectID = EFFECT_FLOATING_FLOWER; bp.effectID = EFFECT_FLOATING_FLOWER;
effect = shim_create_effect_instance(&bp); effect = create_effect_instance(&bp);
effect->numParts = 1; effect->numParts = 1;
part = effect->data.floatingFlower = shim_general_heap_malloc(numParts * sizeof(*part)); part = effect->data.floatingFlower = general_heap_malloc(numParts * sizeof(*part));
ASSERT(effect->data.floatingFlower != NULL); ASSERT(effect->data.floatingFlower != NULL);
@ -55,15 +55,15 @@ void floating_flower_main(s32 type, f32 posX, f32 posY, f32 posZ, s32 duration)
} else { } else {
part->accelY = 0.12f; part->accelY = 0.12f;
part->jerkY = -0.0152f; part->jerkY = -0.0152f;
part->rot.x = (shim_rand_int(1) * 30) - 15; part->rot.x = (rand_int(1) * 30) - 15;
part->rot.y = shim_rand_int(360); part->rot.y = rand_int(360);
part->angularVel.x = 0; part->angularVel.x = 0;
part->angularVel.y = (shim_rand_int(1) * 8) - 4; part->angularVel.y = (rand_int(1) * 8) - 4;
part->timeLeft = duration; part->timeLeft = duration;
part->lifetime = 0; part->lifetime = 0;
part->unk_44 = shim_rand_int(10); part->unk_44 = rand_int(10);
part->unk_40 = shim_rand_int(20); part->unk_40 = rand_int(20);
part->unk_3C = (shim_rand_int(1) * 2) - 1; part->unk_3C = (rand_int(1) * 2) - 1;
} }
D_E001A610++; D_E001A610++;
@ -123,7 +123,7 @@ void floating_flower_update(EffectInstance* effect) {
data->timeLeft--; data->timeLeft--;
data->lifetime++; data->lifetime++;
if (data->timeLeft < 0) { if (data->timeLeft < 0) {
shim_remove_effect(effect); remove_effect(effect);
} }
} }
@ -136,7 +136,7 @@ void floating_flower_render(EffectInstance* effect) {
renderTask.distance = 0; renderTask.distance = 0;
renderTask.renderMode = RENDER_MODE_2D; renderTask.renderMode = RENDER_MODE_2D;
retTask = shim_queue_render_task(&renderTask); retTask = queue_render_task(&renderTask);
retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR;
} }
@ -150,15 +150,15 @@ void floating_flower_appendGfx(void* effect) {
gDPPipeSync(gMainGfxPos++); gDPPipeSync(gMainGfxPos++);
gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(effectTemp->graphics->data)); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(effectTemp->graphics->data));
shim_guPositionF(mtxTransform, part->rot.x, part->rot.y, 0.0f, 1.0f, part->pos.x, part->pos.y, part->pos.z); guPositionF(mtxTransform, part->rot.x, part->rot.y, 0.0f, 1.0f, part->pos.x, part->pos.y, part->pos.z);
shim_guMtxF2L(mtxTransform, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(mtxTransform, &gDisplayContext->matrixStack[gMatrixListPos]);
a = alpha = 255; a = alpha = 255;
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
if (*gBackgroundFogModePtr == FOG_MODE_1) { if (*gBackgroundFogModePtr == FOG_MODE_1) {
shim_get_background_color_blend(&rgb, &rgb, &rgb, &a); get_background_color_blend(&rgb, &rgb, &rgb, &a);
alpha -= a; alpha -= a;
} }

View File

@ -29,9 +29,9 @@ EffectInstance* floating_rock_main(s32 type, f32 posX, f32 posY, f32 posZ, f32 f
bp.renderUI = NULL; bp.renderUI = NULL;
bp.effectID = EFFECT_FLOATING_ROCK; bp.effectID = EFFECT_FLOATING_ROCK;
effect = shim_create_effect_instance(&bp); effect = create_effect_instance(&bp);
effect->numParts = numParts; effect->numParts = numParts;
data = effect->data.floatingRock = shim_general_heap_malloc(numParts * sizeof(*data)); data = effect->data.floatingRock = general_heap_malloc(numParts * sizeof(*data));
ASSERT(effect->data.floatingRock != NULL); ASSERT(effect->data.floatingRock != NULL);
data->type = type; data->type = type;
@ -46,8 +46,8 @@ EffectInstance* floating_rock_main(s32 type, f32 posX, f32 posY, f32 posZ, f32 f
data->vel.x = 0; data->vel.x = 0;
data->vel.z = 0; data->vel.z = 0;
data->rot.x = 0; data->rot.x = 0;
data->rot.y = shim_rand_int(360); data->rot.y = rand_int(360);
data->rot.z = shim_rand_int(360); data->rot.z = rand_int(360);
data->rotVel.x = 0.0f; data->rotVel.x = 0.0f;
data->rotVel.z = 20.0f; data->rotVel.z = 20.0f;
data->rotVel.y = -20.0f; data->rotVel.y = -20.0f;
@ -69,7 +69,7 @@ void floating_rock_update(EffectInstance* effect) {
data->timeLeft--; data->timeLeft--;
data->lifetime++; data->lifetime++;
if (data->timeLeft < 0) { if (data->timeLeft < 0) {
shim_remove_effect(effect); remove_effect(effect);
return; return;
} }
@ -82,7 +82,7 @@ void floating_rock_update(EffectInstance* effect) {
data->rot.y += data->rotVel.y; data->rot.y += data->rotVel.y;
if (data->pos.y <= data->floorY) { if (data->pos.y <= data->floorY) {
data->pos.y = data->floorY; data->pos.y = data->floorY;
shim_load_effect(EFFECT_DUST); load_effect(EFFECT_DUST);
dust_main(2, data->pos.x, data->pos.y, data->pos.z, 20); dust_main(2, data->pos.x, data->pos.y, data->pos.z, 20);
data->timeLeft = 30; data->timeLeft = 30;
} }
@ -103,7 +103,7 @@ void floating_rock_render(EffectInstance *effect) {
renderTask.distance = effect76->pos.z; renderTask.distance = effect76->pos.z;
renderTask.renderMode = RENDER_MODE_2D; renderTask.renderMode = RENDER_MODE_2D;
retTask = shim_queue_render_task(&renderTask); retTask = queue_render_task(&renderTask);
retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR;
} }
@ -115,8 +115,8 @@ void floating_rock_appendGfx(void* effect) {
gDPPipeSync(gMainGfxPos++); gDPPipeSync(gMainGfxPos++);
gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data));
shim_guPositionF(mtxTransform, data->rot.x, data->rot.z, data->rot.y, data->scale, data->pos.x, data->pos.y, data->pos.z); guPositionF(mtxTransform, data->rot.x, data->rot.z, data->rot.y, data->scale, data->pos.x, data->pos.y, data->pos.z);
shim_guMtxF2L(mtxTransform, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(mtxTransform, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
gDPSetPrimColor(gMainGfxPos++, 0, 0, 215, 215, 110, alpha); gDPSetPrimColor(gMainGfxPos++, 0, 0, 215, 215, 110, alpha);

View File

@ -12,16 +12,16 @@ void flower_splash_update_part_transform(FlowerFXData* effect) {
Matrix4f transformMtx; Matrix4f transformMtx;
Matrix4f tempMtx; Matrix4f tempMtx;
shim_guRotateF(transformMtx, effect->rot.x, 1.0f, 0.0f, 0.0f); guRotateF(transformMtx, effect->rot.x, 1.0f, 0.0f, 0.0f);
shim_guRotateF(tempMtx, effect->rot.z, 0.0f, 0.0f, 1.0f); guRotateF(tempMtx, effect->rot.z, 0.0f, 0.0f, 1.0f);
shim_guMtxCatF(tempMtx, transformMtx, transformMtx); guMtxCatF(tempMtx, transformMtx, transformMtx);
shim_guRotateF(tempMtx, effect->rot.y, 0.0f, 1.0f, 0.0f); guRotateF(tempMtx, effect->rot.y, 0.0f, 1.0f, 0.0f);
shim_guMtxCatF(transformMtx, tempMtx, transformMtx); guMtxCatF(transformMtx, tempMtx, transformMtx);
shim_guScaleF(tempMtx, effect->scale.x, effect->scale.y, effect->scale.z); guScaleF(tempMtx, effect->scale.x, effect->scale.y, effect->scale.z);
shim_guMtxCatF(tempMtx, transformMtx, transformMtx); guMtxCatF(tempMtx, transformMtx, transformMtx);
shim_guTranslateF(tempMtx, effect->pos.x, effect->pos.y, effect->pos.z); guTranslateF(tempMtx, effect->pos.x, effect->pos.y, effect->pos.z);
shim_guMtxCatF(transformMtx, tempMtx, transformMtx); guMtxCatF(transformMtx, tempMtx, transformMtx);
shim_guMtxF2L(transformMtx, &effect->transformMtx); guMtxF2L(transformMtx, &effect->transformMtx);
} }
void flower_splash_update_part(FlowerFXData* effect) { void flower_splash_update_part(FlowerFXData* effect) {
@ -58,13 +58,13 @@ void flower_splash_main(f32 posX, f32 posY, f32 posZ, f32 angle) {
bp.renderUI = NULL; bp.renderUI = NULL;
bp.effectID = EFFECT_FLOWER_SPLASH; bp.effectID = EFFECT_FLOWER_SPLASH;
effect = shim_create_effect_instance(&bp); effect = create_effect_instance(&bp);
effect->numParts = numParts; effect->numParts = numParts;
part = effect->data.flowerSplash = shim_general_heap_malloc(numParts * sizeof(*part)); part = effect->data.flowerSplash = general_heap_malloc(numParts * sizeof(*part));
ASSERT(effect->data.flowerSplash != NULL); ASSERT(effect->data.flowerSplash != NULL);
shim_mem_clear(part, numParts * sizeof(*part)); mem_clear(part, numParts * sizeof(*part));
for (i = 0; i < numParts; i++, part++) { for (i = 0; i < numParts; i++, part++) {
part->alive = TRUE; part->alive = TRUE;
@ -93,9 +93,9 @@ void flower_splash_main(f32 posX, f32 posY, f32 posZ, f32 angle) {
part->integrator[3] = 0.0f; part->integrator[3] = 0.0f;
part->velocityScaleA = -3.9f; part->velocityScaleA = -3.9f;
partAngle = shim_clamp_angle(part->rot.y); partAngle = clamp_angle(part->rot.y);
part->velocity.x = shim_sin_deg(partAngle); part->velocity.x = sin_deg(partAngle);
part->velocity.z = shim_cos_deg(partAngle); part->velocity.z = cos_deg(partAngle);
} }
} }
@ -121,7 +121,7 @@ void flower_splash_update(EffectInstance* effect) {
} }
if (!anyAlive) { if (!anyAlive) {
shim_remove_effect(effect); remove_effect(effect);
} }
} }
@ -134,12 +134,12 @@ void flower_splash_render(EffectInstance* effect) {
renderTask.distance = 0; renderTask.distance = 0;
renderTask.renderMode = RENDER_MODE_28; renderTask.renderMode = RENDER_MODE_28;
retTask = shim_queue_render_task(&renderTask); retTask = queue_render_task(&renderTask);
retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR;
} }
void flower_splash_dispose(EffectInstance* effect) { void flower_splash_dispose(EffectInstance* effect) {
shim_remove_effect(effect); remove_effect(effect);
} }
void flower_splash_appendGfx(void* effect) { void flower_splash_appendGfx(void* effect) {

View File

@ -13,16 +13,16 @@ void flower_trail_update_part_transform(FlowerFXData* effect) {
Matrix4f transformMtx; Matrix4f transformMtx;
Matrix4f tempMtx; Matrix4f tempMtx;
shim_guRotateF(transformMtx, effect->rot.x, 1.0f, 0.0f, 0.0f); guRotateF(transformMtx, effect->rot.x, 1.0f, 0.0f, 0.0f);
shim_guRotateF(tempMtx, effect->rot.z, 0.0f, 0.0f, 1.0f); guRotateF(tempMtx, effect->rot.z, 0.0f, 0.0f, 1.0f);
shim_guMtxCatF(tempMtx, transformMtx, transformMtx); guMtxCatF(tempMtx, transformMtx, transformMtx);
shim_guRotateF(tempMtx, effect->rot.y, 0.0f, 1.0f, 0.0f); guRotateF(tempMtx, effect->rot.y, 0.0f, 1.0f, 0.0f);
shim_guMtxCatF(transformMtx, tempMtx, transformMtx); guMtxCatF(transformMtx, tempMtx, transformMtx);
shim_guScaleF(tempMtx, effect->scale.x, effect->scale.y, effect->scale.z); guScaleF(tempMtx, effect->scale.x, effect->scale.y, effect->scale.z);
shim_guMtxCatF(tempMtx, transformMtx, transformMtx); guMtxCatF(tempMtx, transformMtx, transformMtx);
shim_guTranslateF(tempMtx, effect->pos.x, effect->pos.y, effect->pos.z); guTranslateF(tempMtx, effect->pos.x, effect->pos.y, effect->pos.z);
shim_guMtxCatF(transformMtx, tempMtx, transformMtx); guMtxCatF(transformMtx, tempMtx, transformMtx);
shim_guMtxF2L(transformMtx, &effect->transformMtx); guMtxF2L(transformMtx, &effect->transformMtx);
} }
void flower_trail_update_part(FlowerFXData* effect) { void flower_trail_update_part(FlowerFXData* effect) {
@ -60,13 +60,13 @@ void flower_trail_main(s32 triggeredByNpc, f32 posX, f32 posY, f32 posZ, f32 ang
bp.renderUI = NULL; bp.renderUI = NULL;
bp.effectID = EFFECT_FLOWER_TRAIL; bp.effectID = EFFECT_FLOWER_TRAIL;
effect = shim_create_effect_instance(&bp); effect = create_effect_instance(&bp);
effect->numParts = numParts; effect->numParts = numParts;
part = effect->data.flowerTrail = shim_general_heap_malloc(numParts * sizeof(*part)); part = effect->data.flowerTrail = general_heap_malloc(numParts * sizeof(*part));
ASSERT(effect->data.flowerTrail != NULL); ASSERT(effect->data.flowerTrail != NULL);
shim_mem_clear(part, numParts * sizeof(*part)); mem_clear(part, numParts * sizeof(*part));
for (i = 0; i < numParts; i++, part++) { for (i = 0; i < numParts; i++, part++) {
part->alive = TRUE; part->alive = TRUE;
@ -100,18 +100,18 @@ void flower_trail_main(s32 triggeredByNpc, f32 posX, f32 posY, f32 posZ, f32 ang
part->rot.y = angle; part->rot.y = angle;
part->rot.x = 0.0f; part->rot.x = 0.0f;
part->rot.z = 0.0f; part->rot.z = 0.0f;
part->useAltColor = (shim_rand_int(100) >> 4) & 1; part->useAltColor = (rand_int(100) >> 4) & 1;
if (direction != 0.0f) { if (direction != 0.0f) {
angleOffset = -90.0f; angleOffset = -90.0f;
partAngle = shim_clamp_angle(angle + angleOffset); partAngle = clamp_angle(angle + angleOffset);
} else { } else {
angleOffset = 90.0f; angleOffset = 90.0f;
partAngle = shim_clamp_angle(angle + angleOffset); partAngle = clamp_angle(angle + angleOffset);
} }
part->velocity.x = shim_sin_deg(partAngle); part->velocity.x = sin_deg(partAngle);
part->velocity.z = shim_cos_deg(partAngle); part->velocity.z = cos_deg(partAngle);
} }
} }
@ -137,7 +137,7 @@ void flower_trail_update(EffectInstance* effect) {
} }
if (!anyAlive) { if (!anyAlive) {
shim_remove_effect(effect); remove_effect(effect);
} }
} }
@ -150,12 +150,12 @@ void flower_trail_render(EffectInstance* effect) {
renderTask.distance = 0; renderTask.distance = 0;
renderTask.renderMode = RENDER_MODE_28; renderTask.renderMode = RENDER_MODE_28;
queuedTaskPtr = shim_queue_render_task(&renderTask); queuedTaskPtr = queue_render_task(&renderTask);
queuedTaskPtr->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; queuedTaskPtr->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR;
} }
void flower_trail_dispose(EffectInstance* effect) { void flower_trail_dispose(EffectInstance* effect) {
shim_remove_effect(effect); remove_effect(effect);
} }
void flower_trail_appendGfx(void* argEffect) { void flower_trail_appendGfx(void* argEffect) {

View File

@ -13,10 +13,10 @@ void func_E0018000(FootprintFXData* part) {
Matrix4f sp18; Matrix4f sp18;
Matrix4f sp58; Matrix4f sp58;
shim_guTranslateF(sp18, part->unk_0C, part->unk_10, part->unk_14); guTranslateF(sp18, part->unk_0C, part->unk_10, part->unk_14);
shim_guRotateF(sp58, part->unk_28, 0.0f, 1.0f, 0.0f); guRotateF(sp58, part->unk_28, 0.0f, 1.0f, 0.0f);
shim_guMtxCatF(sp58, sp18, sp18); guMtxCatF(sp58, sp18, sp18);
shim_guMtxF2L(sp18, &part->mtx); guMtxF2L(sp18, &part->mtx);
} }
void footprint_main(f32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6, f32 arg7) { void footprint_main(f32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6, f32 arg7) {
@ -35,14 +35,14 @@ void footprint_main(f32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5,
bp.renderUI = NULL; bp.renderUI = NULL;
bp.effectID = EFFECT_FOOTPRINT; bp.effectID = EFFECT_FOOTPRINT;
effect = shim_create_effect_instance(&bp); effect = create_effect_instance(&bp);
effect->numParts = 1; effect->numParts = 1;
part = shim_general_heap_malloc(numParts * sizeof(*part)); part = general_heap_malloc(numParts * sizeof(*part));
effect->data.footprint = part; effect->data.footprint = part;
ASSERT(effect->data.footprint != NULL); ASSERT(effect->data.footprint != NULL);
shim_mem_clear(part, numParts * sizeof(*part)); mem_clear(part, numParts * sizeof(*part));
for (i = 0; i < numParts; i++, part++) { for (i = 0; i < numParts; i++, part++) {
part->alive = TRUE; part->alive = TRUE;
@ -61,12 +61,12 @@ void footprint_main(f32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5,
part->unk_24 = 0.0f; part->unk_24 = 0.0f;
part->unk_28 = (arg3 + (arg4 * 30.0f)) - 15.0f; part->unk_28 = (arg3 + (arg4 * 30.0f)) - 15.0f;
part->unk_2C = 0.0f; part->unk_2C = 0.0f;
temp_f20 = shim_clamp_angle(arg3); temp_f20 = clamp_angle(arg3);
part->unk_90 = shim_sin_deg(temp_f20); part->unk_90 = sin_deg(temp_f20);
part->unk_94 = shim_cos_deg(temp_f20); part->unk_94 = cos_deg(temp_f20);
temp_f20_2 = (temp_f20 + 45.0f) - (arg4 * 180.0f); temp_f20_2 = (temp_f20 + 45.0f) - (arg4 * 180.0f);
part->unk_0C += shim_sin_deg(temp_f20_2) * 5.0f; part->unk_0C += sin_deg(temp_f20_2) * 5.0f;
part->unk_14 += shim_cos_deg(temp_f20_2) * 5.0f; part->unk_14 += cos_deg(temp_f20_2) * 5.0f;
part->alpha = 200; part->alpha = 200;
} }
} }
@ -93,7 +93,7 @@ void footprint_update(EffectInstance* effect) {
} }
if (!cond) { if (!cond) {
shim_remove_effect(effect); remove_effect(effect);
} }
} }
@ -106,12 +106,12 @@ void footprint_render(EffectInstance* effect) {
renderTask.distance = 0; renderTask.distance = 0;
renderTask.renderMode = RENDER_MODE_28; renderTask.renderMode = RENDER_MODE_28;
retTask = shim_queue_render_task(&renderTask); retTask = queue_render_task(&renderTask);
retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR;
} }
void func_E00183BC(EffectInstance* effect) { void func_E00183BC(EffectInstance* effect) {
shim_remove_effect(effect); remove_effect(effect);
} }
void footprint_appendGfx(void* effect) { void footprint_appendGfx(void* effect) {

View File

@ -36,9 +36,9 @@ EffectInstance* fright_jar_main(
bp.renderUI = NULL; bp.renderUI = NULL;
bp.effectID = EFFECT_FRIGHT_JAR; bp.effectID = EFFECT_FRIGHT_JAR;
effect = shim_create_effect_instance(&bp); effect = create_effect_instance(&bp);
effect->numParts = numParts; effect->numParts = numParts;
data = effect->data.frightJar = shim_general_heap_malloc(numParts * sizeof(*data)); data = effect->data.frightJar = general_heap_malloc(numParts * sizeof(*data));
ASSERT(effect->data.frightJar != NULL); ASSERT(effect->data.frightJar != NULL);
data->unk_00 = arg0; data->unk_00 = arg0;
@ -79,7 +79,7 @@ void fright_jar_update(EffectInstance* effect) {
data->unk_14++; data->unk_14++;
if (data->unk_10 < 0) { if (data->unk_10 < 0) {
shim_remove_effect(effect); remove_effect(effect);
return; return;
} }
@ -105,7 +105,7 @@ void fright_jar_render(EffectInstance* effect) {
renderTask.distance = 10; renderTask.distance = 10;
renderTask.renderMode = RENDER_MODE_2D; renderTask.renderMode = RENDER_MODE_2D;
retTask = shim_queue_render_task(&renderTask); retTask = queue_render_task(&renderTask);
retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR;
} }
@ -126,10 +126,10 @@ void fright_jar_appendGfx(void* effect) {
gDPPipeSync(gMainGfxPos++); gDPPipeSync(gMainGfxPos++);
gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data));
shim_guTranslateF(sp10, data->unk_04, data->unk_08, data->unk_0C); guTranslateF(sp10, data->unk_04, data->unk_08, data->unk_0C);
shim_guScaleF(sp50, -data->unk_28, data->unk_28, data->unk_28); guScaleF(sp50, -data->unk_28, data->unk_28, data->unk_28);
shim_guMtxCatF(sp50, sp10, sp10); guMtxCatF(sp50, sp10, sp10);
shim_guMtxF2L(sp10, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp10, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPMatrix(gMainGfxPos++, camera->unkMatrix, G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, camera->unkMatrix, G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW);

View File

@ -32,9 +32,9 @@ void gather_energy_pink_main(s32 type, f32 posX, f32 posY, f32 posZ, f32 scale,
bp.renderUI = NULL; bp.renderUI = NULL;
bp.effectID = EFFECT_GATHER_ENERGY_PINK; bp.effectID = EFFECT_GATHER_ENERGY_PINK;
effect = shim_create_effect_instance(&bp); effect = create_effect_instance(&bp);
effect->numParts = numParts; effect->numParts = numParts;
data = effect->data.gatherEnergyPink = shim_general_heap_malloc(sizeof(*data)); data = effect->data.gatherEnergyPink = general_heap_malloc(sizeof(*data));
ASSERT (data != NULL); ASSERT (data != NULL);
data->unk_00 = type; data->unk_00 = type;
@ -92,7 +92,7 @@ void gather_energy_pink_update(EffectInstance* effect) {
part->unk_2C++; part->unk_2C++;
if (part->unk_28 < 0) { if (part->unk_28 < 0) {
shim_remove_effect(effect); remove_effect(effect);
return; return;
} }
@ -112,12 +112,12 @@ void gather_energy_pink_update(EffectInstance* effect) {
} }
if (part->unk_00 == 1) { if (part->unk_00 == 1) {
part->unk_1C += (part->unk_20 + shim_sin_deg(unk_28 * 10) * 0.1 * part->unk_20 - part->unk_1C) * 0.4; part->unk_1C += (part->unk_20 + sin_deg(unk_28 * 10) * 0.1 * part->unk_20 - part->unk_1C) * 0.4;
} else { } else {
part->unk_1C += (part->unk_20 + shim_sin_deg(unk_28 * 10) * 0.1 * part->unk_20 - part->unk_1C) * 0.3; part->unk_1C += (part->unk_20 + sin_deg(unk_28 * 10) * 0.1 * part->unk_20 - part->unk_1C) * 0.3;
} }
shim_transform_point(&gCameras[gCurrentCameraID].perspectiveMatrix[0], part->posA.x, part->posA.y, part->posA.z, 1.0f, &sp28, &sp2C, &sp30, &sp34); transform_point(&gCameras[gCurrentCameraID].perspectiveMatrix[0], part->posA.x, part->posA.y, part->posA.z, 1.0f, &sp28, &sp2C, &sp30, &sp34);
sp34 = 1.0f / sp34; sp34 = 1.0f / sp34;
sp28 *= sp34; sp28 *= sp34;
@ -153,7 +153,7 @@ void gather_energy_pink_render(EffectInstance* effect) {
renderTask.distance = 0; renderTask.distance = 0;
renderTask.renderMode = RENDER_MODE_2D; renderTask.renderMode = RENDER_MODE_2D;
retTask = shim_queue_render_task(&renderTask); retTask = queue_render_task(&renderTask);
retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR;
} }
@ -175,25 +175,25 @@ void gather_energy_pink_appendGfx(void* effect) {
gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data));
gSPDisplayList(gMainGfxPos++, dlist); gSPDisplayList(gMainGfxPos++, dlist);
shim_guTranslateF(sp20, part->posB.x, part->posB.y, part->posB.z); guTranslateF(sp20, part->posB.x, part->posB.y, part->posB.z);
shim_guScaleF(sp60, part->unk_1C, part->unk_1C, 1.0f); guScaleF(sp60, part->unk_1C, part->unk_1C, 1.0f);
shim_guMtxCatF(sp60, sp20, sp20); guMtxCatF(sp60, sp20, sp20);
shim_guPerspectiveF(sp60, &perspNorm, unk_00 == 1 ? 130.0f : 30.0f, (f32) camera->viewportW / camera->viewportH, 4.0f, 16384.0f, 1.0f); guPerspectiveF(sp60, &perspNorm, unk_00 == 1 ? 130.0f : 30.0f, (f32) camera->viewportW / camera->viewportH, 4.0f, 16384.0f, 1.0f);
shim_guMtxCatF(sp60, sp20, sp20); guMtxCatF(sp60, sp20, sp20);
shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION);
switch (unk_00) { switch (unk_00) {
case 1: case 1:
shim_guTranslateF(sp20, 0.0f, 0.0f, -70.0f); guTranslateF(sp20, 0.0f, 0.0f, -70.0f);
break; break;
case 0: case 0:
shim_guTranslateF(sp20, 0.0f, 0.0f, -80.0f); guTranslateF(sp20, 0.0f, 0.0f, -80.0f);
break; break;
} }
shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);

View File

@ -26,9 +26,9 @@ EffectInstance* gather_magic_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 ar
bp.renderUI = NULL; bp.renderUI = NULL;
bp.effectID = EFFECT_GATHER_MAGIC; bp.effectID = EFFECT_GATHER_MAGIC;
effect = shim_create_effect_instance(&bp); effect = create_effect_instance(&bp);
effect->numParts = numParts; effect->numParts = numParts;
data = shim_general_heap_malloc(numParts * sizeof(*data)); data = general_heap_malloc(numParts * sizeof(*data));
effect->data.gatherMagic = data; effect->data.gatherMagic = data;
ASSERT(effect->data.gatherMagic != NULL); ASSERT(effect->data.gatherMagic != NULL);
@ -88,7 +88,7 @@ void gather_magic_update(EffectInstance* effect) {
part->unk_1C++; part->unk_1C++;
if (part->unk_18 < 0) { if (part->unk_18 < 0) {
shim_remove_effect(effect); remove_effect(effect);
return; return;
} }
@ -111,10 +111,10 @@ void gather_magic_update(EffectInstance* effect) {
f32 unk_20 = part->unk_20; f32 unk_20 = part->unk_20;
f32 unk_2C = part->unk_2C; f32 unk_2C = part->unk_2C;
f32 unk_24 = part->unk_24; f32 unk_24 = part->unk_24;
f32 sin_20 = shim_sin_deg(unk_20); f32 sin_20 = sin_deg(unk_20);
f32 cos_20 = shim_cos_deg(unk_20); f32 cos_20 = cos_deg(unk_20);
f32 sin_24 = shim_sin_deg(unk_24); f32 sin_24 = sin_deg(unk_24);
f32 cos_24 = shim_cos_deg(unk_24); f32 cos_24 = cos_deg(unk_24);
part->unk_08 = unk_2C * sin_20 * cos_24; part->unk_08 = unk_2C * sin_20 * cos_24;
part->unk_0C = unk_2C * cos_20 * cos_24; part->unk_0C = unk_2C * cos_20 * cos_24;
@ -147,7 +147,7 @@ void gather_magic_render(EffectInstance* effect) {
renderTask.distance = 10; renderTask.distance = 10;
renderTask.renderMode = RENDER_MODE_SURFACE_XLU_LAYER3; renderTask.renderMode = RENDER_MODE_SURFACE_XLU_LAYER3;
retTask = shim_queue_render_task(&renderTask); retTask = queue_render_task(&renderTask);
retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR;
} }
@ -164,10 +164,10 @@ void gather_magic_appendGfx(void* effect) {
gDPPipeSync(gMainGfxPos++); gDPPipeSync(gMainGfxPos++);
gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data));
shim_guTranslateF(sp18, part->unk_08, part->unk_0C, part->unk_10); guTranslateF(sp18, part->unk_08, part->unk_0C, part->unk_10);
shim_guRotateF(sp98, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); guRotateF(sp98, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f);
shim_guMtxCatF(sp98, sp18, sp18); guMtxCatF(sp98, sp18, sp18);
shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(gMainGfxPos++, D_09000080_38F790); gSPDisplayList(gMainGfxPos++, D_09000080_38F790);
@ -180,10 +180,10 @@ void gather_magic_appendGfx(void* effect) {
if (scale != 0.0f) { if (scale != 0.0f) {
gDPSetPrimColor(gMainGfxPos++, 0, 0, unk_30, unk_34, unk_38, part->unk_14); gDPSetPrimColor(gMainGfxPos++, 0, 0, unk_30, unk_34, unk_38, part->unk_14);
shim_guTranslateF(sp18, part->unk_08, part->unk_0C, part->unk_10); guTranslateF(sp18, part->unk_08, part->unk_0C, part->unk_10);
shim_guScaleF(sp58, scale, scale, scale); guScaleF(sp58, scale, scale, scale);
shim_guMtxCatF(sp58, sp18, sp18); guMtxCatF(sp58, sp18, sp18);
shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
gSPDisplayList(gMainGfxPos++, D_E008E890[i & 1]); gSPDisplayList(gMainGfxPos++, D_E008E890[i & 1]);

View File

@ -41,9 +41,9 @@ void got_item_outline_main(
bp.renderUI = NULL; bp.renderUI = NULL;
bp.effectID = EFFECT_GOT_ITEM_OUTLINE; bp.effectID = EFFECT_GOT_ITEM_OUTLINE;
effect = shim_create_effect_instance(&bp); effect = create_effect_instance(&bp);
effect->numParts = numParts; effect->numParts = numParts;
data = effect->data.gotItemOutline = shim_general_heap_malloc(numParts * sizeof(*data)); data = effect->data.gotItemOutline = general_heap_malloc(numParts * sizeof(*data));
ASSERT(effect->data.gotItemOutline != NULL); ASSERT(effect->data.gotItemOutline != NULL);
data->timeLeft = 100; data->timeLeft = 100;
@ -67,7 +67,7 @@ void got_item_outline_update(EffectInstance* effect) {
if (data->timeLeft < 100) { if (data->timeLeft < 100) {
data->timeLeft--; data->timeLeft--;
if (data->timeLeft < 0) { if (data->timeLeft < 0) {
shim_remove_effect(effect); remove_effect(effect);
return; return;
} }
} }
@ -100,7 +100,7 @@ void got_item_outline_render(EffectInstance* effect) {
renderTask.distance = 0; renderTask.distance = 0;
renderTask.renderMode = RENDER_MODE_2D; renderTask.renderMode = RENDER_MODE_2D;
retTask = shim_queue_render_task(&renderTask); retTask = queue_render_task(&renderTask);
retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR;
} }
@ -128,17 +128,17 @@ void got_item_outline_appendGfx(void* effect) {
gDPSetEnvColor(gMainGfxPos++, 255, 255, 0, 255); gDPSetEnvColor(gMainGfxPos++, 255, 255, 0, 255);
} }
shim_guTranslateF(mtxTransform, data->pos.x, data->pos.y, data->pos.z); guTranslateF(mtxTransform, data->pos.x, data->pos.y, data->pos.z);
shim_guRotateF(mtxTemp, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); guRotateF(mtxTemp, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f);
shim_guMtxCatF(mtxTemp, mtxTransform, mtxTransform); guMtxCatF(mtxTemp, mtxTransform, mtxTransform);
shim_guTranslateF(mtxTemp, 0.0f, 0.0f, -2.0f); guTranslateF(mtxTemp, 0.0f, 0.0f, -2.0f);
shim_guMtxCatF(mtxTemp, mtxTransform, mtxTransform); guMtxCatF(mtxTemp, mtxTransform, mtxTransform);
scale *= 0.6; scale *= 0.6;
shim_guScaleF(mtxTemp, scale, scale, 1.0f); guScaleF(mtxTemp, scale, scale, 1.0f);
shim_guMtxCatF(mtxTemp, mtxTransform, mtxTransform); guMtxCatF(mtxTemp, mtxTransform, mtxTransform);
shim_guMtxF2L(mtxTransform, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(mtxTransform, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);

View File

@ -35,12 +35,12 @@ EffectInstance* green_impact_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 ar
bpPtr->renderUI = NULL; bpPtr->renderUI = NULL;
bpPtr->effectID = EFFECT_GREEN_IMPACT; bpPtr->effectID = EFFECT_GREEN_IMPACT;
effect = shim_create_effect_instance(bpPtr); effect = create_effect_instance(bpPtr);
effect->numParts = numParts; effect->numParts = numParts;
part = effect->data.greenImpact = shim_general_heap_malloc(numParts * sizeof(*part)); part = effect->data.greenImpact = general_heap_malloc(numParts * sizeof(*part));
ASSERT(effect->data.greenImpact != NULL); ASSERT(effect->data.greenImpact != NULL);
shim_mem_clear(part, numParts * sizeof(*part)); mem_clear(part, numParts * sizeof(*part));
part->unk_2C = 0; part->unk_2C = 0;
part->unk_00 = arg0; part->unk_00 = arg0;
@ -77,7 +77,7 @@ void green_impact_update(EffectInstance* effect) {
part->unk_28--; part->unk_28--;
if (part->unk_28 < 0) { if (part->unk_28 < 0) {
shim_remove_effect(effect); remove_effect(effect);
return; return;
} }
@ -93,8 +93,8 @@ void green_impact_update(EffectInstance* effect) {
part->unk_04 = 0; part->unk_04 = 0;
part->unk_08 = 0; part->unk_08 = 0;
part->unk_0C = 0; part->unk_0C = 0;
part->unk_10 = -shim_sin_deg(part->unk_34) * 0.5; part->unk_10 = -sin_deg(part->unk_34) * 0.5;
part->unk_14 = shim_cos_deg(part->unk_34) * 0.5; part->unk_14 = cos_deg(part->unk_34) * 0.5;
part->unk_18 = 0; part->unk_18 = 0;
part->unk_20 = 10.0f; part->unk_20 = 10.0f;
part->unk_3C = 32.0f; part->unk_3C = 32.0f;
@ -126,7 +126,7 @@ void green_impact_render(EffectInstance* effect) {
renderTask.distance = 0; renderTask.distance = 0;
renderTask.renderMode = RENDER_MODE_28; renderTask.renderMode = RENDER_MODE_28;
retTask = shim_queue_render_task(&renderTask); retTask = queue_render_task(&renderTask);
} }
void green_impact_appendGfx(void* effect) { void green_impact_appendGfx(void* effect) {
@ -163,8 +163,8 @@ void green_impact_appendGfx(void* effect) {
gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data));
gSPDisplayList(gMainGfxPos++, dlist); gSPDisplayList(gMainGfxPos++, dlist);
shim_guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, part->unk_04, part->unk_08, part->unk_0C); guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, part->unk_04, part->unk_08, part->unk_0C);
shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
@ -183,14 +183,14 @@ void green_impact_appendGfx(void* effect) {
part++; part++;
for (i = 1; i < ((EffectInstance*)effect)->numParts; i++, part++) { for (i = 1; i < ((EffectInstance*)effect)->numParts; i++, part++) {
if (part->unk_4C >= 0) { if (part->unk_4C >= 0) {
shim_guTranslateF(sp20, part->unk_04, part->unk_08, part->unk_0C); guTranslateF(sp20, part->unk_04, part->unk_08, part->unk_0C);
shim_guRotateF(sp60, part->unk_34, 0.0f, 0.0f, 1.0f); guRotateF(sp60, part->unk_34, 0.0f, 0.0f, 1.0f);
shim_guMtxCatF(sp60, sp20, sp20); guMtxCatF(sp60, sp20, sp20);
shim_guScaleF(sp60, part->unk_1C * 0.3, part->unk_20 * 0.3, part->unk_24 * 0.3); guScaleF(sp60, part->unk_1C * 0.3, part->unk_20 * 0.3, part->unk_24 * 0.3);
shim_guMtxCatF(sp60, sp20, sp20); guMtxCatF(sp60, sp20, sp20);
shim_guRotateF(sp60, part->unk_30, 0.0f, 1.0f, 0.0f); guRotateF(sp60, part->unk_30, 0.0f, 1.0f, 0.0f);
shim_guMtxCatF(sp60, sp20, sp20); guMtxCatF(sp60, sp20, sp20);
shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]);
dlist2 = D_09000540_365EF0; dlist2 = D_09000540_365EF0;

View File

@ -39,10 +39,10 @@ EffectInstance* hieroglyphs_main(s32 arg0, f32 posX, f32 posY, f32 posZ, f32 arg
effectBp.renderUI = NULL; effectBp.renderUI = NULL;
effectBp.effectID = EFFECT_HIEROGLYPHS; effectBp.effectID = EFFECT_HIEROGLYPHS;
effect = shim_create_effect_instance(&effectBp); effect = create_effect_instance(&effectBp);
effect->numParts = numParts; effect->numParts = numParts;
data = effect->data.hieroglyphs = shim_general_heap_malloc(numParts * sizeof(*data)); data = effect->data.hieroglyphs = general_heap_malloc(numParts * sizeof(*data));
ASSERT(data != NULL); ASSERT(data != NULL);
data->unk_00 = arg0; data->unk_00 = arg0;
@ -85,7 +85,7 @@ void hieroglyphs_update(EffectInstance* effect) {
} }
temp_a2 = ++data->lifeTime; temp_a2 = ++data->lifeTime;
if (data->timeLeft < 0) { if (data->timeLeft < 0) {
shim_remove_effect(effect); remove_effect(effect);
return; return;
} }
if (data->timeLeft < 16) { if (data->timeLeft < 16) {
@ -105,7 +105,7 @@ void hieroglyphs_render(EffectInstance* effect) {
renderTask.distance = 10; renderTask.distance = 10;
renderTask.renderMode = RENDER_MODE_2D; renderTask.renderMode = RENDER_MODE_2D;
retTask = shim_queue_render_task(&renderTask); retTask = queue_render_task(&renderTask);
retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR;
} }
@ -125,10 +125,10 @@ void hieroglyphs_appendGfx(void* effect) {
gDPPipeSync(gMainGfxPos++); gDPPipeSync(gMainGfxPos++);
gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data));
shim_guTranslateF(sp20, data->pos.x, data->pos.y, data->pos.z); guTranslateF(sp20, data->pos.x, data->pos.y, data->pos.z);
shim_guScaleF(sp60, data->unk_38, data->unk_38, data->unk_38); guScaleF(sp60, data->unk_38, data->unk_38, data->unk_38);
shim_guMtxCatF(sp60, sp20, sp20); guMtxCatF(sp60, sp20, sp20);
shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPMatrix(gMainGfxPos++, camera->unkMatrix, G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, camera->unkMatrix, G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW);
@ -144,18 +144,18 @@ void hieroglyphs_appendGfx(void* effect) {
(lifeTime * 2 + 127) * 4, 31 * 4); (lifeTime * 2 + 127) * 4, 31 * 4);
gMainGfxPos += 2; gMainGfxPos += 2;
shim_guRotateF(sp20, 20.0f, 1.0f, 0.0f, 0.0f); guRotateF(sp20, 20.0f, 1.0f, 0.0f, 0.0f);
shim_guPositionF(sp60, 0.0f, shim_sin_deg(lifeTime * 8 + 78.75) * -30.0f, 0.0f, 1.0f, 6.0f, 0.0f, 0.0f); guPositionF(sp60, 0.0f, sin_deg(lifeTime * 8 + 78.75) * -30.0f, 0.0f, 1.0f, 6.0f, 0.0f, 0.0f);
shim_guMtxCatF(sp60, sp20, sp20); guMtxCatF(sp60, sp20, sp20);
shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
for (i = 0; i < 16; i++) { for (i = 0; i < 16; i++) {
f32 angle = i * 48 + lifeTime * 8; f32 angle = i * 48 + lifeTime * 8;
shim_guPositionF(sp20, 0.0f, shim_sin_deg(angle) * 30.0f, 6.0f, (f32) i * 0.01 + 1.0, 8.0f, 0.0f, 0.0f); guPositionF(sp20, 0.0f, sin_deg(angle) * 30.0f, 6.0f, (f32) i * 0.01 + 1.0, 8.0f, 0.0f, 0.0f);
shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW);
gSPVertex(gMainGfxPos++, &D_090010A8_3DDDF8[i * 2], 2, i * 2); gSPVertex(gMainGfxPos++, &D_090010A8_3DDDF8[i * 2], 2, i * 2);
@ -174,8 +174,8 @@ void hieroglyphs_appendGfx(void* effect) {
for (i = 0; i < 2; i++) { for (i = 0; i < 2; i++) {
s32 idx = (lifeTime + i * 4) % 17; s32 idx = (lifeTime + i * 4) % 17;
shim_guPositionF(sp20, 0.0f, 0.0f, -0x11A + i * 0x24, 1.0f, 0.0f, 0.0f, 0.0f); guPositionF(sp20, 0.0f, 0.0f, -0x11A + i * 0x24, 1.0f, 0.0f, 0.0f, 0.0f);
shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
gDPSetPrimColor(gMainGfxPos++, 0, 0, D_E00E29F4[idx], D_E00E2A08[idx], D_E00E2A1C[idx], data->unk_24); gDPSetPrimColor(gMainGfxPos++, 0, 0, D_E00E29F4[idx], D_E00E2A08[idx], D_E00E2A1C[idx], data->unk_24);

View File

@ -26,10 +26,10 @@ EffectInstance* huff_puff_breath_main(s32 type, f32 posX, f32 posY, f32 posZ, f3
effectBp.renderUI = NULL; effectBp.renderUI = NULL;
effectBp.effectID = EFFECT_HUFF_PUFF_BREATH; effectBp.effectID = EFFECT_HUFF_PUFF_BREATH;
effect = shim_create_effect_instance(&effectBp); effect = create_effect_instance(&effectBp);
effect->numParts = numParts; effect->numParts = numParts;
data = effect->data.huffPuffBreath = shim_general_heap_malloc(numParts * sizeof(*data)); data = effect->data.huffPuffBreath = general_heap_malloc(numParts * sizeof(*data));
ASSERT(data != NULL); ASSERT(data != NULL);
data->type = type; data->type = type;
@ -55,8 +55,8 @@ EffectInstance* huff_puff_breath_main(s32 type, f32 posX, f32 posY, f32 posZ, f3
data->angle = angle; data->angle = angle;
data->speedY = 0; data->speedY = 0;
data->speedX = speed; data->speedX = speed;
data->texOffsetX = shim_rand_int(32); data->texOffsetX = rand_int(32);
data->texOffsetY = shim_rand_int(16); data->texOffsetY = rand_int(16);
data->primB = 150; data->primB = 150;
data->envR = 215; data->envR = 215;
data->envG = 210; data->envG = 210;
@ -84,7 +84,7 @@ void huff_puff_breath_update(EffectInstance* effect) {
temp_a2 = ++data->lifeTime; temp_a2 = ++data->lifeTime;
if (data->timeLeft < 0) { if (data->timeLeft < 0) {
shim_remove_effect(effect); remove_effect(effect);
return; return;
} }
if (data->timeLeft < 16) { if (data->timeLeft < 16) {
@ -118,7 +118,7 @@ void huff_puff_breath_render(EffectInstance* effect) {
renderTask.distance = 10; renderTask.distance = 10;
renderTask.renderMode = RENDER_MODE_2D; renderTask.renderMode = RENDER_MODE_2D;
retTask = shim_queue_render_task(&renderTask); retTask = queue_render_task(&renderTask);
} }
void func_E00DC2FC(void) { void func_E00DC2FC(void) {
@ -137,12 +137,12 @@ void huff_puff_breath_appendGfx(void* effect) {
gDPPipeSync(gMainGfxPos++); gDPPipeSync(gMainGfxPos++);
gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data));
shim_guTranslateF(sp18, data->pos.x, data->pos.y, data->pos.z); guTranslateF(sp18, data->pos.x, data->pos.y, data->pos.z);
shim_guRotateF(sp58, data->angle, 0.0f, 0.0f, 1.0f); guRotateF(sp58, data->angle, 0.0f, 0.0f, 1.0f);
shim_guMtxCatF(sp58, sp18, sp18); guMtxCatF(sp58, sp18, sp18);
shim_guScaleF(sp58, data->scale, data->scale, data->scale); guScaleF(sp58, data->scale, data->scale, data->scale);
shim_guMtxCatF(sp58, sp18, sp18); guMtxCatF(sp58, sp18, sp18);
shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPMatrix(gMainGfxPos++, camera->unkMatrix, G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, camera->unkMatrix, G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW);

View File

@ -28,10 +28,10 @@ EffectInstance* ice_pillar_main(s32 arg0, f32 x, f32 y, f32 z, f32 scale, s32 ar
effectBp.renderUI = NULL; effectBp.renderUI = NULL;
effectBp.effectID = EFFECT_ICE_PILLAR; effectBp.effectID = EFFECT_ICE_PILLAR;
effect = shim_create_effect_instance(&effectBp); effect = create_effect_instance(&effectBp);
effect->numParts = numParts; effect->numParts = numParts;
data = effect->data.icePillar = shim_general_heap_malloc(numParts * sizeof(*data)); data = effect->data.icePillar = general_heap_malloc(numParts * sizeof(*data));
ASSERT(data != NULL); ASSERT(data != NULL);
data->unk_00 = arg0; data->unk_00 = arg0;
@ -56,10 +56,10 @@ EffectInstance* ice_pillar_main(s32 arg0, f32 x, f32 y, f32 z, f32 scale, s32 ar
data->env.a = 255; data->env.a = 255;
data->unk_24 = data->unk_25 = 0; data->unk_24 = data->unk_25 = 0;
shim_load_effect(EFFECT_MISC_PARTICLES); load_effect(EFFECT_MISC_PARTICLES);
data->miscParticles = misc_particles_main(1, x, y + 10.0f, z, 32.0f, 30.0f, scale, 4, 0); data->miscParticles = misc_particles_main(1, x, y + 10.0f, z, 32.0f, 30.0f, scale, 4, 0);
shim_load_effect(EFFECT_COLD_BREATH); load_effect(EFFECT_COLD_BREATH);
return effect; return effect;
} }
@ -84,30 +84,30 @@ void ice_pillar_update(EffectInstance* effect) {
data->lifeTime++; data->lifeTime++;
if (data->timeLeft < 0) { if (data->timeLeft < 0) {
shim_load_effect(EFFECT_ICE_SHARD); load_effect(EFFECT_ICE_SHARD);
for (i = 0; i < 20; i++) { for (i = 0; i < 20; i++) {
EffectInstance* iceShard; EffectInstance* iceShard;
iceShard = ice_shard_main( iceShard = ice_shard_main(
(i % 2) + 2, (i % 2) + 2,
(data->pos.x + shim_rand_int(20)) - 10.0f, (data->pos.x + rand_int(20)) - 10.0f,
data->pos.y + (shim_rand_int(40) * data->scale), data->pos.y + (rand_int(40) * data->scale),
data->pos.z + 3.0f, data->pos.z + 3.0f,
(data->scale * ((shim_rand_int(10) * 0.7 * 0.1) + 0.3)), (data->scale * ((rand_int(10) * 0.7 * 0.1) + 0.3)),
i + 30 i + 30
); );
iceShard->data.iceShard->animFrame = shim_rand_int(10) * 0.1; iceShard->data.iceShard->animFrame = rand_int(10) * 0.1;
iceShard->data.iceShard->animRate = (shim_rand_int(30) * 0.01) + 0.1; iceShard->data.iceShard->animRate = (rand_int(30) * 0.01) + 0.1;
iceShard->data.iceShard->rotation = shim_rand_int(359); iceShard->data.iceShard->rotation = rand_int(359);
iceShard->data.iceShard->angularVel = shim_rand_int(20); iceShard->data.iceShard->angularVel = rand_int(20);
iceShard->data.iceShard->vel.x = shim_rand_int(10) - 5; iceShard->data.iceShard->vel.x = rand_int(10) - 5;
iceShard->data.iceShard->vel.y = shim_rand_int(10) - 5; iceShard->data.iceShard->vel.y = rand_int(10) - 5;
iceShard->data.iceShard->vel.z = 0; iceShard->data.iceShard->vel.z = 0;
iceShard->data.iceShard->gravAccel = -0.1f; iceShard->data.iceShard->gravAccel = -0.1f;
} }
shim_remove_effect(data->miscParticles); remove_effect(data->miscParticles);
shim_remove_effect(effect); remove_effect(effect);
return; return;
} }
@ -116,7 +116,7 @@ void ice_pillar_update(EffectInstance* effect) {
data->unk_25--; data->unk_25--;
if (data->unk_25 < 0) { if (data->unk_25 < 0) {
data->unk_25 = shim_rand_int(60) + 8; data->unk_25 = rand_int(60) + 8;
} }
if (data->unk_25 < 8) { if (data->unk_25 < 8) {
@ -126,7 +126,7 @@ void ice_pillar_update(EffectInstance* effect) {
} }
if (timeLeft > 16 && (lifeTime % 16) == 0) { if (timeLeft > 16 && (lifeTime % 16) == 0) {
shim_load_effect(EFFECT_COLD_BREATH); load_effect(EFFECT_COLD_BREATH);
cold_breath_main(2, data->pos.x, data->pos.y + (data->scale * 40.0f), data->pos.z, data->scale, 30); cold_breath_main(2, data->pos.x, data->pos.y + (data->scale * 40.0f), data->pos.z, data->scale, 30);
} }
data->miscParticles->data.miscParticles->pos.x = data->pos.x; data->miscParticles->data.miscParticles->pos.x = data->pos.x;
@ -143,7 +143,7 @@ void ice_pillar_render(EffectInstance* effect) {
renderTask.distance = 5; renderTask.distance = 5;
renderTask.renderMode = RENDER_MODE_2D; renderTask.renderMode = RENDER_MODE_2D;
retTask = shim_queue_render_task(&renderTask); retTask = queue_render_task(&renderTask);
retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR;
} }
@ -157,10 +157,10 @@ void ice_pillar_appendGfx(void* effect) {
gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data));
camera = &gCameras[gCurrentCameraID]; camera = &gCameras[gCurrentCameraID];
shim_guTranslateF(sp10, data->pos.x, data->pos.y, data->pos.z); guTranslateF(sp10, data->pos.x, data->pos.y, data->pos.z);
shim_guScaleF(sp50, data->scale, data->scale, data->scale); guScaleF(sp50, data->scale, data->scale, data->scale);
shim_guMtxCatF(sp50, sp10, sp10); guMtxCatF(sp50, sp10, sp10);
shim_guMtxF2L(sp10, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp10, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++],
G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);

View File

@ -33,9 +33,9 @@ EffectInstance* ice_shard_main(
bp.renderUI = NULL; bp.renderUI = NULL;
bp.effectID = EFFECT_ICE_SHARD; bp.effectID = EFFECT_ICE_SHARD;
effect = shim_create_effect_instance(&bp); effect = create_effect_instance(&bp);
effect->numParts = numParts; effect->numParts = numParts;
data = effect->data.iceShard = shim_general_heap_malloc(numParts * sizeof(*data)); data = effect->data.iceShard = general_heap_malloc(numParts * sizeof(*data));
ASSERT(effect->data.iceShard != NULL); ASSERT(effect->data.iceShard != NULL);
data->type = arg0; data->type = arg0;
@ -58,12 +58,12 @@ EffectInstance* ice_shard_main(
data->envCol.b = 255; data->envCol.b = 255;
data->envCol.a = 255; data->envCol.a = 255;
data->animFrame = 0; data->animFrame = 0;
data->animRate = (shim_rand_int(1) * 2 - 1) * 0.25 * (shim_rand_int(4) * 0.1 + 0.1); data->animRate = (rand_int(1) * 2 - 1) * 0.25 * (rand_int(4) * 0.1 + 0.1);
data->rotation = shim_rand_int(359); data->rotation = rand_int(359);
data->vel.x = shim_rand_int(10) - 5; data->vel.x = rand_int(10) - 5;
data->vel.y = shim_rand_int(10) - 5; data->vel.y = rand_int(10) - 5;
data->vel.z = shim_rand_int(10) - 5; data->vel.z = rand_int(10) - 5;
data->angularVel = shim_rand_int(40) - 20; data->angularVel = rand_int(40) - 20;
data->gravAccel = -0.1f; data->gravAccel = -0.1f;
return effect; return effect;
@ -88,7 +88,7 @@ void ice_shard_update(EffectInstance* effect) {
data->lifetime++; data->lifetime++;
if (data->timeLeft < 0) { if (data->timeLeft < 0) {
shim_remove_effect(effect); remove_effect(effect);
return; return;
} }
@ -126,7 +126,7 @@ void ice_shard_render(EffectInstance* effect) {
renderTask.distance = 10; renderTask.distance = 10;
renderTask.renderMode = RENDER_MODE_2D; renderTask.renderMode = RENDER_MODE_2D;
retTask = shim_queue_render_task(&renderTask); retTask = queue_render_task(&renderTask);
retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR;
} }
@ -143,13 +143,13 @@ void ice_shard_appendGfx(void* effect) {
gDPPipeSync(gMainGfxPos++); gDPPipeSync(gMainGfxPos++);
gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data));
shim_guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].currentYaw, 0.0f, data->scale, data->pos.x, data->pos.y, data->pos.z); guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].currentYaw, 0.0f, data->scale, data->pos.x, data->pos.y, data->pos.z);
shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
shim_guRotateF(sp20, data->rotation, 0.0f, 0.0f, 1.0f); guRotateF(sp20, data->rotation, 0.0f, 0.0f, 1.0f);
shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
gSPDisplayList(gMainGfxPos++, D_E01108B4[0]); gSPDisplayList(gMainGfxPos++, D_E01108B4[0]);

View File

@ -101,14 +101,14 @@ void landing_dust_main(s32 type, f32 x, f32 y, f32 z, f32 arg4) {
bpPtr->renderUI = NULL; bpPtr->renderUI = NULL;
bpPtr->effectID = EFFECT_LANDING_DUST; bpPtr->effectID = EFFECT_LANDING_DUST;
effect = shim_create_effect_instance(bpPtr); effect = create_effect_instance(bpPtr);
effect->numParts = numParts; effect->numParts = numParts;
data = shim_general_heap_malloc(numParts * sizeof(*data)); data = general_heap_malloc(numParts * sizeof(*data));
effect->data.landingDust = data; effect->data.landingDust = data;
ASSERT(effect->data.landingDust != NULL); ASSERT(effect->data.landingDust != NULL);
shim_mem_clear(data, numParts * sizeof(*data)); mem_clear(data, numParts * sizeof(*data));
switch (type) { switch (type) {
case 0: case 0:
@ -147,9 +147,9 @@ void landing_dust_main(s32 type, f32 x, f32 y, f32 z, f32 arg4) {
data->x = 0.0f; data->x = 0.0f;
data->y = 0.0f; data->y = 0.0f;
data->z = 4.0f; data->z = 4.0f;
theta = shim_clamp_angle(90 + (180 * (i - 1))); theta = clamp_angle(90 + (180 * (i - 1)));
data->unk_30 = shim_sin_deg(theta); data->unk_30 = sin_deg(theta);
data->unk_34 = shim_cos_deg(theta); data->unk_34 = cos_deg(theta);
} }
break; break;
case 2: case 2:
@ -159,27 +159,27 @@ void landing_dust_main(s32 type, f32 x, f32 y, f32 z, f32 arg4) {
switch (i - 1) { switch (i - 1) {
case 0: case 0:
theta = 135.0f; theta = 135.0f;
data->x = -shim_sin_deg(theta) * 25.0f; data->x = -sin_deg(theta) * 25.0f;
data->y = 0.0f; data->y = 0.0f;
data->z = -shim_cos_deg(theta) * 25.0f; data->z = -cos_deg(theta) * 25.0f;
data->unk_24 = -0.04f; data->unk_24 = -0.04f;
data->unk_28 = 0.94f; data->unk_28 = 0.94f;
data->unk_20 = 0.95f; data->unk_20 = 0.95f;
break; break;
case 1: case 1:
theta = -135.0f; theta = -135.0f;
data->x = -shim_sin_deg(theta) * 25.0f; data->x = -sin_deg(theta) * 25.0f;
data->y = 4.0f; data->y = 4.0f;
data->z = -shim_cos_deg(theta) * 25.0f; data->z = -cos_deg(theta) * 25.0f;
data->unk_24 = -0.04f; data->unk_24 = -0.04f;
data->unk_28 = 0.94f; data->unk_28 = 0.94f;
data->unk_20 = 0.84999996f; data->unk_20 = 0.84999996f;
break; break;
case 2: case 2:
theta = 20.0f; theta = 20.0f;
data->x = -shim_sin_deg(theta) * 25.0f; data->x = -sin_deg(theta) * 25.0f;
data->y = 10.0f; data->y = 10.0f;
data->z = -shim_cos_deg(theta) * 25.0f; data->z = -cos_deg(theta) * 25.0f;
data->unk_24 = -0.04f; data->unk_24 = -0.04f;
data->unk_28 = 0.94f; data->unk_28 = 0.94f;
data->unk_20 = 0.75f; data->unk_20 = 0.75f;
@ -199,11 +199,11 @@ void landing_dust_main(s32 type, f32 x, f32 y, f32 z, f32 arg4) {
data->unk_28 = 0.94f; data->unk_28 = 0.94f;
data->unk_2C = 0.94f; data->unk_2C = 0.94f;
theta = arg4 + ((i - 1) * 360 / (numParts - 1)); theta = arg4 + ((i - 1) * 360 / (numParts - 1));
data->x = -shim_sin_deg(theta) * 10.0f; data->x = -sin_deg(theta) * 10.0f;
data->y = 0.0f; data->y = 0.0f;
data->z = -shim_cos_deg(theta) * 10.0f; data->z = -cos_deg(theta) * 10.0f;
data->unk_30 = shim_sin_deg(theta); data->unk_30 = sin_deg(theta);
data->unk_34 = shim_cos_deg(theta); data->unk_34 = cos_deg(theta);
} }
break; break;
} }
@ -218,7 +218,7 @@ void landing_dust_update(EffectInstance* effect) {
data->unk_40 = D_E000CD24[data->unk_38][data->unk_3C++]; data->unk_40 = D_E000CD24[data->unk_38][data->unk_3C++];
if (data->unk_40 < 0) { if (data->unk_40 < 0) {
shim_remove_effect(effect); remove_effect(effect);
} else { } else {
s32 type = data->type; s32 type = data->type;
s32 i; s32 i;
@ -253,7 +253,7 @@ void landing_dust_render(EffectInstance* effect) {
renderTask.distance = 0; renderTask.distance = 0;
renderTask.renderMode = RENDER_MODE_28; renderTask.renderMode = RENDER_MODE_28;
retTask = shim_queue_render_task(&renderTask); retTask = queue_render_task(&renderTask);
retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR;
} }
@ -286,10 +286,10 @@ void landing_dust_appendGfx(void* effect) {
spD8 = temp_t0 & 7; spD8 = temp_t0 & 7;
spDC = temp_t0 & 0x40; spDC = temp_t0 & 0x40;
shim_guTranslateF(mtx1, part->x, part->y, part->z); guTranslateF(mtx1, part->x, part->y, part->z);
shim_guRotateF(mtx2, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); guRotateF(mtx2, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f);
shim_guMtxCatF(mtx2, mtx1, mtx3); guMtxCatF(mtx2, mtx1, mtx3);
shim_guMtxF2L(mtx3, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(mtx3, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, gSPMatrix(gMainGfxPos++,
&gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
@ -332,8 +332,8 @@ void landing_dust_appendGfx(void* effect) {
part++; part++;
for (i = 1; i < ((EffectInstance*)effect)->numParts; i++, part++) { for (i = 1; i < ((EffectInstance*)effect)->numParts; i++, part++) {
shim_guTranslateF(mtx1, part->x, part->y, part->z); guTranslateF(mtx1, part->x, part->y, part->z);
shim_guMtxF2L(mtx1, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(mtx1, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++],
G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
gSPDisplayList(gMainGfxPos++, dlist1); gSPDisplayList(gMainGfxPos++, dlist1);

View File

@ -36,9 +36,9 @@ void lens_flare_main(s32 type, f32 posX, f32 posY, f32 posZ, s32 duration) {
bp.renderUI = NULL; bp.renderUI = NULL;
bp.effectID = EFFECT_LENS_FLARE; bp.effectID = EFFECT_LENS_FLARE;
effect = shim_create_effect_instance(&bp); effect = create_effect_instance(&bp);
effect->numParts = numParts; effect->numParts = numParts;
data = effect->data.lensFlare = shim_general_heap_malloc(numParts * sizeof(*data)); data = effect->data.lensFlare = general_heap_malloc(numParts * sizeof(*data));
ASSERT(effect->data.lensFlare != NULL); ASSERT(effect->data.lensFlare != NULL);
data->type = type; data->type = type;
@ -73,7 +73,7 @@ void lens_flare_update(EffectInstance* effect) {
data->lifetime++; data->lifetime++;
if (data->timeLeft < 0) { if (data->timeLeft < 0) {
shim_remove_effect(effect); remove_effect(effect);
return; return;
} }
@ -89,8 +89,8 @@ void lens_flare_update(EffectInstance* effect) {
data->largeFlareScaleVel += 0.29; data->largeFlareScaleVel += 0.29;
data->largeFlareRot += data->largeFlareRotVel; data->largeFlareRot += data->largeFlareRotVel;
data->largeFlareRotVel *= 0.93; data->largeFlareRotVel *= 0.93;
data->smallFlareScale = shim_sin_deg(time * 50) * 0.5 + 0.9; data->smallFlareScale = sin_deg(time * 50) * 0.5 + 0.9;
data->smallFlareAlpha = shim_sin_deg(time * 40) * 64.0f + 144.0f; data->smallFlareAlpha = sin_deg(time * 40) * 64.0f + 144.0f;
} }
void lens_flare_render(EffectInstance* effect) { void lens_flare_render(EffectInstance* effect) {
@ -102,7 +102,7 @@ void lens_flare_render(EffectInstance* effect) {
renderTask.distance = 20; renderTask.distance = 20;
renderTask.renderMode = RENDER_MODE_2D; renderTask.renderMode = RENDER_MODE_2D;
retTask = shim_queue_render_task(&renderTask); retTask = queue_render_task(&renderTask);
retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR;
} }
@ -119,18 +119,18 @@ void lens_flare_appendGfx(void* effect) {
gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data));
gSPDisplayList(gMainGfxPos++, D_E0034788[type]); gSPDisplayList(gMainGfxPos++, D_E0034788[type]);
shim_guTranslateF(mtxTransform, data->pos.x, data->pos.y, data->pos.z); guTranslateF(mtxTransform, data->pos.x, data->pos.y, data->pos.z);
shim_guRotateF(mtxTemp, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); guRotateF(mtxTemp, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f);
shim_guMtxCatF(mtxTemp, mtxTransform, mtxShared); guMtxCatF(mtxTemp, mtxTransform, mtxShared);
alpha = data->smallFlareAlpha; alpha = data->smallFlareAlpha;
idx = data->lifetime * 3; idx = data->lifetime * 3;
// small twinkling shine which changes color // small twinkling shine which changes color
if (type == 0) { if (type == 0) {
shim_guScaleF(mtxTemp, data->smallFlareScale, data->smallFlareScale, data->smallFlareScale); guScaleF(mtxTemp, data->smallFlareScale, data->smallFlareScale, data->smallFlareScale);
shim_guMtxCatF(mtxTemp, mtxShared, mtxTransform); guMtxCatF(mtxTemp, mtxShared, mtxTransform);
shim_guMtxF2L(mtxTransform, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(mtxTransform, &gDisplayContext->matrixStack[gMatrixListPos]);
idx %= ARRAY_COUNT(D_E0034790); idx %= ARRAY_COUNT(D_E0034790);
@ -147,11 +147,11 @@ void lens_flare_appendGfx(void* effect) {
// large growing white shine // large growing white shine
if (alpha > 0) { if (alpha > 0) {
shim_guScaleF(mtxTemp, data->largeFlareScale, data->largeFlareScale, data->largeFlareScale); guScaleF(mtxTemp, data->largeFlareScale, data->largeFlareScale, data->largeFlareScale);
shim_guMtxCatF(mtxTemp, mtxShared, mtxTransform); guMtxCatF(mtxTemp, mtxShared, mtxTransform);
shim_guRotateF(mtxTemp, data->largeFlareRot, 0.0f, 0.0f, 1.0f); guRotateF(mtxTemp, data->largeFlareRot, 0.0f, 0.0f, 1.0f);
shim_guMtxCatF(mtxTemp, mtxTransform, mtxTransform); guMtxCatF(mtxTemp, mtxTransform, mtxTransform);
shim_guMtxF2L(mtxTransform, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(mtxTransform, &gDisplayContext->matrixStack[gMatrixListPos]);
gDPSetPrimColor(gMainGfxPos++, 0, 0, D_E0034790[idx], D_E0034790[idx + 1], D_E0034790[idx + 2], alpha); gDPSetPrimColor(gMainGfxPos++, 0, 0, D_E0034790[idx], D_E0034790[idx + 1], D_E0034790[idx + 2], alpha);
gDPSetPrimColor(gMainGfxPos++, 0, 0, 255, 255, 255, alpha); gDPSetPrimColor(gMainGfxPos++, 0, 0, 255, 255, 255, alpha);

View File

@ -107,9 +107,9 @@ void light_rays_main(
bpPtr->renderUI = NULL; bpPtr->renderUI = NULL;
bpPtr->effectID = EFFECT_LIGHT_RAYS; bpPtr->effectID = EFFECT_LIGHT_RAYS;
effect = shim_create_effect_instance(bpPtr); effect = create_effect_instance(bpPtr);
effect->numParts = numParts; effect->numParts = numParts;
part = effect->data.lightRays = shim_general_heap_malloc(numParts * sizeof(*part)); part = effect->data.lightRays = general_heap_malloc(numParts * sizeof(*part));
ASSERT(effect->data.lightRays != NULL); ASSERT(effect->data.lightRays != NULL);
part->type = type; part->type = type;
@ -201,7 +201,7 @@ void light_rays_update(EffectInstance* effect) {
} }
if (part->timeLeft < 0) { if (part->timeLeft < 0) {
shim_remove_effect(effect); remove_effect(effect);
return; return;
} }
@ -263,7 +263,7 @@ void light_rays_render(EffectInstance* effect) {
renderTask.distance = 10; renderTask.distance = 10;
renderTask.renderMode = RENDER_MODE_2D; renderTask.renderMode = RENDER_MODE_2D;
retTask = shim_queue_render_task(&renderTask); retTask = queue_render_task(&renderTask);
retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR;
} }
@ -291,7 +291,7 @@ void light_rays_appendGfx(void* effect) {
gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data));
gSPDisplayList(gMainGfxPos++, dlist2); gSPDisplayList(gMainGfxPos++, dlist2);
shim_guTranslateF(mtxTranslate, part->pos.x, part->pos.y, part->pos.z); guTranslateF(mtxTranslate, part->pos.x, part->pos.y, part->pos.z);
part++; part++;
for (i = 1; i < ((EffectInstance*)effect)->numParts; i++, part++) { for (i = 1; i < ((EffectInstance*)effect)->numParts; i++, part++) {
@ -306,8 +306,8 @@ void light_rays_appendGfx(void* effect) {
func_E006A85C(part); func_E006A85C(part);
} }
shim_guRotateF(mtxTemp, part->rotation.x, 1.0f, 0.0f, 0.0f); guRotateF(mtxTemp, part->rotation.x, 1.0f, 0.0f, 0.0f);
shim_guMtxCatF(mtxTemp, mtxTranslate, mtxTransform); guMtxCatF(mtxTemp, mtxTranslate, mtxTransform);
if (type >= 2) { if (type >= 2) {
unk_64 = part->rotation.z; unk_64 = part->rotation.z;
@ -317,12 +317,12 @@ void light_rays_appendGfx(void* effect) {
angleZ = unk_64 + 0.0f; angleZ = unk_64 + 0.0f;
} }
shim_guRotateF(mtxTemp, angleZ, 0.0f, 0.0f, 1.0f); guRotateF(mtxTemp, angleZ, 0.0f, 0.0f, 1.0f);
shim_guMtxCatF(mtxTemp, mtxTransform, mtxTransform); guMtxCatF(mtxTemp, mtxTransform, mtxTransform);
shim_guRotateF(mtxTemp, part->rotation.y, 0.0f, 1.0f, 0.0f); guRotateF(mtxTemp, part->rotation.y, 0.0f, 1.0f, 0.0f);
shim_guMtxCatF(mtxTemp, mtxTransform, mtxTransform); guMtxCatF(mtxTemp, mtxTransform, mtxTransform);
shim_guTranslateF(mtxTemp, part->unk_58, 0.0f, 0.0f); guTranslateF(mtxTemp, part->unk_58, 0.0f, 0.0f);
shim_guMtxCatF(mtxTemp, mtxTransform, mtxTransform); guMtxCatF(mtxTemp, mtxTransform, mtxTransform);
scaleX = scaleZ = (temp + 3.0f) * 0.25; scaleX = scaleZ = (temp + 3.0f) * 0.25;
switch (i & 3) { switch (i & 3) {
@ -341,22 +341,22 @@ void light_rays_appendGfx(void* effect) {
break; break;
} }
shim_guScaleF(mtxTemp, scaleX, scaleY, scaleZ); guScaleF(mtxTemp, scaleX, scaleY, scaleZ);
shim_guMtxCatF(mtxTemp, mtxTransform, mtxTransform); guMtxCatF(mtxTemp, mtxTransform, mtxTransform);
gDPSetPrimColor(gMainGfxPos++, 0, 0, 255, 255, 240, part->alpha); gDPSetPrimColor(gMainGfxPos++, 0, 0, 255, 255, 240, part->alpha);
} else { } else {
shim_guRotateF(mtxTemp, part->rotation.y, 0.0f, 1.0f, 0.0f); guRotateF(mtxTemp, part->rotation.y, 0.0f, 1.0f, 0.0f);
shim_guMtxCatF(mtxTemp, mtxTransform, mtxTransform); guMtxCatF(mtxTemp, mtxTransform, mtxTransform);
shim_guRotateF(mtxTemp, part->rotation.z, 0.0f, 0.0f, 1.0f); guRotateF(mtxTemp, part->rotation.z, 0.0f, 0.0f, 1.0f);
shim_guMtxCatF(mtxTemp, mtxTransform, mtxTransform); guMtxCatF(mtxTemp, mtxTransform, mtxTransform);
shim_guTranslateF(mtxTemp, part->unk_58, 0.0f, 0.0f); guTranslateF(mtxTemp, part->unk_58, 0.0f, 0.0f);
shim_guMtxCatF(mtxTemp, mtxTransform, mtxTransform); guMtxCatF(mtxTemp, mtxTransform, mtxTransform);
gDPSetPrimColor(gMainGfxPos++, 0, 0, 255, 255, 181, part->alpha); gDPSetPrimColor(gMainGfxPos++, 0, 0, 255, 255, 181, part->alpha);
} }
shim_guMtxF2L(mtxTransform, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(mtxTransform, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(gMainGfxPos++, dlist); gSPDisplayList(gMainGfxPos++, dlist);

View File

@ -45,9 +45,9 @@ EffectInstance* lightning_main(
bp.renderUI = NULL; bp.renderUI = NULL;
bp.effectID = EFFECT_LIGHTNING; bp.effectID = EFFECT_LIGHTNING;
effect = shim_create_effect_instance(&bp); effect = create_effect_instance(&bp);
effect->numParts = numParts; effect->numParts = numParts;
data = effect->data.lightning = shim_general_heap_malloc(numParts * sizeof(*data)); data = effect->data.lightning = general_heap_malloc(numParts * sizeof(*data));
ASSERT(effect->data.lightning != NULL); ASSERT(effect->data.lightning != NULL);
data->unk_00 = arg0; data->unk_00 = arg0;
@ -74,13 +74,13 @@ EffectInstance* lightning_main(
if (arg0 == 1 || arg0 == 2) { if (arg0 == 1 || arg0 == 2) {
if (arg0 == 1) { if (arg0 == 1) {
shim_load_effect(EFFECT_GATHER_MAGIC); load_effect(EFFECT_GATHER_MAGIC);
data->unk_44 = gather_magic_main(0, -118.0f, 184.0f, 79.0f, 1.0f, -1); data->unk_44 = gather_magic_main(0, -118.0f, 184.0f, 79.0f, 1.0f, -1);
shim_load_effect(EFFECT_BULB_GLOW); load_effect(EFFECT_BULB_GLOW);
bulb_glow_main(0, -120.0f, 189.0f, 77.0f, 1.0f, &data->unk_48); bulb_glow_main(0, -120.0f, 189.0f, 77.0f, 1.0f, &data->unk_48);
} else { } else {
shim_load_effect(EFFECT_SNAKING_STATIC); load_effect(EFFECT_SNAKING_STATIC);
data->unk_48 = snaking_static_main(0, -120.0f, 189.0f, 72.0f, 1.0f, 0); data->unk_48 = snaking_static_main(0, -120.0f, 189.0f, 72.0f, 1.0f, 0);
data->unk_48->data.snakingStatic->unk_28 = 255; data->unk_48->data.snakingStatic->unk_28 = 255;
@ -95,7 +95,7 @@ EffectInstance* lightning_main(
if (arg0 >= 3) { if (arg0 >= 3) {
s32 effectArg0; s32 effectArg0;
shim_load_effect(EFFECT_FLASHING_BOX_SHOCKWAVE); load_effect(EFFECT_FLASHING_BOX_SHOCKWAVE);
if (gGameStatusPtr->isBattle == TRUE) { if (gGameStatusPtr->isBattle == TRUE) {
effectArg0 = 3; effectArg0 = 3;
} else { } else {
@ -128,15 +128,15 @@ void lightning_update(EffectInstance* effect) {
data->unk_18++; data->unk_18++;
if (data->unk_14 < 0) { if (data->unk_14 < 0) {
shim_remove_effect(effect); remove_effect(effect);
if (data->unk_48 != NULL) { if (data->unk_48 != NULL) {
shim_remove_effect(data->unk_48); remove_effect(data->unk_48);
data->unk_48 = NULL; data->unk_48 = NULL;
} }
if (data->unk_44 != NULL) { if (data->unk_44 != NULL) {
shim_remove_effect(data->unk_44); remove_effect(data->unk_44);
data->unk_44 = NULL; data->unk_44 = NULL;
} }
} else { } else {
@ -144,7 +144,7 @@ void lightning_update(EffectInstance* effect) {
s32 unk_18 = data->unk_18; s32 unk_18 = data->unk_18;
if (data->unk_44 != NULL && unk_18 >= 18) { if (data->unk_44 != NULL && unk_18 >= 18) {
shim_remove_effect(data->unk_44); remove_effect(data->unk_44);
data->unk_44 = NULL; data->unk_44 = NULL;
} }
@ -208,7 +208,7 @@ void lightning_render(EffectInstance* effect) {
renderTask.distance = 10; renderTask.distance = 10;
renderTask.renderMode = RENDER_MODE_SURFACE_XLU_LAYER3; renderTask.renderMode = RENDER_MODE_SURFACE_XLU_LAYER3;
retTask = shim_queue_render_task(&renderTask); retTask = queue_render_task(&renderTask);
retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR;
} }
@ -245,24 +245,24 @@ void lightning_appendGfx(void* effect) {
case 0: case 0:
case 1: case 1:
case 2: case 2:
shim_guPerspectiveF(sp20, &perspNorm, 30.0f, (f32) camera->viewportW / (f32) camera->viewportH, 4.0f, 16384.0f, 1.0f); guPerspectiveF(sp20, &perspNorm, 30.0f, (f32) camera->viewportW / (f32) camera->viewportH, 4.0f, 16384.0f, 1.0f);
shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION);
shim_guTranslateF(sp20, data->unk_04, data->unk_08, -500.0f); guTranslateF(sp20, data->unk_04, data->unk_08, -500.0f);
shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gDPSetPrimColor(gMainGfxPos++, 0, 0, 255, 47, 198, 255); gDPSetPrimColor(gMainGfxPos++, 0, 0, 255, 47, 198, 255);
break; break;
default: default:
shim_guTranslateF(sp20, data->unk_04, data->unk_08, data->unk_0C); guTranslateF(sp20, data->unk_04, data->unk_08, data->unk_0C);
shim_guRotateF(sp60, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); guRotateF(sp60, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f);
shim_guMtxCatF(sp60, sp20, sp20); guMtxCatF(sp60, sp20, sp20);
shim_guTranslateF(sp60, 0.0f, 0.0f, 1.0f); guTranslateF(sp60, 0.0f, 0.0f, 1.0f);
shim_guMtxCatF(sp60, sp20, sp20); guMtxCatF(sp60, sp20, sp20);
shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gDPSetPrimColor(gMainGfxPos++, 0, 0, 255, 255, 0, data->unk_10); gDPSetPrimColor(gMainGfxPos++, 0, 0, 255, 255, 0, data->unk_10);

View File

@ -67,9 +67,9 @@ EffectInstance* lightning_bolt_main(
bp.renderUI = NULL; bp.renderUI = NULL;
bp.effectID = EFFECT_LIGHTNING_BOLT; bp.effectID = EFFECT_LIGHTNING_BOLT;
effect = shim_create_effect_instance(&bp); effect = create_effect_instance(&bp);
effect->numParts = numParts; effect->numParts = numParts;
data = effect->data.lightningBolt = shim_general_heap_malloc(numParts * sizeof(*data)); data = effect->data.lightningBolt = general_heap_malloc(numParts * sizeof(*data));
ASSERT(effect->data.lightningBolt != NULL); ASSERT(effect->data.lightningBolt != NULL);
data->type = type; data->type = type;
@ -94,14 +94,14 @@ EffectInstance* lightning_bolt_main(
temp = SQ(startX - endX) + SQ(startY - endY) + SQ(startZ - endZ); temp = SQ(startX - endX) + SQ(startY - endY) + SQ(startZ - endZ);
if (temp != 0.0f) { if (temp != 0.0f) {
data->unk_114 = shim_sqrtf(temp) * 0.005; data->unk_114 = sqrtf(temp) * 0.005;
data->outerColor.r = 255; data->outerColor.r = 255;
data->outerColor.g = 220; data->outerColor.g = 220;
data->outerColor.b = 20; data->outerColor.b = 20;
data->innerColor.r = 255; data->innerColor.r = 255;
data->innerColor.g = 255; data->innerColor.g = 255;
data->innerColor.b = 255; data->innerColor.b = 255;
data->unk_110 = shim_rand_int(359); data->unk_110 = rand_int(359);
return effect; return effect;
} else { } else {
@ -113,7 +113,7 @@ void lightning_bolt_init(EffectInstance* effect) {
} }
f32 lightning_bolt_get_rand_symmetric(f32 interval) { f32 lightning_bolt_get_rand_symmetric(f32 interval) {
return (f32)shim_rand_int(interval) - interval * 0.5; return (f32)rand_int(interval) - interval * 0.5;
} }
void lightning_bolt_update(EffectInstance* effect) { void lightning_bolt_update(EffectInstance* effect) {
@ -132,7 +132,7 @@ void lightning_bolt_update(EffectInstance* effect) {
data->lifetime++; data->lifetime++;
if (data->timeLeft < 0) { if (data->timeLeft < 0) {
shim_remove_effect(effect); remove_effect(effect);
return; return;
} }
@ -162,7 +162,7 @@ void lightning_bolt_render(EffectInstance *effect) {
} }
renderTaskPointer->renderMode = RENDER_MODE_2D; renderTaskPointer->renderMode = RENDER_MODE_2D;
retTask = shim_queue_render_task(renderTaskPointer); retTask = queue_render_task(renderTaskPointer);
retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR;
} }
@ -208,8 +208,8 @@ void lightning_bolt_appendGfx(void* effect) {
gDPPipeSync(gMainGfxPos++); gDPPipeSync(gMainGfxPos++);
gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data));
shim_guScaleF(sp10, 0.1f, 0.1f, 0.1f); guScaleF(sp10, 0.1f, 0.1f, 0.1f);
shim_guMtxF2L(sp10, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp10, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gDPSetPrimColor(gMainGfxPos++, 0, 0, data->outerColor.r, data->outerColor.g, data->outerColor.b, alpha); gDPSetPrimColor(gMainGfxPos++, 0, 0, data->outerColor.r, data->outerColor.g, data->outerColor.b, alpha);
@ -237,8 +237,8 @@ void lightning_bolt_appendGfx(void* effect) {
theta = (data->unk_110 + (i - lifetime) * 10) % 120 - 60; theta = (data->unk_110 + (i - lifetime) * 10) % 120 - 60;
deltaPos = preset->offset[i]; deltaPos = preset->offset[i];
sinAngle = shim_sin_deg(theta) * deltaPos * 0.04; sinAngle = sin_deg(theta) * deltaPos * 0.04;
cosAngle = shim_cos_deg(theta) * deltaPos * 0.04; cosAngle = cos_deg(theta) * deltaPos * 0.04;
deltaX = avgDeltaX * cosAngle - avgDeltaY * sinAngle; deltaX = avgDeltaX * cosAngle - avgDeltaY * sinAngle;
deltaY = avgDeltaX * sinAngle + avgDeltaY * cosAngle; deltaY = avgDeltaX * sinAngle + avgDeltaY * cosAngle;
@ -258,14 +258,14 @@ void lightning_bolt_appendGfx(void* effect) {
for (i = 0; i < ARRAY_COUNT(data->boltVertexPosX); i++) { for (i = 0; i < ARRAY_COUNT(data->boltVertexPosX); i++) {
if (i == 0) { if (i == 0) {
edgeLength = 8.0f; edgeLength = 8.0f;
edgeAngle = -shim_atan2(data->boltVertexPosY[1], -data->boltVertexPosX[1], data->boltVertexPosY[0], -data->boltVertexPosX[0]); edgeAngle = -atan2(data->boltVertexPosY[1], -data->boltVertexPosX[1], data->boltVertexPosY[0], -data->boltVertexPosX[0]);
} else { } else {
edgeLength = 8.0f; edgeLength = 8.0f;
if (i == ARRAY_COUNT(data->boltVertexPosX) - 1) { if (i == ARRAY_COUNT(data->boltVertexPosX) - 1) {
edgeAngle = -90.0f; edgeAngle = -90.0f;
} else { } else {
nextAngle = -shim_atan2(data->boltVertexPosY[i + 1], -data->boltVertexPosX[i + 1], data->boltVertexPosY[i], -data->boltVertexPosX[i]); nextAngle = -atan2(data->boltVertexPosY[i + 1], -data->boltVertexPosX[i + 1], data->boltVertexPosY[i], -data->boltVertexPosX[i]);
prevAngle = -shim_atan2(data->boltVertexPosY[i], -data->boltVertexPosX[i], data->boltVertexPosY[i - 1], -data->boltVertexPosX[i - 1]); prevAngle = -atan2(data->boltVertexPosY[i], -data->boltVertexPosX[i], data->boltVertexPosY[i - 1], -data->boltVertexPosX[i - 1]);
if (prevAngle - nextAngle > 180.0f) { if (prevAngle - nextAngle > 180.0f) {
nextAngle += 360.0f; nextAngle += 360.0f;
} else if (prevAngle - nextAngle < -180.0f) { } else if (prevAngle - nextAngle < -180.0f) {
@ -283,8 +283,8 @@ void lightning_bolt_appendGfx(void* effect) {
edgeLength *= (widthScale * data->edgeLength[i]); edgeLength *= (widthScale * data->edgeLength[i]);
texOffsetX = (128 - i * 12) * 32; texOffsetX = (128 - i * 12) * 32;
edgeDeltaX = edgeLength * shim_sin_deg(edgeAngle); edgeDeltaX = edgeLength * sin_deg(edgeAngle);
edgeDeltaY = edgeLength * shim_cos_deg(edgeAngle); edgeDeltaY = edgeLength * cos_deg(edgeAngle);
edgeDeltaZ = 0.0f; edgeDeltaZ = 0.0f;
vtx->ob[0] = (data->boltVertexPosX[i] + edgeDeltaX) * 10.0f; vtx->ob[0] = (data->boltVertexPosX[i] + edgeDeltaX) * 10.0f;

View File

@ -63,9 +63,9 @@ EffectInstance* lil_oink_main(void) {
bp.renderUI = NULL; bp.renderUI = NULL;
bp.effectID = EFFECT_LIL_OINK; bp.effectID = EFFECT_LIL_OINK;
effect = shim_create_effect_instance(&bp); effect = create_effect_instance(&bp);
effect->numParts = numParts; effect->numParts = numParts;
data = effect->data.lilOink = shim_general_heap_malloc(numParts * sizeof(*data)); data = effect->data.lilOink = general_heap_malloc(numParts * sizeof(*data));
ASSERT(data != NULL); ASSERT(data != NULL);
data->lifetime = 0; data->lifetime = 0;
@ -109,7 +109,7 @@ void lil_oink_update(EffectInstance* effect) {
break; break;
case LIL_OINK_ANIM_3: case LIL_OINK_ANIM_3:
data->gfxFrame[i] = lil_oink_AnimateGfxSelect[time % ARRAY_COUNT(lil_oink_AnimateGfxSelect)]; data->gfxFrame[i] = lil_oink_AnimateGfxSelect[time % ARRAY_COUNT(lil_oink_AnimateGfxSelect)];
data->rot[i] = data->rot[i] + shim_sin_deg(time * 10); data->rot[i] = data->rot[i] + sin_deg(time * 10);
if (time >= 36) { if (time >= 36) {
animDone = TRUE; animDone = TRUE;
data->animTime[i] = 0; data->animTime[i] = 0;
@ -117,7 +117,7 @@ void lil_oink_update(EffectInstance* effect) {
break; break;
case LIL_OINK_ANIM_2: case LIL_OINK_ANIM_2:
data->gfxFrame[i] = lil_oink_AnimateGfxSelect[time % ARRAY_COUNT(lil_oink_AnimateGfxSelect)]; data->gfxFrame[i] = lil_oink_AnimateGfxSelect[time % ARRAY_COUNT(lil_oink_AnimateGfxSelect)];
data->jumpOffset[i] = shim_sin_deg(time * 20) * 2.0f; data->jumpOffset[i] = sin_deg(time * 20) * 2.0f;
animDone = TRUE; animDone = TRUE;
if (time >= 9) { if (time >= 9) {
data->jumpOffset[i] = 0.0f; data->jumpOffset[i] = 0.0f;
@ -126,7 +126,7 @@ void lil_oink_update(EffectInstance* effect) {
break; break;
case LIL_OINK_ANIM_4: case LIL_OINK_ANIM_4:
data->gfxFrame[i] = lil_oink_AnimateGfxSelect[time % ARRAY_COUNT(lil_oink_AnimateGfxSelect)]; data->gfxFrame[i] = lil_oink_AnimateGfxSelect[time % ARRAY_COUNT(lil_oink_AnimateGfxSelect)];
data->jumpOffset[i] = shim_sin_deg(time * 20) * 4.0f; data->jumpOffset[i] = sin_deg(time * 20) * 4.0f;
if (!(time < 9)) { if (!(time < 9)) {
animDone = TRUE; animDone = TRUE;
data->jumpOffset[i] = 0.0f; data->jumpOffset[i] = 0.0f;
@ -136,7 +136,7 @@ void lil_oink_update(EffectInstance* effect) {
case LIL_OINK_ANIM_5: case LIL_OINK_ANIM_5:
default: default:
data->gfxFrame[i] = lil_oink_AnimateGfxSelect[time % ARRAY_COUNT(lil_oink_AnimateGfxSelect)]; data->gfxFrame[i] = lil_oink_AnimateGfxSelect[time % ARRAY_COUNT(lil_oink_AnimateGfxSelect)];
data->jumpOffset[i] = shim_sin_deg(time * 5) * 12.0f; data->jumpOffset[i] = sin_deg(time * 5) * 12.0f;
if (!(time < 36)) { if (!(time < 36)) {
animDone = TRUE; animDone = TRUE;
data->jumpOffset[i] = 0.0f; data->jumpOffset[i] = 0.0f;
@ -164,7 +164,7 @@ void lil_oink_render(EffectInstance* effect) {
renderTask.distance = 10; renderTask.distance = 10;
renderTask.renderMode = RENDER_MODE_2D; renderTask.renderMode = RENDER_MODE_2D;
retTask = shim_queue_render_task(&renderTask); retTask = queue_render_task(&renderTask);
retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR;
} }
@ -183,15 +183,15 @@ void lil_oink_appendGfx(void* effect) {
for (i = 0; i < MAX_LIL_OINKS; i++) { for (i = 0; i < MAX_LIL_OINKS; i++) {
if (data->flags[i] & LIL_OINK_FLAG_VISIBLE) { if (data->flags[i] & LIL_OINK_FLAG_VISIBLE) {
shim_guPositionF(mtxTransform, 0.0f, 180.0f - data->rot[i], 0.0f, 1.0f, guPositionF(mtxTransform, 0.0f, 180.0f - data->rot[i], 0.0f, 1.0f,
data->x[i], data->y[i] + data->jumpOffset[i], data->z[i]); data->x[i], data->y[i] + data->jumpOffset[i], data->z[i]);
shim_guMtxF2L(mtxTransform, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(mtxTransform, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++],
G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(gMainGfxPos++, D_E0114718[data->type[i]]); gSPDisplayList(gMainGfxPos++, D_E0114718[data->type[i]]);
if (data->type[i] == LIL_OINK_TYPE_SILVER || data->type[i] == LIL_OINK_TYPE_GOLD) { if (data->type[i] == LIL_OINK_TYPE_SILVER || data->type[i] == LIL_OINK_TYPE_GOLD) {
f32 shineVariation = shim_sin_deg(angle) * 63.0f; f32 shineVariation = sin_deg(angle) * 63.0f;
s8 primColor = shineVariation + 63.0f; s8 primColor = shineVariation + 63.0f;
gDPSetPrimColor(gMainGfxPos++, 0, 0, primColor, primColor, primColor, 0); gDPSetPrimColor(gMainGfxPos++, 0, 0, primColor, primColor, primColor, 0);

View File

@ -22,9 +22,9 @@ EffectInstance* merlin_house_stars_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3)
bp.renderUI = NULL; bp.renderUI = NULL;
bp.effectID = EFFECT_MERLIN_HOUSE_STARS; bp.effectID = EFFECT_MERLIN_HOUSE_STARS;
effect = shim_create_effect_instance(&bp); effect = create_effect_instance(&bp);
effect->numParts = numParts; effect->numParts = numParts;
data = effect->data.merlinHouseStars = shim_general_heap_malloc(numParts * sizeof(*data)); data = effect->data.merlinHouseStars = general_heap_malloc(numParts * sizeof(*data));
ASSERT(effect->data.merlinHouseStars != NULL); ASSERT(effect->data.merlinHouseStars != NULL);
data->unk_04 = 100; data->unk_04 = 100;
@ -63,7 +63,7 @@ void merlin_house_stars_update(EffectInstance* effect) {
data->unk_08++; data->unk_08++;
if (data->unk_04 < 0) { if (data->unk_04 < 0) {
shim_remove_effect(effect); remove_effect(effect);
return; return;
} }
@ -119,7 +119,7 @@ void merlin_house_stars_render(EffectInstance* effect) {
renderTask.distance = 0; renderTask.distance = 0;
renderTask.renderMode = RENDER_MODE_2D; renderTask.renderMode = RENDER_MODE_2D;
retTask = shim_queue_render_task(&renderTask); retTask = queue_render_task(&renderTask);
retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR;
} }
@ -137,10 +137,10 @@ void merlin_house_stars_appendGfx(void* effect) {
gDPPipeSync(gMainGfxPos++); gDPPipeSync(gMainGfxPos++);
gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data));
shim_guTranslateF(sp10, data->unk_0C, data->unk_10, data->unk_14); guTranslateF(sp10, data->unk_0C, data->unk_10, data->unk_14);
shim_guScaleF(sp50, 0.96f, 0.96f, 0.96f); guScaleF(sp50, 0.96f, 0.96f, 0.96f);
shim_guMtxCatF(sp50, sp10, sp10); guMtxCatF(sp50, sp10, sp10);
shim_guMtxF2L(sp10, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp10, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gDPSetPrimColor(gMainGfxPos++, 0, 0, 0, 0, 0, 127); gDPSetPrimColor(gMainGfxPos++, 0, 0, 0, 0, 0, 127);

View File

@ -69,9 +69,9 @@ EffectInstance* misc_particles_main(
bp.renderUI = NULL; bp.renderUI = NULL;
bp.effectID = EFFECT_MISC_PARTICLES; bp.effectID = EFFECT_MISC_PARTICLES;
effect = shim_create_effect_instance(&bp); effect = create_effect_instance(&bp);
effect->numParts = numParticles; effect->numParts = numParticles;
part = effect->data.miscParticles = shim_general_heap_malloc(numParticles * sizeof(*part)); part = effect->data.miscParticles = general_heap_malloc(numParticles * sizeof(*part));
ASSERT(effect->data.miscParticles != NULL); ASSERT(effect->data.miscParticles != NULL);
part->variation = variation; part->variation = variation;
@ -113,9 +113,9 @@ EffectInstance* misc_particles_main(
part->glowColor.a = 255; part->glowColor.a = 255;
break; break;
default: default:
part->innerColor.r = shim_rand_int(127) + 128; part->innerColor.r = rand_int(127) + 128;
part->innerColor.g = shim_rand_int(255 - part->innerColor.r) + 128; part->innerColor.g = rand_int(255 - part->innerColor.r) + 128;
part->innerColor.b = shim_rand_int(383 - part->innerColor.r - part->innerColor.g) + 128; part->innerColor.b = rand_int(383 - part->innerColor.r - part->innerColor.g) + 128;
part->glowColor.r = 127; part->glowColor.r = 127;
part->glowColor.g = 127; part->glowColor.g = 127;
part->glowColor.b = 127; part->glowColor.b = 127;
@ -172,7 +172,7 @@ void misc_particles_update(EffectInstance* effect) {
particle->lifetime++; particle->lifetime++;
if (particle->timeLeft < 0) { if (particle->timeLeft < 0) {
shim_remove_effect(effect); remove_effect(effect);
return; return;
} }
@ -187,8 +187,8 @@ void misc_particles_update(EffectInstance* effect) {
posX = particle->pos.x; posX = particle->pos.x;
posY = particle->pos.y; posY = particle->pos.y;
posZ = particle->pos.z; posZ = particle->pos.z;
temp_cos = shim_cos_deg(gCameras[gCurrentCameraID].currentYaw); temp_cos = cos_deg(gCameras[gCurrentCameraID].currentYaw);
temp_sin = shim_sin_deg(gCameras[gCurrentCameraID].currentYaw); temp_sin = sin_deg(gCameras[gCurrentCameraID].currentYaw);
innerColorR = particle->innerColor.r; innerColorR = particle->innerColor.r;
innerColorG = particle->innerColor.g; innerColorG = particle->innerColor.g;
innerColorB = particle->innerColor.b; innerColorB = particle->innerColor.b;
@ -208,9 +208,9 @@ void misc_particles_update(EffectInstance* effect) {
if (particle->animTime >= 0) { if (particle->animTime >= 0) {
if (particle->animTime == 0) { if (particle->animTime == 0) {
f32 randMag = shim_rand_int(scaleX) - scaleX * 0.5; f32 randMag = rand_int(scaleX) - scaleX * 0.5;
particle->pos.x = posX + randMag * temp_cos - temp_sin; particle->pos.x = posX + randMag * temp_cos - temp_sin;
particle->pos.y = posY + shim_rand_int(scaleY); particle->pos.y = posY + rand_int(scaleY);
particle->pos.z = posZ + randMag * temp_sin + temp_cos; particle->pos.z = posZ + randMag * temp_sin + temp_cos;
particle->innerColor.r = innerColorR; particle->innerColor.r = innerColorR;
particle->innerColor.g = innerColorG; particle->innerColor.g = innerColorG;
@ -224,10 +224,10 @@ void misc_particles_update(EffectInstance* effect) {
particle->unk_18 = 0.0f; particle->unk_18 = 0.0f;
particle->unk_1C = 0.0f; particle->unk_1C = 0.0f;
particle->unk_24 = 0.0f; particle->unk_24 = 0.0f;
particle->unk_28 = (f32) (-shim_rand_int(10) - 2) * 0.05; particle->unk_28 = (f32) (-rand_int(10) - 2) * 0.05;
particle->unk_5C = 0.0f; particle->unk_5C = 0.0f;
particle->unk_60 = 0.0f; particle->unk_60 = 0.0f;
particle->scale = (f32) shim_rand_int(10) * 0.05 + 0.5; particle->scale = (f32) rand_int(10) * 0.05 + 0.5;
} }
particle->innerColor.a = D_E00E4E00[particle->animTime]; particle->innerColor.a = D_E00E4E00[particle->animTime];
particle->pos.x += particle->unk_18; particle->pos.x += particle->unk_18;
@ -241,16 +241,16 @@ void misc_particles_update(EffectInstance* effect) {
case 3: case 3:
if (particle->animTime == 0) { if (particle->animTime == 0) {
if (variation == 2) { if (variation == 2) {
particle->unk_18 = (f32) (shim_rand_int(20) - 10) * 0.05; particle->unk_18 = (f32) (rand_int(20) - 10) * 0.05;
particle->unk_1C = (f32) (shim_rand_int(20) - 10) * 0.05; particle->unk_1C = (f32) (rand_int(20) - 10) * 0.05;
} else { } else {
particle->unk_18 = 0.0f; particle->unk_18 = 0.0f;
particle->unk_1C = 0.0f; particle->unk_1C = 0.0f;
} }
particle->unk_24 = 0.0f; particle->unk_24 = 0.0f;
particle->unk_28 = 0.0f; particle->unk_28 = 0.0f;
particle->unk_5C = shim_rand_int(15); particle->unk_5C = rand_int(15);
particle->unk_60 = shim_rand_int(15); particle->unk_60 = rand_int(15);
particle->innerColor.a = 255; particle->innerColor.a = 255;
} }
particle->scale = (f32) D_E00E4DC0[particle->animTime] * 0.1; particle->scale = (f32) D_E00E4DC0[particle->animTime] * 0.1;
@ -267,9 +267,9 @@ void misc_particles_update(EffectInstance* effect) {
particle->unk_60 = 0.0f; particle->unk_60 = 0.0f;
particle->innerColor.a = 255; particle->innerColor.a = 255;
particle->scale = 1.0f; particle->scale = 1.0f;
particle->innerColor.r = shim_rand_int(127) + 128; particle->innerColor.r = rand_int(127) + 128;
particle->innerColor.g = shim_rand_int(255 - particle->innerColor.r) + 128; particle->innerColor.g = rand_int(255 - particle->innerColor.r) + 128;
particle->innerColor.b = shim_rand_int(383 - particle->innerColor.r - particle->innerColor.g) + 128; particle->innerColor.b = rand_int(383 - particle->innerColor.r - particle->innerColor.g) + 128;
} }
if (variation == 4) { if (variation == 4) {
particle->scale = (f32) D_E00E4DE0[particle->animTime] * 0.01; particle->scale = (f32) D_E00E4DE0[particle->animTime] * 0.01;
@ -291,7 +291,7 @@ void misc_particles_render(EffectInstance* effect) {
renderTask.distance = 7; renderTask.distance = 7;
renderTask.renderMode = RENDER_MODE_2D; renderTask.renderMode = RENDER_MODE_2D;
retTask = shim_queue_render_task(&renderTask); retTask = queue_render_task(&renderTask);
retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR;
} }
@ -314,8 +314,8 @@ void misc_particles_appendGfx(void* effect) {
particle++; particle++;
for (i = 1; i < ((EffectInstance*)effect)->numParts; i++, particle++) { for (i = 1; i < ((EffectInstance*)effect)->numParts; i++, particle++) {
if (particle->animTime >= 0) { if (particle->animTime >= 0) {
shim_guPositionF(mtxTransform, 0.0f, -gCameras[gCurrentCameraID].currentYaw, 0.0f, particle->scale * alphaScale, particle->pos.x, particle->pos.y, particle->pos.z); guPositionF(mtxTransform, 0.0f, -gCameras[gCurrentCameraID].currentYaw, 0.0f, particle->scale * alphaScale, particle->pos.x, particle->pos.y, particle->pos.z);
shim_guMtxF2L(mtxTransform, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(mtxTransform, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
gDPSetPrimColor(gMainGfxPos++, 0, 80 - particle->animTime, particle->innerColor.r, particle->innerColor.g, particle->innerColor.b, alphaScale * particle->innerColor.a); gDPSetPrimColor(gMainGfxPos++, 0, 80 - particle->animTime, particle->innerColor.r, particle->innerColor.g, particle->innerColor.b, alphaScale * particle->innerColor.a);

View File

@ -44,9 +44,9 @@ EffectInstance* motion_blur_flame_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f
bp.renderUI = NULL; bp.renderUI = NULL;
bp.effectID = EFFECT_MOTION_BLUR_FLAME; bp.effectID = EFFECT_MOTION_BLUR_FLAME;
effect = shim_create_effect_instance(&bp); effect = create_effect_instance(&bp);
effect->numParts = numParts; effect->numParts = numParts;
data = effect->data.motionBlurFlame = shim_general_heap_malloc(numParts * sizeof(*data)); data = effect->data.motionBlurFlame = general_heap_malloc(numParts * sizeof(*data));
ASSERT(effect->data.motionBlurFlame != NULL); ASSERT(effect->data.motionBlurFlame != NULL);
data->unk_00 = arg0; data->unk_00 = arg0;
@ -90,7 +90,7 @@ void motion_blur_flame_update(EffectInstance* effect) {
} }
if (data->unk_50 < 0) { if (data->unk_50 < 0) {
shim_remove_effect(effect); remove_effect(effect);
return; return;
} }
temp = data->unk_50; temp = data->unk_50;
@ -116,7 +116,7 @@ void motion_blur_flame_render(EffectInstance* effect) {
renderTask.distance = 100; renderTask.distance = 100;
renderTask.renderMode = RENDER_MODE_2D; renderTask.renderMode = RENDER_MODE_2D;
retTask = shim_queue_render_task(&renderTask); retTask = queue_render_task(&renderTask);
retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR;
} }
@ -165,7 +165,7 @@ void motion_blur_flame_appendGfx(void* effect) {
s32 height = temp_s1->unk_14; s32 height = temp_s1->unk_14;
if (i == 0) { if (i == 0) {
var_a2 = shim_is_point_visible(temp_f12, temp_f14, temp_f0, -1, &sp48, &sp4C); var_a2 = is_point_visible(temp_f12, temp_f14, temp_f0, -1, &sp48, &sp4C);
} else { } else {
var_a2 = temp_f0; var_a2 = temp_f0;
sp48 = temp_f12; sp48 = temp_f12;

View File

@ -40,9 +40,9 @@ EffectInstance* moving_cloud_main(
bp.renderUI = NULL; bp.renderUI = NULL;
bp.effectID = EFFECT_MOVING_CLOUD; bp.effectID = EFFECT_MOVING_CLOUD;
effect = shim_create_effect_instance(&bp); effect = create_effect_instance(&bp);
effect->numParts = numParts; effect->numParts = numParts;
data = effect->data.movingCloud = shim_general_heap_malloc(numParts * sizeof(*data)); data = effect->data.movingCloud = general_heap_malloc(numParts * sizeof(*data));
ASSERT(effect->data.movingCloud != NULL); ASSERT(effect->data.movingCloud != NULL);
data->unk_00 = arg0; data->unk_00 = arg0;
@ -54,7 +54,7 @@ EffectInstance* moving_cloud_main(
var_f12 = SQ(temp_f24) + SQ(temp_f22) + SQ(temp_f20); var_f12 = SQ(temp_f24) + SQ(temp_f22) + SQ(temp_f20);
if (var_f12 != 0.0f) { if (var_f12 != 0.0f) {
var_f12 = shim_sqrtf(var_f12); var_f12 = sqrtf(var_f12);
} }
if (arg7 > 0.0f) { if (arg7 > 0.0f) {
@ -132,7 +132,7 @@ void moving_cloud_update(EffectInstance* effect) {
data->unk_20++; data->unk_20++;
if (data->unk_1C < 0) { if (data->unk_1C < 0) {
shim_remove_effect(effect); remove_effect(effect);
return; return;
} }
@ -172,7 +172,7 @@ void moving_cloud_render(EffectInstance* effect) {
renderTask.distance = 10; renderTask.distance = 10;
renderTask.renderMode = RENDER_MODE_2D; renderTask.renderMode = RENDER_MODE_2D;
retTask = shim_queue_render_task(&renderTask); retTask = queue_render_task(&renderTask);
retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR;
} }
@ -186,10 +186,10 @@ void moving_cloud_appendGfx(void* effect) {
gDPPipeSync(gMainGfxPos++); gDPPipeSync(gMainGfxPos++);
gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data));
shim_guTranslateF(sp10, data->unk_04, data->unk_08, data->unk_0C); guTranslateF(sp10, data->unk_04, data->unk_08, data->unk_0C);
shim_guScaleF(sp50, data->unk_44, data->unk_44, data->unk_44); guScaleF(sp50, data->unk_44, data->unk_44, data->unk_44);
shim_guMtxCatF(sp50, sp10, sp10); guMtxCatF(sp50, sp10, sp10);
shim_guMtxF2L(sp10, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp10, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPMatrix(gMainGfxPos++, camera->unkMatrix, G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, camera->unkMatrix, G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW);

View File

@ -48,10 +48,10 @@ void music_note_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3) {
bp.renderUI = NULL; bp.renderUI = NULL;
bp.effectID = EFFECT_MUSIC_NOTE; bp.effectID = EFFECT_MUSIC_NOTE;
effect = shim_create_effect_instance(bpPtr); effect = create_effect_instance(bpPtr);
effect->numParts = numParts; effect->numParts = numParts;
part = effect->data.musicNote = shim_general_heap_malloc(numParts * sizeof(*part)); part = effect->data.musicNote = general_heap_malloc(numParts * sizeof(*part));
ASSERT(effect->data.musicNote != NULL); ASSERT(effect->data.musicNote != NULL);
@ -63,7 +63,7 @@ void music_note_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3) {
part->timeLeft = 0x40; part->timeLeft = 0x40;
part->unk_14 = 0; part->unk_14 = 0;
part->unk_1C = 0; part->unk_1C = 0;
part->unk_20 = shim_rand_int(6); part->unk_20 = rand_int(6);
switch (arg0) { switch (arg0) {
case 0: case 0:
part->unk_24 = 0.0f; part->unk_24 = 0.0f;
@ -72,16 +72,16 @@ void music_note_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3) {
part->unk_30 = 1.0f; part->unk_30 = 1.0f;
break; break;
case 1: case 1:
randInt = shim_rand_int(10); randInt = rand_int(10);
part->unk_24 = (randInt * 0.1) + -5.0; part->unk_24 = (randInt * 0.1) + -5.0;
part->unk_28 = (shim_rand_int(10) * 0.1) + 0.5; part->unk_28 = (rand_int(10) * 0.1) + 0.5;
part->unk_2C = 0; part->unk_2C = 0;
part->unk_30 = 0.0f; part->unk_30 = 0.0f;
break; break;
default: default:
randInt = shim_rand_int(10); randInt = rand_int(10);
part->unk_24 = 5.0 - (randInt * 0.1); part->unk_24 = 5.0 - (randInt * 0.1);
part->unk_28 = (shim_rand_int(10) * 0.1) + 1.0; part->unk_28 = (rand_int(10) * 0.1) + 1.0;
part->unk_2C = 0; part->unk_2C = 0;
part->unk_30 = 0.0f; part->unk_30 = 0.0f;
break; break;
@ -99,7 +99,7 @@ void music_note_update(EffectInstance* effect) {
part->unk_1C++; part->unk_1C++;
timeLeft = part->timeLeft; timeLeft = part->timeLeft;
if (timeLeft < 0) { if (timeLeft < 0) {
shim_remove_effect(effect); remove_effect(effect);
return; return;
} }
if (timeLeft >= 6) { if (timeLeft >= 6) {
@ -124,7 +124,7 @@ void music_note_render(EffectInstance* effect) {
renderTask.distance = 0; renderTask.distance = 0;
renderTask.renderMode = RENDER_MODE_2D; renderTask.renderMode = RENDER_MODE_2D;
retTask = shim_queue_render_task(&renderTask); retTask = queue_render_task(&renderTask);
retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR;
} }
@ -146,12 +146,12 @@ void music_note_appendGfx(void* data) {
gDPSetPrimColor(gMainGfxPos++, 0, 0, gDPSetPrimColor(gMainGfxPos++, 0, 0,
D_E004C67C[rgbOffset], D_E004C67C[rgbOffset + 1], D_E004C67C[rgbOffset + 2], fxData->unk_14 D_E004C67C[rgbOffset], D_E004C67C[rgbOffset + 1], D_E004C67C[rgbOffset + 2], fxData->unk_14
); );
shim_guTranslateF(sp18, fxData->pos.x, fxData->pos.y, fxData->pos.z); guTranslateF(sp18, fxData->pos.x, fxData->pos.y, fxData->pos.z);
shim_guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f);
shim_guMtxCatF(sp58, sp18, sp18); guMtxCatF(sp58, sp18, sp18);
shim_guScaleF(sp58, fxData->unk_10, fxData->unk_10, 0.0f); guScaleF(sp58, fxData->unk_10, fxData->unk_10, 0.0f);
shim_guMtxCatF(sp58, sp18, sp18); guMtxCatF(sp58, sp18, sp18);
shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
gSPDisplayList(gMainGfxPos++, D_E004C660[dlistIdx]); gSPDisplayList(gMainGfxPos++, D_E004C660[dlistIdx]);
gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW); gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);

View File

@ -49,9 +49,9 @@ EffectInstance* partner_buff_main(s32 useRandomValues, f32 arg1, f32 arg2, f32 a
bp.renderUI = func_E011A3A0; bp.renderUI = func_E011A3A0;
bp.effectID = EFFECT_PARTNER_BUFF; bp.effectID = EFFECT_PARTNER_BUFF;
effect = shim_create_effect_instance(&bp); effect = create_effect_instance(&bp);
effect->numParts = numParts; effect->numParts = numParts;
part = effect->data.partnerBuff = shim_general_heap_malloc(numParts * sizeof(*part)); part = effect->data.partnerBuff = general_heap_malloc(numParts * sizeof(*part));
ASSERT(effect->data.partnerBuff != NULL); ASSERT(effect->data.partnerBuff != NULL);
part->useRandomValues = useRandomValues; part->useRandomValues = useRandomValues;
@ -97,7 +97,7 @@ void partner_buff_update(EffectInstance* effect) {
data->lifeTime++; data->lifeTime++;
if (data->timeLeft < 0) { if (data->timeLeft < 0) {
shim_remove_effect(effect); remove_effect(effect);
return; return;
} }
@ -111,7 +111,7 @@ void partner_buff_update(EffectInstance* effect) {
} }
// possibly a leftover debug option // possibly a leftover debug option
if (useRandomValues == 1 && time % 30 == 0) { if (useRandomValues == 1 && time % 30 == 0) {
buff->turnsLeft = shim_rand_int(4); buff->turnsLeft = rand_int(4);
} }
switch (buff->state) { switch (buff->state) {

View File

@ -48,9 +48,9 @@ EffectInstance* peach_star_beam_main(s32 type, f32 x, f32 y, f32 z, f32 arg4, s3
bp.renderUI = NULL; bp.renderUI = NULL;
bp.effectID = EFFECT_PEACH_STAR_BEAM; bp.effectID = EFFECT_PEACH_STAR_BEAM;
effect = shim_create_effect_instance(&bp); effect = create_effect_instance(&bp);
effect->numParts = numParts; effect->numParts = numParts;
data = effect->data.peachStarBeam = shim_general_heap_malloc(sizeof(*data)); data = effect->data.peachStarBeam = general_heap_malloc(sizeof(*data));
ASSERT(effect->data.peachStarBeam != NULL); ASSERT(effect->data.peachStarBeam != NULL);
data->type = type; data->type = type;
@ -117,7 +117,7 @@ void peach_star_beam_update(EffectInstance* effect) {
data->lifetime++; data->lifetime++;
if (data->timeLeft < 0) { if (data->timeLeft < 0) {
shim_remove_effect(effect); remove_effect(effect);
return; return;
} }
@ -137,9 +137,9 @@ void peach_star_beam_update(EffectInstance* effect) {
part->pos.z = centerZ; part->pos.z = centerZ;
} else { } else {
spiritAngle = rotationAngle + ((-360 + (360 * i)) / 7); spiritAngle = rotationAngle + ((-360 + (360 * i)) / 7);
part->pos.x = centerX + radius * shim_sin_deg(spiritAngle); part->pos.x = centerX + radius * sin_deg(spiritAngle);
part->pos.y = centerY; part->pos.y = centerY;
part->pos.z = centerZ + radius * shim_cos_deg(spiritAngle); part->pos.z = centerZ + radius * cos_deg(spiritAngle);
} }
if (!(part->flags & 2)) { if (!(part->flags & 2)) {
part->lockedPos.x = part->pos.x; part->lockedPos.x = part->pos.x;
@ -158,7 +158,7 @@ void peach_star_beam_render(EffectInstance* effect) {
renderTask.distance = 10; renderTask.distance = 10;
renderTask.renderMode = RENDER_MODE_2D; renderTask.renderMode = RENDER_MODE_2D;
retTask = shim_queue_render_task(&renderTask); retTask = queue_render_task(&renderTask);
retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR;
} }
@ -189,8 +189,8 @@ void peach_star_beam_appendGfx(void* effect) {
} }
if (!(data->pos.z < partZ)) { if (!(data->pos.z < partZ)) {
shim_guPositionF(sp20, 0.0f, 0.0f, 0.0f, SPRITE_WORLD_SCALE_F, partX, partY, partZ); guPositionF(sp20, 0.0f, 0.0f, 0.0f, SPRITE_WORLD_SCALE_F, partX, partY, partZ);
shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++],
G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
@ -203,10 +203,10 @@ void peach_star_beam_appendGfx(void* effect) {
} }
} }
shim_guTranslateF(sp20, data->pos.x, data->pos.y - (((f32) (255 - data->unk_3C) * 400.0) / 255.0), data->pos.z); guTranslateF(sp20, data->pos.x, data->pos.y - (((f32) (255 - data->unk_3C) * 400.0) / 255.0), data->pos.z);
shim_guScaleF(sp60, data->beamScale * 0.4, data->beamScale * 0.4, data->beamScale * 0.4); guScaleF(sp60, data->beamScale * 0.4, data->beamScale * 0.4, data->beamScale * 0.4);
shim_guMtxCatF(sp60, sp20, sp20); guMtxCatF(sp60, sp20, sp20);
shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++],
G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
@ -233,8 +233,8 @@ void peach_star_beam_appendGfx(void* effect) {
} }
if (!(partZ <= data->pos.z)) { if (!(partZ <= data->pos.z)) {
shim_guPositionF(sp20, 0.0f, 0.0f, 0.0f, 0.67f, partX, partY, partZ); guPositionF(sp20, 0.0f, 0.0f, 0.0f, 0.67f, partX, partY, partZ);
shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++],
G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);

View File

@ -113,9 +113,9 @@ EffectInstance* pink_sparkles_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 a
bp.renderUI = NULL; bp.renderUI = NULL;
bp.effectID = EFFECT_PINK_SPARKLES; bp.effectID = EFFECT_PINK_SPARKLES;
effect = shim_create_effect_instance(&bp); effect = create_effect_instance(&bp);
effect->numParts = numParts; effect->numParts = numParts;
part = effect->data.pinkSparkles = shim_general_heap_malloc(numParts * sizeof(*part)); part = effect->data.pinkSparkles = general_heap_malloc(numParts * sizeof(*part));
ASSERT(effect->data.pinkSparkles != NULL); ASSERT(effect->data.pinkSparkles != NULL);
part->unk_04 = arg1; part->unk_04 = arg1;
@ -132,15 +132,15 @@ EffectInstance* pink_sparkles_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 a
for (i = 0; i < 16; i++) { for (i = 0; i < 16; i++) {
for (j = 0; j < 16; j++) { for (j = 0; j < 16; j++) {
if (D_E01248C0[j + (15 - i) * 16 + arg0 * 256] != 46) { if (D_E01248C0[j + (15 - i) * 16 + arg0 * 256] != 46) {
f32 temp_f20 = j * 2 - 16 + (shim_rand_int(20) - 10) * 0.1; f32 temp_f20 = j * 2 - 16 + (rand_int(20) - 10) * 0.1;
part->unk_04 = temp_f20 * shim_cos_deg(angle); part->unk_04 = temp_f20 * cos_deg(angle);
part->unk_08 = i * 2 + (shim_rand_int(20) - 10) * 0.1; part->unk_08 = i * 2 + (rand_int(20) - 10) * 0.1;
part->unk_0C = temp_f20 * shim_sin_deg(angle); part->unk_0C = temp_f20 * sin_deg(angle);
part->unk_10 = part->unk_04 * 0.04; part->unk_10 = part->unk_04 * 0.04;
part->unk_14 = part->unk_08 * 0.04; part->unk_14 = part->unk_08 * 0.04;
part->unk_18 = shim_rand_int(10) * 0.001; part->unk_18 = rand_int(10) * 0.001;
part->unk_1C = shim_rand_int(7) + 30; part->unk_1C = rand_int(7) + 30;
part->unk_20 = 0; part->unk_20 = 0;
count++; count++;
@ -210,7 +210,7 @@ void pink_sparkles_update(EffectInstance* effect) {
} }
if (count >= effect->numParts - 1) { if (count >= effect->numParts - 1) {
shim_remove_effect(effect); remove_effect(effect);
} }
} }
@ -223,7 +223,7 @@ void pink_sparkles_render(EffectInstance* effect) {
renderTask.distance = 0; renderTask.distance = 0;
renderTask.renderMode = RENDER_MODE_2D; renderTask.renderMode = RENDER_MODE_2D;
retTask = shim_queue_render_task(&renderTask); retTask = queue_render_task(&renderTask);
} }
void pink_sparkles_appendGfx(void* effect) { void pink_sparkles_appendGfx(void* effect) {
@ -246,21 +246,21 @@ void pink_sparkles_appendGfx(void* effect) {
colorIdx = (part->unk_20 - 1) * 3; colorIdx = (part->unk_20 - 1) * 3;
shim_guTranslateF(sp98, part->unk_04, part->unk_08, part->unk_0C); guTranslateF(sp98, part->unk_04, part->unk_08, part->unk_0C);
shim_guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f);
shim_guMtxCatF(sp58, sp98, sp98); guMtxCatF(sp58, sp98, sp98);
part++; part++;
for (i = 0; i < ((EffectInstance*)effect)->numParts - 1; i++, part++) { for (i = 0; i < ((EffectInstance*)effect)->numParts - 1; i++, part++) {
s32 unk_28 = part->unk_28; s32 unk_28 = part->unk_28;
if (unk_28 >= 0) { if (unk_28 >= 0) {
shim_guTranslateF(sp58, part->unk_04, part->unk_08, part->unk_0C); guTranslateF(sp58, part->unk_04, part->unk_08, part->unk_0C);
sp58[0][0] = sp58[1][1] = sp58[2][2] = part->unk_24; sp58[0][0] = sp58[1][1] = sp58[2][2] = part->unk_24;
shim_guMtxCatF(sp58, sp98, sp18); guMtxCatF(sp58, sp98, sp18);
shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]);
if (colorIdx >= ARRAY_COUNT(D_E0124BC0)) { if (colorIdx >= ARRAY_COUNT(D_E0124BC0)) {
colorIdx = 0; colorIdx = 0;

View File

@ -42,7 +42,7 @@ EffectInstance* purple_ring_main(
return NULL; return NULL;
} }
temp_f12 = 1.0f / shim_sqrtf(temp_f12); temp_f12 = 1.0f / sqrtf(temp_f12);
arg4 *= temp_f12; arg4 *= temp_f12;
arg5 *= temp_f12; arg5 *= temp_f12;
arg6 *= temp_f12; arg6 *= temp_f12;
@ -66,7 +66,7 @@ EffectInstance* purple_ring_main(
return NULL; return NULL;
} }
temp_f12 = 1.0f / shim_sqrtf(temp_f12); temp_f12 = 1.0f / sqrtf(temp_f12);
var_f22 *= temp_f12; var_f22 *= temp_f12;
var_f24 *= temp_f12; var_f24 *= temp_f12;
var_f20 *= temp_f12; var_f20 *= temp_f12;
@ -80,7 +80,7 @@ EffectInstance* purple_ring_main(
return NULL; return NULL;
} }
temp_f12 = 1.0f / shim_sqrtf(temp_f12); temp_f12 = 1.0f / sqrtf(temp_f12);
sp68 *= temp_f12; sp68 *= temp_f12;
sp6C *= temp_f12; sp6C *= temp_f12;
sp70 *= temp_f12; sp70 *= temp_f12;
@ -92,9 +92,9 @@ EffectInstance* purple_ring_main(
bpPtr->renderUI = NULL; bpPtr->renderUI = NULL;
bpPtr->effectID = EFFECT_PURPLE_RING; bpPtr->effectID = EFFECT_PURPLE_RING;
effect = shim_create_effect_instance(bpPtr); effect = create_effect_instance(bpPtr);
effect->numParts = numParts; effect->numParts = numParts;
data = effect->data.purpleRing = shim_general_heap_malloc(numParts * sizeof(*data)); data = effect->data.purpleRing = general_heap_malloc(numParts * sizeof(*data));
ASSERT(effect->data.purpleRing != NULL); ASSERT(effect->data.purpleRing != NULL);
data->unk_00 = arg0; data->unk_00 = arg0;
@ -148,7 +148,7 @@ void purple_ring_update(EffectInstance* effect) {
part->unk_70++; part->unk_70++;
if (part->unk_6C < 0) { if (part->unk_6C < 0) {
shim_remove_effect(effect); remove_effect(effect);
return; return;
} }
@ -184,7 +184,7 @@ void purple_ring_render(EffectInstance* effect) {
renderTask.distance = 0; renderTask.distance = 0;
renderTask.renderMode = RENDER_MODE_2D; renderTask.renderMode = RENDER_MODE_2D;
retTask = shim_queue_render_task(&renderTask); retTask = queue_render_task(&renderTask);
retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR;
} }
@ -200,11 +200,11 @@ void purple_ring_appendGfx(void* effect) {
gSPDisplayList(gMainGfxPos++, D_09000200_352EE0); gSPDisplayList(gMainGfxPos++, D_09000200_352EE0);
gDPSetPrimColor(gMainGfxPos++, 0, 0, data->unk_74, data->unk_75, data->unk_76, data->unk_68); gDPSetPrimColor(gMainGfxPos++, 0, 0, data->unk_74, data->unk_75, data->unk_76, data->unk_68);
shim_guTranslateF(sp10, data->unk_04, data->unk_08, data->unk_0C); guTranslateF(sp10, data->unk_04, data->unk_08, data->unk_0C);
shim_guMtxCatF(data->unk_1C, sp10, sp10); guMtxCatF(data->unk_1C, sp10, sp10);
shim_guScaleF(sp50, data->unk_64, data->unk_64, data->unk_64); guScaleF(sp50, data->unk_64, data->unk_64, data->unk_64);
shim_guMtxCatF(sp50, sp10, sp10); guMtxCatF(sp50, sp10, sp10);
shim_guMtxF2L(sp10, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp10, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
gDPSetTileSize(gMainGfxPos++, G_TX_RENDERTILE, 0, unk_5C, temp * 4, unk_5C + temp); gDPSetTileSize(gMainGfxPos++, G_TX_RENDERTILE, 0, unk_5C, temp * 4, unk_5C + temp);

View File

@ -15,7 +15,7 @@ EffectInstance* quizmo_answer_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3) {
bp.renderUI = NULL; bp.renderUI = NULL;
bp.effectID = EFFECT_QUIZMO_ANSWER; bp.effectID = EFFECT_QUIZMO_ANSWER;
effect = shim_create_effect_instance(&bp); effect = create_effect_instance(&bp);
effect->data.quizmoAnswer = NULL; effect->data.quizmoAnswer = NULL;
gDPPipeSync(gMainGfxPos++); gDPPipeSync(gMainGfxPos++);
@ -34,6 +34,6 @@ EffectInstance* quizmo_answer_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3) {
gDPPipeSync(gMainGfxPos++); gDPPipeSync(gMainGfxPos++);
gSPSegment(gMainGfxPos++, 0x00, NULL); gSPSegment(gMainGfxPos++, 0x00, NULL);
shim_remove_effect(effect); remove_effect(effect);
return NULL; return NULL;
} }

View File

@ -36,9 +36,9 @@ EffectInstance* quizmo_assistant_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f3
bp.renderUI = NULL; bp.renderUI = NULL;
bp.effectID = EFFECT_QUIZMO_ASSISTANT; bp.effectID = EFFECT_QUIZMO_ASSISTANT;
effect = shim_create_effect_instance(&bp); effect = create_effect_instance(&bp);
effect->numParts = numParts; effect->numParts = numParts;
data = effect->data.quizmoAssistant = shim_general_heap_malloc(numParts * sizeof(*data)); data = effect->data.quizmoAssistant = general_heap_malloc(numParts * sizeof(*data));
ASSERT(effect->data.quizmoAssistant != NULL); ASSERT(effect->data.quizmoAssistant != NULL);
data->unk_00 = arg0; data->unk_00 = arg0;
@ -75,7 +75,7 @@ void quizmo_assistant_update(EffectInstance* effect) {
data->lifetime++; data->lifetime++;
if (data->vanishTimer < 0) { if (data->vanishTimer < 0) {
shim_remove_effect(effect); remove_effect(effect);
return; return;
} }
@ -93,7 +93,7 @@ void quizmo_assistant_render(EffectInstance* effect) {
renderTask.distance = 10; renderTask.distance = 10;
renderTask.renderMode = RENDER_MODE_2D; renderTask.renderMode = RENDER_MODE_2D;
retTask = shim_queue_render_task(&renderTask); retTask = queue_render_task(&renderTask);
retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR;
} }
@ -108,14 +108,14 @@ void quizmo_assistant_appendGfx(void* effect) {
gDPPipeSync(gMainGfxPos++); gDPPipeSync(gMainGfxPos++);
gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data));
shim_guTranslateF(sp18, data->position.x, data->position.y, data->position.z); guTranslateF(sp18, data->position.x, data->position.y, data->position.z);
shim_guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f);
shim_guMtxCatF(sp58, sp18, sp18); guMtxCatF(sp58, sp18, sp18);
shim_guTranslateF(sp58, 89.5f, 0.0f, 2.0f); guTranslateF(sp58, 89.5f, 0.0f, 2.0f);
shim_guMtxCatF(sp58, sp18, sp18); guMtxCatF(sp58, sp18, sp18);
shim_guScaleF(sp58, 5.0f / 7, 5.0f / 7, 5.0f / 7); guScaleF(sp58, 5.0f / 7, 5.0f / 7, 5.0f / 7);
shim_guMtxCatF(sp58, sp18, sp18); guMtxCatF(sp58, sp18, sp18);
shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gDPSetPrimColor(gMainGfxPos++, 0, 0, fadeInAmt, fadeInAmt, fadeInAmt, 255); gDPSetPrimColor(gMainGfxPos++, 0, 0, fadeInAmt, fadeInAmt, fadeInAmt, 255);

View File

@ -89,10 +89,10 @@ EffectInstance* quizmo_audience_main(s32 arg0, f32 posX, f32 posY, f32 posZ) {
effectBp.renderUI = NULL; effectBp.renderUI = NULL;
effectBp.effectID = EFFECT_QUIZMO_AUDIENCE; effectBp.effectID = EFFECT_QUIZMO_AUDIENCE;
effect = shim_create_effect_instance(&effectBp); effect = create_effect_instance(&effectBp);
effect->numParts = numParts; effect->numParts = numParts;
data = effect->data.quizmoAudience = shim_general_heap_malloc(numParts * sizeof(*data)); data = effect->data.quizmoAudience = general_heap_malloc(numParts * sizeof(*data));
ASSERT(data != NULL); ASSERT(data != NULL);
data->timeLeft = 100; data->timeLeft = 100;
@ -131,7 +131,7 @@ void quizmo_audience_update(EffectInstance* effect) {
data->lifeTime++; data->lifeTime++;
if (data->timeLeft < 0) { if (data->timeLeft < 0) {
shim_remove_effect(effect); remove_effect(effect);
return; return;
} }
@ -142,11 +142,11 @@ void quizmo_audience_update(EffectInstance* effect) {
for (i = 0; i < MAX_QUIZMO_AUDIENCE; i++) { for (i = 0; i < MAX_QUIZMO_AUDIENCE; i++) {
switch (data->compState[i]) { switch (data->compState[i]) {
case 0: case 0:
if (shim_rand_int(10) == 10) { if (rand_int(10) == 10) {
data->compState[i] = 1; data->compState[i] = 1;
data->compType[i] = shim_rand_int(1); data->compType[i] = rand_int(1);
data->compPosIdx[i] = 0; data->compPosIdx[i] = 0;
data->compMoveMagnitude[i] = (shim_rand_int(50) * 0.01) + 0.5; data->compMoveMagnitude[i] = (rand_int(50) * 0.01) + 0.5;
} }
break; break;
case 1: case 1:
@ -173,7 +173,7 @@ void quizmo_audience_render(EffectInstance* effect) {
renderTask.distance = 0; renderTask.distance = 0;
renderTask.renderMode = RENDER_MODE_2D; renderTask.renderMode = RENDER_MODE_2D;
retTask = shim_queue_render_task(&renderTask); retTask = queue_render_task(&renderTask);
retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR;
} }
@ -190,10 +190,10 @@ void quizmo_audience_appendGfx(void* effect) {
gDPPipeSync(gMainGfxPos++); gDPPipeSync(gMainGfxPos++);
gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data));
shim_guTranslateF(sp18, data->pos.x, data->pos.y, data->pos.z); guTranslateF(sp18, data->pos.x, data->pos.y, data->pos.z);
shim_guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f);
shim_guMtxCatF(sp58, sp18, sp18); guMtxCatF(sp58, sp18, sp18);
shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++],
G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
@ -201,8 +201,8 @@ void quizmo_audience_appendGfx(void* effect) {
gSPDisplayList(gMainGfxPos++, D_09003110_3AA8B0); gSPDisplayList(gMainGfxPos++, D_09003110_3AA8B0);
for (i = 0; i < MAX_QUIZMO_AUDIENCE; i++) { for (i = 0; i < MAX_QUIZMO_AUDIENCE; i++) {
shim_guTranslateF(sp18, data->compX[i], data->compY[i], 0.0f); guTranslateF(sp18, data->compX[i], data->compY[i], 0.0f);
shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++],
G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);

View File

@ -33,10 +33,10 @@ EffectInstance* quizmo_stage_main(s32 arg0, f32 posX, f32 posY, f32 posZ) {
effectBp.renderUI = NULL; effectBp.renderUI = NULL;
effectBp.effectID = EFFECT_QUIZMO_STAGE; effectBp.effectID = EFFECT_QUIZMO_STAGE;
effect = shim_create_effect_instance(&effectBp); effect = create_effect_instance(&effectBp);
effect->numParts = numParts; effect->numParts = numParts;
data = effect->data.quizmoStage = shim_general_heap_malloc(numParts * sizeof(*data)); data = effect->data.quizmoStage = general_heap_malloc(numParts * sizeof(*data));
ASSERT(data != NULL); ASSERT(data != NULL);
data->vanishTimer = 100; data->vanishTimer = 100;
@ -78,7 +78,7 @@ void quizmo_stage_update(EffectInstance *effect) {
lifeTime = data->lifetime; lifeTime = data->lifetime;
if (data->vanishTimer < 0) { if (data->vanishTimer < 0) {
shim_remove_effect(effect); remove_effect(effect);
return; return;
} }
if (data->vanishTimer < 16) { if (data->vanishTimer < 16) {
@ -101,7 +101,7 @@ void quizmo_stage_render(EffectInstance* effect) {
renderTask.distance = 0; renderTask.distance = 0;
renderTask.renderMode = RENDER_MODE_SURFACE_OPA; renderTask.renderMode = RENDER_MODE_SURFACE_OPA;
retTask = shim_queue_render_task(&renderTask); retTask = queue_render_task(&renderTask);
retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR;
} }
@ -114,10 +114,10 @@ void quizmo_stage_appendGfx(void* effect) {
gDPPipeSync(gMainGfxPos++); gDPPipeSync(gMainGfxPos++);
gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data));
shim_guTranslateF(sp18, data->origin.x, data->origin.y, data->origin.z); guTranslateF(sp18, data->origin.x, data->origin.y, data->origin.z);
shim_guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f);
shim_guMtxCatF(sp58, sp18, sp18); guMtxCatF(sp58, sp18, sp18);
shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gDPSetPrimColor(gMainGfxPos++, 0, 0, microphoneRaiseAmt, microphoneRaiseAmt, microphoneRaiseAmt, 255); gDPSetPrimColor(gMainGfxPos++, 0, 0, microphoneRaiseAmt, microphoneRaiseAmt, microphoneRaiseAmt, 255);
@ -127,8 +127,8 @@ void quizmo_stage_appendGfx(void* effect) {
if (data->unk_3C != 255) { if (data->unk_3C != 255) {
gSPMatrix(gMainGfxPos++, &D_09004148_39CD08[2], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &D_09004148_39CD08[2], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
shim_guRotateF(sp18, (data->rearWallRaiseAmt * 180) / 255 - 180, 1.0f, 0.0f, 0.0f); guRotateF(sp18, (data->rearWallRaiseAmt * 180) / 255 - 180, 1.0f, 0.0f, 0.0f);
shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW);
gSPDisplayList(gMainGfxPos++, D_09006E28_39F9E8); gSPDisplayList(gMainGfxPos++, D_09006E28_39F9E8);
@ -138,16 +138,16 @@ void quizmo_stage_appendGfx(void* effect) {
gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW); gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
gSPMatrix(gMainGfxPos++, &D_09004148_39CD08[0], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &D_09004148_39CD08[0], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
shim_guRotateF(sp18, 90 - (data->leftWallRaiseAmt * 90) / 255, 0.0f, 0.0f, 1.0f); guRotateF(sp18, 90 - (data->leftWallRaiseAmt * 90) / 255, 0.0f, 0.0f, 1.0f);
shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW);
gSPDisplayList(gMainGfxPos++, D_09006FB0_39FB70); gSPDisplayList(gMainGfxPos++, D_09006FB0_39FB70);
gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW); gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
gSPMatrix(gMainGfxPos++, &D_09004148_39CD08[1], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &D_09004148_39CD08[1], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
shim_guRotateF(sp18, (data->rightWallRaiseAmt * 90) / 255 - 90, 0.0f, 0.0f, 1.0f); guRotateF(sp18, (data->rightWallRaiseAmt * 90) / 255 - 90, 0.0f, 0.0f, 1.0f);
shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW);
gSPDisplayList(gMainGfxPos++, D_09006F20_39FAE0); gSPDisplayList(gMainGfxPos++, D_09006F20_39FAE0);
@ -159,8 +159,8 @@ void quizmo_stage_appendGfx(void* effect) {
gSPDisplayList(gMainGfxPos++, D_09006FD8_39FB98); gSPDisplayList(gMainGfxPos++, D_09006FD8_39FB98);
gSPMatrix(gMainGfxPos++, &D_09004148_39CD08[3], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &D_09004148_39CD08[3], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
shim_guRotateF(sp18, 90 - (data->podiumRaiseAmt * 90) / 255, 1.0f, 0.0f, 0.0f); guRotateF(sp18, 90 - (data->podiumRaiseAmt * 90) / 255, 1.0f, 0.0f, 0.0f);
shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW);
gSPDisplayList(gMainGfxPos++, D_09006D48_39F908); gSPDisplayList(gMainGfxPos++, D_09006D48_39F908);

View File

@ -46,9 +46,9 @@ EffectInstance* radial_shimmer_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32
bp.renderUI = NULL; bp.renderUI = NULL;
bp.effectID = EFFECT_RADIAL_SHIMMER; bp.effectID = EFFECT_RADIAL_SHIMMER;
effect = shim_create_effect_instance(&bp); effect = create_effect_instance(&bp);
effect->numParts = numParts; effect->numParts = numParts;
data = effect->data.radialShimmer = shim_general_heap_malloc(numParts * sizeof(*data)); data = effect->data.radialShimmer = general_heap_malloc(numParts * sizeof(*data));
ASSERT(effect->data.radialShimmer != NULL); ASSERT(effect->data.radialShimmer != NULL);
data->unk_00 = arg0; data->unk_00 = arg0;
@ -221,7 +221,7 @@ void radial_shimmer_update(EffectInstance* effect) {
} }
if (part->timeLeft < 0) { if (part->timeLeft < 0) {
shim_remove_effect(effect); remove_effect(effect);
return; return;
} }
@ -241,7 +241,7 @@ void radial_shimmer_update(EffectInstance* effect) {
part->unk_1C = part->unk_20; part->unk_1C = part->unk_20;
shim_transform_point(&gCameras[gCurrentCameraID].perspectiveMatrix[0], part->unk_04, part->unk_08, part->unk_0C, transform_point(&gCameras[gCurrentCameraID].perspectiveMatrix[0], part->unk_04, part->unk_08, part->unk_0C,
1.0f, &outX, &outY, &outZ, &outS); 1.0f, &outX, &outY, &outZ, &outS);
outS = 1.0f / outS; outS = 1.0f / outS;
@ -280,7 +280,7 @@ void radial_shimmer_render(EffectInstance* effect) {
renderTask.distance = 0; renderTask.distance = 0;
renderTask.renderMode = RENDER_MODE_2D; renderTask.renderMode = RENDER_MODE_2D;
retTask = shim_queue_render_task(&renderTask); retTask = queue_render_task(&renderTask);
retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR;
} }
@ -313,18 +313,18 @@ void radial_shimmer_appendGfx(void* effect) {
gDPPipeSync(gMainGfxPos++); gDPPipeSync(gMainGfxPos++);
gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data));
shim_guTranslateF(sp20, data->unk_10, data->unk_14, data->unk_18); guTranslateF(sp20, data->unk_10, data->unk_14, data->unk_18);
shim_guScaleF(sp60, data->unk_1C, data->unk_1C, 1.0f); guScaleF(sp60, data->unk_1C, data->unk_1C, 1.0f);
shim_guMtxCatF(sp60, sp20, sp20); guMtxCatF(sp60, sp20, sp20);
shim_guPerspectiveF(sp60, &spA0, data->unk_60, (f32) camera->viewportW / camera->viewportH, 4.0f, 16384.0f, 1.0f); guPerspectiveF(sp60, &spA0, data->unk_60, (f32) camera->viewportW / camera->viewportH, 4.0f, 16384.0f, 1.0f);
shim_guMtxCatF(sp60, sp20, sp20); guMtxCatF(sp60, sp20, sp20);
shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++],
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION);
shim_guTranslateF(sp20, 0.0f, 0.0f, data->unk_64); guTranslateF(sp20, 0.0f, 0.0f, data->unk_64);
shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++],
G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);

View File

@ -40,9 +40,9 @@ EffectInstance* radiating_energy_orb_main(
bp.renderUI = NULL; bp.renderUI = NULL;
bp.effectID = EFFECT_RADIATING_ENERGY_ORB; bp.effectID = EFFECT_RADIATING_ENERGY_ORB;
effect = shim_create_effect_instance(&bp); effect = create_effect_instance(&bp);
effect->numParts = numParts; effect->numParts = numParts;
part = effect->data.radiatingEnergyOrb = shim_general_heap_malloc(numParts * sizeof(*part)); part = effect->data.radiatingEnergyOrb = general_heap_malloc(numParts * sizeof(*part));
ASSERT(effect->data.radiatingEnergyOrb != NULL); ASSERT(effect->data.radiatingEnergyOrb != NULL);
part->unk_04 = arg0; part->unk_04 = arg0;
@ -59,10 +59,10 @@ EffectInstance* radiating_energy_orb_main(
part++; part++;
for (i = 1; i < numParts; i++, part++) { for (i = 1; i < numParts; i++, part++) {
part->unk_20 = shim_rand_int(360); part->unk_20 = rand_int(360);
part->unk_2C = (i * 2) % 20 + 60; part->unk_2C = (i * 2) % 20 + 60;
part->unk_28 = shim_rand_int(15) * 0.1 + 0.4; part->unk_28 = rand_int(15) * 0.1 + 0.4;
part->unk_30 = shim_rand_int(10) * 0.1 + 0.1; part->unk_30 = rand_int(10) * 0.1 + 0.1;
} }
return effect; return effect;
@ -89,7 +89,7 @@ void radiating_energy_orb_update(EffectInstance* effect) {
part->unk_1C++; part->unk_1C++;
if (part->unk_18 < 0) { if (part->unk_18 < 0) {
shim_remove_effect(effect); remove_effect(effect);
return; return;
} }
@ -104,13 +104,13 @@ void radiating_energy_orb_update(EffectInstance* effect) {
part++; part++;
for (i = 1; i < effect->numParts; i++, part++) { for (i = 1; i < effect->numParts; i++, part++) {
part->unk_14 = shim_cos_deg((part->unk_2C - 70.0f) * 90.0f / 10.0f) * 255.0f; part->unk_14 = cos_deg((part->unk_2C - 70.0f) * 90.0f / 10.0f) * 255.0f;
part->unk_2C += part->unk_30; part->unk_2C += part->unk_30;
if (part->unk_2C > 80.0f) { if (part->unk_2C > 80.0f) {
part->unk_2C = 60.0f; part->unk_2C = 60.0f;
part->unk_28 = shim_rand_int(15) * 0.1 + 0.4; part->unk_28 = rand_int(15) * 0.1 + 0.4;
part->unk_30 = shim_rand_int(10) * 0.1 + 0.1; part->unk_30 = rand_int(10) * 0.1 + 0.1;
part->unk_20 = shim_rand_int(360); part->unk_20 = rand_int(360);
} }
} }
} }
@ -124,7 +124,7 @@ void radiating_energy_orb_render(EffectInstance* effect) {
renderTask.distance = 10; renderTask.distance = 10;
renderTask.renderMode = RENDER_MODE_SURFACE_XLU_LAYER3; renderTask.renderMode = RENDER_MODE_SURFACE_XLU_LAYER3;
retTask = shim_queue_render_task(&renderTask); retTask = queue_render_task(&renderTask);
retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR;
} }
@ -146,15 +146,15 @@ void radiating_energy_orb_appendGfx(void* effect) {
gDPPipeSync(gMainGfxPos++); gDPPipeSync(gMainGfxPos++);
gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data));
shim_guTranslateF(sp18, part->unk_08, part->unk_0C, part->unk_10); guTranslateF(sp18, part->unk_08, part->unk_0C, part->unk_10);
shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPMatrix(gMainGfxPos++, camera->unkMatrix, G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, camera->unkMatrix, G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW);
gDPSetPrimColor(gMainGfxPos++, 0, 0, 255, 64, 64, unk_14); gDPSetPrimColor(gMainGfxPos++, 0, 0, 255, 64, 64, unk_14);
shim_guRotateF(sp18, temp_s2 * 2 + unk_1C, 0.0f, 0.0f, 1.0f); guRotateF(sp18, temp_s2 * 2 + unk_1C, 0.0f, 0.0f, 1.0f);
shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
gSPDisplayList(gMainGfxPos++, D_090012A8_3A2008); gSPDisplayList(gMainGfxPos++, D_090012A8_3A2008);
@ -170,23 +170,23 @@ void radiating_energy_orb_appendGfx(void* effect) {
gDPSetPrimColor(gMainGfxPos++, 0, 0, 255, 255, 255, (part->unk_14 * unk_14) >> 8); gDPSetPrimColor(gMainGfxPos++, 0, 0, 255, 255, 255, (part->unk_14 * unk_14) >> 8);
gDPSetCombineMode(gMainGfxPos++, PM_CC_07, PM_CC_07); gDPSetCombineMode(gMainGfxPos++, PM_CC_07, PM_CC_07);
shim_guRotateF(sp18, part->unk_20, 0.0f, 0.0f, 1.0f); guRotateF(sp18, part->unk_20, 0.0f, 0.0f, 1.0f);
shim_guTranslateF(sp58, part->unk_2C, 0.0f, 0.0f); guTranslateF(sp58, part->unk_2C, 0.0f, 0.0f);
shim_guMtxCatF(sp58, sp18, sp18); guMtxCatF(sp58, sp18, sp18);
shim_guScaleF(sp58, scale, scale, scale); guScaleF(sp58, scale, scale, scale);
shim_guMtxCatF(sp58, sp18, sp18); guMtxCatF(sp58, sp18, sp18);
shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
gSPDisplayList(gMainGfxPos++, D_E009EDFC[0]); gSPDisplayList(gMainGfxPos++, D_E009EDFC[0]);
gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW); gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
shim_guRotateF(sp18, part->unk_20, 0.0f, 0.0f, 1.0f); guRotateF(sp18, part->unk_20, 0.0f, 0.0f, 1.0f);
shim_guTranslateF(sp58, part->unk_2C + 5.0f, 0.0f, 0.0f); guTranslateF(sp58, part->unk_2C + 5.0f, 0.0f, 0.0f);
shim_guMtxCatF(sp58, sp18, sp18); guMtxCatF(sp58, sp18, sp18);
shim_guScaleF(sp58, 2.3 - scale, 2.3 - scale, 2.3 - scale); guScaleF(sp58, 2.3 - scale, 2.3 - scale, 2.3 - scale);
shim_guMtxCatF(sp58, sp18, sp18); guMtxCatF(sp58, sp18, sp18);
shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
gSPDisplayList(gMainGfxPos++, D_E009EDF8[0]); gSPDisplayList(gMainGfxPos++, D_E009EDF8[0]);
@ -195,28 +195,28 @@ void radiating_energy_orb_appendGfx(void* effect) {
gDPSetEnvColor(gMainGfxPos++, 255, 128, 255, 0); gDPSetEnvColor(gMainGfxPos++, 255, 128, 255, 0);
gDPSetCombineLERP(gMainGfxPos++, ENVIRONMENT, PRIMITIVE, TEXEL0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0, ENVIRONMENT, PRIMITIVE, TEXEL0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0); gDPSetCombineLERP(gMainGfxPos++, ENVIRONMENT, PRIMITIVE, TEXEL0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0, ENVIRONMENT, PRIMITIVE, TEXEL0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0);
shim_guRotateF(sp18, part->unk_20 + 14.0f, 0.0f, 0.0f, 1.0f); guRotateF(sp18, part->unk_20 + 14.0f, 0.0f, 0.0f, 1.0f);
shim_guRotateF(sp58, (i * 10) % 45 + unk_1C, 0.0f, 1.0f, 0.0f); guRotateF(sp58, (i * 10) % 45 + unk_1C, 0.0f, 1.0f, 0.0f);
shim_guMtxCatF(sp58, sp18, sp18); guMtxCatF(sp58, sp18, sp18);
shim_guTranslateF(sp58, 20.0f, 0.0f, 0.0f); guTranslateF(sp58, 20.0f, 0.0f, 0.0f);
shim_guMtxCatF(sp58, sp18, sp18); guMtxCatF(sp58, sp18, sp18);
shim_guScaleF(sp58, (part->unk_2C - 60.0f) * 0.05 + 1.0, 2.0 - (part->unk_2C - 60.0f) * 0.05, 1.0f); guScaleF(sp58, (part->unk_2C - 60.0f) * 0.05 + 1.0, 2.0 - (part->unk_2C - 60.0f) * 0.05, 1.0f);
shim_guMtxCatF(sp58, sp18, sp18); guMtxCatF(sp58, sp18, sp18);
shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
gSPDisplayList(gMainGfxPos++, D_E009EDF4[0]); gSPDisplayList(gMainGfxPos++, D_E009EDF4[0]);
gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW); gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
gDPSetPrimColor(gMainGfxPos++, 0, 0, 255, 64, 64, (part->unk_14 * unk_14) >> 8); gDPSetPrimColor(gMainGfxPos++, 0, 0, 255, 64, 64, (part->unk_14 * unk_14) >> 8);
shim_guRotateF(sp18, part->unk_20 + 34.0f + unk_1C, 0.0f, 0.0f, 1.0f); guRotateF(sp18, part->unk_20 + 34.0f + unk_1C, 0.0f, 0.0f, 1.0f);
shim_guRotateF(sp58, i * 35, 0.0f, 1.0f, 0.0f); guRotateF(sp58, i * 35, 0.0f, 1.0f, 0.0f);
shim_guMtxCatF(sp58, sp18, sp18); guMtxCatF(sp58, sp18, sp18);
shim_guTranslateF(sp58, 15.0f, 0.0f, 0.0f); guTranslateF(sp58, 15.0f, 0.0f, 0.0f);
shim_guMtxCatF(sp58, sp18, sp18); guMtxCatF(sp58, sp18, sp18);
shim_guScaleF(sp58, (part->unk_2C - 60.0f) * 0.1 + 2.0, 1.0f, 1.0f); guScaleF(sp58, (part->unk_2C - 60.0f) * 0.1 + 2.0, 1.0f, 1.0f);
shim_guMtxCatF(sp58, sp18, sp18); guMtxCatF(sp58, sp18, sp18);
shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
gSPDisplayList(gMainGfxPos++, D_E009EDF0[0]); gSPDisplayList(gMainGfxPos++, D_E009EDF0[0]);

View File

@ -55,9 +55,9 @@ EffectInstance* recover_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, s32 arg4) {
bp.unk_00 = 0; bp.unk_00 = 0;
bp.effectID = EFFECT_RECOVER; bp.effectID = EFFECT_RECOVER;
effect = shim_create_effect_instance(&bp); effect = create_effect_instance(&bp);
effect->numParts = numParts; effect->numParts = numParts;
part = effect->data.recover = shim_general_heap_malloc(numParts * sizeof(*part)); part = effect->data.recover = general_heap_malloc(numParts * sizeof(*part));
ASSERT(effect->data.recover != NULL); ASSERT(effect->data.recover != NULL);
part->unk_00 = arg0; part->unk_00 = arg0;
@ -116,7 +116,7 @@ void recover_update(EffectInstance* effect) {
part->unk_30++; part->unk_30++;
if (part->unk_2C < 0) { if (part->unk_2C < 0) {
shim_remove_effect(effect); remove_effect(effect);
return; return;
} }
@ -138,8 +138,8 @@ void recover_update(EffectInstance* effect) {
part->unk_04 += part->unk_10; part->unk_04 += part->unk_10;
part->unk_08 += part->unk_14; part->unk_08 += part->unk_14;
part->unk_0C += part->unk_18; part->unk_0C += part->unk_18;
part->unk_1C = shim_sin_deg(i * 38 + unk_2C * 12) * -30.0f; part->unk_1C = sin_deg(i * 38 + unk_2C * 12) * -30.0f;
part->unk_24 = shim_cos_deg(i * 38 + unk_2C * 12) * 8.0f; part->unk_24 = cos_deg(i * 38 + unk_2C * 12) * 8.0f;
if (unk_2C < 20) { if (unk_2C < 20) {
part->unk_24 *= (f32) unk_2C * 0.05; part->unk_24 *= (f32) unk_2C * 0.05;
@ -176,10 +176,10 @@ void func_E0080448(EffectInstance* effect) {
gDPPipeSync(gMainGfxPos++); gDPPipeSync(gMainGfxPos++);
gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data));
shim_guTranslateF(sp18, part->unk_04, part->unk_08, part->unk_0C); guTranslateF(sp18, part->unk_04, part->unk_08, part->unk_0C);
shim_guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f);
shim_guMtxCatF(sp58, sp18, sp98); guMtxCatF(sp58, sp18, sp98);
shim_guMtxF2L(sp98, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp98, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
@ -203,15 +203,15 @@ void func_E0080448(EffectInstance* effect) {
(unk_44 == 0 ? D_09003200_385000 : D_09003298_385098) : (unk_44 == 0 ? D_09003200_385000 : D_09003298_385098) :
D_09003330_385130); D_09003330_385130);
shim_guTranslateF(sp18, part->unk_04 + part->unk_24, part->unk_08, part->unk_0C); guTranslateF(sp18, part->unk_04 + part->unk_24, part->unk_08, part->unk_0C);
shim_guScaleF(sp58, part->unk_38, part->unk_3C, 1.0f); guScaleF(sp58, part->unk_38, part->unk_3C, 1.0f);
shim_guMtxCatF(sp58, sp18, sp18); guMtxCatF(sp58, sp18, sp18);
shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
shim_guRotateF(sp18, part->unk_1C, 0.0f, 0.0f, 1.0f); guRotateF(sp18, part->unk_1C, 0.0f, 0.0f, 1.0f);
shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);

View File

@ -36,9 +36,9 @@ EffectInstance* red_impact_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4
bpPtr->renderUI = NULL; bpPtr->renderUI = NULL;
bpPtr->effectID = EFFECT_RED_IMPACT; bpPtr->effectID = EFFECT_RED_IMPACT;
effect = shim_create_effect_instance(bpPtr); effect = create_effect_instance(bpPtr);
effect->numParts = numParts; effect->numParts = numParts;
part = effect->data.redImpact = shim_general_heap_malloc(numParts * sizeof(*part)); part = effect->data.redImpact = general_heap_malloc(numParts * sizeof(*part));
ASSERT(effect->data.redImpact != NULL); ASSERT(effect->data.redImpact != NULL);
part->unk_2C = 0; part->unk_2C = 0;
@ -80,7 +80,7 @@ void red_impact_update(EffectInstance* effect) {
part->unk_28--; part->unk_28--;
if (part->unk_28 < 0) { if (part->unk_28 < 0) {
shim_remove_effect(effect); remove_effect(effect);
return; return;
} }
@ -98,8 +98,8 @@ void red_impact_update(EffectInstance* effect) {
part->unk_04 = 0; part->unk_04 = 0;
part->unk_08 = 0; part->unk_08 = 0;
part->unk_0C = 0; part->unk_0C = 0;
part->unk_10 = -shim_sin_deg(part->unk_34) * 0.5; part->unk_10 = -sin_deg(part->unk_34) * 0.5;
part->unk_14 = shim_cos_deg(part->unk_34) * 0.5; part->unk_14 = cos_deg(part->unk_34) * 0.5;
part->unk_18 = 0; part->unk_18 = 0;
part->unk_3C = 32.0f; part->unk_3C = 32.0f;
part->unk_40 = 32.0f; part->unk_40 = 32.0f;
@ -136,7 +136,7 @@ void red_impact_render(EffectInstance* effect) {
renderTask.distance = 0; renderTask.distance = 0;
renderTask.renderMode = RENDER_MODE_28; renderTask.renderMode = RENDER_MODE_28;
retTask = shim_queue_render_task(&renderTask); retTask = queue_render_task(&renderTask);
retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR;
} }
@ -170,8 +170,8 @@ void red_impact_appendGfx(void* effect) {
gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data));
gSPDisplayList(gMainGfxPos++, dlist); gSPDisplayList(gMainGfxPos++, dlist);
shim_guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, part->unk_04, part->unk_08, part->unk_0C); guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, part->unk_04, part->unk_08, part->unk_0C);
shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
@ -190,14 +190,14 @@ void red_impact_appendGfx(void* effect) {
part++; part++;
for (i = 1; i < ((EffectInstance*)effect)->numParts; i++, part++) { for (i = 1; i < ((EffectInstance*)effect)->numParts; i++, part++) {
if (part->unk_4C >= 0) { if (part->unk_4C >= 0) {
shim_guTranslateF(sp20, part->unk_04, part->unk_08, part->unk_0C); guTranslateF(sp20, part->unk_04, part->unk_08, part->unk_0C);
shim_guRotateF(sp60, part->unk_34, 0.0f, 0.0f, 1.0f); guRotateF(sp60, part->unk_34, 0.0f, 0.0f, 1.0f);
shim_guMtxCatF(sp60, sp20, sp20); guMtxCatF(sp60, sp20, sp20);
shim_guScaleF(sp60, part->unk_1C * temp_1C, part->unk_20 * temp_20, part->unk_24 * temp_24); guScaleF(sp60, part->unk_1C * temp_1C, part->unk_20 * temp_20, part->unk_24 * temp_24);
shim_guMtxCatF(sp60, sp20, sp20); guMtxCatF(sp60, sp20, sp20);
shim_guRotateF(sp60, part->unk_30, 0.0f, 1.0f, 0.0f); guRotateF(sp60, part->unk_30, 0.0f, 1.0f, 0.0f);
shim_guMtxCatF(sp60, sp20, sp20); guMtxCatF(sp60, sp20, sp20);
shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]);
dlist2 = D_09000940_359CF0; dlist2 = D_09000940_359CF0;

View File

@ -25,12 +25,12 @@ void ring_blast_main(s32 arg0, f32 posX, f32 posY, f32 posZ, f32 arg4, s32 arg5)
effectBp.renderUI = NULL; effectBp.renderUI = NULL;
effectBp.effectID = EFFECT_RING_BLAST; effectBp.effectID = EFFECT_RING_BLAST;
effect = shim_create_effect_instance(&effectBp); effect = create_effect_instance(&effectBp);
effect->numParts = numParts; effect->numParts = numParts;
data = effect->data.ringBlast = shim_general_heap_malloc(numParts * sizeof(*data)); data = effect->data.ringBlast = general_heap_malloc(numParts * sizeof(*data));
ASSERT(data != NULL); ASSERT(data != NULL);
shim_mem_clear(data, numParts * sizeof(*data)); mem_clear(data, numParts * sizeof(*data));
data->timeLeft = arg5; data->timeLeft = arg5;
data->lifeTime = 0; data->lifeTime = 0;
@ -61,7 +61,7 @@ void ring_blast_update(EffectInstance* effect) {
data->timeLeft--; data->timeLeft--;
if (data->timeLeft < 0) { if (data->timeLeft < 0) {
shim_remove_effect(effect); remove_effect(effect);
return; return;
} }
data->unk_24 += data->unk_28; data->unk_24 += data->unk_28;
@ -79,7 +79,7 @@ void ring_blast_render(EffectInstance* effect) {
renderTask.distance = 0; renderTask.distance = 0;
renderTask.renderMode = RENDER_MODE_28; renderTask.renderMode = RENDER_MODE_28;
retTask = shim_queue_render_task(&renderTask); retTask = queue_render_task(&renderTask);
retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR;
} }
@ -98,10 +98,10 @@ void ring_blast_appendGfx(void* effect) {
gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data));
gSPDisplayList(gMainGfxPos++, dlist2); gSPDisplayList(gMainGfxPos++, dlist2);
shim_guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].currentYaw, 0.0f, data->unk_10, data->pos.x, data->pos.y, data->pos.z); guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].currentYaw, 0.0f, data->unk_10, data->pos.x, data->pos.y, data->pos.z);
shim_guRotateF(sp60, data->unk_24, 0.0f, 0.0f, 1.0f); guRotateF(sp60, data->unk_24, 0.0f, 0.0f, 1.0f);
shim_guMtxCatF(sp60, sp20, sp20); guMtxCatF(sp60, sp20, sp20);
shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);

View File

@ -35,9 +35,9 @@ void rising_bubble_main(s32 arg0, f32 posX, f32 posY, f32 posZ, f32 arg4) {
effectBp.renderUI = NULL; effectBp.renderUI = NULL;
effectBp.effectID = EFFECT_RISING_BUBBLE; effectBp.effectID = EFFECT_RISING_BUBBLE;
effect = shim_create_effect_instance(&effectBp); effect = create_effect_instance(&effectBp);
effect->numParts = numParts; effect->numParts = numParts;
data = effect->data.risingBubble = shim_general_heap_malloc(numParts * sizeof(*data)); data = effect->data.risingBubble = general_heap_malloc(numParts * sizeof(*data));
ASSERT(data != NULL); ASSERT(data != NULL);
data->unk_00 = arg0; data->unk_00 = arg0;
@ -47,12 +47,12 @@ void rising_bubble_main(s32 arg0, f32 posX, f32 posY, f32 posZ, f32 arg4) {
data->unk_14 = 0; data->unk_14 = 0;
data->lifeTime = 0; data->lifeTime = 0;
if (arg4 != 0.0f) { if (arg4 != 0.0f) {
data->unk_10 = ((shim_rand_int(3) * 0.1) + 0.7) * 0.4; data->unk_10 = ((rand_int(3) * 0.1) + 0.7) * 0.4;
} else { } else {
data->unk_10 = 1.0f; data->unk_10 = 1.0f;
} }
data->timeLeft = 32; data->timeLeft = 32;
data->unk_20 = shim_rand_int(31); data->unk_20 = rand_int(31);
data->unk_24 = posY + arg4; data->unk_24 = posY + arg4;
} }
@ -68,7 +68,7 @@ void rising_bubble_update(EffectInstance* effect) {
data->lifeTime++; data->lifeTime++;
if (data->timeLeft < 0) { if (data->timeLeft < 0) {
shim_remove_effect(effect); remove_effect(effect);
return; return;
} }
@ -101,7 +101,7 @@ void rising_bubble_render(EffectInstance* effect) {
renderTask.distance = 0; renderTask.distance = 0;
renderTask.renderMode = RENDER_MODE_2D; renderTask.renderMode = RENDER_MODE_2D;
retTask = shim_queue_render_task(&renderTask); retTask = queue_render_task(&renderTask);
retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR;
} }
@ -128,18 +128,18 @@ void rising_bubble_appendGfx(void* effect) {
(uls ) * 4, (ult ) * 4, (uls ) * 4, (ult ) * 4,
(uls + 32) * 4, (ult + 32) * 4); (uls + 32) * 4, (ult + 32) * 4);
shim_guTranslateF(sp20, data->pos.x, data->pos.y, data->pos.z); guTranslateF(sp20, data->pos.x, data->pos.y, data->pos.z);
shim_guScaleF(sp60, data->unk_10, 1.0f, data->unk_10); guScaleF(sp60, data->unk_10, 1.0f, data->unk_10);
shim_guMtxCatF(sp60, sp20, sp20); guMtxCatF(sp60, sp20, sp20);
} else { } else {
gSPDisplayList(gMainGfxPos++, D_E0046618[0]); gSPDisplayList(gMainGfxPos++, D_E0046618[0]);
gDPSetPrimColor(gMainGfxPos++, 0, 0, 255, 255, 255, data->unk_14); gDPSetPrimColor(gMainGfxPos++, 0, 0, 255, 255, 255, data->unk_14);
gDPSetEnvColor(gMainGfxPos++, 128, 128, 255, data->unk_14); gDPSetEnvColor(gMainGfxPos++, 128, 128, 255, data->unk_14);
shim_guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].currentYaw, 0.0f, data->unk_10, data->pos.x, data->pos.y, data->pos.z); guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].currentYaw, 0.0f, data->unk_10, data->pos.x, data->pos.y, data->pos.z);
} }
shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
if (data->pos.y >= data->unk_24) { if (data->pos.y >= data->unk_24) {

View File

@ -43,9 +43,9 @@ EffectInstance* shape_spell_main(s32 isChild, f32 x, f32 y, f32 z, f32 arg4, f32
bp.renderUI = NULL; bp.renderUI = NULL;
bp.effectID = EFFECT_SHAPE_SPELL; bp.effectID = EFFECT_SHAPE_SPELL;
effect = shim_create_effect_instance(bpPtr); effect = create_effect_instance(bpPtr);
effect->numParts = numParts; effect->numParts = numParts;
part = effect->data.shapeSpell = shim_general_heap_malloc(numParts * sizeof(*part)); part = effect->data.shapeSpell = general_heap_malloc(numParts * sizeof(*part));
ASSERT(effect->data.shapeSpell != NULL); ASSERT(effect->data.shapeSpell != NULL);
@ -94,7 +94,7 @@ void shape_spell_update(EffectInstance* effect) {
part->unk_2C++; part->unk_2C++;
if (part->timeLeft < 0) { if (part->timeLeft < 0) {
shim_remove_effect(effect); remove_effect(effect);
return; return;
} }
@ -129,14 +129,14 @@ void shape_spell_render(EffectInstance* effect) {
renderTask.distance = 0; renderTask.distance = 0;
renderTask.renderMode = RENDER_MODE_2D; renderTask.renderMode = RENDER_MODE_2D;
retTask = shim_queue_render_task(&renderTask); retTask = queue_render_task(&renderTask);
retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR;
} }
s32 func_E0024324(s32 arg0, s32 arg1) { s32 func_E0024324(s32 arg0, s32 arg1) {
s32 frameCounter = gGameStatusPtr->frameCounter * 32; s32 frameCounter = gGameStatusPtr->frameCounter * 32;
return (f32)((shim_sin_deg(frameCounter + arg1) * (255 - arg0) + (255 - arg0)) * 0.5 + arg0); return (f32)((sin_deg(frameCounter + arg1) * (255 - arg0) + (255 - arg0)) * 0.5 + arg0);
} }
s32 func_E00243BC(s32 arg0, s32 arg1) { s32 func_E00243BC(s32 arg0, s32 arg1) {
@ -144,7 +144,7 @@ s32 func_E00243BC(s32 arg0, s32 arg1) {
arg1 += 180; arg1 += 180;
return (f32)((shim_sin_deg(frameCounter + arg1) * -arg0 + -arg0) * 0.5 + arg0); return (f32)((sin_deg(frameCounter + arg1) * -arg0 + -arg0) * 0.5 + arg0);
} }
void shape_spell_appendGfx(void* effect) { void shape_spell_appendGfx(void* effect) {
@ -205,34 +205,34 @@ void shape_spell_appendGfx(void* effect) {
primA = data->unk_34 * 100 / 255; primA = data->unk_34 * 100 / 255;
} }
shim_guPositionF(sp20, 0.0f, var_f30, 0.0f, unk_28, unk_10, unk_14, unk_18); guPositionF(sp20, 0.0f, var_f30, 0.0f, unk_28, unk_10, unk_14, unk_18);
shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
shim_guTranslateF(sp20, guTranslateF(sp20,
shim_sin_deg(angle) * factor, sin_deg(angle) * factor,
shim_cos_deg(angle) * factor, 0.0f); cos_deg(angle) * factor, 0.0f);
angle += 120.0f; angle += 120.0f;
sp60[0] = &gDisplayContext->matrixStack[gMatrixListPos++]; sp60[0] = &gDisplayContext->matrixStack[gMatrixListPos++];
shim_guMtxF2L(sp20, sp60[0]); guMtxF2L(sp20, sp60[0]);
shim_guTranslateF(sp20, guTranslateF(sp20,
shim_sin_deg(angle) * factor, sin_deg(angle) * factor,
shim_cos_deg(angle) * factor, 0.0f); cos_deg(angle) * factor, 0.0f);
angle += 120.0f; angle += 120.0f;
sp60[1] = &gDisplayContext->matrixStack[gMatrixListPos++]; sp60[1] = &gDisplayContext->matrixStack[gMatrixListPos++];
shim_guMtxF2L(sp20, sp60[1]); guMtxF2L(sp20, sp60[1]);
shim_guTranslateF(sp20, guTranslateF(sp20,
shim_sin_deg(angle) * factor, sin_deg(angle) * factor,
shim_cos_deg(angle) * factor, 0.0f); cos_deg(angle) * factor, 0.0f);
sp60[2] = &gDisplayContext->matrixStack[gMatrixListPos++]; sp60[2] = &gDisplayContext->matrixStack[gMatrixListPos++];
shim_guMtxF2L(sp20, sp60[2]); guMtxF2L(sp20, sp60[2]);
for (j = 0; j < 3; j++) { for (j = 0; j < 3; j++) {
gSPMatrix(gMainGfxPos++, sp60[j], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, sp60[j], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
@ -263,18 +263,18 @@ void shape_spell_appendGfx(void* effect) {
var_f30 = -gCameras[gCurrentCameraID].currentYaw; var_f30 = -gCameras[gCurrentCameraID].currentYaw;
} }
shim_guPositionF(sp20, 0.0f, var_f30, 0.0f, 1.0f, data->pos.x, data->pos.y, data->pos.z); guPositionF(sp20, 0.0f, var_f30, 0.0f, 1.0f, data->pos.x, data->pos.y, data->pos.z);
shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
if (!isChild) { if (!isChild) {
gSPDisplayList(gMainGfxPos++, savedGfxPos2); gSPDisplayList(gMainGfxPos++, savedGfxPos2);
} else { } else {
shim_guRotateF(sp20, 30.0f, 0.0f, 0.0f, 1.0f); guRotateF(sp20, 30.0f, 0.0f, 0.0f, 1.0f);
mtx = &gDisplayContext->matrixStack[gMatrixListPos++]; mtx = &gDisplayContext->matrixStack[gMatrixListPos++];
shim_guMtxF2L(sp20, mtx); guMtxF2L(sp20, mtx);
for (i = 0; i < 12; i++) { for (i = 0; i < 12; i++) {
gSPMatrix(gMainGfxPos++, mtx, G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, mtx, G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW);

View File

@ -52,9 +52,9 @@ void shattering_stones_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4) {
bp.renderUI = NULL; bp.renderUI = NULL;
bp.effectID = EFFECT_SHATTERING_STONES; bp.effectID = EFFECT_SHATTERING_STONES;
effect = shim_create_effect_instance(&bp); effect = create_effect_instance(&bp);
effect->numParts = numParts; effect->numParts = numParts;
part = effect->data.shatteringStones = shim_general_heap_malloc(numParts * sizeof(*part)); part = effect->data.shatteringStones = general_heap_malloc(numParts * sizeof(*part));
ASSERT(effect->data.shatteringStones != NULL); ASSERT(effect->data.shatteringStones != NULL);
part->unk_24 = 0; part->unk_24 = 0;
@ -65,9 +65,9 @@ void shattering_stones_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4) {
part->unk_2C = 0; part->unk_2C = 0;
part->unk_30 = 0; part->unk_30 = 0;
part->unk_14 = -2.0f; part->unk_14 = -2.0f;
part->unk_34 = shim_rand_int(60) - 30; part->unk_34 = rand_int(60) - 30;
part->unk_28 = 255; part->unk_28 = 255;
part->unk_38 = shim_rand_int(60) - 30; part->unk_38 = rand_int(60) - 30;
part->unk_3C = part->unk_38 * 0.25; part->unk_3C = part->unk_38 * 0.25;
part->unk_20 = 20; part->unk_20 = 20;
@ -79,7 +79,7 @@ void shattering_stones_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4) {
part->unk_04 = 0; part->unk_04 = 0;
part->unk_08 = 0; part->unk_08 = 0;
part->unk_10 = D_E002C964[i - 1] * 2.0f; part->unk_10 = D_E002C964[i - 1] * 2.0f;
part->unk_14 = (f32) shim_rand_int(10) * 0.1 * 2.0 + 1.0; part->unk_14 = (f32) rand_int(10) * 0.1 * 2.0 + 1.0;
part->unk_2C = 0; part->unk_2C = 0;
part->unk_34 = 0; part->unk_34 = 0;
} }
@ -105,7 +105,7 @@ void shattering_stones_update(EffectInstance* effect) {
if (part->unk_24 == 1) { if (part->unk_24 == 1) {
part->unk_20--; part->unk_20--;
if (part->unk_20 < 0) { if (part->unk_20 < 0) {
shim_remove_effect(effect); remove_effect(effect);
return; return;
} }
@ -134,7 +134,7 @@ void shattering_stones_render(EffectInstance* effect) {
renderTask.distance = 0; renderTask.distance = 0;
renderTask.renderMode = RENDER_MODE_2D; renderTask.renderMode = RENDER_MODE_2D;
retTask = shim_queue_render_task(&renderTask); retTask = queue_render_task(&renderTask);
retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR;
} }
@ -150,18 +150,18 @@ void shattering_stones_appendGfx(void* effect) {
gSPDisplayList(gMainGfxPos++, D_09000C00_341480); gSPDisplayList(gMainGfxPos++, D_09000C00_341480);
if (part->unk_24 == 0) { if (part->unk_24 == 0) {
shim_guTranslateF(sp20, part->unk_00, part->unk_04, part->unk_08); guTranslateF(sp20, part->unk_00, part->unk_04, part->unk_08);
shim_guScaleF(sp60, 1.5f, 1.5f, 1.5f); guScaleF(sp60, 1.5f, 1.5f, 1.5f);
shim_guMtxCatF(sp60, sp20, spA0); guMtxCatF(sp60, sp20, spA0);
shim_guRotateF(sp60, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); guRotateF(sp60, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f);
shim_guMtxCatF(sp60, spA0, spA0); guMtxCatF(sp60, spA0, spA0);
shim_guRotateF(sp60, part->unk_34, 0.0f, 0.0f, 1.0f); guRotateF(sp60, part->unk_34, 0.0f, 0.0f, 1.0f);
shim_guMtxCatF(sp60, spA0, spA0); guMtxCatF(sp60, spA0, spA0);
shim_guRotateF(sp60, part->unk_2C, 1.0f, 0.0f, 0.0f); guRotateF(sp60, part->unk_2C, 1.0f, 0.0f, 0.0f);
shim_guMtxCatF(sp60, spA0, spA0); guMtxCatF(sp60, spA0, spA0);
shim_guRotateF(sp60, part->unk_30, 0.0f, 1.0f, 0.0f); guRotateF(sp60, part->unk_30, 0.0f, 1.0f, 0.0f);
shim_guMtxCatF(sp60, spA0, spA0); guMtxCatF(sp60, spA0, spA0);
shim_guMtxF2L(spA0, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(spA0, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
gDPSetPrimColor(gMainGfxPos++, 0, 0, 102, 109, 123, part->unk_28); gDPSetPrimColor(gMainGfxPos++, 0, 0, 102, 109, 123, part->unk_28);
@ -170,23 +170,23 @@ void shattering_stones_appendGfx(void* effect) {
} else { } else {
s32 unk_28 = part->unk_28; s32 unk_28 = part->unk_28;
shim_guTranslateF(sp20, part->unk_00, part->unk_04, part->unk_08); guTranslateF(sp20, part->unk_00, part->unk_04, part->unk_08);
shim_guScaleF(sp60, 1.5f, 1.5f, 1.5f); guScaleF(sp60, 1.5f, 1.5f, 1.5f);
shim_guMtxCatF(sp60, sp20, spA0); guMtxCatF(sp60, sp20, spA0);
shim_guRotateF(sp60, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); guRotateF(sp60, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f);
shim_guMtxCatF(sp60, spA0, spA0); guMtxCatF(sp60, spA0, spA0);
shim_guRotateF(spE0, part->unk_2C, 1.0f, 0.0f, 0.0f); guRotateF(spE0, part->unk_2C, 1.0f, 0.0f, 0.0f);
part++; part++;
for (i = 1; i < ((EffectInstance*)effect)->numParts; i++, part++) { for (i = 1; i < ((EffectInstance*)effect)->numParts; i++, part++) {
Gfx* dlist = D_E002C940[i]; Gfx* dlist = D_E002C940[i];
shim_guTranslateF(sp60, part->unk_00, part->unk_04, part->unk_08); guTranslateF(sp60, part->unk_00, part->unk_04, part->unk_08);
shim_guMtxCatF(sp60, spA0, sp20); guMtxCatF(sp60, spA0, sp20);
shim_guMtxCatF(spE0, sp20, sp20); guMtxCatF(spE0, sp20, sp20);
shim_guPositionF(sp60, part->unk_2C, 0.0f, part->unk_34, 1.0f, part->unk_18, part->unk_1C, 0.0f); guPositionF(sp60, part->unk_2C, 0.0f, part->unk_34, 1.0f, part->unk_18, part->unk_1C, 0.0f);
shim_guMtxCatF(sp60, sp20, sp20); guMtxCatF(sp60, sp20, sp20);
shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
gDPSetPrimColor(gMainGfxPos++, 0, 0, 150, 150, 200, unk_28); gDPSetPrimColor(gMainGfxPos++, 0, 0, 150, 150, 200, unk_28);

View File

@ -46,9 +46,9 @@ EffectInstance* shimmer_burst_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 a
bp.renderUI = NULL; bp.renderUI = NULL;
bp.effectID = EFFECT_SHIMMER_BURST; bp.effectID = EFFECT_SHIMMER_BURST;
effect = shim_create_effect_instance(&bp); effect = create_effect_instance(&bp);
effect->numParts = numParts; effect->numParts = numParts;
part = effect->data.shimmerBurst = shim_general_heap_malloc(numParts * sizeof(*part)); part = effect->data.shimmerBurst = general_heap_malloc(numParts * sizeof(*part));
ASSERT(effect->data.shimmerBurst != NULL); ASSERT(effect->data.shimmerBurst != NULL);
part->unk_00 = arg0; part->unk_00 = arg0;
@ -118,7 +118,7 @@ void shimmer_burst_update(EffectInstance* effect) {
part->unk_3C++; part->unk_3C++;
if (part->unk_38 < 0) { if (part->unk_38 < 0) {
shim_remove_effect(effect); remove_effect(effect);
return; return;
} }
@ -138,13 +138,13 @@ void shimmer_burst_update(EffectInstance* effect) {
if (part->unk_30 >= 0) { if (part->unk_30 >= 0) {
if (part->unk_30 == 0) { if (part->unk_30 == 0) {
f32 rand1 = shim_rand_int(359); f32 rand1 = rand_int(359);
f32 rand2 = shim_rand_int(359); f32 rand2 = rand_int(359);
if (unk_00 == 0) { if (unk_00 == 0) {
part->unk_04 = unk_10 * shim_sin_deg(rand1) * shim_cos_deg(rand2); part->unk_04 = unk_10 * sin_deg(rand1) * cos_deg(rand2);
part->unk_08 = unk_14 * shim_cos_deg(rand1) * shim_cos_deg(rand2); part->unk_08 = unk_14 * cos_deg(rand1) * cos_deg(rand2);
part->unk_0C = unk_10 * shim_sin_deg(rand2); part->unk_0C = unk_10 * sin_deg(rand2);
part->unk_18 = part->unk_04 * 0.4; part->unk_18 = part->unk_04 * 0.4;
part->unk_1C = part->unk_08 * 0.4; part->unk_1C = part->unk_08 * 0.4;
part->unk_20 = part->unk_0C * 0.4; part->unk_20 = part->unk_0C * 0.4;
@ -152,9 +152,9 @@ void shimmer_burst_update(EffectInstance* effect) {
part->unk_28 = part->unk_1C * 0.1; part->unk_28 = part->unk_1C * 0.1;
part->unk_2C = part->unk_20 * 0.1; part->unk_2C = part->unk_20 * 0.1;
} else { } else {
part->unk_04 = shim_rand_int(unk_10) - unk_10 * 0.5; part->unk_04 = rand_int(unk_10) - unk_10 * 0.5;
part->unk_08 = shim_rand_int(unk_14) - unk_14 * 0.5; part->unk_08 = rand_int(unk_14) - unk_14 * 0.5;
part->unk_0C = shim_rand_int(unk_10) - unk_10 * 0.5; part->unk_0C = rand_int(unk_10) - unk_10 * 0.5;
part->unk_18 = part->unk_04 * 0.3; part->unk_18 = part->unk_04 * 0.3;
part->unk_1C = part->unk_08 * 0.3; part->unk_1C = part->unk_08 * 0.3;
part->unk_20 = part->unk_0C * 0.3; part->unk_20 = part->unk_0C * 0.3;
@ -163,8 +163,8 @@ void shimmer_burst_update(EffectInstance* effect) {
part->unk_2C = part->unk_20 * 0.02; part->unk_2C = part->unk_20 * 0.02;
} }
part->unk_64 = shim_rand_int(15); part->unk_64 = rand_int(15);
part->unk_68 = shim_rand_int(15); part->unk_68 = rand_int(15);
part->unk_34 = 0.0f; part->unk_34 = 0.0f;
part->unk_4C = 255; part->unk_4C = 255;
} }
@ -192,7 +192,7 @@ void shimmer_burst_render(EffectInstance* effect) {
renderTask.distance = 10; renderTask.distance = 10;
renderTask.renderMode = RENDER_MODE_2D; renderTask.renderMode = RENDER_MODE_2D;
retTask = shim_queue_render_task(&renderTask); retTask = queue_render_task(&renderTask);
retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR;
} }
@ -213,10 +213,10 @@ void shimmer_burst_appendGfx(void* effect) {
gDPPipeSync(gMainGfxPos++); gDPPipeSync(gMainGfxPos++);
gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data));
shim_guTranslateF(sp20, part->unk_04, part->unk_08, part->unk_0C); guTranslateF(sp20, part->unk_04, part->unk_08, part->unk_0C);
shim_guScaleF(sp60, part->unk_60, part->unk_60, part->unk_60); guScaleF(sp60, part->unk_60, part->unk_60, part->unk_60);
shim_guMtxCatF(sp60, sp20, sp20); guMtxCatF(sp60, sp20, sp20);
shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gDPSetEnvColor(gMainGfxPos++, part->unk_40, part->unk_44, part->unk_48, part->unk_5C); gDPSetEnvColor(gMainGfxPos++, part->unk_40, part->unk_44, part->unk_48, part->unk_5C);
@ -228,8 +228,8 @@ void shimmer_burst_appendGfx(void* effect) {
part++; part++;
for (i = 1; i < ((EffectInstance*)effect)->numParts; i++, part++) { for (i = 1; i < ((EffectInstance*)effect)->numParts; i++, part++) {
if (part->unk_30 >= 0) { if (part->unk_30 >= 0) {
shim_guPositionF(sp20, 0.0f, 0.0f, part->unk_34, part->unk_60 * temp_f20, part->unk_04, part->unk_08, part->unk_0C); guPositionF(sp20, 0.0f, 0.0f, part->unk_34, part->unk_60 * temp_f20, part->unk_04, part->unk_08, part->unk_0C);
shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
gDPSetPrimColor(gMainGfxPos++, 0, 0, unk_50, unk_54, unk_58, part->unk_4C * temp_f20); gDPSetPrimColor(gMainGfxPos++, 0, 0, unk_50, unk_54, unk_58, part->unk_4C * temp_f20);
@ -242,15 +242,15 @@ void shimmer_burst_appendGfx(void* effect) {
gSPBranchList(savedGfxPos, gMainGfxPos); gSPBranchList(savedGfxPos, gMainGfxPos);
gSPDisplayList(gMainGfxPos++, savedGfxPos + 1); gSPDisplayList(gMainGfxPos++, savedGfxPos + 1);
shim_guRotateF(sp20, 120.0f, 0.4f, 0.0f, 0.8f); guRotateF(sp20, 120.0f, 0.4f, 0.0f, 0.8f);
shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
gSPDisplayList(gMainGfxPos++, savedGfxPos + 1); gSPDisplayList(gMainGfxPos++, savedGfxPos + 1);
gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW); gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
shim_guRotateF(sp20, -120.0f, 0.4f, 0.0f, 0.8f); guRotateF(sp20, -120.0f, 0.4f, 0.0f, 0.8f);
shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
gSPDisplayList(gMainGfxPos++, savedGfxPos + 1); gSPDisplayList(gMainGfxPos++, savedGfxPos + 1);

View File

@ -56,9 +56,9 @@ EffectInstance* shimmer_wave_main(
bp.renderUI = NULL; bp.renderUI = NULL;
bp.effectID = EFFECT_SHIMMER_WAVE; bp.effectID = EFFECT_SHIMMER_WAVE;
effect = shim_create_effect_instance(&bp); effect = create_effect_instance(&bp);
effect->numParts = arg6; effect->numParts = arg6;
part = effect->data.shimmerWave = shim_general_heap_malloc(arg6 * sizeof(*part)); part = effect->data.shimmerWave = general_heap_malloc(arg6 * sizeof(*part));
ASSERT(effect->data.shimmerWave != NULL); ASSERT(effect->data.shimmerWave != NULL);
part->unk_00 = arg0; part->unk_00 = arg0;
@ -119,7 +119,7 @@ void shimmer_wave_update(EffectInstance* effect) {
part->unk_3C++; part->unk_3C++;
if (part->unk_38 < 0) { if (part->unk_38 < 0) {
shim_remove_effect(effect); remove_effect(effect);
return; return;
} }
@ -139,20 +139,20 @@ void shimmer_wave_update(EffectInstance* effect) {
if (part->unk_30 >= 0) { if (part->unk_30 >= 0) {
if (part->unk_30 == 0) { if (part->unk_30 == 0) {
f32 rand = shim_rand_int(359); f32 rand = rand_int(359);
shim_rand_int(359); rand_int(359);
part->unk_04 = unk_10 * shim_sin_deg(rand); part->unk_04 = unk_10 * sin_deg(rand);
part->unk_08 = shim_rand_int(unk_14) - unk_14 * 0.5; part->unk_08 = rand_int(unk_14) - unk_14 * 0.5;
part->unk_0C = unk_10 * shim_cos_deg(rand); part->unk_0C = unk_10 * cos_deg(rand);
part->unk_18 = shim_sin_deg(rand) * 15.0f; part->unk_18 = sin_deg(rand) * 15.0f;
part->unk_1C = part->unk_08 * 0.4; part->unk_1C = part->unk_08 * 0.4;
part->unk_20 = shim_cos_deg(rand) * 15.0f; part->unk_20 = cos_deg(rand) * 15.0f;
part->unk_24 = part->unk_18 * 0.5; part->unk_24 = part->unk_18 * 0.5;
part->unk_28 = part->unk_1C * 0.5; part->unk_28 = part->unk_1C * 0.5;
part->unk_2C = part->unk_20 * 0.5; part->unk_2C = part->unk_20 * 0.5;
part->unk_64 = shim_rand_int(15); part->unk_64 = rand_int(15);
part->unk_68 = shim_rand_int(15); part->unk_68 = rand_int(15);
part->unk_34 = 0.0f; part->unk_34 = 0.0f;
part->unk_4C = 255; part->unk_4C = 255;
} }
@ -180,7 +180,7 @@ void shimmer_wave_render(EffectInstance* effect) {
renderTask.distance = 10; renderTask.distance = 10;
renderTask.renderMode = RENDER_MODE_2D; renderTask.renderMode = RENDER_MODE_2D;
retTask = shim_queue_render_task(&renderTask); retTask = queue_render_task(&renderTask);
retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR;
} }
@ -198,10 +198,10 @@ void shimmer_wave_appendGfx(void* effect) {
gDPPipeSync(gMainGfxPos++); gDPPipeSync(gMainGfxPos++);
gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data));
shim_guTranslateF(sp20, part->unk_04, part->unk_08, part->unk_0C); guTranslateF(sp20, part->unk_04, part->unk_08, part->unk_0C);
shim_guScaleF(sp60, part->unk_60, part->unk_60, part->unk_60); guScaleF(sp60, part->unk_60, part->unk_60, part->unk_60);
shim_guMtxCatF(sp60, sp20, sp20); guMtxCatF(sp60, sp20, sp20);
shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gDPSetEnvColor(gMainGfxPos++, part->unk_40, part->unk_44, part->unk_48, part->unk_5C); gDPSetEnvColor(gMainGfxPos++, part->unk_40, part->unk_44, part->unk_48, part->unk_5C);
@ -213,8 +213,8 @@ void shimmer_wave_appendGfx(void* effect) {
part++; part++;
for (i = 1; i < ((EffectInstance*)effect)->numParts; i++, part++) { for (i = 1; i < ((EffectInstance*)effect)->numParts; i++, part++) {
if (part->unk_30 >= 0) { if (part->unk_30 >= 0) {
shim_guPositionF(sp20, 0.0f, 0.0f, part->unk_34, part->unk_60 * temp_4C, part->unk_04, part->unk_08, part->unk_0C); guPositionF(sp20, 0.0f, 0.0f, part->unk_34, part->unk_60 * temp_4C, part->unk_04, part->unk_08, part->unk_0C);
shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
gDPSetPrimColor(gMainGfxPos++, 0, 0, unk_50, unk_54, unk_58, part->unk_4C * temp_4C); gDPSetPrimColor(gMainGfxPos++, 0, 0, unk_50, unk_54, unk_58, part->unk_4C * temp_4C);
@ -227,15 +227,15 @@ void shimmer_wave_appendGfx(void* effect) {
gSPBranchList(savedGfxPos, gMainGfxPos); gSPBranchList(savedGfxPos, gMainGfxPos);
gSPDisplayList(gMainGfxPos++, savedGfxPos + 1); gSPDisplayList(gMainGfxPos++, savedGfxPos + 1);
shim_guRotateF(sp20, 120.0f, 0.0f, 1.0f, 0.0f); guRotateF(sp20, 120.0f, 0.0f, 1.0f, 0.0f);
shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
gSPDisplayList(gMainGfxPos++, savedGfxPos + 1); gSPDisplayList(gMainGfxPos++, savedGfxPos + 1);
gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW); gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
shim_guRotateF(sp20, -120.0f, 0.0f, 1.0f, 0.0f); guRotateF(sp20, -120.0f, 0.0f, 1.0f, 0.0f);
shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
gSPDisplayList(gMainGfxPos++, savedGfxPos + 1); gSPDisplayList(gMainGfxPos++, savedGfxPos + 1);

View File

@ -32,10 +32,10 @@ EffectInstance* shiny_flare_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg
effectBp.unk_00 = 0; effectBp.unk_00 = 0;
effectBp.renderUI = NULL; effectBp.renderUI = NULL;
effectBp.effectID = EFFECT_SHINY_FLARE; effectBp.effectID = EFFECT_SHINY_FLARE;
effect = shim_create_effect_instance(&effectBp); effect = create_effect_instance(&effectBp);
effect->numParts = numParts; effect->numParts = numParts;
data = effect->data.shinyFlare = shim_general_heap_malloc(numParts * sizeof(*data)); data = effect->data.shinyFlare = general_heap_malloc(numParts * sizeof(*data));
ASSERT(data != NULL); ASSERT(data != NULL);
data->unk_00 = arg0; data->unk_00 = arg0;
@ -70,7 +70,7 @@ void shiny_flare_update(EffectInstance *effect) {
data->lifeTime++; data->lifeTime++;
if (data->timeLeft < 0) { if (data->timeLeft < 0) {
shim_remove_effect(effect); remove_effect(effect);
return; return;
} }
if (data->timeLeft < 4) { if (data->timeLeft < 4) {
@ -90,7 +90,7 @@ void shiny_flare_render(EffectInstance* effect) {
renderTask.distance = 10; renderTask.distance = 10;
renderTask.renderMode = RENDER_MODE_2D; renderTask.renderMode = RENDER_MODE_2D;
retTask = shim_queue_render_task(&renderTask); retTask = queue_render_task(&renderTask);
retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR;
} }
@ -109,10 +109,10 @@ void shiny_flare_appendGfx(void* effect) {
gDPPipeSync(gMainGfxPos++); gDPPipeSync(gMainGfxPos++);
gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data));
shim_guTranslateF(sp10, data->pos.x, data->pos.y, data->pos.z); guTranslateF(sp10, data->pos.x, data->pos.y, data->pos.z);
shim_guScaleF(sp50, scale, scale, scale); guScaleF(sp50, scale, scale, scale);
shim_guMtxCatF(sp50, sp10, sp10); guMtxCatF(sp50, sp10, sp10);
shim_guMtxF2L(sp10, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp10, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPMatrix(gMainGfxPos++, camera->unkMatrix, G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, camera->unkMatrix, G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW);

View File

@ -62,12 +62,12 @@ void shockwave_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3) {
bpPtr->renderUI = NULL; bpPtr->renderUI = NULL;
bpPtr->effectID = EFFECT_SHOCKWAVE; bpPtr->effectID = EFFECT_SHOCKWAVE;
effect = shim_create_effect_instance(bpPtr); effect = create_effect_instance(bpPtr);
effect->numParts = numParts; effect->numParts = numParts;
part = effect->data.shockwave = shim_general_heap_malloc(numParts * sizeof(*part)); part = effect->data.shockwave = general_heap_malloc(numParts * sizeof(*part));
ASSERT(effect->data.shockwave != NULL); ASSERT(effect->data.shockwave != NULL);
shim_mem_clear(part, numParts * sizeof(*part)); mem_clear(part, numParts * sizeof(*part));
if (arg0 >= 2) { if (arg0 >= 2) {
part->unk_28 = 60; part->unk_28 = 60;
@ -155,7 +155,7 @@ void shockwave_update(EffectInstance* effect) {
part->unk_28--; part->unk_28--;
if (part->unk_28 < 0) { if (part->unk_28 < 0) {
shim_remove_effect(effect); remove_effect(effect);
return; return;
} }
@ -184,8 +184,8 @@ void shockwave_update(EffectInstance* effect) {
part->pos.x = 0.0f; part->pos.x = 0.0f;
part->pos.y = 0.0f; part->pos.y = 0.0f;
part->pos.z = 0.0f; part->pos.z = 0.0f;
part->unk_10 = -shim_sin_deg(part->unk_34) * 0.5; part->unk_10 = -sin_deg(part->unk_34) * 0.5;
part->unk_14 = shim_cos_deg(part->unk_34) * 0.5; part->unk_14 = cos_deg(part->unk_34) * 0.5;
part->unk_18 = 0; part->unk_18 = 0;
part->unk_3C = 32.0f; part->unk_3C = 32.0f;
part->unk_40 = 32.0f; part->unk_40 = 32.0f;
@ -261,7 +261,7 @@ void shockwave_render(EffectInstance* effect) {
renderTask.distance = 0; renderTask.distance = 0;
renderTask.renderMode = RENDER_MODE_28; renderTask.renderMode = RENDER_MODE_28;
retTask = shim_queue_render_task(&renderTask); retTask = queue_render_task(&renderTask);
retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR;
} }
@ -309,9 +309,9 @@ void shockwave_appendGfx(void* effect) {
gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data));
gSPDisplayList(gMainGfxPos++, dlist2); gSPDisplayList(gMainGfxPos++, dlist2);
shim_guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f,
data->pos.x, data->pos.y, data->pos.z); data->pos.x, data->pos.y, data->pos.z);
shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++],
G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
@ -324,14 +324,14 @@ void shockwave_appendGfx(void* effect) {
data++; data++;
for (i = 1; i < ((EffectInstance*) effect)->numParts; i++, data++) { for (i = 1; i < ((EffectInstance*) effect)->numParts; i++, data++) {
if (data->unk_4C >= 0) { if (data->unk_4C >= 0) {
shim_guTranslateF(sp20, data->pos.x, data->pos.y, data->pos.z); guTranslateF(sp20, data->pos.x, data->pos.y, data->pos.z);
shim_guRotateF(sp60, data->unk_34, 0.0f, 0.0f, 1.0f); guRotateF(sp60, data->unk_34, 0.0f, 0.0f, 1.0f);
shim_guMtxCatF(sp60, sp20, sp20); guMtxCatF(sp60, sp20, sp20);
shim_guScaleF(sp60, data->unk_1C * 0.3, data->unk_20 * 0.3, data->unk_24 * 0.3); guScaleF(sp60, data->unk_1C * 0.3, data->unk_20 * 0.3, data->unk_24 * 0.3);
shim_guMtxCatF(sp60, sp20, sp20); guMtxCatF(sp60, sp20, sp20);
shim_guRotateF(sp60, data->unk_30, 0.0f, 1.0f, 0.0f); guRotateF(sp60, data->unk_30, 0.0f, 1.0f, 0.0f);
shim_guMtxCatF(sp60, sp20, sp20); guMtxCatF(sp60, sp20, sp20);
shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]);
gDPSetTileSize(gMainGfxPos++, G_TX_RENDERTILE, 0, (s32) data->unk_3C, 0x00FC, (s32) data->unk_3C + 0x7C); gDPSetTileSize(gMainGfxPos++, G_TX_RENDERTILE, 0, (s32) data->unk_3C, 0x00FC, (s32) data->unk_3C + 0x7C);
gDPSetTileSize(gMainGfxPos++, 1, 0, (s32) data->unk_44, 0x007C, (s32) data->unk_44 + 0x7C); gDPSetTileSize(gMainGfxPos++, 1, 0, (s32) data->unk_44, 0x007C, (s32) data->unk_44 + 0x7C);

View File

@ -32,9 +32,9 @@ void sleep_bubble_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg
bp.renderUI = NULL; bp.renderUI = NULL;
bp.effectID = EFFECT_SLEEP_BUBBLE; bp.effectID = EFFECT_SLEEP_BUBBLE;
effect = shim_create_effect_instance(bpPtr); effect = create_effect_instance(bpPtr);
effect->numParts = numParts; effect->numParts = numParts;
part = effect->data.sleepBubble = shim_general_heap_malloc(numParts * sizeof(*part)); part = effect->data.sleepBubble = general_heap_malloc(numParts * sizeof(*part));
ASSERT(effect->data.sleepBubble != NULL); ASSERT(effect->data.sleepBubble != NULL);
@ -72,7 +72,7 @@ void sleep_bubble_update(EffectInstance* effect) {
} }
if (part->timeLeft < 0) { if (part->timeLeft < 0) {
shim_remove_effect(effect); remove_effect(effect);
return; return;
} }
@ -81,7 +81,7 @@ void sleep_bubble_update(EffectInstance* effect) {
temp1 = part->unk_18 + (part->unk_14 - part->unk_18) * 0.1f; temp1 = part->unk_18 + (part->unk_14 - part->unk_18) * 0.1f;
part->unk_18 = temp1; part->unk_18 = temp1;
temp2 = temp1 + (temp1 * shim_sin_deg(unk_20 * 3)) * 0.1; temp2 = temp1 + (temp1 * sin_deg(unk_20 * 3)) * 0.1;
i = 0; i = 0;
yPtr = &part->points->y; yPtr = &part->points->y;
@ -90,11 +90,11 @@ void sleep_bubble_update(EffectInstance* effect) {
for (i = 0; i < ARRAY_COUNT(part->points); i++) { for (i = 0; i < ARRAY_COUNT(part->points); i++) {
angle = i * 360.0f / 21.0f + 17.0f; angle = i * 360.0f / 21.0f + 17.0f;
*xPtr = temp2 * shim_sin_deg(angle); *xPtr = temp2 * sin_deg(angle);
*yPtr = -temp2 * shim_cos_deg(angle); *yPtr = -temp2 * cos_deg(angle);
*xPtr += shim_sin_deg((f32)unk_20 * (shim_sin_deg(xAngle) * 0.1 + 2.0) + (i + 5.0f) * 30.0f) * 1.5; *xPtr += sin_deg((f32)unk_20 * (sin_deg(xAngle) * 0.1 + 2.0) + (i + 5.0f) * 30.0f) * 1.5;
*yPtr += shim_cos_deg((f32)unk_20 * (shim_cos_deg(yAngle) * 0.1 + 2.0) + (i + 5.0f) * 50.0f) * 1.5; *yPtr += cos_deg((f32)unk_20 * (cos_deg(yAngle) * 0.1 + 2.0) + (i + 5.0f) * 50.0f) * 1.5;
xAngle += 53; xAngle += 53;
yAngle += 36; yAngle += 36;
@ -120,7 +120,7 @@ void sleep_bubble_render(EffectInstance* effect) {
renderTask.distance = 0; renderTask.distance = 0;
renderTask.renderMode = RENDER_MODE_2D; renderTask.renderMode = RENDER_MODE_2D;
retTask = shim_queue_render_task(&renderTask); retTask = queue_render_task(&renderTask);
retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR;
} }
@ -142,29 +142,29 @@ void sleep_bubble_appendGfx(void* effect) {
gSPDisplayList(gMainGfxPos++, D_090002E0_35D7F0); gSPDisplayList(gMainGfxPos++, D_090002E0_35D7F0);
} }
shim_guTranslateF(sp18, data->pos.x, data->pos.y, data->pos.z); guTranslateF(sp18, data->pos.x, data->pos.y, data->pos.z);
shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++],
G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPVertex(gMainGfxPos++, &D_09000180_35D690[1], 1, 0); gSPVertex(gMainGfxPos++, &D_09000180_35D690[1], 1, 0);
shim_guRotateF(sp18, data->unk_10, 0.0f, 0.0f, 1.0f); guRotateF(sp18, data->unk_10, 0.0f, 0.0f, 1.0f);
shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++],
G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW); G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW);
shim_guRotateF(sp18, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); guRotateF(sp18, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f);
shim_guTranslateF(sp58, data->unk_C4, data->unk_C8, 0.0f); guTranslateF(sp58, data->unk_C4, data->unk_C8, 0.0f);
shim_guMtxCatF(sp58, sp18, sp18); guMtxCatF(sp58, sp18, sp18);
shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++],
G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
gSPVertex(gMainGfxPos++, &D_09000180_35D690[0], 1, 1); gSPVertex(gMainGfxPos++, &D_09000180_35D690[0], 1, 1);
for (i = 0; i < ARRAY_COUNT(data->points); i++) { for (i = 0; i < ARRAY_COUNT(data->points); i++) {
shim_guTranslateF(sp18, data->points[i].x, data->points[i].y, 0.0f); guTranslateF(sp18, data->points[i].x, data->points[i].y, 0.0f);
shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++],
G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
gSPVertex(gMainGfxPos++, &D_09000180_35D690[i + 2], 1, i + 2); gSPVertex(gMainGfxPos++, &D_09000180_35D690[i + 2], 1, i + 2);

View File

@ -38,10 +38,10 @@ EffectInstance* small_gold_sparkle_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3,
bp.renderUI = NULL; bp.renderUI = NULL;
bp.effectID = EFFECT_SMALL_GOLD_SPARKLE; bp.effectID = EFFECT_SMALL_GOLD_SPARKLE;
effect = shim_create_effect_instance(&bp); effect = create_effect_instance(&bp);
effect->numParts = numParts; effect->numParts = numParts;
data = shim_general_heap_malloc(numParts * sizeof(*data)); data = general_heap_malloc(numParts * sizeof(*data));
effect->data.smallGoldSparkle = data; effect->data.smallGoldSparkle = data;
part = data; part = data;
@ -77,7 +77,7 @@ void small_gold_sparkle_update(EffectInstance* effect) {
part->unk_18++; part->unk_18++;
if (part->unk_14 < 0) { if (part->unk_14 < 0) {
shim_remove_effect(effect); remove_effect(effect);
return; return;
} }
@ -105,7 +105,7 @@ void small_gold_sparkle_render(EffectInstance* effect) {
renderTask.distance = 10; renderTask.distance = 10;
renderTask.renderMode = RENDER_MODE_2D; renderTask.renderMode = RENDER_MODE_2D;
retTask = shim_queue_render_task(&renderTask); retTask = queue_render_task(&renderTask);
retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR;
} }
@ -117,13 +117,13 @@ void small_gold_sparkle_appendGfx(void* effect) {
Mtx* spD8; Mtx* spD8;
s32 i; s32 i;
shim_guRotateF(sp98, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); guRotateF(sp98, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f);
shim_guMtxF2L(sp98, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp98, &gDisplayContext->matrixStack[gMatrixListPos]);
spD8 = &gDisplayContext->matrixStack[gMatrixListPos++]; spD8 = &gDisplayContext->matrixStack[gMatrixListPos++];
gDPPipeSync(gMainGfxPos++); gDPPipeSync(gMainGfxPos++);
gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data));
shim_guTranslateF(sp18, part->unk_08, part->unk_0C, part->unk_10); guTranslateF(sp18, part->unk_08, part->unk_0C, part->unk_10);
shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(gMainGfxPos++, D_090002C0_392700); gSPDisplayList(gMainGfxPos++, D_090002C0_392700);
@ -134,12 +134,12 @@ void small_gold_sparkle_appendGfx(void* effect) {
if (part->unk_20 == 0) { if (part->unk_20 == 0) {
f32 temp_f20 = part->unk_1C; f32 temp_f20 = part->unk_1C;
shim_guTranslateF(sp18, part->unk_08, part->unk_0C, part->unk_10); guTranslateF(sp18, part->unk_08, part->unk_0C, part->unk_10);
if (temp_f20 != 1.0f) { if (temp_f20 != 1.0f) {
shim_guScaleF(sp58, temp_f20, temp_f20, 1.0f); guScaleF(sp58, temp_f20, temp_f20, 1.0f);
shim_guMtxCatF(sp58, sp18, sp18); guMtxCatF(sp58, sp18, sp18);
} }
shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++],
G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
gSPMatrix(gMainGfxPos++, spD8, G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, spD8, G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW);

View File

@ -31,13 +31,13 @@ void smoke_burst_main(s32 arg0, f32 posX, f32 posY, f32 posZ, f32 arg4, s32 time
effectBp.renderUI = NULL; effectBp.renderUI = NULL;
effectBp.effectID = EFFECT_SMOKE_BURST; effectBp.effectID = EFFECT_SMOKE_BURST;
effect = shim_create_effect_instance(&effectBp); effect = create_effect_instance(&effectBp);
effect->numParts = numParts; effect->numParts = numParts;
data = effect->data.smokeBurst = shim_general_heap_malloc(numParts * sizeof(*data)); data = effect->data.smokeBurst = general_heap_malloc(numParts * sizeof(*data));
ASSERT(data != NULL); ASSERT(data != NULL);
shim_mem_clear(data, numParts * sizeof(*data)); mem_clear(data, numParts * sizeof(*data));
data->timeLeft = timeLeft; data->timeLeft = timeLeft;
data->lifeTime = 0; data->lifeTime = 0;
data->unk_1C = timeLeft; data->unk_1C = timeLeft;
@ -81,7 +81,7 @@ void smoke_burst_update(EffectInstance *effect) {
data->timeLeft--; data->timeLeft--;
if (data->timeLeft < 0) { if (data->timeLeft < 0) {
shim_remove_effect(effect); remove_effect(effect);
} }
} }
@ -94,7 +94,7 @@ void smoke_burst_render(EffectInstance* effect) {
renderTask.distance = 0; renderTask.distance = 0;
renderTask.renderMode = RENDER_MODE_28; renderTask.renderMode = RENDER_MODE_28;
retTask = shim_queue_render_task(&renderTask); retTask = queue_render_task(&renderTask);
retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR;
} }
@ -113,10 +113,10 @@ void smoke_burst_appendGfx(void* effect) {
gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data));
gSPDisplayList(gMainGfxPos++, dlist2); gSPDisplayList(gMainGfxPos++, dlist2);
shim_guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].currentYaw, 0.0f, data->unk_10, data->pos.x, data->pos.y, data->pos.z); guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].currentYaw, 0.0f, data->unk_10, data->pos.x, data->pos.y, data->pos.z);
shim_guRotateF(sp60, 20.0f, 0.0f, 0.0f, 1.0f); guRotateF(sp60, 20.0f, 0.0f, 0.0f, 1.0f);
shim_guMtxCatF(sp60, sp20, sp20); guMtxCatF(sp60, sp20, sp20);
shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
gDPSetPrimColor(gMainGfxPos++, 0, 0, data->rgba.r, data->rgba.g, data->rgba.b, data->rgba.a); gDPSetPrimColor(gMainGfxPos++, 0, 0, data->rgba.r, data->rgba.g, data->rgba.b, data->rgba.a);

View File

@ -42,12 +42,12 @@ void smoke_impact_main(
bp.renderUI = NULL; bp.renderUI = NULL;
bp.effectID = EFFECT_SMOKE_IMPACT; bp.effectID = EFFECT_SMOKE_IMPACT;
effect = shim_create_effect_instance(&bp); effect = create_effect_instance(&bp);
effect->numParts = arg5; effect->numParts = arg5;
part = effect->data.smokeImpact = shim_general_heap_malloc(arg5 * sizeof(*part)); part = effect->data.smokeImpact = general_heap_malloc(arg5 * sizeof(*part));
ASSERT(effect->data.smokeImpact != NULL); ASSERT(effect->data.smokeImpact != NULL);
shim_mem_clear(part, arg5 * sizeof(*part)); mem_clear(part, arg5 * sizeof(*part));
part->unk_24 = arg7; part->unk_24 = arg7;
part->unk_28 = 0; part->unk_28 = 0;
@ -67,9 +67,9 @@ void smoke_impact_main(
part->unk_04 = 0; part->unk_04 = 0;
part->unk_08 = 0; part->unk_08 = 0;
part->unk_0C = 0; part->unk_0C = 0;
part->unk_10 = shim_sin_deg(angle); part->unk_10 = sin_deg(angle);
part->unk_14 = 0; part->unk_14 = 0;
part->unk_18 = shim_cos_deg(angle); part->unk_18 = cos_deg(angle);
} }
} }
@ -86,7 +86,7 @@ void smoke_impact_update(EffectInstance* effect) {
part->unk_24--; part->unk_24--;
if (part->unk_24 < 0) { if (part->unk_24 < 0) {
shim_remove_effect(effect); remove_effect(effect);
return; return;
} }
@ -112,7 +112,7 @@ void smoke_impact_render(EffectInstance* effect) {
renderTask.distance = 0; renderTask.distance = 0;
renderTask.renderMode = RENDER_MODE_28; renderTask.renderMode = RENDER_MODE_28;
retTask = shim_queue_render_task(&renderTask); retTask = queue_render_task(&renderTask);
retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR;
} }
@ -134,10 +134,10 @@ void smoke_impact_appendGfx(void* effect) {
gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data));
gSPDisplayList(gMainGfxPos++, dlist2); gSPDisplayList(gMainGfxPos++, dlist2);
shim_guTranslateF(sp18, part->unk_04, part->unk_08, part->unk_0C); guTranslateF(sp18, part->unk_04, part->unk_08, part->unk_0C);
shim_guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f);
shim_guMtxCatF(sp58, sp18, sp98); guMtxCatF(sp58, sp18, sp98);
shim_guMtxF2L(sp98, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp98, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
@ -165,8 +165,8 @@ void smoke_impact_appendGfx(void* effect) {
part++; part++;
for (i = 1; i < ((EffectInstance*)effect)->numParts; i++, part++) { for (i = 1; i < ((EffectInstance*)effect)->numParts; i++, part++) {
shim_guTranslateF(sp18, part->unk_04, part->unk_08, part->unk_0C); guTranslateF(sp18, part->unk_04, part->unk_08, part->unk_0C);
shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
gSPDisplayList(gMainGfxPos++, dlist); gSPDisplayList(gMainGfxPos++, dlist);

View File

@ -48,12 +48,12 @@ void smoke_ring_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3) {
bpPtr->renderUI = NULL; bpPtr->renderUI = NULL;
bpPtr->effectID = EFFECT_SMOKE_RING; bpPtr->effectID = EFFECT_SMOKE_RING;
effect = shim_create_effect_instance(bpPtr); effect = create_effect_instance(bpPtr);
effect->numParts = numParts; effect->numParts = numParts;
part = effect->data.smokeRing = shim_general_heap_malloc(numParts * sizeof(*part)); part = effect->data.smokeRing = general_heap_malloc(numParts * sizeof(*part));
ASSERT(effect->data.smokeRing != NULL); ASSERT(effect->data.smokeRing != NULL);
shim_mem_clear(part, numParts * sizeof(*part)); mem_clear(part, numParts * sizeof(*part));
part->unk_38 = 0; part->unk_38 = 0;
part->unk_3C = 0; part->unk_3C = 0;
@ -74,11 +74,11 @@ void smoke_ring_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3) {
part->unk_24 = -0.16f; part->unk_24 = -0.16f;
part->unk_28 = 0; part->unk_28 = 0;
part->unk_2C = 0; part->unk_2C = 0;
part->unk_04 = -shim_sin_deg(angle) * factor; part->unk_04 = -sin_deg(angle) * factor;
part->unk_08 = -shim_cos_deg(angle) * factor; part->unk_08 = -cos_deg(angle) * factor;
part->unk_0C = 0; part->unk_0C = 0;
part->unk_30 = shim_sin_deg(angle); part->unk_30 = sin_deg(angle);
part->unk_34 = shim_cos_deg(angle); part->unk_34 = cos_deg(angle);
} }
} }
@ -92,7 +92,7 @@ void smoke_ring_update(EffectInstance* effect) {
part->unk_40 = D_E002E754[part->unk_38][part->unk_3C++]; part->unk_40 = D_E002E754[part->unk_38][part->unk_3C++];
if (part->unk_40 < 0) { if (part->unk_40 < 0) {
shim_remove_effect(effect); remove_effect(effect);
return; return;
} }
@ -115,7 +115,7 @@ void smoke_ring_render(EffectInstance* effect) {
renderTask.distance = 0; renderTask.distance = 0;
renderTask.renderMode = RENDER_MODE_28; renderTask.renderMode = RENDER_MODE_28;
retTask = shim_queue_render_task(&renderTask); retTask = queue_render_task(&renderTask);
} }
void smoke_ring_appendGfx(void* effect) { void smoke_ring_appendGfx(void* effect) {
@ -140,10 +140,10 @@ void smoke_ring_appendGfx(void* effect) {
gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data));
gSPDisplayList(gMainGfxPos++, D_09002950_32B7F0); gSPDisplayList(gMainGfxPos++, D_09002950_32B7F0);
shim_guTranslateF(sp18, part->unk_04, part->unk_08, part->unk_0C); guTranslateF(sp18, part->unk_04, part->unk_08, part->unk_0C);
shim_guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f);
shim_guMtxCatF(sp58, sp18, sp98); guMtxCatF(sp58, sp18, sp98);
shim_guMtxF2L(sp98, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp98, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
gDPSetPrimColor(gMainGfxPos++, 0, 0, 238, 220, 215, 160); gDPSetPrimColor(gMainGfxPos++, 0, 0, 238, 220, 215, 160);
@ -166,8 +166,8 @@ void smoke_ring_appendGfx(void* effect) {
part++; part++;
for (i = 1; i < ((EffectInstance*)effect)->numParts; i++, part++) { for (i = 1; i < ((EffectInstance*)effect)->numParts; i++, part++) {
shim_guTranslateF(sp18, part->unk_04, part->unk_08, part->unk_0C); guTranslateF(sp18, part->unk_04, part->unk_08, part->unk_0C);
shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
gSPDisplayList(gMainGfxPos++, dlist); gSPDisplayList(gMainGfxPos++, dlist);

View File

@ -23,10 +23,10 @@ EffectInstance* snaking_static_main(s32 arg0, f32 posX, f32 posY, f32 posZ, f32
effectBp.renderUI = NULL; effectBp.renderUI = NULL;
effectBp.effectID = EFFECT_SNAKING_STATIC; effectBp.effectID = EFFECT_SNAKING_STATIC;
effect = shim_create_effect_instance(&effectBp); effect = create_effect_instance(&effectBp);
effect->numParts = numParts; effect->numParts = numParts;
data = effect->data.snakingStatic = shim_general_heap_malloc(numParts * sizeof(*data)); data = effect->data.snakingStatic = general_heap_malloc(numParts * sizeof(*data));
ASSERT(data != NULL); ASSERT(data != NULL);
data->unk_00 = arg0; data->unk_00 = arg0;
@ -94,7 +94,7 @@ void snaking_static_update(EffectInstance* effect) {
lifeTime = data->lifeTime; lifeTime = data->lifeTime;
if (timeLeft < 0) { if (timeLeft < 0) {
shim_remove_effect(effect); remove_effect(effect);
return; return;
} }
if (timeLeft < 16) { if (timeLeft < 16) {
@ -107,29 +107,29 @@ void snaking_static_update(EffectInstance* effect) {
data++; data++;
for (i = 1; i < effect->numParts; i += 3, data += 3) { for (i = 1; i < effect->numParts; i += 3, data += 3) {
if (data->lifeTime >= data->timeLeft) { if (data->lifeTime >= data->timeLeft) {
data->timeLeft = shim_rand_int(50) + 20; data->timeLeft = rand_int(50) + 20;
data->lifeTime = 0; data->lifeTime = 0;
data->unk_3C = shim_rand_int(360); data->unk_3C = rand_int(360);
data->pos.x = 0.0f; data->pos.x = 0.0f;
data->pos.y = 0.0f; data->pos.y = 0.0f;
} }
if (shim_rand_int(100) < 51) { if (rand_int(100) < 51) {
tempPosX = data->pos.x; tempPosX = data->pos.x;
tempPosY = data->pos.y; tempPosY = data->pos.y;
tempOffsetX = shim_rand_int(16) - 8; tempOffsetX = rand_int(16) - 8;
tempOffsetY = shim_rand_int(16) - 8; tempOffsetY = rand_int(16) - 8;
data[2] = data[1]; data[2] = data[1];
data[1] = data[0]; data[1] = data[0];
data->pos.x = tempPosX + tempOffsetX; data->pos.x = tempPosX + tempOffsetX;
data->pos.y = tempPosY + tempOffsetY; data->pos.y = tempPosY + tempOffsetY;
data->unk_3C = shim_atan2(0.0f, 0.0f, tempOffsetX, tempOffsetY); data->unk_3C = atan2(0.0f, 0.0f, tempOffsetX, tempOffsetY);
if (tempOffsetX != 0.0f || tempOffsetY != 0.0f) { if (tempOffsetX != 0.0f || tempOffsetY != 0.0f) {
data->unk_34 = shim_sqrtf((tempOffsetX * tempOffsetX) + (tempOffsetY * tempOffsetY)); data->unk_34 = sqrtf((tempOffsetX * tempOffsetX) + (tempOffsetY * tempOffsetY));
} else { } else {
data->unk_34 = 0.0f; data->unk_34 = 0.0f;
} }
} }
data->unk_24 = (shim_sin_deg(((data->lifeTime * 180) / data->timeLeft)) * 1024.0f); data->unk_24 = (sin_deg(((data->lifeTime * 180) / data->timeLeft)) * 1024.0f);
if (data->unk_24 >= 256) { if (data->unk_24 >= 256) {
data->unk_24 = 255; data->unk_24 = 255;
} }
@ -138,7 +138,7 @@ void snaking_static_update(EffectInstance* effect) {
data = effect->data.snakingStatic; data = effect->data.snakingStatic;
data++; data++;
for (i = 1; i < effect->numParts; i++, data++) { for (i = 1; i < effect->numParts; i++, data++) {
data->unk_40 = shim_rand_int(15); data->unk_40 = rand_int(15);
} }
} }
@ -151,7 +151,7 @@ void snaking_static_render(EffectInstance* effect) {
renderTask.distance = 10; renderTask.distance = 10;
renderTask.renderMode = RENDER_MODE_2D; renderTask.renderMode = RENDER_MODE_2D;
retTask = shim_queue_render_task(&renderTask); retTask = queue_render_task(&renderTask);
retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR;
} }
@ -173,10 +173,10 @@ void snaking_static_appendGfx(void* effect) {
gDPPipeSync(gMainGfxPos++); gDPPipeSync(gMainGfxPos++);
gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data));
shim_guTranslateF(sp18, data->pos.x, data->pos.y, data->pos.z); guTranslateF(sp18, data->pos.x, data->pos.y, data->pos.z);
shim_guScaleF(sp58, data->unk_38, data->unk_38, data->unk_38); guScaleF(sp58, data->unk_38, data->unk_38, data->unk_38);
shim_guMtxCatF(sp58, sp18, sp18); guMtxCatF(sp58, sp18, sp18);
shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++],
G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
@ -187,12 +187,12 @@ void snaking_static_appendGfx(void* effect) {
data++; data++;
for (i = 1; i < ((EffectInstance*)effect)->numParts; i++, data++) { for (i = 1; i < ((EffectInstance*)effect)->numParts; i++, data++) {
gDPSetPrimColor(gMainGfxPos++, 0, 0, primR, primG, primB, (data->unk_24 * unk_24) / 255); gDPSetPrimColor(gMainGfxPos++, 0, 0, primR, primG, primB, (data->unk_24 * unk_24) / 255);
shim_guTranslateF(sp18, data->pos.x, data->pos.y, 0.0f); guTranslateF(sp18, data->pos.x, data->pos.y, 0.0f);
shim_guRotateF(sp58, data->unk_3C, 0.0f, 0.0f, 1.0f); guRotateF(sp58, data->unk_3C, 0.0f, 0.0f, 1.0f);
shim_guMtxCatF(sp58, sp18, sp18); guMtxCatF(sp58, sp18, sp18);
shim_guScaleF(sp58, data->unk_34 * 0.0625f, data->unk_34 * 0.0625f, 1.0f); guScaleF(sp58, data->unk_34 * 0.0625f, data->unk_34 * 0.0625f, 1.0f);
shim_guMtxCatF(sp58, sp18, sp18); guMtxCatF(sp58, sp18, sp18);
shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++],
G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);

View File

@ -37,10 +37,10 @@ EffectInstance* snowfall_main(s32 arg0, s32 arg1) {
effectBp.renderUI = NULL; effectBp.renderUI = NULL;
effectBp.effectID = EFFECT_SNOWFALL; effectBp.effectID = EFFECT_SNOWFALL;
effect = shim_create_effect_instance(&effectBp); effect = create_effect_instance(&effectBp);
effect->numParts = numParts; effect->numParts = numParts;
data = effect->data.snowfall = shim_general_heap_malloc(numParts * sizeof(*data)); data = effect->data.snowfall = general_heap_malloc(numParts * sizeof(*data));
ASSERT(data != NULL); ASSERT(data != NULL);
data->timeLeft = 100; data->timeLeft = 100;
@ -123,7 +123,7 @@ void snowfall_update(EffectInstance* effect) {
data->timeLeft--; data->timeLeft--;
} }
if (data->timeLeft < 0) { if (data->timeLeft < 0) {
shim_remove_effect(effect); remove_effect(effect);
return; return;
} }
@ -156,7 +156,7 @@ void snowfall_render(EffectInstance* effect) {
renderTask.distance = 0; renderTask.distance = 0;
renderTask.renderMode = RENDER_MODE_2D; renderTask.renderMode = RENDER_MODE_2D;
retTask = shim_queue_render_task(&renderTask); retTask = queue_render_task(&renderTask);
retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR;
} }
@ -178,7 +178,7 @@ void snowfall_appendGfx(void* effect) {
unk_2C = data->unk_2C; unk_2C = data->unk_2C;
dlist = D_E008AA50[data->unk_04]; dlist = D_E008AA50[data->unk_04];
if (*gBackgroundFogModePtr == 1) { if (*gBackgroundFogModePtr == 1) {
shim_get_background_color_blend(&bgRGB, &bgRGB, &bgRGB, &bgAlpha); get_background_color_blend(&bgRGB, &bgRGB, &bgRGB, &bgAlpha);
unk_28 = 255 - bgAlpha; unk_28 = 255 - bgAlpha;
} }
@ -189,16 +189,16 @@ void snowfall_appendGfx(void* effect) {
gSPDisplayList(gMainGfxPos++, D_09000C00_38DC70); gSPDisplayList(gMainGfxPos++, D_09000C00_38DC70);
gDPSetPrimColor(gMainGfxPos++, 0, 0, 255, 255, 255, unk_28); gDPSetPrimColor(gMainGfxPos++, 0, 0, 255, 255, 255, unk_28);
shim_guRotateF(sp18, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); guRotateF(sp18, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f);
shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]);
mtx = &gDisplayContext->matrixStack[gMatrixListPos++]; mtx = &gDisplayContext->matrixStack[gMatrixListPos++];
data++; data++;
for (i = 0; i < unk_2C; i++, data++) { for (i = 0; i < unk_2C; i++, data++) {
if (data->unk_30 <= 0 && data->unk_28 != 0) { if (data->unk_30 <= 0 && data->unk_28 != 0) {
shim_guTranslateF(sp18, data->unk_08, data->unk_0C, data->unk_10); guTranslateF(sp18, data->unk_08, data->unk_0C, data->unk_10);
shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++],
G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);

View File

@ -25,9 +25,9 @@ void snowflake_main(f32 x, f32 y, f32 z, s32 arg3, s32 arg4) {
bp.renderUI = NULL; bp.renderUI = NULL;
bp.effectID = EFFECT_SNOWFLAKE; bp.effectID = EFFECT_SNOWFLAKE;
effect = shim_create_effect_instance(&bp); effect = create_effect_instance(&bp);
effect->numParts = 1; effect->numParts = 1;
part = effect->data.snowflake = shim_general_heap_malloc(numParts * sizeof(*part)); part = effect->data.snowflake = general_heap_malloc(numParts * sizeof(*part));
ASSERT(effect->data.snowflake != NULL); ASSERT(effect->data.snowflake != NULL);
@ -62,7 +62,7 @@ void snowflake_update(EffectInstance* effect) {
data->unk_28--; data->unk_28--;
if (data->unk_28 < 0) { if (data->unk_28 < 0) {
shim_remove_effect(effect); remove_effect(effect);
return; return;
} }
@ -113,7 +113,7 @@ void snowflake_render(EffectInstance* effect) {
renderTaskPtr->distance = 0; renderTaskPtr->distance = 0;
renderTaskPtr->renderMode = RENDER_MODE_2D; renderTaskPtr->renderMode = RENDER_MODE_2D;
retTask = shim_queue_render_task(renderTaskPtr); retTask = queue_render_task(renderTaskPtr);
retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR;
} }
@ -126,18 +126,18 @@ void snowflake_appendGfx(void* effect) {
gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(effectTemp->graphics->data)); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(effectTemp->graphics->data));
gSPDisplayList(gMainGfxPos++, D_09000900_331800); gSPDisplayList(gMainGfxPos++, D_09000900_331800);
shim_guTranslateF(sp18, data->pos.x, data->pos.y, data->pos.z); guTranslateF(sp18, data->pos.x, data->pos.y, data->pos.z);
shim_guRotateF(spD8, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); guRotateF(spD8, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f);
shim_guMtxCatF(spD8, sp18, sp118); guMtxCatF(spD8, sp18, sp118);
shim_guMtxF2L(sp118, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp118, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
gDPSetPrimColor(gMainGfxPos++, 0, 0, 0, 0, 0, 255); gDPSetPrimColor(gMainGfxPos++, 0, 0, 0, 0, 0, 255);
shim_guRotateF(sp58, data->unk_18, 1.0f, 0.0f, 0.0f); guRotateF(sp58, data->unk_18, 1.0f, 0.0f, 0.0f);
shim_guRotateF(sp98, data->unk_1C, 0.0f, 1.0f, 0.0f); guRotateF(sp98, data->unk_1C, 0.0f, 1.0f, 0.0f);
shim_guMtxCatF(sp58, sp98, sp118); guMtxCatF(sp58, sp98, sp118);
shim_guMtxF2L(sp118, &gDisplayContext->matrixStack[gMatrixListPos]); guMtxF2L(sp118, &gDisplayContext->matrixStack[gMatrixListPos]);
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
gSPDisplayList(gMainGfxPos++, D_090009E8_3318E8); gSPDisplayList(gMainGfxPos++, D_090009E8_3318E8);

Some files were not shown because too many files have changed in this diff Show More