diff options
author | PikalaxALT <PikalaxALT@gmail.com> | 2020-04-10 15:57:08 -0400 |
---|---|---|
committer | PikalaxALT <PikalaxALT@gmail.com> | 2020-04-10 15:57:08 -0400 |
commit | a205881ce2caa89a1b2690df9bd335201df2aeda (patch) | |
tree | 8e0c2822030d5985475f86c4286ea923ac9bc71d /src/dma3_manager.c | |
parent | b22d3a821d8656d9fb88000ce02e5b885a59e1c3 (diff) |
Comment dma3 methods and create DMA3_*BIT macros
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; |