diff --git a/config/SALP4Q/splits.txt b/config/SALP4Q/splits.txt index 3f0636e..d3a751c 100644 --- a/config/SALP4Q/splits.txt +++ b/config/SALP4Q/splits.txt @@ -24,6 +24,7 @@ Alice/K/KAliceHero/CKHkAliceHero.cpp: K/KCore/Main/CKYellowPages.cpp: .text start:0x801BC62C end:0x801BCB14 + .data start:0x805011B0 end:0x805011E8 .sbss start:0x805F48D8 end:0x805F48DC K/KServices/KServiceCounter/CKTimeCounter.cpp: diff --git a/config/SALP4Q/symbols.txt b/config/SALP4Q/symbols.txt index 285c23d..511dc00 100644 --- a/config/SALP4Q/symbols.txt +++ b/config/SALP4Q/symbols.txt @@ -2891,7 +2891,7 @@ fn_80018774 = .text:0x80018774; // type:function size:0xC0 fn_80018834 = .text:0x80018834; // type:function size:0x14 fn_80018848 = .text:0x80018848; // type:function size:0xC0 fn_80018908 = .text:0x80018908; // type:function size:0x5C -FindNonRecreableInstance__11IKBaseClassFv = .text:0x80018964; // type:function size:0x8 +FindNonRecreableInstances__11IKBaseClassFUlUlUlPPP11IKBaseClass = .text:0x80018964; // type:function size:0x8 DestroyGame__11IKBaseClassFv = .text:0x8001896C; // type:function size:0x4 fn_80018970 = .text:0x80018970; // type:function size:0x4 fn_80018974 = .text:0x80018974; // type:function size:0x10 @@ -18197,7 +18197,7 @@ fn_801BB284 = .text:0x801BB284; // type:function size:0x74 fn_801BB2F8 = .text:0x801BB2F8; // type:function size:0x74 fn_801BB36C = .text:0x801BB36C; // type:function size:0x74 fn_801BB3E0 = .text:0x801BB3E0; // type:function size:0x74 -fn_801BB454 = .text:0x801BB454; // type:function size:0x7C +FUN_801bb454__FP11IKBaseClassUl = .text:0x801BB454; // type:function size:0x7C fn_801BB4D0 = .text:0x801BB4D0; // type:function size:0x78 fn_801BB548 = .text:0x801BB548; // type:function size:0x8 fn_801BB550 = .text:0x801BB550; // type:function size:0xA4 @@ -18267,7 +18267,7 @@ fn_801BC530 = .text:0x801BC530; // type:function size:0xB4 fn_801BC5E4 = .text:0x801BC5E4; // type:function size:0x48 __ct__13CKYellowPagesFv = .text:0x801BC62C; // type:function size:0xEC __dt__13CKYellowPagesFv = .text:0x801BC718; // type:function size:0x44 -FindNonRecreableInstances__13CKYellowPagesFUlUlUlPl = .text:0x801BC75C; // type:function size:0x158 +FindNonRecreableInstances__13CKYellowPagesFUlUlUlPPP11IKBaseClass = .text:0x801BC75C; // type:function size:0x158 SetServiceCamera__13CKYellowPagesFPv = .text:0x801BC8B4; // type:function size:0xC SetInstance__13CKYellowPagesFv = .text:0x801BC8C0; // type:function size:0x8 SetLoadingInterface__13CKYellowPagesFPv = .text:0x801BC8C8; // type:function size:0xC @@ -18280,18 +18280,18 @@ SetCurrentLevel__13CKYellowPagesFPv = .text:0x801BC910; // type:function size:0x SetKGameManager__13CKYellowPagesFPv = .text:0x801BC91C; // type:function size:0xC SetKGameUIManager__13CKYellowPagesFPv = .text:0x801BC928; // type:function size:0xC SetLocManager__13CKYellowPagesFPv = .text:0x801BC934; // type:function size:0xC -SetGraphicModule__13CKYellowPagesFPv = .text:0x801BC940; // type:function size:0xC +SetGraphicModule__13CKYellowPagesFP14IKSerializable = .text:0x801BC940; // type:function size:0xC SetRendererRootNode__13CKYellowPagesFPv = .text:0x801BC94C; // type:function size:0xC SetRootNode2__13CKYellowPagesFPv = .text:0x801BC958; // type:function size:0xC SetCommunSectorRootNode__13CKYellowPagesFPv = .text:0x801BC964; // type:function size:0xC SetInputModule__13CKYellowPagesFPv = .text:0x801BC970; // type:function size:0xC SetSoundModule__13CKYellowPagesFPv = .text:0x801BC97C; // type:function size:0xC SetCoreFactory__13CKYellowPagesFPv = .text:0x801BC988; // type:function size:0xC -SetServiceManager__13CKYellowPagesFPv = .text:0x801BC994; // type:function size:0xC +SetServiceManager__13CKYellowPagesFP14IKSerializable = .text:0x801BC994; // type:function size:0xC SetServiceLife__13CKYellowPagesFPv = .text:0x801BC9A0; // type:function size:0xC -SetCoreManager__13CKYellowPagesFPv = .text:0x801BC9AC; // type:function size:0xC +SetCoreManager__13CKYellowPagesFP14IKSerializable = .text:0x801BC9AC; // type:function size:0xC SetFileIOManager__13CKYellowPagesFPv = .text:0x801BC9B8; // type:function size:0xC -SetGameLoop__13CKYellowPagesFPv = .text:0x801BC9C4; // type:function size:0xC +SetGameLoop__13CKYellowPagesFP14IKSerializable = .text:0x801BC9C4; // type:function size:0xC SetManager2d__13CKYellowPagesFPv = .text:0x801BC9D0; // type:function size:0xC SetTextureManager__13CKYellowPagesFPv = .text:0x801BC9DC; // type:function size:0xC SetAnimationManager__13CKYellowPagesFPv = .text:0x801BC9E8; // type:function size:0xC @@ -18299,7 +18299,7 @@ SetTimeManager__13CKYellowPagesFPv = .text:0x801BC9F4; // type:function size:0xC SetTrcManager__13CKYellowPagesFPv = .text:0x801BCA00; // type:function size:0xC SetSavingManager__13CKYellowPagesFP15CKSavingManager = .text:0x801BCA0C; // type:function size:0xC SetLoadingManager__13CKYellowPagesFPv = .text:0x801BCA18; // type:function size:0xC -SetServiceCollision__13CKYellowPagesFPv = .text:0x801BCA24; // type:function size:0xC +SetServiceCollision__13CKYellowPagesFP14IKSerializable = .text:0x801BCA24; // type:function size:0xC SetServicePhysics__13CKYellowPagesFPv = .text:0x801BCA30; // type:function size:0xC SetServicePathFinding__13CKYellowPagesFPv = .text:0x801BCA3C; // type:function size:0xC SetServiceProjectiles__13CKYellowPagesFPv = .text:0x801BCA48; // type:function size:0xC @@ -44844,7 +44844,7 @@ lbl_80501098 = .data:0x80501098; // type:object size:0x28 lbl_805010C0 = .data:0x805010C0; // type:object size:0xC0 lbl_80501180 = .data:0x80501180; // type:object size:0x20 lbl_805011A0 = .data:0x805011A0; // type:object size:0x10 -jumptable_805011B0 = .data:0x805011B0; // type:object size:0x38 scope:local +@211 = .data:0x805011B0; // type:object size:0x38 scope:local lbl_805011E8 = .data:0x805011E8; // type:object size:0xB8 lbl_805012A0 = .data:0x805012A0; // type:object size:0x3C data:4byte jumptable_805012DC = .data:0x805012DC; // type:object size:0x20 scope:local diff --git a/src/K/KCore/Interfaces/IKBaseClass.h b/src/K/KCore/Interfaces/IKBaseClass.h index cdbb249..1ac82f5 100644 --- a/src/K/KCore/Interfaces/IKBaseClass.h +++ b/src/K/KCore/Interfaces/IKBaseClass.h @@ -15,7 +15,7 @@ virtual s32 GetClassType() = 0; virtual s32 GetClassID() = 0; virtual KMESSAGE_RETURN MessageProc() { return KMSG_RETURN_NOT_PROCESSED; }; - virtual s32 FindNonRecreableInstance() { return 0; }; + virtual BOOL FindNonRecreableInstances(u32 a, u32 b, u32 c, IKBaseClass*** ppInstances) { return FALSE; }; }; #endif diff --git a/src/K/KCore/Main/CKYellowPages.cpp b/src/K/KCore/Main/CKYellowPages.cpp index 4cc1ed3..386eff9 100644 --- a/src/K/KCore/Main/CKYellowPages.cpp +++ b/src/K/KCore/Main/CKYellowPages.cpp @@ -1,6 +1,6 @@ -#include "K/KCore/Serialization/CKSavingManager.h" -#include "types.h" // IWYU pragma: export #include "K/KCore/Main/CKYellowPages.h" +#include "K/KCore/Interfaces/IKBaseClass.h" +#include "K/KCore/Interfaces/IKSerializable.h" static CKYellowPages* g_pYellowPages; @@ -57,63 +57,60 @@ CKYellowPages::CKYellowPages() CKYellowPages::~CKYellowPages() {} -extern s32 FUN_801bb454(void* pServiceManager, u32 c); -BOOL CKYellowPages::FindNonRecreableInstances(u32 a, u32 b, u32 c, s32* ppInstances) +extern IKBaseClass** FUN_801bb454(IKBaseClass* pServiceManager, u32 b); +BOOL CKYellowPages::FindNonRecreableInstances(u32 a, u32 b, u32 c, IKBaseClass*** ppInstances) { - typedef BOOL (*FuncType)(); BOOL found; - s32 iVar2; - u32 uVar1; + IKBaseClass** iVar2; switch(a) { case 0: - if (b == 1) + switch(b) { - *ppInstances = (int)this->m_pServiceManager; - } - else if (b == 2) - { - *ppInstances = (int)this->m_pGraphic; - } - else if (b == 3) - { - *ppInstances = (int)this->m_pSound; - } - else - { - if (b != 4) - { - typedef u32 (*FuncType2)(); - uVar1 = (*(FuncType2*)(*(int*)this->m_pGameLoop + 0x24))(); - return uVar1; - } - *ppInstances = (int)this->m_pInput; + case 1: + *ppInstances = (IKBaseClass**)this->m_pServiceManager; + break; + case 2: + *ppInstances = (IKBaseClass**)this->m_pGraphic; + break; + case 3: + *ppInstances = (IKBaseClass**)this->m_pSound; + break; + case 4: + *ppInstances = (IKBaseClass**)this->m_pInput; + break; + default: + if (b != 4) + { + BOOL uVar1 = this->m_pGameLoop->FindNonRecreableInstances(a, b, c, ppInstances); + return uVar1; + } + break; } found = (*ppInstances != NULL); break; case 1: - iVar2 = FUN_801bb454(this->m_pServiceManager,c); + iVar2 = FUN_801bb454(this->m_pServiceManager, b); *ppInstances = iVar2; found = iVar2 != 0; break; - case 2: - case 4: - case 12: - found = (*(FuncType*)(*(int*)this->m_pCoreManager + 0x24))(); - break; case 10: case 13: - found = (*(FuncType*)(*(int*)this->m_pGraphic + 0x24))(); - break; - case 11: - if (c == 6) - { - found = (*(FuncType*)(*(int*)this->m_pSrvCollision + 0x24))(); - } - else + if (b == 6) { - found = (*(FuncType*)(*(int*)this->m_pGraphic + 0x24))(); + found = this->m_pSrvCollision->FindNonRecreableInstances(a, b, c, ppInstances); + break; } + found = this->m_pGraphic->FindNonRecreableInstances(a, b, c, ppInstances); + break; + case 11: + found = this->m_pGraphic->FindNonRecreableInstances(a, b, c, ppInstances); + break; + case 2: + case 4: + case 12: + found = this->m_pCoreManager->FindNonRecreableInstances(a, b, c, ppInstances); + break; default: found = (c == 0); break; @@ -186,7 +183,7 @@ void CKYellowPages::SetLocManager(void* pLocManager) g_pYellowPages->m_pLocManager = pLocManager; } -void CKYellowPages::SetGraphicModule(void* pGraphicModule) +void CKYellowPages::SetGraphicModule(IKSerializable* pGraphicModule) { g_pYellowPages->m_pGraphic = pGraphicModule; } @@ -226,7 +223,7 @@ void CKYellowPages::SetCoreFactory(void* pCoreFactory) g_pYellowPages->m_pCoreFactory = pCoreFactory; } -void CKYellowPages::SetServiceManager(void* pServiceManager) +void CKYellowPages::SetServiceManager(IKSerializable* pServiceManager) { g_pYellowPages->m_pServiceManager = pServiceManager; } @@ -236,7 +233,7 @@ void CKYellowPages::SetServiceLife(void* pServiceLife) g_pYellowPages->m_pServiceLife = pServiceLife; } -void CKYellowPages::SetCoreManager(void* pCoreManager) +void CKYellowPages::SetCoreManager(IKSerializable* pCoreManager) { g_pYellowPages->m_pCoreManager = pCoreManager; } @@ -246,7 +243,7 @@ void CKYellowPages::SetFileIOManager(void* pFileIOManager) g_pYellowPages->m_pFileIOManager = pFileIOManager; } -void CKYellowPages::SetGameLoop(void* pGameLoop) +void CKYellowPages::SetGameLoop(IKSerializable* pGameLoop) { g_pYellowPages->m_pGameLoop = pGameLoop; } @@ -286,7 +283,7 @@ void CKYellowPages::SetLoadingManager(void* pLoadingManager) g_pYellowPages->m_pLoadingManager = pLoadingManager; } -void CKYellowPages::SetServiceCollision(void* pServiceCollision) +void CKYellowPages::SetServiceCollision(IKSerializable* pServiceCollision) { g_pYellowPages->m_pSrvCollision = pServiceCollision; } @@ -391,7 +388,7 @@ void* CKYellowPages::GetLoadingInterface() return g_pYellowPages->m_pLoadingInterface; } -void* CKYellowPages::GetGraphicModule() +IKSerializable* CKYellowPages::GetGraphicModule() { return g_pYellowPages->m_pGraphic; } @@ -431,7 +428,7 @@ void* CKYellowPages::GetCoreFactory() return g_pYellowPages->m_pCoreFactory; } -void* CKYellowPages::GetServiceManager() +IKSerializable* CKYellowPages::GetServiceManager() { return g_pYellowPages->m_pServiceManager; } @@ -441,7 +438,7 @@ void* CKYellowPages::GetServiceLife() return g_pYellowPages->m_pServiceLife; } -void* CKYellowPages::GetCoreManager() +IKSerializable* CKYellowPages::GetCoreManager() { return g_pYellowPages->m_pCoreManager; } @@ -451,7 +448,7 @@ void* CKYellowPages::GetFileIOManager() return g_pYellowPages->m_pFileIOManager; } -void* CKYellowPages::GetGameLoop() +IKSerializable* CKYellowPages::GetGameLoop() { return g_pYellowPages->m_pGameLoop; } @@ -496,7 +493,7 @@ void* CKYellowPages::GetUnk6() return g_pYellowPages->m_pUnk6; } -void* CKYellowPages::GetServiceCollision() +IKSerializable* CKYellowPages::GetServiceCollision() { return g_pYellowPages->m_pSrvCollision; } diff --git a/src/K/KCore/Main/CKYellowPages.h b/src/K/KCore/Main/CKYellowPages.h index 233009f..87588e2 100644 --- a/src/K/KCore/Main/CKYellowPages.h +++ b/src/K/KCore/Main/CKYellowPages.h @@ -1,15 +1,16 @@ #ifndef CKYELLOWPAGES_H #define CKYELLOWPAGES_H - #include "types.h" - // #include "K/KCore/Interfaces/IKSerializable.h" + #include "K/KCore/Interfaces/IKBaseClass.h" +#include "types.h" + #include "K/KCore/Interfaces/IKSerializable.h" #include "K/KCore/Serialization/CKSavingManager.h" class CKYellowPages { public: void* m_pLoadingInterface; // 0x00 - void* m_pGraphic; // 0x04 + IKSerializable* m_pGraphic; // 0x04 void* m_pScreen; // 0x08 void* m_pRendererRootNode; // 0x0C void* m_pUnkRootNode; // 0x10 @@ -17,11 +18,11 @@ void* m_pInput; // 0x18 void* m_pSound; // 0x1C void* m_pCoreFactory; // 0x20 - void* m_pServiceManager; // 0x24 + IKSerializable* m_pServiceManager; // 0x24 void* m_pServiceLife; // 0x28 - void* m_pCoreManager; // 0x2C + IKSerializable* m_pCoreManager; // 0x2C void* m_pFileIOManager; // 0x30 - void* m_pGameLoop; // 0x34 + IKSerializable* m_pGameLoop; // 0x34 void* m_pManager2d; // 0x38 void* m_pFlashManager; // 0x3C void* m_pTextureManager; // 0x40 @@ -30,7 +31,7 @@ void* m_pLoadingManager; // 0x4C CKSavingManager* m_pSavingManager; // 0x50 void* m_pUnk6; // 0x54 - CKParams?? - void* m_pSrvCollision; // 0x58 + IKSerializable* m_pSrvCollision; // 0x58 void* m_pSrvPhysics; // 0x5C void* m_pSrvFx; // 0x60 void* m_pSrvBonus; // 0x64 @@ -62,7 +63,7 @@ CKYellowPages(); ~CKYellowPages(); - BOOL FindNonRecreableInstances(u32 a, u32 b, u32 c, s32* ppInstances); + BOOL FindNonRecreableInstances(u32 a, u32 b, u32 c, IKBaseClass*** ppInstances); static void SetServiceCamera(void* pServiceCamera); void SetInstance(); CKYellowPages* GetInstance(); @@ -76,7 +77,7 @@ static void SetKGameManager(void* pKGameManager); static void SetKGameUIManager(void* pKGameUIManager); static void SetLocManager(void* pLocManager); - static void SetGraphicModule(void* pGraphicModule); + static void SetGraphicModule(IKSerializable* pGraphicModule); static void SetScreen(void* pScreen); static void SetRendererRootNode(void* pRendererRootNode); static void SetRootNode2(void* pRootNode2); @@ -84,11 +85,11 @@ static void SetInputModule(void* pInputModule); static void SetSoundModule(void* pSoundModule); static void SetCoreFactory(void* pCoreFactory); - static void SetServiceManager(void* pServiceManager); + static void SetServiceManager(IKSerializable* pServiceManager); static void SetServiceLife(void* pServiceLife); - static void SetCoreManager(void* pCoreManager); + static void SetCoreManager(IKSerializable* pCoreManager); static void SetFileIOManager(void* pFileIOManager); - static void SetGameLoop(void* pGameLoop); + static void SetGameLoop(IKSerializable* pGameLoop); static void SetManager2d(void* pManager2d); static void SetTextureManager(void* pTextureManager); static void SetAnimationManager(void* pAnimationManager); @@ -96,7 +97,7 @@ static void SetTrcManager(void* pTrcManager); static void SetSavingManager(CKSavingManager* pSavingManager); static void SetLoadingManager(void* pLoadingManager); - static void SetServiceCollision(void* pServiceCollision); + static void SetServiceCollision(IKSerializable* pServiceCollision); static void SetServicePhysics(void* pServicePhysics); static void SetServicePathFinding(void* pServicePathFinding); static void SetServiceProjectiles(void* pServiceProjectiles); @@ -118,7 +119,7 @@ static void SetUnk4(void* pUnk4); static inline void* GetLoadingInterface(); - static inline void* GetGraphicModule(); + static inline IKSerializable* GetGraphicModule(); static inline void* GetScreen(); static inline void* GetRendererRootNode(); static inline void* GetRootNode2(); @@ -126,11 +127,11 @@ static inline void* GetInputModule(); static inline void* GetSoundModule(); static inline void* GetCoreFactory(); - static inline void* GetServiceManager(); + static inline IKSerializable* GetServiceManager(); static inline void* GetServiceLife(); // unused + stripped? - static inline void* GetCoreManager(); + static inline IKSerializable* GetCoreManager(); static inline void* GetFileIOManager(); - static inline void* GetGameLoop(); + static inline IKSerializable* GetGameLoop(); static inline void* GetManager2d(); static inline void* GetFlashManager(); static inline void* GetTextureManager(); @@ -139,7 +140,7 @@ static inline void* GetLoadingManager(); static CKSavingManager* GetSavingManager(); static inline void* GetUnk6(); - static inline void* GetServiceCollision(); + static inline IKSerializable* GetServiceCollision(); static inline void* GetServicePhysics(); static inline void* GetServiceFx(); static inline void* GetServiceBonus();