#include "sgl.h"
void * src_A;
void * dest_A;
Uint32 size;
void slDMACopy (src_A, dest_A, size);
void * src_A --Address with original data.
void * dest_A --Forwarding address.
Uint32 size-The size (in bytes) to transfer.
void --Nothing is returned.
Block transfer is performed using the DMA built into the CPU.
slDMACopy (high_ram, vdp2, size);
This function terminates immediately after invoking DMA, so use the "slDMAWait " function if you want to know that the transfer is complete.
slDMAWait |
#include "sgl.h"
void * src_A;
void * dest_A;
Uint32 size;
Uint16 mode;
void slDMAXCopy (src_A, dest_A, size, mode);
void * src_A --Address with original data.
void * dest_A --Forwarding address.
Uint32 size-The size to transfer (in transfer size units).
Uint16 mode --Transfer mode (see below).
void --Nothing is returned.
Block transfer is performed using the DMA built into the CPU.
The argument is the same as slDMACopy above, but mode is specified as follows.
mode: mode:
In the format SourceMode_DestinationMode_Size
SourceMode:
Sinc: Transfer while increasing the transfer source address.
Sdec: Transfer while reducing the transfer source address.
Sfix: Transfers with a fixed transfer source address.
DestinationMode:
Dinc: Transfer while increasing the transfer destination address.
Ddec: Forwards while reducing the forwarding address.
Dfix: The forwarding address is fixed and forwarded.
Size: Size:
Byte: Transfers byte by byte.
Word: Transfer every 2 bytes.
Long: Transfer every 4 bytes.
Fill an area with 0s.
Uint32 dest = 0;
slDMAXCopy (src, & dest, size, Sfix_Dinc_Long );
If you specify subtraction, the address change is performed after each transfer unit.
Please note that the forwarding is performed first, the address is reduced, and the next forwarding is performed.
slDMACopy | slDMAWait | DMASt_CPU0 |
#include "sgl.h"
void slDMAWait ();
void --Do not pass anything.
void --Nothing is returned.
Wait for the end of DMA started by slDMACopy and slDMAXCopy.
slDMACopy (src0, dst0, cnt0); / * First transfer request * /
slDMACopy (src1, dst1, cnt1); / * Second transfer request * /
/ * (Executed after the first one) * /
slDMACopy (src2, dst2, cnt2); / * Third transfer request (same as above) * /
slDMAWait (); / * Waiting for the end of the third transfer * /
slDMACopy and slDMAXCopy always use the same channel, and if it is running, it waits for the end of the transfer and starts a new transfer, so it can be executed continuously.
slDMACopy | slDMAXCopy |
#include "sgl.h"
Bool slDMAStatus ();
void --Do not pass anything.
void --Nothing is returned.
Checks whether the above slDMACopy and slDMAXCopy are running and returns the status.
Returns ON if it is in operation and OFF if it is finished.
slDMACopy (src, dest, size);
if ( slDMAStatus () == ON ) {
::
} else {
::
}
slDMACopy | slDMAXCopy | slDMAWait |
#include "sgl.h"
void slCashPurge ();
void --Do not pass anything.
void --Nothing is returned.
Clears the CPU's built-in cache. It is used when the cache area is changed due to DMA transfer, etc.
* ( Uint32 *) (0x26020000) = 0x25e09990;
::
slCashPurge ();
test = * ( Uint32 *) (0x6020000);
With slDMACopy and slDMAXCopy , the cache is cleared when the transfer destination is the cache area.
Also, when viewing the memory of the master CPU from the slave CPU, the slave CPU
^^^^^^^^^^^^^
Be sure to run this function before you see it.
slSynch |