From d7e750a3207941a551112a7d582e97573ac6bb7c Mon Sep 17 00:00:00 2001 From: Prakxo Date: Sun, 21 Apr 2024 17:30:08 +0200 Subject: [PATCH] link ef_ase2 --- config/rel_slices.yml | 4 ++++ src/ef_ase2.c | 47 +++++++++++++++++++++++++++++++++++++------ 2 files changed, 45 insertions(+), 6 deletions(-) diff --git a/config/rel_slices.yml b/config/rel_slices.yml index 46cb1b9a..b082edd3 100644 --- a/config/rel_slices.yml +++ b/config/rel_slices.yml @@ -986,6 +986,10 @@ ef_ase.c: .text: [0x80604F78, 0x806050E4] .rodata: [0x8064BC90, 0x8064BC98] .data: [0x806D1E88, 0x806D1EA0] +ef_ase2.c: + .text: [0x806050E4, 0x806052A8] + .rodata: [0x8064BC98, 0x8064BCA8] + .data: [0x806D1EA0, 0x806D1EC8] ef_coin.c: .text: [0x80608060, 0x806087EC] .rodata: [0x8064BE48, 0x8064BEA0] diff --git a/src/ef_ase2.c b/src/ef_ase2.c index f1d9ed27..0211287f 100644 --- a/src/ef_ase2.c +++ b/src/ef_ase2.c @@ -1,10 +1,20 @@ #include "ef_effect_control.h" +#include "m_common_data.h" static void eAS2_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1); static void eAS2_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg); static void eAS2_mv(eEC_Effect_c* effect, GAME* game); static void eAS2_dw(eEC_Effect_c* effect, GAME* game); +extern Gfx ef_ase02_00_modelT[]; +extern Gfx ef_ase02_01_modelT[]; +extern Gfx ef_ase02_02_modelT[]; +extern Gfx ef_ase02_03_modelT[]; + +static Gfx* eAS2_model_table[] = { + ef_ase02_00_modelT,ef_ase02_01_modelT,ef_ase02_02_modelT,ef_ase02_03_modelT, +}; + eEC_PROFILE_c iam_ef_ase2 = { // clang-format off &eAS2_init, @@ -17,18 +27,43 @@ eEC_PROFILE_c iam_ef_ase2 = { // clang-format on }; + static void eAS2_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) { - // TODO + xyz_t offs; + + offs.x = 0.0f; + offs.y = 0.0f; + offs.z = 30.0f; + eEC_CLIP->make_effect_proc(eEC_EFFECT_ASE2,pos,&offs,game,NULL,item_name,prio,0,0); } static void eAS2_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) { - // TODO + effect->scale.x = 0.006f; + effect->scale.y = 0.006f; + effect->scale.z = 0.006f; + effect->effect_specific[0] = 0; + effect->timer = 26; } static void eAS2_mv(eEC_Effect_c* effect, GAME* game) { - // TODO + eEC_CLIP->set_continious_env_proc(effect,26,52); + effect->effect_specific[0]++; + sAdo_OngenPos((u32) effect, 0x29, &effect->position); } - static void eAS2_dw(eEC_Effect_c* effect, GAME* game) { - // TODO -} + s16 idx = (s16)((effect->effect_specific[0] >> 2) & 3); + xyz_t* scale = &effect->scale; + + OPEN_DISP(game->graph); + if (scale) { + + } + else { + + } + + eEC_CLIP->auto_matrix_xlu_offset_proc(game, &effect->position, scale, &effect->offset); + gSPDisplayList(NEXT_POLY_XLU_DISP, eAS2_model_table[idx]); + + CLOSE_DISP(game->graph); +} \ No newline at end of file