summaryrefslogtreecommitdiff
path: root/include/SDK
diff options
context:
space:
mode:
Diffstat (limited to 'include/SDK')
-rw-r--r--include/SDK/DVD/dvdfs.h21
-rw-r--r--include/SDK/NAND/NANDOpenClose.h6
-rw-r--r--include/SDK/NAND/nand.h38
-rw-r--r--include/SDK/nand.h1
4 files changed, 44 insertions, 22 deletions
diff --git a/include/SDK/DVD/dvdfs.h b/include/SDK/DVD/dvdfs.h
index 444ae92..8687730 100644
--- a/include/SDK/DVD/dvdfs.h
+++ b/include/SDK/DVD/dvdfs.h
@@ -5,31 +5,16 @@
extern "C" {
#endif
-// TODO: not a nested class, but a struct from the SDK. Referenced
-// by DVDFileInfo
-struct gUnkClass6
-{
- u8 unk0;
- u8 unk1;
- char unk2[0x5];
- char unk7[0x41];
- NANDFileInfo unk48;
- u8 unkD3[0xBD];
-};
-
typedef struct DVDFileInfo DVDFileInfo;
typedef void (*DVDCallback)(s32 result, DVDFileInfo* fileInfo);
+// sizeof DVDFileInfo >= 0x3C
struct DVDFileInfo
{
u8 unk0[0x34];
- size_t unk34;
+ size_t fileSz;
u8 unk38[0x4];
- gUnkClass6* unk3C; // TODO: determine type
- void (*unk40)(s32, void*);
- void* unk44;
- u32 unk48;
};
BOOL DVDOpen(const char*, DVDFileInfo*);
@@ -39,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/SDK/NAND/NANDOpenClose.h b/include/SDK/NAND/NANDOpenClose.h
index 2a93acd..2b5f52f 100644
--- a/include/SDK/NAND/NANDOpenClose.h
+++ b/include/SDK/NAND/NANDOpenClose.h
@@ -5,12 +5,10 @@
extern "C" {
#endif
-typedef struct NANDFileInfo
-{
- u8 unk0[0x8B]; // TODO: determine actual size
-} NANDFileInfo;
+#include <SDK/NAND/nand.h>
s32 NANDOpen(const char* path, NANDFileInfo* info, u8 accType);
+s32 NANDClose(NANDFileInfo* info);
#ifdef __cplusplus
}
diff --git a/include/SDK/NAND/nand.h b/include/SDK/NAND/nand.h
new file mode 100644
index 0000000..bc22279
--- /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
+
+// TODO: size >= 0x8B
+typedef struct NANDFileInfo
+{
+ u8 unk0[0x8C];
+} NANDFileInfo;
+
+// TODO: no idea of size yet
+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 463ef89..1e055e2 100644
--- a/include/SDK/nand.h
+++ b/include/SDK/nand.h
@@ -5,6 +5,7 @@
extern "C" {
#endif
+#include <SDK/NAND/nand.h>
#include <SDK/NAND/NANDCore.h>
#include <SDK/NAND/NANDOpenClose.h>