summaryrefslogtreecommitdiff
path: root/arm9/lib/include/MI_exMemory.h
diff options
context:
space:
mode:
authorRevo <projectrevotpp@hotmail.com>2021-01-08 19:33:39 -0500
committerGitHub <noreply@github.com>2021-01-08 19:33:39 -0500
commit3289261e5aaddcd67f72513de06a72a379854d5c (patch)
tree3af221138ff7d6e8ad56a4b95a6255a0edc3812b /arm9/lib/include/MI_exMemory.h
parentee1f12ce06e865f47511ba200029e0afaafa4255 (diff)
parent1e268426533b6bb78b86e35577c72cd4bb5cbb4c (diff)
Merge pull request #312 from red031000/master
decompile CTRDG_common
Diffstat (limited to 'arm9/lib/include/MI_exMemory.h')
-rw-r--r--arm9/lib/include/MI_exMemory.h40
1 files changed, 37 insertions, 3 deletions
diff --git a/arm9/lib/include/MI_exMemory.h b/arm9/lib/include/MI_exMemory.h
index 8bd355ac..df46b008 100644
--- a/arm9/lib/include/MI_exMemory.h
+++ b/arm9/lib/include/MI_exMemory.h
@@ -1,5 +1,5 @@
-#ifndef NITRO_MI_EXMEMORY_H_
-#define NITRO_MI_EXMEMORY_H_
+#ifndef POKEDIAMOND_MI_EXMEMORY_H
+#define POKEDIAMOND_MI_EXMEMORY_H
#include "consts.h"
@@ -8,6 +8,20 @@ typedef enum {
MI_PROCESSOR_ARM7 = 1
} MIProcessor;
+typedef enum
+{
+ MI_CTRDG_ROMCYCLE1_10 = 0,
+ MI_CTRDG_ROMCYCLE1_8 = 1,
+ MI_CTRDG_ROMCYCLE1_6 = 2,
+ MI_CTRDG_ROMCYCLE1_18 = 3
+} MICartridgeRomCycle1st;
+
+typedef enum
+{
+ MI_CTRDG_ROMCYCLE2_6 = 0,
+ MI_CTRDG_ROMCYCLE2_4 = 1
+} MICartridgeRomCycle2nd;
+
static inline void MIi_SetCardProcessor(MIProcessor proc)
{
reg_MI_EXMEMCNT =
@@ -20,4 +34,24 @@ static inline void MIi_SetCartridgeProcessor(MIProcessor proc)
(u16)((reg_MI_EXMEMCNT & ~0x0080) | (proc << 7));
}
-#endif //NITRO_MI_EXMEMORY_H_
+static inline MICartridgeRomCycle1st MI_GetCartridgeRomCycle1st(void)
+{
+ return (MICartridgeRomCycle1st)((reg_MI_EXMEMCNT & 0xc) >> 2);
+}
+
+static inline MICartridgeRomCycle2nd MI_GetCartridgeRomCycle2nd(void)
+{
+ return (MICartridgeRomCycle2nd)((reg_MI_EXMEMCNT & 0x10) >> 4);
+}
+
+static inline void MI_SetCartridgeRomCycle1st(MICartridgeRomCycle1st c1)
+{
+ reg_MI_EXMEMCNT = (u16)((reg_MI_EXMEMCNT & ~0xc) | (c1 << 2));
+}
+
+static inline void MI_SetCartridgeRomCycle2nd(MICartridgeRomCycle2nd c2)
+{
+ reg_MI_EXMEMCNT = (u16)((reg_MI_EXMEMCNT & ~0x10) | (c2 << 4));
+}
+
+#endif //POKEDIAMOND_MI_EXMEMORY_H