diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/global.h | 6 | ||||
-rw-r--r-- | include/main.h | 40 | ||||
-rw-r--r-- | include/nitro/nitro.h | 16 | ||||
-rw-r--r-- | include/nitro/os.c | 9 | ||||
-rw-r--r-- | include/nitro/os.h | 10 | ||||
-rw-r--r-- | include/nitro/os_asm.h | 12 | ||||
-rw-r--r-- | include/nitro/os_asm.s | 7 | ||||
-rw-r--r-- | include/nitro/types.h | 50 |
8 files changed, 150 insertions, 0 deletions
diff --git a/include/global.h b/include/global.h new file mode 100644 index 00000000..33880ca1 --- /dev/null +++ b/include/global.h @@ -0,0 +1,6 @@ +#ifndef GUARD_GLOBAL_H +#define GUARD_GLOBAL_H + +#include "nitro/nitro.h" + +#endif //GUARD_GLOBAL_H diff --git a/include/main.h b/include/main.h new file mode 100644 index 00000000..0df94795 --- /dev/null +++ b/include/main.h @@ -0,0 +1,40 @@ +#ifndef GUARD_MAIN_H +#define GUARD_MAIN_H + +struct Unk2106FA0 +{ + s32 unk0; + s32 unk4; + s32 unk8; + s32 unkC; + s32 unk10; + s32 unk14; + s32 unk18; + s32 unk1C; + s32 unk20; +}; + +struct Unk21C48B8 +{ + void (*unk0)(s32); + s32 unk4; + s32 unk8; + s32 unkC; + s32 unk10; + s32 unk14; + s32 unk18; + s32 unk1C; + s32 unk20; + s32 unk24; + s32 unk28; + s32 unk2C; + s32 unk30; + s32 unk34; + s32 unk38; + u8 filler3C[0xC]; + s32 unk48; + u8 filler4C[0x20]; + s32 unk6C; +}; + +#endif //GUARD_MAIN_H diff --git a/include/nitro/nitro.h b/include/nitro/nitro.h new file mode 100644 index 00000000..017f3708 --- /dev/null +++ b/include/nitro/nitro.h @@ -0,0 +1,16 @@ +#ifndef POKEDIAMOND_NITRO_H +#define POKEDIAMOND_NITRO_H + +#ifdef __cplusplus +extern "C" { +#endif + +// Include all nitro files +#include "nitro/types.h" +#include "nitro/os.h" + +#ifdef __cplusplus +}; +#endif + +#endif //POKEDIAMOND_NITRO_H diff --git a/include/nitro/os.c b/include/nitro/os.c new file mode 100644 index 00000000..a531740d --- /dev/null +++ b/include/nitro/os.c @@ -0,0 +1,9 @@ +// +// Created by mart on 4/12/20. +// + +#include "os.h" + +asm void OS_GetProcMode() { + +}
\ No newline at end of file diff --git a/include/nitro/os.h b/include/nitro/os.h new file mode 100644 index 00000000..c14b2891 --- /dev/null +++ b/include/nitro/os.h @@ -0,0 +1,10 @@ +// +// Created by mart on 4/12/20. +// + +#ifndef POKEDIAMOND_OS_H +#define POKEDIAMOND_OS_H + +#include "nitro/os_asm.h" + +#endif //POKEDIAMOND_OS_H diff --git a/include/nitro/os_asm.h b/include/nitro/os_asm.h new file mode 100644 index 00000000..775955f1 --- /dev/null +++ b/include/nitro/os_asm.h @@ -0,0 +1,12 @@ +// +// Created by mart on 4/12/20. +// + +#ifndef POKEDIAMOND_OS_ASM_H +#define POKEDIAMOND_OS_ASM_H + +#include "nitro/types.h" + +OSProcMode OS_GetProcMode(); + +#endif //POKEDIAMOND_OS_ASM_H diff --git a/include/nitro/os_asm.s b/include/nitro/os_asm.s new file mode 100644 index 00000000..86d7603c --- /dev/null +++ b/include/nitro/os_asm.s @@ -0,0 +1,7 @@ + +# TODO: make this syntax look correct in CLion +# Potentially switch to AT&T syntax? +OS_GetProcMode: + mrs r0, cpsr + and r0, r0, #0x80 + bx lr diff --git a/include/nitro/types.h b/include/nitro/types.h new file mode 100644 index 00000000..d702de23 --- /dev/null +++ b/include/nitro/types.h @@ -0,0 +1,50 @@ +#ifndef POKEDIAMOND_NITRO_TYPES_H +#define POKEDIAMOND_NITRO_TYPES_H + +typedef unsigned char u8; +typedef unsigned short int u16; +typedef unsigned long u32; + +typedef signed char s8; +typedef signed short int s16; +typedef signed long s32; + +typedef unsigned long long int u64; +typedef signed long long int s64; + +typedef volatile u8 vu8; +typedef volatile u16 vu16; +typedef volatile u32 vu32; +typedef volatile u64 vu64; + +typedef volatile s8 vs8; +typedef volatile s16 vs16; +typedef volatile s32 vs32; +typedef volatile s64 vs64; + +typedef float f32; +typedef volatile f32 vf32; + +typedef int BOOL; +#define TRUE 1 +#define FALSE 0 + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else // __cplusplus +#define NULL ((void *)0) +#endif // __cplusplus +#endif + +typedef enum { + OS_PROCMODE_USER=16, + OS_PROCMODE_FIQ=17, + OS_PROCMODE_IRQ=18, + OS_PROCMODE_SVC=19, + OS_PROCMODE_ABORT=23, + OS_PROCMODE_UNDEF=27, + OS_PROCMODE_SYS=31 +} OSProcMode; + +#endif //POKEDIAMOND_NITRO_TYPES_H |