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 /include/dma3.h | |
parent | 2880cf2a51ea36fa36f00d9ecf07177e5955c882 (diff) | |
parent | 7a562d6bae78fd7c62ed2f804fd8dcc555d85d18 (diff) |
Merge pull request #321 from PikalaxALT/modern_gcc
Get pokefirered_modern to build
Diffstat (limited to 'include/dma3.h')
-rw-r--r-- | include/dma3.h | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/include/dma3.h b/include/dma3.h index 381e1e322..266fa0716 100644 --- a/include/dma3.h +++ b/include/dma3.h @@ -6,6 +6,14 @@ // Maximum amount of data we will transfer in one operation #define MAX_DMA_BLOCK_SIZE 0x1000 +#define DMA_REQUEST_COPY32 1 +#define DMA_REQUEST_FILL32 2 +#define DMA_REQUEST_COPY16 3 +#define DMA_REQUEST_FILL16 4 + +#define DMA3_16BIT 0 +#define DMA3_32BIT 1 + #define Dma3CopyLarge_(src, dest, size, bit) \ { \ const void *_src = src; \ @@ -48,10 +56,26 @@ #define Dma3FillLarge16_(value, dest, size) Dma3FillLarge_(value, dest, size, 16) #define Dma3FillLarge32_(value, dest, size) Dma3FillLarge_(value, dest, size, 32) +// Cancel pending DMA3 requests void ClearDma3Requests(void); + +// Handle pending DMA3 requests void ProcessDma3Requests(void); + +// Copy size bytes from src to dest. +// mode takes a DMA3_*BIT macro +// Returns the request index s16 RequestDma3Copy(const void *src, void *dest, u16 size, u8 mode); + +// Fill size bytes at dest with value. +// mode takes a DMA3_*BIT macro +// Returns the request index s16 RequestDma3Fill(s32 value, void *dest, u16 size, u8 mode); -s16 CheckForSpaceForDma3Request(s16 index); + +// index is the return value from RequestDma3* +// if index = -1, will check if any request is pending +// otherwise, checks if the specified request is pending +// Returns -1 if pending, 0 otherwise +s16 WaitDma3Request(s16 index); #endif // GUARD_DMA3_H |