From cac8575a940b6c1181c1eef3d8076ebde6b91729 Mon Sep 17 00:00:00 2001 From: LagoLunatic Date: Fri, 9 Feb 2024 05:35:00 -0500 Subject: [PATCH] Realmatch daIball_c::m_arcname --- include/d/actor/d_a_bita.h | 1 - include/d/actor/d_a_ib.h | 2 +- src/d/actor/d_a_ib.cpp | 68 ++++++++++++++++++++------------------ 3 files changed, 36 insertions(+), 35 deletions(-) diff --git a/include/d/actor/d_a_bita.h b/include/d/actor/d_a_bita.h index 6098e6d5b..00b5eb348 100644 --- a/include/d/actor/d_a_bita.h +++ b/include/d/actor/d_a_bita.h @@ -11,7 +11,6 @@ class dBgW; class bita_class : public fopAc_ac_c { public: - /* Place member variables here */ /* 0x290 */ request_of_phase_process_class mPhs; /* 0x298 */ J3DModel* mpModel; /* 0x29C */ J3DModel* mpModelEf; diff --git a/include/d/actor/d_a_ib.h b/include/d/actor/d_a_ib.h index 571b9848e..f4b03a71c 100644 --- a/include/d/actor/d_a_ib.h +++ b/include/d/actor/d_a_ib.h @@ -42,7 +42,7 @@ public: static u32 m_ib_actor[5]; - static char m_arcname[]; + static const char m_arcname[]; static dCcD_SrcCyl m_cyl_src; public: diff --git a/src/d/actor/d_a_ib.cpp b/src/d/actor/d_a_ib.cpp index 7a6ef0a08..e667a8405 100644 --- a/src/d/actor/d_a_ib.cpp +++ b/src/d/actor/d_a_ib.cpp @@ -320,39 +320,6 @@ void daIball_c::set_mtx() { mpModel->setBaseTRMtx(mDoMtx_stack_c::get()); } -// TODO: This is a hack. I have no idea why this one variable needs to go in .data instead of .sdata. -SECTION_DATA char daIball_c::m_arcname[] = "Always"; - -dCcD_SrcCyl daIball_c::m_cyl_src = { - // dCcD_SrcGObjInf - { - /* Flags */ 0, - /* SrcObjAt Type */ 0, - /* SrcObjAt Atp */ 0, - /* SrcObjAt SPrm */ 0, - /* SrcObjTg Type */ ~(AT_TYPE_LIGHT), - /* SrcObjTg SPrm */ TG_SPRM_SET | TG_SPRM_IS_OTHER, - /* SrcObjCo SPrm */ CO_SPRM_SET | CO_SPRM_IS_UNK8 | CO_SPRM_VSGRP, - /* SrcGObjAt Se */ 0, - /* SrcGObjAt HitMark */ 0, - /* SrcGObjAt Spl */ 0, - /* SrcGObjAt Mtrl */ 0, - /* SrcGObjAt SPrm */ G_AT_SPRM_STOP_NO_CON_HIT, - /* SrcGObjTg Se */ 0, - /* SrcGObjTg HitMark */ 0, - /* SrcGObjTg Spl */ 0, - /* SrcGObjTg Mtrl */ 0, - /* SrcGObjTg SPrm */ G_TG_SPRM_NO_HIT_MARK, - /* SrcGObjCo SPrm */ 0, - }, - // cM3dGCylS - { - /* Center */ 0.0f, 0.0f, 0.0f, - /* Radius */ 30.0f, - /* Height */ 80.0f, - }, -}; - /* 800F42E8-800F441C .text CreateInit__9daIball_cFv */ void daIball_c::CreateInit() { fopAcM_SetMtx(this, mpModel->getBaseTRMtx()); @@ -512,6 +479,41 @@ static BOOL daIball_Execute(daIball_c* i_this) { return i_this->_daIball_execute(); } +// This symbol needs to go in .data, but as it's only 7 bytes long, it would normally go in .sdata or .sdata2. +// But if the variable is only defined *after* it gets used in daIball_c::CreateHeap that forces it into .data. +// The size of the variable is ignored, and even whether it's const or not is ignored. +const char daIball_c::m_arcname[] = "Always"; + +dCcD_SrcCyl daIball_c::m_cyl_src = { + // dCcD_SrcGObjInf + { + /* Flags */ 0, + /* SrcObjAt Type */ 0, + /* SrcObjAt Atp */ 0, + /* SrcObjAt SPrm */ 0, + /* SrcObjTg Type */ ~(AT_TYPE_LIGHT), + /* SrcObjTg SPrm */ TG_SPRM_SET | TG_SPRM_IS_OTHER, + /* SrcObjCo SPrm */ CO_SPRM_SET | CO_SPRM_IS_UNK8 | CO_SPRM_VSGRP, + /* SrcGObjAt Se */ 0, + /* SrcGObjAt HitMark */ 0, + /* SrcGObjAt Spl */ 0, + /* SrcGObjAt Mtrl */ 0, + /* SrcGObjAt SPrm */ G_AT_SPRM_STOP_NO_CON_HIT, + /* SrcGObjTg Se */ 0, + /* SrcGObjTg HitMark */ 0, + /* SrcGObjTg Spl */ 0, + /* SrcGObjTg Mtrl */ 0, + /* SrcGObjTg SPrm */ G_TG_SPRM_NO_HIT_MARK, + /* SrcGObjCo SPrm */ 0, + }, + // cM3dGCylS + { + /* Center */ 0.0f, 0.0f, 0.0f, + /* Radius */ 30.0f, + /* Height */ 80.0f, + }, +}; + actor_method_class l_daIball_Method = { (process_method_func)daIball_Create, (process_method_func)daIball_Delete,