★ Initialization



ListReference

function

slInit Peripheral


Initialization of peripheral control

Form

    #include "sgl.h"

    void slInitPeripheral (void);

argument

    void --Do not give anything.

Number of returns

    void --Nothing is returned.

function

    Performs initialization for peripheral related functions.

caution


    Since it is called in slInitSystem, the user does not need to call it.

reference

 slInitSystem 


★ Peripheral port input / output



ListReference

function

slGetPortDir1



ListReference

function

slGetPortDir2


Get the input / output direction of the peripheral port

Form

    #include "sgl.h"

    Uint8 slGetPortDir1 (void);
    Uint8 slGetPortDir2 (void);

argument

    void --Do not give anything.

Number of returns

    Uint8 --Peripheral port I / O direction (see below).

function

    Gets the input / output direction of the peripheral port.
When each bit of the value returned by the function is 0, it means the input direction, and when it is 1, it means the output direction.

caution


    Only the lower 7 bits are valid.

reference

 slSetPortDir1
 slSetPortDir2
 slGetPortData1
 slGetPortData2
 slSetPortData1
 slSetPortData2 



ListReference

function

slSetPortDir1



ListReference

function

slSetPortDir2


Set the input / output direction of the peripheral port

Form

    #include "sgl.h"

    Uint8 dir;

    Bool slSetPortDir1 (dir);
    Bool slSetPortDir2 (dir);

argument

    Uint8 dir --Peripheral port I / O direction (see below).

Number of returns

    Bool --A flag that indicates whether the process ended normally (described later).

function

    Sets the input / output direction of the peripheral port.
The argument is the input setting when each bit is 0 and the output setting when it is 1.
If the semaphore is locked by another process or the interrupt back is set, the function returns NG as the return value, otherwise OK .

caution


    Only the lower 7 bits are valid.

reference

 slGetPortDir1
 slGetPortDir2
 slGetPortData1
 slGetPortData2
 slSetPortData1
 slSetPortData2
 slGetStatus
 slGetPeripheral 



ListReference

function

slGetPortData1



ListReference

function

slGetPortData2


Get peripheral port data

Form

    #include "sgl.h"

    Uint8 slGetPortData1 (void);
    Uint8 slGetPortData2 (void);

argument

    void --Do not give anything.

Number of returns

    Uint8 --Peripheral port data.

function

    For each bit input and set by slSetPortDir1 and slSetPortDir2
    Gets the peripheral port data.

caution


    Only the lower 7 bits are valid. Also, slSetPortDir1 ,
    Bits set for output with slSetPortDir2 are not acquired.

reference

 slGetPortDir1
 slGetPortDir2
 slSetPortDir1
 slGetPortDir2
 slGetPortData1
 slGetPortData2
 slGetStatus
 slGetPeripheral 



ListReference

function

slSetPortData1



ListReference

function

slSetPortData2


Set peripheral port data

Form

    #include "sgl.h"

    Uint8 data;

    void slSetPortData1 (data);
    void slSetPortData2 (data);

argument

    Uint8 data --Data you want to set.

Number of returns

    void --Nothing is returned.

function

    For each bit set for output with slSetPortDir1 and slSetPortDir2
    Sets the data for the peripheral port.

caution


    Only the lower 7 bits are valid. Also, slSetPortDir1 ,
    Bits set as input with slSetPortDir2 are not set.

reference

 slGetPortDir1
 slGetPortDir2
 slSetPortDir1
 slGetPortDir2
 slSetPortData1
 slSetPortData2
 slGetStatus
 slGetPeripheral 



ListReference

function

slGetPortSelect1



ListReference

function

slGetPortSelect2


Peripheral port input / output select

Form

    #include "sgl.h"

    Uint8 slGetPortSelect1 (void);
    Uint8 slGetPortSelect2 (void);

argument

    void --Do not give anything.

Number of returns

    Uint8 --Peripheral port I / O select mode (see below).

function

    Peripheral data is acquired in SMPC control mode or SH2
    Check if you are getting in direct mode.
Function is SMPC_CONTROL : SMPC control mode (default) SMPC_SH2_DIRECT : Returns one of the SH2 direct modes.

reference

 slSetPortSelect1
 slSetPortSelect2 



ListReference

function

slSetPortSelect1



ListReference

function

slSetPortSelect2


Peripheral port input / output select

Form

    #include "sgl.h"

    Uint8 mode;

    Bool slSetPortSelect1 (mode);
    Bool slSetPortSelect2 (mode);

argument

    Uint8 mode --Peripheral port I / O select mode (see below).

Number of returns

    Bool --A flag that indicates whether the process ended normally (described later).

function

    Get peripheral data in SMPC control mode or SH2
    Set whether to acquire in direct mode.
