From 2ecf3d6345004f696656eceb320c44a07bfbd4fa Mon Sep 17 00:00:00 2001 From: MegaIDK <125525714+MegaIDK@users.noreply.github.com> Date: Fri, 22 Sep 2023 03:24:47 -0300 Subject: ac_mbg OK but no data (#101) * ac_mbg WIP * format * todo * removed unnecessary commented data --- src/overlays/actors/ovl_Mbg/ac_mbg.c | 57 ++++++++++++++++++++++++++++++++---- src/overlays/actors/ovl_Mbg/ac_mbg.h | 5 +++- 2 files changed, 56 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/overlays/actors/ovl_Mbg/ac_mbg.c b/src/overlays/actors/ovl_Mbg/ac_mbg.c index a59dd7e..887c65c 100644 --- a/src/overlays/actors/ovl_Mbg/ac_mbg.c +++ b/src/overlays/actors/ovl_Mbg/ac_mbg.c @@ -2,6 +2,9 @@ #include "m_actor_dlftbls.h" #include "m_object.h" #include "overlays/gamestates/ovl_play/m_play.h" +#include "m_collision_bg.h" +#include "sys_math.h" +#include "m_rcp.h" void Mbg_Actor_ct(Actor* thisx, Game_Play* game_play); void Mbg_Actor_dt(Actor* thisx, Game_Play* game_play); @@ -9,7 +12,7 @@ void Mbg_Actor_move(Actor* thisx, Game_Play* game_play); void Mbg_Actor_draw(Actor* thisx, Game_Play* game_play); #if 0 -ActorProfile Mbg_Profile = { +ActorProfile Mbg_Profile = { //TODO: import data (some is DisplayList) /* */ ACTOR_MBG, /* */ ACTOR_PART_0, /* */ 0, @@ -24,10 +27,54 @@ ActorProfile Mbg_Profile = { }; #endif -#pragma GLOBAL_ASM("asm/jp/nonmatchings/overlays/actors/ovl_Mbg/ac_mbg/Mbg_Actor_ct.s") +extern Gfx D_80972F40_jp[]; -#pragma GLOBAL_ASM("asm/jp/nonmatchings/overlays/actors/ovl_Mbg/ac_mbg/Mbg_Actor_dt.s") +void Mbg_Actor_ct(Actor* thisx, Game_Play* game_play UNUSED) { + PosRot* temp_a1; + Mbg* this = (Mbg*)thisx; -#pragma GLOBAL_ASM("asm/jp/nonmatchings/overlays/actors/ovl_Mbg/ac_mbg/Mbg_Actor_draw.s") + this->unk_19C = 0; + temp_a1 = &this->actor.world; + this->unk_1A0 = temp_a1->pos; + this->actor.shape.rot.y = 0x2AAA; + this->unk_1AC = 0.0f; + this->unk_19C = mCoBG_RegistMoveBg(this->unk_174, temp_a1, &this->actor.prevPos, &this->actor.shape.rot.y, 40.0f, 0, + 0, 0, 0, 0, 7, 80.0f); +} -#pragma GLOBAL_ASM("asm/jp/nonmatchings/overlays/actors/ovl_Mbg/ac_mbg/Mbg_Actor_move.s") +void Mbg_Actor_dt(Actor* thisx, Game_Play* game_play UNUSED) { + Mbg* this = (Mbg*)thisx; + mCoBG_CrossOffMoveBg(this->unk_19C, thisx); +} + +void Mbg_Actor_draw(Actor* thisx, Game_Play* game_play) { + Vec3f sp3C; + s16 sp3A; + + sp3C = thisx->world.pos; + sp3A = thisx->shape.rot.y; + OPEN_DISPS(game_play->state.gfxCtx); + if (1) {} + _texture_z_light_fog_prim(game_play->state.gfxCtx); + Matrix_translate(sp3C.x, sp3C.y, sp3C.z, 0U); + Matrix_RotateY(sp3A, MTXMODE_APPLY); + gSPMatrix(POLY_OPA_DISP++, _Matrix_to_Mtx_new(game_play->state.gfxCtx), + G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + gSPDisplayList(POLY_OPA_DISP++, D_80972F40_jp); + CLOSE_DISPS(game_play->state.gfxCtx); +} + +void Mbg_Actor_move(Actor* thisx, Game_Play* game_play UNUSED) { + f32 temp_ft2; + Mbg* this = (Mbg*)thisx; + + temp_ft2 = sinf_table(this->unk_1AC * 0.017453292f) * 60.0f; + this->unk_1AC += 2.0f; + if (this->unk_1AC > 360.0f) { + do { + this->unk_1AC -= 360.0f; + } while (this->unk_1AC > 360.0f); + } + this->actor.shape.rot.y += 0x2F; + this->actor.world.pos.x = this->unk_1A0.x + temp_ft2; +} diff --git a/src/overlays/actors/ovl_Mbg/ac_mbg.h b/src/overlays/actors/ovl_Mbg/ac_mbg.h index d48058a..50d878b 100644 --- a/src/overlays/actors/ovl_Mbg/ac_mbg.h +++ b/src/overlays/actors/ovl_Mbg/ac_mbg.h @@ -12,7 +12,10 @@ typedef void (*MbgActionFunc)(struct Mbg*, struct Game_Play*); typedef struct Mbg { /* 0x000 */ Actor actor; - /* 0x174 */ UNK_TYPE1 unk_174[0x3C]; + /* 0x174 */ UNK_TYPE1 unk_174[0x28]; + /* 0x19C */ s32 unk_19C; + /* 0x1A0 */ Vec3f unk_1A0; + /* 0x1AC */ f32 unk_1AC; } Mbg; // size = 0x1B0 #endif -- cgit v1.2.3