From c60dfd44ac789abdb4b4cc7e20978eb77c93a981 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1zaro=20Vieira?= Date: Sat, 3 Mar 2018 05:56:52 -0300 Subject: [PATCH 1/2] Add OSGetSharedData --- source/os_functions.c | 4 ++++ source/os_functions.h | 2 ++ 2 files changed, 6 insertions(+) diff --git a/source/os_functions.c b/source/os_functions.c index a375144..4809591 100644 --- a/source/os_functions.c +++ b/source/os_functions.c @@ -118,6 +118,8 @@ EXPORT_DECL(bool, DisassemblePPCOpcode, u32 *, char *, u32, DisasmGetSym, u32); EXPORT_DECL(void*, OSGetSymbolName, u32, u8 *, u32); EXPORT_DECL(int, OSIsDebuggerInitialized, void); +EXPORT_DECL(bool, OSGetSharedData, u32 type, u32 unk_r4, u8 *addr, u32 *size); + //!---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- //! Memory functions //!---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- @@ -285,6 +287,8 @@ void InitOSFunctionPointers(void){ OS_FIND_EXPORT(coreinit_handle, DisassemblePPCOpcode); OS_FIND_EXPORT(coreinit_handle, OSGetSymbolName); OS_FIND_EXPORT(coreinit_handle, OSIsDebuggerInitialized); + + OS_FIND_EXPORT(coreinit_handle, OSGetSharedData); //!---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- //! Thread functions //!---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- diff --git a/source/os_functions.h b/source/os_functions.h index bcad853..599c762 100644 --- a/source/os_functions.h +++ b/source/os_functions.h @@ -201,6 +201,8 @@ extern bool (*DisassemblePPCOpcode)(u32 *opcode, char *outputBuffer, u32 bufferS extern void *(*OSGetSymbolName)(u32 addr, u8 *symbolName, u32 nameBufSize); extern int (*OSIsDebuggerInitialized)(void); +extern bool (*OSGetSharedData)(u32 type, u32 unk_r4, u8 *addr, u32 *size); + //!---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- //! Memory functions //!---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- From 7d3d9178d2784ad8583a0b43e2359b1c39836cf1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1zaro=20Vieira?= Date: Sat, 3 Mar 2018 08:12:22 -0300 Subject: [PATCH 2/2] Add MCP_TitleCount and MCP_TitleList --- source/os_functions.c | 6 +++++- source/os_functions.h | 4 +++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/source/os_functions.c b/source/os_functions.c index 4809591..c79c2c7 100644 --- a/source/os_functions.c +++ b/source/os_functions.c @@ -152,7 +152,9 @@ EXPORT_DECL(s32, OSGetMemBound, s32 type, u32 * startAddress, u32 * size); //!---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- EXPORT_DECL(s32, MCP_Open, void); EXPORT_DECL(s32, MCP_Close, s32 handle); -EXPORT_DECL(s32, MCP_GetOwnTitleInfo, s32 handle, void * data); +EXPORT_DECL(s32, MCP_TitleCount, s32 handle); +EXPORT_DECL(s32, MCP_TitleList, s32 handle, s32 *res, void *data, s32 count); +EXPORT_DECL(s32, MCP_GetOwnTitleInfo, s32 handle, void *data); EXPORT_DECL(void*, MCP_GetDeviceId, s32 handle, u32 * id); //!---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- @@ -340,6 +342,8 @@ void InitOSFunctionPointers(void){ //!---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- OS_FIND_EXPORT(coreinit_handle, MCP_Open); OS_FIND_EXPORT(coreinit_handle, MCP_Close); + OS_FIND_EXPORT(coreinit_handle, MCP_TitleCount); + OS_FIND_EXPORT(coreinit_handle, MCP_TitleList); OS_FIND_EXPORT(coreinit_handle, MCP_GetOwnTitleInfo); OS_FIND_EXPORT(coreinit_handle, MCP_GetDeviceId); diff --git a/source/os_functions.h b/source/os_functions.h index 599c762..18404d3 100644 --- a/source/os_functions.h +++ b/source/os_functions.h @@ -233,7 +233,9 @@ extern s32 (* OSGetMemBound)(s32 type, u32 * startAddress, u32 * size); //!---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- extern s32 (* MCP_Open)(void); extern s32 (* MCP_Close)(s32 handle); -extern s32 (* MCP_GetOwnTitleInfo)(s32 handle, void * data); +extern s32 (* MCP_TitleCount)(s32 handle); +extern s32 (* MCP_TitleList)(s32 handle, s32 *res, void *data, s32 count); +extern s32 (* MCP_GetOwnTitleInfo)(s32 handle, void *data); extern void* (* MCP_GetDeviceId)(s32 handle, u32 * id); //!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------