From 8f73a39edf782bd2e6c91130aac685b8dd267001 Mon Sep 17 00:00:00 2001 From: Max Date: Sat, 24 Oct 2020 15:07:58 -0400 Subject: match up to func_801DC0C8 with two nonmatchings --- include/SDK/DVD/dvd.h | 14 ++++++++++++++ include/SDK/NAND/NANDCore.h | 14 ++++++++++++++ include/SDK/OS/OSCache.h | 1 + include/SDK/OS/OSInterrupt.h | 15 +++++++++++++++ include/SDK/dvd.h | 14 ++++++++++++++ include/SDK/nand.h | 14 ++++++++++++++ include/SDK/os.h | 1 + 7 files changed, 73 insertions(+) create mode 100644 include/SDK/DVD/dvd.h create mode 100644 include/SDK/NAND/NANDCore.h create mode 100644 include/SDK/OS/OSInterrupt.h create mode 100644 include/SDK/dvd.h create mode 100644 include/SDK/nand.h (limited to 'include/SDK') diff --git a/include/SDK/DVD/dvd.h b/include/SDK/DVD/dvd.h new file mode 100644 index 0000000..16b8623 --- /dev/null +++ b/include/SDK/DVD/dvd.h @@ -0,0 +1,14 @@ +#ifndef POKEREVO_DVD_DVD_H +#define POKEREVO_DVD_DVD_H + +#ifdef __cplusplus +extern "C" { +#endif + +u32 DVDGetCurrentDiskID(void); + +#ifdef __cplusplus +} +#endif + +#endif //POKEREVO_DVD_DVD_H diff --git a/include/SDK/NAND/NANDCore.h b/include/SDK/NAND/NANDCore.h new file mode 100644 index 0000000..0f2811f --- /dev/null +++ b/include/SDK/NAND/NANDCore.h @@ -0,0 +1,14 @@ +#ifndef POKEREVO_NANDCORE_H +#define POKEREVO_NANDCORE_H + +#ifdef __cplusplus +extern "C" { +#endif + +s32 NANDInit(void); + +#ifdef __cplusplus +} +#endif + +#endif //POKEREVO_NANDCORE_H diff --git a/include/SDK/OS/OSCache.h b/include/SDK/OS/OSCache.h index a6fb490..75dd2ca 100644 --- a/include/SDK/OS/OSCache.h +++ b/include/SDK/OS/OSCache.h @@ -5,6 +5,7 @@ extern "C" { #endif +void DCInvalidateRange(void* startAddr, u32 nBytes); void LCEnable(void); #define LC_BASE (0xE000 << 16) #define LCGetBase() ((void*)LC_BASE) diff --git a/include/SDK/OS/OSInterrupt.h b/include/SDK/OS/OSInterrupt.h new file mode 100644 index 0000000..9bb3bda --- /dev/null +++ b/include/SDK/OS/OSInterrupt.h @@ -0,0 +1,15 @@ +#ifndef POKEREVO_OSINTERRUPT_H +#define POKEREVO_OSINTERRUPT_H + +#ifdef __cplusplus +extern "C" { +#endif + +void OSDisableInterrupts(void); +void OSRestoreInterrupts(void); + +#ifdef __cplusplus +} +#endif + +#endif //POKEREVO_OSINTERRUPT_H diff --git a/include/SDK/dvd.h b/include/SDK/dvd.h new file mode 100644 index 0000000..1536458 --- /dev/null +++ b/include/SDK/dvd.h @@ -0,0 +1,14 @@ +#ifndef POKEREVO_DVD_H +#define POKEREVO_DVD_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "SDK/DVD/dvd.h" + +#ifdef __cplusplus +} +#endif + +#endif //POKEREVO_DVD_H diff --git a/include/SDK/nand.h b/include/SDK/nand.h new file mode 100644 index 0000000..c20ee68 --- /dev/null +++ b/include/SDK/nand.h @@ -0,0 +1,14 @@ +#ifndef POKEREVO_NAND_H +#define POKEREVO_NAND_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "SDK/NAND/NANDCore.h" + +#ifdef __cplusplus +} +#endif + +#endif //POKEREVO_NAND_H diff --git a/include/SDK/os.h b/include/SDK/os.h index 10d4153..0d31901 100644 --- a/include/SDK/os.h +++ b/include/SDK/os.h @@ -7,6 +7,7 @@ extern "C" { #include "SDK/OS/OSAlloc.h" #include "SDK/OS/OSCache.h" +#include "SDK/OS/OSInterrupt.h" #ifdef __cplusplus } -- cgit v1.2.3 From b20f4b2f02dbc2421ec45cccbc55e732b094019e Mon Sep 17 00:00:00 2001 From: Max Date: Tue, 27 Oct 2020 01:18:43 -0400 Subject: match func_801DC0C8 --- include/SDK/DVD/dvd.h | 12 +++++++++++- include/SDK/DVD/dvdFatal.h | 14 ++++++++++++++ include/SDK/dvd.h | 1 + 3 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 include/SDK/DVD/dvdFatal.h (limited to 'include/SDK') diff --git a/include/SDK/DVD/dvd.h b/include/SDK/DVD/dvd.h index 16b8623..7a45e89 100644 --- a/include/SDK/DVD/dvd.h +++ b/include/SDK/DVD/dvd.h @@ -5,7 +5,17 @@ extern "C" { #endif -u32 DVDGetCurrentDiskID(void); +typedef struct DVDDiskID +{ + char gameCode[4]; + char makerCode[2]; + u8 unk6; + u8 unk7; +} DVDDiskID; + + +DVDDiskID* DVDGetCurrentDiskID(void); +void DVDInit(void); #ifdef __cplusplus } diff --git a/include/SDK/DVD/dvdFatal.h b/include/SDK/DVD/dvdFatal.h new file mode 100644 index 0000000..3533e71 --- /dev/null +++ b/include/SDK/DVD/dvdFatal.h @@ -0,0 +1,14 @@ +#ifndef POKEREVO_DVDFATAL_H +#define POKEREVO_DVDFATAL_H + +#ifdef __cplusplus +extern "C" { +#endif + +BOOL DVDSetAutoFatalMessaging(BOOL enable); + +#ifdef __cplusplus +} +#endif + +#endif //POKEREVO_DVDFATAL_H diff --git a/include/SDK/dvd.h b/include/SDK/dvd.h index 1536458..0bab0b6 100644 --- a/include/SDK/dvd.h +++ b/include/SDK/dvd.h @@ -6,6 +6,7 @@ extern "C" { #endif #include "SDK/DVD/dvd.h" +#include "SDK/DVD/dvdFatal.h" #ifdef __cplusplus } -- cgit v1.2.3 From a1d40c31b8b84973fb7aaa24d2d90d8f55c4cdc6 Mon Sep 17 00:00:00 2001 From: Max Date: Tue, 27 Oct 2020 11:34:42 -0400 Subject: match func_801DC264 --- include/SDK/OS/OSInterrupt.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/SDK') diff --git a/include/SDK/OS/OSInterrupt.h b/include/SDK/OS/OSInterrupt.h index 9bb3bda..b4508f6 100644 --- a/include/SDK/OS/OSInterrupt.h +++ b/include/SDK/OS/OSInterrupt.h @@ -5,7 +5,7 @@ extern "C" { #endif -void OSDisableInterrupts(void); +BOOL OSDisableInterrupts(void); void OSRestoreInterrupts(void); #ifdef __cplusplus -- cgit v1.2.3 From 1f79672cc57db6176590219ec5e34bb6e077f03c Mon Sep 17 00:00:00 2001 From: Max Date: Tue, 27 Oct 2020 14:06:50 -0400 Subject: match up to func_801DC5FC --- include/SDK/DVD/dvd.h | 1 - include/SDK/DVD/dvdfs.h | 29 +++++++++++++++++++++++++++++ include/SDK/dvd.h | 1 + 3 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 include/SDK/DVD/dvdfs.h (limited to 'include/SDK') diff --git a/include/SDK/DVD/dvd.h b/include/SDK/DVD/dvd.h index 7a45e89..09a6c79 100644 --- a/include/SDK/DVD/dvd.h +++ b/include/SDK/DVD/dvd.h @@ -13,7 +13,6 @@ typedef struct DVDDiskID u8 unk7; } DVDDiskID; - DVDDiskID* DVDGetCurrentDiskID(void); void DVDInit(void); diff --git a/include/SDK/DVD/dvdfs.h b/include/SDK/DVD/dvdfs.h new file mode 100644 index 0000000..8f95a94 --- /dev/null +++ b/include/SDK/DVD/dvdfs.h @@ -0,0 +1,29 @@ +#ifndef POKEREVO_DVDFS_H +#define POKEREVO_DVDFS_H + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct DVDFileInfo DVDFileInfo; + +typedef void (*DVDCallback)(s32 result, DVDFileInfo* fileInfo); + +struct DVDFileInfo +{ + u8 unk0[0x40]; + void (*unk40)(s32, void*); // TODO: not a DVDFileCallback bc an unkClass* is passed as 2nd param + void* unk44; //data cache start addr to invalidate + u32 unk48; // data cache region size +}; + +BOOL DVDOpen(const char*, DVDFileInfo*); +s32 DVDConvertPathToEntrynum(const char* fileName); +s32 DVDReadPrio(DVDFileInfo* fileInfo, void* addr, s32 length, s32 offset, s32 prio); +s32 DVDReadAsyncPrio(DVDFileInfo* fileInfo, void* addr, s32 length, s32 offset, DVDCallback callback, s32 prio); + +#ifdef __cplusplus +} +#endif + +#endif //POKEREVO_DVDFS_H diff --git a/include/SDK/dvd.h b/include/SDK/dvd.h index 0bab0b6..d2cc09e 100644 --- a/include/SDK/dvd.h +++ b/include/SDK/dvd.h @@ -7,6 +7,7 @@ extern "C" { #include "SDK/DVD/dvd.h" #include "SDK/DVD/dvdFatal.h" +#include "SDK/DVD/dvdfs.h" #ifdef __cplusplus } -- cgit v1.2.3 From 69dd6927a2ec6791639065a70da615228ae362f6 Mon Sep 17 00:00:00 2001 From: Max Date: Tue, 27 Oct 2020 15:09:41 -0400 Subject: match up to func_801DC7F8 --- include/SDK/DVD/dvd.h | 1 + include/SDK/DVD/dvdfs.h | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'include/SDK') diff --git a/include/SDK/DVD/dvd.h b/include/SDK/DVD/dvd.h index 09a6c79..f10826f 100644 --- a/include/SDK/DVD/dvd.h +++ b/include/SDK/DVD/dvd.h @@ -15,6 +15,7 @@ typedef struct DVDDiskID DVDDiskID* DVDGetCurrentDiskID(void); void DVDInit(void); +s32 DVDGetDriveStatus(void); #ifdef __cplusplus } diff --git a/include/SDK/DVD/dvdfs.h b/include/SDK/DVD/dvdfs.h index 8f95a94..0597e82 100644 --- a/include/SDK/DVD/dvdfs.h +++ b/include/SDK/DVD/dvdfs.h @@ -11,17 +11,21 @@ typedef void (*DVDCallback)(s32 result, DVDFileInfo* fileInfo); struct DVDFileInfo { - u8 unk0[0x40]; + u8 unk0[0x34]; + u32 unk34; + u8 unk38[0x8]; void (*unk40)(s32, void*); // TODO: not a DVDFileCallback bc an unkClass* is passed as 2nd param void* unk44; //data cache start addr to invalidate - u32 unk48; // data cache region size + s32 unk48; // data cache region size }; BOOL DVDOpen(const char*, DVDFileInfo*); +BOOL DVDClose(DVDFileInfo*); s32 DVDConvertPathToEntrynum(const char* fileName); s32 DVDReadPrio(DVDFileInfo* fileInfo, void* addr, s32 length, s32 offset, s32 prio); s32 DVDReadAsyncPrio(DVDFileInfo* fileInfo, void* addr, s32 length, s32 offset, DVDCallback callback, s32 prio); + #ifdef __cplusplus } #endif -- cgit v1.2.3 From 126972af1a4ff9084cd48f9c57eb07f3951e5086 Mon Sep 17 00:00:00 2001 From: Max Date: Tue, 27 Oct 2020 16:13:32 -0400 Subject: match up to func_801DC9CC --- include/SDK/DVD/dvd.h | 9 +++++++++ include/SDK/DVD/dvdfs.h | 4 +++- include/SDK/OS/OSSemaphore.h | 21 +++++++++++++++++++++ include/SDK/os.h | 1 + 4 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 include/SDK/OS/OSSemaphore.h (limited to 'include/SDK') diff --git a/include/SDK/DVD/dvd.h b/include/SDK/DVD/dvd.h index f10826f..e9517dc 100644 --- a/include/SDK/DVD/dvd.h +++ b/include/SDK/DVD/dvd.h @@ -13,9 +13,18 @@ typedef struct DVDDiskID u8 unk7; } DVDDiskID; +typedef struct DVDCommandBlock +{ + u8 unk0[0x30]; +} DVDCommandBlock; + +typedef void (*DVDCBCallback)(s32 result, DVDCommandBlock* block); + DVDDiskID* DVDGetCurrentDiskID(void); void DVDInit(void); s32 DVDGetDriveStatus(void); +BOOL DVDCheckDiskAsync(DVDCommandBlock* block, DVDCBCallback callback); + #ifdef __cplusplus } diff --git a/include/SDK/DVD/dvdfs.h b/include/SDK/DVD/dvdfs.h index 0597e82..0067c68 100644 --- a/include/SDK/DVD/dvdfs.h +++ b/include/SDK/DVD/dvdfs.h @@ -14,7 +14,7 @@ struct DVDFileInfo u8 unk0[0x34]; u32 unk34; u8 unk38[0x8]; - void (*unk40)(s32, void*); // TODO: not a DVDFileCallback bc an unkClass* is passed as 2nd param + void (*unk40)(s32, void*); // TODO: not a DVDFileCallback bc an unkClass* is passed as 2nd param? void* unk44; //data cache start addr to invalidate s32 unk48; // data cache region size }; @@ -24,6 +24,8 @@ BOOL DVDClose(DVDFileInfo*); s32 DVDConvertPathToEntrynum(const char* fileName); s32 DVDReadPrio(DVDFileInfo* fileInfo, void* addr, s32 length, s32 offset, s32 prio); s32 DVDReadAsyncPrio(DVDFileInfo* fileInfo, void* addr, s32 length, s32 offset, DVDCallback callback, s32 prio); +s32 DVDSeekAsyncPrio(DVDFileInfo* fileInfo, s32 offset, DVDCallback callback, s32 prio); + #ifdef __cplusplus diff --git a/include/SDK/OS/OSSemaphore.h b/include/SDK/OS/OSSemaphore.h new file mode 100644 index 0000000..46e7e03 --- /dev/null +++ b/include/SDK/OS/OSSemaphore.h @@ -0,0 +1,21 @@ +#ifndef POKEREVO_OSSEMAPHORE_H +#define POKEREVO_OSSEMAPHORE_H + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OSSemaphore +{ + u8 unk0[0x10]; +} OSSemaphore; + +s32 OSSignalSemaphore(OSSemaphore* sem); +void OSInitSemaphore(OSSemaphore* sem, s32 count); +s32 OSWaitSemaphore(OSSemaphore* sem); + +#ifdef __cplusplus +} +#endif + +#endif //POKEREVO_OSSEMAPHORE_H diff --git a/include/SDK/os.h b/include/SDK/os.h index 0d31901..d2272f0 100644 --- a/include/SDK/os.h +++ b/include/SDK/os.h @@ -8,6 +8,7 @@ extern "C" { #include "SDK/OS/OSAlloc.h" #include "SDK/OS/OSCache.h" #include "SDK/OS/OSInterrupt.h" +#include "SDK/OS/OSSemaphore.h" #ifdef __cplusplus } -- cgit v1.2.3 From 3512ee2e095d0aaa663b2feea4781f5199139d8f Mon Sep 17 00:00:00 2001 From: Max Date: Tue, 27 Oct 2020 20:00:40 -0400 Subject: match up to func_801DCE38 --- include/SDK/DVD/dvdfs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/SDK') diff --git a/include/SDK/DVD/dvdfs.h b/include/SDK/DVD/dvdfs.h index 0067c68..7be2c08 100644 --- a/include/SDK/DVD/dvdfs.h +++ b/include/SDK/DVD/dvdfs.h @@ -12,7 +12,7 @@ typedef void (*DVDCallback)(s32 result, DVDFileInfo* fileInfo); struct DVDFileInfo { u8 unk0[0x34]; - u32 unk34; + size_t unk34; u8 unk38[0x8]; void (*unk40)(s32, void*); // TODO: not a DVDFileCallback bc an unkClass* is passed as 2nd param? void* unk44; //data cache start addr to invalidate -- cgit v1.2.3 From c4dcd29c7708fc02463cf7e921f31ab404d88843 Mon Sep 17 00:00:00 2001 From: Max Date: Tue, 27 Oct 2020 20:37:19 -0400 Subject: match all of code_801DBE90 --- include/SDK/OS/OSInterrupt.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/SDK') diff --git a/include/SDK/OS/OSInterrupt.h b/include/SDK/OS/OSInterrupt.h index b4508f6..700faf6 100644 --- a/include/SDK/OS/OSInterrupt.h +++ b/include/SDK/OS/OSInterrupt.h @@ -6,7 +6,7 @@ extern "C" { #endif BOOL OSDisableInterrupts(void); -void OSRestoreInterrupts(void); +void OSRestoreInterrupts(BOOL enable); #ifdef __cplusplus } -- cgit v1.2.3 From 585b88fcba1dc639c859288a3df7f21a3b17bd4a Mon Sep 17 00:00:00 2001 From: Max Date: Tue, 27 Oct 2020 22:42:39 -0400 Subject: add headers and cleanup --- include/SDK/DVD/dvdfs.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include/SDK') diff --git a/include/SDK/DVD/dvdfs.h b/include/SDK/DVD/dvdfs.h index 7be2c08..a5283eb 100644 --- a/include/SDK/DVD/dvdfs.h +++ b/include/SDK/DVD/dvdfs.h @@ -14,9 +14,9 @@ struct DVDFileInfo u8 unk0[0x34]; size_t unk34; u8 unk38[0x8]; - void (*unk40)(s32, void*); // TODO: not a DVDFileCallback bc an unkClass* is passed as 2nd param? - void* unk44; //data cache start addr to invalidate - s32 unk48; // data cache region size + void (*unk40)(s32, void*); + void* unk44; + u32 unk48; }; BOOL DVDOpen(const char*, DVDFileInfo*); -- cgit v1.2.3