From a241f57e603bfb63e3cdae8826c740341da24f30 Mon Sep 17 00:00:00 2001 From: fullgrowngaming <42490167+fullgrowngaming@users.noreply.github.com> Date: Sat, 19 Sep 2020 19:55:06 -0700 Subject: [PATCH] obj_hana OK (#20) --- include/variables_overlay.h | 2 +- linker_scripts/code_script.txt | 5 +-- linker_scripts/object_script.txt | 4 ++- src/overlays/actors/ovl_Obj_Hana/z_obj_hana.c | 32 +++++++++++++++---- tables/variables.txt | 2 +- 5 files changed, 34 insertions(+), 11 deletions(-) diff --git a/include/variables_overlay.h b/include/variables_overlay.h index 5802518816..14c0bd3522 100644 --- a/include/variables_overlay.h +++ b/include/variables_overlay.h @@ -4688,7 +4688,7 @@ extern UNK_TYPE4 D_8095F82C; // D_8095F82C extern OverlayRelocationSection enIshiOverlayInfo; // D_8095F830 extern u32 enIshiOverlayRelocations[178]; // D_8095F844 extern u32 enIshiOverlayInfoOffset; // D_8095FB0C -extern UNK_TYPE1 D_8095FB90; // D_8095FB90 +extern UNK_TYPE1 Obj_Hana_InitVars; // Obj_Hana_InitVars extern UNK_TYPE1 D_8095FBB0; // D_8095FBB0 extern OverlayRelocationSection objHanaOverlayInfo; // D_8095FBC0 extern u32 objHanaOverlayRelocations[6]; // D_8095FBD4 diff --git a/linker_scripts/code_script.txt b/linker_scripts/code_script.txt index 53b25aa830..3bfff95822 100644 --- a/linker_scripts/code_script.txt +++ b/linker_scripts/code_script.txt @@ -2060,8 +2060,9 @@ SECTIONS ovl_Obj_Hana : AT(RomLocation) { build/src/overlays/actors/ovl_Obj_Hana/z_obj_hana.o(.text) - build/asm/ovl_Obj_Hana_data.o(.data) - build/asm/ovl_Obj_Hana_rodata.o(.rodata) + build/src/overlays/actors/ovl_Obj_Hana/z_obj_hana.o(.data) + build/src/overlays/actors/ovl_Obj_Hana/z_obj_hana.o(.rodata) + build/src/overlays/actors/ovl_Obj_Hana/z_obj_hana_overlay.o(.ovl) } SegmentEnd = .; SegmentSize = SegmentEnd - SegmentStart; diff --git a/linker_scripts/object_script.txt b/linker_scripts/object_script.txt index a2e546ceae..904945b923 100644 --- a/linker_scripts/object_script.txt +++ b/linker_scripts/object_script.txt @@ -11,4 +11,6 @@ D_0E000048 = 0x0E000048; D_0E000088 = 0x0E000088; D_0E000140 = 0x0E000140; D_0E0001C8 = 0x0E0001C8; -D_0E0002C8 = 0x0E0002C8; \ No newline at end of file +D_0E0002C8 = 0x0E0002C8; + +D_06000500 = 0x06000500; \ No newline at end of file diff --git a/src/overlays/actors/ovl_Obj_Hana/z_obj_hana.c b/src/overlays/actors/ovl_Obj_Hana/z_obj_hana.c index 4a8833f856..128679b253 100644 --- a/src/overlays/actors/ovl_Obj_Hana/z_obj_hana.c +++ b/src/overlays/actors/ovl_Obj_Hana/z_obj_hana.c @@ -1,3 +1,8 @@ +/* + * File: z_obj_hana.c + * Description: Orange Graveyard Flower + */ + #include "z_obj_hana.h" #define FLAGS 0x00000000 @@ -9,7 +14,6 @@ void ObjHana_Destroy(Actor* thisx, GlobalContext* globalCtx); void ObjHana_Update(Actor* thisx, GlobalContext* globalCtx); void ObjHana_Draw(Actor* thisx, GlobalContext* globalCtx); -/* const ActorInit Obj_Hana_InitVars = { ACTOR_OBJ_HANA, ACTORTYPE_PROP, @@ -21,12 +25,28 @@ const ActorInit Obj_Hana_InitVars = { (ActorFunc)ObjHana_Update, (ActorFunc)ObjHana_Draw }; -*/ -GLOBAL_ASM("asm/non_matchings/ovl_Obj_Hana_0x8095FB10/ObjHana_Init.asm") +extern UNK_TYPE D_06000500; -GLOBAL_ASM("asm/non_matchings/ovl_Obj_Hana_0x8095FB10/ObjHana_Destroy.asm") +static InitChainEntry sInitChain[] = { + ICHAIN_VEC3F_DIV1000(scale, 10, ICHAIN_CONTINUE), + ICHAIN_F32(unkFC, 900, ICHAIN_CONTINUE), + ICHAIN_F32(unk100, 40, ICHAIN_CONTINUE), + ICHAIN_F32(unk104, 40, ICHAIN_STOP), +}; -GLOBAL_ASM("asm/non_matchings/ovl_Obj_Hana_0x8095FB10/ObjHana_Update.asm") +void ObjHana_Init(Actor* thisx, GlobalContext* globalCtx) { + ObjHana* this = THIS; + + Actor_ProcessInitChain(&this->actor, sInitChain); +} -GLOBAL_ASM("asm/non_matchings/ovl_Obj_Hana_0x8095FB10/ObjHana_Draw.asm") +void ObjHana_Destroy(Actor* thisx, GlobalContext* globalCtx) { +} + +void ObjHana_Update(Actor* thisx, GlobalContext* globalCtx) { +} + +void ObjHana_Draw(Actor* thisx, GlobalContext* globalCtx) { + func_800BDFC0(globalCtx, &D_06000500); +} diff --git a/tables/variables.txt b/tables/variables.txt index 3f7d9e4196..8296004690 100644 --- a/tables/variables.txt +++ b/tables/variables.txt @@ -9399,7 +9399,7 @@ 0x8095F830:("enIshiOverlayInfo","OverlayRelocationSection","",0x14), 0x8095F844:("enIshiOverlayRelocations","u32","[178]",0x2c8), 0x8095FB0C:("enIshiOverlayInfoOffset","u32","",0x4), - 0x8095FB90:("D_8095FB90","UNK_TYPE1","",0x1), + 0x8095FB90:("Obj_Hana_InitVars","UNK_TYPE1","",0x1), 0x8095FBB0:("D_8095FBB0","UNK_TYPE1","",0x1), 0x8095FBC0:("objHanaOverlayInfo","OverlayRelocationSection","",0x14), 0x8095FBD4:("objHanaOverlayRelocations","u32","[6]",0x18),