diff options
| -rw-r--r-- | include/m_collision_bg.h | 4 | ||||
| -rw-r--r-- | include/m_rcp.h | 2 | ||||
| -rw-r--r-- | include/sys_math.h | 2 | ||||
| -rw-r--r-- | linker_scripts/jp/symbol_addrs_code.txt | 6 | ||||
| -rw-r--r-- | src/overlays/actors/ovl_Mbg/ac_mbg.c | 57 | ||||
| -rw-r--r-- | src/overlays/actors/ovl_Mbg/ac_mbg.h | 5 |
6 files changed, 63 insertions, 13 deletions
diff --git a/include/m_collision_bg.h b/include/m_collision_bg.h index d68d2c9..0fb4a07 100644 --- a/include/m_collision_bg.h +++ b/include/m_collision_bg.h @@ -99,9 +99,9 @@ typedef struct mCoBG_OffsetTable { // void func_8006B5C0_jp(); // void func_8006B664_jp(); // void func_8006B92C_jp(); -// void func_8006B97C_jp(); +s32 mCoBG_RegistMoveBg(s8 *arg0, PosRot *arg1, Vec3f *arg2, s16 *arg3, f32 arg4, s32 arg5, s32 arg6, s32 arg7, s32 arg8, s32 arg9, s32 argA, f32 argB); // void func_8006BAA8_jp(); -// void func_8006BAE4_jp(); +void mCoBG_CrossOffMoveBg(s32 arg0, struct Actor *actor); void func_8006BB64_jp(void); // void func_8006BB9C_jp(); // void func_8006BBE8_jp(); diff --git a/include/m_rcp.h b/include/m_rcp.h index da77c5c..57d180c 100644 --- a/include/m_rcp.h +++ b/include/m_rcp.h @@ -14,7 +14,7 @@ Gfx* gfx_set_fog_nosync(Gfx* gfx, u8 arg1, u8 arg2, u8 arg3, s32 arg4, s16 arg5, // void func_800BD470_jp(); // void func_800BD498_jp(); // void func_800BD4C0_jp(); -// void func_800BD4E8_jp(); +void _texture_z_light_fog_prim(struct GraphicsContext *gfxCtx); // void _texture_z_light_fog_prim_shadow(); // void func_800BD538_jp(); void func_800BD598_jp(Gfx* gfx); diff --git a/include/sys_math.h b/include/sys_math.h index 028151f..c78155c 100644 --- a/include/sys_math.h +++ b/include/sys_math.h @@ -15,7 +15,7 @@ // void ffact(); // void ifact(); // void powi(); -// void sinf_table(); +f32 sinf_table(f32); // void cosf_table(); // void tanf_table(); diff --git a/linker_scripts/jp/symbol_addrs_code.txt b/linker_scripts/jp/symbol_addrs_code.txt index 95c9a7c..70c5fd0 100644 --- a/linker_scripts/jp/symbol_addrs_code.txt +++ b/linker_scripts/jp/symbol_addrs_code.txt @@ -689,9 +689,9 @@ func_8006B39C_jp = 0x8006B39C; // type:func func_8006B5C0_jp = 0x8006B5C0; // type:func func_8006B664_jp = 0x8006B664; // type:func func_8006B92C_jp = 0x8006B92C; // type:func -func_8006B97C_jp = 0x8006B97C; // type:func +mCoBG_RegistMoveBg = 0x8006B97C; // type:func func_8006BAA8_jp = 0x8006BAA8; // type:func -func_8006BAE4_jp = 0x8006BAE4; // type:func +mCoBG_CrossOffMoveBg = 0x8006BAE4; // type:func func_8006BB64_jp = 0x8006BB64; // type:func func_8006BB9C_jp = 0x8006BB9C; // type:func func_8006BBE8_jp = 0x8006BBE8; // type:func @@ -2880,7 +2880,7 @@ func_800BD448_jp = 0x800BD448; // type:func func_800BD470_jp = 0x800BD470; // type:func func_800BD498_jp = 0x800BD498; // type:func func_800BD4C0_jp = 0x800BD4C0; // type:func -func_800BD4E8_jp = 0x800BD4E8; // type:func +_texture_z_light_fog_prim = 0x800BD4E8; // type:func _texture_z_light_fog_prim_shadow = 0x800BD510; // type:func func_800BD538_jp = 0x800BD538; // type:func func_800BD598_jp = 0x800BD598; // type:func 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 |
