Japanese

★ Initialization



ListReference

function

slInitPeripheral


Initializing peripheral control

Format

    #include "sgl.h"

    void slInitPeripheral( void );

argument

    void - gives nothing.

Return number

    void - returns nothing.

function

Performs initialization for peripheral related functions.

Note

Since it is called in slInitSystem , there is no need for the user to call it.

reference

 slInitSystem 


★ Peripheral port input/output



ListReference

function

slGetPortDir1



ListReference

function

slGetPortDir2


Get input/output direction of peripheral port

Format

    #include "sgl.h"

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

argument

    void - gives nothing.

Return number

    Uint8 - Peripheral port input/output direction (described later).

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.

Note

Only the lower 7 bits are valid.

reference

 slSetPortDir1
 slSetPortDir2
 slGetPortData1
 slGetPortData2
 slSetPortData1
 slSetPortData2 



ListReference

function

slSetPortDir1



ListReference

function

slSetPortDir2


Set input/output direction of peripheral port

Format

    #include "sgl.h"

    Uint8 dir;

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

argument

    Uint8 dir - Peripheral port input/output direction (described later).

Return number

    Bool - Flag indicating whether the process ended normally (described later).

function

Set the input/output direction of the peripheral port.
When each bit of the argument is 0, it becomes an input setting, and when it is 1, it becomes an output setting.
If the semaphore is locked by another process or interrupt back is set, the function returns NG , otherwise it returns OK .

Note

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

Format

    #include "sgl.h"

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

argument

    void - gives nothing.

Return number

    Uint8 - Peripheral port data.

function

For each bit input and set in slSetPortDir1 and slSetPortDir2 , Get peripheral port data.

Note

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

reference

 slGetPortDir1
 slGetPortDir2
 slSetPortDir1
 slGetPortDir2
 slGetPortData1
 slGetPortData2
 slGetStatus
 slGetPeripheral 



ListReference

function

slSetPortData1



ListReference

function

slSetPortData2


Set peripheral port data

Format

    #include "sgl.h"

    Uint8 data;

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

argument

    Uint8 data - the data you want to set.

Return number

    void - returns nothing.

function

For each bit set for output with slSetPortDir1 and slSetPortDir2 , Set peripheral port data.

Note

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

reference

 slGetPortDir1
 slGetPortDir2
 slSetPortDir1
 slGetPortDir2
 slSetPortData1
 slSetPortData2
 slGetStatus
 slGetPeripheral 



ListReference

function

slGetPortSelect1



ListReference

function

slGetPortSelect2


Peripheral port input/output selection

Format

    #include "sgl.h"

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

argument

    void - gives nothing.

Return number

    Uint8 - Peripheral port input/output selection mode (described later).

function

Are peripheral data acquired in SMPC control mode or SH2? Check if you are getting it in direct mode.
The function is SMPC_CONTROL : SMPC control mode (initial value) SMPC_SH2_DIRECT : Returns one of the SH2 direct modes.

reference

 slSetPortSelect1
 slSetPortSelect2 



ListReference

function

slSetPortSelect1



ListReference

function

slSetPortSelect2


Peripheral port input/output selection

Format

    #include "sgl.h"

    Uint8 mode;

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

argument

    Uint8 mode - Peripheral port input/output selection mode (described later).

Return number

    Bool - Flag indicating whether the process ended normally (described later).

function

Obtain peripheral data in SMPC control mode or use SH2 Set whether to acquire in direct mode.
For the argument mode, SMPC_CONTROL : SMPC control mode (initial value) SMPC_SH2_DIRECT : SH2 direct mode If the semaphore is locked by another process or interrupt back is set, the function returns NG , otherwise it returns OK .

reference

 slGetPortSelect1
 slGetPortSelect2 



ListReference

function

slGetPortExt1



ListReference

function

slGetPortExt2


Get peripheral port external latch input mode

Format

    #include "sgl.h"

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

argument

    void - gives nothing.

Return number

    Uint8 - External latch input mode (described below).

function

Gets the external latch input mode of the peripheral port and returns the following value.
SMPC_EXL_DIS : External latch input disabled (initial value) SMPC_EXL_ENA : External latch input enable

reference

 slSetPortExt1
 slSetPortExt2 



ListReference

function

slSetPortExt1



ListReference

function

slSetPortExt2


Set external latch input mode for peripheral port 1

Format

    #include "sgl.h"

    Uint8 mode;

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

argument

    Uint8 mode - External latch input mode (described later).

Return number

    Bool - Flag indicating whether the process ended normally (described later).

function

