summaryrefslogtreecommitdiff
path: root/include/gba
diff options
context:
space:
mode:
Diffstat (limited to 'include/gba')
-rw-r--r--include/gba/macro.h31
-rw-r--r--include/gba/types.h11
2 files changed, 28 insertions, 14 deletions
diff --git a/include/gba/macro.h b/include/gba/macro.h
index a0edf2a49..d9e6739b3 100644
--- a/include/gba/macro.h
+++ b/include/gba/macro.h
@@ -104,25 +104,28 @@
}
#define DmaClearLarge(dmaNum, dest, size, block, bit) \
-{ \
- u32 _size = size; \
- while (1) \
- { \
- DmaFill##bit(dmaNum, 0, dest, (block)); \
- dest += (block); \
- _size -= (block); \
- if (_size <= (block)) \
- { \
- DmaFill##bit(dmaNum, 0, dest, _size); \
- break; \
- } \
- } \
+{ \
+ const void *_dest = dest; \
+ u32 _size = size; \
+ while (1) \
+ { \
+ DmaFill##bit(dmaNum, 0, _dest, (block)); \
+ _dest += (block); \
+ _size -= (block); \
+ if (_size <= (block)) \
+ { \
+ DmaFill##bit(dmaNum, 0, _dest, _size); \
+ break; \
+ } \
+ } \
}
#define DmaCopyLarge16(dmaNum, src, dest, size, block) DmaCopyLarge(dmaNum, src, dest, size, block, 16)
-
#define DmaCopyLarge32(dmaNum, src, dest, size, block) DmaCopyLarge(dmaNum, src, dest, size, block, 32)
+#define DmaClearLarge16(dmaNum, dest, size, block) DmaClearLarge(dmaNum, dest, size, block, 16)
+#define DmaClearLarge32(dmaNum, dest, size, block) DmaClearLarge(dmaNum, dest, size, block, 32)
+
#define DmaCopyDefvars(dmaNum, src, dest, size, bit) \
{ \
const void *_src = src; \
diff --git a/include/gba/types.h b/include/gba/types.h
index 480619d21..33ae7df9a 100644
--- a/include/gba/types.h
+++ b/include/gba/types.h
@@ -28,6 +28,17 @@ typedef u8 bool8;
typedef u16 bool16;
typedef u32 bool32;
+struct BgCnt
+{
+ u16 priority:2;
+ u16 charBaseBlock:2;
+ u16 dummy:4;
+ u16 screenBaseBlock:5;
+ u16 areaOverflowMode:1;
+ u16 screenSize:2;
+};
+typedef volatile struct BgCnt vBgCnt;
+
struct PlttData
{
u16 r:5; // red