33#define DMA_QUEUE_SIZE_DEFAULT 80
34#define DMA_QUEUE_SIZE_MIN 32
36#define DMA_TRANSFER_CAPACITY_NTSC 7200
37#define DMA_TRANSFER_CAPACITY_PAL_LOW 8000
38#define DMA_TRANSFER_CAPACITY_PAL_MAX 15000
41#define DMA_BUFFER_SIZE_NTSC 8192
42#define DMA_BUFFER_SIZE_PAL_LOW 8192
43#define DMA_BUFFER_SIZE_PAL_MAX (14 * 1024)
44#define DMA_BUFFER_SIZE_MIN (2 * 1024)
83extern u16* dmaDataBuffer;
Basic SGDK library configuration file.
bool DMA_canQueue(u8 location, u16 len)
Return TRUE if we have enough DMA capacity to transfer the given data block len (see DMA_setMaxTransf...
Definition dma.c:374
bool DMA_queueDma(u8 location, void *from, u16 to, u16 len, u16 step)
Queues the specified DMA transfer operation in the DMA queue. The idea of the DMA queue is to burst ...
Definition dma.c:432
void DMA_setBufferSizeToDefault(void)
Sets the size (in bytes) of the temporary data buffer to default value (8 KB on NTSC system and 14 KB...
Definition dma.c:167
void * DMA_allocateAndQueueDma(u8 location, u16 to, u16 len, u16 step)
Allocate temporary memory and queues the DMA transfer operation in the DMA queue. The idea of the DM...
Definition dma.c:382
void DMA_waitCompletion(void)
Wait current DMA fill/copy operation to complete (same as VDP_waitDMACompletion())
Definition dma.c:779
void DMA_flushQueue(void)
Transfer the content of the DMA queue to the VDP: Each pending DMA operation is sent to the VDP and ...
Definition dma.c:194
void DMA_doDma(u8 location, void *from, u16 to, u16 len, s16 step)
Do DMA transfer operation immediately.
Definition dma.c:545
void DMA_setMaxTransferSize(u16 value)
Sets the maximum amount of data (in bytes) to transfer per DMA_flushQueue() call. VBlank period allo...
Definition dma.c:135
bool DMA_getIgnoreOverCapacity(void)
Return TRUE means that we ignore future DMA operation when we reach the maximum capacity (see DMA_set...
Definition dma.c:172
void DMA_initEx(u16 size, u16 capacity, u16 bufferSize)
Initialize the DMA queue sub system.
Definition dma.c:52
void DMA_setIgnoreOverCapacity(bool value)
Set the "over capacity" DMA queue strategy (default is FALSE).
Definition dma.c:177
void DMA_clearQueue(void)
Clears the DMA queue (all queued operations are lost).
Definition dma.c:183
void DMA_setMaxTransferSizeToDefault(void)
Sets the maximum amount of data (in bytes) to default value (7.2 KB on NTSC system and 15 KB on PAL s...
Definition dma.c:141
void DMA_setMaxQueueSizeToDefault(void)
Sets the maximum allowed number of pending transfer in the queue (allocated queue size) to default va...
Definition dma.c:125
void DMA_doDmaFast(u8 location, void *from, u16 to, u16 len, s16 step)
Same as DMA_doDma(..) method except if doesn't check for 128 KB bank crossing on source.
Definition dma.c:566
u16 DMA_getMaxTransferSize(void)
Returns the maximum allowed size (in bytes) to transfer per DMA_flushQueue() call....
Definition dma.c:130
bool DMA_queueDmaFast(u8 location, void *from, u16 to, u16 len, u16 step)
Same as DMA_queueDma(..) method except if doesn't check for 128 KB bank crossing on source.
Definition dma.c:454
u16 DMA_getBufferSize(void)
Returns the size (in bytes) of the temporary data buffer which can be used to store data that will be...
Definition dma.c:146
void DMA_setMaxQueueSize(u16 value)
Sets the maximum allowed number of pending transfer in the queue (allocated queue size)....
Definition dma.c:112
TransferMethod
VRAM transfer method.
Definition dma.h:52
@ DMA_QUEUE
Definition dma.h:55
@ DMA_QUEUE_COPY
Definition dma.h:56
bool DMA_transfer(TransferMethod tm, u8 location, void *from, u16 to, u16 len, u16 step)
General method to transfer data to VDP memory.
Definition dma.c:322
void DMA_doVRamFill(u16 to, u16 len, u8 value, s16 step)
Do VRAM DMA fill operation.
Definition dma.c:704
void DMA_doVRamCopy(u16 from, u16 to, u16 len, s16 step)
Do VRAM DMA copy operation.
Definition dma.c:753
void DMA_init(void)
Initialize the DMA queue sub system with default settings.
Definition dma.c:47
u16 DMA_getMaxQueueSize(void)
Returns the maximum allowed number of pending transfer in the queue (allocated queue size).
Definition dma.c:107
void * DMA_allocateTemp(u16 len)
Tool method allowing to allocate memory from the DMA temporary buffer if you need a very temporary bu...
Definition dma.c:346
void DMA_doCPUCopyDirect(u32 cmd, void *from, u16 len, s16 step)
Do software (CPU) copy to VDP memory (mainly for testing purpose as it's slower than using DMA)
Definition dma.c:663
void DMA_releaseTemp(u16 len)
Tool method allowing to release memory previously allocated using DMA_allocateTemp(....
Definition dma.c:368
bool DMA_copyAndQueueDma(u8 location, void *from, u16 to, u16 len, u16 step)
Same as DMA_queueDma(..) method except that it first copies the data to transfer through DMA queue in...
Definition dma.c:406
bool DMA_getAutoFlush(void)
Returns TRUE if the DMA_flushQueue() method is automatically called at VBlank to process DMA operatio...
Definition dma.c:88
void DMA_setAutoFlush(bool value)
If set to TRUE (default) then the DMA_flushQueue() method is automatically called at VBlank to proces...
Definition dma.c:93
u16 DMA_getQueueTransferSize(void)
Returns the size (in byte) of data to be transferred currently present in the DMA queue....
Definition dma.c:317
void DMA_setBufferSize(u16 value)
Sets the size (in bytes) of the temporary data buffer which can be used to store data that will be tr...
Definition dma.c:151
u16 DMA_getQueueSize(void)
Returns the number of transfer currently pending in the DMA queue.
Definition dma.c:312
void DMA_doCPUCopy(u8 location, void *from, u16 to, u16 len, s16 step)
Do software (CPU) copy to VDP memory (mainly for testing purpose as it's slower than using DMA)
Definition dma.c:640
DMA transfer definition (used for DMA queue)
Definition dma.h:65
unsigned long u32
Definition types.h:105
short s16
Definition types.h:84
unsigned short u16
Definition types.h:100
unsigned char u8
Definition types.h:95