In the argument mode, SMPC_CONTROL : SMPC control mode (default) SMPC_SH2_DIRECT : SH2 direct mode If the semaphore is locked by another process or the interrupt back is set, the function returns NG as the return value, otherwise OK .

reference

 slGetPortSelect1
 slGetPortSelect2 



ListReference

function

slGetPortExt1



ListReference

function

slGetPortExt2


Get external latch input mode for peripheral port

Form

    #include "sgl.h"

    Uint8 slGetPortExt1 (void);
    Uint8 slGetPortExt2 (void);

argument

    void --Do not give anything.

Number of returns

    Uint8 --External latch input mode (see below).

function

    Gets the external latch input mode of the peripheral port and returns the following values:
SMPC_EXL_DIS : External latch input prohibited (initial value) SMPC_EXL_ENA : External latch input allowed

reference

 slSetPortExt1
 slSetPortExt2 



ListReference

function

slSetPortExt1



ListReference

function

slSetPortExt2


Set the external latch input mode for peripheral port 1

Form

    #include "sgl.h"

    Uint8 mode;

    Bool slSetPortExt1 (mode);
    Bool slSetPortExt2 (mode);

argument

    Uint8 mode --External latch input mode (see below).

Number of returns

    Bool --A flag that indicates whether the process ended normally (described later).

function

    Sets the external latch input mode for the peripheral port.
The external latch input mode given as an argument is SMPC_EXL_DIS : External latch input prohibited (initial value) SMPC_EXL_ENA : Two types of external latch input permission.
If the semaphore is locked by another process or the interrupt back is set, the function returns NG as the return value, otherwise OK .

caution


    When set to external latch input permission mode, slSetPortDir1 ,
    With slSetPortDir2 , bit 6 must be set to the input setting "0",

reference

 slGetPortExt1
 slGetPortExt2 


★ Peripheral control mode



ListReference

function

slGetOptimize


Get peripheral acquisition time optimization mode

Form

    #include "sgl.h"

    Uint8 slGetOptimize (void);

argument

    void --Do not give anything.

Number of returns

    Uint8 --Peripheral acquisition time optimization mode (described later).

function

    Checks whether the peripheral data acquisition when issuing the INTBACK command is in the optimization mode.
The function returns the following values:
SMPC_OPT_ENA : Acquisition time optimization permission (initial value) SMPC_OPT_DIS : Acquisition time optimization prohibited

reference

 slSetOptimize
 slGetStatus 



ListReference

function

slSetOptimize


Set peripheral acquisition time optimization mode

Form

    #include "sgl.h"

    Uint8 mode;

    Bool slSetOptimize (mode);

argument

    Uint8 mode --Peripheral acquisition time optimization mode (described later).

Number of returns

    Bool --A flag that indicates whether the process ended normally (described later).

function

    Sets the peripheral acquisition time optimization mode for INTBACK.
In the argument "mode", SMPC_OPT_ENA : Acquisition time optimization permission (initial value) SMPC_OPT_DIS : One of the acquisition time optimization prohibition is entered.
If the semaphore is locked by another process, error code NG , Returns OK if successful.

caution


    If the acquisition time optimization is disabled, the peripheral data will be updated after the peripheral data is acquired, and the peripheral update result may be delayed by one frame.
Since the processing time of the SMPC interrupt processing function is shortened, time over is unlikely to occur even when the acquisition time is optimized.

reference

 slGetOptimize
 slGetStatus 



ListReference

function

slGetPortMode1



ListReference

function

slGetPortMode2


Get the port mode of the peripheral port

Form

    #include "sgl.h"

    Uint8 slGetPortMode1 (void);
    Uint8 slGetPortMode2 (void);

argument

    void --Do not give anything.

Number of returns

    Uint8 --Peripheral port port mode (see below).

function

    Get the port mode of the peripheral port,
      SMPC_PORT_15 : 15-byte mode (initial value)
      SMPC_PORT_255 : 255 byte mode SMPC_PORT_ZERO : Returns one of 0 byte modes.

reference

 slSetPortMode1
 slSetPortMode2
 slGetStatus 



ListReference

function

slSetPortMode1



ListReference

function

slSetPortMode2


Set the port mode of the peripheral port

Form

    #include "sgl.h"

    Uint8 mode;

    Bool slSetPortMode1 (mode);
    Bool slSetPortMode2 (mode);

argument

    Uint8 mode --Peripheral port port mode (see below).

Number of returns

    Bool --A flag that indicates whether the process ended normally (described later).

function

    Sets the port mode for peripheral ports.
For the argument "mode", specify one of the following.
SMPC_PORT_15 : 15-byte mode (initial value) SMPC_PORT_255 : 255 byte mode SMPC_PORT_ZERO : 0 byte mode If the semaphore is locked by another process, error code NG , Returns OK if successful.

