diff --git a/include/effect_shims.h b/include/effect_shims.h new file mode 100644 index 00000000000..5a2d68ee814 --- /dev/null +++ b/include/effect_shims.h @@ -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 diff --git a/include/effects.h b/include/effects.h index 575a4100b99..b9575b6897d 100644 --- a/include/effects.h +++ b/include/effects.h @@ -2951,4 +2951,132 @@ EffectInstance* fx_86(s32, f32, f32, f32, f32, 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 diff --git a/include/effects_internal.h b/include/effects_internal.h index 48734eaaed2..b2264b81b52 100644 --- a/include/effects_internal.h +++ b/include/effects_internal.h @@ -6,168 +6,6 @@ s32 effect_rand_int(s32); s32 func_E0200044(s32, s32); -EffectInstance* shim_create_effect_instance(EffectBlueprint* effectBp); -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); +#include "effect_shims.h" #endif diff --git a/src/effects.c b/src/effects.c index dc8e4de443b..5f0c8ff4c84 100644 --- a/src/effects.c +++ b/src/effects.c @@ -1,6 +1,5 @@ #include "common.h" #include "effects.h" -#include "effects_internal.h" #include "ld_addrs.h" typedef s32 TlbEntry[0x1000 / 4]; diff --git a/src/effects/attack_result_text.c b/src/effects/attack_result_text.c index 4970f879778..54193f57dff 100644 --- a/src/effects/attack_result_text.c +++ b/src/effects/attack_result_text.c @@ -47,10 +47,10 @@ EffectInstance* attack_result_text_main(s32 type, f32 posX, f32 posY, f32 posZ, bp.renderUI = func_E0090428; bp.effectID = EFFECT_ATTACK_RESULT_TEXT; - effect = shim_create_effect_instance(&bp); + effect = create_effect_instance(&bp); 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); @@ -72,8 +72,8 @@ EffectInstance* attack_result_text_main(s32 type, f32 posX, f32 posY, f32 posZ, data->pos.x = posX; data->pos.y = posY; data->pos.z = posZ; - data->vel.x = 2.0f * (-shim_sin_deg(30.0f) * appearVel); - data->vel.y = 2.0f * (shim_cos_deg(30.0f) * appearVel); + data->vel.x = 2.0f * (-sin_deg(30.0f) * appearVel); + data->vel.y = 2.0f * (cos_deg(30.0f) * appearVel); } else { data->pos.x = -100.0f; data->pos.y = 40.0f; @@ -107,7 +107,7 @@ void attack_result_text_update(EffectInstance* effect) { if (data->timeLeft < 0) { data->isVisible = FALSE; data->timeLeft = -1; - shim_remove_effect(effect); + remove_effect(effect); return; } @@ -192,12 +192,12 @@ void func_E0090444(EffectInstance* effect) { gDPSetPrimDepth(gMainGfxPos++, z, 0); if (type < 5) { - shim_guTranslateF(mtxA, data->pos.x, data->pos.y, data->pos.z); - shim_guRotateF(mtxB, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); - shim_guMtxCatF(mtxB, mtxA, mtxA); - shim_guScaleF(mtxB, scale, scale, 1.0f); - shim_guMtxCatF(mtxB, mtxA, mtxA); - shim_guMtxF2L(mtxA, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(mtxA, data->pos.x, data->pos.y, data->pos.z); + guRotateF(mtxB, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guMtxCatF(mtxB, mtxA, mtxA); + guScaleF(mtxB, scale, scale, 1.0f); + guMtxCatF(mtxB, mtxA, mtxA); + guMtxF2L(mtxA, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gDPSetPrimColor(gMainGfxPos++, 0, 0, 255, 255, 255, data->alpha); diff --git a/src/effects/aura.c b/src/effects/aura.c index f960b562332..a961f933868 100644 --- a/src/effects/aura.c +++ b/src/effects/aura.c @@ -39,10 +39,10 @@ void aura_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, EffectInstance* bp.renderUI = NULL; bp.effectID = EFFECT_AURA; - effect = shim_create_effect_instance(bpPtr); + effect = create_effect_instance(bpPtr); 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); @@ -177,7 +177,7 @@ void aura_update(EffectInstance* effect) { } if (data->fadeTime < 0) { - shim_remove_effect(effect); + remove_effect(effect); return; } @@ -253,7 +253,7 @@ void aura_render(EffectInstance* effect) { renderTask.distance = 0; renderTask.renderMode = RENDER_MODE_2D; - retTask = shim_queue_render_task(&renderTask); + retTask = queue_render_task(&renderTask); 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)); 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) { - shim_guRotateF(tempMtx, data->renderYaw, 0.0f, 1.0f, 0.0f); + guRotateF(tempMtx, data->renderYaw, 0.0f, 1.0f, 0.0f); } 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); - shim_guScaleF(tempMtx, data->scale.x, data->scale.y, 1.0f); - shim_guMtxCatF(tempMtx, transformMtx, transformMtx); + guMtxCatF(tempMtx, translateMtx, transformMtx); + guScaleF(tempMtx, data->scale.x, data->scale.y, 1.0f); + guMtxCatF(tempMtx, transformMtx, transformMtx); if (type == 0) { - shim_guTranslateF(tempMtx, (-(data->scale.x - data->unk_24) / data->unk_24) * 10.0f, 0.0f, 0.0f); - shim_guMtxCatF(tempMtx, transformMtx, transformMtx); + guTranslateF(tempMtx, (-(data->scale.x - data->unk_24) / data->unk_24) * 10.0f, 0.0f, 0.0f); + 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); gSPDisplayList(gMainGfxPos++, D_E0076EC0[type]); 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) { - shim_guRotateF(tempMtx, data->renderYaw, 0.0f, 1.0f, 0.0f); + guRotateF(tempMtx, data->renderYaw, 0.0f, 1.0f, 0.0f); } 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); - shim_guScaleF(tempMtx, data->scale.x, data->scale.y, 1.0f); - shim_guMtxCatF(tempMtx, transformMtx, transformMtx); + guMtxCatF(tempMtx, translateMtx, transformMtx); + guScaleF(tempMtx, data->scale.x, data->scale.y, 1.0f); + guMtxCatF(tempMtx, transformMtx, transformMtx); if (type == 0) { - shim_guTranslateF(tempMtx, (-(data->scale.x - data->unk_24) / data->unk_24) * 10.0f, 0.0f, 0.0f); - shim_guMtxCatF(tempMtx, transformMtx, transformMtx); + guTranslateF(tempMtx, (-(data->scale.x - data->unk_24) / data->unk_24) * 10.0f, 0.0f, 0.0f); + 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); gSPDisplayList(gMainGfxPos++, D_E0076EB0[type]); diff --git a/src/effects/balloon.c b/src/effects/balloon.c index dac4782c860..6409abc5e3a 100644 --- a/src/effects/balloon.c +++ b/src/effects/balloon.c @@ -27,10 +27,10 @@ EffectInstance* balloon_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, s bp.renderUI = NULL; bp.effectID = EFFECT_BALLOON; - effect = shim_create_effect_instance(&bp); + effect = create_effect_instance(&bp); effect->numParts = numParts; - data = shim_general_heap_malloc(numParts * sizeof(*data)); + data = general_heap_malloc(numParts * sizeof(*data)); effect->data.balloon = data; part = data; @@ -59,7 +59,7 @@ void balloon_update(EffectInstance* effect) { part->unk_20++; if (part->unk_1C < 0) { - shim_remove_effect(effect); + remove_effect(effect); return; } @@ -79,7 +79,7 @@ void balloon_render(EffectInstance* effect) { renderTask.distance = 0; renderTask.renderMode = RENDER_MODE_SURFACE_OPA; - retTask = shim_queue_render_task(&renderTask); + retTask = queue_render_task(&renderTask); retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; } @@ -92,12 +92,12 @@ void balloon_appendGfx(void* effect) { gDPPipeSync(gMainGfxPos++); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); - shim_guTranslateF(sp18, data->unk_04, data->unk_08, data->unk_0C); - shim_guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); - shim_guMtxCatF(sp58, sp18, sp18); - shim_guScaleF(sp58, data->unk_18, data->unk_18, 1.0f); - shim_guMtxCatF(sp58, sp18, sp18); - shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(sp18, data->unk_04, data->unk_08, data->unk_0C); + guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guMtxCatF(sp58, sp18, sp18); + guScaleF(sp58, data->unk_18, data->unk_18, 1.0f); + guMtxCatF(sp58, sp18, sp18); + guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); diff --git a/src/effects/big_smoke_puff.c b/src/effects/big_smoke_puff.c index 412f13bc3da..8706f8cca82 100644 --- a/src/effects/big_smoke_puff.c +++ b/src/effects/big_smoke_puff.c @@ -42,10 +42,10 @@ void big_smoke_puff_main(f32 x, f32 y, f32 z) { bp.renderUI = NULL; bp.effectID = EFFECT_BIG_SMOKE_PUFF; - effect = shim_create_effect_instance(&bp); + effect = create_effect_instance(&bp); effect->numParts = numParts; - data = shim_general_heap_malloc(effect->numParts * sizeof(*data)); + data = general_heap_malloc(effect->numParts * sizeof(*data)); effect->data.bigSmokePuff = data; ASSERT(data != NULL); @@ -63,8 +63,8 @@ void big_smoke_puff_main(f32 x, f32 y, f32 z) { theta = D_E0002760[i] + 90.0f; temp_f20 = 2.0 * D_E0002788[i]; - sinTheta = shim_sin_deg(theta); - cosTheta = shim_cos_deg(theta); + sinTheta = sin_deg(theta); + cosTheta = cos_deg(theta); data->unk_20 = temp_f20 * sinTheta; data->unk_24 = -temp_f20 * cosTheta; @@ -102,7 +102,7 @@ void big_smoke_puff_update(EffectInstance* effect) { } if (!cond) { - shim_remove_effect(effect); + remove_effect(effect); } } @@ -115,7 +115,7 @@ void big_smoke_puff_render(EffectInstance* effect) { renderTask.distance = 0; renderTask.renderMode = RENDER_MODE_2D; - retTask = shim_queue_render_task(&renderTask); + retTask = queue_render_task(&renderTask); retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; } @@ -128,8 +128,8 @@ void big_smoke_puff_appendGfx(void* effect) { gDPPipeSync(gMainGfxPos++); 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); - shim_guMtxF2L(mtx, &gDisplayContext->matrixStack[gMatrixListPos]); + guPositionF(mtx, 0.0f, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, data->x, data->y, data->z); + guMtxF2L(mtx, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &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; } - 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); - shim_guMtxF2L(mtx, &gDisplayContext->matrixStack[gMatrixListPos]); + guMtxF2L(mtx, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &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; dlist = sDlists[ARRAY_COUNT(sDlists) - 1]; } 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; dlist = sDlists[(s32)temp]; @@ -176,5 +176,5 @@ void big_smoke_puff_appendGfx(void* effect) { } void func_E0002738(EffectInstance* effect) { - shim_remove_effect(effect); + remove_effect(effect); } diff --git a/src/effects/big_snowflakes.c b/src/effects/big_snowflakes.c index e41e05a99ab..ef6219a512f 100644 --- a/src/effects/big_snowflakes.c +++ b/src/effects/big_snowflakes.c @@ -27,15 +27,15 @@ void big_snowflakes_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3) { bp.renderUI = NULL; bp.effectID = EFFECT_BIG_SNOWFLAKES; - effect = shim_create_effect_instance(&bp); + effect = create_effect_instance(&bp); effect->numParts = numParts; - data = shim_general_heap_malloc(effect->numParts * sizeof(*data)); + data = general_heap_malloc(effect->numParts * sizeof(*data)); effect->data.bigSnowflakes = data; ASSERT(data != NULL); - shim_mem_clear(data, numParts * sizeof(*data)); + mem_clear(data, numParts * sizeof(*data)); data->unk_00 = arg0; data->unk_04 = arg1; data->unk_08 = arg2; @@ -68,7 +68,7 @@ void big_snowflakes_update(EffectInstance* effect) { data->unk_28--; data->unk_2C++; if (data->unk_28 < 0) { - shim_remove_effect(effect); + remove_effect(effect); return; } @@ -82,13 +82,13 @@ void big_snowflakes_update(EffectInstance* effect) { 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_10 *= 0.92; data->unk_14 += -0.05f; data->unk_1C += func_E0200044(50, unk_28 + (i * 20)) - 25; - data->unk_18 += shim_sin_deg(data->unk_1C) * 10.0f; - data->unk_20 += shim_cos_deg(data->unk_1C * 0.5f) * 10.0f; + data->unk_18 += sin_deg(data->unk_1C) * 10.0f; + data->unk_20 += cos_deg(data->unk_1C * 0.5f) * 10.0f; data->unk_04 += data->unk_10; data->unk_08 += data->unk_14; } @@ -103,7 +103,7 @@ void big_snowflakes_render(EffectInstance* effect) { renderTask.distance = 0; renderTask.renderMode = RENDER_MODE_2D; - retTask = shim_queue_render_task(&renderTask); + retTask = queue_render_task(&renderTask); retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; } @@ -119,24 +119,24 @@ void big_snowflakes_appendGfx(void* effect) { gSPDisplayList(gMainGfxPos++, dlist); gDPSetPrimColor(gMainGfxPos++, 0, 0, 20, 100, 20, data->unk_24); - shim_guTranslateF(sp18, data->unk_04, data->unk_08, data->unk_0C); - shim_guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); - shim_guMtxCatF(sp58, sp18, sp98); + guTranslateF(sp18, data->unk_04, data->unk_08, data->unk_0C); + guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guMtxCatF(sp58, sp18, sp98); 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)) - shim_guTranslateF(sp58, data->unk_04, data->unk_08, data->unk_0C); - shim_guMtxCatF(sp58, sp98, sp18); + guTranslateF(sp58, data->unk_04, data->unk_08, data->unk_0C); + guMtxCatF(sp58, sp98, sp18); if (!(i & 1)) { - shim_guRotateF(sp58, data->unk_18, 0.0f, 0.0f, 1.0f); - shim_guMtxCatF(sp58, sp18, sp18); - shim_guRotateF(sp58, data->unk_20, 0.0f, 1.0f, 0.0f); - shim_guMtxCatF(sp58, sp18, sp18); + guRotateF(sp58, data->unk_18, 0.0f, 0.0f, 1.0f); + guMtxCatF(sp58, sp18, sp18); + guRotateF(sp58, data->unk_20, 0.0f, 1.0f, 0.0f); + 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); gSPDisplayList(gMainGfxPos++, dlist2); diff --git a/src/effects/blast.c b/src/effects/blast.c index 26162cf8434..52b96bbdecf 100644 --- a/src/effects/blast.c +++ b/src/effects/blast.c @@ -39,14 +39,14 @@ void blast_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, s32 arg5) { bp.renderUI = NULL; bp.effectID = EFFECT_BLAST; - effect = shim_create_effect_instance(bpPtr); + effect = create_effect_instance(bpPtr); 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); - shim_mem_clear(part, numParts * sizeof(*part)); + mem_clear(part, numParts * sizeof(*part)); part->timeLeft = arg5; part->unk_18 = 0; @@ -72,7 +72,7 @@ void blast_update(EffectInstance* effect) { part->timeLeft--; if (part->timeLeft < 0) { - shim_remove_effect(effect); + remove_effect(effect); return; } @@ -88,7 +88,7 @@ void blast_render(EffectInstance* effect) { renderTask.distance = 0; renderTask.renderMode = RENDER_MODE_28; - retTask = shim_queue_render_task(&renderTask); + retTask = queue_render_task(&renderTask); retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; } @@ -107,14 +107,14 @@ void blast_appendGfx(void *effect) { gSPDisplayList(gMainGfxPos++, D_09001300_37ECD0); gSPDisplayList(gMainGfxPos++, D_E007C510[unk_20]); - shim_guTranslateF(sp18, data->pos.x, data->pos.y, data->pos.z); - shim_guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); - shim_guMtxCatF(sp58, sp18, sp98); - shim_guScaleF(sp18, data->unk_10, data->unk_10, 1.0f); - shim_guMtxCatF(sp18, sp98, sp98); - shim_guRotateF(sp18, data->unk_24, 0.0f, 0.0f, 1.0f); - shim_guMtxCatF(sp18, sp98, sp98); - shim_guMtxF2L(sp98, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(sp18, data->pos.x, data->pos.y, data->pos.z); + guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guMtxCatF(sp58, sp18, sp98); + guScaleF(sp18, data->unk_10, data->unk_10, 1.0f); + guMtxCatF(sp18, sp98, sp98); + guRotateF(sp18, data->unk_24, 0.0f, 0.0f, 1.0f); + guMtxCatF(sp18, sp98, sp98); + guMtxF2L(sp98, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); diff --git a/src/effects/bombette_breaking.c b/src/effects/bombette_breaking.c index b6d9531c924..f3d1bb3ba0f 100644 --- a/src/effects/bombette_breaking.c +++ b/src/effects/bombette_breaking.c @@ -70,9 +70,9 @@ EffectInstance* bombette_breaking_main(s32 type, s32 modelID, s32 treeIndex, f32 f40 *= 0.5; numParts = (xParts * yParts * zParts) + 1; - effect = shim_create_effect_instance(bpPtr); + effect = create_effect_instance(bpPtr); 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); data->unk_04 = -sizeY * 0.5; @@ -152,7 +152,7 @@ void bombette_breaking_update(EffectInstance* effect) { data->timeLeft--; if (data->timeLeft < 0) { - shim_remove_effect(effect); + remove_effect(effect); return; } @@ -198,7 +198,7 @@ void bombette_breaking_render(EffectInstance* effect) { renderTask.distance = 0; renderTask.renderMode = RENDER_MODE_28; - retTask = shim_queue_render_task(&renderTask); + retTask = queue_render_task(&renderTask); retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; } @@ -218,17 +218,17 @@ void bombette_breaking_appendGfx(void* effect) { gDPPipeSync(gMainGfxPos++); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); - shim_guTranslateF(sp20, data->center.x, data->center.y, data->center.z); - shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(sp20, data->center.x, data->center.y, data->center.z); + guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); 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++; 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); - 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); gSPDisplayList(gMainGfxPos++, D_E0084E1C[type]); @@ -241,9 +241,9 @@ void bombette_breaking_appendGfx(void* effect) { data++; for (i = 1; i < ((EffectInstance*)effect)->numParts; i++, data++) { 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); - 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); gSPDisplayList(gMainGfxPos++, sp60); diff --git a/src/effects/breaking_junk.c b/src/effects/breaking_junk.c index fd582453fb9..111b4d24601 100644 --- a/src/effects/breaking_junk.c +++ b/src/effects/breaking_junk.c @@ -32,10 +32,10 @@ EffectInstance* breaking_junk_main(s32 arg0, f32 x, f32 y, f32 z, f32 scale, s32 bp.renderUI = NULL; bp.effectID = EFFECT_BREAKING_JUNK; - effect = shim_create_effect_instance(bpPtr); + effect = create_effect_instance(bpPtr); 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); @@ -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.y = y; data->pos.z = z; - data->vel.x = (shim_rand_int(10) - 5) * 0.5; - data->vel.y = (shim_rand_int(5) + 1) * 0.8; - data->vel.z = (shim_rand_int(10) - 5) * 0.5; + data->vel.x = (rand_int(10) - 5) * 0.5; + data->vel.y = (rand_int(5) + 1) * 0.8; + data->vel.z = (rand_int(10) - 5) * 0.5; data->scale = scale; - data->primR = data->envR = shim_rand_int(255); - g = shim_rand_int(255 - data->envR); + data->primR = data->envR = rand_int(255); + g = rand_int(255 - data->envR); data->primG = data->envG = g; data->primB = data->envB = (255 - g) - data->envR; 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->envG = data->envG * 0.6; data->envB = data->envB * 0.6; - data->rot = shim_rand_int(359); + data->rot = rand_int(359); } return effect; } @@ -97,7 +97,7 @@ void breaking_junk_update(EffectInstance* effect) { data->lifeTime++; if (data->timeLeft < 0) { - shim_remove_effect(effect); + remove_effect(effect); return; } @@ -127,7 +127,7 @@ void breaking_junk_render(EffectInstance* effect) { renderTask.distance = 10; renderTask.renderMode = RENDER_MODE_2D; - retTask = shim_queue_render_task(&renderTask); + retTask = queue_render_task(&renderTask); retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; } @@ -142,10 +142,10 @@ void breaking_junk_appendGfx(void* effect) { gSPDisplayList(gMainGfxPos++, D_E01187C0[0]); 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); - shim_guRotateF(sp60, data->rot, 0.0f, 0.0f, 1.0f); - shim_guMtxCatF(sp60, sp20, sp20); - shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); + guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].currentYaw, 0.0f, data->scale * 0.5, data->pos.x, data->pos.y, data->pos.z); + guRotateF(sp60, data->rot, 0.0f, 0.0f, 1.0f); + guMtxCatF(sp60, sp20, sp20); + guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); 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); gDPSetEnvColor(gMainGfxPos++, data->envR, data->envG, data->envB, data->envA); diff --git a/src/effects/bulb_glow.c b/src/effects/bulb_glow.c index 28d7d4bf8be..f047e12115b 100644 --- a/src/effects/bulb_glow.c +++ b/src/effects/bulb_glow.c @@ -60,9 +60,9 @@ void bulb_glow_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, EffectInst bp.renderUI = NULL; bp.effectID = EFFECT_BULB_GLOW; - effect = shim_create_effect_instance(&bp); + effect = create_effect_instance(&bp); 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); 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; } - data->unk_20 = shim_rand_int(7); + data->unk_20 = rand_int(7); *outEffect = effect; } @@ -105,7 +105,7 @@ void bulb_glow_update(EffectInstance* effect) { data->unk_14--; } if (data->unk_14 < 0) { - shim_remove_effect(effect); + remove_effect(effect); return; } @@ -144,7 +144,7 @@ void bulb_glow_render(EffectInstance* effect) { renderTaskPtr->renderMode = RENDER_MODE_2D; } - retTask = shim_queue_render_task(renderTaskPtr); + retTask = queue_render_task(renderTaskPtr); retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; } @@ -189,7 +189,7 @@ void bulb_glow_appendGfx(void* effect) { glowExtent = temp_s1->unk_10; rectHeight = temp_s1->unk_14; - isPointVisible = shim_is_point_visible(data->pos.x, data->pos.y, data->pos.z, data->unk_1C, ¢erX, ¢erY); + isPointVisible = is_point_visible(data->pos.x, data->pos.y, data->pos.z, data->unk_1C, ¢erX, ¢erY); if (temp_s2 == 5) { isPointVisible = TRUE; diff --git a/src/effects/butterflies.c b/src/effects/butterflies.c index 1a666dfa88b..394ddea2811 100644 --- a/src/effects/butterflies.c +++ b/src/effects/butterflies.c @@ -43,9 +43,9 @@ EffectInstance* butterflies_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3) { bp.renderUI = NULL; bp.effectID = EFFECT_BUTTERFLIES; - effect = shim_create_effect_instance(&bp); + effect = create_effect_instance(&bp); 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); part->unk_04 = 1000; @@ -93,7 +93,7 @@ void butterflies_update(EffectInstance* effect) { } temp_s0->unk_08 += 1; if (temp_s0->unk_04 < 0) { - shim_remove_effect(effect); + remove_effect(effect); return; } if (temp_s0->unk_04 < 0x10) { @@ -104,11 +104,11 @@ void butterflies_update(EffectInstance* effect) { if (temp_s0->unk_30 <= 0) { s32 t; - temp_f20 = shim_rand_int(359); - temp_f24 = temp_s0->unk_18 + (temp_s0->unk_34 * shim_sin_deg(temp_f20)); - temp_f22 = temp_s0->unk_1C + shim_rand_int(temp_s0->unk_38); - temp_f20_2 = temp_s0->unk_20 + (temp_s0->unk_34 * shim_cos_deg(temp_f20)); - t = shim_rand_int(100) + 10; + temp_f20 = rand_int(359); + temp_f24 = temp_s0->unk_18 + (temp_s0->unk_34 * sin_deg(temp_f20)); + temp_f22 = temp_s0->unk_1C + rand_int(temp_s0->unk_38); + temp_f20_2 = temp_s0->unk_20 + (temp_s0->unk_34 * cos_deg(temp_f20)); + t = rand_int(100) + 10; temp_f4 = temp_s0->unk_0C; temp_f6 = temp_s0->unk_10; 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); 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_f22 *= var_f12; @@ -136,7 +136,7 @@ void butterflies_update(EffectInstance* effect) { temp_s0->unk_3C = var_f24; temp_s0->unk_40 = var_f22; 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; if (temp_s0->unk_2C >= 30) { @@ -156,7 +156,7 @@ void butterflies_render(EffectInstance* effect) { renderTask.distance = 0; renderTask.renderMode = RENDER_MODE_2D; - retTask = shim_queue_render_task(&renderTask); + retTask = queue_render_task(&renderTask); retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; } @@ -173,12 +173,12 @@ void butterflies_appendGfx(void* effect) { gDPPipeSync(gMainGfxPos++); 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); - shim_guRotateF(sp58, data->unk_28, 0.0f, 1.0f, 0.0f); - shim_guMtxCatF(sp58, sp18, sp18); - shim_guScaleF(sp58, 0.02f, 0.02f, 0.02f); - shim_guMtxCatF(sp58, sp18, sp18); - shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(sp18, data->unk_0C, data->unk_10 + D_E00AA6EC[data->unk_2C] * 0.3f, data->unk_14); + guRotateF(sp58, data->unk_28, 0.0f, 1.0f, 0.0f); + guMtxCatF(sp58, sp18, sp18); + guScaleF(sp58, 0.02f, 0.02f, 0.02f); + guMtxCatF(sp58, sp18, sp18); + guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gDPSetPrimColor(gMainGfxPos++, 0, 0, primColor, primColor, primColor, 255); diff --git a/src/effects/chapter_change.c b/src/effects/chapter_change.c index d86740acf5c..a99c5b2133b 100644 --- a/src/effects/chapter_change.c +++ b/src/effects/chapter_change.c @@ -105,8 +105,6 @@ void chapter_change_init(EffectInstance* effect); void chapter_change_update(EffectInstance* effect); void chapter_change_render(EffectInstance* 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) { 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.effectID = EFFECT_CHAPTER_CHANGE; - effect = shim_create_effect_instance(&bp); + effect = create_effect_instance(&bp); 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); 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) { data->unk_40 = 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; } @@ -211,7 +209,7 @@ void chapter_change_update(EffectInstance* effect) { data->lifetime++; 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.renderMode = RENDER_MODE_2D; - retTask = shim_queue_render_task(&renderTask); + retTask = queue_render_task(&renderTask); retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; } @@ -287,7 +285,7 @@ void chapter_change_appendGfx(void* effect) { func_E010E000(data, 1, ptr1); 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++); diff --git a/src/effects/chomp_drop.c b/src/effects/chomp_drop.c index 8ed7982988e..7ccbe0dec3e 100644 --- a/src/effects/chomp_drop.c +++ b/src/effects/chomp_drop.c @@ -25,9 +25,9 @@ EffectInstance* chomp_drop_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4 bp.renderUI = NULL; bp.effectID = EFFECT_CHOMP_DROP; - effect = shim_create_effect_instance(&bp); + effect = create_effect_instance(&bp); 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); 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_34 = 1.0f; data->unk_20 = arg7; - data->unk_38 = shim_rand_int(0x168); + data->unk_38 = rand_int(0x168); data->unk_40 = arg9; data->unk_44 = 0; data->unk_3C = arg5; @@ -61,7 +61,7 @@ void chomp_drop_update(EffectInstance* effect) { data->unk_40--; data->unk_44++; if (data->unk_40 < 0) { - shim_remove_effect(effect); + remove_effect(effect); return; } @@ -96,7 +96,7 @@ void chomp_drop_update(EffectInstance* effect) { data->unk_08 += data->unk_10; if (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); data->unk_2C = 4; @@ -127,7 +127,7 @@ void chomp_drop_render(EffectInstance* effect) { renderTask.distance = -10; 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; } @@ -146,17 +146,17 @@ void chomp_drop_appendGfx(void* effect) { gDPPipeSync(gMainGfxPos++); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effectTemp)->graphics->data)); - shim_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); - shim_guMtxCatF(sp60, sp20, sp20); - shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); + guScaleF(sp20, 0.01f, 0.01f, 0.01f); + 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); + guMtxCatF(sp60, sp20, sp20); + guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gDPSetPrimColor( gMainGfxPos++, 0, 0, - (shim_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, + (sin_deg(temp_s6 * 30) * 25.0f) + 225.0f, 255, primA ); @@ -181,8 +181,8 @@ void chomp_drop_appendGfx(void* effect) { for (i = 0; i < 16; i++) { 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_v0_3 = (i * 400) + (s32) (shim_sin_deg(((temp_s6 * 10) + (i * 6)) + temp_s7) * 200.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) (sin_deg(((temp_s6 * 10) + (i * 6)) + temp_s7) * 200.0f * temp_f22); vtx->ob[0] = temp_s1 - 3200; vtx->ob[1] = temp_v0_3; diff --git a/src/effects/cloud_puff.c b/src/effects/cloud_puff.c index 0e6d8e9a5a8..5c4b6817824 100644 --- a/src/effects/cloud_puff.c +++ b/src/effects/cloud_puff.c @@ -24,13 +24,13 @@ void cloud_puff_main(f32 arg0, f32 arg1, f32 arg2, f32 arg3) { bp.renderUI = NULL; bp.effectID = EFFECT_CLOUD_PUFF; - effect = shim_create_effect_instance(&bp); + effect = create_effect_instance(&bp); effect->numParts = numParts; - part = shim_general_heap_malloc(numParts * sizeof(*part)); + part = general_heap_malloc(numParts * sizeof(*part)); effect->data.cloudPuff = part; 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++) { 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_20 = 1.0f; part->alpha = 255; - part->unk_24 = (shim_rand_int(10) * 0.03) + 1.0; - part->unk_28 = (shim_rand_int(10) * 0.03) + 1.7; + part->unk_24 = (rand_int(10) * 0.03) + 1.0; + part->unk_28 = (rand_int(10) * 0.03) + 1.7; part->unk_2C = effect_rand_int(60); part->timeLeft = 30; part->unk_34 = 0.5f; part->unk_38 = -0.02f; part->unk_3C = 0.00005f; part->unk_30 = -3.9f; - temp_f20 = shim_clamp_angle(arg3 + i * 45); - part->unk_44 = shim_sin_deg(temp_f20); - part->unk_48 = shim_cos_deg(temp_f20); + temp_f20 = clamp_angle(arg3 + i * 45); + part->unk_44 = sin_deg(temp_f20); + part->unk_48 = cos_deg(temp_f20); } } @@ -71,9 +71,9 @@ void cloud_puff_update(EffectInstance* effect) { part->alive = FALSE; } else { cond = TRUE; - part->unk_2C = shim_clamp_angle(part->unk_2C + 12.0f); - part->unk_18 = part->unk_24 + shim_sin_deg(part->unk_2C) * 0.1; - part->unk_1C = part->unk_28 + shim_cos_deg(part->unk_2C) * 0.1; + part->unk_2C = clamp_angle(part->unk_2C + 12.0f); + part->unk_18 = part->unk_24 + sin_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_0C += part->unk_30 * part->unk_44; part->unk_14 += part->unk_30 * part->unk_48; @@ -95,7 +95,7 @@ void cloud_puff_update(EffectInstance* effect) { } if (!cond) { - shim_remove_effect(effect); + remove_effect(effect); } } @@ -108,7 +108,7 @@ void cloud_puff_render(EffectInstance* effect) { renderTask.distance = 0; renderTask.renderMode = RENDER_MODE_28; - retTask = shim_queue_render_task(&renderTask); + retTask = queue_render_task(&renderTask); 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++) { 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); - shim_guScaleF(sp60, part->unk_18, part->unk_1C, part->unk_20); - shim_guMtxCatF(sp60, sp20, sp20); - shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); + guScaleF(sp60, part->unk_18, part->unk_1C, part->unk_20); + guMtxCatF(sp60, sp20, sp20); + guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); gDPSetPrimColor(gMainGfxPos++, 0, 0, 112, 96, 24, part->alpha); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], diff --git a/src/effects/cloud_trail.c b/src/effects/cloud_trail.c index 09541638086..ab349343e3e 100644 --- a/src/effects/cloud_trail.c +++ b/src/effects/cloud_trail.c @@ -23,14 +23,14 @@ void cloud_trail_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3) { bp.renderUI = NULL; bp.effectID = EFFECT_CLOUD_TRAIL; - effect = shim_create_effect_instance(&bp); + effect = create_effect_instance(&bp); effect->numParts = 1; - part = shim_general_heap_malloc(numParts * sizeof(*part)); + part = general_heap_malloc(numParts * sizeof(*part)); effect->data.cloudTrail = part; 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++) { 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_24 = 1.0f; part->alpha = -1; - part->unk_28 = (shim_rand_int(10) * 0.03) + 1.4; - part->unk_2C = (shim_rand_int(10) * 0.03) + 1.5; + part->unk_28 = (rand_int(10) * 0.03) + 1.4; + part->unk_2C = (rand_int(10) * 0.03) + 1.5; part->unk_30 = effect_rand_int(60); part->unk_04 = arg0; part->lifetime = 15; @@ -71,9 +71,9 @@ void cloud_trail_update(EffectInstance* effect) { part->alive = FALSE; } else { cond = TRUE; - part->unk_30 = shim_clamp_angle(part->unk_30 + 12.0f); - part->unk_1C = part->unk_28 + shim_sin_deg(part->unk_30) * 0.1; - part->unk_20 = part->unk_2C + shim_cos_deg(part->unk_30) * 0.1; + part->unk_30 = clamp_angle(part->unk_30 + 12.0f); + part->unk_1C = part->unk_28 + sin_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)) { part->lifetime++; @@ -96,7 +96,7 @@ void cloud_trail_update(EffectInstance* effect) { } if (!cond) { - shim_remove_effect(effect); + remove_effect(effect); } } @@ -109,7 +109,7 @@ void cloud_trail_render(EffectInstance* effect) { renderTask.distance = 0; renderTask.renderMode = RENDER_MODE_28; - retTask = shim_queue_render_task(&renderTask); + retTask = queue_render_task(&renderTask); 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++) { 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); - shim_guScaleF(sp60, part->unk_1C, part->unk_20, part->unk_24); - shim_guMtxCatF(sp60, sp20, sp20); - shim_guRotateF(sp60, part->unk_18, 0.0f, 0.0f, 1.0f); - shim_guMtxCatF(sp60, sp20, sp20); - shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); + guScaleF(sp60, part->unk_1C, part->unk_20, part->unk_24); + guMtxCatF(sp60, sp20, sp20); + guRotateF(sp60, part->unk_18, 0.0f, 0.0f, 1.0f); + guMtxCatF(sp60, sp20, sp20); + guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); gDPSetPrimColor(gMainGfxPos++, 0, 0, 112, 96, 24, part->alpha); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], diff --git a/src/effects/cold_breath.c b/src/effects/cold_breath.c index 997d2eb13fa..5b9ae7632b3 100644 --- a/src/effects/cold_breath.c +++ b/src/effects/cold_breath.c @@ -89,9 +89,9 @@ EffectInstance* cold_breath_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg bp.renderUI = NULL; bp.effectID = EFFECT_COLD_BREATH; - effect = shim_create_effect_instance(&bp); + effect = create_effect_instance(&bp); 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); data->unk_00 = arg0; @@ -138,7 +138,7 @@ void cold_breath_update(EffectInstance* effect) { data->unk_14++; if (data->unk_10 < 0) { - shim_remove_effect(effect); + remove_effect(effect); return; } if (data->unk_10 < 16) { @@ -172,7 +172,7 @@ void cold_breath_render(EffectInstance* effect) { renderTask.distance = 6; renderTask.renderMode = RENDER_MODE_2D; - retTask = shim_queue_render_task(&renderTask); + retTask = queue_render_task(&renderTask); retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; } @@ -196,10 +196,10 @@ void cold_breath_appendGfx(void* effect) { gDPPipeSync(gMainGfxPos++); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); - shim_guTranslateF(sp20, data->unk_04, data->unk_08, data->unk_0C); - shim_guScaleF(sp60, data->unk_40, data->unk_40, data->unk_40); - shim_guMtxCatF(sp60, sp20, sp20); - shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(sp20, data->unk_04, data->unk_08, data->unk_0C); + guScaleF(sp60, data->unk_40, data->unk_40, data->unk_40); + guMtxCatF(sp60, sp20, sp20); + guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); 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); @@ -212,8 +212,8 @@ void cold_breath_appendGfx(void* effect) { temp2 = D_E00DE8B4[unkIndex]; temp3 = D_E00DE858[unkIndex]; - shim_guPositionF(sp20, 0.0f, 0.0f, -temp1, temp2 * 0.01f, temp3, 0.0f, 0.0f); - shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); + guPositionF(sp20, 0.0f, 0.0f, -temp1, temp2 * 0.01f, temp3, 0.0f, 0.0f); + guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); temp_f32 = D_E00DE910[unkIndex] * 5.0f / 256.0f; diff --git a/src/effects/confetti.c b/src/effects/confetti.c index 38421d73ab3..50da8aaaa54 100644 --- a/src/effects/confetti.c +++ b/src/effects/confetti.c @@ -35,12 +35,12 @@ u8 D_E0088D00[] = { 0, 1, 2, 3, 2, 1, 0, 0 }; u8 D_E0088D08[] = { 0, 45, 0, 60 }; 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_0C = shim_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_14 = -1.7 - shim_rand_int(800) * 0.1f * 0.01; - part->unk_18 = (shim_rand_int(200) * 0.1f - 10.0f) * 0.05; + part->unk_0C = rand_int(300) * 0.1f - 15.0f; + part->unk_10 = (part->unk_04 + rand_int(100) * 0.1f - 5.0f) * 0.03; + part->unk_14 = -1.7 - rand_int(800) * 0.1f * 0.01; + part->unk_18 = (rand_int(200) * 0.1f - 10.0f) * 0.05; 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->effectID = EFFECT_CONFETTI; - effect = shim_create_effect_instance(bpPtr); + effect = create_effect_instance(bpPtr); 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); 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++; - temp_fp = shim_rand_int(360); + temp_fp = rand_int(360); for (i = 0; i < np; i++, data++) { 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; - sinTheta = shim_sin_deg(theta); - cosTheta = shim_cos_deg(theta); - sinTheta2 = shim_sin_deg(theta2); - cosTheta2 = shim_cos_deg(theta2); + sinTheta = sin_deg(theta); + cosTheta = cos_deg(theta); + sinTheta2 = sin_deg(theta2); + cosTheta2 = cos_deg(theta2); if (arg0 == 3) { func_E0088000(data); data->unk_30 = i * 3; @@ -184,7 +184,7 @@ void confetti_update(EffectInstance* effect) { part->unk_20--; if (part->unk_20 < 0) { - shim_remove_effect(effect); + remove_effect(effect); return; } @@ -241,7 +241,7 @@ void confetti_render(EffectInstance* effect) { renderTask.distance = 0; renderTask.renderMode = RENDER_MODE_2D; - retTask = shim_queue_render_task(&renderTask); + retTask = queue_render_task(&renderTask); } void confetti_appendGfx(void* effect) { @@ -270,10 +270,10 @@ void confetti_appendGfx(void* effect) { gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); gSPDisplayList(gMainGfxPos++, D_09000940_38C4E0); - shim_guTranslateF(sp18, part->unk_04, part->unk_08, part->unk_0C); - shim_guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); - shim_guMtxCatF(sp58, sp18, sp18); - shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(sp18, part->unk_04, part->unk_08, part->unk_0C); + guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guMtxCatF(sp58, sp18, sp18); + guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); savedGfxPos = gMainGfxPos++; @@ -283,8 +283,8 @@ void confetti_appendGfx(void* effect) { color = &D_E0088CDC[i % 12]; if (part->unk_30 <= 0) { - shim_guTranslateF(sp18, part->unk_04, part->unk_08, part->unk_0C); - shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(sp18, part->unk_04, part->unk_08, part->unk_0C); + guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); gDPSetPrimColor(gMainGfxPos++, 0, 0, color->r, color->g, color->b, unk_28); diff --git a/src/effects/damage_indicator.c b/src/effects/damage_indicator.c index 6b59c3e6eae..b4f19d74ff7 100644 --- a/src/effects/damage_indicator.c +++ b/src/effects/damage_indicator.c @@ -94,10 +94,10 @@ void damage_indicator_main(s32 arg0, f32 posX, f32 posY, f32 posZ, f32 starsRadi bp.unk_00 = 0; bp.effectID = EFFECT_DAMAGE_INDICATOR; - effect = shim_create_effect_instance(bpPtr); + effect = create_effect_instance(bpPtr); 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); 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; angle = starsAngle + (((s32) ((((i % 2) * 2) - 1) * i) / 2) * (30.0f - damageAmt)); part->scale = 0.2f; - part->relPos.x = -shim_sin_deg(angle) * starsRadius * 1.5; - part->relPos.y = shim_cos_deg(angle) * starsRadius * 1.5; + part->relPos.x = -sin_deg(angle) * starsRadius * 1.5; + part->relPos.y = cos_deg(angle) * starsRadius * 1.5; part->relPos.z = 0; part->alpha = 255; } @@ -147,7 +147,7 @@ void damage_indicator_update(EffectInstance* effect) { timeLeft = part->timeLeft; if (timeLeft < 0) { - shim_remove_effect(effect); + remove_effect(effect); return; } @@ -204,10 +204,10 @@ void damage_indicator_render_impl(EffectInstance* effect) { gDPPipeSync(gMainGfxPos++); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(effect->graphics->data)); - shim_guTranslateF(mtxTransform, part->basePos.x, part->basePos.y, part->basePos.z); - shim_guRotateF(mtxTemp, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); - shim_guMtxCatF(mtxTemp, mtxTransform, mtxTransform); - shim_guMtxF2L(mtxTransform, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(mtxTransform, part->basePos.x, part->basePos.y, part->basePos.z); + guRotateF(mtxTemp, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guMtxCatF(mtxTemp, mtxTransform, mtxTransform); + guMtxF2L(mtxTransform, &gDisplayContext->matrixStack[gMatrixListPos]); 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); if (i == lastPartIdx) { - shim_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]); + guPositionF(mtxTransform, 0.0f, 0.0f, 0.0f, part->scale, part->curPos.x, part->curPos.y, part->curPos.z); + guMtxF2L(mtxTransform, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPDisplayList(gMainGfxPos++, D_09002150_352370); 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.y + part->basePos.y) * 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); gSPDisplayList(gMainGfxPos++, D_09002160_352380); @@ -250,13 +250,13 @@ void damage_indicator_render_impl(EffectInstance* effect) { gSPDisplayList(gMainGfxPos++, D_09001D40_351F60); - shim_guTranslateF(mtxTransform, part->basePos.x, part->basePos.y, part->basePos.z); - shim_guMtxF2L(mtxTransform, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(mtxTransform, part->basePos.x, part->basePos.y, part->basePos.z); + guMtxF2L(mtxTransform, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); - shim_guScaleF(mtxTransform, part->scale, part->scale, 1.0f); - shim_guMtxF2L(mtxTransform, &gDisplayContext->matrixStack[gMatrixListPos]); + guScaleF(mtxTransform, part->scale, part->scale, 1.0f); + guMtxF2L(mtxTransform, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); diff --git a/src/effects/damage_stars.c b/src/effects/damage_stars.c index 9af223b5e22..9269412e1e9 100644 --- a/src/effects/damage_stars.c +++ b/src/effects/damage_stars.c @@ -52,7 +52,7 @@ void damage_stars_main( if (arg7 != 0) { temp_f12 = SQ(arg4) + SQ(arg5) + SQ(arg6); if (temp_f12 != 0.0f) { - temp_f12 = -1.0f / shim_sqrtf(temp_f12); + temp_f12 = -1.0f / sqrtf(temp_f12); arg4 *= temp_f12; arg5 *= temp_f12; @@ -74,7 +74,7 @@ void damage_stars_main( temp_f12 = SQ(var_f30) + SQ(sp70) + SQ(var_f28); if (temp_f12 != 0) { - temp_f12 = 1.0f / shim_sqrtf(temp_f12); + temp_f12 = 1.0f / sqrtf(temp_f12); var_f30 *= temp_f12; sp70 *= temp_f12; @@ -94,9 +94,9 @@ void damage_stars_main( bpPtr->renderUI = NULL; bpPtr->effectID = EFFECT_DAMAGE_STARS; - effect = shim_create_effect_instance(bpPtr); + effect = create_effect_instance(bpPtr); 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); for (i = 0; i < arg7; i++, part++) { @@ -109,15 +109,15 @@ void damage_stars_main( case 0: case 1: 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_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; break; case 3: - rotateX = shim_sin_deg(gCameras[gCurrentCameraID].currentYaw); - rotateZ = -shim_cos_deg(gCameras[gCurrentCameraID].currentYaw); - shim_guRotateF(sp30, + rotateX = sin_deg(gCameras[gCurrentCameraID].currentYaw); + rotateZ = -cos_deg(gCameras[gCurrentCameraID].currentYaw); + guRotateF(sp30, (arg7 != 1) ? (i * 100) / (arg7 - 1) - 50 : 0.0f, rotateX, 0.0f, rotateZ); 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; break; case 4: - rotateX = shim_sin_deg(gCameras[gCurrentCameraID].currentYaw); - rotateZ = -shim_cos_deg(gCameras[gCurrentCameraID].currentYaw); - shim_guRotateF(sp30, (i * 360.0f) / (arg7 - 1), rotateX, 0.0f, rotateZ); + rotateX = sin_deg(gCameras[gCurrentCameraID].currentYaw); + rotateZ = -cos_deg(gCameras[gCurrentCameraID].currentYaw); + 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_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; @@ -184,7 +184,7 @@ void damage_stars_update(EffectInstance* effect) { part->unk_2C++; if (part->unk_28 < 0) { - shim_remove_effect(effect); + remove_effect(effect); return; } @@ -193,7 +193,7 @@ void damage_stars_update(EffectInstance* effect) { for (i = 0; i < effect->numParts; i++, part++) { 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_18 *= 0.94; if (part->unk_14 < 0.0f) { @@ -235,7 +235,7 @@ void damage_stars_render(EffectInstance* effect) { renderTask.distance = 0; renderTask.renderMode = RENDER_MODE_2D; - retTask = shim_queue_render_task(&renderTask); + retTask = queue_render_task(&renderTask); retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; } @@ -259,15 +259,15 @@ void damage_stars_appendGfx(void* effect) { 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); - shim_guTranslateF(sp18, part->unk_04, part->unk_08, part->unk_0C); - shim_guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); - shim_guMtxCatF(sp58, sp18, sp18); - shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(sp18, part->unk_04, part->unk_08, part->unk_0C); + guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guMtxCatF(sp58, sp18, sp18); + guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); 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); - shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); + guRotateF(sp18, part->unk_1C, 0.0f, 0.0f, 1.0f); + guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPDisplayList(gMainGfxPos++, D_090005E0_343620); diff --git a/src/effects/debuff.c b/src/effects/debuff.c index 1f73ace4f6e..35341bca66c 100644 --- a/src/effects/debuff.c +++ b/src/effects/debuff.c @@ -26,14 +26,14 @@ EffectInstance* debuff_main(s32 type, f32 x, f32 y, f32 z) { bp.renderUI = NULL; bp.effectID = EFFECT_DEBUFF; - effect = shim_create_effect_instance(&bp); + effect = create_effect_instance(&bp); 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); - shim_mem_clear(data, numParts * sizeof(*data)); + mem_clear(data, numParts * sizeof(*data)); data->timeLeft = 30; 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); f32 temp2 = 1.0f; - data->pos.x = shim_cos_deg(angle + 90.0f); - data->pos.y = shim_sin_deg(angle + 90.0f); + data->pos.x = cos_deg(angle + 90.0f); + data->pos.y = sin_deg(angle + 90.0f); data->pos.z = 0.0f; data->unk_10 = 0.0f; data->unk_14 = 0.0f; @@ -90,7 +90,7 @@ void debuff_update(EffectInstance* effect) { data->lifetime++; data->timeLeft--; if (data->timeLeft < 0) { - shim_remove_effect(effect); + remove_effect(effect); return; } @@ -112,8 +112,8 @@ void debuff_update(EffectInstance* effect) { data->scaleX += (1.0f - data->scaleX) * 0.1; 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.y = shim_sin_deg(data->rotZ + 90.0f) * data->unk_30; + data->pos.x = cos_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.renderMode = RENDER_MODE_28; - retTask = shim_queue_render_task(&renderTask); + retTask = queue_render_task(&renderTask); 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)); gSPDisplayList(gMainGfxPos++, dlist2); - shim_guTranslateF(mtxTranslate, data->pos.x, data->pos.y, data->pos.z); - shim_guRotateF(mtxRotate, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); - shim_guMtxCatF(mtxRotate, mtxTranslate, mtxTransform); - shim_guMtxF2L(mtxTransform, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(mtxTranslate, data->pos.x, data->pos.y, data->pos.z); + guRotateF(mtxRotate, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guMtxCatF(mtxRotate, mtxTranslate, mtxTransform); + guMtxF2L(mtxTransform, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); @@ -156,12 +156,12 @@ void debuff_appendGfx(void* effect) { data++; for (i = 1; i < eff->numParts; i++, data++) { - shim_guTranslateF(mtxTranslate, data->pos.x, data->pos.y, data->pos.z); - shim_guRotateF(mtxRotate, data->rotZ, 0.0f, 0.0f, 1.0f); - shim_guMtxCatF(mtxRotate, mtxTranslate, mtxTranslate); - shim_guScaleF(mtxRotate, data->scaleX, data->scaleY, 1.0f); - shim_guMtxCatF(mtxRotate, mtxTranslate, mtxTranslate); - shim_guMtxF2L(mtxTranslate, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(mtxTranslate, data->pos.x, data->pos.y, data->pos.z); + guRotateF(mtxRotate, data->rotZ, 0.0f, 0.0f, 1.0f); + guMtxCatF(mtxRotate, mtxTranslate, mtxTranslate); + guScaleF(mtxRotate, data->scaleX, data->scaleY, 1.0f); + guMtxCatF(mtxRotate, mtxTranslate, mtxTranslate); + guMtxF2L(mtxTranslate, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); diff --git a/src/effects/disable_x.c b/src/effects/disable_x.c index fce0a2b0909..b92c9332f08 100644 --- a/src/effects/disable_x.c +++ b/src/effects/disable_x.c @@ -47,9 +47,9 @@ EffectInstance* disable_x_main(s32 type, f32 x, f32 y, f32 z, s32 arg4) { bp.renderUI = func_E0082528; bp.effectID = EFFECT_DISABLE_X; - effect = shim_create_effect_instance(&bp); + effect = create_effect_instance(&bp); effect->numParts = numParts; - data = shim_general_heap_malloc(numParts * sizeof(*data)); + data = general_heap_malloc(numParts * sizeof(*data)); effect->data.disableX = data; ASSERT(effect->data.disableX != NULL); @@ -121,7 +121,7 @@ void disable_x_update(EffectInstance* effect) { } if (data->unk_28 < 0) { - shim_remove_effect(effect); + remove_effect(effect); return; } @@ -151,10 +151,10 @@ void disable_x_update(EffectInstance* effect) { data[1].unk_28 = 0; data->unk_38++; 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) { - 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); data->unk_38--; } @@ -173,7 +173,7 @@ void disable_x_update(EffectInstance* effect) { data->unk_30 *= unk_34; 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 { data->unk_20 = 0.0f; } @@ -215,11 +215,11 @@ void func_E0082528(EffectInstance* effect) { void func_E0082580(DisableXFXData* data) { Matrix4f sp18, sp58; - shim_guTranslateF(sp18, data->pos.x, data->pos.y, data->pos.z); - shim_guScaleF(sp58, data->scale, data->scale, 1.0f); - shim_guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); - shim_guMtxCatF(sp58, sp18, sp18); - shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(sp18, data->pos.x, data->pos.y, data->pos.z); + guScaleF(sp58, data->scale, data->scale, 1.0f); + guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guMtxCatF(sp58, sp18, sp18); + guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); } @@ -227,14 +227,14 @@ void func_E0082580(DisableXFXData* data) { void func_E00826C4(DisableXFXData* data) { Matrix4f sp18, sp58; - shim_guTranslateF(sp18, data->pos.x, data->pos.y, data->pos.z); - shim_guScaleF(sp58, data->unk_30, data->unk_30, 1.0f); - shim_guMtxCatF(sp58, sp18, sp18); - shim_guRotateF(sp58, data->unk_40, 0.0f, 0.0f, 1.0f); - shim_guMtxCatF(sp58, sp18, sp18); - shim_guTranslateF(sp58, 0.0f, data->unk_20, 0.0f); - shim_guMtxCatF(sp58, sp18, sp18); - shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(sp18, data->pos.x, data->pos.y, data->pos.z); + guScaleF(sp58, data->unk_30, data->unk_30, 1.0f); + guMtxCatF(sp58, sp18, sp18); + guRotateF(sp58, data->unk_40, 0.0f, 0.0f, 1.0f); + guMtxCatF(sp58, sp18, sp18); + guTranslateF(sp58, 0.0f, data->unk_20, 0.0f); + guMtxCatF(sp58, sp18, sp18); + guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); diff --git a/src/effects/drop_leaves.c b/src/effects/drop_leaves.c index c4cfb8743da..9ee19e6859b 100644 --- a/src/effects/drop_leaves.c +++ b/src/effects/drop_leaves.c @@ -23,9 +23,9 @@ void drop_leaves_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, s32 arg4) { bp.renderUI = NULL; bp.effectID = EFFECT_DROP_LEAVES; - effect = shim_create_effect_instance(&bp); + effect = create_effect_instance(&bp); 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); part->unk_00 = arg0; @@ -75,7 +75,7 @@ void drop_leaves_update(EffectInstance *effect) { part->unk_2C++; if (part->unk_28 < 0) { - shim_remove_effect(effect); + remove_effect(effect); return; } @@ -92,22 +92,22 @@ void drop_leaves_update(EffectInstance *effect) { 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_10 += temp; if (unk_00 == 0) { 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 { part->unk_14 += -0.05f; part->unk_10 *= 0.92; } part->unk_1C += func_E0200044(50, unk_2C + i * 20) - 25; - part->unk_18 += shim_sin_deg(part->unk_1C) * 10.0f; - part->unk_20 += shim_cos_deg(part->unk_1C * 0.5f) * 10.0f; + part->unk_18 += sin_deg(part->unk_1C) * 10.0f; + part->unk_20 += cos_deg(part->unk_1C * 0.5f) * 10.0f; part->unk_04 += part->unk_10; part->unk_08 += part->unk_14; } @@ -122,7 +122,7 @@ void drop_leaves_render(EffectInstance* effect) { renderTask.distance = 0; renderTask.renderMode = RENDER_MODE_2D; - retTask = shim_queue_render_task(&renderTask); + retTask = queue_render_task(&renderTask); retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; } @@ -137,19 +137,19 @@ void drop_leaves_appendGfx(void* effect) { gSPDisplayList(gMainGfxPos++, D_09001180_33E790); gDPSetPrimColor(gMainGfxPos++, 0, 0, 20, 100, 20, part->unk_24); - shim_guTranslateF(sp18, part->unk_04, part->unk_08, part->unk_0C); - shim_guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); - shim_guMtxCatF(sp58, sp18, sp98); + guTranslateF(sp18, part->unk_04, part->unk_08, part->unk_0C); + guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guMtxCatF(sp58, sp18, sp98); part++; for (i = 1; i < ((EffectInstance*)effect)->numParts; i++, part++) { - shim_guTranslateF(sp58, part->unk_04, part->unk_08, part->unk_0C); - shim_guMtxCatF(sp58, sp98, sp18); - shim_guRotateF(sp58, part->unk_18, 0.0f, 0.0f, 1.0f); - shim_guMtxCatF(sp58, sp18, sp18); - shim_guRotateF(sp58, part->unk_20, 0.0f, 1.0f, 0.0f); - shim_guMtxCatF(sp58, sp18, sp18); - shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(sp58, part->unk_04, part->unk_08, part->unk_0C); + guMtxCatF(sp58, sp98, sp18); + guRotateF(sp58, part->unk_18, 0.0f, 0.0f, 1.0f); + guMtxCatF(sp58, sp18, sp18); + guRotateF(sp58, part->unk_20, 0.0f, 1.0f, 0.0f); + guMtxCatF(sp58, sp18, sp18); + guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPDisplayList(gMainGfxPos++, D_09001230_33E840); diff --git a/src/effects/dust.c b/src/effects/dust.c index cded1c78d99..451d951c255 100644 --- a/src/effects/dust.c +++ b/src/effects/dust.c @@ -33,9 +33,9 @@ EffectInstance* dust_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, s32 arg4) { bp.renderUI = NULL; bp.effectID = EFFECT_DUST; - effect = shim_create_effect_instance(bpPtr); + effect = create_effect_instance(bpPtr); 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); part->unk_00 = arg0; @@ -53,14 +53,14 @@ EffectInstance* dust_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, s32 arg4) { part++; for (i = 1; i < numParts; i++, part++) { - part->unk_04 = shim_rand_int(200) - 100; - part->unk_08 = shim_rand_int(50); + part->unk_04 = rand_int(200) - 100; + part->unk_08 = rand_int(50); part->unk_0C = 0; part->unk_14 = 0; part->unk_1C = 1.0f; part->unk_20 = 1.0f; part->unk_10 = -1.0f; - part->unk_24 = shim_rand_int(10) / 200; + part->unk_24 = rand_int(10) / 200; switch (arg0) { case 0: 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_28 = 0.4f; part->unk_10 = 0; - part->unk_04 = (shim_rand_int(40) - 20) * 0.1; - part->unk_08 = (shim_rand_int(40) - 20) * 0.1; + part->unk_04 = (rand_int(40) - 20) * 0.1; + part->unk_08 = (rand_int(40) - 20) * 0.1; break; } } @@ -91,7 +91,7 @@ void dust_update(EffectInstance* effect) { part->unk_2C--; if (part->unk_2C < 0) { - shim_remove_effect(effect); + remove_effect(effect); return; } @@ -121,7 +121,7 @@ void dust_render(EffectInstance* effect) { renderTask.distance = 0; 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; } @@ -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); gDPSetEnvColor(gMainGfxPos++, part->unk_3C, part->unk_40, part->unk_44, 0); - shim_guTranslateF(sp18, part->unk_04, part->unk_08, part->unk_0C); - shim_guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); - shim_guMtxCatF(sp58, sp18, sp98); + guTranslateF(sp18, part->unk_04, part->unk_08, part->unk_0C); + guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guMtxCatF(sp58, sp18, sp98); unk_00 = part->unk_00; part++; for (i = 1; i < ((EffectInstance*)effect)->numParts; i++, part++) { matrix = &gDisplayContext->matrixStack[gMatrixListPos++]; - shim_guScaleF(sp18, part->unk_20, part->unk_1C, part->unk_20); - shim_guMtxF2L(sp18, matrix); - shim_guTranslateF(sp58, part->unk_04, part->unk_08, part->unk_0C); - shim_guMtxCatF(sp58, sp98, sp18); - shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); + guScaleF(sp18, part->unk_20, part->unk_1C, part->unk_20); + guMtxF2L(sp18, matrix); + guTranslateF(sp58, part->unk_04, part->unk_08, part->unk_0C); + guMtxCatF(sp58, sp98, sp18); + guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); 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); diff --git a/src/effects/effect_3D.c b/src/effects/effect_3D.c index c1048e61591..1191c6c2944 100644 --- a/src/effects/effect_3D.c +++ b/src/effects/effect_3D.c @@ -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); if (temp_f12 != 0.0f) { - temp_f12 = -1.0f / shim_sqrtf(temp_f12); + temp_f12 = -1.0f / sqrtf(temp_f12); arg4 *= 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); if (temp_f12 != 0.0f) { - temp_f12 = 1.0f / shim_sqrtf(temp_f12); + temp_f12 = 1.0f / sqrtf(temp_f12); temp_f30 *= 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->effectID = EFFECT_3D; - effect = shim_create_effect_instance(bpPtr); + effect = create_effect_instance(bpPtr); 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); 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.y = 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_18 = part->unk_24 = 2.0f * arg5; part->unk_1C = part->unk_28 = 2.0f * arg6; @@ -124,7 +124,7 @@ void effect_3D_update(EffectInstance* effect) { part->unk_5C--; part->unk_60++; if (part->unk_5C < 0 && unk_04 == 2) { - shim_remove_effect(effect); + remove_effect(effect); return; } @@ -207,7 +207,7 @@ void effect_3D_render(EffectInstance* effect) { renderTask.distance = 0; renderTask.renderMode = RENDER_MODE_2D; - retTask = shim_queue_render_task(&renderTask); + retTask = queue_render_task(&renderTask); 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)); gSPDisplayList(gMainGfxPos++, D_09000240_37D3C0); - shim_guTranslateF(sp18, part->pos.x, part->pos.y, part->pos.z); - shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(sp18, part->pos.x, part->pos.y, part->pos.z); + guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); 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++) { gDPSetPrimColor(gMainGfxPos++, 0, 0, 200, 255, 255, part->unk_58); - shim_guTranslateF(sp18, part->pos.x, part->pos.y, part->pos.z); - shim_guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); - shim_guMtxCatF(sp58, sp18, sp18); - shim_guScaleF(sp58, part->unk_44, part->unk_48, part->unk_44); - shim_guMtxCatF(sp58, sp18, sp18); - shim_guRotateF(sp58, part->unk_4C, 0.0f, 0.0f, 1.0f); - shim_guMtxCatF(sp58, sp18, sp18); - shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(sp18, part->pos.x, part->pos.y, part->pos.z); + guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guMtxCatF(sp58, sp18, sp18); + guScaleF(sp58, part->unk_44, part->unk_48, part->unk_44); + guMtxCatF(sp58, sp18, sp18); + guRotateF(sp58, part->unk_4C, 0.0f, 0.0f, 1.0f); + guMtxCatF(sp58, sp18, sp18); + guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPDisplayList(gMainGfxPos++, D_090002E8_37D468); diff --git a/src/effects/effect_46.c b/src/effects/effect_46.c index 6eac2181eb7..c468996bb47 100644 --- a/src/effects/effect_46.c +++ b/src/effects/effect_46.c @@ -35,9 +35,9 @@ EffectInstance* effect_46_main(s32 type, PlayerStatus* player, f32 scale, s32 du bp.renderUI = NULL; bp.effectID = EFFECT_46; - effect = shim_create_effect_instance(&bp); + effect = create_effect_instance(&bp); 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); part->type = type; @@ -138,7 +138,7 @@ void effect_46_update(EffectInstance* effect) { part->lifetime++; if (part->timeLeft < 0) { - shim_remove_effect(effect); + remove_effect(effect); return; } @@ -195,7 +195,7 @@ void effect_46_render(EffectInstance* effect) { renderTask.distance = 0; renderTask.renderMode = RENDER_MODE_2D; - retTask = shim_queue_render_task(&renderTask); + retTask = queue_render_task(&renderTask); 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)); gSPDisplayList(gMainGfxPos++, D_09000420_38EDB0); - shim_guTranslateF(mtxTransform, part->pos.x, part->pos.y, part->pos.z); - shim_guRotateF(mtxTemp, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); - shim_guMtxCatF(mtxTemp, mtxTransform, mtxTransform); - shim_guMtxF2L(mtxTransform, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(mtxTransform, part->pos.x, part->pos.y, part->pos.z); + guRotateF(mtxTemp, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guMtxCatF(mtxTemp, mtxTransform, mtxTransform); + guMtxF2L(mtxTransform, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); 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); - shim_guRotateF(mtxTemp, part->rot.y, 0.0f, 1.0f, 0.0f); - shim_guMtxCatF(mtxTemp, mtxTransform, mtxTransform); + guPositionF(mtxTransform, part->rot.x, 0.0f, part->rot.z, curScale * part->scale, part->pos.x, part->pos.y, part->pos.z); + guRotateF(mtxTemp, part->rot.y, 0.0f, 1.0f, 0.0f); + guMtxCatF(mtxTemp, mtxTransform, mtxTransform); if (type < 8) { - shim_guTranslateF(mtxTemp, 3.0f - (curScale - initialScale) * 3.0f / initialScale, 0.0f, 0.0f); - shim_guMtxCatF(mtxTemp, mtxTransform, mtxTransform); + guTranslateF(mtxTemp, 3.0f - (curScale - initialScale) * 3.0f / initialScale, 0.0f, 0.0f); + guMtxCatF(mtxTemp, mtxTransform, mtxTransform); } else { - shim_guTranslateF(mtxTemp, 2.0f, 0.0f, 0.0f); - shim_guMtxCatF(mtxTemp, mtxTransform, mtxTransform); + guTranslateF(mtxTemp, 2.0f, 0.0f, 0.0f); + guMtxCatF(mtxTemp, mtxTransform, mtxTransform); } 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); gSPDisplayList(gMainGfxPos++, D_090003A0_38ED30); diff --git a/src/effects/effect_63.c b/src/effects/effect_63.c index 59ae981d7a3..4d09fdd1183 100644 --- a/src/effects/effect_63.c +++ b/src/effects/effect_63.c @@ -50,9 +50,9 @@ EffectInstance* effect_63_main( bpPtr->renderUI = NULL; bpPtr->effectID = EFFECT_63; - effect = shim_create_effect_instance(bpPtr); + effect = create_effect_instance(bpPtr); 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); if (arg9 <= 0) { @@ -85,8 +85,8 @@ EffectInstance* effect_63_main( part->unk_3C = 51; part->unk_40 = 123; part->unk_44 = 255; - part->unk_4C = shim_rand_int(64); - part->unk_50 = shim_rand_int(64); + part->unk_4C = rand_int(64); + part->unk_50 = rand_int(64); part->unk_54 = 0; part->unk_58 = 0; part->unk_74 = 0; @@ -102,16 +102,16 @@ EffectInstance* effect_63_main( part->unk_3C = 51; part->unk_40 = 123; part->unk_44 = 255; - randInt = shim_rand_int(360); + randInt = rand_int(360); for (i = 0; i < numParts; i++, part++) { part->unk_04 = arg1; part->unk_08 = arg2; part->unk_0C = arg3; - part->unk_60 = shim_sin_deg(i * 45 + randInt) * 5.0f; - part->unk_64 = shim_cos_deg(i * 45 + randInt) * 2.0f + 3.0f; - part->unk_4C = shim_rand_int(64); - part->unk_50 = shim_rand_int(64); + part->unk_60 = sin_deg(i * 45 + randInt) * 5.0f; + part->unk_64 = cos_deg(i * 45 + randInt) * 2.0f + 3.0f; + part->unk_4C = rand_int(64); + part->unk_50 = rand_int(64); part->unk_70 = 1.0f; part->unk_6C = 1.0f; part->unk_54 = 0; @@ -145,12 +145,12 @@ void effect_63_update(EffectInstance* effect) { part->unk_24++; 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); } if (part->unk_20 < 0) { - shim_remove_effect(effect); + remove_effect(effect); return; } @@ -159,7 +159,7 @@ void effect_63_update(EffectInstance* effect) { switch (unk_00) { case 0: 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); } break; @@ -203,7 +203,7 @@ void effect_63_render(EffectInstance* effect) { renderTask.distance = 10; renderTask.renderMode = RENDER_MODE_2D; - retTask = shim_queue_render_task(&renderTask); + retTask = queue_render_task(&renderTask); 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_50 += part->unk_58; - angle = -shim_atan2(0.0f, 0.0f, part->unk_60, part->unk_64) + part->unk_74; - part->unk_54 = shim_sin_deg(angle); - part->unk_58 = shim_cos_deg(angle); + angle = -atan2(0.0f, 0.0f, part->unk_60, part->unk_64) + part->unk_74; + part->unk_54 = sin_deg(angle); + part->unk_58 = cos_deg(angle); if (part->unk_4C < 0.0f) { part->unk_4C += 128.0f; @@ -246,18 +246,18 @@ void effect_63_appendGfx(void* effect) { tempX = part->unk_4C * 4.0f; tempY = part->unk_50 * 4.0f; - shim_guTranslateF(sp18, part->unk_04, part->unk_08, part->unk_0C); - shim_guScaleF(sp58, unk_48, unk_48, unk_48); - shim_guMtxCatF(sp58, sp18, sp18); - shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(sp18, part->unk_04, part->unk_08, part->unk_0C); + guScaleF(sp58, unk_48, unk_48, unk_48); + guMtxCatF(sp58, sp18, sp18); + guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); 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); - shim_guScaleF(sp18, part->unk_70, part->unk_6C, 1.0f); - shim_guRotateF(sp58, part->unk_74, 0.0f, 0.0f, 1.0f); - shim_guMtxCatF(sp58, sp18, sp18); - shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); + guScaleF(sp18, part->unk_70, part->unk_6C, 1.0f); + guRotateF(sp58, part->unk_74, 0.0f, 0.0f, 1.0f); + guMtxCatF(sp58, sp18, sp18); + guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); 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); diff --git a/src/effects/effect_65.c b/src/effects/effect_65.c index d3f724ea59b..d4ef3699242 100644 --- a/src/effects/effect_65.c +++ b/src/effects/effect_65.c @@ -33,9 +33,9 @@ EffectInstance* effect_65_main( bp.renderUI = NULL; bp.effectID = EFFECT_65; - effect = shim_create_effect_instance(&bp); + effect = create_effect_instance(&bp); 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); data->variation = variation; @@ -104,7 +104,7 @@ EffectInstance* effect_65_main( data->pathPointEnabled[0] = TRUE; data->pathTimestamp[0] = 0; data->pathLength[0] = 0; - data->pathJitterX = shim_rand_int(30) + 10; + data->pathJitterX = rand_int(30) + 10; data->pathJitterY = 0; data->pathJitterZ = 0; @@ -139,7 +139,7 @@ void effect_65_update(EffectInstance* effect) { data->lifeTime++; if (data->timeLeft < 0) { - shim_remove_effect(effect); + remove_effect(effect); return; } @@ -150,8 +150,8 @@ void effect_65_update(EffectInstance* effect) { } if (variation == 3) { - data->pathJitterX += shim_rand_int(10) - 5; - data->pathJitterY += shim_rand_int(10) - 5; + data->pathJitterX += rand_int(10) - 5; + data->pathJitterY += rand_int(10) - 5; data->pos.x += data->pathJitterX; data->pos.y += data->pathJitterY; 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); if (dist != 0.0f) { - dist = shim_sqrtf(dist); + dist = sqrtf(dist); } data->pathLength[idx] = pathLength + dist; @@ -202,7 +202,7 @@ void effect_65_render(EffectInstance* effect) { renderTask.distance = 10; renderTask.renderMode = RENDER_MODE_2D; - retTask = shim_queue_render_task(&renderTask); + retTask = queue_render_task(&renderTask); retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; } @@ -249,8 +249,8 @@ void effect_65_appendGfx(void* effect) { gDPPipeSync(gMainGfxPos++); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); - shim_guTranslateF(mtx, 0.0f, 0.0f, 0.0f); - shim_guMtxF2L(mtx, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(mtx, 0.0f, 0.0f, 0.0f); + guMtxF2L(mtx, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(gMainGfxPos++, D_E00CACB0[variation]); @@ -286,7 +286,7 @@ void effect_65_appendGfx(void* effect) { fadeOutPhase = phase / numPoints; idx = (data->lastPointIndex + a1) % MAX_POINTS; - a = shim_sin_deg(fadeOutPhase) * 255.0f; + a = sin_deg(fadeOutPhase) * 255.0f; if (a > 200) { a = 200; } @@ -301,7 +301,7 @@ void effect_65_appendGfx(void* effect) { next = 0; } 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 { if (i != MAX_POINTS - 1) { next = idx + 1; @@ -312,8 +312,8 @@ void effect_65_appendGfx(void* effect) { if (prev < 0) { prev = MAX_POINTS - 1; } - nextAngle = -shim_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]); + nextAngle = -atan2(data->pathY[next], -data->pathX[next], data->pathY[idx], -data->pathX[idx]); + prevAngle = -atan2(data->pathY[idx], -data->pathX[idx], data->pathY[prev], -data->pathX[prev]); deltaAngle = prevAngle - nextAngle; if (deltaAngle > 180.0f) { nextAngle += 360.0f; @@ -328,7 +328,7 @@ void effect_65_appendGfx(void* effect) { pathPointY = data->pathY[idx]; pathPointZ = data->pathZ[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; if (variation >= 0) { @@ -352,8 +352,8 @@ void effect_65_appendGfx(void* effect) { } } - deltaX = width * shim_sin_deg(angle); - deltaY = width * shim_cos_deg(angle); + deltaX = width * sin_deg(angle); + deltaY = width * cos_deg(angle); deltaZ = 0.0f; vtx->ob[0] = pathPointX + deltaX; diff --git a/src/effects/effect_75.c b/src/effects/effect_75.c index b1708e49f73..58911f3b102 100644 --- a/src/effects/effect_75.c +++ b/src/effects/effect_75.c @@ -27,9 +27,9 @@ EffectInstance* effect_75_main(s32 arg0, f32 posX, f32 posY, f32 posZ, f32 scale bp.renderUI = NULL; bp.effectID = EFFECT_75; - effect = shim_create_effect_instance(&bp); + effect = create_effect_instance(&bp); 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); data->type = arg0; @@ -94,7 +94,7 @@ void effect_75_update(EffectInstance* effect) { } if (data->unk_10 < 0) { - shim_remove_effect(effect); + remove_effect(effect); return; } @@ -147,7 +147,7 @@ void effect_75_update(EffectInstance* effect) { } 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; } @@ -162,7 +162,7 @@ void effect_75_render(EffectInstance* effect) { f32 outZ; 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, &outX, &outY, &outZ, &outS); @@ -182,7 +182,7 @@ void effect_75_render(EffectInstance* effect) { renderTaskPtr->appendGfxArg = effect; 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; } @@ -203,14 +203,14 @@ void effect_75_appendGfx(void* effect) { gDPPipeSync(gMainGfxPos++); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); - shim_guTranslateF(mtxTransfrom, data->pos.x, data->pos.y, data->pos.z); - shim_guScaleF(mtxTemp, data->scale, data->scale, data->scale); - shim_guMtxCatF(mtxTemp, mtxTransfrom, mtxTransfrom); + guTranslateF(mtxTransfrom, data->pos.x, data->pos.y, data->pos.z); + guScaleF(mtxTemp, data->scale, data->scale, data->scale); + guMtxCatF(mtxTemp, mtxTransfrom, mtxTransfrom); if (type == 1) { - shim_guRotateF(mtxTemp, 180.0f, 0.0f, 0.0f, 1.0f); - shim_guMtxCatF(mtxTemp, mtxTransfrom, mtxTransfrom); + guRotateF(mtxTemp, 180.0f, 0.0f, 0.0f, 1.0f); + 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++, camera->unkMatrix, G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW); diff --git a/src/effects/effect_86.c b/src/effects/effect_86.c index 7290ead8aff..e7a9d8a278d 100644 --- a/src/effects/effect_86.c +++ b/src/effects/effect_86.c @@ -42,10 +42,10 @@ EffectInstance* effect_86_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, bp.renderUI = NULL; bp.effectID = EFFECT_86; - effect = shim_create_effect_instance(&bp); + effect = create_effect_instance(&bp); effect->numParts = numParts; - data = shim_general_heap_malloc(numParts * sizeof(*data)); + data = general_heap_malloc(numParts * sizeof(*data)); effect->data.unk_86 = data; part = data; @@ -90,7 +90,7 @@ void effect_86_update(EffectInstance* effect) { data->unk_14++; 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.renderMode = RENDER_MODE_2D; - retTask = shim_queue_render_task(&renderTask); + retTask = queue_render_task(&renderTask); retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; } @@ -118,10 +118,10 @@ void effect_86_appendGfx(void* effect) { gDPPipeSync(gMainGfxPos++); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); - shim_guTranslateF(sp10, part->unk_04, part->unk_08, part->unk_0C); - shim_guScaleF(sp50, part->unk_34, part->unk_34, part->unk_34); - shim_guMtxCatF(sp50, sp10, sp10); - shim_guMtxF2L(sp10, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(sp10, part->unk_04, part->unk_08, part->unk_0C); + guScaleF(sp50, part->unk_34, part->unk_34, part->unk_34); + guMtxCatF(sp50, sp10, sp10); + guMtxF2L(sp10, &gDisplayContext->matrixStack[gMatrixListPos]); 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); diff --git a/src/effects/embers.c b/src/effects/embers.c index d595f067b46..d371f29c4aa 100644 --- a/src/effects/embers.c +++ b/src/effects/embers.c @@ -48,9 +48,9 @@ EffectInstance* embers_main( bp.renderUI = NULL; bp.effectID = EFFECT_EMBERS; - effect = shim_create_effect_instance(&bp); + effect = create_effect_instance(&bp); 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); part->unk_00 = arg0; @@ -116,7 +116,7 @@ void embers_update(EffectInstance* effect) { } if (part->timeLeft < 0) { - shim_remove_effect(effect); + remove_effect(effect); return; } @@ -144,17 +144,17 @@ void embers_update(EffectInstance* effect) { if (part->unk_64 >= 0) { if (part->unk_64 == 0) { - part->unk_04 = shim_rand_int(unk_10) - unk_10 * 0.5; - part->unk_08 = shim_rand_int(unk_14); + part->unk_04 = rand_int(unk_10) - unk_10 * 0.5; + part->unk_08 = rand_int(unk_14); part->unk_0C = 0.0f; - part->unk_44 = (f32) (shim_rand_int(20) - 10) * 0.05; - part->unk_48 = (shim_rand_int(40) - 1) * unk_68 * 0.05; + part->unk_44 = (f32) (rand_int(20) - 10) * 0.05; + part->unk_48 = (rand_int(40) - 1) * unk_68 * 0.05; part->unk_4C = 0.0f; - part->unk_50 = (f32) (shim_rand_int(20) - 10) * 0.05; - part->unk_54 = (shim_rand_int(30) - 1) * unk_6C * 0.05; + part->unk_50 = (f32) (rand_int(20) - 10) * 0.05; + part->unk_54 = (rand_int(30) - 1) * unk_6C * 0.05; part->unk_58 = 0.0f; - part->unk_5C = shim_rand_int(15); - part->unk_60 = shim_rand_int(15); + part->unk_5C = rand_int(15); + part->unk_60 = rand_int(15); } part->unk_40 = D_E00E0A48[part->unk_64]; part->unk_04 += part->unk_44; @@ -178,7 +178,7 @@ void embers_render(EffectInstance* effect) { renderTask.distance = 10; renderTask.renderMode = RENDER_MODE_2D; - retTask = shim_queue_render_task(&renderTask); + retTask = queue_render_task(&renderTask); retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; } @@ -196,10 +196,10 @@ void embers_appendGfx(void* effect) { gDPPipeSync(gMainGfxPos++); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); - shim_guTranslateF(sp10, part->unk_04, part->unk_08, part->unk_0C); - shim_guScaleF(sp50, part->unk_40, part->unk_40, part->unk_40); - shim_guMtxCatF(sp50, sp10, sp10); - shim_guMtxF2L(sp10, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(sp10, part->unk_04, part->unk_08, part->unk_0C); + guScaleF(sp50, part->unk_40, part->unk_40, part->unk_40); + guMtxCatF(sp50, sp10, sp10); + guMtxF2L(sp10, &gDisplayContext->matrixStack[gMatrixListPos]); 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); @@ -210,8 +210,8 @@ void embers_appendGfx(void* effect) { part++; for (i = 1; i < ((EffectInstance*)effect)->numParts; i++, part++) { if (part->unk_64 >= 0) { - shim_guTranslateF(sp10, part->unk_04, part->unk_08, part->unk_0C); - shim_guMtxF2L(sp10, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(sp10, part->unk_04, part->unk_08, part->unk_0C); + guMtxF2L(sp10, &gDisplayContext->matrixStack[gMatrixListPos]); 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); diff --git a/src/effects/emote.c b/src/effects/emote.c index 807ed799090..c7db3b7d145 100644 --- a/src/effects/emote.c +++ b/src/effects/emote.c @@ -63,9 +63,9 @@ void func_E0020000(EmoteFXData* part, s32 arg1) { f32 sin; f32 cos; - sin = shim_sin_deg(gCameras[gCurrentCameraID].currentYaw); - cos = shim_cos_deg(gCameras[gCurrentCameraID].currentYaw); - shim_guRotateF(sp18, -(unk_1C - 20.0f + arg1 * 20), sin, 0.0f, -cos); + sin = sin_deg(gCameras[gCurrentCameraID].currentYaw); + cos = cos_deg(gCameras[gCurrentCameraID].currentYaw); + guRotateF(sp18, -(unk_1C - 20.0f + arg1 * 20), sin, 0.0f, -cos); if (npc == PTR_LIST_END) { 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.effectID = EFFECT_EMOTE; - effect = shim_create_effect_instance(bpPtr); + effect = create_effect_instance(bpPtr); 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); data->unk_3C = arg1; @@ -161,7 +161,7 @@ void emote_update(EffectInstance* effect) { part->unk_38 = D_E0020D80[part->unk_30][0]; part->unk_34 = 1; } else { - shim_remove_effect(effect); + remove_effect(effect); return; } } @@ -171,7 +171,7 @@ void emote_update(EffectInstance* effect) { } if (part->unk_2C < 0) { - shim_remove_effect(effect); + remove_effect(effect); return; } @@ -197,7 +197,7 @@ void emote_render(EffectInstance* effect) { renderTask.distance = 0; renderTask.renderMode = RENDER_MODE_2D; - retTask = shim_queue_render_task(&renderTask); + retTask = queue_render_task(&renderTask); 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)); if (type != 1) { - shim_guTranslateF(sp18, part->unk_04, part->unk_08, part->unk_0C); - shim_guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); - shim_guMtxCatF(sp58, sp18, sp18); + guTranslateF(sp18, part->unk_04, part->unk_08, part->unk_0C); + guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guMtxCatF(sp58, sp18, sp18); matrix = &gDisplayContext->matrixStack[gMatrixListPos]; - shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos++]); - shim_guScaleF(sp58, 1.0f, 0.8f, 1.0f); - shim_guMtxCatF(sp58, sp18, sp18); - shim_guRotateF(sp58, part->unk_24, 0.0f, 0.0f, 1.0f); - shim_guMtxCatF(sp58, sp18, sp18); - shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); + guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos++]); + guScaleF(sp58, 1.0f, 0.8f, 1.0f); + guMtxCatF(sp58, sp18, sp18); + guRotateF(sp58, part->unk_24, 0.0f, 0.0f, 1.0f); + guMtxCatF(sp58, sp18, sp18); + guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(gMainGfxPos++, D_09002170_336DE0); @@ -240,14 +240,14 @@ void emote_appendGfx(void* effect) { } else { if (part->unk_38 == 0) { for (i = 0; i < 3; i++, part++) { - shim_guTranslateF(sp18, part->unk_04, part->unk_08, part->unk_0C); - shim_guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); - shim_guMtxCatF(sp58, sp18, sp18); - shim_guRotateF(sp58, part->unk_24, 0.0f, 0.0f, 1.0f); - shim_guMtxCatF(sp58, sp18, sp18); - shim_guScaleF(sp58, part->unk_28, part->unk_28, 1.0f); - shim_guMtxCatF(sp58, sp18, sp18); - shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(sp18, part->unk_04, part->unk_08, part->unk_0C); + guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guMtxCatF(sp58, sp18, sp18); + guRotateF(sp58, part->unk_24, 0.0f, 0.0f, 1.0f); + guMtxCatF(sp58, sp18, sp18); + guScaleF(sp58, part->unk_28, part->unk_28, 1.0f); + guMtxCatF(sp58, sp18, sp18); + guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); gDPSetPrimColor(gMainGfxPos++, 0, 0, 235, 28, 0, 255); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); diff --git a/src/effects/ending_decals.c b/src/effects/ending_decals.c index 7099005cd50..e5a5f7bc011 100644 --- a/src/effects/ending_decals.c +++ b/src/effects/ending_decals.c @@ -41,9 +41,9 @@ void ending_decals_main(s32 type, f32 posX, f32 posY, f32 posZ, f32 arg4, Effect bp.renderUI = NULL; bp.effectID = EFFECT_ENDING_DECALS; - effect = shim_create_effect_instance(&bp); + effect = create_effect_instance(&bp); 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); data->type = type; @@ -98,7 +98,7 @@ void ending_decals_update(EffectInstance* effect) { data->unk_20++; if (data->unk_1C < 0) { - shim_remove_effect(effect); + remove_effect(effect); return; } @@ -125,7 +125,7 @@ void ending_decals_render(EffectInstance* effect) { renderTaskPtr->renderMode = RENDER_MODE_2D; } - retTask = shim_queue_render_task(renderTaskPtr); + retTask = queue_render_task(renderTaskPtr); retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; } @@ -145,8 +145,8 @@ void ending_decals_appendGfx(void* effect) { gDPPipeSync(gMainGfxPos++); 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); - shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); + guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].currentYaw, 0.0f, data->scale, data->pos.x, data->pos.y, data->pos.z); + guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); diff --git a/src/effects/energy_in_out.c b/src/effects/energy_in_out.c index 18a1020f7ea..a0c2c2bde59 100644 --- a/src/effects/energy_in_out.c +++ b/src/effects/energy_in_out.c @@ -48,9 +48,9 @@ EffectInstance* energy_in_out_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 a bp.renderUI = NULL; bp.effectID = EFFECT_ENERGY_IN_OUT; - effect = shim_create_effect_instance(&bp); + effect = create_effect_instance(&bp); 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); 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_38 = D_E00D6E84[arg0]; - randAngle = shim_rand_int(360); + randAngle = rand_int(360); 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 1: 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_40 = 0; part->scale = 1.0 - (i % 3) * 0.1; break; case 3: 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_40 = 0; part->scale = 1.0 - (i % 3) * 0.1; break; case 6: - part->unk_38 = -(shim_rand_int(10) + 4); + part->unk_38 = -(rand_int(10) + 4); part->unk_10 = 10; part->unk_40 = 0; part->scale = 1.0 - (i % 3) * 0.3; break; case 7: - part->unk_38 = -(shim_rand_int(10) + 4); + part->unk_38 = -(rand_int(10) + 4); part->unk_10 = 10; part->unk_40 = 0; part->scale = 1.0 - (i % 3) * 0.3; break; 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_40 = -1.0f; part->scale = 1.0 - (i % 3) * 0.3; break; 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_40 = -2.0f; 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; break; 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_40 = 0; part->scale = (1.0 - (i % 3) * 0.3) * 0.5; break; 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_10 = 30; part->scale = 1.0 - (i % 3) * 0.3; break; case 4: 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_40 = -2.0f; part->scale = 1.0 - (i % 3) * 0.3; break; } - part->unk_14 = -shim_rand_int(part->unk_10); + part->unk_14 = -rand_int(part->unk_10); if (part->unk_38 < 0.0f) { 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++; if (part->unk_10 < 0) { - shim_remove_effect(effect); + remove_effect(effect); return; } @@ -209,7 +209,7 @@ void energy_in_out_update(EffectInstance* effect) { } else { part->pos.x = 0.0f; } - part->unk_3C = shim_rand_int(359); + part->unk_3C = rand_int(359); } part->pos.x += part->unk_38; @@ -219,7 +219,7 @@ void energy_in_out_update(EffectInstance* effect) { if (angle < 0.0f || angle > 180.0f) { part->unk_24 = 0; } 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.renderMode = RENDER_MODE_2D; - retTask = shim_queue_render_task(&renderTask); + retTask = queue_render_task(&renderTask); } void func_E00D6978(void) { @@ -255,8 +255,8 @@ void energy_in_out_appendGfx(void* effect) { gDPPipeSync(gMainGfxPos++); 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); - shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); + guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].currentYaw, 0.0f, scale, part->pos.x, part->pos.y, part->pos.z); + guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); 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); @@ -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); - shim_guRotateF(sp20, part->unk_3C, 0.0f, 0.0f, 1.0f); - shim_guTranslateF(sp60, part->pos.x + unk_38, 0.0f, 0.0f); - shim_guMtxCatF(sp60, sp20, sp20); + guRotateF(sp20, part->unk_3C, 0.0f, 0.0f, 1.0f); + guTranslateF(sp60, part->pos.x + unk_38, 0.0f, 0.0f); + guMtxCatF(sp60, sp20, sp20); 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 { - shim_guScaleF(sp60, scale, scale, 1.0f); + guScaleF(sp60, scale, scale, 1.0f); } - shim_guMtxCatF(sp60, sp20, sp20); - shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); + guMtxCatF(sp60, sp20, sp20); + guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPDisplayList(gMainGfxPos++, D_E00D6E40[unk_00]); diff --git a/src/effects/energy_orb_wave.c b/src/effects/energy_orb_wave.c index 401059b49b9..31478761ec8 100644 --- a/src/effects/energy_orb_wave.c +++ b/src/effects/energy_orb_wave.c @@ -25,9 +25,9 @@ EffectInstance* energy_orb_wave_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 bp.renderUI = NULL; bp.effectID = EFFECT_ENERGY_ORB_WAVE; - effect = shim_create_effect_instance(&bp); + effect = create_effect_instance(&bp); 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); data->unk_00 = arg0; @@ -99,7 +99,7 @@ void energy_orb_wave_update(EffectInstance* effect) { data->unk_14++; if (data->unk_10 < 0) { - shim_remove_effect(effect); + remove_effect(effect); return; } @@ -121,7 +121,7 @@ void energy_orb_wave_update(EffectInstance* effect) { data->unk_20 = 70; data->unk_24 = 180; 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; break; case 1: @@ -135,7 +135,7 @@ void energy_orb_wave_update(EffectInstance* effect) { data->unk_20 = 170; data->unk_24 = 40; 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; break; case 3: @@ -149,7 +149,7 @@ void energy_orb_wave_update(EffectInstance* effect) { data->unk_20 = 235; data->unk_24 = 235; 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; break; case 5: @@ -213,11 +213,11 @@ void energy_orb_wave_render(EffectInstance* effect) { renderTask.appendGfxArg = effect; renderTask.renderMode = RENDER_MODE_2D; if (effect82->unk_00 >= 3) { - shim_queue_render_task(renderTaskPointer); + queue_render_task(renderTaskPointer); return; } - retTask = shim_queue_render_task(renderTaskPointer); + retTask = queue_render_task(renderTaskPointer); retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; } @@ -236,10 +236,10 @@ void energy_orb_wave_appendGfx(void* effect) { gDPPipeSync(gMainGfxPos++); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); - shim_guTranslateF(sp18, data->pos.x, data->pos.y, data->pos.z); - shim_guScaleF(sp58, data->scale, data->scale, data->scale); - shim_guMtxCatF(sp58, sp18, sp18); - shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(sp18, data->pos.x, data->pos.y, data->pos.z); + guScaleF(sp58, data->scale, data->scale, data->scale); + guMtxCatF(sp58, sp18, sp18); + guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); 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); @@ -250,16 +250,16 @@ void energy_orb_wave_appendGfx(void* effect) { if (unk_00 < 3) { gSPDisplayList(gMainGfxPos++, D_09001000_3A5320); - shim_guRotateF(sp18, unk_14, 0.0f, 0.0f, 1.0f); - shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); + guRotateF(sp18, unk_14, 0.0f, 0.0f, 1.0f); + guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPDisplayList(gMainGfxPos++, D_090011D0_3A54F0); gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW); gDPSetColorDither(gMainGfxPos++, G_CD_MAGICSQ); - shim_guRotateF(sp18, -unk_14 * 8, 0.0f, 0.0f, 1.0f); - shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); + guRotateF(sp18, -unk_14 * 8, 0.0f, 0.0f, 1.0f); + guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPDisplayList(gMainGfxPos++, D_090011F0_3A5510); diff --git a/src/effects/energy_shockwave.c b/src/effects/energy_shockwave.c index a3ba8e680be..9dba91c7f37 100644 --- a/src/effects/energy_shockwave.c +++ b/src/effects/energy_shockwave.c @@ -29,9 +29,9 @@ void energy_shockwave_main( bp.renderUI = NULL; bp.effectID = EFFECT_ENERGY_SHOCKWAVE; - effect = shim_create_effect_instance(&bp); + effect = create_effect_instance(&bp); 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); data->unk_00 = arg0; @@ -72,15 +72,15 @@ void energy_shockwave_update(EffectInstance* effect) { unk_2C = data->unk_2C; if (unk_28 < 0) { - shim_remove_effect(effect); + remove_effect(effect); return; } if (unk_2C % 2) { angle = func_E0200044(360, unk_2C); - shim_sin_deg(angle); - shim_cos_deg(angle); - shim_load_effect(EFFECT_SHIMMER_WAVE); + sin_deg(angle); + cos_deg(angle); + 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); } @@ -131,7 +131,7 @@ void energy_shockwave_render(EffectInstance* effect) { renderTask.distance = 10; 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; } @@ -158,10 +158,10 @@ void energy_shockwave_appendGfx(void* effect) { gDPSetTileSize(gMainGfxPos++, G_TX_RENDERTILE, uls, ult, uls + 252, ult + 252); gDPSetTileSize(gMainGfxPos++, 1, uls2, ult2, uls2 + 124, ult2 + 124); - shim_guTranslateF(sp10, data->unk_04, data->unk_08, data->unk_0C); - shim_guScaleF(sp50, data->unk_1C, data->unk_1C, data->unk_1C); - shim_guMtxCatF(sp50, sp10, sp10); - shim_guMtxF2L(sp10, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(sp10, data->unk_04, data->unk_08, data->unk_0C); + guScaleF(sp50, data->unk_1C, data->unk_1C, data->unk_1C); + guMtxCatF(sp50, sp10, sp10); + guMtxF2L(sp10, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPDisplayList(gMainGfxPos++, D_09000DC0_3762D0); diff --git a/src/effects/explosion.c b/src/effects/explosion.c index 8fe46237f3f..5c2d11fe289 100644 --- a/src/effects/explosion.c +++ b/src/effects/explosion.c @@ -40,9 +40,9 @@ void explosion_main(s32 type, f32 x, f32 y, f32 z) { bpPtr->effectID = EFFECT_EXPLOSION; - effect = shim_create_effect_instance(bpPtr); + effect = create_effect_instance(bpPtr); 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); data->pos.x = x; @@ -100,7 +100,7 @@ void explosion_update(EffectInstance* effect) { part->unk_30--; if (part->unk_30 < 0) { - shim_remove_effect(effect); + remove_effect(effect); return; } @@ -110,10 +110,10 @@ void explosion_update(EffectInstance* effect) { unk_34 = part->unk_34; 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); } 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); } @@ -156,7 +156,7 @@ void explosion_render(EffectInstance* effect) { renderTask.distance = 10; renderTask.renderMode = RENDER_MODE_2D; - retTask = shim_queue_render_task(&renderTask); + retTask = queue_render_task(&renderTask); } void explosion_appendGfx(void* effect) { @@ -171,10 +171,10 @@ void explosion_appendGfx(void* effect) { gDPPipeSync(gMainGfxPos++); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); - shim_guTranslateF(sp18, part->pos.x, part->pos.y, part->pos.z); - shim_guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); - shim_guMtxCatF(sp58, sp18, sp18); - shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(sp18, part->pos.x, part->pos.y, part->pos.z); + guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guMtxCatF(sp58, sp18, sp18); + guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); part++; @@ -183,8 +183,8 @@ void explosion_appendGfx(void* effect) { if (part->unk_00 != -1) { gSPDisplayList(gMainGfxPos++, D_09000840_3447B0); - shim_guScaleF(sp18, part->unk_20, part->unk_20, 1.0f); - shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); + guScaleF(sp18, part->unk_20, part->unk_20, 1.0f); + guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); gDPSetPrimColor(gMainGfxPos++, 0, 0, 255, 255, 240, part->unk_38); 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); - shim_guScaleF(sp18, part->unk_20, part->unk_20, part->unk_20); - shim_guRotateF(sp58, part->unk_28, 0.0f, 0.0f, 1.0f); - shim_guMtxCatF(sp58, sp18, sp18); - shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); + guScaleF(sp18, part->unk_20, part->unk_20, part->unk_20); + guRotateF(sp58, part->unk_28, 0.0f, 0.0f, 1.0f); + guMtxCatF(sp58, sp18, sp18); + guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); switch (unk_34) { default: diff --git a/src/effects/falling_leaves.c b/src/effects/falling_leaves.c index ab29a6a90f5..8654a627bb5 100644 --- a/src/effects/falling_leaves.c +++ b/src/effects/falling_leaves.c @@ -23,9 +23,9 @@ void falling_leaves_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3) { bp.renderUI = NULL; bp.effectID = EFFECT_FALLING_LEAVES; - effect = shim_create_effect_instance(&bp); + effect = create_effect_instance(&bp); 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); part->unk_00 = arg0; @@ -38,12 +38,12 @@ void falling_leaves_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3) { 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_0C = shim_rand_int(30) - 15; - part->unk_18 = shim_rand_int(360); - part->unk_20 = shim_rand_int(360); - part->unk_1C = shim_rand_int(100) / 10; + part->unk_0C = rand_int(30) - 15; + part->unk_18 = rand_int(360); + part->unk_20 = rand_int(360); + part->unk_1C = rand_int(100) / 10; part->unk_10 = 0; part->unk_14 = 0; } @@ -73,7 +73,7 @@ void falling_leaves_update(EffectInstance* effect) { unk_28 = part->unk_28; if (unk_28 < 0) { - shim_remove_effect(effect); + remove_effect(effect); return; } @@ -87,22 +87,22 @@ void falling_leaves_update(EffectInstance* effect) { 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_10 += temp; if (unk_00 == 0) { 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 { part->unk_14 += -0.05f; part->unk_10 *= 0.92; } - part->unk_1C += shim_rand_int(50) - 25.0f; - part->unk_18 += shim_sin_deg(part->unk_1C) * 10.0f; - part->unk_20 += shim_cos_deg(part->unk_1C * 0.5f) * 10.0f; + part->unk_1C += rand_int(50) - 25.0f; + part->unk_18 += sin_deg(part->unk_1C) * 10.0f; + part->unk_20 += cos_deg(part->unk_1C * 0.5f) * 10.0f; part->unk_04 += part->unk_10; part->unk_08 += part->unk_14; } @@ -117,7 +117,7 @@ void falling_leaves_render(EffectInstance* effect) { renderTask.distance = 0; renderTask.renderMode = RENDER_MODE_2D; - retTask = shim_queue_render_task(&renderTask); + retTask = queue_render_task(&renderTask); retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; } @@ -132,19 +132,19 @@ void falling_leaves_appendGfx(void* effect) { gSPDisplayList(gMainGfxPos++, D_09001100_3601E0); gDPSetPrimColor(gMainGfxPos++, 0, 0, 20, 100, 20, part->unk_24); - shim_guTranslateF(sp18, part->unk_04, part->unk_08, part->unk_0C); - shim_guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); - shim_guMtxCatF(sp58, sp18, sp98); + guTranslateF(sp18, part->unk_04, part->unk_08, part->unk_0C); + guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guMtxCatF(sp58, sp18, sp98); part++; for (i = 1; i < ((EffectInstance*)effect)->numParts; i++, part++) { - shim_guTranslateF(sp58, part->unk_04, part->unk_08, part->unk_0C); - shim_guMtxCatF(sp58, sp98, sp18); - shim_guRotateF(sp58, part->unk_18, 0.0f, 0.0f, 1.0f); - shim_guMtxCatF(sp58, sp18, sp18); - shim_guRotateF(sp58, part->unk_20, 0.0f, 1.0f, 0.0f); - shim_guMtxCatF(sp58, sp18, sp18); - shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(sp58, part->unk_04, part->unk_08, part->unk_0C); + guMtxCatF(sp58, sp98, sp18); + guRotateF(sp58, part->unk_18, 0.0f, 0.0f, 1.0f); + guMtxCatF(sp58, sp18, sp18); + guRotateF(sp58, part->unk_20, 0.0f, 1.0f, 0.0f); + guMtxCatF(sp58, sp18, sp18); + guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPDisplayList(gMainGfxPos++, D_090011B0_360290); diff --git a/src/effects/fire_breath.c b/src/effects/fire_breath.c index 045963be562..d8e3f2e1729 100644 --- a/src/effects/fire_breath.c +++ b/src/effects/fire_breath.c @@ -34,9 +34,9 @@ EffectInstance* fire_breath_main( bp.renderUI = NULL; bp.effectID = EFFECT_FIRE_BREATH; - effect = shim_create_effect_instance(&bp); + effect = create_effect_instance(&bp); 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); data->type = type; @@ -102,7 +102,7 @@ void fire_breath_update(EffectInstance* effect) { data->spawnTimer++; if (data->timeLeft < 0) { - shim_remove_effect(effect); + remove_effect(effect); return; } @@ -126,7 +126,7 @@ void fire_breath_update(EffectInstance* effect) { if (spawnTimer == data->spawnDelay + 1 && data->numChildren > 0) { EffectInstance* spawned; - shim_load_effect(EFFECT_FIRE_BREATH); + load_effect(EFFECT_FIRE_BREATH); spawned = fire_breath_main( 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 @@ -174,7 +174,7 @@ void fire_breath_render(EffectInstance* effect) { } renderTaskPointer->renderMode = RENDER_MODE_2D; - retTask = shim_queue_render_task(renderTaskPointer); + retTask = queue_render_task(renderTaskPointer); 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)); if (type == FIRE_BREATH_SMALL) { - shim_guTranslateF(sp18, data->initPos.x, data->initPos.y, data->initPos.z); - shim_guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); - shim_guMtxCatF(sp58, sp18, sp18); - shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(sp18, data->initPos.x, data->initPos.y, data->initPos.z); + guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guMtxCatF(sp58, sp18, sp18); + guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], 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++, 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); - shim_guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); - shim_guMtxCatF(sp58, sp18, sp18); - shim_guScaleF(sp58, data->scale, data->scale, 0.0f); - shim_guMtxCatF(sp58, sp18, sp18); - shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(sp18, data->pos.x, data->pos.y, data->pos.z); + guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guMtxCatF(sp58, sp18, sp18); + guScaleF(sp58, data->scale, data->scale, 0.0f); + guMtxCatF(sp58, sp18, sp18); + guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); diff --git a/src/effects/fire_flower.c b/src/effects/fire_flower.c index 02d41650da6..57a2ea668ea 100644 --- a/src/effects/fire_flower.c +++ b/src/effects/fire_flower.c @@ -31,9 +31,9 @@ EffectInstance* fire_flower_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, s32 arg bp.renderUI = NULL; bp.effectID = EFFECT_FIRE_FLOWER; - effect = shim_create_effect_instance(&bp); + effect = create_effect_instance(&bp); effect->numParts = numParts; - part = shim_general_heap_malloc(numParts * sizeof(*part)); + part = general_heap_malloc(numParts * sizeof(*part)); effect->data.fireFlower = part; ASSERT(effect->data.fireFlower != NULL); @@ -90,13 +90,13 @@ void fire_flower_update(EffectInstance* effect) { unk_40X = part->unk_40.x; if (unk_04 == 7) { - shim_remove_effect(effect); + remove_effect(effect); return; } switch (unk_04) { 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); part->unk_34 = 0; part->unk_38 = 0; @@ -194,7 +194,7 @@ void fire_flower_render(EffectInstance* effect) { renderTask.distance = 0; renderTask.renderMode = RENDER_MODE_2D; - retTask = shim_queue_render_task(&renderTask); + retTask = queue_render_task(&renderTask); retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; } @@ -212,18 +212,18 @@ void fire_flower_appendGfx(void* effect) { gDPPipeSync(gMainGfxPos++); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); - shim_guTranslateF(sp18, part->pos.x, part->pos.y, part->pos.z); - shim_guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); - shim_guMtxCatF(sp58, sp18, sp18); - shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(sp18, part->pos.x, part->pos.y, part->pos.z); + guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guMtxCatF(sp58, sp18, sp18); + guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gDPSetPrimColor(gMainGfxPos++, 0, 0, 255, 0, 0, part->unk_3C); gDPSetEnvColor(gMainGfxPos++, 255, 0, 0, part->unk_38); if ((u32) (unk_04 - 4) < 3U) { - shim_guTranslateF(sp18, 0.0f, 16.0f, 0.0f); - shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(sp18, 0.0f, 16.0f, 0.0f); + guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPDisplayList(gMainGfxPos++, D_09000DE0_381180); @@ -231,10 +231,10 @@ void fire_flower_appendGfx(void* effect) { part++; for (i = 1; i < ((EffectInstance*)effect)->numParts; i++, part++) { if (part->unk_40.z == 0) { - shim_guRotateF(sp18, part->unk_24, 0.0f, 0.0f, 1.0f); - shim_guTranslateF(sp58, part->pos.x, part->pos.y, part->pos.z); - shim_guMtxCatF(sp58, sp18, sp18); - shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); + guRotateF(sp18, part->unk_24, 0.0f, 0.0f, 1.0f); + guTranslateF(sp58, part->pos.x, part->pos.y, part->pos.z); + guMtxCatF(sp58, sp18, sp18); + guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); 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); @@ -257,12 +257,12 @@ void fire_flower_appendGfx(void* effect) { G_TX_MIRROR | G_TX_WRAP, G_TX_MIRROR | G_TX_WRAP, 5, 5, G_TX_NOLOD, G_TX_NOLOD); - shim_guTranslateF(sp18, unk_2C, 0.0f, 0.0f); - shim_guScaleF(sp58, unk_30, unk_30, unk_30); - shim_guMtxCatF(sp58, sp18, sp18); - shim_guRotateF(sp58, unk_28, 0.0f, 1.0f, 0.0f); - shim_guMtxCatF(sp58, sp18, sp18); - shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(sp18, unk_2C, 0.0f, 0.0f); + guScaleF(sp58, unk_30, unk_30, unk_30); + guMtxCatF(sp58, sp18, sp18); + guRotateF(sp58, unk_28, 0.0f, 1.0f, 0.0f); + guMtxCatF(sp58, sp18, sp18); + guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPDisplayList(gMainGfxPos++, D_09000EF8_381298); diff --git a/src/effects/firework.c b/src/effects/firework.c index 2d5ea059a42..d1f85e28743 100644 --- a/src/effects/firework.c +++ b/src/effects/firework.c @@ -61,9 +61,9 @@ EffectInstance* firework_main( bp.renderUI = func_E0086398; bp.effectID = EFFECT_FIREWORK; - effect = shim_create_effect_instance(&bp); + effect = create_effect_instance(&bp); 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); part->unk_00 = arg0; @@ -105,7 +105,7 @@ EffectInstance* firework_main( part++; for (i = 1; i < numParts; i++, part++) { 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_08 = 0; @@ -137,7 +137,7 @@ void firework_update(EffectInstance* effect) { part->unk_34++; if (part->unk_30 < 0) { - shim_remove_effect(effect); + remove_effect(effect); return; } @@ -198,8 +198,8 @@ void func_E00863B4(EffectInstance* effect) { 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); - shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); + guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].currentYaw, 0.0f, unk_28, part->unk_04, part->unk_08, part->unk_0C); + guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); 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++) { gSPDisplayList(gMainGfxPos++, D_E0086AB4[part->unk_00]); - shim_guRotateF(sp20, part->unk_1C, 0.0f, 0.0f, 1.0f); - shim_guRotateF(sp60, part->unk_24, 0.0f, 1.0f, 0.0f); - shim_guMtxCatF(sp60, sp20, sp20); - shim_guTranslateF(sp60, part->unk_04, part->unk_08, part->unk_0C); - shim_guMtxCatF(sp60, sp20, sp20); - shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); + guRotateF(sp20, part->unk_1C, 0.0f, 0.0f, 1.0f); + guRotateF(sp60, part->unk_24, 0.0f, 1.0f, 0.0f); + guMtxCatF(sp60, sp20, sp20); + guTranslateF(sp60, part->unk_04, part->unk_08, part->unk_0C); + guMtxCatF(sp60, sp20, sp20); + guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPDisplayList(gMainGfxPos++, D_E0086AA0[temp_s32]); @@ -280,8 +280,8 @@ void func_E00863B4(EffectInstance* effect) { gDPSetEnvColor(gMainGfxPos++, envR, envG, engB, envA); gSPDisplayList(gMainGfxPos++, savedGfxPos + 1); - shim_guRotateF(sp20, 120.0f, 1.0f, 1.0f, 1.0f); - shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); + guRotateF(sp20, 120.0f, 1.0f, 1.0f, 1.0f); + guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos], G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPDisplayList(gMainGfxPos++, savedGfxPos + 1); diff --git a/src/effects/firework_rocket.c b/src/effects/firework_rocket.c index b21186d537e..38ea02f4f9a 100644 --- a/src/effects/firework_rocket.c +++ b/src/effects/firework_rocket.c @@ -1,8 +1,6 @@ #include "common.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_render(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.effectID = EFFECT_FIREWORK_ROCKET; - effect = shim_create_effect_instance(&bp); + effect = create_effect_instance(&bp); 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); data->variation = variation; @@ -159,7 +157,7 @@ void firework_rocket_update(EffectInstance* effect) { data->lifeTime++; if (data->timeLeft < 0) { - shim_remove_effect(effect); + remove_effect(effect); return; } @@ -185,11 +183,11 @@ void firework_rocket_update(EffectInstance* effect) { i = lifeTime & 3; data->rocketX[i] = data->pos.x - data->velocity.x * (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->rocketVelocityX[i] = (shim_rand_int(10) - 5) * 0.1f; - data->rocketVelocityY[i] = (shim_rand_int(10) - 5) * 0.1f; - data->rocketVelocityZ[i] = (shim_rand_int(10) - 5) * 0.1f; + data->rocketVelocityX[i] = (rand_int(10) - 5) * 0.1f; + data->rocketVelocityY[i] = (rand_int(10) - 5) * 0.1f; + data->rocketVelocityZ[i] = (rand_int(10) - 5) * 0.1f; for (i = 0; i < 4; i++) { data->rocketX[i] += data->rocketVelocityX[i]; @@ -216,7 +214,7 @@ void firework_rocket_render(EffectInstance* effect) { renderTask.distance = 700; renderTask.renderMode = RENDER_MODE_SURFACE_OPA; - retTask = shim_queue_render_task(&renderTask); + retTask = queue_render_task(&renderTask); retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; } @@ -241,12 +239,12 @@ void firework_rocket_appendGfx(void* effect) { s32 i; negYaw = -camera->currentYaw; - sinTheta = shim_sin_deg(negYaw); - cosTheta = shim_cos_deg(negYaw); + sinTheta = sin_deg(negYaw); + cosTheta = cos_deg(negYaw); isExploded = data->isExploded; if (firework_rocket_frame_counter != gGameStatusPtr->frameCounter) { // 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_blur_alpha = 0; } @@ -293,7 +291,7 @@ void firework_rocket_appendGfx(void* effect) { for (i = 0; i < numSparks; i++, sparkDir++) { if (isExploded == TRUE) { // create blinking effect - if (shim_rand_int(16) < 6) { + if (rand_int(16) < 6) { continue; } x = (sparkDir->x * cosTheta + sparkDir->z * sinTheta) * radius + centerX; diff --git a/src/effects/flame.c b/src/effects/flame.c index 5817b2b3165..5f68e61b4a7 100644 --- a/src/effects/flame.c +++ b/src/effects/flame.c @@ -60,9 +60,9 @@ void flame_main( bpPtr->renderUI = NULL; bpPtr->effectID = EFFECT_FLAME; - effect = shim_create_effect_instance(bpPtr); + effect = create_effect_instance(bpPtr); 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); data->unk_00 = arg0; @@ -120,7 +120,7 @@ void flame_render(EffectInstance* effect) { f32 outZ; 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); outDist = outZ + 5000; @@ -139,7 +139,7 @@ void flame_render(EffectInstance* effect) { renderTaskPtr->appendGfxArg = effect; renderTaskPtr->renderMode = RENDER_MODE_SURFACE_XLU_LAYER1; - shim_queue_render_task(renderTaskPtr); + queue_render_task(renderTaskPtr); } 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); gDPSetEnvColor(gMainGfxPos++, unkStruct->unk_04, unkStruct->unk_05, unkStruct->unk_06, 0); - shim_guTranslateF(sp18, data->pos.x, data->pos.y, data->pos.z); - shim_guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); - shim_guMtxCatF(sp58, sp18, sp98); - shim_guScaleF(sp58, data->unk_10 * data->unk_30, data->unk_10 * data->unk_2C, data->unk_10); - shim_guMtxCatF(sp58, sp98, sp98); - shim_guMtxF2L(sp98, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(sp18, data->pos.x, data->pos.y, data->pos.z); + guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guMtxCatF(sp58, sp18, sp98); + guScaleF(sp58, data->unk_10 * data->unk_30, data->unk_10 * data->unk_2C, data->unk_10); + guMtxCatF(sp58, sp98, sp98); + guMtxF2L(sp98, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); diff --git a/src/effects/flashing_box_shockwave.c b/src/effects/flashing_box_shockwave.c index cb4c530d6d0..ae20db3cb8a 100644 --- a/src/effects/flashing_box_shockwave.c +++ b/src/effects/flashing_box_shockwave.c @@ -31,9 +31,9 @@ EffectInstance* flashing_box_shockwave_main( bp.renderUI = NULL; bp.effectID = EFFECT_FLASHING_BOX_SHOCKWAVE; - effect = shim_create_effect_instance(&bp); + effect = create_effect_instance(&bp); 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); data->unk_1C = 30; @@ -93,7 +93,7 @@ void flashing_box_shockwave_update(EffectInstance* effect) { data->unk_20++; if (data->unk_1C < 0) { - shim_remove_effect(effect); + remove_effect(effect); return; } @@ -131,7 +131,7 @@ void flashing_box_shockwave_render(EffectInstance* effect) { renderTask.distance = 10; 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) { @@ -142,22 +142,22 @@ void flashing_box_shockwave_appendGfx(void* effect) { Matrix4f sp58; 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++); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); - shim_guTranslateF(sp18, data->pos.x, data->pos.y, data->pos.z); - shim_guMtxCatF(sp98, sp18, sp18); - shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(sp18, data->pos.x, data->pos.y, data->pos.z); + guMtxCatF(sp98, sp18, sp18); + guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); 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); gDPSetEnvColor(gMainGfxPos++, data->unk_3C, data->unk_40, data->unk_44, 0); if ((unk_00 == 0 || unk_00 == 1) && unk_20 % 2) { - shim_guScaleF(sp18, data->unk_28, data->unk_2C, 15.0f / 14); - shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); + guScaleF(sp18, data->unk_28, data->unk_2C, 15.0f / 14); + guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); 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); } - shim_guTranslateF(sp18, 0.0f, data->unk_2C, 0.0f); - shim_guScaleF(sp58, data->unk_24 * 0.25, data->unk_24 * 0.25, 1.0f); - shim_guMtxCatF(sp58, sp18, sp18); - shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(sp18, 0.0f, data->unk_2C, 0.0f); + guScaleF(sp58, data->unk_24 * 0.25, data->unk_24 * 0.25, 1.0f); + guMtxCatF(sp58, sp18, sp18); + guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPDisplayList(gMainGfxPos++, D_09000950_3939F0); diff --git a/src/effects/floating_cloud_puff.c b/src/effects/floating_cloud_puff.c index 504c8ced757..d88a0ca67d6 100644 --- a/src/effects/floating_cloud_puff.c +++ b/src/effects/floating_cloud_puff.c @@ -32,9 +32,9 @@ EffectInstance* floating_cloud_puff_main( bp.renderUI = NULL; bp.effectID = EFFECT_FLOATING_CLOUD_PUFF; - effect = shim_create_effect_instance(&bp); + effect = create_effect_instance(&bp); 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); data->unk_00 = arg0; @@ -78,7 +78,7 @@ void floating_cloud_puff_update(EffectInstance* effect) { data->unk_14++; if (data->unk_10 < 0) { - shim_remove_effect(effect); + remove_effect(effect); return; } @@ -106,7 +106,7 @@ void floating_cloud_puff_render(EffectInstance* effect) { renderTask.distance = 10; renderTask.renderMode = RENDER_MODE_2D; - retTask = shim_queue_render_task(&renderTask); + retTask = queue_render_task(&renderTask); retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; } @@ -124,10 +124,10 @@ void floating_cloud_puff_appendGfx(void* effect) { gDPPipeSync(gMainGfxPos++); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); - shim_guTranslateF(sp10, data->unk_04, data->unk_08, data->unk_0C); - shim_guScaleF(sp50, scale, scale, scale); - shim_guMtxCatF(sp50, sp10, sp10); - shim_guMtxF2L(sp10, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(sp10, data->unk_04, data->unk_08, data->unk_0C); + guScaleF(sp50, scale, scale, scale); + guMtxCatF(sp50, sp10, sp10); + guMtxF2L(sp10, &gDisplayContext->matrixStack[gMatrixListPos]); 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); diff --git a/src/effects/floating_flower.c b/src/effects/floating_flower.c index 1ca473ef91f..cebd73d9d22 100644 --- a/src/effects/floating_flower.c +++ b/src/effects/floating_flower.c @@ -24,9 +24,9 @@ void floating_flower_main(s32 type, f32 posX, f32 posY, f32 posZ, s32 duration) bp.renderUI = NULL; bp.effectID = EFFECT_FLOATING_FLOWER; - effect = shim_create_effect_instance(&bp); + effect = create_effect_instance(&bp); 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); @@ -55,15 +55,15 @@ void floating_flower_main(s32 type, f32 posX, f32 posY, f32 posZ, s32 duration) } else { part->accelY = 0.12f; part->jerkY = -0.0152f; - part->rot.x = (shim_rand_int(1) * 30) - 15; - part->rot.y = shim_rand_int(360); + part->rot.x = (rand_int(1) * 30) - 15; + part->rot.y = rand_int(360); 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->lifetime = 0; - part->unk_44 = shim_rand_int(10); - part->unk_40 = shim_rand_int(20); - part->unk_3C = (shim_rand_int(1) * 2) - 1; + part->unk_44 = rand_int(10); + part->unk_40 = rand_int(20); + part->unk_3C = (rand_int(1) * 2) - 1; } D_E001A610++; @@ -123,7 +123,7 @@ void floating_flower_update(EffectInstance* effect) { data->timeLeft--; data->lifetime++; 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.renderMode = RENDER_MODE_2D; - retTask = shim_queue_render_task(&renderTask); + retTask = queue_render_task(&renderTask); retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; } @@ -150,15 +150,15 @@ void floating_flower_appendGfx(void* effect) { gDPPipeSync(gMainGfxPos++); 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); - shim_guMtxF2L(mtxTransform, &gDisplayContext->matrixStack[gMatrixListPos]); + guPositionF(mtxTransform, part->rot.x, part->rot.y, 0.0f, 1.0f, part->pos.x, part->pos.y, part->pos.z); + guMtxF2L(mtxTransform, &gDisplayContext->matrixStack[gMatrixListPos]); a = alpha = 255; gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); if (*gBackgroundFogModePtr == FOG_MODE_1) { - shim_get_background_color_blend(&rgb, &rgb, &rgb, &a); + get_background_color_blend(&rgb, &rgb, &rgb, &a); alpha -= a; } diff --git a/src/effects/floating_rock.c b/src/effects/floating_rock.c index a9e9b5e2a6e..dba55221e48 100644 --- a/src/effects/floating_rock.c +++ b/src/effects/floating_rock.c @@ -29,9 +29,9 @@ EffectInstance* floating_rock_main(s32 type, f32 posX, f32 posY, f32 posZ, f32 f bp.renderUI = NULL; bp.effectID = EFFECT_FLOATING_ROCK; - effect = shim_create_effect_instance(&bp); + effect = create_effect_instance(&bp); 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); 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.z = 0; data->rot.x = 0; - data->rot.y = shim_rand_int(360); - data->rot.z = shim_rand_int(360); + data->rot.y = rand_int(360); + data->rot.z = rand_int(360); data->rotVel.x = 0.0f; data->rotVel.z = 20.0f; data->rotVel.y = -20.0f; @@ -69,7 +69,7 @@ void floating_rock_update(EffectInstance* effect) { data->timeLeft--; data->lifetime++; if (data->timeLeft < 0) { - shim_remove_effect(effect); + remove_effect(effect); return; } @@ -82,7 +82,7 @@ void floating_rock_update(EffectInstance* effect) { data->rot.y += data->rotVel.y; if (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); data->timeLeft = 30; } @@ -103,7 +103,7 @@ void floating_rock_render(EffectInstance *effect) { renderTask.distance = effect76->pos.z; renderTask.renderMode = RENDER_MODE_2D; - retTask = shim_queue_render_task(&renderTask); + retTask = queue_render_task(&renderTask); retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; } @@ -115,8 +115,8 @@ void floating_rock_appendGfx(void* effect) { gDPPipeSync(gMainGfxPos++); 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); - shim_guMtxF2L(mtxTransform, &gDisplayContext->matrixStack[gMatrixListPos]); + guPositionF(mtxTransform, data->rot.x, data->rot.z, data->rot.y, data->scale, data->pos.x, data->pos.y, data->pos.z); + guMtxF2L(mtxTransform, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gDPSetPrimColor(gMainGfxPos++, 0, 0, 215, 215, 110, alpha); diff --git a/src/effects/flower_splash.c b/src/effects/flower_splash.c index b1e28f97b6f..6639c1bd53c 100644 --- a/src/effects/flower_splash.c +++ b/src/effects/flower_splash.c @@ -12,16 +12,16 @@ void flower_splash_update_part_transform(FlowerFXData* effect) { Matrix4f transformMtx; Matrix4f tempMtx; - shim_guRotateF(transformMtx, effect->rot.x, 1.0f, 0.0f, 0.0f); - shim_guRotateF(tempMtx, effect->rot.z, 0.0f, 0.0f, 1.0f); - shim_guMtxCatF(tempMtx, transformMtx, transformMtx); - shim_guRotateF(tempMtx, effect->rot.y, 0.0f, 1.0f, 0.0f); - shim_guMtxCatF(transformMtx, tempMtx, transformMtx); - shim_guScaleF(tempMtx, effect->scale.x, effect->scale.y, effect->scale.z); - shim_guMtxCatF(tempMtx, transformMtx, transformMtx); - shim_guTranslateF(tempMtx, effect->pos.x, effect->pos.y, effect->pos.z); - shim_guMtxCatF(transformMtx, tempMtx, transformMtx); - shim_guMtxF2L(transformMtx, &effect->transformMtx); + guRotateF(transformMtx, effect->rot.x, 1.0f, 0.0f, 0.0f); + guRotateF(tempMtx, effect->rot.z, 0.0f, 0.0f, 1.0f); + guMtxCatF(tempMtx, transformMtx, transformMtx); + guRotateF(tempMtx, effect->rot.y, 0.0f, 1.0f, 0.0f); + guMtxCatF(transformMtx, tempMtx, transformMtx); + guScaleF(tempMtx, effect->scale.x, effect->scale.y, effect->scale.z); + guMtxCatF(tempMtx, transformMtx, transformMtx); + guTranslateF(tempMtx, effect->pos.x, effect->pos.y, effect->pos.z); + guMtxCatF(transformMtx, tempMtx, transformMtx); + guMtxF2L(transformMtx, &effect->transformMtx); } 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.effectID = EFFECT_FLOWER_SPLASH; - effect = shim_create_effect_instance(&bp); + effect = create_effect_instance(&bp); 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); - shim_mem_clear(part, numParts * sizeof(*part)); + mem_clear(part, numParts * sizeof(*part)); for (i = 0; i < numParts; i++, part++) { 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->velocityScaleA = -3.9f; - partAngle = shim_clamp_angle(part->rot.y); - part->velocity.x = shim_sin_deg(partAngle); - part->velocity.z = shim_cos_deg(partAngle); + partAngle = clamp_angle(part->rot.y); + part->velocity.x = sin_deg(partAngle); + part->velocity.z = cos_deg(partAngle); } } @@ -121,7 +121,7 @@ void flower_splash_update(EffectInstance* effect) { } if (!anyAlive) { - shim_remove_effect(effect); + remove_effect(effect); } } @@ -134,12 +134,12 @@ void flower_splash_render(EffectInstance* effect) { renderTask.distance = 0; renderTask.renderMode = RENDER_MODE_28; - retTask = shim_queue_render_task(&renderTask); + retTask = queue_render_task(&renderTask); retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; } void flower_splash_dispose(EffectInstance* effect) { - shim_remove_effect(effect); + remove_effect(effect); } void flower_splash_appendGfx(void* effect) { diff --git a/src/effects/flower_trail.c b/src/effects/flower_trail.c index fd958b2b928..3da947c51f8 100644 --- a/src/effects/flower_trail.c +++ b/src/effects/flower_trail.c @@ -13,16 +13,16 @@ void flower_trail_update_part_transform(FlowerFXData* effect) { Matrix4f transformMtx; Matrix4f tempMtx; - shim_guRotateF(transformMtx, effect->rot.x, 1.0f, 0.0f, 0.0f); - shim_guRotateF(tempMtx, effect->rot.z, 0.0f, 0.0f, 1.0f); - shim_guMtxCatF(tempMtx, transformMtx, transformMtx); - shim_guRotateF(tempMtx, effect->rot.y, 0.0f, 1.0f, 0.0f); - shim_guMtxCatF(transformMtx, tempMtx, transformMtx); - shim_guScaleF(tempMtx, effect->scale.x, effect->scale.y, effect->scale.z); - shim_guMtxCatF(tempMtx, transformMtx, transformMtx); - shim_guTranslateF(tempMtx, effect->pos.x, effect->pos.y, effect->pos.z); - shim_guMtxCatF(transformMtx, tempMtx, transformMtx); - shim_guMtxF2L(transformMtx, &effect->transformMtx); + guRotateF(transformMtx, effect->rot.x, 1.0f, 0.0f, 0.0f); + guRotateF(tempMtx, effect->rot.z, 0.0f, 0.0f, 1.0f); + guMtxCatF(tempMtx, transformMtx, transformMtx); + guRotateF(tempMtx, effect->rot.y, 0.0f, 1.0f, 0.0f); + guMtxCatF(transformMtx, tempMtx, transformMtx); + guScaleF(tempMtx, effect->scale.x, effect->scale.y, effect->scale.z); + guMtxCatF(tempMtx, transformMtx, transformMtx); + guTranslateF(tempMtx, effect->pos.x, effect->pos.y, effect->pos.z); + guMtxCatF(transformMtx, tempMtx, transformMtx); + guMtxF2L(transformMtx, &effect->transformMtx); } 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.effectID = EFFECT_FLOWER_TRAIL; - effect = shim_create_effect_instance(&bp); + effect = create_effect_instance(&bp); 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); - shim_mem_clear(part, numParts * sizeof(*part)); + mem_clear(part, numParts * sizeof(*part)); for (i = 0; i < numParts; i++, part++) { 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.x = 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) { angleOffset = -90.0f; - partAngle = shim_clamp_angle(angle + angleOffset); + partAngle = clamp_angle(angle + angleOffset); } else { angleOffset = 90.0f; - partAngle = shim_clamp_angle(angle + angleOffset); + partAngle = clamp_angle(angle + angleOffset); } - part->velocity.x = shim_sin_deg(partAngle); - part->velocity.z = shim_cos_deg(partAngle); + part->velocity.x = sin_deg(partAngle); + part->velocity.z = cos_deg(partAngle); } } @@ -137,7 +137,7 @@ void flower_trail_update(EffectInstance* effect) { } if (!anyAlive) { - shim_remove_effect(effect); + remove_effect(effect); } } @@ -150,12 +150,12 @@ void flower_trail_render(EffectInstance* effect) { renderTask.distance = 0; renderTask.renderMode = RENDER_MODE_28; - queuedTaskPtr = shim_queue_render_task(&renderTask); + queuedTaskPtr = queue_render_task(&renderTask); queuedTaskPtr->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; } void flower_trail_dispose(EffectInstance* effect) { - shim_remove_effect(effect); + remove_effect(effect); } void flower_trail_appendGfx(void* argEffect) { diff --git a/src/effects/footprint.c b/src/effects/footprint.c index 072a5292ba1..380a18f6ce2 100644 --- a/src/effects/footprint.c +++ b/src/effects/footprint.c @@ -13,10 +13,10 @@ void func_E0018000(FootprintFXData* part) { Matrix4f sp18; Matrix4f sp58; - shim_guTranslateF(sp18, part->unk_0C, part->unk_10, part->unk_14); - shim_guRotateF(sp58, part->unk_28, 0.0f, 1.0f, 0.0f); - shim_guMtxCatF(sp58, sp18, sp18); - shim_guMtxF2L(sp18, &part->mtx); + guTranslateF(sp18, part->unk_0C, part->unk_10, part->unk_14); + guRotateF(sp58, part->unk_28, 0.0f, 1.0f, 0.0f); + guMtxCatF(sp58, sp18, sp18); + guMtxF2L(sp18, &part->mtx); } 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.effectID = EFFECT_FOOTPRINT; - effect = shim_create_effect_instance(&bp); + effect = create_effect_instance(&bp); effect->numParts = 1; - part = shim_general_heap_malloc(numParts * sizeof(*part)); + part = general_heap_malloc(numParts * sizeof(*part)); effect->data.footprint = part; 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++) { 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_28 = (arg3 + (arg4 * 30.0f)) - 15.0f; part->unk_2C = 0.0f; - temp_f20 = shim_clamp_angle(arg3); - part->unk_90 = shim_sin_deg(temp_f20); - part->unk_94 = shim_cos_deg(temp_f20); + temp_f20 = clamp_angle(arg3); + part->unk_90 = sin_deg(temp_f20); + part->unk_94 = cos_deg(temp_f20); temp_f20_2 = (temp_f20 + 45.0f) - (arg4 * 180.0f); - part->unk_0C += shim_sin_deg(temp_f20_2) * 5.0f; - part->unk_14 += shim_cos_deg(temp_f20_2) * 5.0f; + part->unk_0C += sin_deg(temp_f20_2) * 5.0f; + part->unk_14 += cos_deg(temp_f20_2) * 5.0f; part->alpha = 200; } } @@ -93,7 +93,7 @@ void footprint_update(EffectInstance* effect) { } if (!cond) { - shim_remove_effect(effect); + remove_effect(effect); } } @@ -106,12 +106,12 @@ void footprint_render(EffectInstance* effect) { renderTask.distance = 0; renderTask.renderMode = RENDER_MODE_28; - retTask = shim_queue_render_task(&renderTask); + retTask = queue_render_task(&renderTask); retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; } void func_E00183BC(EffectInstance* effect) { - shim_remove_effect(effect); + remove_effect(effect); } void footprint_appendGfx(void* effect) { diff --git a/src/effects/fright_jar.c b/src/effects/fright_jar.c index c45efe5408d..c447ed686a5 100644 --- a/src/effects/fright_jar.c +++ b/src/effects/fright_jar.c @@ -36,9 +36,9 @@ EffectInstance* fright_jar_main( bp.renderUI = NULL; bp.effectID = EFFECT_FRIGHT_JAR; - effect = shim_create_effect_instance(&bp); + effect = create_effect_instance(&bp); 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); data->unk_00 = arg0; @@ -79,7 +79,7 @@ void fright_jar_update(EffectInstance* effect) { data->unk_14++; if (data->unk_10 < 0) { - shim_remove_effect(effect); + remove_effect(effect); return; } @@ -105,7 +105,7 @@ void fright_jar_render(EffectInstance* effect) { renderTask.distance = 10; renderTask.renderMode = RENDER_MODE_2D; - retTask = shim_queue_render_task(&renderTask); + retTask = queue_render_task(&renderTask); retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; } @@ -126,10 +126,10 @@ void fright_jar_appendGfx(void* effect) { gDPPipeSync(gMainGfxPos++); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); - shim_guTranslateF(sp10, data->unk_04, data->unk_08, data->unk_0C); - shim_guScaleF(sp50, -data->unk_28, data->unk_28, data->unk_28); - shim_guMtxCatF(sp50, sp10, sp10); - shim_guMtxF2L(sp10, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(sp10, data->unk_04, data->unk_08, data->unk_0C); + guScaleF(sp50, -data->unk_28, data->unk_28, data->unk_28); + guMtxCatF(sp50, sp10, sp10); + guMtxF2L(sp10, &gDisplayContext->matrixStack[gMatrixListPos]); 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); diff --git a/src/effects/gather_energy_pink.c b/src/effects/gather_energy_pink.c index a02d6b744ef..b72ac6c337b 100644 --- a/src/effects/gather_energy_pink.c +++ b/src/effects/gather_energy_pink.c @@ -32,9 +32,9 @@ void gather_energy_pink_main(s32 type, f32 posX, f32 posY, f32 posZ, f32 scale, bp.renderUI = NULL; bp.effectID = EFFECT_GATHER_ENERGY_PINK; - effect = shim_create_effect_instance(&bp); + effect = create_effect_instance(&bp); 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); data->unk_00 = type; @@ -92,7 +92,7 @@ void gather_energy_pink_update(EffectInstance* effect) { part->unk_2C++; if (part->unk_28 < 0) { - shim_remove_effect(effect); + remove_effect(effect); return; } @@ -112,12 +112,12 @@ void gather_energy_pink_update(EffectInstance* effect) { } 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 { - 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; sp28 *= sp34; @@ -153,7 +153,7 @@ void gather_energy_pink_render(EffectInstance* effect) { renderTask.distance = 0; renderTask.renderMode = RENDER_MODE_2D; - retTask = shim_queue_render_task(&renderTask); + retTask = queue_render_task(&renderTask); 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)); gSPDisplayList(gMainGfxPos++, dlist); - shim_guTranslateF(sp20, part->posB.x, part->posB.y, part->posB.z); - shim_guScaleF(sp60, part->unk_1C, part->unk_1C, 1.0f); - shim_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); - shim_guMtxCatF(sp60, sp20, sp20); - shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(sp20, part->posB.x, part->posB.y, part->posB.z); + guScaleF(sp60, part->unk_1C, part->unk_1C, 1.0f); + guMtxCatF(sp60, sp20, sp20); + guPerspectiveF(sp60, &perspNorm, unk_00 == 1 ? 130.0f : 30.0f, (f32) camera->viewportW / camera->viewportH, 4.0f, 16384.0f, 1.0f); + guMtxCatF(sp60, sp20, sp20); + guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); switch (unk_00) { case 1: - shim_guTranslateF(sp20, 0.0f, 0.0f, -70.0f); + guTranslateF(sp20, 0.0f, 0.0f, -70.0f); break; case 0: - shim_guTranslateF(sp20, 0.0f, 0.0f, -80.0f); + guTranslateF(sp20, 0.0f, 0.0f, -80.0f); 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); diff --git a/src/effects/gather_magic.c b/src/effects/gather_magic.c index 87bd962824f..510299ba180 100644 --- a/src/effects/gather_magic.c +++ b/src/effects/gather_magic.c @@ -26,9 +26,9 @@ EffectInstance* gather_magic_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 ar bp.renderUI = NULL; bp.effectID = EFFECT_GATHER_MAGIC; - effect = shim_create_effect_instance(&bp); + effect = create_effect_instance(&bp); effect->numParts = numParts; - data = shim_general_heap_malloc(numParts * sizeof(*data)); + data = general_heap_malloc(numParts * sizeof(*data)); effect->data.gatherMagic = data; ASSERT(effect->data.gatherMagic != NULL); @@ -88,7 +88,7 @@ void gather_magic_update(EffectInstance* effect) { part->unk_1C++; if (part->unk_18 < 0) { - shim_remove_effect(effect); + remove_effect(effect); return; } @@ -111,10 +111,10 @@ void gather_magic_update(EffectInstance* effect) { f32 unk_20 = part->unk_20; f32 unk_2C = part->unk_2C; f32 unk_24 = part->unk_24; - f32 sin_20 = shim_sin_deg(unk_20); - f32 cos_20 = shim_cos_deg(unk_20); - f32 sin_24 = shim_sin_deg(unk_24); - f32 cos_24 = shim_cos_deg(unk_24); + f32 sin_20 = sin_deg(unk_20); + f32 cos_20 = cos_deg(unk_20); + f32 sin_24 = sin_deg(unk_24); + f32 cos_24 = cos_deg(unk_24); part->unk_08 = unk_2C * sin_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.renderMode = RENDER_MODE_SURFACE_XLU_LAYER3; - retTask = shim_queue_render_task(&renderTask); + retTask = queue_render_task(&renderTask); retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; } @@ -164,10 +164,10 @@ void gather_magic_appendGfx(void* effect) { gDPPipeSync(gMainGfxPos++); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); - shim_guTranslateF(sp18, part->unk_08, part->unk_0C, part->unk_10); - shim_guRotateF(sp98, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); - shim_guMtxCatF(sp98, sp18, sp18); - shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(sp18, part->unk_08, part->unk_0C, part->unk_10); + guRotateF(sp98, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guMtxCatF(sp98, sp18, sp18); + guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(gMainGfxPos++, D_09000080_38F790); @@ -180,10 +180,10 @@ void gather_magic_appendGfx(void* effect) { if (scale != 0.0f) { 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); - shim_guScaleF(sp58, scale, scale, scale); - shim_guMtxCatF(sp58, sp18, sp18); - shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(sp18, part->unk_08, part->unk_0C, part->unk_10); + guScaleF(sp58, scale, scale, scale); + guMtxCatF(sp58, sp18, sp18); + guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPDisplayList(gMainGfxPos++, D_E008E890[i & 1]); diff --git a/src/effects/got_item_outline.c b/src/effects/got_item_outline.c index c9101c9ddae..8d055031a10 100644 --- a/src/effects/got_item_outline.c +++ b/src/effects/got_item_outline.c @@ -41,9 +41,9 @@ void got_item_outline_main( bp.renderUI = NULL; bp.effectID = EFFECT_GOT_ITEM_OUTLINE; - effect = shim_create_effect_instance(&bp); + effect = create_effect_instance(&bp); 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); data->timeLeft = 100; @@ -67,7 +67,7 @@ void got_item_outline_update(EffectInstance* effect) { if (data->timeLeft < 100) { data->timeLeft--; if (data->timeLeft < 0) { - shim_remove_effect(effect); + remove_effect(effect); return; } } @@ -100,7 +100,7 @@ void got_item_outline_render(EffectInstance* effect) { renderTask.distance = 0; renderTask.renderMode = RENDER_MODE_2D; - retTask = shim_queue_render_task(&renderTask); + retTask = queue_render_task(&renderTask); retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; } @@ -128,17 +128,17 @@ void got_item_outline_appendGfx(void* effect) { gDPSetEnvColor(gMainGfxPos++, 255, 255, 0, 255); } - shim_guTranslateF(mtxTransform, data->pos.x, data->pos.y, data->pos.z); - shim_guRotateF(mtxTemp, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); - shim_guMtxCatF(mtxTemp, mtxTransform, mtxTransform); - shim_guTranslateF(mtxTemp, 0.0f, 0.0f, -2.0f); - shim_guMtxCatF(mtxTemp, mtxTransform, mtxTransform); + guTranslateF(mtxTransform, data->pos.x, data->pos.y, data->pos.z); + guRotateF(mtxTemp, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guMtxCatF(mtxTemp, mtxTransform, mtxTransform); + guTranslateF(mtxTemp, 0.0f, 0.0f, -2.0f); + guMtxCatF(mtxTemp, mtxTransform, mtxTransform); scale *= 0.6; - shim_guScaleF(mtxTemp, scale, scale, 1.0f); - shim_guMtxCatF(mtxTemp, mtxTransform, mtxTransform); - shim_guMtxF2L(mtxTransform, &gDisplayContext->matrixStack[gMatrixListPos]); + guScaleF(mtxTemp, scale, scale, 1.0f); + guMtxCatF(mtxTemp, mtxTransform, mtxTransform); + guMtxF2L(mtxTransform, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); diff --git a/src/effects/green_impact.c b/src/effects/green_impact.c index 1bf4128de52..0098e7c7e34 100644 --- a/src/effects/green_impact.c +++ b/src/effects/green_impact.c @@ -35,12 +35,12 @@ EffectInstance* green_impact_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 ar bpPtr->renderUI = NULL; bpPtr->effectID = EFFECT_GREEN_IMPACT; - effect = shim_create_effect_instance(bpPtr); + effect = create_effect_instance(bpPtr); 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); - shim_mem_clear(part, numParts * sizeof(*part)); + mem_clear(part, numParts * sizeof(*part)); part->unk_2C = 0; part->unk_00 = arg0; @@ -77,7 +77,7 @@ void green_impact_update(EffectInstance* effect) { part->unk_28--; if (part->unk_28 < 0) { - shim_remove_effect(effect); + remove_effect(effect); return; } @@ -93,8 +93,8 @@ void green_impact_update(EffectInstance* effect) { part->unk_04 = 0; part->unk_08 = 0; part->unk_0C = 0; - part->unk_10 = -shim_sin_deg(part->unk_34) * 0.5; - part->unk_14 = shim_cos_deg(part->unk_34) * 0.5; + part->unk_10 = -sin_deg(part->unk_34) * 0.5; + part->unk_14 = cos_deg(part->unk_34) * 0.5; part->unk_18 = 0; part->unk_20 = 10.0f; part->unk_3C = 32.0f; @@ -126,7 +126,7 @@ void green_impact_render(EffectInstance* effect) { renderTask.distance = 0; renderTask.renderMode = RENDER_MODE_28; - retTask = shim_queue_render_task(&renderTask); + retTask = queue_render_task(&renderTask); } 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)); gSPDisplayList(gMainGfxPos++, dlist); - shim_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]); + guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, part->unk_04, part->unk_08, part->unk_0C); + guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); 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++; for (i = 1; i < ((EffectInstance*)effect)->numParts; i++, part++) { if (part->unk_4C >= 0) { - shim_guTranslateF(sp20, part->unk_04, part->unk_08, part->unk_0C); - shim_guRotateF(sp60, part->unk_34, 0.0f, 0.0f, 1.0f); - shim_guMtxCatF(sp60, sp20, sp20); - shim_guScaleF(sp60, part->unk_1C * 0.3, part->unk_20 * 0.3, part->unk_24 * 0.3); - shim_guMtxCatF(sp60, sp20, sp20); - shim_guRotateF(sp60, part->unk_30, 0.0f, 1.0f, 0.0f); - shim_guMtxCatF(sp60, sp20, sp20); - shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(sp20, part->unk_04, part->unk_08, part->unk_0C); + guRotateF(sp60, part->unk_34, 0.0f, 0.0f, 1.0f); + guMtxCatF(sp60, sp20, sp20); + guScaleF(sp60, part->unk_1C * 0.3, part->unk_20 * 0.3, part->unk_24 * 0.3); + guMtxCatF(sp60, sp20, sp20); + guRotateF(sp60, part->unk_30, 0.0f, 1.0f, 0.0f); + guMtxCatF(sp60, sp20, sp20); + guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); dlist2 = D_09000540_365EF0; diff --git a/src/effects/hieroglyphs.c b/src/effects/hieroglyphs.c index f79bb66b56b..14ff080eec9 100644 --- a/src/effects/hieroglyphs.c +++ b/src/effects/hieroglyphs.c @@ -39,10 +39,10 @@ EffectInstance* hieroglyphs_main(s32 arg0, f32 posX, f32 posY, f32 posZ, f32 arg effectBp.renderUI = NULL; effectBp.effectID = EFFECT_HIEROGLYPHS; - effect = shim_create_effect_instance(&effectBp); + effect = create_effect_instance(&effectBp); 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); data->unk_00 = arg0; @@ -85,7 +85,7 @@ void hieroglyphs_update(EffectInstance* effect) { } temp_a2 = ++data->lifeTime; if (data->timeLeft < 0) { - shim_remove_effect(effect); + remove_effect(effect); return; } if (data->timeLeft < 16) { @@ -105,7 +105,7 @@ void hieroglyphs_render(EffectInstance* effect) { renderTask.distance = 10; renderTask.renderMode = RENDER_MODE_2D; - retTask = shim_queue_render_task(&renderTask); + retTask = queue_render_task(&renderTask); retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; } @@ -125,10 +125,10 @@ void hieroglyphs_appendGfx(void* effect) { gDPPipeSync(gMainGfxPos++); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); - shim_guTranslateF(sp20, data->pos.x, data->pos.y, data->pos.z); - shim_guScaleF(sp60, data->unk_38, data->unk_38, data->unk_38); - shim_guMtxCatF(sp60, sp20, sp20); - shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(sp20, data->pos.x, data->pos.y, data->pos.z); + guScaleF(sp60, data->unk_38, data->unk_38, data->unk_38); + guMtxCatF(sp60, sp20, sp20); + guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); 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); @@ -144,18 +144,18 @@ void hieroglyphs_appendGfx(void* effect) { (lifeTime * 2 + 127) * 4, 31 * 4); gMainGfxPos += 2; - shim_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); - shim_guMtxCatF(sp60, sp20, sp20); - shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); + guRotateF(sp20, 20.0f, 1.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); + guMtxCatF(sp60, sp20, sp20); + guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); for (i = 0; i < 16; i++) { 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); - shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); + guPositionF(sp20, 0.0f, sin_deg(angle) * 30.0f, 6.0f, (f32) i * 0.01 + 1.0, 8.0f, 0.0f, 0.0f); + guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW); 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++) { s32 idx = (lifeTime + i * 4) % 17; - shim_guPositionF(sp20, 0.0f, 0.0f, -0x11A + i * 0x24, 1.0f, 0.0f, 0.0f, 0.0f); - shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); + guPositionF(sp20, 0.0f, 0.0f, -0x11A + i * 0x24, 1.0f, 0.0f, 0.0f, 0.0f); + guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); 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); diff --git a/src/effects/huff_puff_breath.c b/src/effects/huff_puff_breath.c index c0beebb5128..25fd9f341fb 100644 --- a/src/effects/huff_puff_breath.c +++ b/src/effects/huff_puff_breath.c @@ -26,10 +26,10 @@ EffectInstance* huff_puff_breath_main(s32 type, f32 posX, f32 posY, f32 posZ, f3 effectBp.renderUI = NULL; effectBp.effectID = EFFECT_HUFF_PUFF_BREATH; - effect = shim_create_effect_instance(&effectBp); + effect = create_effect_instance(&effectBp); 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); 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->speedY = 0; data->speedX = speed; - data->texOffsetX = shim_rand_int(32); - data->texOffsetY = shim_rand_int(16); + data->texOffsetX = rand_int(32); + data->texOffsetY = rand_int(16); data->primB = 150; data->envR = 215; data->envG = 210; @@ -84,7 +84,7 @@ void huff_puff_breath_update(EffectInstance* effect) { temp_a2 = ++data->lifeTime; if (data->timeLeft < 0) { - shim_remove_effect(effect); + remove_effect(effect); return; } if (data->timeLeft < 16) { @@ -118,7 +118,7 @@ void huff_puff_breath_render(EffectInstance* effect) { renderTask.distance = 10; renderTask.renderMode = RENDER_MODE_2D; - retTask = shim_queue_render_task(&renderTask); + retTask = queue_render_task(&renderTask); } void func_E00DC2FC(void) { @@ -137,12 +137,12 @@ void huff_puff_breath_appendGfx(void* effect) { gDPPipeSync(gMainGfxPos++); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); - shim_guTranslateF(sp18, data->pos.x, data->pos.y, data->pos.z); - shim_guRotateF(sp58, data->angle, 0.0f, 0.0f, 1.0f); - shim_guMtxCatF(sp58, sp18, sp18); - shim_guScaleF(sp58, data->scale, data->scale, data->scale); - shim_guMtxCatF(sp58, sp18, sp18); - shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(sp18, data->pos.x, data->pos.y, data->pos.z); + guRotateF(sp58, data->angle, 0.0f, 0.0f, 1.0f); + guMtxCatF(sp58, sp18, sp18); + guScaleF(sp58, data->scale, data->scale, data->scale); + guMtxCatF(sp58, sp18, sp18); + guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); 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); diff --git a/src/effects/ice_pillar.c b/src/effects/ice_pillar.c index 4d7745fcdae..42b1d9158c9 100644 --- a/src/effects/ice_pillar.c +++ b/src/effects/ice_pillar.c @@ -28,10 +28,10 @@ EffectInstance* ice_pillar_main(s32 arg0, f32 x, f32 y, f32 z, f32 scale, s32 ar effectBp.renderUI = NULL; effectBp.effectID = EFFECT_ICE_PILLAR; - effect = shim_create_effect_instance(&effectBp); + effect = create_effect_instance(&effectBp); 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); 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->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); - shim_load_effect(EFFECT_COLD_BREATH); + load_effect(EFFECT_COLD_BREATH); return effect; } @@ -84,30 +84,30 @@ void ice_pillar_update(EffectInstance* effect) { data->lifeTime++; if (data->timeLeft < 0) { - shim_load_effect(EFFECT_ICE_SHARD); + load_effect(EFFECT_ICE_SHARD); for (i = 0; i < 20; i++) { EffectInstance* iceShard; iceShard = ice_shard_main( (i % 2) + 2, - (data->pos.x + shim_rand_int(20)) - 10.0f, - data->pos.y + (shim_rand_int(40) * data->scale), + (data->pos.x + rand_int(20)) - 10.0f, + data->pos.y + (rand_int(40) * data->scale), 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 ); - iceShard->data.iceShard->animFrame = shim_rand_int(10) * 0.1; - iceShard->data.iceShard->animRate = (shim_rand_int(30) * 0.01) + 0.1; - iceShard->data.iceShard->rotation = shim_rand_int(359); - iceShard->data.iceShard->angularVel = shim_rand_int(20); - iceShard->data.iceShard->vel.x = shim_rand_int(10) - 5; - iceShard->data.iceShard->vel.y = shim_rand_int(10) - 5; + iceShard->data.iceShard->animFrame = rand_int(10) * 0.1; + iceShard->data.iceShard->animRate = (rand_int(30) * 0.01) + 0.1; + iceShard->data.iceShard->rotation = rand_int(359); + iceShard->data.iceShard->angularVel = rand_int(20); + iceShard->data.iceShard->vel.x = rand_int(10) - 5; + iceShard->data.iceShard->vel.y = rand_int(10) - 5; iceShard->data.iceShard->vel.z = 0; iceShard->data.iceShard->gravAccel = -0.1f; } - shim_remove_effect(data->miscParticles); - shim_remove_effect(effect); + remove_effect(data->miscParticles); + remove_effect(effect); return; } @@ -116,7 +116,7 @@ void ice_pillar_update(EffectInstance* effect) { data->unk_25--; 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) { @@ -126,7 +126,7 @@ void ice_pillar_update(EffectInstance* effect) { } 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); } data->miscParticles->data.miscParticles->pos.x = data->pos.x; @@ -143,7 +143,7 @@ void ice_pillar_render(EffectInstance* effect) { renderTask.distance = 5; renderTask.renderMode = RENDER_MODE_2D; - retTask = shim_queue_render_task(&renderTask); + retTask = queue_render_task(&renderTask); 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)); camera = &gCameras[gCurrentCameraID]; - shim_guTranslateF(sp10, data->pos.x, data->pos.y, data->pos.z); - shim_guScaleF(sp50, data->scale, data->scale, data->scale); - shim_guMtxCatF(sp50, sp10, sp10); - shim_guMtxF2L(sp10, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(sp10, data->pos.x, data->pos.y, data->pos.z); + guScaleF(sp50, data->scale, data->scale, data->scale); + guMtxCatF(sp50, sp10, sp10); + guMtxF2L(sp10, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); diff --git a/src/effects/ice_shard.c b/src/effects/ice_shard.c index f8116bf45e8..ad6bf8976d9 100644 --- a/src/effects/ice_shard.c +++ b/src/effects/ice_shard.c @@ -33,9 +33,9 @@ EffectInstance* ice_shard_main( bp.renderUI = NULL; bp.effectID = EFFECT_ICE_SHARD; - effect = shim_create_effect_instance(&bp); + effect = create_effect_instance(&bp); 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); data->type = arg0; @@ -58,12 +58,12 @@ EffectInstance* ice_shard_main( data->envCol.b = 255; data->envCol.a = 255; data->animFrame = 0; - data->animRate = (shim_rand_int(1) * 2 - 1) * 0.25 * (shim_rand_int(4) * 0.1 + 0.1); - data->rotation = shim_rand_int(359); - data->vel.x = shim_rand_int(10) - 5; - data->vel.y = shim_rand_int(10) - 5; - data->vel.z = shim_rand_int(10) - 5; - data->angularVel = shim_rand_int(40) - 20; + data->animRate = (rand_int(1) * 2 - 1) * 0.25 * (rand_int(4) * 0.1 + 0.1); + data->rotation = rand_int(359); + data->vel.x = rand_int(10) - 5; + data->vel.y = rand_int(10) - 5; + data->vel.z = rand_int(10) - 5; + data->angularVel = rand_int(40) - 20; data->gravAccel = -0.1f; return effect; @@ -88,7 +88,7 @@ void ice_shard_update(EffectInstance* effect) { data->lifetime++; if (data->timeLeft < 0) { - shim_remove_effect(effect); + remove_effect(effect); return; } @@ -126,7 +126,7 @@ void ice_shard_render(EffectInstance* effect) { renderTask.distance = 10; renderTask.renderMode = RENDER_MODE_2D; - retTask = shim_queue_render_task(&renderTask); + retTask = queue_render_task(&renderTask); retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; } @@ -143,13 +143,13 @@ void ice_shard_appendGfx(void* effect) { gDPPipeSync(gMainGfxPos++); 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); - shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); + guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].currentYaw, 0.0f, data->scale, data->pos.x, data->pos.y, data->pos.z); + guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); 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); - shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); + guRotateF(sp20, data->rotation, 0.0f, 0.0f, 1.0f); + guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPDisplayList(gMainGfxPos++, D_E01108B4[0]); diff --git a/src/effects/landing_dust.c b/src/effects/landing_dust.c index a1aeb90b8d4..a265602896e 100644 --- a/src/effects/landing_dust.c +++ b/src/effects/landing_dust.c @@ -101,14 +101,14 @@ void landing_dust_main(s32 type, f32 x, f32 y, f32 z, f32 arg4) { bpPtr->renderUI = NULL; bpPtr->effectID = EFFECT_LANDING_DUST; - effect = shim_create_effect_instance(bpPtr); + effect = create_effect_instance(bpPtr); effect->numParts = numParts; - data = shim_general_heap_malloc(numParts * sizeof(*data)); + data = general_heap_malloc(numParts * sizeof(*data)); effect->data.landingDust = data; ASSERT(effect->data.landingDust != NULL); - shim_mem_clear(data, numParts * sizeof(*data)); + mem_clear(data, numParts * sizeof(*data)); switch (type) { 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->y = 0.0f; data->z = 4.0f; - theta = shim_clamp_angle(90 + (180 * (i - 1))); - data->unk_30 = shim_sin_deg(theta); - data->unk_34 = shim_cos_deg(theta); + theta = clamp_angle(90 + (180 * (i - 1))); + data->unk_30 = sin_deg(theta); + data->unk_34 = cos_deg(theta); } break; case 2: @@ -159,27 +159,27 @@ void landing_dust_main(s32 type, f32 x, f32 y, f32 z, f32 arg4) { switch (i - 1) { case 0: theta = 135.0f; - data->x = -shim_sin_deg(theta) * 25.0f; + data->x = -sin_deg(theta) * 25.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_28 = 0.94f; data->unk_20 = 0.95f; break; case 1: theta = -135.0f; - data->x = -shim_sin_deg(theta) * 25.0f; + data->x = -sin_deg(theta) * 25.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_28 = 0.94f; data->unk_20 = 0.84999996f; break; case 2: theta = 20.0f; - data->x = -shim_sin_deg(theta) * 25.0f; + data->x = -sin_deg(theta) * 25.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_28 = 0.94f; 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_2C = 0.94f; 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->z = -shim_cos_deg(theta) * 10.0f; - data->unk_30 = shim_sin_deg(theta); - data->unk_34 = shim_cos_deg(theta); + data->z = -cos_deg(theta) * 10.0f; + data->unk_30 = sin_deg(theta); + data->unk_34 = cos_deg(theta); } break; } @@ -218,7 +218,7 @@ void landing_dust_update(EffectInstance* effect) { data->unk_40 = D_E000CD24[data->unk_38][data->unk_3C++]; if (data->unk_40 < 0) { - shim_remove_effect(effect); + remove_effect(effect); } else { s32 type = data->type; s32 i; @@ -253,7 +253,7 @@ void landing_dust_render(EffectInstance* effect) { renderTask.distance = 0; renderTask.renderMode = RENDER_MODE_28; - retTask = shim_queue_render_task(&renderTask); + retTask = queue_render_task(&renderTask); retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; } @@ -286,10 +286,10 @@ void landing_dust_appendGfx(void* effect) { spD8 = temp_t0 & 7; spDC = temp_t0 & 0x40; - shim_guTranslateF(mtx1, part->x, part->y, part->z); - shim_guRotateF(mtx2, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); - shim_guMtxCatF(mtx2, mtx1, mtx3); - shim_guMtxF2L(mtx3, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(mtx1, part->x, part->y, part->z); + guRotateF(mtx2, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guMtxCatF(mtx2, mtx1, mtx3); + guMtxF2L(mtx3, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); @@ -332,8 +332,8 @@ void landing_dust_appendGfx(void* effect) { part++; for (i = 1; i < ((EffectInstance*)effect)->numParts; i++, part++) { - shim_guTranslateF(mtx1, part->x, part->y, part->z); - shim_guMtxF2L(mtx1, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(mtx1, part->x, part->y, part->z); + guMtxF2L(mtx1, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPDisplayList(gMainGfxPos++, dlist1); diff --git a/src/effects/lens_flare.c b/src/effects/lens_flare.c index 07a05b3f5a5..3497010e894 100644 --- a/src/effects/lens_flare.c +++ b/src/effects/lens_flare.c @@ -36,9 +36,9 @@ void lens_flare_main(s32 type, f32 posX, f32 posY, f32 posZ, s32 duration) { bp.renderUI = NULL; bp.effectID = EFFECT_LENS_FLARE; - effect = shim_create_effect_instance(&bp); + effect = create_effect_instance(&bp); 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); data->type = type; @@ -73,7 +73,7 @@ void lens_flare_update(EffectInstance* effect) { data->lifetime++; if (data->timeLeft < 0) { - shim_remove_effect(effect); + remove_effect(effect); return; } @@ -89,8 +89,8 @@ void lens_flare_update(EffectInstance* effect) { data->largeFlareScaleVel += 0.29; data->largeFlareRot += data->largeFlareRotVel; data->largeFlareRotVel *= 0.93; - data->smallFlareScale = shim_sin_deg(time * 50) * 0.5 + 0.9; - data->smallFlareAlpha = shim_sin_deg(time * 40) * 64.0f + 144.0f; + data->smallFlareScale = sin_deg(time * 50) * 0.5 + 0.9; + data->smallFlareAlpha = sin_deg(time * 40) * 64.0f + 144.0f; } void lens_flare_render(EffectInstance* effect) { @@ -102,7 +102,7 @@ void lens_flare_render(EffectInstance* effect) { renderTask.distance = 20; renderTask.renderMode = RENDER_MODE_2D; - retTask = shim_queue_render_task(&renderTask); + retTask = queue_render_task(&renderTask); 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)); gSPDisplayList(gMainGfxPos++, D_E0034788[type]); - shim_guTranslateF(mtxTransform, data->pos.x, data->pos.y, data->pos.z); - shim_guRotateF(mtxTemp, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); - shim_guMtxCatF(mtxTemp, mtxTransform, mtxShared); + guTranslateF(mtxTransform, data->pos.x, data->pos.y, data->pos.z); + guRotateF(mtxTemp, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guMtxCatF(mtxTemp, mtxTransform, mtxShared); alpha = data->smallFlareAlpha; idx = data->lifetime * 3; // small twinkling shine which changes color if (type == 0) { - shim_guScaleF(mtxTemp, data->smallFlareScale, data->smallFlareScale, data->smallFlareScale); - shim_guMtxCatF(mtxTemp, mtxShared, mtxTransform); - shim_guMtxF2L(mtxTransform, &gDisplayContext->matrixStack[gMatrixListPos]); + guScaleF(mtxTemp, data->smallFlareScale, data->smallFlareScale, data->smallFlareScale); + guMtxCatF(mtxTemp, mtxShared, mtxTransform); + guMtxF2L(mtxTransform, &gDisplayContext->matrixStack[gMatrixListPos]); idx %= ARRAY_COUNT(D_E0034790); @@ -147,11 +147,11 @@ void lens_flare_appendGfx(void* effect) { // large growing white shine if (alpha > 0) { - shim_guScaleF(mtxTemp, data->largeFlareScale, data->largeFlareScale, data->largeFlareScale); - shim_guMtxCatF(mtxTemp, mtxShared, mtxTransform); - shim_guRotateF(mtxTemp, data->largeFlareRot, 0.0f, 0.0f, 1.0f); - shim_guMtxCatF(mtxTemp, mtxTransform, mtxTransform); - shim_guMtxF2L(mtxTransform, &gDisplayContext->matrixStack[gMatrixListPos]); + guScaleF(mtxTemp, data->largeFlareScale, data->largeFlareScale, data->largeFlareScale); + guMtxCatF(mtxTemp, mtxShared, mtxTransform); + guRotateF(mtxTemp, data->largeFlareRot, 0.0f, 0.0f, 1.0f); + guMtxCatF(mtxTemp, mtxTransform, mtxTransform); + 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, 255, 255, 255, alpha); diff --git a/src/effects/light_rays.c b/src/effects/light_rays.c index df2549f31b1..fb0d0c20948 100644 --- a/src/effects/light_rays.c +++ b/src/effects/light_rays.c @@ -107,9 +107,9 @@ void light_rays_main( bpPtr->renderUI = NULL; bpPtr->effectID = EFFECT_LIGHT_RAYS; - effect = shim_create_effect_instance(bpPtr); + effect = create_effect_instance(bpPtr); 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); part->type = type; @@ -201,7 +201,7 @@ void light_rays_update(EffectInstance* effect) { } if (part->timeLeft < 0) { - shim_remove_effect(effect); + remove_effect(effect); return; } @@ -263,7 +263,7 @@ void light_rays_render(EffectInstance* effect) { renderTask.distance = 10; renderTask.renderMode = RENDER_MODE_2D; - retTask = shim_queue_render_task(&renderTask); + retTask = queue_render_task(&renderTask); 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)); 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++; for (i = 1; i < ((EffectInstance*)effect)->numParts; i++, part++) { @@ -306,8 +306,8 @@ void light_rays_appendGfx(void* effect) { func_E006A85C(part); } - shim_guRotateF(mtxTemp, part->rotation.x, 1.0f, 0.0f, 0.0f); - shim_guMtxCatF(mtxTemp, mtxTranslate, mtxTransform); + guRotateF(mtxTemp, part->rotation.x, 1.0f, 0.0f, 0.0f); + guMtxCatF(mtxTemp, mtxTranslate, mtxTransform); if (type >= 2) { unk_64 = part->rotation.z; @@ -317,12 +317,12 @@ void light_rays_appendGfx(void* effect) { angleZ = unk_64 + 0.0f; } - shim_guRotateF(mtxTemp, angleZ, 0.0f, 0.0f, 1.0f); - shim_guMtxCatF(mtxTemp, mtxTransform, mtxTransform); - shim_guRotateF(mtxTemp, part->rotation.y, 0.0f, 1.0f, 0.0f); - shim_guMtxCatF(mtxTemp, mtxTransform, mtxTransform); - shim_guTranslateF(mtxTemp, part->unk_58, 0.0f, 0.0f); - shim_guMtxCatF(mtxTemp, mtxTransform, mtxTransform); + guRotateF(mtxTemp, angleZ, 0.0f, 0.0f, 1.0f); + guMtxCatF(mtxTemp, mtxTransform, mtxTransform); + guRotateF(mtxTemp, part->rotation.y, 0.0f, 1.0f, 0.0f); + guMtxCatF(mtxTemp, mtxTransform, mtxTransform); + guTranslateF(mtxTemp, part->unk_58, 0.0f, 0.0f); + guMtxCatF(mtxTemp, mtxTransform, mtxTransform); scaleX = scaleZ = (temp + 3.0f) * 0.25; switch (i & 3) { @@ -341,22 +341,22 @@ void light_rays_appendGfx(void* effect) { break; } - shim_guScaleF(mtxTemp, scaleX, scaleY, scaleZ); - shim_guMtxCatF(mtxTemp, mtxTransform, mtxTransform); + guScaleF(mtxTemp, scaleX, scaleY, scaleZ); + guMtxCatF(mtxTemp, mtxTransform, mtxTransform); gDPSetPrimColor(gMainGfxPos++, 0, 0, 255, 255, 240, part->alpha); } else { - shim_guRotateF(mtxTemp, part->rotation.y, 0.0f, 1.0f, 0.0f); - shim_guMtxCatF(mtxTemp, mtxTransform, mtxTransform); - shim_guRotateF(mtxTemp, part->rotation.z, 0.0f, 0.0f, 1.0f); - shim_guMtxCatF(mtxTemp, mtxTransform, mtxTransform); - shim_guTranslateF(mtxTemp, part->unk_58, 0.0f, 0.0f); - shim_guMtxCatF(mtxTemp, mtxTransform, mtxTransform); + guRotateF(mtxTemp, part->rotation.y, 0.0f, 1.0f, 0.0f); + guMtxCatF(mtxTemp, mtxTransform, mtxTransform); + guRotateF(mtxTemp, part->rotation.z, 0.0f, 0.0f, 1.0f); + guMtxCatF(mtxTemp, mtxTransform, mtxTransform); + guTranslateF(mtxTemp, part->unk_58, 0.0f, 0.0f); + guMtxCatF(mtxTemp, mtxTransform, mtxTransform); 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); gSPDisplayList(gMainGfxPos++, dlist); diff --git a/src/effects/lightning.c b/src/effects/lightning.c index d3ebbae5cc5..2dbb180837f 100644 --- a/src/effects/lightning.c +++ b/src/effects/lightning.c @@ -45,9 +45,9 @@ EffectInstance* lightning_main( bp.renderUI = NULL; bp.effectID = EFFECT_LIGHTNING; - effect = shim_create_effect_instance(&bp); + effect = create_effect_instance(&bp); 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); data->unk_00 = arg0; @@ -74,13 +74,13 @@ EffectInstance* lightning_main( if (arg0 == 1 || arg0 == 2) { 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); - 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); } 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->data.snakingStatic->unk_28 = 255; @@ -95,7 +95,7 @@ EffectInstance* lightning_main( if (arg0 >= 3) { s32 effectArg0; - shim_load_effect(EFFECT_FLASHING_BOX_SHOCKWAVE); + load_effect(EFFECT_FLASHING_BOX_SHOCKWAVE); if (gGameStatusPtr->isBattle == TRUE) { effectArg0 = 3; } else { @@ -128,15 +128,15 @@ void lightning_update(EffectInstance* effect) { data->unk_18++; if (data->unk_14 < 0) { - shim_remove_effect(effect); + remove_effect(effect); if (data->unk_48 != NULL) { - shim_remove_effect(data->unk_48); + remove_effect(data->unk_48); data->unk_48 = NULL; } if (data->unk_44 != NULL) { - shim_remove_effect(data->unk_44); + remove_effect(data->unk_44); data->unk_44 = NULL; } } else { @@ -144,7 +144,7 @@ void lightning_update(EffectInstance* effect) { s32 unk_18 = data->unk_18; if (data->unk_44 != NULL && unk_18 >= 18) { - shim_remove_effect(data->unk_44); + remove_effect(data->unk_44); data->unk_44 = NULL; } @@ -208,7 +208,7 @@ void lightning_render(EffectInstance* effect) { renderTask.distance = 10; 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; } @@ -245,24 +245,24 @@ void lightning_appendGfx(void* effect) { case 0: case 1: case 2: - shim_guPerspectiveF(sp20, &perspNorm, 30.0f, (f32) camera->viewportW / (f32) camera->viewportH, 4.0f, 16384.0f, 1.0f); - shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); + guPerspectiveF(sp20, &perspNorm, 30.0f, (f32) camera->viewportW / (f32) camera->viewportH, 4.0f, 16384.0f, 1.0f); + guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); 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); - shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(sp20, data->unk_04, data->unk_08, -500.0f); + guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gDPSetPrimColor(gMainGfxPos++, 0, 0, 255, 47, 198, 255); break; default: - shim_guTranslateF(sp20, data->unk_04, data->unk_08, data->unk_0C); - shim_guRotateF(sp60, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); - shim_guMtxCatF(sp60, sp20, sp20); - shim_guTranslateF(sp60, 0.0f, 0.0f, 1.0f); - shim_guMtxCatF(sp60, sp20, sp20); - shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(sp20, data->unk_04, data->unk_08, data->unk_0C); + guRotateF(sp60, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guMtxCatF(sp60, sp20, sp20); + guTranslateF(sp60, 0.0f, 0.0f, 1.0f); + guMtxCatF(sp60, sp20, sp20); + guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gDPSetPrimColor(gMainGfxPos++, 0, 0, 255, 255, 0, data->unk_10); diff --git a/src/effects/lightning_bolt.c b/src/effects/lightning_bolt.c index ffe28234b2c..6d623829ce5 100644 --- a/src/effects/lightning_bolt.c +++ b/src/effects/lightning_bolt.c @@ -67,9 +67,9 @@ EffectInstance* lightning_bolt_main( bp.renderUI = NULL; bp.effectID = EFFECT_LIGHTNING_BOLT; - effect = shim_create_effect_instance(&bp); + effect = create_effect_instance(&bp); 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); data->type = type; @@ -94,14 +94,14 @@ EffectInstance* lightning_bolt_main( temp = SQ(startX - endX) + SQ(startY - endY) + SQ(startZ - endZ); 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.g = 220; data->outerColor.b = 20; data->innerColor.r = 255; data->innerColor.g = 255; data->innerColor.b = 255; - data->unk_110 = shim_rand_int(359); + data->unk_110 = rand_int(359); return effect; } else { @@ -113,7 +113,7 @@ void lightning_bolt_init(EffectInstance* effect) { } 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) { @@ -132,7 +132,7 @@ void lightning_bolt_update(EffectInstance* effect) { data->lifetime++; if (data->timeLeft < 0) { - shim_remove_effect(effect); + remove_effect(effect); return; } @@ -162,7 +162,7 @@ void lightning_bolt_render(EffectInstance *effect) { } renderTaskPointer->renderMode = RENDER_MODE_2D; - retTask = shim_queue_render_task(renderTaskPointer); + retTask = queue_render_task(renderTaskPointer); retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; } @@ -208,8 +208,8 @@ void lightning_bolt_appendGfx(void* effect) { gDPPipeSync(gMainGfxPos++); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); - shim_guScaleF(sp10, 0.1f, 0.1f, 0.1f); - shim_guMtxF2L(sp10, &gDisplayContext->matrixStack[gMatrixListPos]); + guScaleF(sp10, 0.1f, 0.1f, 0.1f); + guMtxF2L(sp10, &gDisplayContext->matrixStack[gMatrixListPos]); 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); @@ -237,8 +237,8 @@ void lightning_bolt_appendGfx(void* effect) { theta = (data->unk_110 + (i - lifetime) * 10) % 120 - 60; deltaPos = preset->offset[i]; - sinAngle = shim_sin_deg(theta) * deltaPos * 0.04; - cosAngle = shim_cos_deg(theta) * deltaPos * 0.04; + sinAngle = sin_deg(theta) * deltaPos * 0.04; + cosAngle = cos_deg(theta) * deltaPos * 0.04; deltaX = avgDeltaX * cosAngle - avgDeltaY * sinAngle; deltaY = avgDeltaX * sinAngle + avgDeltaY * cosAngle; @@ -258,14 +258,14 @@ void lightning_bolt_appendGfx(void* effect) { for (i = 0; i < ARRAY_COUNT(data->boltVertexPosX); i++) { if (i == 0) { 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 { edgeLength = 8.0f; if (i == ARRAY_COUNT(data->boltVertexPosX) - 1) { edgeAngle = -90.0f; } else { - nextAngle = -shim_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]); + nextAngle = -atan2(data->boltVertexPosY[i + 1], -data->boltVertexPosX[i + 1], data->boltVertexPosY[i], -data->boltVertexPosX[i]); + prevAngle = -atan2(data->boltVertexPosY[i], -data->boltVertexPosX[i], data->boltVertexPosY[i - 1], -data->boltVertexPosX[i - 1]); if (prevAngle - nextAngle > 180.0f) { nextAngle += 360.0f; } else if (prevAngle - nextAngle < -180.0f) { @@ -283,8 +283,8 @@ void lightning_bolt_appendGfx(void* effect) { edgeLength *= (widthScale * data->edgeLength[i]); texOffsetX = (128 - i * 12) * 32; - edgeDeltaX = edgeLength * shim_sin_deg(edgeAngle); - edgeDeltaY = edgeLength * shim_cos_deg(edgeAngle); + edgeDeltaX = edgeLength * sin_deg(edgeAngle); + edgeDeltaY = edgeLength * cos_deg(edgeAngle); edgeDeltaZ = 0.0f; vtx->ob[0] = (data->boltVertexPosX[i] + edgeDeltaX) * 10.0f; diff --git a/src/effects/lil_oink.c b/src/effects/lil_oink.c index 66a3f7bfe77..ec98b923c1c 100644 --- a/src/effects/lil_oink.c +++ b/src/effects/lil_oink.c @@ -63,9 +63,9 @@ EffectInstance* lil_oink_main(void) { bp.renderUI = NULL; bp.effectID = EFFECT_LIL_OINK; - effect = shim_create_effect_instance(&bp); + effect = create_effect_instance(&bp); 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); data->lifetime = 0; @@ -109,7 +109,7 @@ void lil_oink_update(EffectInstance* effect) { break; case LIL_OINK_ANIM_3: 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) { animDone = TRUE; data->animTime[i] = 0; @@ -117,7 +117,7 @@ void lil_oink_update(EffectInstance* effect) { break; case LIL_OINK_ANIM_2: 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; if (time >= 9) { data->jumpOffset[i] = 0.0f; @@ -126,7 +126,7 @@ void lil_oink_update(EffectInstance* effect) { break; case LIL_OINK_ANIM_4: 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)) { animDone = TRUE; data->jumpOffset[i] = 0.0f; @@ -136,7 +136,7 @@ void lil_oink_update(EffectInstance* effect) { case LIL_OINK_ANIM_5: default: 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)) { animDone = TRUE; data->jumpOffset[i] = 0.0f; @@ -164,7 +164,7 @@ void lil_oink_render(EffectInstance* effect) { renderTask.distance = 10; renderTask.renderMode = RENDER_MODE_2D; - retTask = shim_queue_render_task(&renderTask); + retTask = queue_render_task(&renderTask); 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++) { 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]); - 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); gSPDisplayList(gMainGfxPos++, D_E0114718[data->type[i]]); 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; gDPSetPrimColor(gMainGfxPos++, 0, 0, primColor, primColor, primColor, 0); diff --git a/src/effects/merlin_house_stars.c b/src/effects/merlin_house_stars.c index e7dc284aa1f..6a96602fc11 100644 --- a/src/effects/merlin_house_stars.c +++ b/src/effects/merlin_house_stars.c @@ -22,9 +22,9 @@ EffectInstance* merlin_house_stars_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3) bp.renderUI = NULL; bp.effectID = EFFECT_MERLIN_HOUSE_STARS; - effect = shim_create_effect_instance(&bp); + effect = create_effect_instance(&bp); 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); data->unk_04 = 100; @@ -63,7 +63,7 @@ void merlin_house_stars_update(EffectInstance* effect) { data->unk_08++; if (data->unk_04 < 0) { - shim_remove_effect(effect); + remove_effect(effect); return; } @@ -119,7 +119,7 @@ void merlin_house_stars_render(EffectInstance* effect) { renderTask.distance = 0; renderTask.renderMode = RENDER_MODE_2D; - retTask = shim_queue_render_task(&renderTask); + retTask = queue_render_task(&renderTask); retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; } @@ -137,10 +137,10 @@ void merlin_house_stars_appendGfx(void* effect) { gDPPipeSync(gMainGfxPos++); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); - shim_guTranslateF(sp10, data->unk_0C, data->unk_10, data->unk_14); - shim_guScaleF(sp50, 0.96f, 0.96f, 0.96f); - shim_guMtxCatF(sp50, sp10, sp10); - shim_guMtxF2L(sp10, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(sp10, data->unk_0C, data->unk_10, data->unk_14); + guScaleF(sp50, 0.96f, 0.96f, 0.96f); + guMtxCatF(sp50, sp10, sp10); + guMtxF2L(sp10, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gDPSetPrimColor(gMainGfxPos++, 0, 0, 0, 0, 0, 127); diff --git a/src/effects/misc_particles.c b/src/effects/misc_particles.c index bfe5c97c19b..21d39e99b6c 100644 --- a/src/effects/misc_particles.c +++ b/src/effects/misc_particles.c @@ -69,9 +69,9 @@ EffectInstance* misc_particles_main( bp.renderUI = NULL; bp.effectID = EFFECT_MISC_PARTICLES; - effect = shim_create_effect_instance(&bp); + effect = create_effect_instance(&bp); 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); part->variation = variation; @@ -113,9 +113,9 @@ EffectInstance* misc_particles_main( part->glowColor.a = 255; break; default: - part->innerColor.r = shim_rand_int(127) + 128; - part->innerColor.g = shim_rand_int(255 - part->innerColor.r) + 128; - part->innerColor.b = shim_rand_int(383 - part->innerColor.r - part->innerColor.g) + 128; + part->innerColor.r = rand_int(127) + 128; + part->innerColor.g = rand_int(255 - part->innerColor.r) + 128; + part->innerColor.b = rand_int(383 - part->innerColor.r - part->innerColor.g) + 128; part->glowColor.r = 127; part->glowColor.g = 127; part->glowColor.b = 127; @@ -172,7 +172,7 @@ void misc_particles_update(EffectInstance* effect) { particle->lifetime++; if (particle->timeLeft < 0) { - shim_remove_effect(effect); + remove_effect(effect); return; } @@ -187,8 +187,8 @@ void misc_particles_update(EffectInstance* effect) { posX = particle->pos.x; posY = particle->pos.y; posZ = particle->pos.z; - temp_cos = shim_cos_deg(gCameras[gCurrentCameraID].currentYaw); - temp_sin = shim_sin_deg(gCameras[gCurrentCameraID].currentYaw); + temp_cos = cos_deg(gCameras[gCurrentCameraID].currentYaw); + temp_sin = sin_deg(gCameras[gCurrentCameraID].currentYaw); innerColorR = particle->innerColor.r; innerColorG = particle->innerColor.g; innerColorB = particle->innerColor.b; @@ -208,9 +208,9 @@ void misc_particles_update(EffectInstance* effect) { 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.y = posY + shim_rand_int(scaleY); + particle->pos.y = posY + rand_int(scaleY); particle->pos.z = posZ + randMag * temp_sin + temp_cos; particle->innerColor.r = innerColorR; particle->innerColor.g = innerColorG; @@ -224,10 +224,10 @@ void misc_particles_update(EffectInstance* effect) { particle->unk_18 = 0.0f; particle->unk_1C = 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_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->pos.x += particle->unk_18; @@ -241,16 +241,16 @@ void misc_particles_update(EffectInstance* effect) { case 3: if (particle->animTime == 0) { if (variation == 2) { - particle->unk_18 = (f32) (shim_rand_int(20) - 10) * 0.05; - particle->unk_1C = (f32) (shim_rand_int(20) - 10) * 0.05; + particle->unk_18 = (f32) (rand_int(20) - 10) * 0.05; + particle->unk_1C = (f32) (rand_int(20) - 10) * 0.05; } else { particle->unk_18 = 0.0f; particle->unk_1C = 0.0f; } particle->unk_24 = 0.0f; particle->unk_28 = 0.0f; - particle->unk_5C = shim_rand_int(15); - particle->unk_60 = shim_rand_int(15); + particle->unk_5C = rand_int(15); + particle->unk_60 = rand_int(15); particle->innerColor.a = 255; } 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->innerColor.a = 255; particle->scale = 1.0f; - particle->innerColor.r = shim_rand_int(127) + 128; - particle->innerColor.g = shim_rand_int(255 - particle->innerColor.r) + 128; - particle->innerColor.b = shim_rand_int(383 - particle->innerColor.r - particle->innerColor.g) + 128; + particle->innerColor.r = rand_int(127) + 128; + particle->innerColor.g = rand_int(255 - particle->innerColor.r) + 128; + particle->innerColor.b = rand_int(383 - particle->innerColor.r - particle->innerColor.g) + 128; } if (variation == 4) { particle->scale = (f32) D_E00E4DE0[particle->animTime] * 0.01; @@ -291,7 +291,7 @@ void misc_particles_render(EffectInstance* effect) { renderTask.distance = 7; renderTask.renderMode = RENDER_MODE_2D; - retTask = shim_queue_render_task(&renderTask); + retTask = queue_render_task(&renderTask); retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; } @@ -314,8 +314,8 @@ void misc_particles_appendGfx(void* effect) { particle++; for (i = 1; i < ((EffectInstance*)effect)->numParts; i++, particle++) { 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); - shim_guMtxF2L(mtxTransform, &gDisplayContext->matrixStack[gMatrixListPos]); + guPositionF(mtxTransform, 0.0f, -gCameras[gCurrentCameraID].currentYaw, 0.0f, particle->scale * alphaScale, particle->pos.x, particle->pos.y, particle->pos.z); + guMtxF2L(mtxTransform, &gDisplayContext->matrixStack[gMatrixListPos]); 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); diff --git a/src/effects/motion_blur_flame.c b/src/effects/motion_blur_flame.c index 9732d30492f..68684a4d16e 100644 --- a/src/effects/motion_blur_flame.c +++ b/src/effects/motion_blur_flame.c @@ -44,9 +44,9 @@ EffectInstance* motion_blur_flame_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f bp.renderUI = NULL; bp.effectID = EFFECT_MOTION_BLUR_FLAME; - effect = shim_create_effect_instance(&bp); + effect = create_effect_instance(&bp); 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); data->unk_00 = arg0; @@ -90,7 +90,7 @@ void motion_blur_flame_update(EffectInstance* effect) { } if (data->unk_50 < 0) { - shim_remove_effect(effect); + remove_effect(effect); return; } temp = data->unk_50; @@ -116,7 +116,7 @@ void motion_blur_flame_render(EffectInstance* effect) { renderTask.distance = 100; renderTask.renderMode = RENDER_MODE_2D; - retTask = shim_queue_render_task(&renderTask); + retTask = queue_render_task(&renderTask); retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; } @@ -165,7 +165,7 @@ void motion_blur_flame_appendGfx(void* effect) { s32 height = temp_s1->unk_14; 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 { var_a2 = temp_f0; sp48 = temp_f12; diff --git a/src/effects/moving_cloud.c b/src/effects/moving_cloud.c index 3f16c75f39f..fd20cdce68f 100644 --- a/src/effects/moving_cloud.c +++ b/src/effects/moving_cloud.c @@ -40,9 +40,9 @@ EffectInstance* moving_cloud_main( bp.renderUI = NULL; bp.effectID = EFFECT_MOVING_CLOUD; - effect = shim_create_effect_instance(&bp); + effect = create_effect_instance(&bp); 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); data->unk_00 = arg0; @@ -54,7 +54,7 @@ EffectInstance* moving_cloud_main( var_f12 = SQ(temp_f24) + SQ(temp_f22) + SQ(temp_f20); if (var_f12 != 0.0f) { - var_f12 = shim_sqrtf(var_f12); + var_f12 = sqrtf(var_f12); } if (arg7 > 0.0f) { @@ -132,7 +132,7 @@ void moving_cloud_update(EffectInstance* effect) { data->unk_20++; if (data->unk_1C < 0) { - shim_remove_effect(effect); + remove_effect(effect); return; } @@ -172,7 +172,7 @@ void moving_cloud_render(EffectInstance* effect) { renderTask.distance = 10; renderTask.renderMode = RENDER_MODE_2D; - retTask = shim_queue_render_task(&renderTask); + retTask = queue_render_task(&renderTask); retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; } @@ -186,10 +186,10 @@ void moving_cloud_appendGfx(void* effect) { gDPPipeSync(gMainGfxPos++); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); - shim_guTranslateF(sp10, data->unk_04, data->unk_08, data->unk_0C); - shim_guScaleF(sp50, data->unk_44, data->unk_44, data->unk_44); - shim_guMtxCatF(sp50, sp10, sp10); - shim_guMtxF2L(sp10, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(sp10, data->unk_04, data->unk_08, data->unk_0C); + guScaleF(sp50, data->unk_44, data->unk_44, data->unk_44); + guMtxCatF(sp50, sp10, sp10); + guMtxF2L(sp10, &gDisplayContext->matrixStack[gMatrixListPos]); 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); diff --git a/src/effects/music_note.c b/src/effects/music_note.c index 92829bf236d..e70390aa3a3 100644 --- a/src/effects/music_note.c +++ b/src/effects/music_note.c @@ -48,10 +48,10 @@ void music_note_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3) { bp.renderUI = NULL; bp.effectID = EFFECT_MUSIC_NOTE; - effect = shim_create_effect_instance(bpPtr); + effect = create_effect_instance(bpPtr); 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); @@ -63,7 +63,7 @@ void music_note_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3) { part->timeLeft = 0x40; part->unk_14 = 0; part->unk_1C = 0; - part->unk_20 = shim_rand_int(6); + part->unk_20 = rand_int(6); switch (arg0) { case 0: 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; break; case 1: - randInt = shim_rand_int(10); + randInt = rand_int(10); 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_30 = 0.0f; break; default: - randInt = shim_rand_int(10); + randInt = rand_int(10); 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_30 = 0.0f; break; @@ -99,7 +99,7 @@ void music_note_update(EffectInstance* effect) { part->unk_1C++; timeLeft = part->timeLeft; if (timeLeft < 0) { - shim_remove_effect(effect); + remove_effect(effect); return; } if (timeLeft >= 6) { @@ -124,7 +124,7 @@ void music_note_render(EffectInstance* effect) { renderTask.distance = 0; renderTask.renderMode = RENDER_MODE_2D; - retTask = shim_queue_render_task(&renderTask); + retTask = queue_render_task(&renderTask); retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; } @@ -146,12 +146,12 @@ void music_note_appendGfx(void* data) { gDPSetPrimColor(gMainGfxPos++, 0, 0, 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); - shim_guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); - shim_guMtxCatF(sp58, sp18, sp18); - shim_guScaleF(sp58, fxData->unk_10, fxData->unk_10, 0.0f); - shim_guMtxCatF(sp58, sp18, sp18); - shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(sp18, fxData->pos.x, fxData->pos.y, fxData->pos.z); + guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guMtxCatF(sp58, sp18, sp18); + guScaleF(sp58, fxData->unk_10, fxData->unk_10, 0.0f); + guMtxCatF(sp58, sp18, sp18); + guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPDisplayList(gMainGfxPos++, D_E004C660[dlistIdx]); gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW); diff --git a/src/effects/partner_buff.c b/src/effects/partner_buff.c index 3fa2f27e75c..6caadfcc418 100644 --- a/src/effects/partner_buff.c +++ b/src/effects/partner_buff.c @@ -49,9 +49,9 @@ EffectInstance* partner_buff_main(s32 useRandomValues, f32 arg1, f32 arg2, f32 a bp.renderUI = func_E011A3A0; bp.effectID = EFFECT_PARTNER_BUFF; - effect = shim_create_effect_instance(&bp); + effect = create_effect_instance(&bp); 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); part->useRandomValues = useRandomValues; @@ -97,7 +97,7 @@ void partner_buff_update(EffectInstance* effect) { data->lifeTime++; if (data->timeLeft < 0) { - shim_remove_effect(effect); + remove_effect(effect); return; } @@ -111,7 +111,7 @@ void partner_buff_update(EffectInstance* effect) { } // possibly a leftover debug option if (useRandomValues == 1 && time % 30 == 0) { - buff->turnsLeft = shim_rand_int(4); + buff->turnsLeft = rand_int(4); } switch (buff->state) { diff --git a/src/effects/peach_star_beam.c b/src/effects/peach_star_beam.c index 7e4bcd42f50..3e4d5fa879b 100644 --- a/src/effects/peach_star_beam.c +++ b/src/effects/peach_star_beam.c @@ -48,9 +48,9 @@ EffectInstance* peach_star_beam_main(s32 type, f32 x, f32 y, f32 z, f32 arg4, s3 bp.renderUI = NULL; bp.effectID = EFFECT_PEACH_STAR_BEAM; - effect = shim_create_effect_instance(&bp); + effect = create_effect_instance(&bp); 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); data->type = type; @@ -117,7 +117,7 @@ void peach_star_beam_update(EffectInstance* effect) { data->lifetime++; if (data->timeLeft < 0) { - shim_remove_effect(effect); + remove_effect(effect); return; } @@ -137,9 +137,9 @@ void peach_star_beam_update(EffectInstance* effect) { part->pos.z = centerZ; } else { 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.z = centerZ + radius * shim_cos_deg(spiritAngle); + part->pos.z = centerZ + radius * cos_deg(spiritAngle); } if (!(part->flags & 2)) { part->lockedPos.x = part->pos.x; @@ -158,7 +158,7 @@ void peach_star_beam_render(EffectInstance* effect) { renderTask.distance = 10; renderTask.renderMode = RENDER_MODE_2D; - retTask = shim_queue_render_task(&renderTask); + retTask = queue_render_task(&renderTask); retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; } @@ -189,8 +189,8 @@ void peach_star_beam_appendGfx(void* effect) { } if (!(data->pos.z < partZ)) { - shim_guPositionF(sp20, 0.0f, 0.0f, 0.0f, SPRITE_WORLD_SCALE_F, partX, partY, partZ); - shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); + guPositionF(sp20, 0.0f, 0.0f, 0.0f, SPRITE_WORLD_SCALE_F, partX, partY, partZ); + guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], 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); - shim_guScaleF(sp60, data->beamScale * 0.4, data->beamScale * 0.4, data->beamScale * 0.4); - shim_guMtxCatF(sp60, sp20, sp20); - shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(sp20, data->pos.x, data->pos.y - (((f32) (255 - data->unk_3C) * 400.0) / 255.0), data->pos.z); + guScaleF(sp60, data->beamScale * 0.4, data->beamScale * 0.4, data->beamScale * 0.4); + guMtxCatF(sp60, sp20, sp20); + guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], 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)) { - shim_guPositionF(sp20, 0.0f, 0.0f, 0.0f, 0.67f, partX, partY, partZ); - shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); + guPositionF(sp20, 0.0f, 0.0f, 0.0f, 0.67f, partX, partY, partZ); + guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); diff --git a/src/effects/pink_sparkles.c b/src/effects/pink_sparkles.c index d8c05bc3bb8..288520938b3 100644 --- a/src/effects/pink_sparkles.c +++ b/src/effects/pink_sparkles.c @@ -113,9 +113,9 @@ EffectInstance* pink_sparkles_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 a bp.renderUI = NULL; bp.effectID = EFFECT_PINK_SPARKLES; - effect = shim_create_effect_instance(&bp); + effect = create_effect_instance(&bp); 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); 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 (j = 0; j < 16; j++) { 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_08 = i * 2 + (shim_rand_int(20) - 10) * 0.1; - part->unk_0C = temp_f20 * shim_sin_deg(angle); + part->unk_04 = temp_f20 * cos_deg(angle); + part->unk_08 = i * 2 + (rand_int(20) - 10) * 0.1; + part->unk_0C = temp_f20 * sin_deg(angle); part->unk_10 = part->unk_04 * 0.04; part->unk_14 = part->unk_08 * 0.04; - part->unk_18 = shim_rand_int(10) * 0.001; - part->unk_1C = shim_rand_int(7) + 30; + part->unk_18 = rand_int(10) * 0.001; + part->unk_1C = rand_int(7) + 30; part->unk_20 = 0; count++; @@ -210,7 +210,7 @@ void pink_sparkles_update(EffectInstance* effect) { } 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.renderMode = RENDER_MODE_2D; - retTask = shim_queue_render_task(&renderTask); + retTask = queue_render_task(&renderTask); } void pink_sparkles_appendGfx(void* effect) { @@ -246,21 +246,21 @@ void pink_sparkles_appendGfx(void* effect) { colorIdx = (part->unk_20 - 1) * 3; - shim_guTranslateF(sp98, part->unk_04, part->unk_08, part->unk_0C); - shim_guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); - shim_guMtxCatF(sp58, sp98, sp98); + guTranslateF(sp98, part->unk_04, part->unk_08, part->unk_0C); + guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guMtxCatF(sp58, sp98, sp98); part++; for (i = 0; i < ((EffectInstance*)effect)->numParts - 1; i++, part++) { s32 unk_28 = part->unk_28; 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; - shim_guMtxCatF(sp58, sp98, sp18); - shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); + guMtxCatF(sp58, sp98, sp18); + guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); if (colorIdx >= ARRAY_COUNT(D_E0124BC0)) { colorIdx = 0; diff --git a/src/effects/purple_ring.c b/src/effects/purple_ring.c index ee7a23b34d4..e837d13a803 100644 --- a/src/effects/purple_ring.c +++ b/src/effects/purple_ring.c @@ -42,7 +42,7 @@ EffectInstance* purple_ring_main( return NULL; } - temp_f12 = 1.0f / shim_sqrtf(temp_f12); + temp_f12 = 1.0f / sqrtf(temp_f12); arg4 *= temp_f12; arg5 *= temp_f12; arg6 *= temp_f12; @@ -66,7 +66,7 @@ EffectInstance* purple_ring_main( return NULL; } - temp_f12 = 1.0f / shim_sqrtf(temp_f12); + temp_f12 = 1.0f / sqrtf(temp_f12); var_f22 *= temp_f12; var_f24 *= temp_f12; var_f20 *= temp_f12; @@ -80,7 +80,7 @@ EffectInstance* purple_ring_main( return NULL; } - temp_f12 = 1.0f / shim_sqrtf(temp_f12); + temp_f12 = 1.0f / sqrtf(temp_f12); sp68 *= temp_f12; sp6C *= temp_f12; sp70 *= temp_f12; @@ -92,9 +92,9 @@ EffectInstance* purple_ring_main( bpPtr->renderUI = NULL; bpPtr->effectID = EFFECT_PURPLE_RING; - effect = shim_create_effect_instance(bpPtr); + effect = create_effect_instance(bpPtr); 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); data->unk_00 = arg0; @@ -148,7 +148,7 @@ void purple_ring_update(EffectInstance* effect) { part->unk_70++; if (part->unk_6C < 0) { - shim_remove_effect(effect); + remove_effect(effect); return; } @@ -184,7 +184,7 @@ void purple_ring_render(EffectInstance* effect) { renderTask.distance = 0; renderTask.renderMode = RENDER_MODE_2D; - retTask = shim_queue_render_task(&renderTask); + retTask = queue_render_task(&renderTask); retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; } @@ -200,11 +200,11 @@ void purple_ring_appendGfx(void* effect) { gSPDisplayList(gMainGfxPos++, D_09000200_352EE0); 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); - shim_guMtxCatF(data->unk_1C, sp10, sp10); - shim_guScaleF(sp50, data->unk_64, data->unk_64, data->unk_64); - shim_guMtxCatF(sp50, sp10, sp10); - shim_guMtxF2L(sp10, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(sp10, data->unk_04, data->unk_08, data->unk_0C); + guMtxCatF(data->unk_1C, sp10, sp10); + guScaleF(sp50, data->unk_64, data->unk_64, data->unk_64); + guMtxCatF(sp50, sp10, sp10); + guMtxF2L(sp10, &gDisplayContext->matrixStack[gMatrixListPos]); 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); diff --git a/src/effects/quizmo_answer.c b/src/effects/quizmo_answer.c index 8249a99fa8a..b8bfedca8a0 100644 --- a/src/effects/quizmo_answer.c +++ b/src/effects/quizmo_answer.c @@ -15,7 +15,7 @@ EffectInstance* quizmo_answer_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3) { bp.renderUI = NULL; bp.effectID = EFFECT_QUIZMO_ANSWER; - effect = shim_create_effect_instance(&bp); + effect = create_effect_instance(&bp); effect->data.quizmoAnswer = NULL; gDPPipeSync(gMainGfxPos++); @@ -34,6 +34,6 @@ EffectInstance* quizmo_answer_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3) { gDPPipeSync(gMainGfxPos++); gSPSegment(gMainGfxPos++, 0x00, NULL); - shim_remove_effect(effect); + remove_effect(effect); return NULL; } diff --git a/src/effects/quizmo_assistant.c b/src/effects/quizmo_assistant.c index 578718fcb43..9a98e995ad7 100644 --- a/src/effects/quizmo_assistant.c +++ b/src/effects/quizmo_assistant.c @@ -36,9 +36,9 @@ EffectInstance* quizmo_assistant_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f3 bp.renderUI = NULL; bp.effectID = EFFECT_QUIZMO_ASSISTANT; - effect = shim_create_effect_instance(&bp); + effect = create_effect_instance(&bp); 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); data->unk_00 = arg0; @@ -75,7 +75,7 @@ void quizmo_assistant_update(EffectInstance* effect) { data->lifetime++; if (data->vanishTimer < 0) { - shim_remove_effect(effect); + remove_effect(effect); return; } @@ -93,7 +93,7 @@ void quizmo_assistant_render(EffectInstance* effect) { renderTask.distance = 10; renderTask.renderMode = RENDER_MODE_2D; - retTask = shim_queue_render_task(&renderTask); + retTask = queue_render_task(&renderTask); retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; } @@ -108,14 +108,14 @@ void quizmo_assistant_appendGfx(void* effect) { gDPPipeSync(gMainGfxPos++); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); - shim_guTranslateF(sp18, data->position.x, data->position.y, data->position.z); - shim_guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); - shim_guMtxCatF(sp58, sp18, sp18); - shim_guTranslateF(sp58, 89.5f, 0.0f, 2.0f); - shim_guMtxCatF(sp58, sp18, sp18); - shim_guScaleF(sp58, 5.0f / 7, 5.0f / 7, 5.0f / 7); - shim_guMtxCatF(sp58, sp18, sp18); - shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(sp18, data->position.x, data->position.y, data->position.z); + guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guMtxCatF(sp58, sp18, sp18); + guTranslateF(sp58, 89.5f, 0.0f, 2.0f); + guMtxCatF(sp58, sp18, sp18); + guScaleF(sp58, 5.0f / 7, 5.0f / 7, 5.0f / 7); + guMtxCatF(sp58, sp18, sp18); + guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gDPSetPrimColor(gMainGfxPos++, 0, 0, fadeInAmt, fadeInAmt, fadeInAmt, 255); diff --git a/src/effects/quizmo_audience.c b/src/effects/quizmo_audience.c index 45e6e964bbf..2e101e82a49 100644 --- a/src/effects/quizmo_audience.c +++ b/src/effects/quizmo_audience.c @@ -89,10 +89,10 @@ EffectInstance* quizmo_audience_main(s32 arg0, f32 posX, f32 posY, f32 posZ) { effectBp.renderUI = NULL; effectBp.effectID = EFFECT_QUIZMO_AUDIENCE; - effect = shim_create_effect_instance(&effectBp); + effect = create_effect_instance(&effectBp); 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); data->timeLeft = 100; @@ -131,7 +131,7 @@ void quizmo_audience_update(EffectInstance* effect) { data->lifeTime++; if (data->timeLeft < 0) { - shim_remove_effect(effect); + remove_effect(effect); return; } @@ -142,11 +142,11 @@ void quizmo_audience_update(EffectInstance* effect) { for (i = 0; i < MAX_QUIZMO_AUDIENCE; i++) { switch (data->compState[i]) { case 0: - if (shim_rand_int(10) == 10) { + if (rand_int(10) == 10) { data->compState[i] = 1; - data->compType[i] = shim_rand_int(1); + data->compType[i] = rand_int(1); 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; case 1: @@ -173,7 +173,7 @@ void quizmo_audience_render(EffectInstance* effect) { renderTask.distance = 0; renderTask.renderMode = RENDER_MODE_2D; - retTask = shim_queue_render_task(&renderTask); + retTask = queue_render_task(&renderTask); retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; } @@ -190,10 +190,10 @@ void quizmo_audience_appendGfx(void* effect) { gDPPipeSync(gMainGfxPos++); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); - shim_guTranslateF(sp18, data->pos.x, data->pos.y, data->pos.z); - shim_guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); - shim_guMtxCatF(sp58, sp18, sp18); - shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(sp18, data->pos.x, data->pos.y, data->pos.z); + guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guMtxCatF(sp58, sp18, sp18); + guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); @@ -201,8 +201,8 @@ void quizmo_audience_appendGfx(void* effect) { gSPDisplayList(gMainGfxPos++, D_09003110_3AA8B0); for (i = 0; i < MAX_QUIZMO_AUDIENCE; i++) { - shim_guTranslateF(sp18, data->compX[i], data->compY[i], 0.0f); - shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(sp18, data->compX[i], data->compY[i], 0.0f); + guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); diff --git a/src/effects/quizmo_stage.c b/src/effects/quizmo_stage.c index 73535b105f1..ac6869cc16b 100644 --- a/src/effects/quizmo_stage.c +++ b/src/effects/quizmo_stage.c @@ -33,10 +33,10 @@ EffectInstance* quizmo_stage_main(s32 arg0, f32 posX, f32 posY, f32 posZ) { effectBp.renderUI = NULL; effectBp.effectID = EFFECT_QUIZMO_STAGE; - effect = shim_create_effect_instance(&effectBp); + effect = create_effect_instance(&effectBp); 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); data->vanishTimer = 100; @@ -78,7 +78,7 @@ void quizmo_stage_update(EffectInstance *effect) { lifeTime = data->lifetime; if (data->vanishTimer < 0) { - shim_remove_effect(effect); + remove_effect(effect); return; } if (data->vanishTimer < 16) { @@ -101,7 +101,7 @@ void quizmo_stage_render(EffectInstance* effect) { renderTask.distance = 0; renderTask.renderMode = RENDER_MODE_SURFACE_OPA; - retTask = shim_queue_render_task(&renderTask); + retTask = queue_render_task(&renderTask); retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; } @@ -114,10 +114,10 @@ void quizmo_stage_appendGfx(void* effect) { gDPPipeSync(gMainGfxPos++); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); - shim_guTranslateF(sp18, data->origin.x, data->origin.y, data->origin.z); - shim_guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); - shim_guMtxCatF(sp58, sp18, sp18); - shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(sp18, data->origin.x, data->origin.y, data->origin.z); + guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guMtxCatF(sp58, sp18, sp18); + guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gDPSetPrimColor(gMainGfxPos++, 0, 0, microphoneRaiseAmt, microphoneRaiseAmt, microphoneRaiseAmt, 255); @@ -127,8 +127,8 @@ void quizmo_stage_appendGfx(void* effect) { if (data->unk_3C != 255) { 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); - shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); + guRotateF(sp18, (data->rearWallRaiseAmt * 180) / 255 - 180, 1.0f, 0.0f, 0.0f); + guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPDisplayList(gMainGfxPos++, D_09006E28_39F9E8); @@ -138,16 +138,16 @@ void quizmo_stage_appendGfx(void* effect) { gSPPopMatrix(gMainGfxPos++, 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); - shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); + guRotateF(sp18, 90 - (data->leftWallRaiseAmt * 90) / 255, 0.0f, 0.0f, 1.0f); + guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPDisplayList(gMainGfxPos++, D_09006FB0_39FB70); gSPPopMatrix(gMainGfxPos++, 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); - shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); + guRotateF(sp18, (data->rightWallRaiseAmt * 90) / 255 - 90, 0.0f, 0.0f, 1.0f); + guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPDisplayList(gMainGfxPos++, D_09006F20_39FAE0); @@ -159,8 +159,8 @@ void quizmo_stage_appendGfx(void* effect) { gSPDisplayList(gMainGfxPos++, D_09006FD8_39FB98); 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); - shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); + guRotateF(sp18, 90 - (data->podiumRaiseAmt * 90) / 255, 1.0f, 0.0f, 0.0f); + guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPDisplayList(gMainGfxPos++, D_09006D48_39F908); diff --git a/src/effects/radial_shimmer.c b/src/effects/radial_shimmer.c index ec66a6ca600..1f1293cc011 100644 --- a/src/effects/radial_shimmer.c +++ b/src/effects/radial_shimmer.c @@ -46,9 +46,9 @@ EffectInstance* radial_shimmer_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 bp.renderUI = NULL; bp.effectID = EFFECT_RADIAL_SHIMMER; - effect = shim_create_effect_instance(&bp); + effect = create_effect_instance(&bp); 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); data->unk_00 = arg0; @@ -221,7 +221,7 @@ void radial_shimmer_update(EffectInstance* effect) { } if (part->timeLeft < 0) { - shim_remove_effect(effect); + remove_effect(effect); return; } @@ -241,7 +241,7 @@ void radial_shimmer_update(EffectInstance* effect) { 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); outS = 1.0f / outS; @@ -280,7 +280,7 @@ void radial_shimmer_render(EffectInstance* effect) { renderTask.distance = 0; renderTask.renderMode = RENDER_MODE_2D; - retTask = shim_queue_render_task(&renderTask); + retTask = queue_render_task(&renderTask); retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; } @@ -313,18 +313,18 @@ void radial_shimmer_appendGfx(void* effect) { gDPPipeSync(gMainGfxPos++); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); - shim_guTranslateF(sp20, data->unk_10, data->unk_14, data->unk_18); - shim_guScaleF(sp60, data->unk_1C, data->unk_1C, 1.0f); - shim_guMtxCatF(sp60, sp20, sp20); - shim_guPerspectiveF(sp60, &spA0, data->unk_60, (f32) camera->viewportW / camera->viewportH, 4.0f, 16384.0f, 1.0f); - shim_guMtxCatF(sp60, sp20, sp20); - shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(sp20, data->unk_10, data->unk_14, data->unk_18); + guScaleF(sp60, data->unk_1C, data->unk_1C, 1.0f); + guMtxCatF(sp60, sp20, sp20); + guPerspectiveF(sp60, &spA0, data->unk_60, (f32) camera->viewportW / camera->viewportH, 4.0f, 16384.0f, 1.0f); + guMtxCatF(sp60, sp20, sp20); + guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); - shim_guTranslateF(sp20, 0.0f, 0.0f, data->unk_64); - shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(sp20, 0.0f, 0.0f, data->unk_64); + guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); diff --git a/src/effects/radiating_energy_orb.c b/src/effects/radiating_energy_orb.c index 310697bc972..4f088a43234 100644 --- a/src/effects/radiating_energy_orb.c +++ b/src/effects/radiating_energy_orb.c @@ -40,9 +40,9 @@ EffectInstance* radiating_energy_orb_main( bp.renderUI = NULL; bp.effectID = EFFECT_RADIATING_ENERGY_ORB; - effect = shim_create_effect_instance(&bp); + effect = create_effect_instance(&bp); 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); part->unk_04 = arg0; @@ -59,10 +59,10 @@ EffectInstance* radiating_energy_orb_main( 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_28 = shim_rand_int(15) * 0.1 + 0.4; - part->unk_30 = shim_rand_int(10) * 0.1 + 0.1; + part->unk_28 = rand_int(15) * 0.1 + 0.4; + part->unk_30 = rand_int(10) * 0.1 + 0.1; } return effect; @@ -89,7 +89,7 @@ void radiating_energy_orb_update(EffectInstance* effect) { part->unk_1C++; if (part->unk_18 < 0) { - shim_remove_effect(effect); + remove_effect(effect); return; } @@ -104,13 +104,13 @@ void radiating_energy_orb_update(EffectInstance* effect) { 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; if (part->unk_2C > 80.0f) { part->unk_2C = 60.0f; - part->unk_28 = shim_rand_int(15) * 0.1 + 0.4; - part->unk_30 = shim_rand_int(10) * 0.1 + 0.1; - part->unk_20 = shim_rand_int(360); + part->unk_28 = rand_int(15) * 0.1 + 0.4; + part->unk_30 = rand_int(10) * 0.1 + 0.1; + part->unk_20 = rand_int(360); } } } @@ -124,7 +124,7 @@ void radiating_energy_orb_render(EffectInstance* effect) { renderTask.distance = 10; 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; } @@ -146,15 +146,15 @@ void radiating_energy_orb_appendGfx(void* effect) { gDPPipeSync(gMainGfxPos++); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); - shim_guTranslateF(sp18, part->unk_08, part->unk_0C, part->unk_10); - shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(sp18, part->unk_08, part->unk_0C, part->unk_10); + guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); 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); gDPSetPrimColor(gMainGfxPos++, 0, 0, 255, 64, 64, unk_14); - shim_guRotateF(sp18, temp_s2 * 2 + unk_1C, 0.0f, 0.0f, 1.0f); - shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); + guRotateF(sp18, temp_s2 * 2 + unk_1C, 0.0f, 0.0f, 1.0f); + guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); 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); gDPSetCombineMode(gMainGfxPos++, PM_CC_07, PM_CC_07); - shim_guRotateF(sp18, part->unk_20, 0.0f, 0.0f, 1.0f); - shim_guTranslateF(sp58, part->unk_2C, 0.0f, 0.0f); - shim_guMtxCatF(sp58, sp18, sp18); - shim_guScaleF(sp58, scale, scale, scale); - shim_guMtxCatF(sp58, sp18, sp18); - shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); + guRotateF(sp18, part->unk_20, 0.0f, 0.0f, 1.0f); + guTranslateF(sp58, part->unk_2C, 0.0f, 0.0f); + guMtxCatF(sp58, sp18, sp18); + guScaleF(sp58, scale, scale, scale); + guMtxCatF(sp58, sp18, sp18); + guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPDisplayList(gMainGfxPos++, D_E009EDFC[0]); gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW); - shim_guRotateF(sp18, part->unk_20, 0.0f, 0.0f, 1.0f); - shim_guTranslateF(sp58, part->unk_2C + 5.0f, 0.0f, 0.0f); - shim_guMtxCatF(sp58, sp18, sp18); - shim_guScaleF(sp58, 2.3 - scale, 2.3 - scale, 2.3 - scale); - shim_guMtxCatF(sp58, sp18, sp18); - shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); + guRotateF(sp18, part->unk_20, 0.0f, 0.0f, 1.0f); + guTranslateF(sp58, part->unk_2C + 5.0f, 0.0f, 0.0f); + guMtxCatF(sp58, sp18, sp18); + guScaleF(sp58, 2.3 - scale, 2.3 - scale, 2.3 - scale); + guMtxCatF(sp58, sp18, sp18); + guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPDisplayList(gMainGfxPos++, D_E009EDF8[0]); @@ -195,28 +195,28 @@ void radiating_energy_orb_appendGfx(void* effect) { gDPSetEnvColor(gMainGfxPos++, 255, 128, 255, 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); - shim_guRotateF(sp58, (i * 10) % 45 + unk_1C, 0.0f, 1.0f, 0.0f); - shim_guMtxCatF(sp58, sp18, sp18); - shim_guTranslateF(sp58, 20.0f, 0.0f, 0.0f); - shim_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); - shim_guMtxCatF(sp58, sp18, sp18); - shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); + guRotateF(sp18, part->unk_20 + 14.0f, 0.0f, 0.0f, 1.0f); + guRotateF(sp58, (i * 10) % 45 + unk_1C, 0.0f, 1.0f, 0.0f); + guMtxCatF(sp58, sp18, sp18); + guTranslateF(sp58, 20.0f, 0.0f, 0.0f); + guMtxCatF(sp58, sp18, sp18); + guScaleF(sp58, (part->unk_2C - 60.0f) * 0.05 + 1.0, 2.0 - (part->unk_2C - 60.0f) * 0.05, 1.0f); + guMtxCatF(sp58, sp18, sp18); + guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPDisplayList(gMainGfxPos++, D_E009EDF4[0]); gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW); 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); - shim_guRotateF(sp58, i * 35, 0.0f, 1.0f, 0.0f); - shim_guMtxCatF(sp58, sp18, sp18); - shim_guTranslateF(sp58, 15.0f, 0.0f, 0.0f); - shim_guMtxCatF(sp58, sp18, sp18); - shim_guScaleF(sp58, (part->unk_2C - 60.0f) * 0.1 + 2.0, 1.0f, 1.0f); - shim_guMtxCatF(sp58, sp18, sp18); - shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); + guRotateF(sp18, part->unk_20 + 34.0f + unk_1C, 0.0f, 0.0f, 1.0f); + guRotateF(sp58, i * 35, 0.0f, 1.0f, 0.0f); + guMtxCatF(sp58, sp18, sp18); + guTranslateF(sp58, 15.0f, 0.0f, 0.0f); + guMtxCatF(sp58, sp18, sp18); + guScaleF(sp58, (part->unk_2C - 60.0f) * 0.1 + 2.0, 1.0f, 1.0f); + guMtxCatF(sp58, sp18, sp18); + guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPDisplayList(gMainGfxPos++, D_E009EDF0[0]); diff --git a/src/effects/recover.c b/src/effects/recover.c index 74dc30330c9..0382a4ef21b 100644 --- a/src/effects/recover.c +++ b/src/effects/recover.c @@ -55,9 +55,9 @@ EffectInstance* recover_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, s32 arg4) { bp.unk_00 = 0; bp.effectID = EFFECT_RECOVER; - effect = shim_create_effect_instance(&bp); + effect = create_effect_instance(&bp); 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); part->unk_00 = arg0; @@ -116,7 +116,7 @@ void recover_update(EffectInstance* effect) { part->unk_30++; if (part->unk_2C < 0) { - shim_remove_effect(effect); + remove_effect(effect); return; } @@ -138,8 +138,8 @@ void recover_update(EffectInstance* effect) { part->unk_04 += part->unk_10; part->unk_08 += part->unk_14; part->unk_0C += part->unk_18; - part->unk_1C = shim_sin_deg(i * 38 + unk_2C * 12) * -30.0f; - part->unk_24 = shim_cos_deg(i * 38 + unk_2C * 12) * 8.0f; + part->unk_1C = sin_deg(i * 38 + unk_2C * 12) * -30.0f; + part->unk_24 = cos_deg(i * 38 + unk_2C * 12) * 8.0f; if (unk_2C < 20) { part->unk_24 *= (f32) unk_2C * 0.05; @@ -176,10 +176,10 @@ void func_E0080448(EffectInstance* effect) { gDPPipeSync(gMainGfxPos++); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); - shim_guTranslateF(sp18, part->unk_04, part->unk_08, part->unk_0C); - shim_guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); - shim_guMtxCatF(sp58, sp18, sp98); - shim_guMtxF2L(sp98, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(sp18, part->unk_04, part->unk_08, part->unk_0C); + guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guMtxCatF(sp58, sp18, sp98); + guMtxF2L(sp98, &gDisplayContext->matrixStack[gMatrixListPos]); 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) : D_09003330_385130); - shim_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); - shim_guMtxCatF(sp58, sp18, sp18); - shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(sp18, part->unk_04 + part->unk_24, part->unk_08, part->unk_0C); + guScaleF(sp58, part->unk_38, part->unk_3C, 1.0f); + guMtxCatF(sp58, sp18, sp18); + guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); 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); - shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); + guRotateF(sp18, part->unk_1C, 0.0f, 0.0f, 1.0f); + guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); diff --git a/src/effects/red_impact.c b/src/effects/red_impact.c index 3dc799e8fed..8006a2731ae 100644 --- a/src/effects/red_impact.c +++ b/src/effects/red_impact.c @@ -36,9 +36,9 @@ EffectInstance* red_impact_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4 bpPtr->renderUI = NULL; bpPtr->effectID = EFFECT_RED_IMPACT; - effect = shim_create_effect_instance(bpPtr); + effect = create_effect_instance(bpPtr); 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); part->unk_2C = 0; @@ -80,7 +80,7 @@ void red_impact_update(EffectInstance* effect) { part->unk_28--; if (part->unk_28 < 0) { - shim_remove_effect(effect); + remove_effect(effect); return; } @@ -98,8 +98,8 @@ void red_impact_update(EffectInstance* effect) { part->unk_04 = 0; part->unk_08 = 0; part->unk_0C = 0; - part->unk_10 = -shim_sin_deg(part->unk_34) * 0.5; - part->unk_14 = shim_cos_deg(part->unk_34) * 0.5; + part->unk_10 = -sin_deg(part->unk_34) * 0.5; + part->unk_14 = cos_deg(part->unk_34) * 0.5; part->unk_18 = 0; part->unk_3C = 32.0f; part->unk_40 = 32.0f; @@ -136,7 +136,7 @@ void red_impact_render(EffectInstance* effect) { renderTask.distance = 0; renderTask.renderMode = RENDER_MODE_28; - retTask = shim_queue_render_task(&renderTask); + retTask = queue_render_task(&renderTask); 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)); gSPDisplayList(gMainGfxPos++, dlist); - shim_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]); + guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, part->unk_04, part->unk_08, part->unk_0C); + guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); 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++; for (i = 1; i < ((EffectInstance*)effect)->numParts; i++, part++) { if (part->unk_4C >= 0) { - shim_guTranslateF(sp20, part->unk_04, part->unk_08, part->unk_0C); - shim_guRotateF(sp60, part->unk_34, 0.0f, 0.0f, 1.0f); - shim_guMtxCatF(sp60, sp20, sp20); - shim_guScaleF(sp60, part->unk_1C * temp_1C, part->unk_20 * temp_20, part->unk_24 * temp_24); - shim_guMtxCatF(sp60, sp20, sp20); - shim_guRotateF(sp60, part->unk_30, 0.0f, 1.0f, 0.0f); - shim_guMtxCatF(sp60, sp20, sp20); - shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(sp20, part->unk_04, part->unk_08, part->unk_0C); + guRotateF(sp60, part->unk_34, 0.0f, 0.0f, 1.0f); + guMtxCatF(sp60, sp20, sp20); + guScaleF(sp60, part->unk_1C * temp_1C, part->unk_20 * temp_20, part->unk_24 * temp_24); + guMtxCatF(sp60, sp20, sp20); + guRotateF(sp60, part->unk_30, 0.0f, 1.0f, 0.0f); + guMtxCatF(sp60, sp20, sp20); + guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); dlist2 = D_09000940_359CF0; diff --git a/src/effects/ring_blast.c b/src/effects/ring_blast.c index 5ef377de0c4..0b7243639ff 100644 --- a/src/effects/ring_blast.c +++ b/src/effects/ring_blast.c @@ -25,12 +25,12 @@ void ring_blast_main(s32 arg0, f32 posX, f32 posY, f32 posZ, f32 arg4, s32 arg5) effectBp.renderUI = NULL; effectBp.effectID = EFFECT_RING_BLAST; - effect = shim_create_effect_instance(&effectBp); + effect = create_effect_instance(&effectBp); 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); - shim_mem_clear(data, numParts * sizeof(*data)); + mem_clear(data, numParts * sizeof(*data)); data->timeLeft = arg5; data->lifeTime = 0; @@ -61,7 +61,7 @@ void ring_blast_update(EffectInstance* effect) { data->timeLeft--; if (data->timeLeft < 0) { - shim_remove_effect(effect); + remove_effect(effect); return; } data->unk_24 += data->unk_28; @@ -79,7 +79,7 @@ void ring_blast_render(EffectInstance* effect) { renderTask.distance = 0; renderTask.renderMode = RENDER_MODE_28; - retTask = shim_queue_render_task(&renderTask); + retTask = queue_render_task(&renderTask); 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)); 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); - shim_guRotateF(sp60, data->unk_24, 0.0f, 0.0f, 1.0f); - shim_guMtxCatF(sp60, sp20, sp20); - shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); + guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].currentYaw, 0.0f, data->unk_10, data->pos.x, data->pos.y, data->pos.z); + guRotateF(sp60, data->unk_24, 0.0f, 0.0f, 1.0f); + guMtxCatF(sp60, sp20, sp20); + guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); diff --git a/src/effects/rising_bubble.c b/src/effects/rising_bubble.c index 6ff16ae30d2..0e83fa016f8 100644 --- a/src/effects/rising_bubble.c +++ b/src/effects/rising_bubble.c @@ -35,9 +35,9 @@ void rising_bubble_main(s32 arg0, f32 posX, f32 posY, f32 posZ, f32 arg4) { effectBp.renderUI = NULL; effectBp.effectID = EFFECT_RISING_BUBBLE; - effect = shim_create_effect_instance(&effectBp); + effect = create_effect_instance(&effectBp); 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); 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->lifeTime = 0; 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 { data->unk_10 = 1.0f; } data->timeLeft = 32; - data->unk_20 = shim_rand_int(31); + data->unk_20 = rand_int(31); data->unk_24 = posY + arg4; } @@ -68,7 +68,7 @@ void rising_bubble_update(EffectInstance* effect) { data->lifeTime++; if (data->timeLeft < 0) { - shim_remove_effect(effect); + remove_effect(effect); return; } @@ -101,7 +101,7 @@ void rising_bubble_render(EffectInstance* effect) { renderTask.distance = 0; renderTask.renderMode = RENDER_MODE_2D; - retTask = shim_queue_render_task(&renderTask); + retTask = queue_render_task(&renderTask); retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; } @@ -128,18 +128,18 @@ void rising_bubble_appendGfx(void* effect) { (uls ) * 4, (ult ) * 4, (uls + 32) * 4, (ult + 32) * 4); - shim_guTranslateF(sp20, data->pos.x, data->pos.y, data->pos.z); - shim_guScaleF(sp60, data->unk_10, 1.0f, data->unk_10); - shim_guMtxCatF(sp60, sp20, sp20); + guTranslateF(sp20, data->pos.x, data->pos.y, data->pos.z); + guScaleF(sp60, data->unk_10, 1.0f, data->unk_10); + guMtxCatF(sp60, sp20, sp20); } else { gSPDisplayList(gMainGfxPos++, D_E0046618[0]); gDPSetPrimColor(gMainGfxPos++, 0, 0, 255, 255, 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); if (data->pos.y >= data->unk_24) { diff --git a/src/effects/shape_spell.c b/src/effects/shape_spell.c index bb6f3b1818e..8e2588aa3c8 100644 --- a/src/effects/shape_spell.c +++ b/src/effects/shape_spell.c @@ -43,9 +43,9 @@ EffectInstance* shape_spell_main(s32 isChild, f32 x, f32 y, f32 z, f32 arg4, f32 bp.renderUI = NULL; bp.effectID = EFFECT_SHAPE_SPELL; - effect = shim_create_effect_instance(bpPtr); + effect = create_effect_instance(bpPtr); 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); @@ -94,7 +94,7 @@ void shape_spell_update(EffectInstance* effect) { part->unk_2C++; if (part->timeLeft < 0) { - shim_remove_effect(effect); + remove_effect(effect); return; } @@ -129,14 +129,14 @@ void shape_spell_render(EffectInstance* effect) { renderTask.distance = 0; renderTask.renderMode = RENDER_MODE_2D; - retTask = shim_queue_render_task(&renderTask); + retTask = queue_render_task(&renderTask); retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; } s32 func_E0024324(s32 arg0, s32 arg1) { 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) { @@ -144,7 +144,7 @@ s32 func_E00243BC(s32 arg0, s32 arg1) { 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) { @@ -205,34 +205,34 @@ void shape_spell_appendGfx(void* effect) { primA = data->unk_34 * 100 / 255; } - shim_guPositionF(sp20, 0.0f, var_f30, 0.0f, unk_28, unk_10, unk_14, unk_18); - shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); + guPositionF(sp20, 0.0f, var_f30, 0.0f, unk_28, unk_10, unk_14, unk_18); + guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); - shim_guTranslateF(sp20, - shim_sin_deg(angle) * factor, - shim_cos_deg(angle) * factor, 0.0f); + guTranslateF(sp20, + sin_deg(angle) * factor, + cos_deg(angle) * factor, 0.0f); angle += 120.0f; sp60[0] = &gDisplayContext->matrixStack[gMatrixListPos++]; - shim_guMtxF2L(sp20, sp60[0]); - shim_guTranslateF(sp20, - shim_sin_deg(angle) * factor, - shim_cos_deg(angle) * factor, 0.0f); + guMtxF2L(sp20, sp60[0]); + guTranslateF(sp20, + sin_deg(angle) * factor, + cos_deg(angle) * factor, 0.0f); angle += 120.0f; sp60[1] = &gDisplayContext->matrixStack[gMatrixListPos++]; - shim_guMtxF2L(sp20, sp60[1]); - shim_guTranslateF(sp20, - shim_sin_deg(angle) * factor, - shim_cos_deg(angle) * factor, 0.0f); + guMtxF2L(sp20, sp60[1]); + guTranslateF(sp20, + sin_deg(angle) * factor, + cos_deg(angle) * factor, 0.0f); sp60[2] = &gDisplayContext->matrixStack[gMatrixListPos++]; - shim_guMtxF2L(sp20, sp60[2]); + guMtxF2L(sp20, sp60[2]); for (j = 0; j < 3; j++) { 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; } - shim_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]); + guPositionF(sp20, 0.0f, var_f30, 0.0f, 1.0f, data->pos.x, data->pos.y, data->pos.z); + guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); if (!isChild) { gSPDisplayList(gMainGfxPos++, savedGfxPos2); } 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++]; - shim_guMtxF2L(sp20, mtx); + guMtxF2L(sp20, mtx); for (i = 0; i < 12; i++) { gSPMatrix(gMainGfxPos++, mtx, G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW); diff --git a/src/effects/shattering_stones.c b/src/effects/shattering_stones.c index 02ef16c4a18..0c3278bd20f 100644 --- a/src/effects/shattering_stones.c +++ b/src/effects/shattering_stones.c @@ -52,9 +52,9 @@ void shattering_stones_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4) { bp.renderUI = NULL; bp.effectID = EFFECT_SHATTERING_STONES; - effect = shim_create_effect_instance(&bp); + effect = create_effect_instance(&bp); 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); 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_30 = 0; 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_38 = shim_rand_int(60) - 30; + part->unk_38 = rand_int(60) - 30; part->unk_3C = part->unk_38 * 0.25; 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_08 = 0; 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_34 = 0; } @@ -105,7 +105,7 @@ void shattering_stones_update(EffectInstance* effect) { if (part->unk_24 == 1) { part->unk_20--; if (part->unk_20 < 0) { - shim_remove_effect(effect); + remove_effect(effect); return; } @@ -134,7 +134,7 @@ void shattering_stones_render(EffectInstance* effect) { renderTask.distance = 0; renderTask.renderMode = RENDER_MODE_2D; - retTask = shim_queue_render_task(&renderTask); + retTask = queue_render_task(&renderTask); retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; } @@ -150,18 +150,18 @@ void shattering_stones_appendGfx(void* effect) { gSPDisplayList(gMainGfxPos++, D_09000C00_341480); if (part->unk_24 == 0) { - shim_guTranslateF(sp20, part->unk_00, part->unk_04, part->unk_08); - shim_guScaleF(sp60, 1.5f, 1.5f, 1.5f); - shim_guMtxCatF(sp60, sp20, spA0); - shim_guRotateF(sp60, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); - shim_guMtxCatF(sp60, spA0, spA0); - shim_guRotateF(sp60, part->unk_34, 0.0f, 0.0f, 1.0f); - shim_guMtxCatF(sp60, spA0, spA0); - shim_guRotateF(sp60, part->unk_2C, 1.0f, 0.0f, 0.0f); - shim_guMtxCatF(sp60, spA0, spA0); - shim_guRotateF(sp60, part->unk_30, 0.0f, 1.0f, 0.0f); - shim_guMtxCatF(sp60, spA0, spA0); - shim_guMtxF2L(spA0, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(sp20, part->unk_00, part->unk_04, part->unk_08); + guScaleF(sp60, 1.5f, 1.5f, 1.5f); + guMtxCatF(sp60, sp20, spA0); + guRotateF(sp60, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guMtxCatF(sp60, spA0, spA0); + guRotateF(sp60, part->unk_34, 0.0f, 0.0f, 1.0f); + guMtxCatF(sp60, spA0, spA0); + guRotateF(sp60, part->unk_2C, 1.0f, 0.0f, 0.0f); + guMtxCatF(sp60, spA0, spA0); + guRotateF(sp60, part->unk_30, 0.0f, 1.0f, 0.0f); + guMtxCatF(sp60, spA0, spA0); + guMtxF2L(spA0, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gDPSetPrimColor(gMainGfxPos++, 0, 0, 102, 109, 123, part->unk_28); @@ -170,23 +170,23 @@ void shattering_stones_appendGfx(void* effect) { } else { s32 unk_28 = part->unk_28; - shim_guTranslateF(sp20, part->unk_00, part->unk_04, part->unk_08); - shim_guScaleF(sp60, 1.5f, 1.5f, 1.5f); - shim_guMtxCatF(sp60, sp20, spA0); - shim_guRotateF(sp60, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); - shim_guMtxCatF(sp60, spA0, spA0); - shim_guRotateF(spE0, part->unk_2C, 1.0f, 0.0f, 0.0f); + guTranslateF(sp20, part->unk_00, part->unk_04, part->unk_08); + guScaleF(sp60, 1.5f, 1.5f, 1.5f); + guMtxCatF(sp60, sp20, spA0); + guRotateF(sp60, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guMtxCatF(sp60, spA0, spA0); + guRotateF(spE0, part->unk_2C, 1.0f, 0.0f, 0.0f); part++; for (i = 1; i < ((EffectInstance*)effect)->numParts; i++, part++) { Gfx* dlist = D_E002C940[i]; - shim_guTranslateF(sp60, part->unk_00, part->unk_04, part->unk_08); - shim_guMtxCatF(sp60, spA0, sp20); - shim_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); - shim_guMtxCatF(sp60, sp20, sp20); - shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(sp60, part->unk_00, part->unk_04, part->unk_08); + guMtxCatF(sp60, spA0, sp20); + guMtxCatF(spE0, sp20, sp20); + guPositionF(sp60, part->unk_2C, 0.0f, part->unk_34, 1.0f, part->unk_18, part->unk_1C, 0.0f); + guMtxCatF(sp60, sp20, sp20); + guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gDPSetPrimColor(gMainGfxPos++, 0, 0, 150, 150, 200, unk_28); diff --git a/src/effects/shimmer_burst.c b/src/effects/shimmer_burst.c index 45b49c4f05b..4d2caef43bb 100644 --- a/src/effects/shimmer_burst.c +++ b/src/effects/shimmer_burst.c @@ -46,9 +46,9 @@ EffectInstance* shimmer_burst_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 a bp.renderUI = NULL; bp.effectID = EFFECT_SHIMMER_BURST; - effect = shim_create_effect_instance(&bp); + effect = create_effect_instance(&bp); 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); part->unk_00 = arg0; @@ -118,7 +118,7 @@ void shimmer_burst_update(EffectInstance* effect) { part->unk_3C++; if (part->unk_38 < 0) { - shim_remove_effect(effect); + remove_effect(effect); return; } @@ -138,13 +138,13 @@ void shimmer_burst_update(EffectInstance* effect) { if (part->unk_30 >= 0) { if (part->unk_30 == 0) { - f32 rand1 = shim_rand_int(359); - f32 rand2 = shim_rand_int(359); + f32 rand1 = rand_int(359); + f32 rand2 = rand_int(359); if (unk_00 == 0) { - part->unk_04 = unk_10 * shim_sin_deg(rand1) * shim_cos_deg(rand2); - part->unk_08 = unk_14 * shim_cos_deg(rand1) * shim_cos_deg(rand2); - part->unk_0C = unk_10 * shim_sin_deg(rand2); + part->unk_04 = unk_10 * sin_deg(rand1) * cos_deg(rand2); + part->unk_08 = unk_14 * cos_deg(rand1) * cos_deg(rand2); + part->unk_0C = unk_10 * sin_deg(rand2); part->unk_18 = part->unk_04 * 0.4; part->unk_1C = part->unk_08 * 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_2C = part->unk_20 * 0.1; } else { - part->unk_04 = shim_rand_int(unk_10) - unk_10 * 0.5; - part->unk_08 = shim_rand_int(unk_14) - unk_14 * 0.5; - part->unk_0C = shim_rand_int(unk_10) - unk_10 * 0.5; + part->unk_04 = rand_int(unk_10) - unk_10 * 0.5; + part->unk_08 = rand_int(unk_14) - unk_14 * 0.5; + part->unk_0C = rand_int(unk_10) - unk_10 * 0.5; part->unk_18 = part->unk_04 * 0.3; part->unk_1C = part->unk_08 * 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_64 = shim_rand_int(15); - part->unk_68 = shim_rand_int(15); + part->unk_64 = rand_int(15); + part->unk_68 = rand_int(15); part->unk_34 = 0.0f; part->unk_4C = 255; } @@ -192,7 +192,7 @@ void shimmer_burst_render(EffectInstance* effect) { renderTask.distance = 10; renderTask.renderMode = RENDER_MODE_2D; - retTask = shim_queue_render_task(&renderTask); + retTask = queue_render_task(&renderTask); retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; } @@ -213,10 +213,10 @@ void shimmer_burst_appendGfx(void* effect) { gDPPipeSync(gMainGfxPos++); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); - shim_guTranslateF(sp20, part->unk_04, part->unk_08, part->unk_0C); - shim_guScaleF(sp60, part->unk_60, part->unk_60, part->unk_60); - shim_guMtxCatF(sp60, sp20, sp20); - shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(sp20, part->unk_04, part->unk_08, part->unk_0C); + guScaleF(sp60, part->unk_60, part->unk_60, part->unk_60); + guMtxCatF(sp60, sp20, sp20); + guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); 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); @@ -228,8 +228,8 @@ void shimmer_burst_appendGfx(void* effect) { part++; for (i = 1; i < ((EffectInstance*)effect)->numParts; i++, part++) { 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); - shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); + guPositionF(sp20, 0.0f, 0.0f, part->unk_34, part->unk_60 * temp_f20, part->unk_04, part->unk_08, part->unk_0C); + guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); 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); @@ -242,15 +242,15 @@ void shimmer_burst_appendGfx(void* effect) { gSPBranchList(savedGfxPos, gMainGfxPos); gSPDisplayList(gMainGfxPos++, savedGfxPos + 1); - shim_guRotateF(sp20, 120.0f, 0.4f, 0.0f, 0.8f); - shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); + guRotateF(sp20, 120.0f, 0.4f, 0.0f, 0.8f); + guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPDisplayList(gMainGfxPos++, savedGfxPos + 1); gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW); - shim_guRotateF(sp20, -120.0f, 0.4f, 0.0f, 0.8f); - shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); + guRotateF(sp20, -120.0f, 0.4f, 0.0f, 0.8f); + guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPDisplayList(gMainGfxPos++, savedGfxPos + 1); diff --git a/src/effects/shimmer_wave.c b/src/effects/shimmer_wave.c index 41ad158d442..ba87257ac60 100644 --- a/src/effects/shimmer_wave.c +++ b/src/effects/shimmer_wave.c @@ -56,9 +56,9 @@ EffectInstance* shimmer_wave_main( bp.renderUI = NULL; bp.effectID = EFFECT_SHIMMER_WAVE; - effect = shim_create_effect_instance(&bp); + effect = create_effect_instance(&bp); 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); part->unk_00 = arg0; @@ -119,7 +119,7 @@ void shimmer_wave_update(EffectInstance* effect) { part->unk_3C++; if (part->unk_38 < 0) { - shim_remove_effect(effect); + remove_effect(effect); return; } @@ -139,20 +139,20 @@ void shimmer_wave_update(EffectInstance* effect) { if (part->unk_30 >= 0) { if (part->unk_30 == 0) { - f32 rand = shim_rand_int(359); - shim_rand_int(359); + f32 rand = rand_int(359); + rand_int(359); - part->unk_04 = unk_10 * shim_sin_deg(rand); - part->unk_08 = shim_rand_int(unk_14) - unk_14 * 0.5; - part->unk_0C = unk_10 * shim_cos_deg(rand); - part->unk_18 = shim_sin_deg(rand) * 15.0f; + part->unk_04 = unk_10 * sin_deg(rand); + part->unk_08 = rand_int(unk_14) - unk_14 * 0.5; + part->unk_0C = unk_10 * cos_deg(rand); + part->unk_18 = sin_deg(rand) * 15.0f; 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_28 = part->unk_1C * 0.5; part->unk_2C = part->unk_20 * 0.5; - part->unk_64 = shim_rand_int(15); - part->unk_68 = shim_rand_int(15); + part->unk_64 = rand_int(15); + part->unk_68 = rand_int(15); part->unk_34 = 0.0f; part->unk_4C = 255; } @@ -180,7 +180,7 @@ void shimmer_wave_render(EffectInstance* effect) { renderTask.distance = 10; renderTask.renderMode = RENDER_MODE_2D; - retTask = shim_queue_render_task(&renderTask); + retTask = queue_render_task(&renderTask); retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; } @@ -198,10 +198,10 @@ void shimmer_wave_appendGfx(void* effect) { gDPPipeSync(gMainGfxPos++); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); - shim_guTranslateF(sp20, part->unk_04, part->unk_08, part->unk_0C); - shim_guScaleF(sp60, part->unk_60, part->unk_60, part->unk_60); - shim_guMtxCatF(sp60, sp20, sp20); - shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(sp20, part->unk_04, part->unk_08, part->unk_0C); + guScaleF(sp60, part->unk_60, part->unk_60, part->unk_60); + guMtxCatF(sp60, sp20, sp20); + guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); 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); @@ -213,8 +213,8 @@ void shimmer_wave_appendGfx(void* effect) { part++; for (i = 1; i < ((EffectInstance*)effect)->numParts; i++, part++) { 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); - shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); + guPositionF(sp20, 0.0f, 0.0f, part->unk_34, part->unk_60 * temp_4C, part->unk_04, part->unk_08, part->unk_0C); + guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); 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); @@ -227,15 +227,15 @@ void shimmer_wave_appendGfx(void* effect) { gSPBranchList(savedGfxPos, gMainGfxPos); gSPDisplayList(gMainGfxPos++, savedGfxPos + 1); - shim_guRotateF(sp20, 120.0f, 0.0f, 1.0f, 0.0f); - shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); + guRotateF(sp20, 120.0f, 0.0f, 1.0f, 0.0f); + guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPDisplayList(gMainGfxPos++, savedGfxPos + 1); gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW); - shim_guRotateF(sp20, -120.0f, 0.0f, 1.0f, 0.0f); - shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); + guRotateF(sp20, -120.0f, 0.0f, 1.0f, 0.0f); + guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPDisplayList(gMainGfxPos++, savedGfxPos + 1); diff --git a/src/effects/shiny_flare.c b/src/effects/shiny_flare.c index d11a47e15f3..e0e9a58111b 100644 --- a/src/effects/shiny_flare.c +++ b/src/effects/shiny_flare.c @@ -32,10 +32,10 @@ EffectInstance* shiny_flare_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg effectBp.unk_00 = 0; effectBp.renderUI = NULL; effectBp.effectID = EFFECT_SHINY_FLARE; - effect = shim_create_effect_instance(&effectBp); + effect = create_effect_instance(&effectBp); 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); data->unk_00 = arg0; @@ -70,7 +70,7 @@ void shiny_flare_update(EffectInstance *effect) { data->lifeTime++; if (data->timeLeft < 0) { - shim_remove_effect(effect); + remove_effect(effect); return; } if (data->timeLeft < 4) { @@ -90,7 +90,7 @@ void shiny_flare_render(EffectInstance* effect) { renderTask.distance = 10; renderTask.renderMode = RENDER_MODE_2D; - retTask = shim_queue_render_task(&renderTask); + retTask = queue_render_task(&renderTask); retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; } @@ -109,10 +109,10 @@ void shiny_flare_appendGfx(void* effect) { gDPPipeSync(gMainGfxPos++); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); - shim_guTranslateF(sp10, data->pos.x, data->pos.y, data->pos.z); - shim_guScaleF(sp50, scale, scale, scale); - shim_guMtxCatF(sp50, sp10, sp10); - shim_guMtxF2L(sp10, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(sp10, data->pos.x, data->pos.y, data->pos.z); + guScaleF(sp50, scale, scale, scale); + guMtxCatF(sp50, sp10, sp10); + guMtxF2L(sp10, &gDisplayContext->matrixStack[gMatrixListPos]); 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); diff --git a/src/effects/shockwave.c b/src/effects/shockwave.c index 239dda67faa..6c0cf940955 100644 --- a/src/effects/shockwave.c +++ b/src/effects/shockwave.c @@ -62,12 +62,12 @@ void shockwave_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3) { bpPtr->renderUI = NULL; bpPtr->effectID = EFFECT_SHOCKWAVE; - effect = shim_create_effect_instance(bpPtr); + effect = create_effect_instance(bpPtr); 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); - shim_mem_clear(part, numParts * sizeof(*part)); + mem_clear(part, numParts * sizeof(*part)); if (arg0 >= 2) { part->unk_28 = 60; @@ -155,7 +155,7 @@ void shockwave_update(EffectInstance* effect) { part->unk_28--; if (part->unk_28 < 0) { - shim_remove_effect(effect); + remove_effect(effect); return; } @@ -184,8 +184,8 @@ void shockwave_update(EffectInstance* effect) { part->pos.x = 0.0f; part->pos.y = 0.0f; part->pos.z = 0.0f; - part->unk_10 = -shim_sin_deg(part->unk_34) * 0.5; - part->unk_14 = shim_cos_deg(part->unk_34) * 0.5; + part->unk_10 = -sin_deg(part->unk_34) * 0.5; + part->unk_14 = cos_deg(part->unk_34) * 0.5; part->unk_18 = 0; part->unk_3C = 32.0f; part->unk_40 = 32.0f; @@ -261,7 +261,7 @@ void shockwave_render(EffectInstance* effect) { renderTask.distance = 0; renderTask.renderMode = RENDER_MODE_28; - retTask = shim_queue_render_task(&renderTask); + retTask = queue_render_task(&renderTask); 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)); 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); - 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); @@ -324,14 +324,14 @@ void shockwave_appendGfx(void* effect) { data++; for (i = 1; i < ((EffectInstance*) effect)->numParts; i++, data++) { if (data->unk_4C >= 0) { - shim_guTranslateF(sp20, data->pos.x, data->pos.y, data->pos.z); - shim_guRotateF(sp60, data->unk_34, 0.0f, 0.0f, 1.0f); - shim_guMtxCatF(sp60, sp20, sp20); - shim_guScaleF(sp60, data->unk_1C * 0.3, data->unk_20 * 0.3, data->unk_24 * 0.3); - shim_guMtxCatF(sp60, sp20, sp20); - shim_guRotateF(sp60, data->unk_30, 0.0f, 1.0f, 0.0f); - shim_guMtxCatF(sp60, sp20, sp20); - shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(sp20, data->pos.x, data->pos.y, data->pos.z); + guRotateF(sp60, data->unk_34, 0.0f, 0.0f, 1.0f); + guMtxCatF(sp60, sp20, sp20); + guScaleF(sp60, data->unk_1C * 0.3, data->unk_20 * 0.3, data->unk_24 * 0.3); + guMtxCatF(sp60, sp20, sp20); + guRotateF(sp60, data->unk_30, 0.0f, 1.0f, 0.0f); + guMtxCatF(sp60, sp20, sp20); + guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); 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); diff --git a/src/effects/sleep_bubble.c b/src/effects/sleep_bubble.c index 808abf19de0..da2b8e7a0af 100644 --- a/src/effects/sleep_bubble.c +++ b/src/effects/sleep_bubble.c @@ -32,9 +32,9 @@ void sleep_bubble_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg bp.renderUI = NULL; bp.effectID = EFFECT_SLEEP_BUBBLE; - effect = shim_create_effect_instance(bpPtr); + effect = create_effect_instance(bpPtr); 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); @@ -72,7 +72,7 @@ void sleep_bubble_update(EffectInstance* effect) { } if (part->timeLeft < 0) { - shim_remove_effect(effect); + remove_effect(effect); return; } @@ -81,7 +81,7 @@ void sleep_bubble_update(EffectInstance* effect) { temp1 = part->unk_18 + (part->unk_14 - part->unk_18) * 0.1f; 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; yPtr = &part->points->y; @@ -90,11 +90,11 @@ void sleep_bubble_update(EffectInstance* effect) { for (i = 0; i < ARRAY_COUNT(part->points); i++) { angle = i * 360.0f / 21.0f + 17.0f; - *xPtr = temp2 * shim_sin_deg(angle); - *yPtr = -temp2 * shim_cos_deg(angle); + *xPtr = temp2 * sin_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; - *yPtr += shim_cos_deg((f32)unk_20 * (shim_cos_deg(yAngle) * 0.1 + 2.0) + (i + 5.0f) * 50.0f) * 1.5; + *xPtr += sin_deg((f32)unk_20 * (sin_deg(xAngle) * 0.1 + 2.0) + (i + 5.0f) * 30.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; yAngle += 36; @@ -120,7 +120,7 @@ void sleep_bubble_render(EffectInstance* effect) { renderTask.distance = 0; renderTask.renderMode = RENDER_MODE_2D; - retTask = shim_queue_render_task(&renderTask); + retTask = queue_render_task(&renderTask); retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; } @@ -142,29 +142,29 @@ void sleep_bubble_appendGfx(void* effect) { gSPDisplayList(gMainGfxPos++, D_090002E0_35D7F0); } - shim_guTranslateF(sp18, data->pos.x, data->pos.y, data->pos.z); - shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(sp18, data->pos.x, data->pos.y, data->pos.z); + guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPVertex(gMainGfxPos++, &D_09000180_35D690[1], 1, 0); - shim_guRotateF(sp18, data->unk_10, 0.0f, 0.0f, 1.0f); - shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); + guRotateF(sp18, data->unk_10, 0.0f, 0.0f, 1.0f); + guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW); - shim_guRotateF(sp18, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); - shim_guTranslateF(sp58, data->unk_C4, data->unk_C8, 0.0f); - shim_guMtxCatF(sp58, sp18, sp18); - shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); + guRotateF(sp18, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guTranslateF(sp58, data->unk_C4, data->unk_C8, 0.0f); + guMtxCatF(sp58, sp18, sp18); + guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPVertex(gMainGfxPos++, &D_09000180_35D690[0], 1, 1); for (i = 0; i < ARRAY_COUNT(data->points); i++) { - shim_guTranslateF(sp18, data->points[i].x, data->points[i].y, 0.0f); - shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(sp18, data->points[i].x, data->points[i].y, 0.0f); + guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPVertex(gMainGfxPos++, &D_09000180_35D690[i + 2], 1, i + 2); diff --git a/src/effects/small_gold_sparkle.c b/src/effects/small_gold_sparkle.c index 035e6fbd188..590b73373e1 100644 --- a/src/effects/small_gold_sparkle.c +++ b/src/effects/small_gold_sparkle.c @@ -38,10 +38,10 @@ EffectInstance* small_gold_sparkle_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, bp.renderUI = NULL; bp.effectID = EFFECT_SMALL_GOLD_SPARKLE; - effect = shim_create_effect_instance(&bp); + effect = create_effect_instance(&bp); effect->numParts = numParts; - data = shim_general_heap_malloc(numParts * sizeof(*data)); + data = general_heap_malloc(numParts * sizeof(*data)); effect->data.smallGoldSparkle = data; part = data; @@ -77,7 +77,7 @@ void small_gold_sparkle_update(EffectInstance* effect) { part->unk_18++; if (part->unk_14 < 0) { - shim_remove_effect(effect); + remove_effect(effect); return; } @@ -105,7 +105,7 @@ void small_gold_sparkle_render(EffectInstance* effect) { renderTask.distance = 10; renderTask.renderMode = RENDER_MODE_2D; - retTask = shim_queue_render_task(&renderTask); + retTask = queue_render_task(&renderTask); retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; } @@ -117,13 +117,13 @@ void small_gold_sparkle_appendGfx(void* effect) { Mtx* spD8; s32 i; - shim_guRotateF(sp98, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); - shim_guMtxF2L(sp98, &gDisplayContext->matrixStack[gMatrixListPos]); + guRotateF(sp98, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guMtxF2L(sp98, &gDisplayContext->matrixStack[gMatrixListPos]); spD8 = &gDisplayContext->matrixStack[gMatrixListPos++]; gDPPipeSync(gMainGfxPos++); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); - shim_guTranslateF(sp18, part->unk_08, part->unk_0C, part->unk_10); - shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(sp18, part->unk_08, part->unk_0C, part->unk_10); + guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(gMainGfxPos++, D_090002C0_392700); @@ -134,12 +134,12 @@ void small_gold_sparkle_appendGfx(void* effect) { if (part->unk_20 == 0) { 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) { - shim_guScaleF(sp58, temp_f20, temp_f20, 1.0f); - shim_guMtxCatF(sp58, sp18, sp18); + guScaleF(sp58, temp_f20, temp_f20, 1.0f); + 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++, spD8, G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW); diff --git a/src/effects/smoke_burst.c b/src/effects/smoke_burst.c index fd1df2e71c7..6e40cf71897 100644 --- a/src/effects/smoke_burst.c +++ b/src/effects/smoke_burst.c @@ -31,13 +31,13 @@ void smoke_burst_main(s32 arg0, f32 posX, f32 posY, f32 posZ, f32 arg4, s32 time effectBp.renderUI = NULL; effectBp.effectID = EFFECT_SMOKE_BURST; - effect = shim_create_effect_instance(&effectBp); + effect = create_effect_instance(&effectBp); 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); - shim_mem_clear(data, numParts * sizeof(*data)); + mem_clear(data, numParts * sizeof(*data)); data->timeLeft = timeLeft; data->lifeTime = 0; data->unk_1C = timeLeft; @@ -81,7 +81,7 @@ void smoke_burst_update(EffectInstance *effect) { data->timeLeft--; 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.renderMode = RENDER_MODE_28; - retTask = shim_queue_render_task(&renderTask); + retTask = queue_render_task(&renderTask); 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)); 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); - shim_guRotateF(sp60, 20.0f, 0.0f, 0.0f, 1.0f); - shim_guMtxCatF(sp60, sp20, sp20); - shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); + guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].currentYaw, 0.0f, data->unk_10, data->pos.x, data->pos.y, data->pos.z); + guRotateF(sp60, 20.0f, 0.0f, 0.0f, 1.0f); + guMtxCatF(sp60, sp20, sp20); + guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); 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); diff --git a/src/effects/smoke_impact.c b/src/effects/smoke_impact.c index 6bc1be8a4b2..fc8d969af2e 100644 --- a/src/effects/smoke_impact.c +++ b/src/effects/smoke_impact.c @@ -42,12 +42,12 @@ void smoke_impact_main( bp.renderUI = NULL; bp.effectID = EFFECT_SMOKE_IMPACT; - effect = shim_create_effect_instance(&bp); + effect = create_effect_instance(&bp); 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); - shim_mem_clear(part, arg5 * sizeof(*part)); + mem_clear(part, arg5 * sizeof(*part)); part->unk_24 = arg7; part->unk_28 = 0; @@ -67,9 +67,9 @@ void smoke_impact_main( part->unk_04 = 0; part->unk_08 = 0; part->unk_0C = 0; - part->unk_10 = shim_sin_deg(angle); + part->unk_10 = sin_deg(angle); 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--; if (part->unk_24 < 0) { - shim_remove_effect(effect); + remove_effect(effect); return; } @@ -112,7 +112,7 @@ void smoke_impact_render(EffectInstance* effect) { renderTask.distance = 0; renderTask.renderMode = RENDER_MODE_28; - retTask = shim_queue_render_task(&renderTask); + retTask = queue_render_task(&renderTask); 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)); gSPDisplayList(gMainGfxPos++, dlist2); - shim_guTranslateF(sp18, part->unk_04, part->unk_08, part->unk_0C); - shim_guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); - shim_guMtxCatF(sp58, sp18, sp98); - shim_guMtxF2L(sp98, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(sp18, part->unk_04, part->unk_08, part->unk_0C); + guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guMtxCatF(sp58, sp18, sp98); + guMtxF2L(sp98, &gDisplayContext->matrixStack[gMatrixListPos]); 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++; for (i = 1; i < ((EffectInstance*)effect)->numParts; i++, part++) { - shim_guTranslateF(sp18, part->unk_04, part->unk_08, part->unk_0C); - shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(sp18, part->unk_04, part->unk_08, part->unk_0C); + guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPDisplayList(gMainGfxPos++, dlist); diff --git a/src/effects/smoke_ring.c b/src/effects/smoke_ring.c index 264d9ff4197..522d316452f 100644 --- a/src/effects/smoke_ring.c +++ b/src/effects/smoke_ring.c @@ -48,12 +48,12 @@ void smoke_ring_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3) { bpPtr->renderUI = NULL; bpPtr->effectID = EFFECT_SMOKE_RING; - effect = shim_create_effect_instance(bpPtr); + effect = create_effect_instance(bpPtr); 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); - shim_mem_clear(part, numParts * sizeof(*part)); + mem_clear(part, numParts * sizeof(*part)); part->unk_38 = 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_28 = 0; part->unk_2C = 0; - part->unk_04 = -shim_sin_deg(angle) * factor; - part->unk_08 = -shim_cos_deg(angle) * factor; + part->unk_04 = -sin_deg(angle) * factor; + part->unk_08 = -cos_deg(angle) * factor; part->unk_0C = 0; - part->unk_30 = shim_sin_deg(angle); - part->unk_34 = shim_cos_deg(angle); + part->unk_30 = sin_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++]; if (part->unk_40 < 0) { - shim_remove_effect(effect); + remove_effect(effect); return; } @@ -115,7 +115,7 @@ void smoke_ring_render(EffectInstance* effect) { renderTask.distance = 0; renderTask.renderMode = RENDER_MODE_28; - retTask = shim_queue_render_task(&renderTask); + retTask = queue_render_task(&renderTask); } 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)); gSPDisplayList(gMainGfxPos++, D_09002950_32B7F0); - shim_guTranslateF(sp18, part->unk_04, part->unk_08, part->unk_0C); - shim_guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); - shim_guMtxCatF(sp58, sp18, sp98); - shim_guMtxF2L(sp98, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(sp18, part->unk_04, part->unk_08, part->unk_0C); + guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guMtxCatF(sp58, sp18, sp98); + guMtxF2L(sp98, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gDPSetPrimColor(gMainGfxPos++, 0, 0, 238, 220, 215, 160); @@ -166,8 +166,8 @@ void smoke_ring_appendGfx(void* effect) { part++; for (i = 1; i < ((EffectInstance*)effect)->numParts; i++, part++) { - shim_guTranslateF(sp18, part->unk_04, part->unk_08, part->unk_0C); - shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(sp18, part->unk_04, part->unk_08, part->unk_0C); + guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPDisplayList(gMainGfxPos++, dlist); diff --git a/src/effects/snaking_static.c b/src/effects/snaking_static.c index 8dcd8069f37..e259c8b6dc9 100644 --- a/src/effects/snaking_static.c +++ b/src/effects/snaking_static.c @@ -23,10 +23,10 @@ EffectInstance* snaking_static_main(s32 arg0, f32 posX, f32 posY, f32 posZ, f32 effectBp.renderUI = NULL; effectBp.effectID = EFFECT_SNAKING_STATIC; - effect = shim_create_effect_instance(&effectBp); + effect = create_effect_instance(&effectBp); 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); data->unk_00 = arg0; @@ -94,7 +94,7 @@ void snaking_static_update(EffectInstance* effect) { lifeTime = data->lifeTime; if (timeLeft < 0) { - shim_remove_effect(effect); + remove_effect(effect); return; } if (timeLeft < 16) { @@ -107,29 +107,29 @@ void snaking_static_update(EffectInstance* effect) { data++; for (i = 1; i < effect->numParts; i += 3, data += 3) { if (data->lifeTime >= data->timeLeft) { - data->timeLeft = shim_rand_int(50) + 20; + data->timeLeft = rand_int(50) + 20; data->lifeTime = 0; - data->unk_3C = shim_rand_int(360); + data->unk_3C = rand_int(360); data->pos.x = 0.0f; data->pos.y = 0.0f; } - if (shim_rand_int(100) < 51) { + if (rand_int(100) < 51) { tempPosX = data->pos.x; tempPosY = data->pos.y; - tempOffsetX = shim_rand_int(16) - 8; - tempOffsetY = shim_rand_int(16) - 8; + tempOffsetX = rand_int(16) - 8; + tempOffsetY = rand_int(16) - 8; data[2] = data[1]; data[1] = data[0]; data->pos.x = tempPosX + tempOffsetX; 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) { - data->unk_34 = shim_sqrtf((tempOffsetX * tempOffsetX) + (tempOffsetY * tempOffsetY)); + data->unk_34 = sqrtf((tempOffsetX * tempOffsetX) + (tempOffsetY * tempOffsetY)); } else { 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) { data->unk_24 = 255; } @@ -138,7 +138,7 @@ void snaking_static_update(EffectInstance* effect) { data = effect->data.snakingStatic; 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.renderMode = RENDER_MODE_2D; - retTask = shim_queue_render_task(&renderTask); + retTask = queue_render_task(&renderTask); retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; } @@ -173,10 +173,10 @@ void snaking_static_appendGfx(void* effect) { gDPPipeSync(gMainGfxPos++); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); - shim_guTranslateF(sp18, data->pos.x, data->pos.y, data->pos.z); - shim_guScaleF(sp58, data->unk_38, data->unk_38, data->unk_38); - shim_guMtxCatF(sp58, sp18, sp18); - shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(sp18, data->pos.x, data->pos.y, data->pos.z); + guScaleF(sp58, data->unk_38, data->unk_38, data->unk_38); + guMtxCatF(sp58, sp18, sp18); + guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); @@ -187,12 +187,12 @@ void snaking_static_appendGfx(void* effect) { data++; for (i = 1; i < ((EffectInstance*)effect)->numParts; i++, data++) { gDPSetPrimColor(gMainGfxPos++, 0, 0, primR, primG, primB, (data->unk_24 * unk_24) / 255); - shim_guTranslateF(sp18, data->pos.x, data->pos.y, 0.0f); - shim_guRotateF(sp58, data->unk_3C, 0.0f, 0.0f, 1.0f); - shim_guMtxCatF(sp58, sp18, sp18); - shim_guScaleF(sp58, data->unk_34 * 0.0625f, data->unk_34 * 0.0625f, 1.0f); - shim_guMtxCatF(sp58, sp18, sp18); - shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(sp18, data->pos.x, data->pos.y, 0.0f); + guRotateF(sp58, data->unk_3C, 0.0f, 0.0f, 1.0f); + guMtxCatF(sp58, sp18, sp18); + guScaleF(sp58, data->unk_34 * 0.0625f, data->unk_34 * 0.0625f, 1.0f); + guMtxCatF(sp58, sp18, sp18); + guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); diff --git a/src/effects/snowfall.c b/src/effects/snowfall.c index 8e14ad65eb0..9561f15be1e 100644 --- a/src/effects/snowfall.c +++ b/src/effects/snowfall.c @@ -37,10 +37,10 @@ EffectInstance* snowfall_main(s32 arg0, s32 arg1) { effectBp.renderUI = NULL; effectBp.effectID = EFFECT_SNOWFALL; - effect = shim_create_effect_instance(&effectBp); + effect = create_effect_instance(&effectBp); 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); data->timeLeft = 100; @@ -123,7 +123,7 @@ void snowfall_update(EffectInstance* effect) { data->timeLeft--; } if (data->timeLeft < 0) { - shim_remove_effect(effect); + remove_effect(effect); return; } @@ -156,7 +156,7 @@ void snowfall_render(EffectInstance* effect) { renderTask.distance = 0; renderTask.renderMode = RENDER_MODE_2D; - retTask = shim_queue_render_task(&renderTask); + retTask = queue_render_task(&renderTask); retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; } @@ -178,7 +178,7 @@ void snowfall_appendGfx(void* effect) { unk_2C = data->unk_2C; dlist = D_E008AA50[data->unk_04]; if (*gBackgroundFogModePtr == 1) { - shim_get_background_color_blend(&bgRGB, &bgRGB, &bgRGB, &bgAlpha); + get_background_color_blend(&bgRGB, &bgRGB, &bgRGB, &bgAlpha); unk_28 = 255 - bgAlpha; } @@ -189,16 +189,16 @@ void snowfall_appendGfx(void* effect) { gSPDisplayList(gMainGfxPos++, D_09000C00_38DC70); gDPSetPrimColor(gMainGfxPos++, 0, 0, 255, 255, 255, unk_28); - shim_guRotateF(sp18, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); - shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); + guRotateF(sp18, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); mtx = &gDisplayContext->matrixStack[gMatrixListPos++]; data++; for (i = 0; i < unk_2C; i++, data++) { if (data->unk_30 <= 0 && data->unk_28 != 0) { - shim_guTranslateF(sp18, data->unk_08, data->unk_0C, data->unk_10); - shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(sp18, data->unk_08, data->unk_0C, data->unk_10); + guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); diff --git a/src/effects/snowflake.c b/src/effects/snowflake.c index 9978515cacc..18a355e1401 100644 --- a/src/effects/snowflake.c +++ b/src/effects/snowflake.c @@ -25,9 +25,9 @@ void snowflake_main(f32 x, f32 y, f32 z, s32 arg3, s32 arg4) { bp.renderUI = NULL; bp.effectID = EFFECT_SNOWFLAKE; - effect = shim_create_effect_instance(&bp); + effect = create_effect_instance(&bp); 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); @@ -62,7 +62,7 @@ void snowflake_update(EffectInstance* effect) { data->unk_28--; if (data->unk_28 < 0) { - shim_remove_effect(effect); + remove_effect(effect); return; } @@ -113,7 +113,7 @@ void snowflake_render(EffectInstance* effect) { renderTaskPtr->distance = 0; renderTaskPtr->renderMode = RENDER_MODE_2D; - retTask = shim_queue_render_task(renderTaskPtr); + retTask = queue_render_task(renderTaskPtr); 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)); gSPDisplayList(gMainGfxPos++, D_09000900_331800); - shim_guTranslateF(sp18, data->pos.x, data->pos.y, data->pos.z); - shim_guRotateF(spD8, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); - shim_guMtxCatF(spD8, sp18, sp118); - shim_guMtxF2L(sp118, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(sp18, data->pos.x, data->pos.y, data->pos.z); + guRotateF(spD8, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guMtxCatF(spD8, sp18, sp118); + guMtxF2L(sp118, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gDPSetPrimColor(gMainGfxPos++, 0, 0, 0, 0, 0, 255); - shim_guRotateF(sp58, data->unk_18, 1.0f, 0.0f, 0.0f); - shim_guRotateF(sp98, data->unk_1C, 0.0f, 1.0f, 0.0f); - shim_guMtxCatF(sp58, sp98, sp118); - shim_guMtxF2L(sp118, &gDisplayContext->matrixStack[gMatrixListPos]); + guRotateF(sp58, data->unk_18, 1.0f, 0.0f, 0.0f); + guRotateF(sp98, data->unk_1C, 0.0f, 1.0f, 0.0f); + guMtxCatF(sp58, sp98, sp118); + guMtxF2L(sp118, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPDisplayList(gMainGfxPos++, D_090009E8_3318E8); diff --git a/src/effects/snowman_doll.c b/src/effects/snowman_doll.c index 0992e99c7d9..f49c56dff10 100644 --- a/src/effects/snowman_doll.c +++ b/src/effects/snowman_doll.c @@ -81,9 +81,9 @@ EffectInstance* snowman_doll_main( bp.renderUI = NULL; bp.effectID = EFFECT_SNOWMAN_DOLL; - effect = shim_create_effect_instance(&bp); + effect = create_effect_instance(&bp); effect->numParts = numParts; - data = effect->data.snowmanDoll = shim_general_heap_malloc(numParts * sizeof(*data)); + data = effect->data.snowmanDoll = general_heap_malloc(numParts * sizeof(*data)); ASSERT(effect->data.snowmanDoll != NULL); data->unk_00 = arg0; @@ -137,7 +137,7 @@ void snowman_doll_update(EffectInstance* effect) { data->unk_14++; if (data->unk_10 < 0) { - shim_remove_effect(effect); + remove_effect(effect); return; } @@ -255,13 +255,13 @@ void snowman_doll_update(EffectInstance* effect) { } if ((unk_14 & 7) == 1) { - shim_load_effect(EFFECT_COLD_BREATH); + load_effect(EFFECT_COLD_BREATH); cold_breath_main(2, - data->unk_04 + data->unk_30 + shim_rand_int(60) - 30.0f, - data->unk_08 + data->unk_34 + shim_rand_int(100) + 50.0f, + data->unk_04 + data->unk_30 + rand_int(60) - 30.0f, + data->unk_08 + data->unk_34 + rand_int(100) + 50.0f, data->unk_0C + data->unk_38, 4.0f, 40); - shim_load_effect(EFFECT_MISC_PARTICLES); + load_effect(EFFECT_MISC_PARTICLES); misc_particles_main(1, data->unk_04 + data->unk_30, data->unk_08 + data->unk_34 + 10.0f, @@ -279,7 +279,7 @@ void snowman_doll_render(EffectInstance* effect) { renderTask.distance = -10; renderTask.renderMode = RENDER_MODE_28; - retTask = shim_queue_render_task(&renderTask); + retTask = queue_render_task(&renderTask); retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; } @@ -295,19 +295,19 @@ void snowman_doll_appendGfx(void* effect) { gDPPipeSync(gMainGfxPos++); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); - shim_guTranslateF(sp18, data->unk_04, data->unk_08, data->unk_0C); - shim_guScaleF(sp58, data->unk_28, data->unk_28, data->unk_28); - shim_guMtxCatF(sp58, sp18, sp18); - shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(sp18, data->unk_04, data->unk_08, data->unk_0C); + guScaleF(sp58, data->unk_28, data->unk_28, data->unk_28); + guMtxCatF(sp58, sp18, sp18); + guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - shim_guTranslateF(sp18, data->unk_30, data->unk_34, data->unk_38); - shim_guScaleF(sp58, data->unk_48, data->unk_4C, data->unk_48); - shim_guMtxCatF(sp58, sp18, sp18); - shim_guRotateF(sp58, data->unk_2C, 0.0f, 1.0f, 0.0f); - shim_guMtxCatF(sp58, sp18, sp18); - shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(sp18, data->unk_30, data->unk_34, data->unk_38); + guScaleF(sp58, data->unk_48, data->unk_4C, data->unk_48); + guMtxCatF(sp58, sp18, sp18); + guRotateF(sp58, data->unk_2C, 0.0f, 1.0f, 0.0f); + guMtxCatF(sp58, sp18, sp18); + guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gDPSetPrimColor(gMainGfxPos++, 0, 0, data->unk_18, data->unk_1C, data->unk_20, unk_24); diff --git a/src/effects/something_rotating.c b/src/effects/something_rotating.c index 039351766a9..e67f2d0c9c6 100644 --- a/src/effects/something_rotating.c +++ b/src/effects/something_rotating.c @@ -94,9 +94,9 @@ EffectInstance* something_rotating_main( bp.renderUI = NULL; bp.effectID = EFFECT_SOMETHING_ROTATING; - effect = shim_create_effect_instance(&bp); + effect = create_effect_instance(&bp); effect->numParts = numParts; - part = effect->data.somethingRotating = shim_general_heap_malloc(numParts * sizeof(*part)); + part = effect->data.somethingRotating = general_heap_malloc(numParts * sizeof(*part)); ASSERT(effect->data.somethingRotating != NULL); part->unk_00 = arg0; @@ -156,7 +156,7 @@ void something_rotating_update(EffectInstance* effect) { part->unk_14++; if (part->unk_10 < 0) { - shim_remove_effect(effect); + remove_effect(effect); return; } @@ -167,12 +167,12 @@ void something_rotating_update(EffectInstance* effect) { part++; for (i = 1; i < effect->numParts; i++, part++) { f32 angle2 = unk_14 * 4.0f + (f32) i * 51.43; - f32 temp_f24 = shim_sin_deg(angle2); + f32 temp_f24 = sin_deg(angle2); f32 temp_f22 = part->unk_2C; - part->pos.x = x + temp_f22 * shim_sin_deg(angle1) * temp_f24; - part->pos.y = y + temp_f22 * shim_cos_deg(angle2); - part->pos.z = z + temp_f22 * shim_cos_deg(angle1) * temp_f24; + part->pos.x = x + temp_f22 * sin_deg(angle1) * temp_f24; + part->pos.y = y + temp_f22 * cos_deg(angle2); + part->pos.z = z + temp_f22 * cos_deg(angle1) * temp_f24; switch (part->state) { case 1: @@ -224,7 +224,7 @@ void something_rotating_update(EffectInstance* effect) { unk_14_2 = part->unk_14; if (unk_14_2 < 18) { - part->unk_2C = (shim_sin_deg(90 - unk_14_2 * 10) + 1.0f) * 50.0f * 0.5; + part->unk_2C = (sin_deg(90 - unk_14_2 * 10) + 1.0f) * 50.0f * 0.5; } else { part->unk_2C = 0.0f; part->state++; @@ -248,7 +248,7 @@ void something_rotating_render(EffectInstance* effect) { renderTask.distance = 10; 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; } @@ -263,16 +263,16 @@ void func_E01166E8(s32 arg0, SomethingRotatingFXData* part) { temp = 0.0f; } - shim_guPositionF(sp20, 0.0f, part->unk_20 - temp, 0.0f, part->unk_18, + guPositionF(sp20, 0.0f, part->unk_20 - temp, 0.0f, part->unk_18, part->pos.x + 2.0f, part->pos.y, part->pos.z + 2.0f ); - shim_guRotateF(sp60, part->unk_1C, 0.0f, 0.0f, 1.0f); - shim_guMtxCatF(sp60, sp20, sp20); - shim_guTranslateF(sp60, 0.0f, 0.0f, -2.0f); - shim_guMtxCatF(sp60, sp20, sp20); - shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); + guRotateF(sp60, part->unk_1C, 0.0f, 0.0f, 1.0f); + guMtxCatF(sp60, sp20, sp20); + guTranslateF(sp60, 0.0f, 0.0f, -2.0f); + guMtxCatF(sp60, sp20, sp20); + guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); diff --git a/src/effects/sparkles.c b/src/effects/sparkles.c index 8f2c115fc56..2699a1d8cbf 100644 --- a/src/effects/sparkles.c +++ b/src/effects/sparkles.c @@ -83,9 +83,9 @@ void sparkles_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4) { bpPtr->renderUI = NULL; bpPtr->effectID = EFFECT_SPARKLES; - effect = shim_create_effect_instance(bpPtr); + effect = create_effect_instance(bpPtr); effect->numParts = numParts; - part = effect->data.sparkles = shim_general_heap_malloc(numParts * sizeof(*part)); + part = effect->data.sparkles = general_heap_malloc(numParts * sizeof(*part)); ASSERT(effect->data.sparkles != NULL); part->unk_04 = arg1; @@ -97,31 +97,31 @@ void sparkles_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4) { part++; for (i = 1; i < numParts; i++, part++) { - f32 rand1 = shim_rand_int(arg4 * 1000.0f) / 1000.0f; - f32 rand2 = shim_rand_int(var_f30 * 1000.0f) / 1000.0f; + f32 rand1 = rand_int(arg4 * 1000.0f) / 1000.0f; + f32 rand2 = rand_int(var_f30 * 1000.0f) / 1000.0f; switch (arg0) { case 0: angle = (360.0f / (numParts - 1)) * i; angle2 = (1800.0f / (numParts - 1)) * i - 90.0f; part->unk_18 = 0.0f; - part->unk_10 = (shim_sin_deg(angle) * (85.0f - shim_sin_deg(angle2) * 15.0f - (i & 1) * 5) / 100.0f) * arg4; - part->unk_14 = (shim_cos_deg(angle) * (85.0f - shim_sin_deg(angle2) * 15.0f - (i & 1) * 5) / 100.0f) * arg4; + part->unk_10 = (sin_deg(angle) * (85.0f - sin_deg(angle2) * 15.0f - (i & 1) * 5) / 100.0f) * arg4; + part->unk_14 = (cos_deg(angle) * (85.0f - sin_deg(angle2) * 15.0f - (i & 1) * 5) / 100.0f) * arg4; part->unk_0C = 0; part->unk_28 = 0; break; case 1: case 2: - angle = (360.0f / (numParts - 1)) * i + shim_rand_int(359); + angle = (360.0f / (numParts - 1)) * i + rand_int(359); if (i & 1) { - part->unk_18 = -(shim_rand_int(50) / 1000 + 0.05); + part->unk_18 = -(rand_int(50) / 1000 + 0.05); } else { part->unk_18 = 0; } part->unk_10 = 0; part->unk_14 = 0; - part->unk_04 = rand1 * shim_sin_deg(angle); - part->unk_08 = rand2 * shim_cos_deg(angle); + part->unk_04 = rand1 * sin_deg(angle); + part->unk_08 = rand2 * cos_deg(angle); part->unk_0C = 0; part->unk_1C = 1.0f; part->unk_24 = i * 2 + 30; @@ -131,12 +131,12 @@ void sparkles_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4) { case 3: case 4: default: - angle = (360.0f / (numParts - 1)) * i + shim_rand_int(359); - part->unk_18 = -(shim_rand_int(50) / 1000 + 0.05); + angle = (360.0f / (numParts - 1)) * i + rand_int(359); + part->unk_18 = -(rand_int(50) / 1000 + 0.05); part->unk_10 = 0.0f; part->unk_14 = 0.0f; - part->unk_04 = rand1 * shim_sin_deg(angle); - part->unk_08 = rand2 * shim_cos_deg(angle); + part->unk_04 = rand1 * sin_deg(angle); + part->unk_08 = rand2 * cos_deg(angle); part->unk_0C = 0; part->unk_1C = 1.0f; part->unk_24 = i * 2 + 18; @@ -168,7 +168,7 @@ void sparkles_update(EffectInstance *effect) { unk_20 = part->unk_20; if ((unk_00 == 0 || unk_00 == 10) && part->unk_24 < 0) { - shim_remove_effect(effect); + remove_effect(effect); return; } @@ -186,8 +186,8 @@ void sparkles_update(EffectInstance *effect) { angle = func_E0200044(360, i + 177); temp_f20 = (i & 3) * 0.5f + 1.0f; firstPart->unk_00 = 10; - part->unk_10 = temp_f20 * shim_sin_deg(angle); - part->unk_14 = temp_f20 * shim_cos_deg(angle); + part->unk_10 = temp_f20 * sin_deg(angle); + part->unk_14 = temp_f20 * cos_deg(angle); part->unk_18 = -0.05f; } break; @@ -226,7 +226,7 @@ void sparkles_update(EffectInstance *effect) { } if (unk_00 != 0 && unk_00 != 10 && count >= effect->numParts - 1) { - shim_remove_effect(effect); + remove_effect(effect); } } @@ -239,7 +239,7 @@ void sparkles_render(EffectInstance* effect) { renderTask.distance = 0; renderTask.renderMode = RENDER_MODE_2D; - retTask = shim_queue_render_task(&renderTask); + retTask = queue_render_task(&renderTask); } void sparkles_appendGfx(void* effect) { @@ -256,24 +256,24 @@ void sparkles_appendGfx(void* effect) { colorIdx = (part->unk_20 - 1) * 3; - shim_guTranslateF(sp18, part->unk_04, part->unk_08, part->unk_0C); - shim_guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); - shim_guMtxCatF(sp58, sp18, sp98); + guTranslateF(sp18, part->unk_04, part->unk_08, part->unk_0C); + guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guMtxCatF(sp58, sp18, sp98); part++; for (i = 0; i < ((EffectInstance*)effect)->numParts - 1; i++, part++) { s32 unk_2C = part->unk_2C; if (unk_2C >= 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] = part->unk_1C; sp58[1][1] = part->unk_1C; sp58[2][2] = part->unk_1C; colorIdx += 3; - shim_guMtxCatF(sp58, sp98, sp18); - shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); + guMtxCatF(sp58, sp98, sp18); + guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); colorIdx %= ARRAY_COUNT(D_E0022CF0); diff --git a/src/effects/spiky_white_aura.c b/src/effects/spiky_white_aura.c index 01d9c886584..6c2d467c5f6 100644 --- a/src/effects/spiky_white_aura.c +++ b/src/effects/spiky_white_aura.c @@ -46,7 +46,7 @@ void spiky_white_aura_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, s32 arg4) { temp_f12 = SQ(fs3) + SQ(fs2) + SQ(fs1); if (temp_f12 != 0.0f) { - temp_f12 = -1.0f / shim_sqrtf(temp_f12); + temp_f12 = -1.0f / sqrtf(temp_f12); fs3 *= temp_f12; fs2 *= temp_f12; @@ -68,7 +68,7 @@ void spiky_white_aura_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, s32 arg4) { temp_f12 = SQ(var_f0) + SQ(var_f2) + SQ(var_f4); if (temp_f12 != 0.0f) { - temp_f12 = 1.0 / shim_sqrtf(temp_f12); + temp_f12 = 1.0 / sqrtf(temp_f12); fs3 *= 18.0f; fs2 *= 18.0f; @@ -81,9 +81,9 @@ void spiky_white_aura_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, s32 arg4) { bpPtr->renderUI = NULL; bpPtr->effectID = EFFECT_SPIKY_WHITE_AURA; - effect = shim_create_effect_instance(bpPtr); + effect = create_effect_instance(bpPtr); effect->numParts = numParts; - part = effect->data.spikyWhiteAura = shim_general_heap_malloc(numParts * sizeof(*part)); + part = effect->data.spikyWhiteAura = general_heap_malloc(numParts * sizeof(*part)); ASSERT(effect->data.spikyWhiteAura != NULL); for (i = 0; i < numParts; i++, part++) { @@ -95,8 +95,8 @@ void spiky_white_aura_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, s32 arg4) { part->unk_08 = arg2; part->unk_0C = arg3; - sinYaw = shim_sin_deg(gCameras[gCurrentCameraID].currentYaw); - cosYaw = -shim_cos_deg(gCameras[gCurrentCameraID].currentYaw); + sinYaw = sin_deg(gCameras[gCurrentCameraID].currentYaw); + cosYaw = -cos_deg(gCameras[gCurrentCameraID].currentYaw); if (numParts != 1) { rotateA = (i * 100) / (numParts - 1) - 50; @@ -104,7 +104,7 @@ void spiky_white_aura_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, s32 arg4) { rotateA = 0.0f; } - shim_guRotateF(matrix, rotateA, sinYaw, 0.0f, cosYaw); + guRotateF(matrix, rotateA, sinYaw, 0.0f, cosYaw); part->unk_10 = (sp30[0][0] * fs3 + sp30[1][0] * fs2 + sp30[2][0] * fs1) * 0.6; part->unk_14 = sp30[0][1] * fs3 + sp30[1][1] * fs2 + sp30[2][1] * fs1; @@ -132,7 +132,7 @@ void spiky_white_aura_update(EffectInstance* effect) { part->unk_2C++; if (part->unk_28 < 0) { - shim_remove_effect(effect); + remove_effect(effect); return; } @@ -145,7 +145,7 @@ void spiky_white_aura_update(EffectInstance* effect) { part->unk_14 *= 0.8; part->unk_18 *= 0.8; part->unk_24 += (255 - part->unk_24) * 0.4; - part->unk_20 = shim_sin_deg(part->unk_24 / 2) * 3.0f + shim_sin_deg(unk_2C * 30.0f); + part->unk_20 = sin_deg(part->unk_24 / 2) * 3.0f + sin_deg(unk_2C * 30.0f); } if (unk_28 < 5) { @@ -153,7 +153,7 @@ void spiky_white_aura_update(EffectInstance* effect) { part->unk_10 *= 0.7; part->unk_14 *= 0.7; part->unk_18 *= 0.7; - part->unk_20 = shim_sin_deg(part->unk_24 / 2) * 3.0f + shim_sin_deg(unk_2C * 30.0f) + (255 - part->unk_24) / 30.0f; + part->unk_20 = sin_deg(part->unk_24 / 2) * 3.0f + sin_deg(unk_2C * 30.0f) + (255 - part->unk_24) / 30.0f; } part->unk_04 += part->unk_10; @@ -171,7 +171,7 @@ void spiky_white_aura_render(EffectInstance* effect) { renderTask.distance = 0; renderTask.renderMode = RENDER_MODE_2D; - retTask = shim_queue_render_task(&renderTask); + retTask = queue_render_task(&renderTask); retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; } @@ -186,14 +186,14 @@ void spiky_white_aura_appendGfx(void* effect) { gDPSetPrimColor(gMainGfxPos++, 0, 0, 255, 255, 255, part->unk_24); for (i = 0; i < ((EffectInstance*)effect)->numParts; i++, part++) { - shim_guTranslateF(sp18, part->unk_04, part->unk_08, part->unk_0C); - shim_guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); - shim_guMtxCatF(sp58, sp18, sp18); - shim_guRotateF(sp58, part->unk_1C, 0.0f, 0.0f, 1.0f); - shim_guMtxCatF(sp58, sp18, sp18); - shim_guScaleF(sp58, part->unk_20, part->unk_20, 1.0f); - shim_guMtxCatF(sp58, sp18, sp18); - shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(sp18, part->unk_04, part->unk_08, part->unk_0C); + guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guMtxCatF(sp58, sp18, sp18); + guRotateF(sp58, part->unk_1C, 0.0f, 0.0f, 1.0f); + guMtxCatF(sp58, sp18, sp18); + guScaleF(sp58, part->unk_20, part->unk_20, 1.0f); + guMtxCatF(sp58, sp18, sp18); + guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); gDPPipeSync(gMainGfxPos++); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); diff --git a/src/effects/spirit_card.c b/src/effects/spirit_card.c index cef673d9346..0742eda094f 100644 --- a/src/effects/spirit_card.c +++ b/src/effects/spirit_card.c @@ -46,9 +46,9 @@ EffectInstance* spirit_card_main( bp.renderUI = NULL; bp.effectID = EFFECT_SPIRIT_CARD; - effect = shim_create_effect_instance(&bp); + effect = create_effect_instance(&bp); effect->numParts = numParts; - data = effect->data.spiritCard = shim_general_heap_malloc(numParts * sizeof(*data)); + data = effect->data.spiritCard = general_heap_malloc(numParts * sizeof(*data)); ASSERT(effect->data.spiritCard != NULL); data->unk_00 = arg0; @@ -67,12 +67,12 @@ EffectInstance* spirit_card_main( data->unk_20 = 30.0f; if (arg0 == 0) { - shim_load_effect(EFFECT_RING_BLAST); + load_effect(EFFECT_RING_BLAST); ring_blast_main(1, data->pos.x, data->pos.y, data->pos.z, 3.0f, 30); } if (arg0 < 2) { - shim_load_effect(EFFECT_MISC_PARTICLES); + load_effect(EFFECT_MISC_PARTICLES); data->child = misc_particles_main(3, arg1, arg2 - arg4 * 30.0f, arg3, arg4 * 30.0f, arg4 * 50.0f, 1.0f, 16, 0); } else { data->child = NULL; @@ -99,7 +99,7 @@ void spirit_card_update(EffectInstance* effect) { data->unk_14++; if (data->unk_10 < 0) { - shim_remove_effect(effect); + remove_effect(effect); if (data->child != NULL) { data->child->flags |= FX_INSTANCE_FLAG_DISMISS; } @@ -121,7 +121,7 @@ void spirit_card_render(EffectInstance* effect) { renderTask.distance = 10; 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; } @@ -136,12 +136,12 @@ void func_E0112330(s32 arg0, SpiritCardFXData* data) { temp = 0.0f; } - shim_guPositionF(sp20, 0.0f, data->yaw - temp, 0.0f, data->unk_18, data->pos.x + 2.0f, data->pos.y, data->pos.z + 2.0f); - shim_guRotateF(sp60, data->unk_20, 0.0f, 0.0f, 1.0f); - shim_guMtxCatF(sp60, sp20, sp20); - shim_guTranslateF(sp60, 0.0f, 0.0f, -2.0f); - shim_guMtxCatF(sp60, sp20, sp20); - shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); + guPositionF(sp20, 0.0f, data->yaw - temp, 0.0f, data->unk_18, data->pos.x + 2.0f, data->pos.y, data->pos.z + 2.0f); + guRotateF(sp60, data->unk_20, 0.0f, 0.0f, 1.0f); + guMtxCatF(sp60, sp20, sp20); + guTranslateF(sp60, 0.0f, 0.0f, -2.0f); + guMtxCatF(sp60, sp20, sp20); + guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); } diff --git a/src/effects/squirt.c b/src/effects/squirt.c index dbc9d9883d2..5a5110ec50b 100644 --- a/src/effects/squirt.c +++ b/src/effects/squirt.c @@ -25,9 +25,9 @@ EffectInstance* squirt_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f3 bp.renderUI = NULL; bp.effectID = EFFECT_SQUIRT; - effect = shim_create_effect_instance(&bp); + effect = create_effect_instance(&bp); effect->numParts = numParts; - data = effect->data.squirt = shim_general_heap_malloc(numParts * sizeof(*data)); + data = effect->data.squirt = general_heap_malloc(numParts * sizeof(*data)); ASSERT(effect->data.squirt != NULL); data->unk_00 = arg0; @@ -104,7 +104,7 @@ void squirt_update(EffectInstance* effect) { data->unk_30++; if (data->unk_2C < 0) { - shim_remove_effect(effect); + remove_effect(effect); return; } @@ -132,7 +132,7 @@ void squirt_update(EffectInstance* effect) { data->unk_148[i] = data->unk_18 + (data->unk_24 - data->unk_18) * factor; } else { data->unk_E8[i] = data->unk_10 + (data->unk_1C - data->unk_10) * factor; - data->unk_118[i] = data->unk_14 + (data->unk_20 - data->unk_14) * factor + shim_sin_deg(factor * 180.0f) * 120.0f; + data->unk_118[i] = data->unk_14 + (data->unk_20 - data->unk_14) * factor + sin_deg(factor * 180.0f) * 120.0f; data->unk_148[i] = data->unk_18 + (data->unk_24 - data->unk_18) * factor; data->unk_1D8[i] = 255.0f - factor * 255.0f; } @@ -149,7 +149,7 @@ void squirt_render(EffectInstance* effect) { renderTask.distance = 10; renderTask.renderMode = RENDER_MODE_2D; - retTask = shim_queue_render_task(&renderTask); + retTask = queue_render_task(&renderTask); retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; } @@ -175,10 +175,10 @@ void squirt_appendGfx(void* effect) { gDPPipeSync(gMainGfxPos++); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); - shim_guTranslateF(sp10, 0.0f, 0.0f, 0.0f); - shim_guScaleF(sp50, 0.05f, 0.05f, 0.05f); - shim_guMtxCatF(sp50, sp10, sp10); - shim_guMtxF2L(sp10, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(sp10, 0.0f, 0.0f, 0.0f); + guScaleF(sp50, 0.05f, 0.05f, 0.05f); + guMtxCatF(sp50, sp10, sp10); + guMtxF2L(sp10, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gDPSetPrimColor(gMainGfxPos++, 0, 0, data->unk_34, data->unk_38, data->unk_3C, data->unk_40); @@ -197,7 +197,7 @@ void squirt_appendGfx(void* effect) { if (i == 0 || zero == i || (i != 11 && data->unk_178[i] == 0)) { theta = data->unk_118[inc]; - theta = -shim_atan2(theta, -data->unk_E8[i + 1], data->unk_118[i], -data->unk_E8[i]); + theta = -atan2(theta, -data->unk_E8[i + 1], data->unk_118[i], -data->unk_E8[i]); } if (data->unk_00 == 0) { @@ -218,8 +218,8 @@ void squirt_appendGfx(void* effect) { tc0 *= 64; var_f22 *= unk_50; - sinComp = var_f22 * shim_sin_deg(theta); - cosComp = var_f22 * shim_cos_deg(theta); + sinComp = var_f22 * sin_deg(theta); + cosComp = var_f22 * cos_deg(theta); vtx->ob[0] = (data->unk_E8[i] + sinComp) * 20.0f; vtx->ob[1] = (data->unk_118[i] + cosComp) * 20.0f; diff --git a/src/effects/star.c b/src/effects/star.c index d2a58da1b83..24c0dcd9fbd 100644 --- a/src/effects/star.c +++ b/src/effects/star.c @@ -39,9 +39,9 @@ EffectInstance* star_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 bp.renderUI = NULL; bp.effectID = EFFECT_STAR; - effect = shim_create_effect_instance(&bp); + effect = create_effect_instance(&bp); effect->numParts = 1; - part = effect->data.star = shim_general_heap_malloc(numParts * sizeof(*part)); + part = effect->data.star = general_heap_malloc(numParts * sizeof(*part)); ASSERT(effect->data.star != NULL); part->unk_00 = 1; @@ -55,8 +55,8 @@ EffectInstance* star_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 if (arg0 == 3) { part->unk_240 = 0.2f; - part->unk_244 = shim_rand_int(255); - part->unk_248 = shim_rand_int(255 - part->unk_244); + part->unk_244 = rand_int(255); + part->unk_248 = rand_int(255 - part->unk_244); temp_s0 = 255 - part->unk_248; part->unk_24C = temp_s0 - part->unk_244; } else { @@ -73,7 +73,7 @@ EffectInstance* star_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 temp_f26 = SQ(temp_f24) + SQ(temp_f22) + SQ(temp_f20); phi_f26 = temp_f26; if (temp_f26 != 0.0f) { - phi_f26 = shim_sqrtf(temp_f26); + phi_f26 = sqrtf(temp_f26); temp_f26 = arg7 / phi_f26; } @@ -82,15 +82,15 @@ EffectInstance* star_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 part->unk_18 = temp_f20 * temp_f26; currentYaw = gCameras[gCurrentCameraID].currentYaw; - cosYaw = -shim_cos_deg(currentYaw); - sinYaw = -shim_sin_deg(currentYaw); + cosYaw = -cos_deg(currentYaw); + sinYaw = -sin_deg(currentYaw); temp_f4 = cosYaw * part->unk_10; temp_f2 = sinYaw * part->unk_18; temp_f12 = SQ(temp_f4) + SQ(temp_f2); if (temp_f12 != 0.0f) { - temp_f12 = shim_sqrtf(temp_f12); + temp_f12 = sqrtf(temp_f12); } if ((cosYaw * part->unk_10) + (sinYaw * part->unk_18) < 0.0f) { @@ -100,10 +100,10 @@ EffectInstance* star_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 part->unk_2C = 20.0f; } - part->unk_20 = part->unk_24 = shim_atan2(0.0f, 0.0f, -part->unk_14, -temp_f12); + part->unk_20 = part->unk_24 = atan2(0.0f, 0.0f, -part->unk_14, -temp_f12); part->unk_30 = phi_f26 / arg7; part->unk_34 = -temp_f12; - shim_guTranslate(part->unk_40, part->unk_04, part->unk_08, part->unk_0C); + guTranslate(part->unk_40, part->unk_04, part->unk_08, part->unk_0C); for (i = 1; i < ARRAY_COUNT(part->unk_40); i++) { part->unk_40[i] = part->unk_40[0]; @@ -125,7 +125,7 @@ void star_update(EffectInstance* effect) { if (data->unk_38 >= 2) { length = SQ(data->unk_10) + SQ(data->unk_14) + SQ(data->unk_18); if (length > 0.01f) { - length = 1.0f / shim_sqrtf(length); + length = 1.0f / sqrtf(length); } xTemp = data->unk_10 * length * 32.0f; @@ -138,7 +138,7 @@ void star_update(EffectInstance* effect) { if (data->unk_00 != 0 && data->unk_14 < 0.0f && - shim_npc_raycast_down_sides(0, &x, &y, &z, &length) != 0 && + npc_raycast_down_sides(0, &x, &y, &z, &length) != 0 && length < 42.0f) { data->unk_1C = data->unk_1C + 1.0f; @@ -146,11 +146,11 @@ void star_update(EffectInstance* effect) { data->unk_10 = data->unk_10 * 0.7; data->unk_34 = data->unk_34 * 0.7; data->unk_2C = data->unk_2C * 0.7; - shim_load_effect(EFFECT_LANDING_DUST); + load_effect(EFFECT_LANDING_DUST); landing_dust_main(0, data->unk_04, data->unk_08 - 5.0f, data->unk_0C, 0.0f); if (!gGameStatusPtr->isBattle) { - shim_sfx_play_sound_at_position(SOUND_B0000016, SOUND_SPACE_MODE_0, data->unk_04, data->unk_08, data->unk_0C); + sfx_play_sound_at_position(SOUND_B0000016, SOUND_SPACE_MODE_0, data->unk_04, data->unk_08, data->unk_0C); } data->unk_00 = 0; @@ -162,7 +162,7 @@ void star_update(EffectInstance* effect) { if (data->unk_1C != 0.0f) { data->unk_14 += -0.5; data->unk_24 += data->unk_2C; - data->unk_20 = shim_atan2(0.0f, 0.0f, -data->unk_14, data->unk_34); + data->unk_20 = atan2(0.0f, 0.0f, -data->unk_14, data->unk_34); } } @@ -175,7 +175,7 @@ void star_update(EffectInstance* effect) { data->unk_0C += data->unk_18; if (data->unk_30 < 0) { - shim_remove_effect(effect); + remove_effect(effect); } } @@ -196,7 +196,7 @@ void star_render(EffectInstance* effect) { } renderTaskPtr->renderMode = renderModeTemp; - retTask = shim_queue_render_task(&renderTask); + retTask = queue_render_task(&renderTask); } void star_appendGfx(void* effect) { @@ -214,10 +214,10 @@ void star_appendGfx(void* effect) { gDPPipeSync(gMainGfxPos++); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); - shim_guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].currentYaw, 0.0f, unk_240, data->unk_04, data->unk_08, data->unk_0C); - shim_guRotateF(sp60, data->unk_24, 0.0f, 0.0f, 1.0f); - shim_guMtxCatF(sp60, sp20, sp20); - shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); + guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].currentYaw, 0.0f, unk_240, data->unk_04, data->unk_08, data->unk_0C); + guRotateF(sp60, data->unk_24, 0.0f, 0.0f, 1.0f); + guMtxCatF(sp60, sp20, sp20); + guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gDPSetPrimColor(gMainGfxPos++, 0, 80, unk_244, unk_248, unk_24C, 255); @@ -241,10 +241,10 @@ void star_appendGfx(void* effect) { if (data->unk_1C <= 1.0f) { s32 baseIdx = (data->unk_3C + 5) % 8; - shim_guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].currentYaw, 0.0f, unk_240, data->unk_04, data->unk_08, data->unk_0C); - shim_guRotateF(sp60, data->unk_20, 0.0f, 0.0f, 1.0f); - shim_guMtxCatF(sp60, sp20, sp20); - shim_guMtxF2L(sp20, &data->unk_40[data->unk_3C]); + guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].currentYaw, 0.0f, unk_240, data->unk_04, data->unk_08, data->unk_0C); + guRotateF(sp60, data->unk_20, 0.0f, 0.0f, 1.0f); + guMtxCatF(sp60, sp20, sp20); + guMtxF2L(sp20, &data->unk_40[data->unk_3C]); for (i = 0; i < 5; i++) { idx = (baseIdx - i + 8) % 8; diff --git a/src/effects/star_outline.c b/src/effects/star_outline.c index 5fa3f57bec9..32054053641 100644 --- a/src/effects/star_outline.c +++ b/src/effects/star_outline.c @@ -27,10 +27,10 @@ EffectInstance* star_outline_main(s32 arg0, f32 posX, f32 posY, f32 posZ, f32 ar effectBp.renderUI = NULL; effectBp.effectID = EFFECT_STAR_OUTLINE; - effect = shim_create_effect_instance(&effectBp); + effect = create_effect_instance(&effectBp); effect->numParts = numParts; - data = effect->data.starOutline = shim_general_heap_malloc(numParts * sizeof(*data)); + data = effect->data.starOutline = general_heap_malloc(numParts * sizeof(*data)); ASSERT(data != NULL); data->unk_00 = 1; @@ -81,7 +81,7 @@ void star_outline_update(EffectInstance* effect) { data->lifeTime++; if (data->timeLeft < 0) { - shim_remove_effect(effect); + remove_effect(effect); return; } lifeTime = data->lifeTime; @@ -114,14 +114,14 @@ void star_outline_update(EffectInstance* effect) { data->unk_24 = 255; data->unk_3C.y = (lifeTime * 4.0f * 0.4953); data->unk_3C.z = (lifeTime * 4.0f * 0.2234); - data->unk_34 = ((shim_sin_deg (lifetimeF * 7.12343)) * 127.0f) + 128.0f; - data->unk_18 = ((shim_sin_deg (lifetimeF * 1.231)) * 127.0f) + 215.0f; - data->unk_1C = ((shim_sin_deg (lifetimeF * 0.531)) * 127.0f) + 215.0f; - data->unk_20 = ((shim_sin_deg (lifetimeF * 3.231)) * 127.0f) + 215.0f; - data->unk_28 = ((shim_sin_deg (lifetimeF * 0.298)) * 127.0f) + 188.0f; - data->unk_2C = ((shim_sin_deg (lifetimeF * 0.831)) * 127.0f) + 188.0f; - data->unk_30 = ((shim_sin_deg (lifetimeF * 2.231)) * 127.0f) + 188.0f; - data->unk_38 = ((shim_sin_deg (lifetimeF * 2.044)) * 0.3) + 0.7; + data->unk_34 = ((sin_deg (lifetimeF * 7.12343)) * 127.0f) + 128.0f; + data->unk_18 = ((sin_deg (lifetimeF * 1.231)) * 127.0f) + 215.0f; + data->unk_1C = ((sin_deg (lifetimeF * 0.531)) * 127.0f) + 215.0f; + data->unk_20 = ((sin_deg (lifetimeF * 3.231)) * 127.0f) + 215.0f; + data->unk_28 = ((sin_deg (lifetimeF * 0.298)) * 127.0f) + 188.0f; + data->unk_2C = ((sin_deg (lifetimeF * 0.831)) * 127.0f) + 188.0f; + data->unk_30 = ((sin_deg (lifetimeF * 2.231)) * 127.0f) + 188.0f; + data->unk_38 = ((sin_deg (lifetimeF * 2.044)) * 0.3) + 0.7; } if (lifeTime == 1) { data->unk_48 = data->unk_3C.x; @@ -140,7 +140,7 @@ void star_outline_render(EffectInstance* effect) { renderTask.distance = 10; renderTask.renderMode = RENDER_MODE_2D; - retTask = shim_queue_render_task(&renderTask); + retTask = queue_render_task(&renderTask); retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; } @@ -211,10 +211,10 @@ void star_outline_appendGfx(void* effect) { gSPDisplayList(gMainGfxPos++, D_E0126BC8[0]); if (unk_34 != 0) { - shim_guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].currentYaw, 0.0f, (f32) ((f64) data->unk_54 * 0.4), data->pos.x, data->pos.y, data->pos.z); - shim_guPositionF(sp60, data->unk_48, data->unk_4C, data->unk_50, 1.0f, 0.0f, 0.0f, 0.0f); - shim_guMtxCatF(sp60, sp20, sp20); - shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); + guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].currentYaw, 0.0f, (f32) ((f64) data->unk_54 * 0.4), data->pos.x, data->pos.y, data->pos.z); + guPositionF(sp60, data->unk_48, data->unk_4C, data->unk_50, 1.0f, 0.0f, 0.0f, 0.0f); + guMtxCatF(sp60, sp20, sp20); + guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); @@ -230,10 +230,10 @@ void star_outline_appendGfx(void* effect) { gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW); } - shim_guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].currentYaw, 0.0f, data->unk_38 * 0.4, data->pos.x, data->pos.y, data->pos.z); - shim_guPositionF(sp60, data->unk_3C.x, data->unk_3C.y, data->unk_3C.z, 1.0f, 0.0f, 0.0f, 0.0f); - shim_guMtxCatF(sp60, sp20, sp20); - shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); + guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].currentYaw, 0.0f, data->unk_38 * 0.4, data->pos.x, data->pos.y, data->pos.z); + guPositionF(sp60, data->unk_3C.x, data->unk_3C.y, data->unk_3C.z, 1.0f, 0.0f, 0.0f, 0.0f); + guMtxCatF(sp60, sp20, sp20); + guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); diff --git a/src/effects/star_spirits_energy.c b/src/effects/star_spirits_energy.c index b9b0e78867a..a1c44540b63 100644 --- a/src/effects/star_spirits_energy.c +++ b/src/effects/star_spirits_energy.c @@ -105,9 +105,9 @@ EffectInstance* star_spirits_energy_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, bp.renderUI = NULL; bp.effectID = EFFECT_STAR_SPIRITS_ENERGY; - effect = shim_create_effect_instance(&bp); + effect = create_effect_instance(&bp); effect->numParts = numParts; - data = effect->data.starSpiritsEnergy = shim_general_heap_malloc(numParts * sizeof(*data)); + data = effect->data.starSpiritsEnergy = general_heap_malloc(numParts * sizeof(*data)); ASSERT(effect->data.starSpiritsEnergy != NULL); data->unk_00 = arg0 & 0xFF00; @@ -180,7 +180,7 @@ void star_spirits_energy_update(EffectInstance* effect) { data->unk_18++; if (data->unk_14 < 0) { - shim_remove_effect(effect); + remove_effect(effect); return; } @@ -194,10 +194,10 @@ void star_spirits_energy_update(EffectInstance* effect) { case 0: data->unk_50[0] = (unk_18 & 3) * 30 + 200; data->unk_74++; - data->unk_40[0] = shim_sin_deg(unk_18 * 20) * 0.04 + 0.5; + data->unk_40[0] = sin_deg(unk_18 * 20) * 0.04 + 0.5; if (data->unk_00 != 0) { - data->unk_08 += shim_sin_deg(unk_18); - data->unk_0C += shim_cos_deg(unk_18 * 1.235631); + data->unk_08 += sin_deg(unk_18); + data->unk_0C += cos_deg(unk_18 * 1.235631); if (data->unk_74 > 50) { data->unk_74 = 0; if (unk_04 == 3) { @@ -331,7 +331,7 @@ void star_spirits_energy_render(EffectInstance* effect) { renderTask.distance = 10; renderTask.renderMode = RENDER_MODE_2D; - retTask = shim_queue_render_task(&renderTask); + retTask = queue_render_task(&renderTask); retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; } @@ -345,9 +345,9 @@ void star_spirits_energy_appendGfx(void* effect) { gDPPipeSync(gMainGfxPos++); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); - shim_guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].currentYaw, 0.0f, + guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].currentYaw, 0.0f, data->unk_3C, data->unk_08, data->unk_0C, data->unk_10); - 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); @@ -357,8 +357,8 @@ void star_spirits_energy_appendGfx(void* effect) { for (i = 0; i < 4; i++) { if (unk_04 != 1 || i != 2) { if (data->unk_40[i] != 0.0f && data->unk_50[i] != 0) { - shim_guPositionF(sp20, 0.0f, 0.0f, 0.0f, data->unk_40[i], 0.0f, 0.0f, 0.0f); - shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); + guPositionF(sp20, 0.0f, 0.0f, 0.0f, data->unk_40[i], 0.0f, 0.0f, 0.0f); + guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); diff --git a/src/effects/stars_burst.c b/src/effects/stars_burst.c index 988f2b5bdee..63462190648 100644 --- a/src/effects/stars_burst.c +++ b/src/effects/stars_burst.c @@ -52,9 +52,9 @@ void stars_burst_main( bpPtr->renderUI = NULL; bpPtr->effectID = EFFECT_STARS_BURST; - effect = shim_create_effect_instance(bpPtr); + effect = create_effect_instance(bpPtr); effect->numParts = numParts; - part = effect->data.starsBurst = shim_general_heap_malloc(numParts * sizeof(*part)); + part = effect->data.starsBurst = general_heap_malloc(numParts * sizeof(*part)); ASSERT(effect->data.starsBurst != NULL); part->unk_00 = arg0; @@ -67,15 +67,15 @@ void stars_burst_main( part++; for (i = 1; i < numParts; i++, part++) { - temp = shim_rand_int(10) * 0.25f + 5.0f; + temp = rand_int(10) * 0.25f + 5.0f; part->unk_00 = arg0; part->unk_04 = arg1; part->unk_08 = arg2; part->unk_0C = arg3; - part->unk_10 = shim_cos_deg(arg5 + (i & 2) * (i / 2) * 4) * shim_sin_deg(arg4); - part->unk_14 = shim_sin_deg(arg5 + (i & 2) * (i / 2) * 4); - part->unk_18 = shim_cos_deg(arg5 + (i & 2) * (i / 2) * 4) * shim_cos_deg(arg4); + part->unk_10 = cos_deg(arg5 + (i & 2) * (i / 2) * 4) * sin_deg(arg4); + part->unk_14 = sin_deg(arg5 + (i & 2) * (i / 2) * 4); + part->unk_18 = cos_deg(arg5 + (i & 2) * (i / 2) * 4) * cos_deg(arg4); part->unk_28 = temp; part->unk_24 = temp / 10.0; } @@ -94,7 +94,7 @@ void stars_burst_update(EffectInstance* effect) { part->unk_34++; if (part->unk_30 < 0) { - shim_remove_effect(effect); + remove_effect(effect); return; } @@ -124,7 +124,7 @@ void stars_burst_render(EffectInstance* effect) { renderTask.distance = 0; renderTask.renderMode = RENDER_MODE_2D; - retTask = shim_queue_render_task(&renderTask); + retTask = queue_render_task(&renderTask); retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; } @@ -154,12 +154,12 @@ void stars_burst_appendGfx(void* effect) { gDPSetPrimColor(gMainGfxPos++, 0, 0, D_E0042780[rIdx % 36], D_E0042780[gIdx % 36], D_E0042780[bIdx % 36], unk_2C); - shim_guTranslateF(sp18, part->unk_04, part->unk_08, part->unk_0C); - shim_guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); - shim_guMtxCatF(sp58, sp18, sp18); - shim_guScaleF(sp58, part->unk_24, part->unk_24, 1.0f); - shim_guMtxCatF(sp58, sp18, sp18); - shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(sp18, part->unk_04, part->unk_08, part->unk_0C); + guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guMtxCatF(sp58, sp18, sp18); + guScaleF(sp58, part->unk_24, part->unk_24, 1.0f); + guMtxCatF(sp58, sp18, sp18); + guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPDisplayList(gMainGfxPos++, dlist); diff --git a/src/effects/stars_orbiting.c b/src/effects/stars_orbiting.c index 41a12dfc170..9fa5a014f7e 100644 --- a/src/effects/stars_orbiting.c +++ b/src/effects/stars_orbiting.c @@ -36,12 +36,12 @@ void stars_orbiting_main( bp.renderUI = func_E005E318; bp.effectID = EFFECT_STARS_ORBITING; - effect = shim_create_effect_instance(&bp); + effect = create_effect_instance(&bp); effect->numParts = numStars; - part = effect->data.starsOrbiting = shim_general_heap_malloc(numStars * sizeof(*part)); + part = effect->data.starsOrbiting = general_heap_malloc(numStars * sizeof(*part)); ASSERT(effect->data.starsOrbiting != NULL); - shim_mem_clear(part, numStars * sizeof(*part)); + mem_clear(part, numStars * sizeof(*part)); part->type = type; part->pos.x = posX; @@ -81,9 +81,9 @@ void stars_orbiting_update(EffectInstance* effect) { part++; for (i = 1; i < effect->numParts; i++, part++) { - part->pos.x = radius * shim_sin_deg(part->yaw); - part->pos.z = radius * shim_cos_deg(part->yaw) * shim_cos_deg(part->pitch); - part->pos.y = radius * shim_cos_deg(part->yaw) * shim_sin_deg(part->pitch); + part->pos.x = radius * sin_deg(part->yaw); + part->pos.z = radius * cos_deg(part->yaw) * cos_deg(part->pitch); + part->pos.y = radius * cos_deg(part->yaw) * sin_deg(part->pitch); part->roll += part->rollSpinRate; part->pitch = 0.0f; part->yaw += 16; @@ -116,20 +116,20 @@ void func_E005E334(EffectInstance* effect) { gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); gSPDisplayList(gMainGfxPos++, dlist2); - shim_guTranslateF(sp18, part->pos.x, part->pos.y, part->pos.z); - shim_guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); - shim_guMtxCatF(sp58, sp18, sp98); - shim_guMtxF2L(sp98, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(sp18, part->pos.x, part->pos.y, part->pos.z); + guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guMtxCatF(sp58, sp18, sp98); + guMtxF2L(sp98, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gDPSetPrimColor(gMainGfxPos++, 0, 0, 220, 220, 40, 255); part++; for (i = 1; i < effect->numParts; i++, part++) { - shim_guTranslateF(sp18, part->pos.x, part->pos.y, part->pos.z); - shim_guRotateF(sp58, part->roll, 0.0f, 0.0f, 1.0f); - shim_guMtxCatF(sp58, sp18, sp18); - shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(sp18, part->pos.x, part->pos.y, part->pos.z); + guRotateF(sp58, part->roll, 0.0f, 0.0f, 1.0f); + guMtxCatF(sp58, sp18, sp18); + guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPDisplayList(gMainGfxPos++, dlist); diff --git a/src/effects/stars_shimmer.c b/src/effects/stars_shimmer.c index bfed3f54ae6..973288bdbf5 100644 --- a/src/effects/stars_shimmer.c +++ b/src/effects/stars_shimmer.c @@ -69,9 +69,9 @@ void stars_shimmer_main(s32 type, f32 x, f32 y, f32 z, f32 arg4, f32 arg5, s32 n bpPtr->renderUI = NULL; bpPtr->effectID = EFFECT_STARS_SHIMMER; - effect = shim_create_effect_instance(bpPtr); + effect = create_effect_instance(bpPtr); effect->numParts = numParts; - part = effect->data.starsShimmer = shim_general_heap_malloc(numParts * sizeof(*part)); + part = effect->data.starsShimmer = general_heap_malloc(numParts * sizeof(*part)); ASSERT(effect->data.starsShimmer != NULL); if (type == 6) { @@ -91,14 +91,14 @@ void stars_shimmer_main(s32 type, f32 x, f32 y, f32 z, f32 arg4, f32 arg5, s32 n for (i = 1; i < numParts; i++, part++) { temp_f22 = (360.0f / (numParts - 1)) * i; if (type > 1) { - theta = temp_f22 + shim_rand_int(359); + theta = temp_f22 + rand_int(359); } else { theta = temp_f22 + 0.0f; } t3 = (temp_f22 * 10.0f) - 90.0f; - sinTheta = shim_sin_deg(theta); - cosTheta = shim_cos_deg(theta); - temp_f22 = shim_sin_deg(t3); + sinTheta = sin_deg(theta); + cosTheta = cos_deg(theta); + temp_f22 = sin_deg(t3); temp_f8 = (arg4 * 0.4) - (arg4 * 0.1 * temp_f22); temp_ft = (arg5 * 0.4) - (arg5 * 0.1 * temp_f22); new_var = 1.0f; // TODO dumb temp and cast later required to match @@ -117,8 +117,8 @@ void stars_shimmer_main(s32 type, f32 x, f32 y, f32 z, f32 arg4, f32 arg5, s32 n part->unk_14 = cosTheta * temp_ft; break; case 3: - part->pos.x = (sinTheta * arg4 * shim_rand_int(100)) * 0.005; - part->pos.y = (cosTheta * arg5 * shim_rand_int(100)) * 0.005; + part->pos.x = (sinTheta * arg4 * rand_int(100)) * 0.005; + part->pos.y = (cosTheta * arg5 * rand_int(100)) * 0.005; part->pos.z = 0.0f; part->unk_18 = part->unk_10 = part->unk_14 = 0.0f; @@ -132,8 +132,8 @@ void stars_shimmer_main(s32 type, f32 x, f32 y, f32 z, f32 arg4, f32 arg5, s32 n part->unk_10 = sinTheta * temp_f8; part->pos.y = temp5; part->pos.z = cosTheta * temp_f8; - part->unk_14 = -shim_rand_int(10) * 0.03f; - part->unk_18 = (shim_rand_int(10) * 0.04f) + 0.01; + part->unk_14 = -rand_int(10) * 0.03f; + part->unk_18 = (rand_int(10) * 0.04f) + 0.01; break; } } @@ -155,7 +155,7 @@ void stars_shimmer_update(EffectInstance* effect) { lifeTime = it->lifeTime; if (state == 0 || state == 1 || state == 3 || state >= 10) { if (it->timeLeft < 0) { - shim_remove_effect(effect); + remove_effect(effect); return; } } @@ -180,8 +180,8 @@ void stars_shimmer_update(EffectInstance* effect) { var_f20 -= 120.0f; } data->state = 10; - it->unk_10 = shim_sin_deg(var_f20); - it->unk_14 = shim_cos_deg(var_f20); + it->unk_10 = sin_deg(var_f20); + it->unk_14 = cos_deg(var_f20); it->unk_18 = -0.05f; } break; @@ -252,8 +252,8 @@ void stars_shimmer_update(EffectInstance* effect) { it->unk_1C += (0.1 - it->unk_1C) * 0.1; } if (state == 4) { - it->pos.x = (it->unk_10 * shim_sin_deg(lifeTime * 12)); - it->pos.z = (it->unk_10 * shim_cos_deg(lifeTime * 12)); + it->pos.x = (it->unk_10 * sin_deg(lifeTime * 12)); + it->pos.z = (it->unk_10 * cos_deg(lifeTime * 12)); } else { it->pos.x = it->unk_10; } @@ -263,7 +263,7 @@ void stars_shimmer_update(EffectInstance* effect) { } if (state != 0 && state != 1 && state != 3 && state < 10 && deadParts >= effect->numParts - 1) { - shim_remove_effect(effect); + remove_effect(effect); } } @@ -276,7 +276,7 @@ void stars_shimmer_render(EffectInstance* effect) { renderTask.distance = 0; renderTask.renderMode = RENDER_MODE_2D; - retTask = shim_queue_render_task(&renderTask); + retTask = queue_render_task(&renderTask); } void stars_shimmer_appendGfx(void* effect) { @@ -296,9 +296,9 @@ void stars_shimmer_appendGfx(void* effect) { gSPDisplayList(gMainGfxPos++, D_09000F20_338EE0); temp_s4 = (data->lifeTime - 1) * 3; - shim_guTranslateF(sp18, data->pos.x, data->pos.y, data->pos.z); - shim_guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); - shim_guMtxCatF(sp58, sp18, sp98); + guTranslateF(sp18, data->pos.x, data->pos.y, data->pos.z); + guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guMtxCatF(sp58, sp18, sp98); switch (type) { case 0: @@ -334,10 +334,10 @@ void stars_shimmer_appendGfx(void* effect) { for (i = 0; i < ((EffectInstance*)effect)->numParts - 1; i++, data++) { unk_28 = data->unk_28; if (unk_28 >= 0) { - shim_guTranslateF(sp58, data->pos.x, data->pos.y, data->pos.z); + guTranslateF(sp58, data->pos.x, data->pos.y, data->pos.z); sp58[0][0] = sp58[1][1] = sp58[2][2] = data->unk_1C; - shim_guMtxCatF(sp58, sp98, sp18); - shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); + guMtxCatF(sp58, sp98, sp18); + guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); if (temp_s4 >= 36) { temp_s4 = 0; } diff --git a/src/effects/stars_spread.c b/src/effects/stars_spread.c index 95785116168..98e09dba3b6 100644 --- a/src/effects/stars_spread.c +++ b/src/effects/stars_spread.c @@ -31,12 +31,12 @@ void stars_spread_main( bp.renderUI = NULL; bp.effectID = EFFECT_STARS_SPREAD; - effect = shim_create_effect_instance(&bp); + effect = create_effect_instance(&bp); effect->numParts = arg4; - part = effect->data.starsSpread = shim_general_heap_malloc(arg4 * sizeof(*part)); + part = effect->data.starsSpread = general_heap_malloc(arg4 * sizeof(*part)); ASSERT(effect->data.starsSpread != NULL); - shim_mem_clear(part, arg4 * sizeof(*part)); + mem_clear(part, arg4 * sizeof(*part)); part->unk_24 = arg5; part->unk_28 = 0; @@ -51,8 +51,8 @@ void stars_spread_main( part->unk_04 = 0; part->unk_08 = 0; part->unk_0C = 0; - part->unk_10 = shim_sin_deg((i - 1) * 360 / (arg4 - 1)) * 8.0; - part->unk_14 = shim_cos_deg((i - 1) * 360 / (arg4 - 1)) * 8.0; + part->unk_10 = sin_deg((i - 1) * 360 / (arg4 - 1)) * 8.0; + part->unk_14 = cos_deg((i - 1) * 360 / (arg4 - 1)) * 8.0; part->unk_18 = 0; part->unk_1C = 0; part->unk_20 = 20.0f; @@ -73,7 +73,7 @@ void stars_spread_update(EffectInstance* effect) { part->unk_24--; if (part->unk_24 < 0) { - shim_remove_effect(effect); + remove_effect(effect); return; } @@ -115,7 +115,7 @@ void stars_spread_render(EffectInstance* effect) { renderTask.distance = 0; renderTask.renderMode = RENDER_MODE_28; - retTask = shim_queue_render_task(&renderTask); + retTask = queue_render_task(&renderTask); retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; } @@ -130,22 +130,22 @@ void stars_spread_appendGfx(void* effect) { gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); gSPDisplayList(gMainGfxPos++, D_09000440_360E70); - shim_guTranslateF(sp18, part->unk_04, part->unk_08, part->unk_0C); - shim_guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); - shim_guMtxCatF(sp58, sp18, sp18); - shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(sp18, part->unk_04, part->unk_08, part->unk_0C); + guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guMtxCatF(sp58, sp18, sp18); + guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gDPSetPrimColor(gMainGfxPos++, 0, 0, 220, 220, 40, 230); part++; for (i = 1; i < ((EffectInstance*)effect)->numParts; i++, part++) { - shim_guTranslateF(sp18, part->unk_04, part->unk_08, part->unk_0C); - shim_guRotateF(sp58, part->unk_1C, 0.0f, 0.0f, 1.0f); - shim_guMtxCatF(sp58, sp18, sp18); - shim_guScaleF(sp58, part->unk_30, part->unk_30, 1.0f); - shim_guMtxCatF(sp58, sp18, sp18); - shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(sp18, part->unk_04, part->unk_08, part->unk_0C); + guRotateF(sp58, part->unk_1C, 0.0f, 0.0f, 1.0f); + guMtxCatF(sp58, sp18, sp18); + guScaleF(sp58, part->unk_30, part->unk_30, 1.0f); + guMtxCatF(sp58, sp18, sp18); + guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPDisplayList(gMainGfxPos++, dlist); diff --git a/src/effects/stat_change.c b/src/effects/stat_change.c index 6793ed46187..901e03d60d3 100644 --- a/src/effects/stat_change.c +++ b/src/effects/stat_change.c @@ -152,9 +152,9 @@ EffectInstance* stat_change_main(s32 arg0, f32 x, f32 y, f32 z, f32 scale, s32 t bp.unk_00 = 0; bp.effectID = EFFECT_STAT_CHANGE; - effect = shim_create_effect_instance(bpPtr); + effect = create_effect_instance(bpPtr); effect->numParts = numParts; - part = effect->data.statChange = shim_general_heap_malloc(numParts * sizeof(*part)); + part = effect->data.statChange = general_heap_malloc(numParts * sizeof(*part)); ASSERT(effect->data.statChange != NULL); @@ -190,7 +190,7 @@ void stat_change_update(EffectInstance* effect) { old_unk18 = part->unk_18++; if (part->timeLeft < 0) { - shim_remove_effect(effect); + remove_effect(effect); return; } @@ -245,8 +245,8 @@ void func_E00AC2A4(EffectInstance* effect) { gDPPipeSync(gMainGfxPos++); 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); - shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); + guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].currentYaw, 0.0f, data->scale, data->pos.x, data->pos.y, data->pos.z); + guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); @@ -258,10 +258,10 @@ void func_E00AC2A4(EffectInstance* effect) { gDPSetCombineLERP(gMainGfxPos++, TEXEL0, 0, SHADE, 0, PRIMITIVE, 0, TEXEL0, 0, TEXEL0, 0, SHADE, 0, PRIMITIVE, 0, TEXEL0, 0); } - shim_guTranslateF(sp20, 0.0f, data->unk_40, 0.0f); - shim_guScaleF(sp60, data->scaleX, data->scaleY, 1.0f); - shim_guMtxCatF(sp60, sp20, sp20); - shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(sp20, 0.0f, data->unk_40, 0.0f); + guScaleF(sp60, data->scaleX, data->scaleY, 1.0f); + guMtxCatF(sp60, sp20, sp20); + guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPDisplayList(gMainGfxPos++, D_E00AC7B0[arrowType]); @@ -270,8 +270,8 @@ void func_E00AC2A4(EffectInstance* effect) { gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW); gSPDisplayList(gMainGfxPos++, D_090028E0_3B1FE0); - shim_guTranslateF(sp20, 0.0f, data->unk_3C, 0.0f); - shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(sp20, 0.0f, data->unk_3C, 0.0f); + guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); diff --git a/src/effects/static_status.c b/src/effects/static_status.c index 7876a0a9cff..0d07bf1a36a 100644 --- a/src/effects/static_status.c +++ b/src/effects/static_status.c @@ -59,9 +59,9 @@ EffectInstance* static_status_main( bp.renderUI = NULL; bp.effectID = EFFECT_STATIC_STATUS; - effect = shim_create_effect_instance(&bp); + effect = create_effect_instance(&bp); effect->numParts = numBolts; - part = effect->data.staticStatus = shim_general_heap_malloc(numBolts * sizeof(*part)); + part = effect->data.staticStatus = general_heap_malloc(numBolts * sizeof(*part)); ASSERT(effect->data.staticStatus != NULL); part->type = type; @@ -112,7 +112,7 @@ void static_status_update(EffectInstance* effect) { part->lifetime++; if (part->timeLeft < 0) { - shim_remove_effect(effect); + remove_effect(effect); return; } @@ -140,8 +140,8 @@ void static_status_update(EffectInstance* effect) { if (part->frame >= 0) { if (part->frame == 0) { angle = (i * 360.0f) / (effect->numParts - 1); - part->pos.x = shim_sin_deg(angle) * 16.0f; - part->pos.y = shim_cos_deg(angle) * 16.0f; + part->pos.x = sin_deg(angle) * 16.0f; + part->pos.y = cos_deg(angle) * 16.0f; part->unk_10 = part->pos.x * initialAmt; part->unk_14 = part->pos.y * initialAmt; part->unk_18 = 0.0f; @@ -181,7 +181,7 @@ void static_status_render(EffectInstance* effect) { renderTask.distance = 10; renderTask.renderMode = RENDER_MODE_SURFACE_OPA; - retTask = shim_queue_render_task(&renderTask); + retTask = queue_render_task(&renderTask); retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; } @@ -200,10 +200,10 @@ void static_status_appendGfx(void* effect) { gDPPipeSync(gMainGfxPos++); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); - shim_guTranslateF(mtxTransform, part->pos.x, part->pos.y, part->pos.z); - shim_guScaleF(mtxTemp, part->scale, part->scale, part->scale); - shim_guMtxCatF(mtxTemp, mtxTransform, mtxTransform); - shim_guMtxF2L(mtxTransform, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(mtxTransform, part->pos.x, part->pos.y, part->pos.z); + guScaleF(mtxTemp, part->scale, part->scale, part->scale); + guMtxCatF(mtxTemp, mtxTransform, mtxTransform); + guMtxF2L(mtxTransform, &gDisplayContext->matrixStack[gMatrixListPos]); 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); @@ -212,8 +212,8 @@ void static_status_appendGfx(void* effect) { part++; for (i = 1; i < ((EffectInstance*)effect)->numParts; i++, part++) { if (part->frame >= 0) { - shim_guPositionF(mtxTransform, 0.0f, 0.0f, part->rotation, part->scale, part->pos.x, part->pos.y, 0.0f); - shim_guMtxF2L(mtxTransform, &gDisplayContext->matrixStack[gMatrixListPos]); + guPositionF(mtxTransform, 0.0f, 0.0f, part->rotation, part->scale, part->pos.x, part->pos.y, 0.0f); + guMtxF2L(mtxTransform, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gDPSetPrimColor(gMainGfxPos++, 0, 0, 0, 0, 0, (unk_30 * part->alpha) >> 8); diff --git a/src/effects/steam_burst.c b/src/effects/steam_burst.c index a575892697a..a2f84df52a5 100644 --- a/src/effects/steam_burst.c +++ b/src/effects/steam_burst.c @@ -33,12 +33,12 @@ void steam_burst_main( bp.renderUI = NULL; bp.effectID = EFFECT_STEAM_BURST; - effect = shim_create_effect_instance(&bp); + effect = create_effect_instance(&bp); effect->numParts = numParts; - part = effect->data.steamBurst = shim_general_heap_malloc(numParts * sizeof(*part)); + part = effect->data.steamBurst = general_heap_malloc(numParts * sizeof(*part)); ASSERT(effect->data.steamBurst != NULL); - shim_mem_clear(part, numParts * sizeof(*part)); + mem_clear(part, numParts * sizeof(*part)); part->unk_24 = arg5; part->unk_28 = 0; @@ -58,9 +58,9 @@ void steam_burst_main( part->unk_04 = zero; part->unk_08 = zero; part->unk_0C = zero; - part->unk_10 = shim_sin_deg(0.0f); + part->unk_10 = sin_deg(0.0f); part->unk_14 = 0.0f; - part->unk_18 = shim_cos_deg(0.0f); + part->unk_18 = cos_deg(0.0f); } } @@ -77,7 +77,7 @@ void steam_burst_update(EffectInstance* effect) { part->unk_24--; if (part->unk_24 < 0) { - shim_remove_effect(effect); + remove_effect(effect); return; } @@ -103,7 +103,7 @@ void steam_burst_render(EffectInstance* effect) { renderTask.distance = 0; renderTask.renderMode = RENDER_MODE_28; - retTask = shim_queue_render_task(&renderTask); + retTask = queue_render_task(&renderTask); retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; } @@ -123,10 +123,10 @@ void steam_burst_appendGfx(void* effect) { gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); gSPDisplayList(gMainGfxPos++, dlist2); - shim_guTranslateF(sp18, part->unk_04, part->unk_08, part->unk_0C); - shim_guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); - shim_guMtxCatF(sp58, sp18, sp98); - shim_guMtxF2L(sp98, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(sp18, part->unk_04, part->unk_08, part->unk_0C); + guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guMtxCatF(sp58, sp18, sp98); + guMtxF2L(sp98, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gDPSetPrimColor(gMainGfxPos++, 0, 0, 230, 222, 222, 130); @@ -147,8 +147,8 @@ void steam_burst_appendGfx(void* effect) { part++; for (i = 1; i < ((EffectInstance*)effect)->numParts; i++, part++) { - shim_guTranslateF(sp18, part->unk_04, part->unk_08, part->unk_0C); - shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(sp18, part->unk_04, part->unk_08, part->unk_0C); + guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPDisplayList(gMainGfxPos++, dlist); diff --git a/src/effects/stop_watch.c b/src/effects/stop_watch.c index 0d50e0810a7..51e75f65765 100644 --- a/src/effects/stop_watch.c +++ b/src/effects/stop_watch.c @@ -65,9 +65,9 @@ EffectInstance* stop_watch_main( bp.renderUI = NULL; bp.effectID = EFFECT_STOP_WATCH; - effect = shim_create_effect_instance(&bp); + effect = create_effect_instance(&bp); effect->numParts = numParts; - data = effect->data.stopWatch = shim_general_heap_malloc(numParts * sizeof(*data)); + data = effect->data.stopWatch = general_heap_malloc(numParts * sizeof(*data)); ASSERT(effect->data.stopWatch != NULL); data->unk_00 = arg0; @@ -123,7 +123,7 @@ void stop_watch_update(EffectInstance* effect) { data->unk_14++; if (data->unk_10 < 0) { - shim_remove_effect(effect); + remove_effect(effect); return; } @@ -171,7 +171,7 @@ void stop_watch_render(EffectInstance* effect) { renderTask.distance = 10; renderTask.renderMode = RENDER_MODE_2D; - retTask = shim_queue_render_task(&renderTask); + retTask = queue_render_task(&renderTask); } void func_E00C4300(void) { @@ -191,10 +191,10 @@ void stop_watch_appendGfx(void* effect) { gDPPipeSync(gMainGfxPos++); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); - shim_guTranslateF(sp20, data->unk_04, data->unk_08, data->unk_0C); - shim_guScaleF(sp60, data->unk_28, data->unk_28, data->unk_28); - shim_guMtxCatF(sp60, sp20, sp20); - shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(sp20, data->unk_04, data->unk_08, data->unk_0C); + guScaleF(sp60, data->unk_28, data->unk_28, data->unk_28); + guMtxCatF(sp60, sp20, sp20); + guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); 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); @@ -208,8 +208,8 @@ void stop_watch_appendGfx(void* effect) { for (i = 0; i < 16; i++) { Vtx_t* vtx = &vtxBuffer[i * 2]; f32 unk_30 = data->unk_30; - s32 temp_s1 = shim_sin_deg(unk_14 * 10 + i * 60) * 500.0f * unk_30; - s32 temp_f0 = shim_sin_deg(unk_14 * 10 + i * 6) * 200.0f * unk_30; + s32 temp_s1 = sin_deg(unk_14 * 10 + i * 60) * 500.0f * unk_30; + s32 temp_f0 = sin_deg(unk_14 * 10 + i * 6) * 200.0f * unk_30; vtx->ob[0] = temp_s1 - 3200; vtx->ob[1] = i * 400 + temp_f0 - 3000; @@ -231,8 +231,8 @@ void stop_watch_appendGfx(void* effect) { gMainGfxPos++; savedGfxPos = gMainGfxPos; - shim_guScaleF(sp20, 0.01f, 0.01f, 0.01f); - shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); + guScaleF(sp20, 0.01f, 0.01f, 0.01f); + guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPVertex(gMainGfxPos++, vtxBuffer, 32, 0); @@ -248,8 +248,8 @@ void stop_watch_appendGfx(void* effect) { gSPEndDisplayList(gMainGfxPos++); for (i = 0; i < 10; i++) { - shim_guPositionF(sp20, data->unk_AC[i], data->unk_D4[i], data->unk_FC[i], D_E00C49D0[i % 4] * 0.01, data->unk_34[i], data->unk_5C[i], data->unk_84[i]); - shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); + guPositionF(sp20, data->unk_AC[i], data->unk_D4[i], data->unk_FC[i], D_E00C49D0[i % 4] * 0.01, data->unk_34[i], data->unk_5C[i], data->unk_84[i]); + guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gDPSetPrimColor(gMainGfxPos++, 0, 0, D_E00C49D4[i], D_E00C49E8[i], D_E00C49FC[i], unk_24 * data->unk_124[i] / 255); diff --git a/src/effects/sun.c b/src/effects/sun.c index c002e7bff8c..a28167e73e4 100644 --- a/src/effects/sun.c +++ b/src/effects/sun.c @@ -34,10 +34,10 @@ EffectInstance* sun_main(s32 shineFromRight, f32 offsetX, f32 offsetY, f32 offse bp.renderUI = NULL; bp.effectID = EFFECT_SUN; - effect = shim_create_effect_instance(&bp); + effect = create_effect_instance(&bp); effect->numParts = numParts; - data = effect->data.sun = shim_general_heap_malloc(sizeof(*data)); + data = effect->data.sun = general_heap_malloc(sizeof(*data)); ASSERT(data != NULL); data->shineFromRight = shineFromRight; @@ -89,7 +89,7 @@ void sun_update(EffectInstance* effect) { data->lifeTime = 256; } if (data->timeLeft < 0) { - shim_remove_effect(effect); + remove_effect(effect); return; } @@ -120,8 +120,8 @@ void sun_update(EffectInstance* effect) { for (i = 0; i < 5; i++) { data->texScrollAmt[i] -= 4.0 - * ((shim_sin_deg((time * 2 + (20 * i))) * 0.01) + 0.05) - * shim_sin_deg(((f32) time * 0.25) + (SQ(i) * 20)); + * ((sin_deg((time * 2 + (20 * i))) * 0.01) + 0.05) + * sin_deg(((f32) time * 0.25) + (SQ(i) * 20)); if (data->texScrollAmt[i] < 0.0f) { data->texScrollAmt[i] += 256.0f; @@ -141,7 +141,7 @@ void sun_render(EffectInstance* effect) { renderTask.distance = 10; renderTask.renderMode = RENDER_MODE_2D; - retTask = shim_queue_render_task(&renderTask); + retTask = queue_render_task(&renderTask); retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; } @@ -164,16 +164,16 @@ void sun_appendGfx(void* argEffect) { gSPSegment(gMainGfxPos++, 0x9, VIRTUAL_TO_PHYSICAL(effect->graphics->data)); if (!fromRight) { - shim_guOrthoF(mtx, -1600.0f, 1600.0f, -1200.0f, 1200.0f, -100.0f, 100.0f, 1.0f); + guOrthoF(mtx, -1600.0f, 1600.0f, -1200.0f, 1200.0f, -100.0f, 100.0f, 1.0f); } else { - shim_guOrthoF(mtx, 1600.0f, -1600.0f, -1200.0f, 1200.0f, -100.0f, 100.0f, 1.0f); + guOrthoF(mtx, 1600.0f, -1600.0f, -1200.0f, 1200.0f, -100.0f, 100.0f, 1.0f); } - shim_guMtxF2L(mtx, &gDisplayContext->matrixStack[gMatrixListPos]); + guMtxF2L(mtx, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); - shim_guTranslateF(mtx, 0.0f, 0.0f, 0.0f); - shim_guMtxF2L(mtx, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(mtx, 0.0f, 0.0f, 0.0f); + guMtxF2L(mtx, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); diff --git a/src/effects/sweat.c b/src/effects/sweat.c index cf36273173f..01bf92a8c9e 100644 --- a/src/effects/sweat.c +++ b/src/effects/sweat.c @@ -26,14 +26,14 @@ void sweat_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, s32 effectBp.renderUI = NULL; effectBp.effectID = EFFECT_SWEAT; - effect = shim_create_effect_instance(&effectBp); + effect = create_effect_instance(&effectBp); effect->numParts = numParts; - data = effect->data.sweat = shim_general_heap_malloc(numParts * sizeof(*data)); + data = effect->data.sweat = general_heap_malloc(numParts * sizeof(*data)); ASSERT(data != NULL); data->unk_00 = arg0; - shim_guRotateF(matrix, -arg5, shim_sin_deg(gCameras[gCurrentCameraID].currentYaw), 0.0f, -shim_cos_deg(gCameras[gCurrentCameraID].currentYaw)); + guRotateF(matrix, -arg5, sin_deg(gCameras[gCurrentCameraID].currentYaw), 0.0f, -cos_deg(gCameras[gCurrentCameraID].currentYaw)); temp_f2 = arg4 + 16.0f; data->pos.x = arg1 + (matrix[1][0] * temp_f2); data->pos.y = arg2 + (matrix[1][1] * temp_f2); @@ -54,7 +54,7 @@ void sweat_update(EffectInstance *effect) { data->timeLeft--; if (data->timeLeft < 0) { - shim_remove_effect(effect); + remove_effect(effect); return; } data->pos.x += data->unk_18; @@ -77,7 +77,7 @@ void sweat_render(EffectInstance* effect) { renderTask.distance = 0; renderTask.renderMode = RENDER_MODE_2D; - retTask = shim_queue_render_task(&renderTask); + retTask = queue_render_task(&renderTask); retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; } @@ -89,12 +89,12 @@ void sweat_appendGfx(void* effect) { gDPPipeSync(gMainGfxPos++); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); - shim_guTranslateF(sp18, data->pos.x, data->pos.y, data->pos.z); - shim_guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); - shim_guMtxCatF(sp58, sp18, sp18); - shim_guRotateF(sp58, data->unk_10, 0.0f, 0.0f, 1.0f); - shim_guMtxCatF(sp58, sp18, sp18); - shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(sp18, data->pos.x, data->pos.y, data->pos.z); + guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guMtxCatF(sp58, sp18, sp18); + guRotateF(sp58, data->unk_10, 0.0f, 0.0f, 1.0f); + guMtxCatF(sp58, sp18, sp18); + guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); diff --git a/src/effects/tattle_window.c b/src/effects/tattle_window.c index d0f9e43917c..ae4ee9438fc 100644 --- a/src/effects/tattle_window.c +++ b/src/effects/tattle_window.c @@ -72,9 +72,9 @@ EffectInstance* tattle_window_main(s32 arg0, f32 x, f32 y, f32 z, f32 arg4, s32 bp.unk_00 = 0; bp.effectID = EFFECT_TATTLE_WINDOW; - effect = shim_create_effect_instance(bpPtr); + effect = create_effect_instance(bpPtr); effect->numParts = numParts; - part = effect->data.tattleWindow = shim_general_heap_malloc(numParts * sizeof(*part)); + part = effect->data.tattleWindow = general_heap_malloc(numParts * sizeof(*part)); ASSERT(effect->data.tattleWindow != NULL); @@ -121,7 +121,7 @@ void tattle_window_update(EffectInstance* effect) { unk_10 = part->unk_10; if (unk_10 < 0) { - shim_remove_effect(effect); + remove_effect(effect); return; } unk_10_2 = unk_10; @@ -230,7 +230,7 @@ void func_E00D8630(EffectInstance* effect) { flags = 1; } - shim_draw_box( + draw_box( flags, &D_E00D87E0, (data->pos.x + data->offset.x) - 75.0f, (data->pos.y + data->offset.y) - 53.0f, diff --git a/src/effects/throw_spiny.c b/src/effects/throw_spiny.c index f0363a97664..a9c1b61bfbe 100644 --- a/src/effects/throw_spiny.c +++ b/src/effects/throw_spiny.c @@ -33,9 +33,9 @@ EffectInstance* throw_spiny_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg bp.renderUI = NULL; bp.effectID = EFFECT_THROW_SPINY; - effect = (EffectInstance*)shim_create_effect_instance(bpPtr); + effect = (EffectInstance*)create_effect_instance(bpPtr); effect->numParts = numParts; - spinyObject = effect->data.throwSpiny = shim_general_heap_malloc(numParts * sizeof(*spinyObject)); + spinyObject = effect->data.throwSpiny = general_heap_malloc(numParts * sizeof(*spinyObject)); ASSERT(effect->data.throwSpiny != NULL); spinyObject->unk_00 = arg0; spinyObject->lifeDuration = 0; @@ -74,8 +74,8 @@ EffectInstance* throw_spiny_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg spinyObject->unk_30 = 70; spinyObject->unk_34 = 180; spinyObject->unk_38 = 120; - spinyObject->yaw = shim_rand_int(360); - spinyObject->rotationSpeed = shim_rand_int(10) + 5; + spinyObject->yaw = rand_int(360); + spinyObject->rotationSpeed = rand_int(10) + 5; spinyObject->state = -1; spinyObject->xScale = 1.0f; spinyObject->yScale = 1.0f; @@ -103,7 +103,7 @@ void throw_spiny_update(EffectInstance* effectInstance) { spinyObject->lifeDuration++; if (spinyObject->life < 0) { - shim_remove_effect(effectInstance); + remove_effect(effectInstance); return; } @@ -149,7 +149,7 @@ void throw_spiny_render(EffectInstance* effect) { renderTask.distance = 10; renderTask.renderMode = RENDER_MODE_2D; - retTask = shim_queue_render_task(&renderTask); + retTask = queue_render_task(&renderTask); retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; } @@ -168,12 +168,12 @@ void throw_spiny_appendGfx(void* effect) { gDPPipeSync(gMainGfxPos++); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); - shim_guTranslateF(sp18, data->pos.x, data->pos.y, data->pos.z); - shim_guScaleF(sp58, scale * data->xScale, scale * data->yScale, scale); - shim_guMtxCatF(sp58, sp18, sp18); - shim_guRotateF(sp58, data->yaw, 0.0f, 0.0f, 1.0f); - shim_guMtxCatF(sp58, sp18, sp18); - shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(sp18, data->pos.x, data->pos.y, data->pos.z); + guScaleF(sp58, scale * data->xScale, scale * data->yScale, scale); + guMtxCatF(sp58, sp18, sp18); + guRotateF(sp58, data->yaw, 0.0f, 0.0f, 1.0f); + guMtxCatF(sp58, sp18, sp18); + guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); 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); diff --git a/src/effects/thunderbolt_ring.c b/src/effects/thunderbolt_ring.c index 4c8dd880de1..ed119902986 100644 --- a/src/effects/thunderbolt_ring.c +++ b/src/effects/thunderbolt_ring.c @@ -22,10 +22,10 @@ EffectInstance* thunderbolt_ring_main(s32 arg0, f32 posX, f32 posY, f32 posZ, f3 effectBp.renderUI = NULL; effectBp.effectID = EFFECT_THUNDERBOLT_RING; - effect = shim_create_effect_instance(&effectBp); + effect = create_effect_instance(&effectBp); effect->numParts = numParts; - data = effect->data.thunderboltRing = shim_general_heap_malloc(numParts * sizeof(*data)); + data = effect->data.thunderboltRing = general_heap_malloc(numParts * sizeof(*data)); ASSERT(data != NULL); data->unk_00 = arg0; @@ -70,7 +70,7 @@ void thunderbolt_ring_update(EffectInstance *effect) { lifeTime = data->lifeTime; if (timeLeft < 0) { - shim_remove_effect(effect); + remove_effect(effect); return; } if (timeLeft < 8) { @@ -93,7 +93,7 @@ void thunderbolt_ring_render(EffectInstance* effect) { renderTask.distance = 10; renderTask.renderMode = RENDER_MODE_2D; - retTask = shim_queue_render_task(&renderTask); + retTask = queue_render_task(&renderTask); } void thunderbolt_ring_appendGfx(void* effect) { @@ -110,8 +110,8 @@ void thunderbolt_ring_appendGfx(void* effect) { gDPPipeSync(gMainGfxPos++); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); - shim_guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].currentYaw, 0.0f, data->unk_28, data->pos.x, data->pos.y, data->pos.z); - shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); + guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].currentYaw, 0.0f, data->unk_28, data->pos.x, data->pos.y, data->pos.z); + guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(gMainGfxPos++, D_09000000_3B46A0); @@ -120,12 +120,12 @@ void thunderbolt_ring_appendGfx(void* effect) { savedGfxPos2 = gMainGfxPos; for (i = 0; i < 5; i++) { - shim_guRotateF(sp20, i * 72 + 90, 0.0f, 0.0f, 1.0f); - shim_guScaleF(sp60, 1.0f, scaleY, 1.0f); - shim_guMtxCatF(sp60, sp20, sp20); - shim_guPositionF(sp60, 0.0f, 0.0f, 0.0f, 1.0f, 30.0f, 0.0f, 0.0f); - shim_guMtxCatF(sp60, sp20, sp20); - shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); + guRotateF(sp20, i * 72 + 90, 0.0f, 0.0f, 1.0f); + guScaleF(sp60, 1.0f, scaleY, 1.0f); + guMtxCatF(sp60, sp20, sp20); + guPositionF(sp60, 0.0f, 0.0f, 0.0f, 1.0f, 30.0f, 0.0f, 0.0f); + guMtxCatF(sp60, sp20, sp20); + guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPDisplayList(gMainGfxPos++, D_090000C8_3B4768); @@ -139,10 +139,10 @@ void thunderbolt_ring_appendGfx(void* effect) { for (i = 0; i < data->unk_30 + 1; i++) { f32 angle = lifeTime * 8 + i * 180 / (data->unk_30 + 1); - f32 temp = (f32) (i + 1) + shim_cos_deg(angle) * 0.1; + f32 temp = (f32) (i + 1) + cos_deg(angle) * 0.1; - shim_guPositionF(sp20, 0.0f, 0.0f, i * 36, temp * data->unk_2C, 0.0f, 0.0f, 0.0f); - shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); + guPositionF(sp20, 0.0f, 0.0f, i * 36, temp * data->unk_2C, 0.0f, 0.0f, 0.0f); + guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPDisplayList(gMainGfxPos++, savedGfxPos2); diff --git a/src/effects/tubba_heart_attack.c b/src/effects/tubba_heart_attack.c index ea0b03e8775..b2e71f990c2 100644 --- a/src/effects/tubba_heart_attack.c +++ b/src/effects/tubba_heart_attack.c @@ -60,9 +60,9 @@ EffectInstance* tubba_heart_attack_main( bp.renderUI = NULL; bp.effectID = EFFECT_TUBBA_HEART_ATTACK; - effect = shim_create_effect_instance(&bp); + effect = create_effect_instance(&bp); effect->numParts = numParts; - data = effect->data.tubbaHeartAttack = shim_general_heap_malloc(numParts * sizeof(*data)); + data = effect->data.tubbaHeartAttack = general_heap_malloc(numParts * sizeof(*data)); ASSERT(effect->data.tubbaHeartAttack != NULL); data->unk_00 = arg0; @@ -82,10 +82,10 @@ EffectInstance* tubba_heart_attack_main( data->unk_20 = 120; for (i = 0; i < 25; i++) { - f32 sin = shim_sin_deg(i * 1080 / 25); - f32 cos = shim_cos_deg(i * 1080 / 25); + f32 sin = sin_deg(i * 1080 / 25); + f32 cos = cos_deg(i * 1080 / 25); - data->unk_478[i] = shim_rand_int(359) - 180; + data->unk_478[i] = rand_int(359) - 180; data->unk_284[i] = sin * 15.0f; data->unk_2E8[i] = D_E00CCE4C[i] + 10; data->unk_34C[i] = cos * 15.0f; @@ -131,7 +131,7 @@ void tubba_heart_attack_update(EffectInstance* effect) { data->unk_14++; if (data->unk_10 < 0) { - shim_remove_effect(effect); + remove_effect(effect); return; } @@ -224,9 +224,9 @@ void tubba_heart_attack_update(EffectInstance* effect) { break; case 4: factor = D_E00CCE04[data->unk_734[i]] * 0.01; - angle = i * 1080 / 25 + (1.0f - factor) * 1080.0f * 0.5 * shim_cos_deg(i * 180 / 25); - sin = shim_sin_deg(angle); - cos = shim_cos_deg(angle); + angle = i * 1080 / 25 + (1.0f - factor) * 1080.0f * 0.5 * cos_deg(i * 180 / 25); + sin = sin_deg(angle); + cos = cos_deg(angle); data->unk_2C[i] = ((15.0f / factor) / factor) * sin; data->unk_90[i] = D_E00CCE4C[i] + 10; @@ -261,10 +261,10 @@ void tubba_heart_attack_update(EffectInstance* effect) { break; case 6: - shim_load_effect(EFFECT_FLOATING_CLOUD_PUFF); - shim_guRotateF(sp18, data->unk_4DC[i], 0.0f, 1.0f, 0.0f); - shim_guTranslateF(sp58, data->unk_2C[i], data->unk_90[i], data->unk_F4[i]); - shim_guMtxCatF(sp58, sp18, sp18); + load_effect(EFFECT_FLOATING_CLOUD_PUFF); + guRotateF(sp18, data->unk_4DC[i], 0.0f, 1.0f, 0.0f); + guTranslateF(sp58, data->unk_2C[i], data->unk_90[i], data->unk_F4[i]); + guMtxCatF(sp58, sp18, sp18); puffEffect = floating_cloud_puff_main(0, data->unk_04 + sp18[3][0], data->unk_08 + sp18[3][1], data->unk_0C + sp18[3][2], 1.0f, 16); puffEffect->data.floatingCloudPuff->unk_28 = 100; @@ -287,7 +287,7 @@ void tubba_heart_attack_render(EffectInstance* effect) { renderTask.distance = 10; renderTask.renderMode = RENDER_MODE_2D; - retTask = shim_queue_render_task(&renderTask); + retTask = queue_render_task(&renderTask); retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; } @@ -305,10 +305,10 @@ void tubba_heart_attack_appendGfx(void* effect) { gDPPipeSync(gMainGfxPos++); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); - shim_guTranslateF(sp18, data->unk_04, data->unk_08, data->unk_0C); - shim_guScaleF(sp58, data->unk_28, data->unk_28, data->unk_28); - shim_guMtxCatF(sp58, sp18, sp18); - shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(sp18, data->unk_04, data->unk_08, data->unk_0C); + guScaleF(sp58, data->unk_28, data->unk_28, data->unk_28); + guMtxCatF(sp58, sp18, sp18); + guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gDPSetPrimColor(gMainGfxPos++, 0, 0, data->unk_18, data->unk_1C, data->unk_20, unk_24); @@ -317,16 +317,16 @@ void tubba_heart_attack_appendGfx(void* effect) { for (i = 0; i < 25; i++) { if (data->unk_6D0[i] != 0 && data->unk_6D0[i] != 7) { - shim_guRotateF(sp18, data->unk_4DC[i], 0.0f, 1.0f, 0.0f); - shim_guTranslateF(sp58, data->unk_2C[i], data->unk_90[i], data->unk_F4[i]); - shim_guMtxCatF(sp58, sp18, sp18); - shim_guRotateF(sp58, -data->unk_4DC[i], 0.0f, 1.0f, 0.0f); - shim_guMtxCatF(sp58, sp18, sp18); - shim_guRotateF(sp58, data->unk_478[i], 0.0f, 0.0f, 1.0f); - shim_guMtxCatF(sp58, sp18, sp18); - shim_guScaleF(sp58, data->unk_3B0[i], data->unk_414[i], 1.0f); - shim_guMtxCatF(sp58, sp18, sp18); - shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); + guRotateF(sp18, data->unk_4DC[i], 0.0f, 1.0f, 0.0f); + guTranslateF(sp58, data->unk_2C[i], data->unk_90[i], data->unk_F4[i]); + guMtxCatF(sp58, sp18, sp18); + guRotateF(sp58, -data->unk_4DC[i], 0.0f, 1.0f, 0.0f); + guMtxCatF(sp58, sp18, sp18); + guRotateF(sp58, data->unk_478[i], 0.0f, 0.0f, 1.0f); + guMtxCatF(sp58, sp18, sp18); + guScaleF(sp58, data->unk_3B0[i], data->unk_414[i], 1.0f); + guMtxCatF(sp58, sp18, sp18); + guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, camera->unkMatrix, G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW); diff --git a/src/effects/underwater.c b/src/effects/underwater.c index e6190fc4ba4..373413f8b6d 100644 --- a/src/effects/underwater.c +++ b/src/effects/underwater.c @@ -26,9 +26,9 @@ EffectInstance* underwater_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4 bp.renderUI = NULL; bp.effectID = EFFECT_UNDERWATER; - effect = shim_create_effect_instance(&bp); + effect = create_effect_instance(&bp); effect->numParts = numParts; - data = effect->data.underwater = shim_general_heap_malloc(numParts * sizeof(*data)); + data = effect->data.underwater = general_heap_malloc(numParts * sizeof(*data)); ASSERT(effect->data.underwater != NULL); data->unk_00 = arg0; @@ -84,7 +84,7 @@ void underwater_update(EffectInstance* effect) { data->lifeTime++; if (data->timeLeft < 0) { - shim_remove_effect(effect); + remove_effect(effect); return; } @@ -103,7 +103,7 @@ void underwater_update(EffectInstance* effect) { factor = (f32) alpha / 255.0f; for (i = 1; i < ARRAY_COUNT(data->unk_23) - 1; i++) { - data->unk_23[i][6] = shim_sin_deg(-((lifeTime - i) * 20)) * -64.0f * factor; + data->unk_23[i][6] = sin_deg(-((lifeTime - i) * 20)) * -64.0f * factor; } for (i = 1; i < ARRAY_COUNT(data->unk_23) - 1; i++) { @@ -145,7 +145,7 @@ void underwater_render(EffectInstance* effect) { renderTask.distance = 100; renderTask.renderMode = RENDER_MODE_2D; - retTask = shim_queue_render_task(&renderTask); + retTask = queue_render_task(&renderTask); } void func_E00BA618(void) { @@ -193,8 +193,8 @@ void underwater_appendGfx(void* effect) { gDPSetTexturePersp(gMainGfxPos++, G_TP_PERSP); gDPSetTextureFilter(gMainGfxPos++, G_TF_BILERP); - shim_guFrustumF(mtx, -80.0f, 80.0f, 60.0f, -60.0f, 160.0f, 640.0f, 1.0f); - shim_guMtxF2L(mtx, &gDisplayContext->matrixStack[gMatrixListPos]); + guFrustumF(mtx, -80.0f, 80.0f, 60.0f, -60.0f, 160.0f, 640.0f, 1.0f); + guMtxF2L(mtx, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); gSPClearGeometryMode(gMainGfxPos++, G_CULL_BOTH | G_LIGHTING); gSPSetGeometryMode(gMainGfxPos++, G_SHADE | G_SHADING_SMOOTH); diff --git a/src/effects/walking_dust.c b/src/effects/walking_dust.c index 7b164d05032..0e77be6370a 100644 --- a/src/effects/walking_dust.c +++ b/src/effects/walking_dust.c @@ -32,14 +32,14 @@ void walking_dust_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg bp.renderUI = NULL; bp.effectID = EFFECT_WALKING_DUST; - effect = shim_create_effect_instance(&bp); + effect = create_effect_instance(&bp); effect->numParts = numParts; - data = shim_general_heap_malloc(numParts * sizeof(*data)); + data = general_heap_malloc(numParts * sizeof(*data)); effect->data.walkingDust = data; ASSERT(effect->data.walkingDust != NULL); - shim_mem_clear(data, numParts * sizeof(*data)); + mem_clear(data, numParts * sizeof(*data)); data->unk_6C = arg0 == 2; data->unk_70 = 0; data->unk_04 = arg0; @@ -66,7 +66,7 @@ void walking_dust_update(EffectInstance* effect) { data->unk_74 = D_E000E684[data->unk_6C][data->unk_70++]; if (data->unk_74 < 0) { - shim_remove_effect(effect); + remove_effect(effect); } else { s32 i; @@ -88,7 +88,7 @@ void walking_dust_render(EffectInstance* effect) { renderTask.distance = 0; renderTask.renderMode = RENDER_MODE_28; - retTask = shim_queue_render_task(&renderTask); + retTask = queue_render_task(&renderTask); retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; } @@ -154,10 +154,10 @@ void walking_dust_appendGfx(void* effect) { } for (i = 0; i < effectTemp->numParts; i++, data++) { - shim_guTranslateF(sp18, data->unk_08, data->unk_0C, data->unk_10); - shim_guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); - shim_guMtxCatF(sp58, sp18, sp18); - shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(sp18, data->unk_08, data->unk_0C, data->unk_10); + guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guMtxCatF(sp58, sp18, sp18); + guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(gMainGfxPos++, dlist2); diff --git a/src/effects/water_block.c b/src/effects/water_block.c index d18b1addcd9..b71e90bbf29 100644 --- a/src/effects/water_block.c +++ b/src/effects/water_block.c @@ -82,9 +82,9 @@ EffectInstance* water_block_main(s32 arg0, f32 x, f32 y, f32 z, f32 arg4, s32 ar bpPtr->renderUI = NULL; bpPtr->effectID = EFFECT_WATER_BLOCK; - effect = shim_create_effect_instance(bpPtr); + effect = create_effect_instance(bpPtr); effect->numParts = numParts; - data = effect->data.waterBlock = shim_general_heap_malloc(sizeof(*data)); + data = effect->data.waterBlock = general_heap_malloc(sizeof(*data)); ASSERT(data != NULL); data->unk_00 = arg0; @@ -147,11 +147,11 @@ void water_block_update(EffectInstance* effect) { temp_v1_3 = data->unk_10; if (temp_v1_3 < 0) { if (temp_a0 == 1) { - shim_load_effect(EFFECT_WATER_SPLASH); + load_effect(EFFECT_WATER_SPLASH); water_splash_main(0, data->pos.x, data->pos.y + 24.0f, data->pos.z, 2.0f, 0x1E); water_splash_main(1, data->pos.x, data->pos.y + 24.0f, data->pos.z, 2.0f, 0x1E); } - shim_remove_effect(effect); + remove_effect(effect); return; } temp_s0 = data->unk_14; @@ -170,9 +170,9 @@ void water_block_update(EffectInstance* effect) { } - data->unk_1C = shim_sin_deg((temp_s0 * 6) + temp_s0) * 32.0f + 127.0f; + data->unk_1C = sin_deg((temp_s0 * 6) + temp_s0) * 32.0f + 127.0f; temp_f20 = (f32)temp_s0 * 0.01; - data->unk_30 = (shim_sin_deg(temp_f20 * 6.0f) * 32.0f * shim_sin_deg(temp_f20)) + 256.0f + (shim_cos_deg(2.0f * temp_f20) * 32.0f) + (shim_cos_deg(temp_f20) * 32.0f); + data->unk_30 = (sin_deg(temp_f20 * 6.0f) * 32.0f * sin_deg(temp_f20)) + 256.0f + (cos_deg(2.0f * temp_f20) * 32.0f) + (cos_deg(temp_f20) * 32.0f); data->unk_34 += 0.2; if (data->unk_34 >= 128.0f) { data->unk_34 = 0.0f; @@ -184,16 +184,16 @@ void water_block_update(EffectInstance* effect) { if (data->unk_88[i] == 0) { data->unk_38[i] = 0.0f; data->unk_48[i] = 240.0f; - data->unk_58[i] = (shim_rand_int(10) - 5) * 0.2; - data->unk_68[i] = shim_rand_int(10) + 2; - data->unk_78[i] = shim_rand_int(10) + 1; + data->unk_58[i] = (rand_int(10) - 5) * 0.2; + data->unk_68[i] = rand_int(10) + 2; + data->unk_78[i] = rand_int(10) + 1; } data->unk_48[i] += data->unk_68[i]; data->unk_38[i] += data->unk_58[i]; data->unk_58[i] *= 0.97; data->unk_68[i] += (10.0f - data->unk_68[i]) * 0.1; if (data->unk_48[i] > 480.0f) { - data->unk_88[i] = ~shim_rand_int(10); + data->unk_88[i] = ~rand_int(10); } } } @@ -208,7 +208,7 @@ void water_block_render(EffectInstance* effect) { renderTask.distance = 20; renderTask.renderMode = RENDER_MODE_2D; - retTask = shim_queue_render_task(&renderTask); + retTask = queue_render_task(&renderTask); retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; } @@ -229,8 +229,8 @@ void water_block_appendGfx(void *effect) { gDPPipeSync(gMainGfxPos++); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(effectTemp->graphics->data)); - shim_guTranslateF(sp20, data->pos.x, data->pos.y, data->pos.z); - shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(sp20, data->pos.x, data->pos.y, data->pos.z); + guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); @@ -246,9 +246,9 @@ void water_block_appendGfx(void *effect) { f32 z = var_s6->unk_02 * 10; if (y != 0.0f) { - f32 dx = shim_sin_deg(temp_s0 + func_E0200044(1000, (x + (y * 10.0f) + (z * 100.0f)))) * 20.0f; - f32 dy = shim_sin_deg(temp_s0 + func_E0200044(1000, ((x * 10.0f) + (y * 100.0f) + z))) * 20.0f; - f32 dz = shim_sin_deg(temp_s0 + func_E0200044(1000, ((x * 100.0f) + y + (z * 10.0f)))) * 20.0f; + f32 dx = sin_deg(temp_s0 + func_E0200044(1000, (x + (y * 10.0f) + (z * 100.0f)))) * 20.0f; + f32 dy = sin_deg(temp_s0 + func_E0200044(1000, ((x * 10.0f) + (y * 100.0f) + z))) * 20.0f; + f32 dz = sin_deg(temp_s0 + func_E0200044(1000, ((x * 100.0f) + y + (z * 10.0f)))) * 20.0f; x += dx; y += dy; z += dz; @@ -267,8 +267,8 @@ void water_block_appendGfx(void *effect) { var_fp->v.cn[3] = 80; } - shim_guScaleF(sp20, 0.1f, 0.1f, 0.1f); - shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); + guScaleF(sp20, 0.1f, 0.1f, 0.1f); + guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gDPSetEnvColor(gMainGfxPos++, 0, 0, 255, data->unk_28); @@ -277,8 +277,8 @@ void water_block_appendGfx(void *effect) { for (i = 0; i < NUM_WATER_BLOCK_COMPONENTS; i++) { if (data->unk_88[i] >= 0) { - shim_guPositionF(sp20, 0.0f, 0.0f, 0.0f, data->unk_78[i], data->unk_38[i], data->unk_48[i], 0.0f); - shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); + guPositionF(sp20, 0.0f, 0.0f, 0.0f, data->unk_78[i], data->unk_38[i], data->unk_48[i], 0.0f); + guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPDisplayList(gMainGfxPos++, D_090004A0_3B7090); gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW); diff --git a/src/effects/water_fountain.c b/src/effects/water_fountain.c index 35941ed9e41..62aa740806f 100644 --- a/src/effects/water_fountain.c +++ b/src/effects/water_fountain.c @@ -134,10 +134,10 @@ EffectInstance* water_fountain_main(s32 arg0, f32 posX, f32 posY, f32 posZ, f32 effectBp.renderUI = NULL; effectBp.effectID = EFFECT_WATER_FOUNTAIN; - effect = shim_create_effect_instance(&effectBp); + effect = create_effect_instance(&effectBp); effect->numParts = numParts; - data = effect->data.waterFountain = shim_general_heap_malloc(numParts * sizeof(*data)); + data = effect->data.waterFountain = general_heap_malloc(numParts * sizeof(*data)); ASSERT(data != NULL); data->unk_00 = arg0; @@ -180,7 +180,7 @@ void water_fountain_update(EffectInstance* effect) { } data->lifeTime++; if (data->timeLeft < 0) { - shim_remove_effect(effect); + remove_effect(effect); return; } if (data->lifeTime < 8) { @@ -198,7 +198,7 @@ void water_fountain_render(EffectInstance* effect) { renderTask.distance = 10; renderTask.renderMode = RENDER_MODE_2D; - retTask = shim_queue_render_task(&renderTask); + retTask = queue_render_task(&renderTask); retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; } @@ -238,19 +238,19 @@ void water_fountain_appendGfx(void *effect) { gDPPipeSync(gMainGfxPos++); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); - shim_guTranslateF(sp18, data->pos.x, data->pos.y, data->pos.z); - shim_guScaleF(sp58, data->unk_34, data->unk_34, data->unk_34); - shim_guMtxCatF(sp58, sp18, sp18); - shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(sp18, data->pos.x, data->pos.y, data->pos.z); + guScaleF(sp58, data->unk_34, data->unk_34, data->unk_34); + guMtxCatF(sp58, sp18, sp18); + guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); 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); gSPDisplayList(gMainGfxPos++, D_09000280_3B8AE0); - shim_guRotateF(sp18, data->unk_38, 0.0f, 0.0f, 1.0f); - shim_guScaleF(sp58, data->unk_3C, data->unk_40, 1.0f); - shim_guMtxCatF(sp58, sp18, sp18); - shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); + guRotateF(sp18, data->unk_38, 0.0f, 0.0f, 1.0f); + guScaleF(sp58, data->unk_3C, data->unk_40, 1.0f); + guMtxCatF(sp58, sp18, sp18); + guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gDPSetEnvColor(gMainGfxPos++, data->unk_28, data->unk_2C, data->unk_30, unk_24); @@ -269,12 +269,12 @@ void water_fountain_appendGfx(void *effect) { if (lifeTime * 5 >= idx) { s32 temp2 = idx + 1; if (timeLeft >= var_s6 - temp2) { - shim_guTranslateF(sp18, (f32) ptr[idx].unk_00, (f32) ptr[idx].unk_01 + 10.0f, 0.0f); - shim_guScaleF(sp58, (f32) basePtr[idx].unk_02 * 0.01, (f32) basePtr[idx].unk_04 * 0.01, 1.0f); - shim_guMtxCatF(sp58, sp18, sp18); - shim_guRotateF(sp58, (f32) ptr[idx].unk_06 + D_E00B8CA4[(j + i) & 7], 0.0f, 0.0f, 1.0f); - shim_guMtxCatF(sp58, sp18, sp18); - shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(sp18, (f32) ptr[idx].unk_00, (f32) ptr[idx].unk_01 + 10.0f, 0.0f); + guScaleF(sp58, (f32) basePtr[idx].unk_02 * 0.01, (f32) basePtr[idx].unk_04 * 0.01, 1.0f); + guMtxCatF(sp58, sp18, sp18); + guRotateF(sp58, (f32) ptr[idx].unk_06 + D_E00B8CA4[(j + i) & 7], 0.0f, 0.0f, 1.0f); + guMtxCatF(sp58, sp18, sp18); + guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gDPSetPrimColor(gMainGfxPos++, 0, 0, unk_18, unk_1C, unk_20, (unk_24 * basePtr[idx].unk_08) >> 8); diff --git a/src/effects/water_splash.c b/src/effects/water_splash.c index 2d1dd1ebfd6..6ba89ccb9d1 100644 --- a/src/effects/water_splash.c +++ b/src/effects/water_splash.c @@ -43,9 +43,9 @@ EffectInstance* water_splash_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 ar bpPtr->unk_00 = 0; bpPtr->renderUI = NULL; bpPtr->effectID = EFFECT_WATER_SPLASH; - effect = shim_create_effect_instance(bpPtr); + effect = create_effect_instance(bpPtr); effect->numParts = numParts; - effect->data.waterSplash = part = shim_general_heap_malloc(numParts * sizeof(*part)); + effect->data.waterSplash = part = general_heap_malloc(numParts * sizeof(*part)); ASSERT(part != NULL); part->unk_00 = arg0; @@ -72,24 +72,24 @@ EffectInstance* water_splash_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 ar part->unk_34 = 2.0f; switch (arg0) { case 0: - part->unk_10.x = shim_rand_int(10) - 2; - part->unk_10.y = shim_rand_int(10) - 5; - part->unk_10.z = shim_rand_int(10) - 5; + part->unk_10.x = rand_int(10) - 2; + part->unk_10.y = rand_int(10) - 5; + part->unk_10.z = rand_int(10) - 5; break; case 1: - part->unk_10.x = 2 - shim_rand_int(10); - part->unk_10.y = shim_rand_int(10) - 5; - part->unk_10.z = shim_rand_int(10) - 5; + part->unk_10.x = 2 - rand_int(10); + part->unk_10.y = rand_int(10) - 5; + part->unk_10.z = rand_int(10) - 5; break; case 2: - part->unk_10.x = (shim_rand_int(100) - 50) * 0.07f; - part->unk_10.y = (shim_rand_int(100) + 10) * 0.2f; - part->unk_10.z = (shim_rand_int(100) - 50) * 0.07f; + part->unk_10.x = (rand_int(100) - 50) * 0.07f; + part->unk_10.y = (rand_int(100) + 10) * 0.2f; + part->unk_10.z = (rand_int(100) - 50) * 0.07f; break; default: - part->unk_10.x = (shim_rand_int(10) - 5) * 0.5; - part->unk_10.y = (shim_rand_int(10) - 5) * 0.5; - part->unk_10.z = (shim_rand_int(10) - 5) * 0.5; + part->unk_10.x = (rand_int(10) - 5) * 0.5; + part->unk_10.y = (rand_int(10) - 5) * 0.5; + part->unk_10.z = (rand_int(10) - 5) * 0.5; part->unk_1C = i; part->unk_34 = 0.4f; break; @@ -122,7 +122,7 @@ void water_splash_update(EffectInstance *effect) { temp_a1_3 = part->unk_1C; part->unk_20++; if (temp_a1_3 < 0) { - shim_remove_effect(effect); + remove_effect(effect); return; } @@ -160,7 +160,7 @@ void water_splash_render(EffectInstance* effect) { renderTask.distance = 10; renderTask.renderMode = RENDER_MODE_2D; - retTask = shim_queue_render_task(&renderTask); + retTask = queue_render_task(&renderTask); } void func_E00BE5B4(void) { @@ -178,10 +178,10 @@ void water_splash_appendGfx(void* effect) { gDPPipeSync(gMainGfxPos++); gSPSegment(gMainGfxPos++, 0x09, OS_K0_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); - shim_guTranslateF(sp10, sp94, temp_fp, data->unk_04.z); - shim_guScaleF(sp50, data->unk_34, data->unk_34, data->unk_34); - shim_guMtxCatF(sp50, sp10, sp10); - shim_guMtxF2L(sp10, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(sp10, sp94, temp_fp, data->unk_04.z); + guScaleF(sp50, data->unk_34, data->unk_34, data->unk_34); + guMtxCatF(sp50, sp10, sp10); + guMtxF2L(sp10, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, currentCamera->unkMatrix, G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPDisplayList(gMainGfxPos++, D_09000100_3BCB90); @@ -207,10 +207,10 @@ void water_splash_appendGfx(void* effect) { temp_t2 + 0xA0, temp_t3 + 0x78, temp_t2 + 0xBF, temp_t3 + 0x97, 0, G_TX_WRAP, G_TX_WRAP, 5, 5, G_TX_NOLOD, G_TX_NOLOD); - shim_guTranslateF(sp10, data->unk_04.x, data->unk_04.y, data->unk_04.z); - shim_guScaleF(sp50, data->unk_34, data->unk_34, data->unk_34); - shim_guMtxCatF(sp50, sp10, sp10); - shim_guMtxF2L(sp10, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(sp10, data->unk_04.x, data->unk_04.y, data->unk_04.z); + guScaleF(sp50, data->unk_34, data->unk_34, data->unk_34); + guMtxCatF(sp50, sp10, sp10); + guMtxF2L(sp10, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gDPSetPrimColor(gMainGfxPos++, 0, 0, 200, 255, 255, (sp90 * data->unk_30) / 255); gDPSetEnvColor(gMainGfxPos++, 0, 32, 32, 0); diff --git a/src/effects/waterfall.c b/src/effects/waterfall.c index ac23f336dbe..be87eb12f30 100644 --- a/src/effects/waterfall.c +++ b/src/effects/waterfall.c @@ -29,9 +29,9 @@ EffectInstance* waterfall_main( bp.renderUI = NULL; bp.effectID = EFFECT_WATERFALL; - effect = shim_create_effect_instance(&bp); + effect = create_effect_instance(&bp); effect->numParts = numParts; - data = effect->data.waterfall = shim_general_heap_malloc(numParts * sizeof(*data)); + data = effect->data.waterfall = general_heap_malloc(numParts * sizeof(*data)); ASSERT(effect->data.waterfall != NULL); data->unk_00 = arg0; @@ -52,7 +52,7 @@ EffectInstance* waterfall_main( for (i = 0; i < 12; i++) { data->unk_2C[i] = 0; - data->unk_5C[i] = (f32) shim_rand_int(10) * 0.01 + -1.0; + data->unk_5C[i] = (f32) rand_int(10) * 0.01 + -1.0; } return effect; @@ -78,7 +78,7 @@ void waterfall_update(EffectInstance* effect) { data->unk_14++; if (data->unk_10 < 0) { - shim_remove_effect(effect); + remove_effect(effect); return; } @@ -110,7 +110,7 @@ void waterfall_render(EffectInstance* effect) { renderTask.distance = 10; renderTask.renderMode = RENDER_MODE_2D; - retTask = shim_queue_render_task(&renderTask); + retTask = queue_render_task(&renderTask); } void func_E00B62D8(void) { @@ -132,10 +132,10 @@ void waterfall_appendGfx(void* effect) { gDPPipeSync(gMainGfxPos++); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); - shim_guTranslateF(sp10, data->unk_04, data->unk_08, data->unk_0C); - shim_guScaleF(sp50, scale, scale, scale); - shim_guMtxCatF(sp50, sp10, sp10); - shim_guMtxF2L(sp10, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(sp10, data->unk_04, data->unk_08, data->unk_0C); + guScaleF(sp50, scale, scale, scale); + guMtxCatF(sp50, sp10, sp10); + guMtxF2L(sp10, &gDisplayContext->matrixStack[gMatrixListPos]); 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); diff --git a/src/effects/whirlwind.c b/src/effects/whirlwind.c index b03ff7122f7..c5b99ca6538 100644 --- a/src/effects/whirlwind.c +++ b/src/effects/whirlwind.c @@ -24,9 +24,9 @@ EffectInstance* whirlwind_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, bp.effectID = EFFECT_WHIRLWIND; numParts = 1; - effect = shim_create_effect_instance(bpPtr); + effect = create_effect_instance(bpPtr); effect->numParts = numParts; - part = effect->data.whirlwind = shim_general_heap_malloc(effect->numParts * sizeof(*part)); + part = effect->data.whirlwind = general_heap_malloc(effect->numParts * sizeof(*part)); ASSERT(part != NULL); part->unk_00 = arg0; @@ -55,9 +55,9 @@ EffectInstance* whirlwind_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, part->unk_58[i] = arg2; part->unk_78[i] = arg3; part->unk_98[i] = i * 0.2 + 1.0; - part->unk_B8[i] = shim_rand_int(360); - part->unk_D8[i] = shim_rand_int(100) * 0.1 + 2.0; - part->unk_F8[i] = shim_rand_int(30) * 0.1; + part->unk_B8[i] = rand_int(360); + part->unk_D8[i] = rand_int(100) * 0.1 + 2.0; + part->unk_F8[i] = rand_int(30) * 0.1; part->unk_118[i] = 0; } part->unk_138 = 0; @@ -87,7 +87,7 @@ void whirlwind_update(EffectInstance* effect) { } part->unk_14++; if (part->unk_10 < 0) { - shim_remove_effect(effect); + remove_effect(effect); return; } temp = part->unk_34; @@ -139,7 +139,7 @@ void whirlwind_render(EffectInstance* effect) { renderTask.distance = 10; renderTask.renderMode = RENDER_MODE_2D; - queuedTask = shim_queue_render_task(&renderTask); + queuedTask = queue_render_task(&renderTask); queuedTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; } @@ -174,8 +174,8 @@ void whirlwind_appendGfx(void* effect) { gDPPipeSync(gMainGfxPos++); gSPSegment(gMainGfxPos++, 0x09, OS_K0_TO_PHYSICAL(eff->graphics->data)); - shim_guTranslateF(sp20, 0.0f, 0.0f, 0.0f); - shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(sp20, 0.0f, 0.0f, 0.0f); + guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(gMainGfxPos++, D_09000400_3D3D30); @@ -190,16 +190,16 @@ void whirlwind_appendGfx(void* effect) { // fill the vertex buffer; 2 sets of 16 verticies for (i = 0; i <= (360 / 24); i++) { Vtx* vtx = &vertexBuffer[i]; - vtx->v.ob[0] = shim_cos_deg(i * (360 / 15)) * 100.0f; + vtx->v.ob[0] = cos_deg(i * (360 / 15)) * 100.0f; vtx->v.ob[1] = 0; - vtx->v.ob[2] = shim_sin_deg(i * (360 / 15)) * 100.0f; + vtx->v.ob[2] = sin_deg(i * (360 / 15)) * 100.0f; vtx->v.tc[0] = i * 128; vtx->v.tc[1] = 0; vtx = &vertexBuffer[i + (360 / 24 + 1)]; - vtx->v.ob[0] = shim_cos_deg(i * (360 / 15)) * 100.0f; + vtx->v.ob[0] = cos_deg(i * (360 / 15)) * 100.0f; vtx->v.ob[1] = 0; - vtx->v.ob[2] = shim_sin_deg(i * (360 / 15)) * 100.0f; + vtx->v.ob[2] = sin_deg(i * (360 / 15)) * 100.0f; vtx->v.tc[0] = i * 512; vtx->v.tc[1] = 1024; } @@ -218,8 +218,8 @@ void whirlwind_appendGfx(void* effect) { // This marks the end of our dynamically generated display list, return control back to the main display list gSPEndDisplayList(gMainGfxPos++); - shim_guScaleF(sp20, 0.1f, 0.1f, 0.1f); - shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); + guScaleF(sp20, 0.1f, 0.1f, 0.1f); + guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); // Save position to later insert a branch around the commands that follow this @@ -230,33 +230,33 @@ void whirlwind_appendGfx(void* effect) { // Generate main display list for(i = 0; i < (MAX_WHIRLWIND_SEGMENTS - 1); i++) { - shim_guPositionF(sp20, 0.0f, 0.0f, data->unk_118[i], 1.0f, data->unk_38[i] * 10.0f, data->unk_58[i] * 10.0f, data->unk_78[i] * 10.0f); - shim_guRotateF(sp60, data->unk_138 + i * i, -0.03f, 1.0f, 0.1f); - shim_guMtxCatF(sp60, sp20, sp20); + guPositionF(sp20, 0.0f, 0.0f, data->unk_118[i], 1.0f, data->unk_38[i] * 10.0f, data->unk_58[i] * 10.0f, data->unk_78[i] * 10.0f); + guRotateF(sp60, data->unk_138 + i * i, -0.03f, 1.0f, 0.1f); + guMtxCatF(sp60, sp20, sp20); var_f4 = data->unk_98[i] * spB8; if (spA0 < 0x10) { var_f4 += (127 - primAlpha) * 0.02f; } - shim_guScaleF(sp60, var_f4, spB8, var_f4); - shim_guMtxCatF(sp60, sp20, sp20); + guScaleF(sp60, var_f4, spB8, var_f4); + guMtxCatF(sp60, sp20, sp20); temp_f20_2 = data->unk_F8[i] * 10.0f; f22 = data->unk_B8[i]; - shim_guTranslateF(sp60, temp_f20_2 * shim_sin_deg(f22), 0.0f, temp_f20_2 * shim_cos_deg(f22)); - shim_guMtxCatF(sp60, sp20, sp20); - shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(sp60, temp_f20_2 * sin_deg(f22), 0.0f, temp_f20_2 * cos_deg(f22)); + guMtxCatF(sp60, sp20, sp20); + guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPVertex(gMainGfxPos++, vertexBuffer, 16, 0); gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW); - shim_guPositionF(sp20, 0.0f, 0.0f, data->unk_118[i + 1], 1.0f, data->unk_38[i + 1] * 10.0f, data->unk_58[i + 1] * 10.0f, data->unk_78[i + 1] * 10.0f); - shim_guRotateF(sp60, data->unk_138 + i * i, 0.03f, 1.0f, 0.0f); - shim_guMtxCatF(sp60, sp20, sp20); - shim_guScaleF(sp60, data->unk_98[i + 1] * spB8, spB8, data->unk_98[i + 1] * spB8); - shim_guMtxCatF(sp60, sp20, sp20); + guPositionF(sp20, 0.0f, 0.0f, data->unk_118[i + 1], 1.0f, data->unk_38[i + 1] * 10.0f, data->unk_58[i + 1] * 10.0f, data->unk_78[i + 1] * 10.0f); + guRotateF(sp60, data->unk_138 + i * i, 0.03f, 1.0f, 0.0f); + guMtxCatF(sp60, sp20, sp20); + guScaleF(sp60, data->unk_98[i + 1] * spB8, spB8, data->unk_98[i + 1] * spB8); + guMtxCatF(sp60, sp20, sp20); temp_f20_3 = data->unk_F8[i] * 10.0f; - shim_guTranslateF(sp60, temp_f20_3 * shim_sin_deg(data->unk_B8[i]), 0.0f, temp_f20_3 * shim_cos_deg(data->unk_B8[i])); - shim_guMtxCatF(sp60, sp20, sp20); - shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(sp60, temp_f20_3 * sin_deg(data->unk_B8[i]), 0.0f, temp_f20_3 * cos_deg(data->unk_B8[i])); + guMtxCatF(sp60, sp20, sp20); + guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPVertex(gMainGfxPos++, &vertexBuffer[16], 16, 16); gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW); diff --git a/src/effects/windy_leaves.c b/src/effects/windy_leaves.c index 25922199f8b..030076789a7 100644 --- a/src/effects/windy_leaves.c +++ b/src/effects/windy_leaves.c @@ -26,9 +26,9 @@ void windy_leaves_main(s32 type, f32 arg1, f32 arg2, f32 arg3) { bp.effectID = EFFECT_WINDY_LEAVES; numParts = 5; - effect = shim_create_effect_instance(bpPtr); + effect = create_effect_instance(bpPtr); effect->numParts = numParts; - effect->data.windyLeaves = part = shim_general_heap_malloc(numParts * sizeof(*part)); + effect->data.windyLeaves = part = general_heap_malloc(numParts * sizeof(*part)); ASSERT(part != NULL); part->type = type; @@ -70,8 +70,8 @@ void windy_leaves_main(s32 type, f32 arg1, f32 arg2, f32 arg3) { break; case 2: part->unk_1C = 2.0 * ((f32)temp_v0_2 * 0.1); - part->unk_10 = -part->unk_04.x * (shim_rand_int(10) * 0.008 + 0.05); - part->unk_14 = -part->unk_04.y * (shim_rand_int(10) * 0.008 + 0.05); + part->unk_10 = -part->unk_04.x * (rand_int(10) * 0.008 + 0.05); + part->unk_14 = -part->unk_04.y * (rand_int(10) * 0.008 + 0.05); break; default: break; @@ -96,7 +96,7 @@ void windy_leaves_update(EffectInstance* effect) { part->unk_28--; part->unk_2C++; if (part->unk_28 < 0) { - shim_remove_effect(effect); + remove_effect(effect); return; } temp_a1 = part->unk_2C; @@ -113,19 +113,19 @@ void windy_leaves_update(EffectInstance* effect) { switch (temp) { case 0: for (i = 1; i < effect->numParts; i++, part++) { - f32 temp3 = (shim_sin_deg(2.0f * part->unk_18) * 0.2); + f32 temp3 = (sin_deg(2.0f * part->unk_18) * 0.2); part->unk_14 += -0.05f; part->unk_10 += temp3; if (temp == 0) { 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 { part->unk_14 += -0.05f; part->unk_10 *= 0.92; } part->unk_1C += func_E0200044(50, temp_a1 + i * 20) - 25; - part->unk_18 += shim_sin_deg(part->unk_1C) * 10.0f; - part->unk_20 += shim_cos_deg(part->unk_1C * 0.5) * 10.0f; + part->unk_18 += sin_deg(part->unk_1C) * 10.0f; + part->unk_20 += cos_deg(part->unk_1C * 0.5) * 10.0f; part->unk_04.x += part->unk_10; part->unk_04.y += part->unk_14; if (part->unk_04.y < 30.0f) { @@ -163,13 +163,13 @@ void windy_leaves_update(EffectInstance* effect) { break; case 1: for (i = 1; i < effect->numParts; i++, part++) { - part->unk_10 += (f32)(shim_sin_deg(2.0f * part->unk_18) * 0.2 * 2.0); + part->unk_10 += (f32)(sin_deg(2.0f * part->unk_18) * 0.2 * 2.0); part->unk_14 += -0.05f; part->unk_10 *= 0.8464; part->unk_14 += -0.05f; part->unk_1C += func_E0200044(50, temp_a1 + i * 20) - 25; - part->unk_18 += shim_sin_deg(part->unk_1C) * 10.0f; - part->unk_20 += shim_cos_deg(part->unk_1C * 0.5) * 10.0f; + part->unk_18 += sin_deg(part->unk_1C) * 10.0f; + part->unk_20 += cos_deg(part->unk_1C * 0.5) * 10.0f; part->unk_04.x += part->unk_10; part->unk_04.y += part->unk_14; if (part->unk_04.y < 30.0f) { @@ -208,8 +208,8 @@ void windy_leaves_update(EffectInstance* effect) { case 2: for (i = 1; i < effect->numParts; i++, part++) { part->unk_1C += func_E0200044(50, temp_a1 + i * 20) - 25; - part->unk_18 += shim_sin_deg(part->unk_1C) * 10.0f; - part->unk_20 += shim_cos_deg(part->unk_1C * 0.5) * 10.0f; + part->unk_18 += sin_deg(part->unk_1C) * 10.0f; + part->unk_20 += cos_deg(part->unk_1C * 0.5) * 10.0f; part->unk_04.x += part->unk_10; part->unk_04.y += part->unk_14; } @@ -226,7 +226,7 @@ void windy_leaves_render(EffectInstance* effect) { renderTask.distance = 0; renderTask.renderMode = RENDER_MODE_2D; - retTask = shim_queue_render_task(&renderTask); + retTask = queue_render_task(&renderTask); retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; } @@ -244,19 +244,19 @@ void windy_leaves_appendGfx(void* effect) { gSPSegment(gMainGfxPos++, 0x09, OS_K0_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); gSPDisplayList(gMainGfxPos++, D_09001180_33E790); gDPSetPrimColor(gMainGfxPos++, 0, 0, 20, 100, 20, part->alpha); - shim_guTranslateF(sp18, part->unk_04.x, part->unk_04.y, part->unk_04.z); - shim_guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); - shim_guMtxCatF(sp58, sp18, sp98); + guTranslateF(sp18, part->unk_04.x, part->unk_04.y, part->unk_04.z); + guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guMtxCatF(sp58, sp18, sp98); part++; for (i = 1; i < ((EffectInstance*)effect)->numParts; i++, part++) { - shim_guTranslateF(sp58, part->unk_04.x, part->unk_04.y, part->unk_04.z); - shim_guMtxCatF(sp58, sp98, sp18); - shim_guRotateF(sp58, part->unk_18, 0.0f, 0.0f, 1.0f); - shim_guMtxCatF(sp58, sp18, sp18); - shim_guRotateF(sp58, part->unk_20, 0.0f, 1.0f, 0.0f); - shim_guMtxCatF(sp58, sp18, sp18); - shim_guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); + guTranslateF(sp58, part->unk_04.x, part->unk_04.y, part->unk_04.z); + guMtxCatF(sp58, sp98, sp18); + guRotateF(sp58, part->unk_18, 0.0f, 0.0f, 1.0f); + guMtxCatF(sp58, sp18, sp18); + guRotateF(sp58, part->unk_20, 0.0f, 1.0f, 0.0f); + guMtxCatF(sp58, sp18, sp18); + guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPDisplayList(gMainGfxPos++, dlist); gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);