summaryrefslogtreecommitdiff
path: root/include/gba/types.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/gba/types.h')
-rw-r--r--include/gba/types.h70
1 files changed, 70 insertions, 0 deletions
diff --git a/include/gba/types.h b/include/gba/types.h
new file mode 100644
index 000000000..4e1ab3003
--- /dev/null
+++ b/include/gba/types.h
@@ -0,0 +1,70 @@
+#ifndef GUARD_GBA_TYPES_H
+#define GUARD_GBA_TYPES_H
+
+typedef unsigned char u8;
+typedef unsigned short u16;
+typedef unsigned int u32;
+typedef signed char s8;
+typedef signed short s16;
+typedef signed int s32;
+
+typedef volatile u8 vu8;
+typedef volatile u16 vu16;
+typedef volatile u32 vu32;
+typedef volatile s8 vs8;
+typedef volatile s16 vs16;
+typedef volatile s32 vs32;
+
+typedef float f32;
+typedef double f64;
+
+typedef u8 bool8;
+typedef u16 bool16;
+typedef u32 bool32;
+
+struct OamData
+{
+ u32 y:8;
+ u32 affineMode:2;
+ u32 objMode:2;
+ u32 mosaic:1;
+ u32 bpp:1;
+ u32 shape:2;
+
+ u32 x:9;
+ u32 matrixNum:5; // bits 3/4 are h-flip/v-flip if not in affine mode
+ u32 size:2;
+
+ u16 tileNum:10;
+ u16 priority:2;
+ u16 paletteNum:4;
+ u16 affineParam;
+};
+
+#define ST_OAM_OBJ_NORMAL 0
+#define ST_OAM_OBJ_BLEND 1
+#define ST_OAM_OBJ_WINDOW 2
+
+#define ST_OAM_AFFINE_OFF 0
+#define ST_OAM_AFFINE_NORMAL 1
+#define ST_OAM_AFFINE_ERASE 2
+#define ST_OAM_AFFINE_DOUBLE 3
+
+#define ST_OAM_AFFINE_ON_MASK 1
+#define ST_OAM_AFFINE_DOUBLE_MASK 2
+
+#define ST_OAM_4BPP 0
+#define ST_OAM_8BPP 1
+
+#define ST_OAM_SQUARE 0
+#define ST_OAM_H_RECTANGLE 1
+#define ST_OAM_V_RECTANGLE 2
+
+struct ObjAffineSrcData
+{
+ s16 xScale;
+ s16 yScale;
+ u16 rotation;
+};
+
+#endif // GUARD_GBA_TYPES_H