SystemPauseMgr and NXArgs are game code

Both link in the game archive, and NXArgs uses game classes such as
GameScene. The engine only calls SystemPauseMgr's virtuals, so it now
goes through ksys::ISystemPauseMgr and no longer includes Game/.

(AI assisted using Claude Fable 5.1 and Claude Opus 5.5)
This commit is contained in:
Léo Lam
2026-09-28 03:39:31 +02:00
parent c4c7c00e85
commit 44c75aa78a
11 changed files with 90 additions and 72 deletions
+21 -21
View File
@@ -54423,12 +54423,12 @@ Address,Quality,Size,Name
0x0000007100901a90,U,000068,
0x0000007100901ad4,U,000100,
0x0000007100901b38,U,000108,
0x0000007100901ba4,O,000164,_ZN4ksys6nxargs14createInstanceEPN4sead4HeapE
0x0000007100901c48,U,000152,nxargs::dtor
0x0000007100901ce0,U,000148,nxargs::dtorDelete
0x0000007100901d74,O,000804,_ZN4ksys6nxargs4initEPN4sead4HeapE
0x0000007100902098,O,000632,_ZN4ksys6nxargs12allocEntriesEPN4sead4HeapEPKh
0x0000007100902310,U,000320,_ZN4ksys6nxargs10handleArgsEv
0x0000007100901ba4,O,000164,_ZN5uking6nxargs14createInstanceEPN4sead4HeapE
0x0000007100901c48,U,000152,uking::nxargs::dtor
0x0000007100901ce0,U,000148,uking::nxargs::dtorDelete
0x0000007100901d74,O,000804,_ZN5uking6nxargs4initEPN4sead4HeapE
0x0000007100902098,O,000632,_ZN5uking6nxargs12allocEntriesEPN4sead4HeapEPKh
0x0000007100902310,U,000320,_ZN5uking6nxargs10handleArgsEv
0x0000007100902450,U,002848,
0x0000007100902f70,U,000004,j__ZdlPv_410
0x0000007100902f74,U,000240,_ZN4sead15FixedSafeStringILi37EEaSERKNS_14SafeStringBaseIcEE
@@ -54583,22 +54583,22 @@ Address,Quality,Size,Name
0x000000710090add8,U,000008,
0x000000710090ade0,U,000040,
0x000000710090ae08,U,000384,
0x000000710090af88,O,000028,_ZN4ksys14SystemPauseMgrC1Ev
0x000000710090afa4,O,000004,_ZN4ksys14SystemPauseMgrD1Ev
0x000000710090afa8,O,000004,_ZN4ksys14SystemPauseMgrD0Ev
0x000000710090af88,O,000028,_ZN5uking14SystemPauseMgrC1Ev
0x000000710090afa4,O,000004,_ZN5uking14SystemPauseMgrD1Ev
0x000000710090afa8,O,000004,_ZN5uking14SystemPauseMgrD0Ev
0x000000710090afac,U,000004,j_nullsub_3106
0x000000710090afb0,U,000152,
0x000000710090b048,U,000224,
0x000000710090b128,U,000124,
0x000000710090b1a4,U,000096,
0x000000710090b204,U,000252,
0x000000710090b300,U,000072,
0x000000710090b348,U,000096,
0x000000710090b3a8,U,000280,
0x000000710090b4c0,U,000240,
0x000000710090b5b0,U,000236,RootTaskStuff::openFadeScreen
0x000000710090b69c,U,000312,
0x000000710090b7d4,U,000072,
0x000000710090afb0,U,000152,uking::SystemPauseMgr::waitForOnUiActorMgrAndBlockSaveMaybe
0x000000710090b048,U,000224,uking::SystemPauseMgr::stopNfpAndWaitForSaveMgr
0x000000710090b128,U,000124,uking::SystemPauseMgr::waitForOnUiActorMgr
0x000000710090b1a4,U,000096,uking::SystemPauseMgr::pauseGameSceneAndWait
0x000000710090b204,U,000252,uking::SystemPauseMgr::releaseScreensAndShowMainLayer
0x000000710090b300,U,000072,uking::SystemPauseMgr::onSystemPauseResume
0x000000710090b348,U,000096,uking::SystemPauseMgr::waitForStageGenFinalStep
0x000000710090b3a8,U,000280,uking::SystemPauseMgr::restoreMainLayerAndResumeGameScene
0x000000710090b4c0,U,000240,uking::SystemPauseMgr::hideMainLayer
0x000000710090b5b0,U,000236,uking::SystemPauseMgr::openFadeScreen
0x000000710090b69c,U,000312,uking::SystemPauseMgr::showMainLayerAndResumeProcJobs
0x000000710090b7d4,U,000072,uking::SystemPauseMgr::clearHideMainLayerAndResumeEvents
0x000000710090b81c,U,001044,
0x000000710090bc30,U,000268,setPauseState1
0x000000710090bd3c,U,000300,setPauseState0
Can't render this file because it is too large.
+4
View File
@@ -12,4 +12,8 @@ target_sources(uking PRIVATE
gamePlayReport.h
E3Mgr.cpp
E3Mgr.h
NXArgs.cpp
NXArgs.h
SystemPauseMgr.cpp
SystemPauseMgr.h
)
@@ -1,6 +1,6 @@
#include "KingSystem/System/NXArgs.h"
#include "Game/NXArgs.h"
namespace ksys {
namespace uking {
SEAD_SINGLETON_DISPOSER_IMPL(nxargs)
@@ -75,4 +75,4 @@ void nxargs::allocEntries(sead::Heap* heap, const u8* data) {
}
}
} // namespace ksys
} // namespace uking
@@ -9,7 +9,7 @@
#include <prim/seadSafeString.h>
#include "KingSystem/Utils/Types.h"
namespace ksys {
namespace uking {
class nxargs {
SEAD_SINGLETON_DISPOSER(nxargs)
@@ -96,4 +96,4 @@ private:
};
KSYS_CHECK_SIZE_NX150(nxargs, 0x48);
} // namespace ksys
} // namespace uking
@@ -1,9 +1,9 @@
#include "KingSystem/System/SystemPauseMgr.h"
#include "Game/SystemPauseMgr.h"
namespace ksys {
namespace uking {
SystemPauseMgr::SystemPauseMgr() = default;
SystemPauseMgr::~SystemPauseMgr() = default;
} // namespace ksys
} // namespace uking
+34
View File
@@ -0,0 +1,34 @@
#pragma once
#include "KingSystem/System/OverlayArenaSystem.h"
#include "KingSystem/Utils/Types.h"
namespace uking {
class SystemPauseMgr : public ksys::ISystemPauseMgr {
public:
SystemPauseMgr();
~SystemPauseMgr() override;
void m2() override;
void waitForOnUiActorMgrAndBlockSaveMaybe() override;
void stopNfpAndWaitForSaveMgr() override;
void waitForOnUiActorMgr() override;
void pauseGameSceneAndWait() override;
bool releaseScreensAndShowMainLayer() override;
void onSystemPauseResume() override;
void waitForStageGenFinalStep() override;
void restoreMainLayerAndResumeGameScene() override;
bool hideMainLayer() override;
void openFadeScreen() override;
void showMainLayerAndResumeProcJobs() override;
void clearHideMainLayerAndResumeEvents() override;
bool wasMainLayerVisible() const { return mMainLayerWasVisible; }
private:
bool mMainLayerWasVisible = true;
};
KSYS_CHECK_SIZE_NX150(SystemPauseMgr, 0x10);
} // namespace uking
-4
View File
@@ -27,8 +27,6 @@ target_sources(uking PRIVATE
MemoryProfiler.h
MessageCapture.cpp
MessageCapture.h
NXArgs.cpp
NXArgs.h
OcclusionQueryCylinder.cpp
OcclusionQueryCylinder.h
OverlayArena.cpp
@@ -50,8 +48,6 @@ target_sources(uking PRIVATE
StarterPackMgr.cpp
StarterPackMgr.h
StringBoard.h
SystemPauseMgr.cpp
SystemPauseMgr.h
SystemTimers.cpp
SystemTimers.h
Terminal.cpp
@@ -6,7 +6,6 @@
#include "KingSystem/Resource/resSystem.h"
#include "KingSystem/Sound/sndResource.h"
#include "KingSystem/System/OverlayArena.h"
#include "KingSystem/System/SystemPauseMgr.h"
#include "KingSystem/Terrain/teraSystem.h"
#include "KingSystem/Utils/Thread/Task.h"
#include "KingSystem/Utils/Thread/TaskThread.h"
+21 -3
View File
@@ -23,7 +23,25 @@ class TaskThread;
} // namespace util
class OverlayArena;
class SystemPauseMgr;
class ISystemPauseMgr {
public:
virtual ~ISystemPauseMgr() = default;
virtual void m2() = 0;
virtual void waitForOnUiActorMgrAndBlockSaveMaybe() = 0;
virtual void stopNfpAndWaitForSaveMgr() = 0;
virtual void waitForOnUiActorMgr() = 0;
virtual void pauseGameSceneAndWait() = 0;
virtual bool releaseScreensAndShowMainLayer() = 0;
virtual void onSystemPauseResume() = 0;
virtual void waitForStageGenFinalStep() = 0;
virtual void restoreMainLayerAndResumeGameScene() = 0;
virtual bool hideMainLayer() = 0;
virtual void openFadeScreen() = 0;
virtual void showMainLayerAndResumeProcJobs() = 0;
virtual void clearHideMainLayerAndResumeEvents() = 0;
};
// FIXME: incomplete
class OverlayArenaSystem {
@@ -34,7 +52,7 @@ class OverlayArenaSystem {
public:
struct InitArg {
SystemPauseMgr* system_pause_mgr;
ISystemPauseMgr* system_pause_mgr;
};
bool init(const InitArg& arg, sead::Heap* heap);
@@ -95,7 +113,7 @@ private:
OverlayArena* mAudioArena = nullptr;
OverlayArena* mUnknownArena = nullptr;
sead::Heap* mJpegHeap = nullptr;
SystemPauseMgr* mSystemPauseMgr = nullptr;
ISystemPauseMgr* mSystemPauseMgr = nullptr;
OverlayArenaSystemS1 mS1;
u32 _b8 = 0;
util::TaskThread* mPrepareThread = nullptr;
+2 -2
View File
@@ -6,15 +6,15 @@
namespace ksys {
class ISystemPauseMgr;
class OverlayArenaSystemS1;
class SystemPauseMgr;
// FIXME: incomplete
class OverlayArenaSystemS2 {
public:
struct InitArg {
OverlayArenaSystemS1* s1;
SystemPauseMgr* system_pause_mgr;
ISystemPauseMgr* system_pause_mgr;
};
OverlayArenaSystemS2();
-33
View File
@@ -1,33 +0,0 @@
#pragma once
#include "KingSystem/Utils/Types.h"
namespace ksys {
class SystemPauseMgr {
public:
SystemPauseMgr();
virtual ~SystemPauseMgr();
virtual void m2();
virtual void m3();
virtual void m4();
virtual void m5();
virtual void m6();
virtual bool m7();
virtual void m8();
virtual void m9();
virtual void m10();
virtual bool m11();
virtual void m12();
virtual void m13();
virtual void m14();
bool get8() const { return _8; }
private:
bool _8 = true;
};
KSYS_CHECK_SIZE_NX150(SystemPauseMgr, 0x10);
} // namespace ksys