From 0c7265cf0de9d4ec95d28c5e103c00a63f4a1697 Mon Sep 17 00:00:00 2001 From: Bad Diode Date: Tue, 18 May 2021 16:40:24 +0200 Subject: Proof of concept of UXN on the GBA --- src/shorthand.h | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 src/shorthand.h (limited to 'src/shorthand.h') diff --git a/src/shorthand.h b/src/shorthand.h new file mode 100644 index 0000000..42eb935 --- /dev/null +++ b/src/shorthand.h @@ -0,0 +1,36 @@ +#ifndef UTILS_SHORTHAND_H +#define UTILS_SHORTHAND_H + +#include +#include +#include +#include + +// +// This simple header just typedefs the basic C define types to a shorter name, +// loads the quality of life bool macro for _Bool and defines shorthand macros +// for byte sizes. + +typedef uint8_t u8; +typedef uint16_t u16; +typedef uint32_t u32; +typedef uint64_t u64; +typedef int8_t s8; +typedef int16_t s16; +typedef int32_t s32; +typedef int64_t 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; + +#define KB(N) ((u64)(N) * 1024) +#define MB(N) ((u64)KB(N) * 1024) +#define GB(N) ((u64)MB(N) * 1024) +#define TB(N) ((u64)GB(N) * 1024) + +#endif // UTILS_SHORTHAND_H -- cgit v1.2.1