summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/c_keyframe.h2
-rw-r--r--include/m_collision_bg.h12
-rw-r--r--include/m_common_data.h16
-rw-r--r--include/m_lib.h2
-rw-r--r--include/m_rcp.h (renamed from include/6E0F50.h)6
-rw-r--r--include/unknown_structs.h8
-rw-r--r--linker_scripts/jp/symbol_addrs_overlays.txt45
-rw-r--r--linker_scripts/jp/undefined_syms.ld11
-rw-r--r--src/code/game.c2
-rw-r--r--src/code/m_lights.c2
-rw-r--r--src/overlays/actors/ovl_Toudai/ac_toudai.c277
-rw-r--r--src/overlays/actors/ovl_Toudai/ac_toudai.h20
-rw-r--r--src/overlays/gamestates/ovl_play/m_play.c2
-rw-r--r--src/overlays/submenu/submenu_ovl/m_submenu_ovl.c2
-rw-r--r--yamls/jp/code.yaml2
-rw-r--r--yamls/jp/overlays.yaml2
16 files changed, 356 insertions, 55 deletions
diff --git a/include/c_keyframe.h b/include/c_keyframe.h
index 6193640..d375efa 100644
--- a/include/c_keyframe.h
+++ b/include/c_keyframe.h
@@ -99,6 +99,8 @@ s16 cKF_KeyCalc(s16 startIndex, s16 sequenceLength, Keyframe* dataSource, f32 cu
void cKF_SkeletonInfo_subRotInterpolation(f32 t, s16* out, s16 jointRotation, s16 morphRotation);
void cKF_SkeletonInfo_morphST(s16* joint, s16* morph, f32 t);
void cKF_SkeletonInfo_R_zeroClear(SkeletonInfoR* skeletonInfo);
+void cKF_SkeletonInfo_R_ct(SkeletonInfoR* skeletonInfo, BaseSkeletonR* skeleton, BaseAnimationR* animation,
+ Vec3s* jointTable, Vec3s* morphTable);
void cKF_SkeletonInfo_R_dt(SkeletonInfoR* skeletonInfo);
void cKF_SkeletonInfo_R_init_standard_stop(SkeletonInfoR* skeletonInfo, BaseAnimationR* animation, Vec3s* diffRotTable);
void cKF_SkeletonInfo_R_init_standard_stop_speedset(SkeletonInfoR* skeletonInfo, BaseAnimationR* animation,
diff --git a/include/m_collision_bg.h b/include/m_collision_bg.h
index a677c0d..d68d2c9 100644
--- a/include/m_collision_bg.h
+++ b/include/m_collision_bg.h
@@ -4,6 +4,16 @@
#include "ultra64.h"
#include "z64math.h"
+typedef struct mCoBG_OffsetTable {
+ /* 0x00 */ u8 unitAttribute;
+ /* 0x01 */ s8 crOffset;
+ /* 0x02 */ s8 luOffset;
+ /* 0x03 */ s8 ldOffset;
+ /* 0x04 */ s8 rdOffset;
+ /* 0x05 */ s8 ruOffset;
+ /* 0x06 */ s8 slateSwitch;
+} mCoBG_OffsetTable; // size = 0x7
+
// void func_80067430_jp();
// void func_800674B0_jp();
// void func_800674D8_jp();
@@ -215,7 +225,7 @@ s32 mCoBG_SearchWaterLimitDistN(UNK_TYPE* arg0, Vec3f arg1, s16 arg4, f32 arg5,
// void func_800739FC_jp();
// void func_80073C38_jp();
// void func_80073CC0_jp();
-// void mCoBG_SetPluss5PointOffset_file();
+void mCoBG_SetPluss5PointOffset_file(Vec3f pos, mCoBG_OffsetTable offsetData, char* file, s32 line);
// void func_80074090_jp();
// void func_80074174_jp();
// void func_800741DC_jp();
diff --git a/include/m_common_data.h b/include/m_common_data.h
index c3ef8d1..a53d6d2 100644
--- a/include/m_common_data.h
+++ b/include/m_common_data.h
@@ -84,11 +84,12 @@ typedef struct CommonData_unk_10078 {
typedef UNK_RET (*CommonData_unk_10098_unk_4)(struct ActorOverlay*, size_t);
typedef UNK_RET (*CommonData_unk_10098_unk_8)(void);
-
// TODO: figure out if this is a generic memory allocation or if it is Actor specific
typedef UNK_PTR (*CommonData_unk_10098_unk_0C)(void);
-
typedef UNK_RET (*CommonData_unk_10098_unk_10)(struct Actor*);
+typedef UNK_RET (*CommonData_unk_10098_unk_A8)(UNK_PTR, UNK_TYPE, u16 name, Actor* actor);
+typedef UNK_RET (*CommonData_unk_10098_unk_AC)(u16);
+typedef UNK_RET (*CommonData_unk_10098_unk_450)(u16);
typedef struct CommonData_unk_10098 {
/* 0x00 */ UNK_TYPE1 unk_00[0x4];
@@ -96,7 +97,16 @@ typedef struct CommonData_unk_10098 {
/* 0x08 */ CommonData_unk_10098_unk_8 unk_08;
/* 0x0C */ CommonData_unk_10098_unk_0C unk_0C;
/* 0x10 */ CommonData_unk_10098_unk_10 unk_10;
-} CommonData_unk_10098; // size >= 0x10
+ /* 0x014 */ UNK_TYPE1 unk_14[0x94];
+ /* 0x0A8 */ CommonData_unk_10098_unk_A8 unk_A8; // unload object
+ /* 0x0AC */ CommonData_unk_10098_unk_AC unk_AC; // load object
+ /* 0x0B0 */ UNK_TYPE unk_B0;
+ /* 0x0B4 */ UNK_TYPE1 pad[0x450-0xb4];
+ /* 0x450 */ CommonData_unk_10098_unk_450 unk_450; // load palette
+ /* 0x454 */ UNK_TYPE unk_454;
+ /* 0x458 */ UNK_TYPE1 pad2[0x86C-0x458];
+ /* 0x86C */ UNK_TYPE unk_86C;
+} CommonData_unk_10098; // size >= 0x870
typedef struct mPr_mother_mail_info_c {
/* 0x00 */ UNK_TYPE1 unk_00[0xE];
diff --git a/include/m_lib.h b/include/m_lib.h
index 2478201..1fdaecd 100644
--- a/include/m_lib.h
+++ b/include/m_lib.h
@@ -48,7 +48,7 @@ s16 search_position_angleY(Vec3f* arg0, Vec3f* arg1);
// void ValueSet__xyz_t();
// void ValueSet__xyz_t_x1000();
// void ValueSet__s_xyz();
-// void add_calc();
+f32 add_calc(f32* pValue, f32 target, f32 fraction, f32 maxStep, f32 minStep);
// void add_calc2();
// void add_calc0();
// void add_calc_a();
diff --git a/include/6E0F50.h b/include/m_rcp.h
index bd456a5..da77c5c 100644
--- a/include/6E0F50.h
+++ b/include/m_rcp.h
@@ -17,9 +17,9 @@ Gfx* gfx_set_fog_nosync(Gfx* gfx, u8 arg1, u8 arg2, u8 arg3, s32 arg4, s16 arg5,
// void func_800BD4E8_jp();
// void _texture_z_light_fog_prim_shadow();
// void func_800BD538_jp();
-// void func_800BD598_jp();
-// void func_800BD5C0_jp();
-// void func_800BD5E8_jp();
+void func_800BD598_jp(Gfx* gfx);
+void func_800BD5C0_jp(struct GraphicsContext* gfxCtx);
+void func_800BD5E8_jp(Gfx* gfx);
// void func_800BD648_jp();
// void func_800BD68C_jp();
// void func_800BD6D0_jp();
diff --git a/include/unknown_structs.h b/include/unknown_structs.h
index d3de487..59a8da2 100644
--- a/include/unknown_structs.h
+++ b/include/unknown_structs.h
@@ -41,6 +41,14 @@ typedef struct Game_Play_unk_0110 {
/* 0x1818 */ void* unk_1818;
} Game_Play_unk_0110; // size >= 0x181C
+typedef struct ShadowData {
+ /* 0x00 */ u32 numberOfVertices;
+ /* 0x04 */ u8* vertexFixFlagTable;
+ /* 0x08 */ f32 size;
+ /* 0x0C */ Vtx* vertices;
+ /* 0x10 */ Gfx* model;
+} ShadowData; // size = 0x14
+
typedef struct struct_809AEFA4 {
/* 0x00 */ UNK_PTR unk_00;
/* 0x04 */ UNK_PTR unk_04;
diff --git a/linker_scripts/jp/symbol_addrs_overlays.txt b/linker_scripts/jp/symbol_addrs_overlays.txt
index 3d8edeb..6f7430b 100644
--- a/linker_scripts/jp/symbol_addrs_overlays.txt
+++ b/linker_scripts/jp/symbol_addrs_overlays.txt
@@ -21499,36 +21499,33 @@ D_80AAB294_jp = 0x80AAB294; //
aTOU_actor_ct = 0x80AAB300; // type:func
aTOU_actor_dt = 0x80AAB3D0; // type:func
-func_80AAB488_jp = 0x80AAB488; // type:func
-func_80AAB60C_jp = 0x80AAB60C; // type:func
-func_80AAB81C_jp = 0x80AAB81C; // type:func
-func_80AAB840_jp = 0x80AAB840; // type:func
-func_80AAB894_jp = 0x80AAB894; // type:func
-func_80AAB8D8_jp = 0x80AAB8D8; // type:func
-func_80AAB918_jp = 0x80AAB918; // type:func
-func_80AAB9C8_jp = 0x80AAB9C8; // type:func
+aTOU_set_bgOffset = 0x80AAB488; // type:func
+aTOU_color_ctrl = 0x80AAB60C; // type:func
+aTOU_init = 0x80AAB81C; // type:func
+aTOU_wait = 0x80AAB840; // type:func
+aTOU_lighting = 0x80AAB894; // type:func
+aTOU_lightout = 0x80AAB8D8; // type:func
+aTOU_setup_action = 0x80AAB918; // type:func
+aTOU_actor_move = 0x80AAB9C8; // type:func
aTOU_actor_init = 0x80AABA50; // type:func
-func_80AABAB8_jp = 0x80AABAB8; // type:func
-func_80AABAD8_jp = 0x80AABAD8; // type:func
+aTOU_actor_draw_before = 0x80AABAB8; // type:func
+aTOU_actor_draw_after = 0x80AABAD8; // type:func
aTOU_actor_draw = 0x80AABEB0; // type:func
// .data
Toudai_Profile = 0x80AAC060; //
-D_80AAC084_jp = 0x80AAC084; //
-D_80AAC098_jp = 0x80AAC098; //
-D_80AAC0AC_jp = 0x80AAC0AC; //
-D_80AAC0B4_jp = 0x80AAC0B4; //
-D_80AAC0D0_jp = 0x80AAC0D0; //
-D_FLT_80AAC0D8_jp = 0x80AAC0D8; // type:f32
-D_FLT_80AAC0E0_jp = 0x80AAC0E0; // type:f32
-D_80AAC0E8_jp = 0x80AAC0E8; //
-D_80AAC0F0_jp = 0x80AAC0F0; //
-D_80AAC100_jp = 0x80AAC100; //
-D_80AAC108_jp = 0x80AAC108; // type:u8
-D_80AAC109_jp = 0x80AAC109; // type:u8
-D_80AAC10A_jp = 0x80AAC10A; // type:s8
-D_80AAC10B_jp = 0x80AAC10B; // type:s8
+aTOU_shadow_vtx_fix_flg_table = 0x80AAC084; //
+aTOU_shadow_data = 0x80AAC098; //
+skl_324 = 0x80AAC0AC; //
+height_table_ct_360 = 0x80AAC0B4; //
+height_table_361 = 0x80AAC0D0; //
+addX_362 = 0x80AAC0D8; // type:f32
+addZ_363 = 0x80AAC0E0; // type:f32
+ani_484 = 0x80AAC0E8; //
+process_485 = 0x80AAC0F0; //
+mdl_519 = 0x80AAC100; //
+prmcol_520 = 0x80AAC108; //
// .rodata
diff --git a/linker_scripts/jp/undefined_syms.ld b/linker_scripts/jp/undefined_syms.ld
index 8588297..7467a43 100644
--- a/linker_scripts/jp/undefined_syms.ld
+++ b/linker_scripts/jp/undefined_syms.ld
@@ -5707,6 +5707,17 @@ D_C001660 = 0x0C001660;
D_C004660 = 0x0C004660;
D_C012370 = 0x0C012370;
+// ac_toudai
+
+obj_s_toudai_shadow_v = 0x060089C8;
+obj_s_toudai_shadow_1_model = 0x06008B08;
+cKF_bs_r_obj_s_toudai = 0x0607EE1C;
+cKF_bs_r_obj_w_toudai = 0x06080A24;
+cKF_ba_r_obj_s_toudai = 0x0607EE6C;
+cKF_ba_r_obj_w_toudai = 0x06080A74;
+obj_s_toudai_light_model = 0x0607E188;
+obj_w_toudai_light_model = 0x0607FD90;
+
// Buffers
diff --git a/src/code/game.c b/src/code/game.c
index aca7062..7767fc0 100644
--- a/src/code/game.c
+++ b/src/code/game.c
@@ -11,7 +11,7 @@
#include "padmgr.h"
#include "69E2C0.h"
#include "gfxalloc.h"
-#include "6E0F50.h"
+#include "m_rcp.h"
#include "code_variables.h"
#include "overlays/gamestates/ovl_play/m_play.h"
#include "overlays/gamestates/ovl_famicom_emu/famicom_emu.h"
diff --git a/src/code/m_lights.c b/src/code/m_lights.c
index 172fba0..664d53b 100644
--- a/src/code/m_lights.c
+++ b/src/code/m_lights.c
@@ -4,7 +4,7 @@
#include "macros.h"
#include "sys_matrix.h"
#include "overlays/gamestates/ovl_play/m_play.h"
-#include "6E0F50.h"
+#include "m_rcp.h"
extern Gfx D_400AA00[]; // point_light_init_model
extern Gfx D_400AA40[]; // point_light_model
diff --git a/src/overlays/actors/ovl_Toudai/ac_toudai.c b/src/overlays/actors/ovl_Toudai/ac_toudai.c
index 93c09a6..db08c4d 100644
--- a/src/overlays/actors/ovl_Toudai/ac_toudai.c
+++ b/src/overlays/actors/ovl_Toudai/ac_toudai.c
@@ -2,13 +2,27 @@
#include "m_actor_dlftbls.h"
#include "m_object.h"
#include "overlays/gamestates/ovl_play/m_play.h"
+#include "c_keyframe.h"
+#include "m_field_info.h"
+#include "m_collision_bg.h"
+#include "m_rcp.h"
+#include "m_lib.h"
+#include "macros.h"
+#include "code_variables.h"
+
+#define THIS ((Toudai*)thisx)
void aTOU_actor_ct(Actor* thisx, Game_Play* game_play);
void aTOU_actor_dt(Actor* thisx, Game_Play* game_play);
void aTOU_actor_init(Actor* thisx, Game_Play* game_play);
void aTOU_actor_draw(Actor* thisx, Game_Play* game_play);
+void aTOU_set_bgOffset(Toudai* this, s32 heightTableIndex);
+void aTOU_init(Toudai* this, struct Game_Play* game_play);
+void aTOU_wait(Toudai* this, struct Game_Play* game_play);
+void aTOU_lighting(Toudai* this, struct Game_Play* game_play);
+void aTOU_lightout(Toudai* this, struct Game_Play* game_play);
+void aTOU_setup_action(Toudai* this, s32 processIndex);
-#if 0
ActorProfile Toudai_Profile = {
/* */ ACTOR_TOUDAI,
/* */ ACTOR_PART_0,
@@ -22,32 +36,265 @@ ActorProfile Toudai_Profile = {
/* */ aTOU_actor_draw,
/* */ NULL,
};
-#endif
-#pragma GLOBAL_ASM("asm/jp/nonmatchings/overlays/actors/ovl_Toudai/ac_toudai/aTOU_actor_ct.s")
+u8 aTOU_shadow_vtx_fix_flg_table[] = { 0x01, 0x00, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x01, 0x00,
+ 0x00, 0x00, 0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x01, 0x00 };
+
+extern Vtx obj_s_toudai_shadow_v[];
+extern Gfx obj_s_toudai_shadow_1_model[];
+ShadowData aTOU_shadow_data = { 20, aTOU_shadow_vtx_fix_flg_table, 60.0f, obj_s_toudai_shadow_v,
+ obj_s_toudai_shadow_1_model };
+
+extern BaseSkeletonR cKF_bs_r_obj_s_toudai;
+extern BaseSkeletonR cKF_bs_r_obj_w_toudai;
+BaseSkeletonR* skl_324[] = { &cKF_bs_r_obj_s_toudai, &cKF_bs_r_obj_w_toudai };
+
+void aTOU_actor_ct(Actor* thisx, Game_Play* game_play UNUSED) {
+ Toudai* this = THIS;
+ s32 type = (common_data.time.season == WINTER);
+
+ gSegments[6] = OS_K0_TO_PHYSICAL(common_data.unk_10098->unk_AC(45));
+ cKF_SkeletonInfo_R_ct(&this->skeletonInfo, skl_324[type], NULL, this->jointTable, this->morphTable);
+ aTOU_set_bgOffset(this, 1);
+ aTOU_setup_action(this, 0);
+ cKF_SkeletonInfo_R_play(&this->skeletonInfo);
+ this->actor.world.pos.x -= 20.0f;
+ this->actor.world.pos.z -= 20.0f;
+}
+
+void aTOU_actor_dt(Actor* thisx, Game_Play* game_play UNUSED) {
+ Toudai* this = THIS;
+
+ common_data.unk_10098->unk_A8(&common_data.unk_10098->unk_B0, 8, 45, thisx);
+ common_data.unk_10098->unk_A8(&common_data.unk_10098->unk_454, 9, 90, thisx);
+ common_data.unk_10098->unk_A8(&common_data.unk_10098->unk_86C, 8, 45, thisx);
+ cKF_SkeletonInfo_R_dt(&this->skeletonInfo);
+ thisx->world.pos.x += 20.0f;
+ thisx->world.pos.z += 20.0f;
+}
+
+mCoBG_OffsetTable height_table_ct_360[] = { { 0x64, 16, 16, 16, 16, 16, 0 },
+ { 0x64, 16, 16, 16, 16, 16, 0 },
+ { 0x64, 16, 16, 16, 16, 16, 0 },
+ { 0x64, 16, 16, 16, 16, 16, 0 } };
+mCoBG_OffsetTable* height_table_361[] = { height_table_ct_360, height_table_ct_360 };
+f32 addX_362[] = { -40.0f, 0.0f };
+f32 addZ_363[] = { -40.0f, 0.0f };
+
+void aTOU_set_bgOffset(Toudai* this, s32 heightTableIndex) {
+ s32 i;
+ Vec3f pos;
+ mCoBG_OffsetTable* offsetTable = height_table_361[heightTableIndex];
+
+ for (i = 0; i < 2; i++) {
+ pos.z = addZ_363[i] + this->actor.home.pos.z;
+ pos.x = addX_362[0] + this->actor.home.pos.x;
+ mCoBG_SetPluss5PointOffset_file(pos, *offsetTable, "../ac_toudai_move.c_inc", 76);
+ offsetTable++;
+ pos.x = addX_362[1] + this->actor.home.pos.x;
+ mCoBG_SetPluss5PointOffset_file(pos, *offsetTable, "../ac_toudai_move.c_inc", 80);
+ offsetTable++;
+ }
+}
+
+void aTOU_color_ctrl(Toudai* this) {
+ f32 var_fv0;
+ s32 frameTemp;
+
+ if (this->unk2BC == 0) {
+ add_calc(&this->unk2C8, 0.0f, 0.3f, 100.0f, 1.0f);
+ add_calc(&this->unk2CC, 0.0f, 0.3f, 100.0f, 1.0f);
+ add_calc(&this->unk2D0, 0.0f, 0.1f, 100.0f, 1.0f);
+ return;
+ }
+
+ frameTemp = this->unk1E8 - 51;
+ var_fv0 = (frameTemp < 0) ? 1.0f : -1.0f;
+ frameTemp = ABS(frameTemp);
-#pragma GLOBAL_ASM("asm/jp/nonmatchings/overlays/actors/ovl_Toudai/ac_toudai/aTOU_actor_dt.s")
+ if (frameTemp == 0) {
+ this->unk2C8 = 220.0f;
+ this->unk2CC = 240.0f;
-#pragma GLOBAL_ASM("asm/jp/nonmatchings/overlays/actors/ovl_Toudai/ac_toudai/func_80AAB488_jp.s")
+ } else if (frameTemp >= 40) {
+ add_calc(&this->unk2C8, 0.0f, 0.3f, 100.0f, 1.0f);
+ add_calc(&this->unk2CC, 0.0f, 0.3f, 100.0f, 1.0f);
-#pragma GLOBAL_ASM("asm/jp/nonmatchings/overlays/actors/ovl_Toudai/ac_toudai/func_80AAB60C_jp.s")
+ } else if (frameTemp < 10) {
+ this->unk2C8 = this->unk2C8 + (9.0f * var_fv0);
+ this->unk2CC = this->unk2CC + (14.0f * var_fv0);
-#pragma GLOBAL_ASM("asm/jp/nonmatchings/overlays/actors/ovl_Toudai/ac_toudai/func_80AAB81C_jp.s")
+ } else if (frameTemp < 30) {
+ this->unk2C8 = this->unk2C8 + (2.5f * var_fv0);
+ this->unk2CC = this->unk2CC + (4.5f * var_fv0);
-#pragma GLOBAL_ASM("asm/jp/nonmatchings/overlays/actors/ovl_Toudai/ac_toudai/func_80AAB840_jp.s")
+ } else {
+ this->unk2C8 = this->unk2C8 + (8.0f * var_fv0);
+ this->unk2CC = this->unk2CC + var_fv0;
+ }
-#pragma GLOBAL_ASM("asm/jp/nonmatchings/overlays/actors/ovl_Toudai/ac_toudai/func_80AAB894_jp.s")
+ add_calc(&this->unk2D0, 255.0f, 0.1f, 100.0f, 1.0f);
+}
-#pragma GLOBAL_ASM("asm/jp/nonmatchings/overlays/actors/ovl_Toudai/ac_toudai/func_80AAB8D8_jp.s")
+void aTOU_init(Toudai* this, Game_Play* game_play UNUSED) {
+ aTOU_setup_action(this, 1);
+}
-#pragma GLOBAL_ASM("asm/jp/nonmatchings/overlays/actors/ovl_Toudai/ac_toudai/func_80AAB918_jp.s")
+void aTOU_wait(Toudai* this, Game_Play* game_play UNUSED) {
+ if ((common_data.time.now_sec >= 0xFD20) || (common_data.time.now_sec < 0x4650)) {
+ this->unk2BC = 1;
+ this->skeletonInfo.frameControl.speed = 1.0f;
+ aTOU_setup_action(this, 2);
+ }
+}
-#pragma GLOBAL_ASM("asm/jp/nonmatchings/overlays/actors/ovl_Toudai/ac_toudai/func_80AAB9C8_jp.s")
+void aTOU_lighting(Toudai* this, Game_Play* game_play UNUSED) {
+ if ((common_data.time.now_sec < 64800) && (common_data.time.now_sec >= 18000)) {
+ aTOU_setup_action(this, 3);
+ }
+}
-#pragma GLOBAL_ASM("asm/jp/nonmatchings/overlays/actors/ovl_Toudai/ac_toudai/aTOU_actor_init.s")
+void aTOU_lightout(Toudai* this, Game_Play* game_play UNUSED) {
+ if (this->unk1E8 == 0x33) {
+ this->unk2BC = 0;
+ this->skeletonInfo.frameControl.speed = 0.0f;
+ aTOU_setup_action(this, 1);
+ }
+}
-#pragma GLOBAL_ASM("asm/jp/nonmatchings/overlays/actors/ovl_Toudai/ac_toudai/func_80AABAB8_jp.s")
+extern BaseAnimationR cKF_ba_r_obj_s_toudai;
+extern BaseAnimationR cKF_ba_r_obj_w_toudai;
+BaseAnimationR* ani_484[] = { &cKF_ba_r_obj_s_toudai, &cKF_ba_r_obj_w_toudai };
+ToudaiActionFunc process_485[] = { aTOU_init, aTOU_wait, aTOU_lighting, aTOU_lightout };
-#pragma GLOBAL_ASM("asm/jp/nonmatchings/overlays/actors/ovl_Toudai/ac_toudai/func_80AABAD8_jp.s")
+void aTOU_setup_action(Toudai* this, s32 processIndex) {
+ s32 type;
+ if (processIndex == 0) {
+ type = (common_data.time.season == WINTER);
+ cKF_SkeletonInfo_R_init(&this->skeletonInfo, this->skeletonInfo.skeleton, ani_484[type], 1.0f, 100.0f, 51.0f,
+ 0.0f, 0.0f, ANIMATION_REPEAT, NULL);
+ }
+
+ this->unk2A0 = process_485[processIndex];
+ this->unk2B4 = processIndex;
+}
+
+void aTOU_actor_move(Actor* thisx, Game_Play* game_play) {
+ Toudai* this = THIS;
+
+ gSegments[6] = OS_K0_TO_PHYSICAL(common_data.unk_10098->unk_AC(45));
+ this->unk174 = cKF_SkeletonInfo_R_play(&this->skeletonInfo);
+ this->unk1E8 = this->skeletonInfo.frameControl.currentFrame;
+ this->unk2A0(this, game_play);
+ aTOU_color_ctrl(this);
+}
+
+void aTOU_actor_init(Actor* thisx, Game_Play* game_play) {
+ Toudai* this = THIS;
+
+ mFI_SetFG_common(61706, this->actor.home.pos, 0);
+ aTOU_actor_move(thisx, game_play);
+ this->actor.update = aTOU_actor_move;
+}
+
+s32 aTOU_actor_draw_before(Game_Play* game_play UNUSED, SkeletonInfoR* skeletonInfo UNUSED, s32 jointIndex,
+ Gfx** dlist) {
+ // LIGHTHOUSE_JOINT_LIGHT
+ if (jointIndex == 4) {
+ *dlist = NULL;
+ }
+ return 1;
+}
+
+extern Gfx obj_s_toudai_light_model[];
+extern Gfx obj_w_toudai_light_model[];
+Gfx* mdl_519[] = { obj_s_toudai_light_model, obj_w_toudai_light_model };
+Color_RGBA8 prmcol_520 = { 255, 255, 150, 120 };
+
+#ifdef NON_EQUIVALENT
+s32 aTOU_actor_draw_after(Game_Play* game_play, SkeletonInfoR* skeletonInfo, s32 jointIndex, Gfx** dlist,
+ u8* displayBufferFlag, Toudai* arg5, Vec3s* rotation, Vec3f* translation) {
+ s32 type; // sp24
+ s32 object; // sp20
+ s32 palette; // sp1C
+ GraphicsContext* temp_a3;
+ u8 var_a0;
+ Mtx* mtx; // sp18
+ u32 temp_v1;
+ u32 temp;
+ Gfx* gfx;
+
+ // LIGHTHOUSE_JOINT_LIGHT
+ if ((jointIndex == 4) && (arg5->unk2CC)) {
+ OPEN_DISPS(temp_a3);
+ mtx = _Matrix_to_Mtx_new(temp_a3);
+ if (mtx != NULL) {
+ type = (common_data.time.season == 3);
+ object = common_data.unk_10098->unk_AC(45);
+ palette = common_data.unk_10098->unk_450(90);
+ func_800BD5C0_jp(game_play->state.gfxCtx);
+ gfx = LIGHT_DISP;
+ gSPSegment(gfx++, 0x08, palette);
+ gSPSegment(gfx++, 0x06, object);
+
+ temp = arg5->unk2C8;
+ var_a0 = arg5->unk2CC;
+ temp_v1 = arg5->unk2D0;
+ if (arg5->unk2D0 < arg5->unk2CC) {
+ arg5->unk2CC = temp_v1;
+ }
+ gDPPipeSync(gfx++);
+ gDPSetPrimColor(gfx++, 0, arg5->unk2D0, prmcol_520.r, prmcol_520.g, temp, var_a0);
+ gSPMatrix(gfx++, mtx, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gSPDisplayList(gfx++, mdl_519[type]);
+ if (!temp_a3) {}
+ }
+ CLOSE_DISPS(temp_a3);
+ }
+ return 1;
+}
+#else
+#pragma GLOBAL_ASM("asm/jp/nonmatchings/overlays/actors/ovl_Toudai/ac_toudai/aTOU_actor_draw_after.s")
+#endif
+
+#ifdef NON_EQUIVALENT
+void aTOU_actor_draw(Actor* thisx, Game_Play* game_play) {
+ Toudai* this = THIS;
+ GraphicsContext* gfxCtx = game_play->state.gfxCtx;
+ UNK_PTR sp68; // object
+ u16* sp64; // palette
+ GraphicsContext* temp_a2;
+ Mtx* mtx; // temp_v1
+ Gfx* gfx;
+ CommonData_unk_10098* ptr;
+ u8 t = this->skeletonInfo.skeleton->unk01;
+ OPEN_DISPS(gfxCtx);
+ ptr = common_data.unk_10098;
+ mtx = GRAPH_ALLOC(gfxCtx, t * sizeof(Mtx));
+ if (mtx != NULL) {
+ sp68 = ptr->unk_AC(45);
+ sp64 = ptr->unk_450(90);
+ func_800BD5E8_jp(gfx);
+ gfx = POLY_OPA_DISP;
+ gSPSegment(gfx++, 0x08, sp64);
+ gSegments[6] = OS_K0_TO_PHYSICAL(sp68);
+ gSPSegment(gfx++, 0x06, sp68);
+ POLY_OPA_DISP = gfx;
+ func_800BD598_jp(gfx);
+
+ gfx = POLY_XLU_DISP;
+ gSPSegment(gfx++, 0x08, sp64);
+ gSPSegment(gfx++, 0x06, sp68);
+ POLY_XLU_DISP = gfx;
+ Setpos_HiliteReflect_init(&this->actor.world.pos, game_play);
+ Setpos_HiliteReflect_xlu_init(&this->actor.world.pos, game_play);
+ cKF_Si3_draw_R_SV(game_play, &this->skeletonInfo, mtx, aTOU_actor_draw_before, aTOU_actor_draw_after, this);
+ common_data.unk_10080->unk_4(game_play, &aTOU_shadow_data, 45);
+ }
+ CLOSE_DISPS(gfxCtx);
+ if (gfxCtx) {}
+}
+#else
#pragma GLOBAL_ASM("asm/jp/nonmatchings/overlays/actors/ovl_Toudai/ac_toudai/aTOU_actor_draw.s")
+#endif
diff --git a/src/overlays/actors/ovl_Toudai/ac_toudai.h b/src/overlays/actors/ovl_Toudai/ac_toudai.h
index 7efe709..b77b364 100644
--- a/src/overlays/actors/ovl_Toudai/ac_toudai.h
+++ b/src/overlays/actors/ovl_Toudai/ac_toudai.h
@@ -4,15 +4,31 @@
#include "ultra64.h"
#include "m_actor.h"
#include "unk.h"
+#include "z64math.h"
+#include "c_keyframe.h"
-struct Game_Play;
struct Toudai;
+struct Game_Play;
typedef void (*ToudaiActionFunc)(struct Toudai*, struct Game_Play*);
typedef struct Toudai {
/* 0x000 */ Actor actor;
- /* 0x174 */ UNK_TYPE1 unk_174[0x164];
+ /* 0x174 */ s32 unk174;
+ /* 0x178 */ SkeletonInfoR skeletonInfo;
+ /* 0x1E8 */ s32 unk1E8;
+ /* 0x1EC */ Vec3s jointTable[15];
+ /* 0x246 */ Vec3s morphTable[15];
+ /* 0x2A0 */ ToudaiActionFunc unk2A0;
+ /* 0x2A4 */ UNK_TYPE1 unk2A4[0x10];
+ /* 0x2B4 */ UNK_TYPE unk2B4;
+ /* 0x2B8 */ UNK_TYPE1 unk2B8[0x4];
+ /* 0x2BC */ UNK_TYPE unk2BC;
+ /* 0x2C0 */ UNK_TYPE1 unk2C0[0x8];
+ /* 0x2C8 */ f32 unk2C8;
+ /* 0x2CC */ f32 unk2CC;
+ /* 0x2D0 */ f32 unk2D0;
+ /* 0x2D4 */ UNK_TYPE1 unk2D4[0x4];
} Toudai; // size = 0x2D8
#endif
diff --git a/src/overlays/gamestates/ovl_play/m_play.c b/src/overlays/gamestates/ovl_play/m_play.c
index 0c824c0..0f9c254 100644
--- a/src/overlays/gamestates/ovl_play/m_play.c
+++ b/src/overlays/gamestates/ovl_play/m_play.c
@@ -23,7 +23,7 @@
#include "libc64/qrand.h"
#include "m_controller.h"
#include "m_debug_display.h"
-#include "6E0F50.h"
+#include "m_rcp.h"
#include "6D2720.h"
#include "m_lights.h"
#include "m_private.h"
diff --git a/src/overlays/submenu/submenu_ovl/m_submenu_ovl.c b/src/overlays/submenu/submenu_ovl/m_submenu_ovl.c
index 15f8f60..cbaffdf 100644
--- a/src/overlays/submenu/submenu_ovl/m_submenu_ovl.c
+++ b/src/overlays/submenu/submenu_ovl/m_submenu_ovl.c
@@ -7,7 +7,7 @@
#include "PreRender.h"
#include "sys_matrix.h"
#include "z_std_dma.h"
-#include "6E0F50.h"
+#include "m_rcp.h"
#include "macros.h"
#include "segment_symbols.h"
diff --git a/yamls/jp/code.yaml b/yamls/jp/code.yaml
index e62b31d..f2dc816 100644
--- a/yamls/jp/code.yaml
+++ b/yamls/jp/code.yaml
@@ -65,7 +65,7 @@
- [0x6DA460, asm, code/6DA460]
- [0x6DB420, asm, code/6DB420]
- [0x6DE300, asm, code/6DE300]
- - [0x6E0F50, asm, code/6E0F50]
+ - [0x6E0F50, asm, code/m_rcp]
- [0x6E2300, asm, code/6E2300]
- [0x6E30B0, asm, code/6E30B0]
- [0x6E6C90, c, code/m_start_data_init]
diff --git a/yamls/jp/overlays.yaml b/yamls/jp/overlays.yaml
index f4a2f65..05d9bc9 100644
--- a/yamls/jp/overlays.yaml
+++ b/yamls/jp/overlays.yaml
@@ -16991,7 +16991,7 @@
bss_size: 0x0
subsegments:
- [0x96B470, c, overlays/actors/ovl_Toudai/ac_toudai]
- - [0x96C1D0, data, overlays/actors/ovl_Toudai/ac_toudai]
+ - [0x96C1D0, .data, overlays/actors/ovl_Toudai/ac_toudai]
- [0x96C280, .rodata, overlays/actors/ovl_Toudai/ac_toudai]
- name: ovl_Toudai_reloc
type: code