From c40c29dd8f647a65be3f53645992eab8d93b83aa Mon Sep 17 00:00:00 2001 From: ProjectRevoTPP Date: Wed, 1 Apr 2020 13:14:15 -0400 Subject: [PATCH 1/2] fix remaining nonmatchings in z_bg_spot15_saku --- .../ovl_Bg_Spot15_Saku/z_bg_spot15_saku.c | 18 +++--------------- .../ovl_Bg_Spot15_Saku/z_bg_spot15_saku.h | 3 +-- 2 files changed, 4 insertions(+), 17 deletions(-) diff --git a/src/overlays/actors/ovl_Bg_Spot15_Saku/z_bg_spot15_saku.c b/src/overlays/actors/ovl_Bg_Spot15_Saku/z_bg_spot15_saku.c index 52a6f59441..8722b7db67 100644 --- a/src/overlays/actors/ovl_Bg_Spot15_Saku/z_bg_spot15_saku.c +++ b/src/overlays/actors/ovl_Bg_Spot15_Saku/z_bg_spot15_saku.c @@ -58,20 +58,13 @@ void BgSpot15Saku_Destroy(BgSpot15Saku* this, GlobalContext* globalCtx) { DynaPolyInfo_Free(globalCtx, &globalCtx->colCtx.dyna, this->dyna.dynaPolyId); } -#ifdef NON_MATCHING // regalloc differences void func_808B4930(BgSpot15Saku* this, GlobalContext* globalCtx) { - void* temp = this->unk_168; - void* temp2 = this->unk_16C; - - if ((temp != NULL || temp2 != NULL) && !(gSaveContext.inf_table[7] & 2)) { + if (this->unk_168 && !(gSaveContext.inf_table[7] & 2)) { this->unk_17C = 2; this->actionFunc = func_808B4978; } } -#else -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Spot15_Saku/func_808B4930.s") -#endif void func_808B4978(BgSpot15Saku* this, GlobalContext* globalCtx) { Actor* thisx = &this->dyna.actor; @@ -86,18 +79,13 @@ void func_808B4978(BgSpot15Saku* this, GlobalContext* globalCtx) { } } -#ifdef NON_MATCHING // single regalloc difference void func_808B4A04(BgSpot15Saku* this, GlobalContext* globalCtx) { - if (this->unk_17C == 0) { - this->unk_168 = 0 & 0xFFFFFFFFFFFFFFFF; - this->unk_16C = 0 & 0xFFFFFFFFFFFFFFFF; + if (!this->unk_17C) { + this->unk_168 = 0; this->actionFunc = func_808B4930; } } -#else -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Spot15_Saku/func_808B4A04.s") -#endif void BgSpot15Saku_Update(BgSpot15Saku* this, GlobalContext* globalCtx) { DECR(this->unk_17C); diff --git a/src/overlays/actors/ovl_Bg_Spot15_Saku/z_bg_spot15_saku.h b/src/overlays/actors/ovl_Bg_Spot15_Saku/z_bg_spot15_saku.h index abd85de7b4..d39b38dced 100644 --- a/src/overlays/actors/ovl_Bg_Spot15_Saku/z_bg_spot15_saku.h +++ b/src/overlays/actors/ovl_Bg_Spot15_Saku/z_bg_spot15_saku.h @@ -7,8 +7,7 @@ typedef struct { /* 0x0000 */ DynaPolyActor dyna; /* 0x0164 */ ActorFunc actionFunc; - /* 0x0168 */ UNK_PTR unk_168; - /* 0x016C */ UNK_PTR unk_16C; + /* 0x0168 */ u64 unk_168; /* 0x0170 */ f32 unk_170; /* 0x0174 */ f32 unk_174; /* 0x0174 */ f32 unk_178; From 9008b300465dbdd786c2c3eb9ac2a72ea9e687f7 Mon Sep 17 00:00:00 2001 From: ProjectRevoTPP Date: Wed, 1 Apr 2020 13:30:26 -0400 Subject: [PATCH 2/2] remove unneeded comments --- src/overlays/actors/ovl_Bg_Spot15_Saku/z_bg_spot15_saku.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/overlays/actors/ovl_Bg_Spot15_Saku/z_bg_spot15_saku.c b/src/overlays/actors/ovl_Bg_Spot15_Saku/z_bg_spot15_saku.c index 8722b7db67..759863cf32 100644 --- a/src/overlays/actors/ovl_Bg_Spot15_Saku/z_bg_spot15_saku.c +++ b/src/overlays/actors/ovl_Bg_Spot15_Saku/z_bg_spot15_saku.c @@ -58,7 +58,6 @@ void BgSpot15Saku_Destroy(BgSpot15Saku* this, GlobalContext* globalCtx) { DynaPolyInfo_Free(globalCtx, &globalCtx->colCtx.dyna, this->dyna.dynaPolyId); } -// regalloc differences void func_808B4930(BgSpot15Saku* this, GlobalContext* globalCtx) { if (this->unk_168 && !(gSaveContext.inf_table[7] & 2)) { this->unk_17C = 2; @@ -79,7 +78,6 @@ void func_808B4978(BgSpot15Saku* this, GlobalContext* globalCtx) { } } -// single regalloc difference void func_808B4A04(BgSpot15Saku* this, GlobalContext* globalCtx) { if (!this->unk_17C) { this->unk_168 = 0;