summaryrefslogtreecommitdiff
path: root/include/SDK/NAND
diff options
context:
space:
mode:
Diffstat (limited to 'include/SDK/NAND')
-rw-r--r--include/SDK/NAND/NANDOpenClose.h6
-rw-r--r--include/SDK/NAND/nand.h38
2 files changed, 40 insertions, 4 deletions
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