From WiiUBrew
Jump to navigation Jump to search

dmae.rpl is the system library that provides DMA (Direct Memory Access) functions.


In the context of the DMAE library; timestamps (as OSTimes) are used to identify operations. They can be used with DMAEWaitDone for synchronisation.


Prototype Description
OSTime DMAEGetRetiredTimeStamp();
OSTime DMAEGetLastSubmittedTimeStamp(); Returns the last timestamp submitted to the DMAE engine, as an OSTime.
bool DMAEWaitDone(OSTime timestamp); Wait until a given DMA operation is complete.
void DMAESetTimeout(unsigned int timeout); Set the timeout for DMA operations.
unsigned int DMAEGetTimeout(); Gets the current timeout for DMA operations.


Prototype Description
OSTime DMAECopyMem(void* dst, void* src, size_t numDwords, DMAEEndianSwapMode endian); Uses DMA to copy memory from one location to another. Note numDwords - the size should be given as bytes / 4.
OSTime DMAEFillMem(void* dst, unsigned int value, size_t numDwords); Uses DMA to fill memory with a given value. Again, note numDwords.


Name Definition
typedef enum DMAEEndianSwapMode {
    NONE = 0,
    SWAP_8_IN_16 = 1,
    SWAP_8_IN_32 = 2,
} DMAEEndianSwapMode;

See Also

Decaf's implementation of the DMAE lib (source for this page)