Japanese

ListReference

function

slSynch


wait for next video display

Format

    #include "sgl.h"

    void slSynch( void );

argument

    void - gives nothing.

Return number

    void - returns nothing.

function

Waits for the next video display to begin (or the first frame if it is 2 frames).
If there is a processing failure in the previous processing, it will end immediately.

example

    slInitSystem ( TV_320x224 , NULL , 2 );
                    :
    while( -1 ) {
           :
      slSynch ();
    }

reference

 slInitSynch
 SynchConst
 SynchCount
 PauseFlag
 WinPtr
 Resolution
 NbPCMBf
 PCMBufFlag
 FRT_Count
 VDP2_TVSTAT
 RandWork 



ListReference

function

slInitSynch


wait for next video display

Format

    #include "sgl.h"

    void slInitSynch( void );

argument

    void - gives nothing.

Return number

    void - returns nothing.

function

Initializes the interrupt wait counter and makes sure to wait for the next video display to begin before exiting.

example

    slInitSystem ( TV_320x224 , NULL , -1 );
                    :
    while( -1 ) {
           :
      slInitSynch ();
    }

Note

If processing is interrupted, always wait until the next frame.

reference

 slSynch
 SynchConst
 SynchCount
 PauseFlag
 WinPtr
 Resolution
 NbPCMBf
 PCMBufFlag
 FRT_Count
 VDP2_TVSTAT
 RandWork 



ListReference

function

slIntFunction


Format

    #include "sgl.h"

    void ( *func ( void ) );

    void slIntFunction( func );

argument

    void ( *func ( void ) ) - Pointer to the function to execute during blanking.

Return number

    void - returns nothing.

function

Register the function to be executed during blanking start interrupt processing.
Registered user functions are executed after scroll data transfer.
Specify NULL if you want to delete the registered function.

example

    void intfunc() {
      call1();
      call2();
      call3();
    }
    slIntFunction ( intfunc );

    void intfunc() {
      res = slDivFX ( arg1, arg2 );
              :
    }
    slIntFunction ( intfunc ); /*NG!!! intfunc() uses a divider. */
                              /* Think of the math package functions (fixed decimal operations and matrix operations) as basically using a divider. */

Note

Since it is executed during interrupt processing, it is not allowed to use a divider within the function.

reference

 slSynchFunction
 UserFunction 



ListReference

function

slSynchFunction


Format

    #include "sgl.h"

    void ( *func( void ) );

    void slSynchFunction( func );

argument

    void ( *func( void ) ) - Pointer to the function you want to run while waiting for an interrupt.

Return number

    void - returns nothing.

function

Register a function to be executed while waiting for a blanking interrupt using the slSynch function. Specify NULL if you want to delete the registered function.

example

    void syncfunc() {
      call1();
      call2();
    }
    slSynchFunction ( syncfunc );

reference

 slSynch
 slInitSynch 



ListReference

function

slTransferEntry


Format

    #include "sgl.h"

    void *src;
    void *dest;
    Uint16 size;

    Bool slTransferEntry( src, dest, size );

argument

    void *src - Source address.
void *dest - Destination address.
Uint16 size - Transfer size.

Return number

    Bool - Error code (described below).

function

Add to the list of DMA transfers to be executed during the next blanking interrupt.
Returns FALSE if transfer entries exceed the buffer.

example

    void *src = ( void * )( 0x6090000 );
    void *dest = ( void * )( 0x25e00000 );
    Uint16 size = 0x20000;
    slTransferEntry ( src, dest, size );

    void *src = ( void * )( 0x25f00000 );
    void *dest = ( void * )( 0x25e00000 );
    Uint16 size = 0x1000;
    slTransferEntry ( src, dest, size ); /*NG Transfer between the same buses is not possible. */

Note

Since the SCU's DMA indirect mode is used, the transfer source and transfer destination must be on different buses.
There are three buses, each connected via an SCU:
CPU-Bus: IPLROM, WORK RAM, Backup RAM, SMPC A-Bus: CD, Cartridge B-Bus: VDP1, VDP2, SCSP

reference

 Trans Count
 TransRequest 



ListReference

function

slNoOperation


do nothing

Format

    #include "sgl.h"

    void slNoOperation( void );

argument

    void - gives nothing.

Return number

    void - returns nothing.

function

I won't do anything. Please use this when canceling an interrupt registration function or when applying a wait.

example

    slIntFunction ( slNoOperation );

reference

 slIntFunction
 slSynchFunction

return
Copyright SEGA ENTERPRISES, LTD., 1997