From 751c5e10490f1cc35628dd5ac05a41d23ca4b82c Mon Sep 17 00:00:00 2001 From: kyleburnette Date: Tue, 4 May 2021 16:51:42 -0700 Subject: [PATCH] obj_funen OK (#91) * initial funen work * obj_funen OK * ran format script --- linker_scripts/code_script.txt | 4 +-- linker_scripts/object_script.txt | 3 ++ .../actors/ovl_Obj_Funen/z_obj_funen.c | 31 ++++++++++++++++--- 3 files changed, 32 insertions(+), 6 deletions(-) diff --git a/linker_scripts/code_script.txt b/linker_scripts/code_script.txt index 7a1f315a01..a60505a48a 100644 --- a/linker_scripts/code_script.txt +++ b/linker_scripts/code_script.txt @@ -4132,9 +4132,9 @@ SECTIONS ovl_Obj_Funen : AT(RomLocation) { build/src/overlays/actors/ovl_Obj_Funen/z_obj_funen.o(.text) - build/asm/overlays/ovl_Obj_Funen_data.o(.data) + build/src/overlays/actors/ovl_Obj_Funen/z_obj_funen.o(.data) build/src/overlays/actors/ovl_Obj_Funen/z_obj_funen.o(.rodata) - build/asm/overlays/ovl_Obj_Funen_rodata.o(.rodata) + build/src/overlays/actors/ovl_Obj_Funen/z_obj_funen_overlay.o(.ovl) } SegmentEnd = .; SegmentSize = SegmentEnd - SegmentStart; diff --git a/linker_scripts/object_script.txt b/linker_scripts/object_script.txt index 458cafefd4..2904f24540 100644 --- a/linker_scripts/object_script.txt +++ b/linker_scripts/object_script.txt @@ -157,6 +157,9 @@ D_06000908 = 0x06000908; D_06000F28 = 0x06000F28; D_06000CE8 = 0x06000CE8; +/* obj_funen */ +D_060000D0 = 0x060000D0; + /* item_b_heart */ D_06001290 = 0x06001290; D_06001470 = 0x06001470; diff --git a/src/overlays/actors/ovl_Obj_Funen/z_obj_funen.c b/src/overlays/actors/ovl_Obj_Funen/z_obj_funen.c index 78562a26f2..db14becc64 100644 --- a/src/overlays/actors/ovl_Obj_Funen/z_obj_funen.c +++ b/src/overlays/actors/ovl_Obj_Funen/z_obj_funen.c @@ -7,7 +7,6 @@ void ObjFunen_Init(Actor* thisx, GlobalContext* globalCtx); void ObjFunen_Draw(Actor* thisx, GlobalContext* globalCtx); -/* const ActorInit Obj_Funen_InitVars = { ACTOR_OBJ_FUNEN, ACTORCAT_PROP, @@ -19,8 +18,32 @@ const ActorInit Obj_Funen_InitVars = { (ActorFunc)func_800BDFB0, (ActorFunc)ObjFunen_Draw }; -*/ -#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_Obj_Funen_0x80A19740/ObjFunen_Init.asm") +extern Gfx D_060000D0[]; -#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_Obj_Funen_0x80A19740/ObjFunen_Draw.asm") +f32 D_80A198D0[] = { 0.1f, 0.024390244f }; + +void ObjFunen_Init(Actor* thisx, GlobalContext* globalCtx) { + ObjFunen* this = THIS; + + Actor_SetScale(&this->actor, D_80A198D0[this->actor.params & 1]); +} + +void ObjFunen_Draw(Actor* thisx, GlobalContext* globalCtx) { + s32 temp; + s32 pad[2]; + + OPEN_DISPS(globalCtx->state.gfxCtx); + + func_8012C2DC(globalCtx->state.gfxCtx); + Matrix_RotateY((s16)(func_800DFCDC(ACTIVE_CAM) - 0x8000), 1); + + gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_MODELVIEW | G_MTX_LOAD | G_MTX_NOPUSH); + + temp = -(globalCtx->unk18840 & 0x7FFFFFFF) & 0x7F; + + gSPSegment(POLY_XLU_DISP++, 0x08, + Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0, temp, 0x20, 0x20, 1, 0, temp, 0x20, 0x20)); + gSPDisplayList(POLY_XLU_DISP++, D_060000D0); + CLOSE_DISPS(globalCtx->state.gfxCtx); +}