Dmae.rpl

From WiiUBrew
Revision as of 03:19, 31 October 2017 by QuarkTheAwesome (talk | contribs) (Page Redo - clear out SDK stuff; use Decaf as source instead)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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

Functions

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

Timing

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.

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.

Enums

Name Definition
DMAEEndianSwapMode
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)