summaryrefslogtreecommitdiff
path: root/arm9/lib/src/OS_ownerInfo.c
diff options
context:
space:
mode:
authorPikalaxALT <pikalaxalt@gmail.com>2020-05-27 21:32:48 -0400
committerPikalaxALT <pikalaxalt@gmail.com>2020-05-27 21:32:48 -0400
commitd43d43f06bd17ac320247bc4e8d58cde2a9d9f70 (patch)
treeefacf95ec792b7c12d13eee670a59b3b4e5535cd /arm9/lib/src/OS_ownerInfo.c
parent35c9f9fc2e2ff3387ff89b956a88e05000d4768a (diff)
parentd42cc73852cdb0cc0684bb87aaa6975d06cae02f (diff)
Merge remote-tracking branch 'origin' into libvct
Diffstat (limited to 'arm9/lib/src/OS_ownerInfo.c')
-rw-r--r--arm9/lib/src/OS_ownerInfo.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/arm9/lib/src/OS_ownerInfo.c b/arm9/lib/src/OS_ownerInfo.c
new file mode 100644
index 00000000..10a638fb
--- /dev/null
+++ b/arm9/lib/src/OS_ownerInfo.c
@@ -0,0 +1,27 @@
+#include "function_target.h"
+#include "OS_ownerInfo.h"
+#include "MI_memory.h"
+
+ARM_FUNC void OS_GetMacAddress(u8 *macAddress)
+{
+ MI_CpuCopy8((void *)0x027FFCF4, macAddress, 0x6);
+}
+
+ARM_FUNC void OS_GetOwnerInfo(OSOwnerInfo* info)
+{
+ NVRAMConfig *src = (NVRAMConfig *)OS_GetSystemWork()->nvramUserInfo;
+ info->language = (u8)src->ncd.option.language;
+ info->favoriteColour = (u8)src->ncd.owner.favouriteColour;
+ info->birthday.month = (u8)src->ncd.owner.birthday.month;
+ info->birthday.day = (u8)src->ncd.owner.birthday.day;
+ info->nickNameLength = (u16)src->ncd.owner.nickname.length;
+ info->commentLength = (u16)src->ncd.owner.comment.length;
+ MIi_CpuCopy16(src->ncd.owner.nickname.str, info->nickName, 10 * sizeof(u16));
+ MIi_CpuCopy16(src->ncd.owner.comment.str, info->comment, 26 * sizeof(u16));
+}
+
+ARM_FUNC s64 OS_GetOwnerRtcOffset(void)
+{
+ NVRAMConfig *src = (NVRAMConfig *)OS_GetSystemWork()->nvramUserInfo;
+ return src->ncd.option.rtcOffset;
+}