Sets the external latch input mode of the peripheral port.
The external latch input mode given as an argument is SMPC_EXL_DIS : External latch input disabled (initial value) SMPC_EXL_ENA : There are two types: external latch input enabled.
If the semaphore is locked by another process or interrupt back is set, the function returns NG , otherwise it returns OK .

Note

When set to external latch input enable mode, slSetPortDir1 , In slSetPortDir2 , bit 6 must be input set to "0",

reference

 slGetPortExt1
 slGetPortExt2 


★ Peripheral control mode



ListReference

function

slGetOptimize


Get peripheral acquisition time optimization mode

Format

    #include "sgl.h"

    Uint8 slGetOptimize( void );

argument

    void - gives nothing.

Return number

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

function

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

reference

 slSetOptimize
 slGetStatus 



ListReference

function

slSetOptimize


Set peripheral acquisition time optimization mode

Format

    #include "sgl.h"

    Uint8 mode;

    Bool slSetOptimize( mode );

argument

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

Return number

    Bool - Flag indicating whether the process ended normally (described later).

function

Sets the peripheral acquisition time optimization mode during INTBACK.
The argument "mode" has SMPC_OPT_ENA : Acquisition time optimization permission (initial value) SMPC_OPT_DIS : Contains either acquisition time optimization disabled.
If the semaphore is locked by another process, the error code NG is displayed. Returns OK if successful.

Note

If acquisition time optimization is disabled, the peripheral data will be updated after the peripheral data is acquired, and the peripheral update results may be delayed by one frame.
Since the processing time in the SMPC interrupt processing function is shortened, timeovers rarely occur even when optimizing the acquisition time.

reference

 slGetOptimize
 slGetStatus 



ListReference

function

slGetPortMode1



ListReference

function

slGetPortMode2


Get port mode of peripheral port

Format

    #include "sgl.h"

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

argument

    void - gives nothing.

Return number

    Uint8 - Port mode of peripheral port (described below).

function

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

reference

 slSetPortMode1
 slSetPortMode2
 slGetStatus 



ListReference

function

slSetPortMode1



ListReference

function

slSetPortMode2


Set port mode of peripheral port

Format

    #include "sgl.h"

    Uint8 mode;

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

argument

    Uint8 mode - Port mode of peripheral port (described below).

Return number

    Bool - Flag indicating whether the process ended normally (described later).

function

Set the port mode of the peripheral port.
Specify one of the following for the argument "mode".
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, the error code NG is returned. Returns OK if successful.

reference

 slGetPortMode1
 slGetPortMode2
 slGetStatus 


★ State control



ListReference

function

slCheckReset


Get SMPC reset button status

Format

    #include "sgl.h"

    Uint8 slCheckReset( void );

argument

    void - gives nothing.

Return number

    Uint8 - SMPC reset button status (described later).

function

Gets the SMPC reset button state and returns a value like below.
SMPC_RES_OFF : Reset button OFF (initial value) SMPC_RES_ON : Reset button ON

Note

Once turned "ON", it will not change until slClearReset is called.
Normally (when the reset button is enabled), there is no need for the application to monitor the status of the reset button.
If the reset button is enabled, an NMI interrupt is automatically generated and control is transferred to BOOT-ROM.
Use this 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

Format

    #include "sgl.h"

    Bool slClearReset( void );

argument

    void - gives nothing.

Return number

    Bool - Flag indicating whether the process ended normally (described later).

function

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

reference

 slCheckReset
 slGetStatus 



ListReference

function

slIntBackCancel


Clear interrupt back setting flag

Format

    #include "sgl.h"

    Bool slIntBackCancel( void );

argument

    void - gives nothing.

Return number

    Bool - Flag indicating whether the process ended normally (described later).

function

Used when canceling interrupt back settings set by slGetPeripheral and slGetStatus .
If the semaphore is locked by another process, the error code NG is displayed. Returns OK if successful.

reference

 slGetStatus
 slGetPeripheral 


★ SMPC memory conversion service



ListReference

function

slGetLanguage


Get SMPC memory language number

Format

    #include "sgl.h"

    Uint8 slGetLanguage( void );

argument

    void - gives nothing.

Return number

    Uint8 - Language information number.

function

Obtain the post-game information number (usually set in multiplayer) managed by SMPC. The value returned by the function is one of the following six values: 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

Format

    #include "sgl.h"

    Uint8 num;

    void slSetLanguage( num );

argument

    Uint8 num - Language information number (described later).

Return number

    void - returns nothing.

function

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

Note

Please follow the creation standards for language information settings.

reference

 slGetLanguage
 slGetStatus 



ListReference