reference

 slGetPortMode1
 slGetPortMode2
 slGetStatus 


★ State control



ListReference

function

slCheckReset


Get SMPC reset button status

Form

    #include "sgl.h"

    Uint8 slCheckReset (void);

argument

    void --Do not give anything.

Number of returns

    Uint8 --SMPC reset button state (see below).

function

    Gets the SMPC reset button state and returns a value similar to the following:
SMPC_RES_OFF : Reset button OFF (initial value) SMPC_RES_ON : Reset button ON

caution


    Once turned "ON", it does not change until slClearReset is called.
Normally (reset button enabled) the application does not need to monitor the reset button status.
When the reset button is enabled, an NMI interrupt is automatically generated and control is transferred to BOOT-ROM.
Use only when the reset button is always disabled, such as in modem-compatible applications.

reference

 slClearReset
 slGetStatus 



ListReference

function

slClearReset


Clear SMPC reset button state

Form

    #include "sgl.h"

    Bool slClearReset (void);

argument

    void --Do not give anything.

Number of returns

    Bool --A flag that indicates whether the process ended normally (described later).

function

    Clears the SMPC reset button state.
If the semaphore is locked by another process, error code NG , Returns OK if successful.

reference

 slCheckReset
 slGetStatus 



ListReference

function

slIntBackCancel


Clear the interrupt back setting flag

Form

    #include "sgl.h"

    Bool slIntBackCancel (void);

argument

    void --Do not give anything.

Number of returns

    Bool --A flag that indicates whether the process ended normally (described later).

function

    It is used to cancel the interrupt back setting set by slGetPeripheral and slGetStatus.
If the semaphore is locked by another process, error code NG , Returns OK if successful.

reference

 slGetStatus
 slGetPeripheral 


★ SMPC memory conversion service



ListReference

function

slGetLanguage


Get SMPC memory language number

Form

    #include "sgl.h"

    Uint8 slGetLanguage (void);

argument

    void --Do not give anything.

Number of returns

    Uint8 --Language information number.

function

    Acquires the postscript information number (usually set in multiplayer) managed by SMPC. The value returned by the function can be one of six : SMPC_ENGLISH: English SMPC_DEUTSCH : German SMPC_FRANCAIS : French SMPC_ESPANOL : Spanish SMPC_ITALIANO : Italian SMPC_JAPAN : Japanese.

reference

 slSetLanguage
 slGetStatus 



ListReference

function

slSetLanguage


Set SMPC memory language number

Form

    #include "sgl.h"

    Uint8 num;

    void slSetLanguage (num);

argument

    Uint8 num --Language information number (see below).

Number of returns

    void --Nothing is returned.

function

    Change the language information number managed by SMPC.
The argument "num" SMPC_ENGLISH : English SMPC_DEUTSCH : German SMPC_FRANCAIS : French SMPC_ESPANOL : Spanish SMPC_ITALIANO : Italian SMPC_JAPAN : Enter either Japanese.

caution


    Follow the creation criteria for the language information settings.

reference

 slGetLanguage
 slGetStatus 



ListReference

function

slGetSoundEffect


Get SMPC memory sound effect mode

Form

    #include "sgl.h"

    Uint8 slGetSoundEffect (void);

argument

    void --Do not give anything.

Number of returns

    Uint8 --Sound effect mode.

function

    Acquires information on sound effects managed by SMPC.
SMPC_EFFECT_ON : Sound effect ON SMPC_EFFECT_OFF : Sound effect OFF

reference

 slSetSoundEffect
 slGetStatus 



ListReference

function

slSetSoundEffect


Set SMPC memory sound effect mode

Form

    #include "sgl.h"

    Uint8 mode;
    void slSetSoundEffect (mode);

argument

    Uint8 mode --Sound effect mode (see below).

Number of returns

    void --Nothing is returned.

function

    Change the sound effect mode managed by SMPC.
SMPC_EFFECT_ON : Sound effect ON SMPC_EFFECT_OFF : Sound effect OFF

reference

 slGetSoundEffect
 slGetStatus 



ListReference

function

slGetSoundOutput


Get SMPC memory audio output mode

Form

    #include "sgl.h"

    Uint8 slGetSoundOutput (void);

argument

    void --Do not give anything.

Number of returns

    Uint8 --Audio output mode (see below).

function

    Acquires the audio output mode managed by SMPC and returns the following values.
SMPC_SOUND_STEREO : Stereo SMPC_SOUND_MONO : Monaural

caution


    The STREO / MONO mode obtained here has nothing to do with the output of the sound driver. For sounds emitted from the application through the sound driver, it is necessary to set the sound driver's STREO / MONO.

reference

 slSetSoundOutput
 slGetStatus 



