summaryrefslogtreecommitdiff
path: root/arm9/lib/include
diff options
context:
space:
mode:
Diffstat (limited to 'arm9/lib/include')
-rw-r--r--arm9/lib/include/MI_memory.h1
-rw-r--r--arm9/lib/include/OS_entropy.h7
-rw-r--r--arm9/lib/include/OS_ownerInfo.h28
-rw-r--r--arm9/lib/include/gx.h2
-rw-r--r--arm9/lib/include/mmap.h2
-rw-r--r--arm9/lib/include/userInfo.h92
6 files changed, 124 insertions, 8 deletions
diff --git a/arm9/lib/include/MI_memory.h b/arm9/lib/include/MI_memory.h
index d9935a5f..0ebb3560 100644
--- a/arm9/lib/include/MI_memory.h
+++ b/arm9/lib/include/MI_memory.h
@@ -6,5 +6,6 @@ void MI_CpuCopy8(void const *src, void *dest, u32 size);
static inline void MI_CpuClear8(void *dest, u32 size) {
MI_CpuFill8(dest, 0, size);
}
+void MIi_CpuCopy16(const void *src, void *dst, u32 size);
#endif //NITRO_MI_MEMORY_H_
diff --git a/arm9/lib/include/OS_entropy.h b/arm9/lib/include/OS_entropy.h
index 78ac71b7..b0f2781a 100644
--- a/arm9/lib/include/OS_entropy.h
+++ b/arm9/lib/include/OS_entropy.h
@@ -6,15 +6,10 @@
#define POKEDIAMOND_OS_ENTROPY_H
#include "consts.h"
+#include "userInfo.h"
void OS_GetLowEntropyData(u32 * arr);
-typedef struct NVRAMConfig{
- u8 ncd[110]; // todo: typeof NVRAMConfigData
- u16 saveCount;
- u16 rc16;
-} NVRAMConfig;
-
extern vu64 OSi_TickCounter;
extern u16 OS_GetTickLo(void);
diff --git a/arm9/lib/include/OS_ownerInfo.h b/arm9/lib/include/OS_ownerInfo.h
new file mode 100644
index 00000000..13bae06e
--- /dev/null
+++ b/arm9/lib/include/OS_ownerInfo.h
@@ -0,0 +1,28 @@
+#ifndef POKEDIAMOND_OS_OWNERINFO_H
+#define POKEDIAMOND_OS_OWNERINFO_H
+
+#include "consts.h"
+#include "userInfo.h"
+
+typedef struct OSBirthday
+{
+ u8 month;
+ u8 day;
+} OSBirthday;
+
+typedef struct OSOwnerInfo
+{
+ u8 language;
+ u8 favoriteColour;
+ OSBirthday birthday;
+ u16 nickName[10]; //either 10 or 8
+ u16 nickNameLength;
+ u16 comment[26];
+ u16 commentLength;
+} OSOwnerInfo;
+
+void OS_GetMacAddress(u8 *macAddress);
+void OS_GetOwnerInfo(OSOwnerInfo* info);
+s64 OS_GetOwnerRtcOffset(void);
+
+#endif //POKEDIAMOND_OS_OWNERINFO_H
diff --git a/arm9/lib/include/gx.h b/arm9/lib/include/gx.h
index 8abe4e40..79b707fc 100644
--- a/arm9/lib/include/gx.h
+++ b/arm9/lib/include/gx.h
@@ -2,6 +2,7 @@
#define GUARD_GX_H
#include "fx.h"
+#include "MI_memory.h"
//temporary while other files aren't decompiled
@@ -14,7 +15,6 @@ void MI_Copy64B(void *src, void *dst);
void MI_WaitDma(u32);
void MI_DmaCopy32Async(u32, const void *, void *, u32, void *, void *);
void MI_DmaCopy16(u32 unk, const void *src, void *dst, u32 size);
-void MIi_CpuCopy16(const void *src, void *dst, u32 size);
void MI_DmaCopy32(u32 unk, const void *src, void *dst, u32 size);
void MIi_CpuCopy32(const void *src, void *dst, u32 size);
void OSi_UnlockVram(u16, u16);
diff --git a/arm9/lib/include/mmap.h b/arm9/lib/include/mmap.h
index 207e0509..65b93e1e 100644
--- a/arm9/lib/include/mmap.h
+++ b/arm9/lib/include/mmap.h
@@ -98,7 +98,7 @@ typedef struct {
u16 mmem_checker_subp; // 3fa-3fb: 2bytes MainMomory Size Checker for Sub processor
u8 padding4[2]; // 3fc-3fd: (2bytes)
u16 command_area; // 3fe-3ff: 2bytes Command Area
-} OSSystemWork;
+} OSSystemWork; //0x027FFC00
#define OS_GetSystemWork() ((OSSystemWork *)HW_MAIN_MEM_SYSTEM)
diff --git a/arm9/lib/include/userInfo.h b/arm9/lib/include/userInfo.h
new file mode 100644
index 00000000..690dcf54
--- /dev/null
+++ b/arm9/lib/include/userInfo.h
@@ -0,0 +1,92 @@
+#ifndef POKEDIAMOND_USERINFO_H
+#define POKEDIAMOND_USERINFO_H
+
+typedef struct NVRAMConfigDate
+{
+ u8 month; //0x00
+ u8 day; //0x01
+} NVRAMConfigDate; //0x02
+
+typedef struct NVRAMConfigNickname
+{
+ u16 str[10]; //0x00
+ u8 length; //0x14
+ u8 rsv; //0x15
+} NVRAMConfigNickname; //0x16
+
+typedef struct NVRAMConfigComment
+{
+ u16 str[26]; //0x00
+ u8 length; //0x34
+ u8 rsv; //0x35
+} NVRAMConfigComment; //0x36
+
+typedef struct NVRAMConfigOwnerInfo
+{
+ u8 favouriteColour:4; //0x00 (0-3)
+ u8 rsv:4; //0x00 (4-7)
+ NVRAMConfigDate birthday; //0x01
+ u8 pad; //0x03
+ NVRAMConfigNickname nickname; //0x04
+ NVRAMConfigComment comment; //0x1a
+} NVRAMConfigOwnerInfo; //0x50
+
+typedef struct NVRAMConfigAlarm
+{
+ u8 hour; //0x00
+ u8 minute; //0x01
+ u8 second; //0x02
+ u8 pad; //0x03
+ u16 enableWeek:7; //0x04 (0-6)
+ u16 alarmOn:1; //0x04 (7)
+ u16 rsv:8; //0x04 (8-15)
+} NVRAMConfigAlarm; //0x06
+
+typedef struct NVRAMConfigTpCalibData
+{
+ u16 raw_x1; //0x00
+ u16 raw_y1; //0x02
+ u8 dx1; //0x04
+ u8 dy1; //0x05
+ u16 raw_x2; //0x06
+ u16 raw_y2; //0x08
+ u8 dx2; //0x0a
+ u8 dy2; //0x0b
+} NVRAMConfigTpCalibData; //0x0c
+
+typedef struct NVRAMConfigOption
+{
+ u16 language:3; //0x00 (0-2)
+ u16 agbLcd:1; //0x00 (3)
+ u16 detectPullOutCardFlag:1; //0x00 (4)
+ u16 detectPullOutCtrdgFlag:1; //0x00 (5)
+ u16 autoBootFlag:1; //0x00 (6)
+ u16 rsv:4; //0x00 (7-10)
+ u16 input_favouriteColour:1; //0x00 (11)
+ u16 input_tp:1; //0x00 (12)
+ u16 input_language:1; //0x00 (13)
+ u16 input_rtc:1; //0x00 (14)
+ u16 input_nickname:1; //0x00 (15)
+ u8 timeZone; //0x02
+ u8 rtcClockAdjust; //0x03
+ s64 rtcOffset; //0x04
+} NVRAMConfigOption; //0x0c
+
+typedef struct NVRAMConfigData
+{
+ u8 version; //0x00
+ u8 pad; //0x01
+ NVRAMConfigOwnerInfo owner; //0x02
+ NVRAMConfigAlarm alarm; //0x52
+ NVRAMConfigTpCalibData tp; //0x58
+ NVRAMConfigOption option; //0x64
+} NVRAMConfigData; //0x70
+
+typedef struct NVRAMConfig
+{
+ NVRAMConfigData ncd; //0x00
+ u16 saveCount; //0x70
+ u16 crc16; //0x72
+} NVRAMConfig; //0x74
+
+#endif //POKEDIAMOND_USERINFO_H