function

slGetSoundEffect


Get SMPC memory sound effect mode

Format

    #include "sgl.h"

    Uint8 slGetSoundEffect( void );

argument

    void - gives nothing.

Return number

    Uint8 - Sound effect mode.

function

Get 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

Format

    #include "sgl.h"

    Uint8 mode;
    void slSetSoundEffect( mode );

argument

    Uint8 mode - Sound effect mode (described later).

Return number

    void - returns nothing.

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

Format

    #include "sgl.h"

    Uint8 slGetSoundOutput( void );

argument

    void - gives nothing.

Return number

    Uint8 - Audio output mode (described later).

function

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

Note


    The STREO/MONO mode obtained here has nothing to do with the sound driver output. For sounds emitted from the
    application through the sound driver, you need to configure the sound driver's STREO/MONO settings.

reference

 slSetSoundOutput
 slGetStatus 



ListReference

function

slSetSoundOutput


Set SMPC memory audio output mode

Format

    #include "sgl.h"

    Uint8 mode;

    void slSetSoundOutput( mode );

argument

    Uint8 mode - Audio output mode (described later).

Return number

    void - returns nothing.

function

Change the audio output mode managed by SMPC.
The argument "mode" has SMPC_SOUND_STEREO : Stereo SMPC_SOUND_MONO : Monaural.
In addition, when changing the CDDA audio output mode, Please use slCDDAOn (if using SGL's sound function) or SND_SetCdDaPan (if using SBL's sound function).

Note

In the current creation standards, application option settings, etc. If you have configured STEREO/MONO, you will also need to use this function to change the audio output mode settings managed by SMPC.
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, please change the sound driver settings.

reference

 slGetSoundOutput
 slGetStatus 



ListReference

function

slGetHelpWindow


Get SMPC memory help window mode

Format

    #include "sgl.h"

    Uint8 slGetHelpWindow( void );

argument

    void - gives nothing.

Return number

    Uint8 - Help window mode (described below).

function

Get help window mode, SMPC_HELP_ENA : Display.
SMPC_HELP_DIS : Do not display.
returns.

reference

 slSetHelpWindow
 slGetStatus 



ListReference

function

slSetHelpWindow


Set SMPC memory help window mode

Format

    #include "sgl.h"

    Uint8 mode;

    void slSetHelpWindow( mode );

argument

    Uint8 mode - Help window mode (described below).

Return number

    void - returns nothing.

function

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

Note

Please do not use this function because the current creation standards prohibit setting the help window mode.

reference

 slGetHelpWindow
 slGetStatus 


★ Interrupt back setting



ListReference

macro

slGetStatus


Interrupt back (obtain SMPC status/peripheral data)

Format

    #include "sgl.h"

    Bool slGetStatus( void );

argument

    void - gives nothing.

Return number

    Bool - Flag indicating whether the process ended normally (described later).

function

Execute the SMPC interrupt back command and check the SMPC status, Get any of the peripheral data.
This function only needs to be called once, and can be called as is without canceling it even when changing settings.
The settings will take effect from the next frame and data collection will begin.
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 from the data collected in the next frame.
Therefore, you can refer to the collected data from the second frame after setting.
When the library is started, slInitSystem is set to only acquire peripheral data, so you can start referencing peripherals without waiting.
The semaphore cannot be acquired because another process is locking it, or If the peripheral port input/output settings given by slSetPortDir1 and slSetPortDir2 are incorrect, NG is returned as the result code.

Note

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

reference

 slSetPortDir1
 slSetPortDir2
 slGetPeripheral
 slInitSystem 



ListReference

macro

slGetPeripheral


Interrupt back (obtain peripheral data only)

Format

    #include "sgl.h"

    Bool slGetPeripheral( void );

argument

    void - gives nothing.

Return number

    Bool - Flag indicating whether the process ended normally (described later).

function

Execute the SMPC interrupt back command and retrieve only peripheral data.
This function only needs to be called once, and can be called as is without canceling it even when changing settings.
The settings will take effect from the next frame and data collection will begin.
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 from the data collected in the next frame.
Therefore, you can refer to the collected data from the second frame after setting.
When the library is started, slInitSystem is set to only acquire peripheral data, so you can start referencing peripherals without waiting.
The semaphore cannot be acquired because another process is locking it, or If the peripheral port input/output settings given by slSetPortDir1 and slSetPortDir2 are incorrect, NG is returned as the result code.

Note

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

reference

 slGetStatus
 slSetPortDir1
 slSetPortDir2
 slInitSystem

return
Copyright SEGA ENTERPRISES, LTD., 1997