diff options
author | PikalaxALT <pikalaxalt@gmail.com> | 2018-02-03 09:42:19 -0500 |
---|---|---|
committer | PikalaxALT <pikalaxalt@gmail.com> | 2018-02-03 09:42:19 -0500 |
commit | d52f52fa734b856361b04ea5d70877a6f265df0c (patch) | |
tree | 60444b7ba53b8e4c9030a694acb03c54e4144778 /include/gba | |
parent | d4e8c20f840996049f269ffcd22d7e3feb489696 (diff) | |
parent | eb6aed50e56f36ce416f7ecc8edfacea1da61bf1 (diff) |
Merge branch 'master' into link
Diffstat (limited to 'include/gba')
-rw-r--r-- | include/gba/defines.h | 5 | ||||
-rw-r--r-- | include/gba/macro.h | 21 |
2 files changed, 21 insertions, 5 deletions
diff --git a/include/gba/defines.h b/include/gba/defines.h index 41cc84f4a..5c07347ce 100644 --- a/include/gba/defines.h +++ b/include/gba/defines.h @@ -60,11 +60,6 @@ #define TOTAL_OBJ_TILE_COUNT 1024 -#define RGB(r, g, b) ((r) | ((g) << 5) | ((b) << 10)) - -#define RGB_BLACK RGB(0, 0, 0) -#define RGB_WHITE RGB(31, 31, 31) - #define WIN_RANGE(a, b) (((a) << 8) | (b)) #endif // GUARD_GBA_DEFINES diff --git a/include/gba/macro.h b/include/gba/macro.h index ad4820bcf..3b35a1946 100644 --- a/include/gba/macro.h +++ b/include/gba/macro.h @@ -122,6 +122,27 @@ #define DmaFillLarge32(dmaNum, value, dest, size, block) DmaFillLarge(dmaNum, value, dest, size, block, 32) +#define DmaClearLarge(dmaNum, dest, size, block, bit) \ +{ \ + 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 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; \ |