From 6e9afd0f7d6f8e037fd71e91dfdad4b45f8e7e2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Lam?= Date: Sun, 11 Oct 2026 04:13:20 +0200 Subject: ksys/act: rename the actor accessor to ActorLinkConstDataAccess The 0x18-sized accessor appears to be named ActorLinkConstDataAccess based on a source path string in the Wii U build. The 0x10-sized base class (which we had given the name to) only holds a BaseProc and its dtor/acquire functions live in a separate TU so let's rename it BaseProcAccessor (unofficial name). acquireActor is a header inline whose one copy landed in the BeamBase object. Nothing in BeamBase calls it, so the BeamBase function that used it was probably dead-stripped by the linker. (AI assisted using Claude Opus 5.5) --- src/KingSystem/ActorSystem/actBaseProcAccessor.cpp | 48 ++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 src/KingSystem/ActorSystem/actBaseProcAccessor.cpp (limited to 'src/KingSystem/ActorSystem/actBaseProcAccessor.cpp') diff --git a/src/KingSystem/ActorSystem/actBaseProcAccessor.cpp b/src/KingSystem/ActorSystem/actBaseProcAccessor.cpp new file mode 100644 index 00000000..4333471a --- /dev/null +++ b/src/KingSystem/ActorSystem/actBaseProcAccessor.cpp @@ -0,0 +1,48 @@ +#include "KingSystem/ActorSystem/actBaseProcAccessor.h" +#include "KingSystem/ActorSystem/actBaseProc.h" +#include "KingSystem/ActorSystem/actBaseProcMgr.h" +#include "KingSystem/Utils/Debug.h" + +namespace ksys::act { + +BaseProcAccessor::~BaseProcAccessor() { + if (mAcquired && mProc) + mProc->release(); + + mAcquired = false; + mProc = nullptr; +} + +bool BaseProcAccessor::acquire(BaseProc* proc) { + if (mProc) { + if (mAcquired) + mProc->release(); + + mAcquired = false; + mProc = nullptr; + } + + return proc && proc->acquire(*this); +} + +bool acquireProc(BaseProcAccessor* accessor, BaseProc* proc, const sead::SafeString& from, s32) { + bool acquired = false; + + if (accessor) { + acquired = accessor->acquire(proc); + if (!acquired) + return false; + } + + if (acquired || BaseProcMgr::instance()->isHighPriorityThread()) + return true; + + sead::FixedSafeString<256> message; + // (%s)Acquiring from a low priority thread. Please change via ActorLinkConstDataAccess + message.format("(%s)低スレッドからの取得です。ActorLinkConstDataAccess経由に変更お願いします", + from.cstr()); + util::PrintDebug(message); + return false; +} + +} // namespace ksys::act -- cgit v1.2.3