diff options
author | PikalaxALT <PikalaxALT@users.noreply.github.com> | 2020-04-12 10:12:37 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-12 10:12:37 -0400 |
commit | 6001e107993d1da69decdf479abf8a661ad57dda (patch) | |
tree | 9a430f0b70e0a24965378724f1bd28cd1a193dc1 /src/dma3_manager.c | |
parent | 2880cf2a51ea36fa36f00d9ecf07177e5955c882 (diff) | |
parent | 7a562d6bae78fd7c62ed2f804fd8dcc555d85d18 (diff) |
Merge pull request #321 from PikalaxALT/modern_gcc
Get pokefirered_modern to build
Diffstat (limited to 'src/dma3_manager.c')
-rw-r--r-- | src/dma3_manager.c | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/src/dma3_manager.c b/src/dma3_manager.c index ec2cb932f..a3a2374be 100644 --- a/src/dma3_manager.c +++ b/src/dma3_manager.c @@ -3,12 +3,7 @@ #define MAX_DMA_REQUESTS 128 -#define DMA_REQUEST_COPY32 1 -#define DMA_REQUEST_FILL32 2 -#define DMA_REQUEST_COPY16 3 -#define DMA_REQUEST_FILL16 4 - -static /*IWRAM_DATA*/ struct { +static struct { /* 0x00 */ const u8 *src; /* 0x04 */ u8 *dest; /* 0x08 */ u16 size; @@ -26,7 +21,7 @@ void ClearDma3Requests(void) gDma3ManagerLocked = TRUE; gDma3RequestCursor = 0; - for(i = 0; i < (u8)ARRAY_COUNT(gDma3Requests); i++) + for(i = 0; i < (u8)NELEMS(gDma3Requests); i++) { gDma3Requests[i].size = 0; gDma3Requests[i].src = 0; @@ -108,10 +103,10 @@ s16 RequestDma3Copy(const void *src, void *dest, u16 size, u8 mode) gDma3Requests[cursor].dest = dest; gDma3Requests[cursor].size = size; - if(mode == 1) - gDma3Requests[cursor].mode = mode; + if(mode == DMA3_32BIT) + gDma3Requests[cursor].mode = DMA_REQUEST_COPY32; else - gDma3Requests[cursor].mode = 3; + gDma3Requests[cursor].mode = DMA_REQUEST_COPY16; gDma3ManagerLocked = FALSE; return (s16)cursor; @@ -146,10 +141,10 @@ s16 RequestDma3Fill(s32 value, void *dest, u16 size, u8 mode) gDma3Requests[cursor].mode = mode; gDma3Requests[cursor].value = value; - if(mode == 1) - gDma3Requests[cursor].mode = 2; + if(mode == DMA3_32BIT) + gDma3Requests[cursor].mode = DMA_REQUEST_FILL32; else - gDma3Requests[cursor].mode = 4; + gDma3Requests[cursor].mode = DMA_REQUEST_FILL16; gDma3ManagerLocked = FALSE; return (s16)cursor; @@ -167,7 +162,7 @@ s16 RequestDma3Fill(s32 value, void *dest, u16 size, u8 mode) return -1; } -s16 CheckForSpaceForDma3Request(s16 index) +s16 WaitDma3Request(s16 index) { int current = 0; |