From 1c8251e938cc216d96b6fa4b13a541a578ea5374 Mon Sep 17 00:00:00 2001 From: Norgesnerd <5824576+Norgesnerd@users.noreply.github.com> Date: Tue, 27 May 2025 13:30:38 +0200 Subject: [PATCH 1/2] Implement & link ef_lovelove2 --- configure.py | 2 +- src/effect/ef_lovelove2.c | 46 +++++++++++++++++++++++++++++++++++---- 2 files changed, 43 insertions(+), 5 deletions(-) diff --git a/configure.py b/configure.py index e053a6c3..dfe40437 100644 --- a/configure.py +++ b/configure.py @@ -1290,7 +1290,7 @@ config.libs = [ Object(Matching, "effect/ef_kyousou_onpu.c"), Object(Matching, "effect/ef_lamp_light.c"), Object(Matching, "effect/ef_lovelove.c"), - Object(NonMatching, "effect/ef_lovelove2.c"), + Object(Matching, "effect/ef_lovelove2.c"), Object(NonMatching, "effect/ef_lovelove_heart.c"), Object(Matching, "effect/ef_make_hem.c"), Object(NonMatching, "effect/ef_mizutama.c"), diff --git a/src/effect/ef_lovelove2.c b/src/effect/ef_lovelove2.c index 1ce83096..2a40a81b 100644 --- a/src/effect/ef_lovelove2.c +++ b/src/effect/ef_lovelove2.c @@ -1,5 +1,9 @@ #include "ef_effect_control.h" +#include "m_common_data.h" + +extern Gfx ef_lovelove02_00_modelT[]; + static void eLL2_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1); static void eLL2_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg); static void eLL2_mv(eEC_Effect_c* effect, GAME* game); @@ -18,17 +22,51 @@ eEC_PROFILE_c iam_ef_lovelove2 = { }; static void eLL2_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) { - // TODO + pos.y += 16.0f; + eEC_CLIP->make_effect_proc(eEC_EFFECT_LOVELOVE2, pos, NULL, game, &angle, item_name, prio, 0, 0); } static void eLL2_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) { - // TODO + effect->effect_specific[0] = *(s16*)ct_arg; + effect->timer = 112; + effect->scale = ZeroVec; + effect->offset = ZeroVec; + effect->effect_specific[1] = 0; + effect->acceleration = ZeroVec; + + sAdo_OngenTrgStart(0x118, &effect->position); } static void eLL2_mv(eEC_Effect_c* effect, GAME* game) { - // TODO + s16 timer = 112 - effect->timer; + effect->effect_specific[1] += DEG2SHORT_ANGLE(10.55f); + effect->position.y += eEC_CLIP->calc_adjust_proc(timer, 0, 28, 1.0f, 0.1f); } static void eLL2_dw(eEC_Effect_c* effect, GAME* game) { - // TODO + f32 temp1, temp2, temp3; + u8 alpha; + + xyz_t* scale = &effect->scale; + s16 timer = 112 - effect->timer; + s16 angle = effect->effect_specific[1]; + f32 sin = sin_s(angle); + f32 cos = cos_s(angle); + + temp1 = eEC_CLIP->calc_adjust_proc(timer, 0, 30, 0.003f, 0.014f); + temp2 = eEC_CLIP->calc_adjust_proc(timer, 0, 30, 1.0125f, 0.6375f); + temp3 = eEC_CLIP->calc_adjust_proc(timer, 0, 30, 0.037499964f, 0.412499964f); + alpha = (s8)eEC_CLIP->calc_adjust_proc(timer, 96, 112, 255.0f, 0.0f); + + scale->x = temp1 * (temp3 + ((sin + 1.0f) * 0.5f * (temp2 - temp3))); + scale->y = temp1 * (temp3 + ((cos + 1.0f) * 0.5f * (temp2 - temp3))); + scale->z = temp1; + + OPEN_DISP(game->graph); + + eEC_CLIP->auto_matrix_xlu_offset_proc(game, &effect->position, scale, &effect->offset); + gDPSetPrimColor(NEXT_POLY_XLU_DISP, 0, 255, 255, 255, 255, alpha); + gSPDisplayList(NEXT_POLY_XLU_DISP, ef_lovelove02_00_modelT); + + CLOSE_DISP(game->graph); } From 11cdb2cd8a67f4de06e7ef01a9e081b734f4bb09 Mon Sep 17 00:00:00 2001 From: Norgesnerd <5824576+Norgesnerd@users.noreply.github.com> Date: Tue, 27 May 2025 13:48:50 +0200 Subject: [PATCH 2/2] Implement & link ef_lovelove_heart --- configure.py | 2 +- src/effect/ef_lovelove_heart.c | 54 +++++++++++++++++++++++++++++++--- 2 files changed, 51 insertions(+), 5 deletions(-) diff --git a/configure.py b/configure.py index dfe40437..4e1a7f33 100644 --- a/configure.py +++ b/configure.py @@ -1291,7 +1291,7 @@ config.libs = [ Object(Matching, "effect/ef_lamp_light.c"), Object(Matching, "effect/ef_lovelove.c"), Object(Matching, "effect/ef_lovelove2.c"), - Object(NonMatching, "effect/ef_lovelove_heart.c"), + Object(Matching, "effect/ef_lovelove_heart.c"), Object(Matching, "effect/ef_make_hem.c"), Object(NonMatching, "effect/ef_mizutama.c"), Object(NonMatching, "effect/ef_motiyuge.c"), diff --git a/src/effect/ef_lovelove_heart.c b/src/effect/ef_lovelove_heart.c index f08f89c1..b00dee7d 100644 --- a/src/effect/ef_lovelove_heart.c +++ b/src/effect/ef_lovelove_heart.c @@ -1,5 +1,9 @@ #include "ef_effect_control.h" +#include "m_common_data.h" + +extern Gfx ef_lovelove01_00_modelT[]; + static void eLoveH_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1); static void eLoveH_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg); static void eLoveH_mv(eEC_Effect_c* effect, GAME* game); @@ -18,17 +22,59 @@ eEC_PROFILE_c iam_ef_lovelove_heart = { }; static void eLoveH_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) { - // TODO + eEC_CLIP->make_effect_proc(eEC_EFFECT_LOVELOVE_HEART, pos, NULL, game, NULL, item_name, prio, 0, 0); } static void eLoveH_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) { - // TODO + eEC_CLIP->random_first_speed_proc(&effect->velocity, 0.55f, 170.0f, 0.0f); + + effect->timer = 120; + + effect->scale.x = 0.0f; + effect->scale.y = 0.0f; + effect->scale.z = 0.0f; + + effect->effect_specific[0] = 0; + + effect->acceleration.x = 0.0f; + effect->acceleration.y = 0.0f; + effect->acceleration.z = 0.0f; } static void eLoveH_mv(eEC_Effect_c* effect, GAME* game) { - // TODO + s16 timer = 120 - effect->timer; + + xyz_t_add(&effect->velocity, &effect->acceleration, &effect->velocity); + xyz_t_add(&effect->position, &effect->velocity, &effect->position); + + effect->effect_specific[0] += DEG2SHORT_ANGLE2(10.55f); + effect->acceleration.y = eEC_CLIP->calc_adjust_proc(timer, 20, 120, 0.0f, 0.0425f); } static void eLoveH_dw(eEC_Effect_c* effect, GAME* game) { - // TODO + f32 temp1, temp2, temp3; + u8 alpha; + + xyz_t* scale = &effect->scale; + s16 timer = 120 - effect->timer; + s16 angle = effect->effect_specific[0]; + f32 sin = sin_s(angle); + f32 cos = cos_s(angle); + + temp1 = eEC_CLIP->calc_adjust_proc(timer, 0, 120, 0.0f, 0.01f); + temp2 = eEC_CLIP->calc_adjust_proc(timer, 0, 30, 1.3499999f, 0.85f); + temp3 = eEC_CLIP->calc_adjust_proc(timer, 0, 30, 0.050000012f, 0.54999995f); + alpha = (s8)eEC_CLIP->calc_adjust_proc(timer, 60, 120, 255.0f, 0.0f); + + scale->x = temp1 * (temp3 + ((sin + 1.0f) * 0.5f * (temp2 - temp3))); + scale->y = temp1 * (temp3 + ((cos + 1.0f) * 0.5f * (temp2 - temp3))); + scale->z = temp1; + + OPEN_DISP(game->graph); + + eEC_CLIP->auto_matrix_xlu_proc(game, &effect->position, scale); + gDPSetPrimColor(NEXT_POLY_XLU_DISP, 0, 255, 255, 255, 255, alpha); + gSPDisplayList(NEXT_POLY_XLU_DISP, ef_lovelove01_00_modelT); + + CLOSE_DISP(game->graph); }