ListReference

function

slSetSoundOutput


Set SMPC memory audio output mode

Form

    #include "sgl.h"

    Uint8 mode;

    void slSetSoundOutput (mode);

argument

    Uint8 mode --Audio output mode (described later).

Number of returns

    void --Nothing is returned.

function

    Change the audio output mode managed by SMPC.
The argument "mode" SMPC_SOUND_STEREO : Stereo SMPC_SOUND_MONO : Contains one of monaural.
When changing the audio output mode of CDDA, Be sure to use slCDDAOn (if you are using the SGL sound function) or SND_SetCdDaPan (if you are using the SBL sound function).

caution


    Currently, in the creation criteria, in the option settings of the application, etc.
    When STEREO / MONO is set, it is necessary to change the setting of the audio output mode managed by SMPC by using this function.
Also, changing this mode does not change the sound output from the user application. To change the STEREO / MONO information of the sound output from the application, change the sound driver settings.

reference

 slGetSoundOutput
 slGetStatus 



ListReference

function

slGetHelpWindow


Get SMPC memory help window mode

Form

    #include "sgl.h"

    Uint8 slGetHelpWindow (void);

argument

    void --Do not give anything.

Number of returns

    Uint8 --Help window mode (see below).

function

    Get help window mode and
      SMPC_HELP_ENA : Display.
SMPC_HELP_DIS : Do not display.
Returns.

reference

 slSetHelpWindow
 slGetStatus 



ListReference

function

slSetHelpWindow


Set SMPC memory help window mode

Form

    #include "sgl.h"

    Uint8 mode;

    void slSetHelpWindow (mode);

argument

    Uint8 mode --Help window mode (see below).

Number of returns

    void --Nothing is returned.

function

    Set the help window mode.
The argument "mode" SMPC_HELP_ENA : Display.
SMPC_HELP_DIS : Do not display.
Is entered.

caution


    Do not use this function as the current creation criteria prohibit setting the help window mode.

reference

 slGetHelpWindow
 slGetStatus 


★ Interrupt back setting



ListReference

macro

slGetStatus


Interrupt back (acquire SMPC status peripheral data)

Form

    #include "sgl.h"

    Bool slGetStatus (void);

argument

    void --Do not give anything.

Number of returns

    Bool --A flag that indicates whether the process ended normally (described later).

function

    Execute the SMPC interrupt back command, SMPC status,
    Get any of the peripheral data.
You only need to call this function once, and you can call it as it is without canceling it when you change the setting.
The settings will take effect from the next frame and data collection will start.
If you change the settings, the data collected in that frame will be reflected in the reference data in the next frame, and the new settings will be reflected in the data collected in the next frame.
Therefore, the collected data can be referred to from the second frame after setting.
When the library is started, slInitSystem is set to acquire only peripheral data, so you can start referencing peripheral data without weighting.
Another process is locked and you cannot get a semaphore, or If the input / output settings of the peripheral port given by slSetPortDir1 and slSetPortDir2 are incorrect, NG is returned as the result code.

caution


    This function is executed by slInitSystem , and the SMPC status obtained there is stored in the global variable called Smpc_Status inside the library. After that, slGetPeripheral is called, so the normal operation is in the mode to get only peripheral data.
You do not need to call this function unless you intentionally get the SMPC status again.
This function cannot be used from the slave side.
If you try to use it on the slave side, it returns NG as the result code of the function and The command will not be executed.

reference

 slSetPortDir1
 slSetPortDir2
 slGetPeripheral
 slInitSystem 



ListReference

macro

slGetPeripheral


Interrupt back (acquire only peripheral data)

Form

    #include "sgl.h"

    Bool slGetPeripheral (void);

argument

    void --Do not give anything.

Number of returns

    Bool --A flag that indicates whether the process ended normally (described later).

function

    Execute the SMPC interrupt back command to get only the peripheral data.
You only need to call this function once, and you can call it as it is without canceling it when you change the setting.
The settings will take effect from the next frame and data collection will start.
If you change the settings, the data collected in that frame will be reflected in the reference data in the next frame, and the new settings will be reflected in the data collected in the next frame.
Therefore, the collected data can be referred to from the second frame after setting.
When the library is started, slInitSystem is set to acquire only peripheral data, so you can start referencing peripheral data without weighting.
Another process is locked and you cannot get a semaphore, or If the input / output settings of the peripheral port given by slSetPortDir1 and slSetPortDir2 are incorrect, NG is returned as the result code.

caution


    This function cannot be used from the slave side.
If you try to use it on the slave side, it returns NG as the result code of the function and The command will not be executed.

reference

 slGetStatus
 slSetPortDir1
 slSetPortDir2
 slInitSystem

return
Copyright SEGA ENTERPRISES, LTD., 1997