Difference between revisions of "Dmae.rpl"
Jump to navigation
Jump to search
m |
(Page Redo - clear out SDK stuff; use Decaf as source instead) |
||
Line 2: | Line 2: | ||
==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=== | ===Timing=== | ||
{| class="wikitable" | {| class="wikitable" | ||
− | |||
!Prototype | !Prototype | ||
!Description | !Description | ||
|- | |- | ||
− | + | |<syntaxhighlight lang="C" enclose="none">OSTime DMAEGetRetiredTimeStamp();</syntaxhighlight> | |
− | |< | + | | |
− | | | + | |- |
− | | | + | |<syntaxhighlight lang="C" enclose="none">OSTime DMAEGetLastSubmittedTimeStamp();</syntaxhighlight> |
− | + | |Returns the last timestamp submitted to the DMAE engine, as an OSTime. | |
− | + | |- | |
− | + | |<syntaxhighlight lang="C" enclose="none">bool DMAEWaitDone(OSTime timestamp);</syntaxhighlight> | |
− | + | |Wait until a given DMA operation is complete. | |
− | |||
|- | |- | ||
− | + | |<syntaxhighlight lang="C" enclose="none">void DMAESetTimeout(unsigned int timeout);</syntaxhighlight> | |
− | |< | + | |Set the timeout for DMA operations. |
− | | | ||
|- | |- | ||
− | + | |<syntaxhighlight lang="C" enclose="none">unsigned int DMAEGetTimeout();</syntaxhighlight> | |
− | |< | + | |Gets the current timeout for DMA operations. |
− | | | ||
|} | |} | ||
− | === | + | |
+ | ===Operations=== | ||
{| class="wikitable" | {| class="wikitable" | ||
− | |||
!Prototype | !Prototype | ||
!Description | !Description | ||
|- | |- | ||
− | + | |<syntaxhighlight lang="C" enclose="none">OSTime DMAECopyMem(void* dst, void* src, size_t numDwords, DMAEEndianSwapMode endian);</syntaxhighlight> | |
− | |< | + | |Uses DMA to copy memory from one location to another. Note ''numDwords'' - the size should be given as <code>bytes / 4</code>. |
− | | | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
− | + | |<syntaxhighlight lang="C" enclose="none">OSTime DMAEFillMem(void* dst, unsigned int value, size_t numDwords);</syntaxhighlight> | |
− | |< | + | |Uses DMA to fill memory with a given value. Again, note ''numDwords''. |
− | | | ||
|} | |} | ||
− | == | + | ==Enums== |
− | |||
− | |||
{| class="wikitable" | {| class="wikitable" | ||
!Name | !Name | ||
− | ! | + | !Definition |
− | |||
|- | |- | ||
− | | | + | |DMAEEndianSwapMode |
− | | | + | |<syntaxhighlight lang="C"> |
− | <syntaxhighlight lang="C"> | + | typedef enum DMAEEndianSwapMode { |
− | typedef enum | + | NONE = 0, |
− | + | SWAP_8_IN_16 = 1, | |
− | + | SWAP_8_IN_32 = 2, | |
− | } | + | } DMAEEndianSwapMode; |
</syntaxhighlight> | </syntaxhighlight> | ||
|} | |} | ||
− | |||
− | + | ==See Also== | |
− | + | [https://github.com/decaf-emu/decaf-emu/blob/master/src/libdecaf/src/modules/dmae/dmae_core.cpp Decaf's implementation of the DMAE lib] (source for this page) | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− |
Latest revision as of 03:19, 31 October 2017
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)