diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/MSL_C/MSL_Common/qsort.h (renamed from include/libstdc++/qsort.h) | 0 | ||||
-rw-r--r-- | include/MSL_C/stdlib.h | 15 | ||||
-rw-r--r-- | include/MSL_C/string.h | 22 | ||||
-rw-r--r-- | include/Runtime/MWCPlusLib.h (renamed from include/libstdc++/CPlusLib.h) | 6 | ||||
-rw-r--r-- | include/SDK/DVD/dvdfs.h | 10 | ||||
-rw-r--r-- | include/SDK/DWC/gamespy/darray.h (renamed from include/GameSpy/darray.h) | 0 | ||||
-rw-r--r-- | include/SDK/DWC/gamespy/hashtable.h (renamed from include/GameSpy/hashtable.h) | 2 | ||||
-rw-r--r-- | include/SDK/DWC/gamespy/nonport.h (renamed from include/GameSpy/nonport.h) | 0 | ||||
-rw-r--r-- | include/SDK/NAND/NANDOpenClose.h | 17 | ||||
-rw-r--r-- | include/SDK/NAND/nand.h | 38 | ||||
-rw-r--r-- | include/SDK/nand.h | 4 | ||||
-rw-r--r-- | include/code_801DBE90.h | 11 | ||||
-rw-r--r-- | include/code_801DCE6C.h | 47 |
13 files changed, 138 insertions, 34 deletions
diff --git a/include/libstdc++/qsort.h b/include/MSL_C/MSL_Common/qsort.h index c13ae0e..c13ae0e 100644 --- a/include/libstdc++/qsort.h +++ b/include/MSL_C/MSL_Common/qsort.h diff --git a/include/MSL_C/stdlib.h b/include/MSL_C/stdlib.h new file mode 100644 index 0000000..bf86bca --- /dev/null +++ b/include/MSL_C/stdlib.h @@ -0,0 +1,15 @@ +#ifndef POKEREVO_STDLIB_H
+#define POKEREVO_STDLIB_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void qsort(void *base, u32 nmemb, u32 size,
+ s32 (*compar)(const void *, const void *));
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif //POKEREVO_STDLIB_H
diff --git a/include/MSL_C/string.h b/include/MSL_C/string.h new file mode 100644 index 0000000..7b4755c --- /dev/null +++ b/include/MSL_C/string.h @@ -0,0 +1,22 @@ +#ifndef POKEREVO_STRING_H
+#define POKEREVO_STRING_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void *memset(void *s, int c, size_t n);
+void *memmove(void *dest, const void *src, size_t n);
+void *memcpy(void *dest, const void *src, size_t n);
+int strcmp(const char *s1, const char *s2);
+int strncmp(const char *s1, const char *s2, size_t n);
+char *strcpy(char *dest, const char *src);
+char *strncpy(char *dest, const char *src, size_t n);
+char *strcat(char *dest, const char *src);
+char *strncat(char *dest, const char *src, size_t n);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif //POKEREVO_STRING_H
diff --git a/include/libstdc++/CPlusLib.h b/include/Runtime/MWCPlusLib.h index 819c0a9..f8ede23 100644 --- a/include/libstdc++/CPlusLib.h +++ b/include/Runtime/MWCPlusLib.h @@ -1,5 +1,5 @@ -#ifndef POKEREVO_CPLUSLIB_H -#define POKEREVO_CPLUSLIB_H +#ifndef POKEREVO_MWCPLUSLIB_H +#define POKEREVO_MWCPLUSLIB_H #ifdef __cplusplus extern "C" { @@ -11,4 +11,4 @@ void __ptmf_scall(...); } #endif -#endif //POKEREVO_CPLUSLIB_H +#endif //POKEREVO_MWCPLUSLIB_H diff --git a/include/SDK/DVD/dvdfs.h b/include/SDK/DVD/dvdfs.h index a5283eb..8687730 100644 --- a/include/SDK/DVD/dvdfs.h +++ b/include/SDK/DVD/dvdfs.h @@ -9,14 +9,12 @@ typedef struct DVDFileInfo DVDFileInfo; typedef void (*DVDCallback)(s32 result, DVDFileInfo* fileInfo);
+// sizeof DVDFileInfo >= 0x3C
struct DVDFileInfo
{
u8 unk0[0x34];
- size_t unk34;
- u8 unk38[0x8];
- void (*unk40)(s32, void*);
- void* unk44;
- u32 unk48;
+ size_t fileSz;
+ u8 unk38[0x4];
};
BOOL DVDOpen(const char*, DVDFileInfo*);
@@ -26,7 +24,7 @@ s32 DVDReadPrio(DVDFileInfo* fileInfo, void* addr, s32 length, s32 offset, s32 p s32 DVDReadAsyncPrio(DVDFileInfo* fileInfo, void* addr, s32 length, s32 offset, DVDCallback callback, s32 prio);
s32 DVDSeekAsyncPrio(DVDFileInfo* fileInfo, s32 offset, DVDCallback callback, s32 prio);
-
+#define DVDGetLength(info) ((info)->fileSz)
#ifdef __cplusplus
}
diff --git a/include/GameSpy/darray.h b/include/SDK/DWC/gamespy/darray.h index 5c7c170..5c7c170 100644 --- a/include/GameSpy/darray.h +++ b/include/SDK/DWC/gamespy/darray.h diff --git a/include/GameSpy/hashtable.h b/include/SDK/DWC/gamespy/hashtable.h index 26e0b6d..beb4812 100644 --- a/include/GameSpy/hashtable.h +++ b/include/SDK/DWC/gamespy/hashtable.h @@ -5,7 +5,7 @@ extern "C" {
#endif
-#include "GameSpy/darray.h"
+#include <DWC/gamespy/darray.h>
typedef s32 (*HashFunction)(void *, s32);
diff --git a/include/GameSpy/nonport.h b/include/SDK/DWC/gamespy/nonport.h index c1ed0e7..c1ed0e7 100644 --- a/include/GameSpy/nonport.h +++ b/include/SDK/DWC/gamespy/nonport.h diff --git a/include/SDK/NAND/NANDOpenClose.h b/include/SDK/NAND/NANDOpenClose.h new file mode 100644 index 0000000..2b5f52f --- /dev/null +++ b/include/SDK/NAND/NANDOpenClose.h @@ -0,0 +1,17 @@ +#ifndef POKEREVO_NANDOPENCLOSE_H
+#define POKEREVO_NANDOPENCLOSE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <SDK/NAND/nand.h>
+
+s32 NANDOpen(const char* path, NANDFileInfo* info, u8 accType);
+s32 NANDClose(NANDFileInfo* info);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif //POKEREVO_NANDOPENCLOSE_H
diff --git a/include/SDK/NAND/nand.h b/include/SDK/NAND/nand.h new file mode 100644 index 0000000..ac2f655 --- /dev/null +++ b/include/SDK/NAND/nand.h @@ -0,0 +1,38 @@ +#ifndef POKEREVO_NAND_NAND_H
+#define POKEREVO_NAND_NAND_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+// NOTE: size >= 0x8B, putting 0x8C for now
+typedef struct NANDFileInfo
+{
+ u8 unk0[0x8C];
+} NANDFileInfo;
+
+// TODO: placeholder size
+typedef struct NANDCommandBlock
+{
+ u8 unk0[0x4];
+} NANDCommandBlock;
+
+typedef void (*NANDCallback)(s32 result, NANDCommandBlock* block);
+
+s32 NANDGetLength(NANDFileInfo* info, u32* length);
+s32 NANDSeek(NANDFileInfo* info, s32 offset, s32 whence);
+s32 NANDSeekAsync(NANDFileInfo* info, s32 offset, s32 whence, NANDCallback cb, NANDCommandBlock* block);
+s32 NANDRead(NANDFileInfo* info, void* buf, u32 length);
+s32 NANDReadAsync(NANDFileInfo* info, void* buf, u32 length, NANDCallback cb, NANDCommandBlock* block);
+void* NANDGetUserData(const NANDCommandBlock* block);
+void NANDSetUserData(NANDCommandBlock* block, void* data);
+s32 NANDCreate(const char* fileName, u8 perm, u8 attr);
+s32 NANDWrite(NANDFileInfo* info, const void* buf, u32 length);
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif //POKEREVO_NAND_NAND_H
diff --git a/include/SDK/nand.h b/include/SDK/nand.h index c20ee68..1e055e2 100644 --- a/include/SDK/nand.h +++ b/include/SDK/nand.h @@ -5,7 +5,9 @@ extern "C" {
#endif
-#include "SDK/NAND/NANDCore.h"
+#include <SDK/NAND/nand.h>
+#include <SDK/NAND/NANDCore.h>
+#include <SDK/NAND/NANDOpenClose.h>
#ifdef __cplusplus
}
diff --git a/include/code_801DBE90.h b/include/code_801DBE90.h index 49889e7..3531815 100644 --- a/include/code_801DBE90.h +++ b/include/code_801DBE90.h @@ -7,13 +7,18 @@ extern "C" { #include "SDK/dvd.h"
#include "SDK/mem.h"
+#include "code_801DCE6C.h"
struct gUnkClass5
{
u8 unk0;
- u8 unk1;
+ u8 unk1; // flag: indicates NAND file opened/closed?
u8 unk2[0x2];
DVDFileInfo unk4;
+ gUnkClass6* unk40; // TODO: determine type
+ void (*unk44)(s32, void*);
+ void* unk48; // NANDReadAsync addr
+ u32 unk4C; // NANDReadAsync size
};
BOOL func_801DC0C8(size_t p1, u32 p2);
@@ -26,12 +31,12 @@ BOOL func_801DC6C4(gUnkClass5* p1); size_t func_801DC760(gUnkClass5* p1);
BOOL func_801DC7F8(gUnkClass5* p1, s32 offset, void (*p3)(s32, void*));
u8* func_801DCBC0(const char* fileName, u32* fileSz);
-void* func_801DCCAC(const char* fileName, MEMHeapHandle heap, u32* fileSz);
+u8* func_801DCCAC(const char* fileName, MEMHeapHandle heap, u32* fileSz);
BOOL func_801DCD94(const char* fileName);
void func_801DCDB8(void (*p1)(u32), void (*p2)(void));
u32 func_801DCDC4(void);
void func_801DCE38(void);
-u8 func_801DCE44(void);
+BOOL func_801DCE44(void);
#ifdef __cplusplus
}
diff --git a/include/code_801DCE6C.h b/include/code_801DCE6C.h index f06b185..a9e90cb 100644 --- a/include/code_801DCE6C.h +++ b/include/code_801DCE6C.h @@ -1,31 +1,38 @@ #ifndef POKEREVO_CODE_801DCE6C_H
#define POKEREVO_CODE_801DCE6C_H
-#ifdef __cplusplus
-extern "C" {
-#endif
+#include <SDK/nand.h>
-#include "code_801DBE90.h"
+struct gUnkClass5;
-struct gUnkClass4
+struct gUnkClass6
{
- u8 unk0[0x2];
- char unk2[0x5];
- char unk7[0xC79];
+ u8 unk0;
+ u8 unk1;
+ char unk2[0x46];
+ NANDFileInfo unk48;
+ NANDCommandBlock block;
+ u8 unkD8[0xB8];
- gUnkClass4(void);
+ const char* func_801DCE6C(void) const;
+ const char* func_801DCE74(void) const;
};
-u32 func_801DCF74(gUnkClass4*, const char*, gUnkClass5*);
-u32 func_801DCF48(gUnkClass4*, const char*);
-s32 func_801DD084(gUnkClass4* p1, gUnkClass5* p2, void* addr, s32 length, s32 offset);
-void* func_801DD220(gUnkClass4*, gUnkClass5*, void*, u32, s32);
-u32 func_801DCFE4(gUnkClass4*, gUnkClass5*);
-u32 func_801DD03C(gUnkClass4*, gUnkClass5*, u32*);
-BOOL func_801DD294(gUnkClass4*, const char*, s32);
-
-#ifdef __cplusplus
-}
-#endif
+class gUnkClass4
+{
+ enum { ArrLength_ = 8 };
+ gUnkClass6 arr_[ArrLength_];
+
+ gUnkClass6* func_801DCEB4(const char* p2);
+public:
+ gUnkClass4(void);
+ BOOL func_801DCF48(const char* p2);
+ BOOL func_801DCF74(const char* fileName, gUnkClass5* fp);
+ BOOL func_801DCFE4(gUnkClass5* fp) const;
+ BOOL func_801DD03C(gUnkClass5* fp, u32* fileSz) const;
+ s32 func_801DD084(gUnkClass5* fp, void* addr, s32 length, s32 offset) const;
+ BOOL func_801DD220(gUnkClass5* fp, void*, u32, s32 offset) const;
+ BOOL func_801DD294(const char *fileName, s32);
+};
#endif //POKEREVO_CODE_801DCE6C_H
|