ListReference

function

slDMACopy


Memory transfer using DMA

Form

    #include "sgl.h"

    void * src_A;
    void * dest_A;
    Uint32 size;

    void slDMACopy (src_A, dest_A, size);

argument

    void * src_A --Address with original data.
void * dest_A --Forwarding address.
Uint32 size-The size (in bytes) to transfer.

Number of returns

    void --Nothing is returned.

function

    Block transfer is performed using the DMA built into the CPU.

Example

    slDMACopy (high_ram, vdp2, size);

caution


    This function terminates immediately after invoking DMA, so use the "slDMAWait " function if you want to know that the transfer is complete.

reference

 slDMAWait 



ListReference

function

slDMAXCopy


Memory transfer using DMA

Form

    #include "sgl.h"

    void * src_A;
    void * dest_A;
    Uint32 size;
    Uint16 mode;

    void slDMAXCopy (src_A, dest_A, size, mode);

argument

    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).

Number of returns

    void --Nothing is returned.

function

    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.

Example

    Fill an area with 0s.
Uint32 dest = 0; slDMAXCopy (src, & dest, size, Sfix_Dinc_Long );

caution


    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.

reference

 slDMACopy
 slDMAWait
 DMASt_CPU0 



ListReference

function

slDMAWait


Waiting for DMA transfer

Form

    #include "sgl.h"

    void slDMAWait ();

argument

    void --Do not pass anything.

Number of returns

    void --Nothing is returned.

function

    Wait for the end of DMA started by slDMACopy and slDMAXCopy.

Example

    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 * /

caution


    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.

reference

 slDMACopy
 slDMAXCopy 



ListReference

function

slDMAStatus


DMA startup status

Form

    #include "sgl.h"

    Bool slDMAStatus ();

argument

    void --Do not pass anything.

Number of returns

    void --Nothing is returned.

function

    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.

Example

    slDMACopy (src, dest, size);
    if ( slDMAStatus () == ON ) {
                    ::
    } else {
                    ::
    }

reference

 slDMACopy
 slDMAXCopy
 slDMAWait 



ListReference

function

slCashPurge


Cache initialization

Form

    #include "sgl.h"

    void slCashPurge ();

argument

    void --Do not pass anything.

Number of returns

    void --Nothing is returned.

function

    Clears the CPU's built-in cache. It is used when the cache area is changed due to DMA transfer, etc.

Example

    * ( Uint32 *) (0x26020000) = 0x25e09990;
              ::
    slCashPurge ();
    test = * ( Uint32 *) (0x6020000);

caution


    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.

reference

 slSynch

return
Copyright SEGA ENTERPRISES, LTD., 1997