diff options
author | PikalaxALT <pikalaxalt@gmail.com> | 2017-12-23 13:33:42 -0500 |
---|---|---|
committer | PikalaxALT <pikalaxalt@gmail.com> | 2017-12-23 13:33:42 -0500 |
commit | 3ea9cff2c67b3db195c3326afc56fa0662c2327a (patch) | |
tree | b5439c760be451055f0de03f3319a72768a1e8b5 /include/gba/macro.h | |
parent | 26fcc566a4da9287ab4d3795aaadde2a9f4a2947 (diff) | |
parent | aa13f45ebb79aed62171fbfe654d8b542fc9aa6c (diff) |
Merge branch 'master' into unk_text_8095904
Diffstat (limited to 'include/gba/macro.h')
-rw-r--r-- | include/gba/macro.h | 31 |
1 files changed, 17 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; \ |