#include "sgl.h"
void slInitPeripheral (void);
void --Do not give anything.
void --Nothing is returned.
Performs initialization for peripheral related functions.
Since it is called in slInitSystem, the user does not need to call it.
slInitSystem |
#include "sgl.h"
Uint8 slGetPortDir1 (void);
Uint8 slGetPortDir2 (void);
void --Do not give anything.
Uint8 --Peripheral port I / O direction (see below).
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.
Only the lower 7 bits are valid.
slSetPortDir1 | slSetPortDir2 | slGetPortData1 | slGetPortData2 |
slSetPortData1 | slSetPortData2 |
#include "sgl.h"
Uint8 dir;
Bool slSetPortDir1 (dir);
Bool slSetPortDir2 (dir);
Uint8 dir --Peripheral port I / O direction (see below).
Bool --A flag that indicates whether the process ended normally (described later).
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 .
Only the lower 7 bits are valid.
slGetPortDir1 | slGetPortDir2 | slGetPortData1 | slGetPortData2 |
slSetPortData1 | slSetPortData2 | slGetStatus | slGetPeripheral |
#include "sgl.h"
Uint8 slGetPortData1 (void);
Uint8 slGetPortData2 (void);
void --Do not give anything.
Uint8 --Peripheral port data.
For each bit input and set by slSetPortDir1 and slSetPortDir2
Gets the peripheral port data.
Only the lower 7 bits are valid. Also, slSetPortDir1 ,
Bits set for output with slSetPortDir2 are not acquired.
slGetPortDir1 | slGetPortDir2 | slSetPortDir1 | slGetPortDir2 |
slGetPortData1 | slGetPortData2 | slGetStatus | slGetPeripheral |
#include "sgl.h"
Uint8 data;
void slSetPortData1 (data);
void slSetPortData2 (data);
Uint8 data --Data you want to set.
void --Nothing is returned.
For each bit set for output with slSetPortDir1 and slSetPortDir2
Sets the data for the peripheral port.
Only the lower 7 bits are valid. Also, slSetPortDir1 ,
Bits set as input with slSetPortDir2 are not set.
slGetPortDir1 | slGetPortDir2 | slSetPortDir1 | slGetPortDir2 |
slSetPortData1 | slSetPortData2 | slGetStatus | slGetPeripheral |
#include "sgl.h"
Uint8 slGetPortSelect1 (void);
Uint8 slGetPortSelect2 (void);
void --Do not give anything.
Uint8 --Peripheral port I / O select mode (see below).
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.
slSetPortSelect1 | slSetPortSelect2 |
#include "sgl.h"
Uint8 mode;
Bool slSetPortSelect1 (mode);
Bool slSetPortSelect2 (mode);
Uint8 mode --Peripheral port I / O select mode (see below).
Bool --A flag that indicates whether the process ended normally (described later).
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 .
slGetPortSelect1 | slGetPortSelect2 |
#include "sgl.h"
Uint8 slGetPortExt1 (void);
Uint8 slGetPortExt2 (void);
void --Do not give anything.
Uint8 --External latch input mode (see below).
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 allowedslSetPortExt1 | slSetPortExt2 |
#include "sgl.h"
Uint8 mode;
Bool slSetPortExt1 (mode);
Bool slSetPortExt2 (mode);
Uint8 mode --External latch input mode (see below).
Bool --A flag that indicates whether the process ended normally (described later).
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 .
When set to external latch input permission mode, slSetPortDir1 ,
With slSetPortDir2 , bit 6 must be set to the input setting "0",
slGetPortExt1 | slGetPortExt2 |
#include "sgl.h"
Uint8 slGetOptimize (void);
void --Do not give anything.
Uint8 --Peripheral acquisition time optimization mode (described later).
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 prohibitedslSetOptimize | slGetStatus |
#include "sgl.h"
Uint8 mode;
Bool slSetOptimize (mode);
Uint8 mode --Peripheral acquisition time optimization mode (described later).
Bool --A flag that indicates whether the process ended normally (described later).
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.
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.
slGetOptimize | slGetStatus |
#include "sgl.h"
Uint8 slGetPortMode1 (void);
Uint8 slGetPortMode2 (void);
void --Do not give anything.
Uint8 --Peripheral port port mode (see below).
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.
slSetPortMode1 | slSetPortMode2 | slGetStatus |
#include "sgl.h"
Uint8 mode;
Bool slSetPortMode1 (mode);
Bool slSetPortMode2 (mode);
Uint8 mode --Peripheral port port mode (see below).
Bool --A flag that indicates whether the process ended normally (described later).
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.
slGetPortMode1 | slGetPortMode2 | slGetStatus |
#include "sgl.h"
Uint8 slCheckReset (void);
void --Do not give anything.
Uint8 --SMPC reset button state (see below).
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
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.
slClearReset | slGetStatus |
#include "sgl.h"
Bool slClearReset (void);
void --Do not give anything.
Bool --A flag that indicates whether the process ended normally (described later).
Clears the SMPC reset button state.
If the semaphore is locked by another process, error code NG ,
Returns OK if successful.
slCheckReset | slGetStatus |
#include "sgl.h"
Bool slIntBackCancel (void);
void --Do not give anything.
Bool --A flag that indicates whether the process ended normally (described later).
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.
slGetStatus | slGetPeripheral |
#include "sgl.h"
Uint8 slGetLanguage (void);
void --Do not give anything.
Uint8 --Language information number.
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.
slSetLanguage | slGetStatus |
#include "sgl.h"
Uint8 num;
void slSetLanguage (num);
Uint8 num --Language information number (see below).
void --Nothing is returned.
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.
Follow the creation criteria for the language information settings.
slGetLanguage | slGetStatus |
#include "sgl.h"
Uint8 slGetSoundEffect (void);
void --Do not give anything.
Uint8 --Sound effect mode.
Acquires information on sound effects managed by SMPC.
SMPC_EFFECT_ON : Sound effect ON
SMPC_EFFECT_OFF : Sound effect OFF
slSetSoundEffect | slGetStatus |
#include "sgl.h"
Uint8 mode;
void slSetSoundEffect (mode);
Uint8 mode --Sound effect mode (see below).
void --Nothing is returned.
Change the sound effect mode managed by SMPC.
SMPC_EFFECT_ON : Sound effect ON
SMPC_EFFECT_OFF : Sound effect OFF
slGetSoundEffect | slGetStatus |
#include "sgl.h"
Uint8 slGetSoundOutput (void);
void --Do not give anything.
Uint8 --Audio output mode (see below).
Acquires the audio output mode managed by SMPC and returns the following values.
SMPC_SOUND_STEREO : Stereo SMPC_SOUND_MONO : Monaural
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.
slSetSoundOutput | slGetStatus |
#include "sgl.h"
Uint8 mode;
void slSetSoundOutput (mode);
Uint8 mode --Audio output mode (described later).
void --Nothing is returned.
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).
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.
slGetSoundOutput | slGetStatus |
#include "sgl.h"
Uint8 slGetHelpWindow (void);
void --Do not give anything.
Uint8 --Help window mode (see below).
Get help window mode and
SMPC_HELP_ENA : Display.
SMPC_HELP_DIS : Do not display.
Returns.
slSetHelpWindow | slGetStatus |
#include "sgl.h"
Uint8 mode;
void slSetHelpWindow (mode);
Uint8 mode --Help window mode (see below).
void --Nothing is returned.
Set the help window mode.
The argument "mode"
SMPC_HELP_ENA : Display.
SMPC_HELP_DIS : Do not display.
Is entered.
Do not use this function as the current creation criteria prohibit setting the help window mode.
slGetHelpWindow | slGetStatus |
#include "sgl.h"
Bool slGetStatus (void);
void --Do not give anything.
Bool --A flag that indicates whether the process ended normally (described later).
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.
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.
slSetPortDir1 | slSetPortDir2 | slGetPeripheral | slInitSystem |
#include "sgl.h"
Bool slGetPeripheral (void);
void --Do not give anything.
Bool --A flag that indicates whether the process ended normally (described later).
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.
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.
slGetStatus | slSetPortDir1 | slSetPortDir2 | slInitSystem |