Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions config/SALP4Q/splits.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
18 changes: 9 additions & 9 deletions config/SALP4Q/symbols.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -18280,26 +18280,26 @@ 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
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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/K/KCore/Interfaces/IKBaseClass.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
101 changes: 49 additions & 52 deletions src/K/KCore/Main/CKYellowPages.cpp
Original file line number Diff line number Diff line change
@@ -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;

Expand Down Expand Up @@ -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)
Copy link

Copilot AI Oct 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This condition check for b != 4 is redundant as it's already inside the case 4 branch of the outer switch statement, which only executes when b == 4. This code is unreachable.

Copilot uses AI. Check for mistakes.
{
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);
Copy link

Copilot AI Oct 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function call passes parameter b but the surrounding case statement suggests this should be parameter c (case 1 should use the third parameter, not the second).

Suggested change
iVar2 = FUN_801bb454(this->m_pServiceManager, b);
iVar2 = FUN_801bb454(this->m_pServiceManager, c);

Copilot uses AI. Check for mistakes.
*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)
Copy link

Copilot AI Oct 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The condition checks parameter b but cases 10 and 13 should likely check parameter c based on the original code structure (case 11 checked c == 6).

Suggested change
if (b == 6)
if (c == 6)

Copilot uses AI. Check for mistakes.
{
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;
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand All @@ -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;
}
Expand All @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -391,7 +388,7 @@ void* CKYellowPages::GetLoadingInterface()
return g_pYellowPages->m_pLoadingInterface;
}

void* CKYellowPages::GetGraphicModule()
IKSerializable* CKYellowPages::GetGraphicModule()
{
return g_pYellowPages->m_pGraphic;
}
Expand Down Expand Up @@ -431,7 +428,7 @@ void* CKYellowPages::GetCoreFactory()
return g_pYellowPages->m_pCoreFactory;
}

void* CKYellowPages::GetServiceManager()
IKSerializable* CKYellowPages::GetServiceManager()
{
return g_pYellowPages->m_pServiceManager;
}
Expand All @@ -441,7 +438,7 @@ void* CKYellowPages::GetServiceLife()
return g_pYellowPages->m_pServiceLife;
}

void* CKYellowPages::GetCoreManager()
IKSerializable* CKYellowPages::GetCoreManager()
{
return g_pYellowPages->m_pCoreManager;
}
Expand All @@ -451,7 +448,7 @@ void* CKYellowPages::GetFileIOManager()
return g_pYellowPages->m_pFileIOManager;
}

void* CKYellowPages::GetGameLoop()
IKSerializable* CKYellowPages::GetGameLoop()
{
return g_pYellowPages->m_pGameLoop;
}
Expand Down Expand Up @@ -496,7 +493,7 @@ void* CKYellowPages::GetUnk6()
return g_pYellowPages->m_pUnk6;
}

void* CKYellowPages::GetServiceCollision()
IKSerializable* CKYellowPages::GetServiceCollision()
{
return g_pYellowPages->m_pSrvCollision;
}
Expand Down
Loading