diff options
author | Revo <projectrevotpp@hotmail.com> | 2020-06-05 16:03:15 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-05 16:03:15 -0400 |
commit | cae6ef601c8d2892c078eb77327e4552f3c8bf64 (patch) | |
tree | 081eda1af00d591ff2789ec3f5343d01870d6079 /arm9/lib/include | |
parent | 9595aa2bee8b1c87342cf20cff10c2675aa1006f (diff) | |
parent | ed295dc6089bdf4825233b63e432fb194240b98a (diff) |
Merge pull request #140 from red031000/master
shared headers
Diffstat (limited to 'arm9/lib/include')
34 files changed, 40 insertions, 152 deletions
diff --git a/arm9/lib/include/CARD_backup.h b/arm9/lib/include/CARD_backup.h index de594beb..d2cbc231 100644 --- a/arm9/lib/include/CARD_backup.h +++ b/arm9/lib/include/CARD_backup.h @@ -1,6 +1,8 @@ #ifndef NITRO_CARD_BACKUP_H_ #define NITRO_CARD_BACKUP_H_ +#include "nitro/types.h" + BOOL CARD_TryWaitBackupAsync(void); #endif //NITRO_CARD_BACKUP_H_ diff --git a/arm9/lib/include/CARD_pullOut.h b/arm9/lib/include/CARD_pullOut.h index 4a64f5ae..be49b95d 100644 --- a/arm9/lib/include/CARD_pullOut.h +++ b/arm9/lib/include/CARD_pullOut.h @@ -1,6 +1,8 @@ #ifndef NITRO_CARD_PULLOUT_H_ #define NITRO_CARD_PULLOUT_H_ +#include "nitro/types.h" + BOOL CARD_IsPulledOut(void); #endif //NITRO_CARD_PULLOUT_H_ diff --git a/arm9/lib/include/CARD_rom.h b/arm9/lib/include/CARD_rom.h index 4c2e9dd5..3d7bbb77 100644 --- a/arm9/lib/include/CARD_rom.h +++ b/arm9/lib/include/CARD_rom.h @@ -1,6 +1,7 @@ #ifndef NITRO_CARD_ROM_H_ #define NITRO_CARD_ROM_H_ +#include "nitro/types.h" #include "MI_exMemory.h" #include "MI_dma.h" diff --git a/arm9/lib/include/CP_context.h b/arm9/lib/include/CP_context.h index cfed9735..4a925257 100644 --- a/arm9/lib/include/CP_context.h +++ b/arm9/lib/include/CP_context.h @@ -5,7 +5,7 @@ #ifndef POKEDIAMOND_CP_CONTEXT_H #define POKEDIAMOND_CP_CONTEXT_H -#include "types.h" +#include "nitro/types.h" typedef struct CPContext { u64 div_numer; diff --git a/arm9/lib/include/CTRDG_common.h b/arm9/lib/include/CTRDG_common.h index c83602b8..32049f3c 100644 --- a/arm9/lib/include/CTRDG_common.h +++ b/arm9/lib/include/CTRDG_common.h @@ -1,6 +1,8 @@ #ifndef NITRO_CTRDG_COMMON_H_ #define NITRO_CTRDG_COMMON_H_ +#include "nitro/types.h" + BOOL CTRDG_IsPulledOut(void); #endif //NITRO_CTRDG_COMMON_H_ diff --git a/arm9/lib/include/DGT_dgt.h b/arm9/lib/include/DGT_dgt.h index bc9cb47e..95c7c4e2 100644 --- a/arm9/lib/include/DGT_dgt.h +++ b/arm9/lib/include/DGT_dgt.h @@ -1,6 +1,8 @@ #ifndef NITRO_DGT_DGT_H_ #define NITRO_DGT_DGT_H_ +#include "nitro/types.h" + void DGT_Hash2CalcHmac(void* digest, void* bin_ptr, u32 bin_len, void* key_ptr, u32 keylen); #endif //NITRO_DGT_DGT_H_ diff --git a/arm9/lib/include/FS_command_default.h b/arm9/lib/include/FS_command_default.h index 1984aeb0..20e20f8f 100644 --- a/arm9/lib/include/FS_command_default.h +++ b/arm9/lib/include/FS_command_default.h @@ -1,7 +1,7 @@ #ifndef POKEDIAMOND_FS_COMMAND_DEFAULT_H #define POKEDIAMOND_FS_COMMAND_DEFAULT_H -#include "types.h" +#include "nitro/types.h" #include "FS_archive.h" typedef struct diff --git a/arm9/lib/include/FS_rom.h b/arm9/lib/include/FS_rom.h index a98c8a9c..bd0cd73b 100644 --- a/arm9/lib/include/FS_rom.h +++ b/arm9/lib/include/FS_rom.h @@ -4,7 +4,7 @@ #include "FS_archive.h" #include "FS_file.h" #include "CARD_rom.h" -#include "types.h" +#include "nitro/types.h" extern FSArchive fsi_arc_rom; extern s32 fsi_card_lock_id; diff --git a/arm9/lib/include/MATH_crc.h b/arm9/lib/include/MATH_crc.h index 800b738b..f15a2e32 100644 --- a/arm9/lib/include/MATH_crc.h +++ b/arm9/lib/include/MATH_crc.h @@ -1,7 +1,7 @@ #ifndef GUARD_MATH_CRC_H #define GUARD_MATH_CRC_H -#include "types.h" +#include "nitro/types.h" typedef u8 MATHCRC8Context; typedef u16 MATHCRC16Context; diff --git a/arm9/lib/include/MATH_dgt.h b/arm9/lib/include/MATH_dgt.h index 9eb3d2ef..140b4f98 100644 --- a/arm9/lib/include/MATH_dgt.h +++ b/arm9/lib/include/MATH_dgt.h @@ -2,7 +2,7 @@ #define GUARD_MATH_DGT_H #include "dgt.h" -#include "types.h" +#include "nitro/types.h" typedef struct DGTHash1Context MATHMD5Context; typedef struct DGTHash2Context MATHSHA1Context; diff --git a/arm9/lib/include/MATH_pop.h b/arm9/lib/include/MATH_pop.h index 89dab0c0..29a42b22 100644 --- a/arm9/lib/include/MATH_pop.h +++ b/arm9/lib/include/MATH_pop.h @@ -1,7 +1,7 @@ #ifndef GUARD_MATH_POP_H #define GUARD_MATH_POP_H -#include "types.h" +#include "nitro/types.h" u8 MATH_CountPopulation(u32); diff --git a/arm9/lib/include/MB_mb.h b/arm9/lib/include/MB_mb.h index 128ea480..5bccaf8b 100644 --- a/arm9/lib/include/MB_mb.h +++ b/arm9/lib/include/MB_mb.h @@ -1,7 +1,3 @@ -// -// Created by red031000 on 2020-05-06. -// - #ifndef POKEDIAMOND_MB_MB_H #define POKEDIAMOND_MB_MB_H diff --git a/arm9/lib/include/OS_alarm.h b/arm9/lib/include/OS_alarm.h index 6971248a..d6b0c210 100644 --- a/arm9/lib/include/OS_alarm.h +++ b/arm9/lib/include/OS_alarm.h @@ -1,11 +1,7 @@ -// -// Created by red031000 on 2020-05-17. -// - #ifndef POKEDIAMOND_OS_ALARM_H #define POKEDIAMOND_OS_ALARM_H -#include "types.h" +#include "nitro/types.h" #include "OS_thread.h" typedef void (*OSAlarmHandler) (void *); diff --git a/arm9/lib/include/OS_alloc.h b/arm9/lib/include/OS_alloc.h index 74b7b0e5..5ee95395 100644 --- a/arm9/lib/include/OS_alloc.h +++ b/arm9/lib/include/OS_alloc.h @@ -1,11 +1,7 @@ -// -// Created by mart on 4/23/20. -// - #ifndef POKEDIAMOND_OS_ALLOC_H #define POKEDIAMOND_OS_ALLOC_H -#include "types.h" +#include "nitro/types.h" #include "OS_arena.h" typedef int OSHeapHandle; diff --git a/arm9/lib/include/OS_arena.h b/arm9/lib/include/OS_arena.h index 8cfef81d..7608835a 100644 --- a/arm9/lib/include/OS_arena.h +++ b/arm9/lib/include/OS_arena.h @@ -1,11 +1,7 @@ -// -// Created by red031000 on 2020-04-27. -// - #ifndef POKEDIAMOND_OS_ARENA_H #define POKEDIAMOND_OS_ARENA_H -#include "types.h" +#include "nitro/types.h" typedef enum { OS_ARENA_MAIN = 0, diff --git a/arm9/lib/include/OS_context.h b/arm9/lib/include/OS_context.h index c0ab62f1..cded1acb 100644 --- a/arm9/lib/include/OS_context.h +++ b/arm9/lib/include/OS_context.h @@ -1,11 +1,7 @@ -// -// Created by red031000 on 2020-05-17. -// - #ifndef POKEDIAMOND_OS_CONTEXT_H #define POKEDIAMOND_OS_CONTEXT_H -#include "types.h" +#include "nitro/types.h" #include "CP_context.h" typedef struct OSContext diff --git a/arm9/lib/include/OS_init.h b/arm9/lib/include/OS_init.h index 6792c900..baa2f442 100644 --- a/arm9/lib/include/OS_init.h +++ b/arm9/lib/include/OS_init.h @@ -1,7 +1,7 @@ #ifndef POKEDIAMOND_ARM9_OS_INIT_H #define POKEDIAMOND_ARM9_OS_INIT_H -#include "types.h" +#include "nitro/types.h" #include "consts.h" #include "OS_tcm.h" #include "OS_spinLock.h" diff --git a/arm9/lib/include/OS_interrupt.h b/arm9/lib/include/OS_interrupt.h index cbdc225f..6ffa3a10 100644 --- a/arm9/lib/include/OS_interrupt.h +++ b/arm9/lib/include/OS_interrupt.h @@ -1,11 +1,7 @@ -// -// Created by red031000 on 2020-05-07. -// - #ifndef POKEDIAMOND_OS_INTERRUPT_H #define POKEDIAMOND_OS_INTERRUPT_H -#include "types.h" +#include "nitro/types.h" typedef void (*OSIrqFunction) (void); diff --git a/arm9/lib/include/OS_mutex.h b/arm9/lib/include/OS_mutex.h index 5db66fbe..a2cdff23 100644 --- a/arm9/lib/include/OS_mutex.h +++ b/arm9/lib/include/OS_mutex.h @@ -1,11 +1,7 @@ -// -// Created by red031000 on 2020-05-17. -// - #ifndef POKEDIAMOND_OS_MUTEX_H #define POKEDIAMOND_OS_MUTEX_H -#include "types.h" +#include "nitro/types.h" #include "OS_thread.h" struct OSMutex { diff --git a/arm9/lib/include/OS_printf.h b/arm9/lib/include/OS_printf.h index 7c2e09b4..acb7f8c7 100644 --- a/arm9/lib/include/OS_printf.h +++ b/arm9/lib/include/OS_printf.h @@ -5,7 +5,7 @@ #define OS_TPanic(...) OS_Terminate() #define OS_TWarning(...) ((void)0) -#include "types.h" +#include "nitro/types.h" s32 OS_SPrintf(s8 *buffer, const s8 *format, ...); s32 OS_VSPrintf(s8 *buffer, const s8 *format, void *args); diff --git a/arm9/lib/include/OS_protectionRegion.h b/arm9/lib/include/OS_protectionRegion.h index 8e25420a..9b65258d 100644 --- a/arm9/lib/include/OS_protectionRegion.h +++ b/arm9/lib/include/OS_protectionRegion.h @@ -1,11 +1,7 @@ -// -// Created by red031000 on 2020-04-24. -// - #ifndef POKEDIAMOND_OS_PROTECTIONREGION_H #define POKEDIAMOND_OS_PROTECTIONREGION_H -#include "types.h" +#include "nitro/types.h" #include "consts.h" void OS_SetDPermissionsForProtectionRegion(register u32 setMask, register u32 flags); diff --git a/arm9/lib/include/OS_spinLock.h b/arm9/lib/include/OS_spinLock.h index eccc502b..5dc47522 100644 --- a/arm9/lib/include/OS_spinLock.h +++ b/arm9/lib/include/OS_spinLock.h @@ -1,11 +1,7 @@ -// -// Created by red031000 on 2020-05-03. -// - #ifndef POKEDIAMOND_OS_SPINLOCK_H #define POKEDIAMOND_OS_SPINLOCK_H -#include "types.h" +#include "nitro/types.h" #include "syscall.h" typedef volatile struct OSLockWord { diff --git a/arm9/lib/include/OS_system.h b/arm9/lib/include/OS_system.h index a5426c17..37dbbd76 100644 --- a/arm9/lib/include/OS_system.h +++ b/arm9/lib/include/OS_system.h @@ -3,24 +3,7 @@ #include "function_target.h" #include "consts.h" - -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; - -ENUMS_ALWAYS_INT_ON -typedef enum { - OS_INTRMODE_DISABLE_IRQ = HW_PSR_DISABLE_IRQ, - OS_INTRMODE_DISABLE_FIQ = HW_PSR_DISABLE_FIQ, - OS_INTRMODE_ENABLE = 0 -} OSIntrMode; -ENUMS_ALWAYS_INT_RESET +#include "nitro/OS_system_shared.h" OSIntrMode OS_EnableInterrupts(void); OSIntrMode OS_DisableInterrupts(void); diff --git a/arm9/lib/include/OS_terminate_proc.h b/arm9/lib/include/OS_terminate_proc.h index d1abe3ad..1d3ac27e 100644 --- a/arm9/lib/include/OS_terminate_proc.h +++ b/arm9/lib/include/OS_terminate_proc.h @@ -5,6 +5,8 @@ #ifndef POKEDIAMOND_OS_TERMINATE_PROC_H #define POKEDIAMOND_OS_TERMINATE_PROC_H +#include "nitro/types.h" + void OS_Terminate(void); void OS_Halt(void); diff --git a/arm9/lib/include/OS_thread.h b/arm9/lib/include/OS_thread.h index bbdb33c9..bf62e66b 100644 --- a/arm9/lib/include/OS_thread.h +++ b/arm9/lib/include/OS_thread.h @@ -1,11 +1,7 @@ -// -// Created by red031000 on 2020-05-03. -// - #ifndef POKEDIAMOND_OS_THREAD_H #define POKEDIAMOND_OS_THREAD_H -#include "types.h" +#include "nitro/types.h" #include "OS_context.h" typedef struct OSiAlarm OSAlarm; diff --git a/arm9/lib/include/OS_tick.h b/arm9/lib/include/OS_tick.h index fbb8ce9e..fb4ce7e6 100644 --- a/arm9/lib/include/OS_tick.h +++ b/arm9/lib/include/OS_tick.h @@ -1,11 +1,7 @@ -// -// Created by red031000 on 2020-05-17. -// - #ifndef POKEDIAMOND_OS_TICK_H #define POKEDIAMOND_OS_TICK_H -#include "types.h" +#include "nitro/types.h" typedef u64 OSTick; diff --git a/arm9/lib/include/consts.h b/arm9/lib/include/consts.h index b99b4148..6c83bce8 100644 --- a/arm9/lib/include/consts.h +++ b/arm9/lib/include/consts.h @@ -1,19 +1,10 @@ -// -// Created by mart on 4/15/20. -// - -#ifndef POKEDIAMOND_CONSTS_H -#define POKEDIAMOND_CONSTS_H +#ifndef POKEDIAMOND_ARM9_CONSTS_H +#define POKEDIAMOND_ARM9_CONSTS_H +#include "nitro/consts_shared.h" #include "mmap.h" #include "registers.h" -#define HW_PSR_CPU_MODE_MASK 0x1f // CPU mode - -#define HW_PSR_DISABLE_FIQ 0x40 // Disable FIQ -#define HW_PSR_DISABLE_IRQ 0x80 // Disable IRQ -#define HW_PSR_DISABLE_IRQ_FIQ 0xc0 // Disable FIQ and IRQ - #define HW_C6_PR_4KB 0x16 #define HW_C6_PR_8KB 0x18 #define HW_C6_PR_16KB 0x1a @@ -53,4 +44,4 @@ #define OS_IE_V_BLANK (1UL << 0) -#endif //POKEDIAMOND_CONSTS_H +#endif //POKEDIAMOND_ARM9_CONSTS_H diff --git a/arm9/lib/include/custom_allocator.h b/arm9/lib/include/custom_allocator.h index 828566f7..0a42ae13 100644 --- a/arm9/lib/include/custom_allocator.h +++ b/arm9/lib/include/custom_allocator.h @@ -1,7 +1,7 @@ #ifndef POKEDIAMOND_CUSTOM_ALLOCATOR_H #define POKEDIAMOND_CUSTOM_ALLOCATOR_H -#include "types.h" +#include "nitro/types.h" typedef void * (* AllocFunc)(u32 size); typedef void (* FreeFunc)(void * ptr); diff --git a/arm9/lib/include/dgt.h b/arm9/lib/include/dgt.h index a764e85a..97916f1b 100644 --- a/arm9/lib/include/dgt.h +++ b/arm9/lib/include/dgt.h @@ -1,7 +1,7 @@ #ifndef GUARD_DGT_H #define GUARD_DGT_H -#include "types.h" +#include "nitro/types.h" struct DGTHash1Context { union { diff --git a/arm9/lib/include/gx.h b/arm9/lib/include/gx.h index 79b707fc..f1c9fa50 100644 --- a/arm9/lib/include/gx.h +++ b/arm9/lib/include/gx.h @@ -3,6 +3,7 @@ #include "fx.h" #include "MI_memory.h" +#include "MI_dma.h" //temporary while other files aren't decompiled diff --git a/arm9/lib/include/mmap.h b/arm9/lib/include/mmap.h index c43e65b6..8f9d8dcd 100644 --- a/arm9/lib/include/mmap.h +++ b/arm9/lib/include/mmap.h @@ -1,7 +1,7 @@ #ifndef NITRO_MMAP_H #define NITRO_MMAP_H -#include "types.h" +#include "nitro/types.h" extern u32 SDK_AUTOLOAD_DTCM_START[]; diff --git a/arm9/lib/include/nitro.h b/arm9/lib/include/nitro.h index 9eeab198..ea7503cc 100644 --- a/arm9/lib/include/nitro.h +++ b/arm9/lib/include/nitro.h @@ -8,7 +8,7 @@ extern "C" { // Include all nitro files #include "sections.h" #include "misc.h" -#include "types.h" +#include "nitro/types.h" #include "consts.h" #include "OS_init.h" #include "mmap.h" diff --git a/arm9/lib/include/registers.h b/arm9/lib/include/registers.h index a1536eb8..4781ba1b 100644 --- a/arm9/lib/include/registers.h +++ b/arm9/lib/include/registers.h @@ -1,11 +1,7 @@ -// -// Created by red031000 on 2020-05-06. -// - #ifndef POKEDIAMOND_REGISTERS_H #define POKEDIAMOND_REGISTERS_H -#include "types.h" +#include "nitro/types.h" #define reg_GX_DISPCNT (*(REGType32v *)0x4000000) #define reg_GX_DISPSTAT (*(REGType16v *)0x4000004) diff --git a/arm9/lib/include/types.h b/arm9/lib/include/types.h deleted file mode 100644 index ca11e244..00000000 --- a/arm9/lib/include/types.h +++ /dev/null @@ -1,50 +0,0 @@ -#ifndef POKEDIAMOND_ARM9_TYPES_H -#define POKEDIAMOND_ARM9_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 u8 REGType8; -typedef u16 REGType16; -typedef u32 REGType32; -typedef u64 REGType64; - -typedef vu8 REGType8v; -typedef vu16 REGType16v; -typedef vu32 REGType32v; -typedef vu64 REGType64v; - -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 - -#endif //POKEDIAMOND_ARM9_TYPES_H |