Japanese
PROGRAMMER'S GUIDESMPC Interface User's Manual
BackForward
SMPC Interface User's Manual

detail


■Function

●System management system
The system management system has the following functions.

 function
 into back
 non-intoback
 Master SH2 ON
 ×
 Slave SH2 ON
 ×
 Slave SH2 OFF
 ×
 sound on
 ×
 Sound OFF
 ×
 CD ON
 ×
 CD OFF
 ×
 Whole system reset
 ×
 NMI request
 ×
 hot reset enable
 ×
 Hot reset disabled
 ×
 Get cartridge code
 ×
 Get area code
 ×
 Get system status
 ×
 SMPC memory settings
 ×
 SMPC memory acquisition
 ×
 Time setting
 ×
 Get time
 × 
It is prohibited to issue clock change commands directly to SMPC.
If you wish to use it, please use the SYS_CHGSYSCK() function in the system library.

●Peripheral control system
The library supports the following peripherals.

 game machine
 Peripheral name
 saturn peripherals
 digital device
 analog device
 Pointing device (mouse)
 keyboard
 Multi tap (6P)
 mega drive peripherals
 3 button PAD
 6 button PAD
 4P adapter
 mouse

●Peripherals not compatible with libraries
The following peripherals are not supported by this library.
Please refer to the respective documentation for details.

  1. Virtua Gun → Reference: Developer's Information STN-41
  2. Speech recognition → Added dedicated library (release date undecided )

■Processing

●Issue non-intback command
This is non-intback type processing.

●Issuing an intoback command

●Recommended example
Recommended examples are shown for the following three patterns.

●Explanation of the figure
Main processing
Intoback initialization (1): Specify system data acquisition
Into back initialization (2): Specify peripheral data acquisition
Into back initialization (3): Specify peripheral data acquisition + time data acquisition

SMPC processing
(1): System data collection processing
(2): Peripheral data collection processing
(3): Time data collection processing

(1) Pattern 1

*If the game frame is 1 frame

*If the game frame is 2 frames
Peripheral data acquisition* does not acquire peripheral data.

(2) Pattern 2

(3) Pattern 3

●Restrictions
<< Common to all commands>>

<< Non-intback command issuing function>>

<< Intoback command issue function>>

System data acquisition (excluding time)

Peripheral data acquisition, time data acquisition

■Peripheral control

Peripheral controls must be created to meet game creation standards.
This library does not process the data of connected peripherals.
All tasks such as checking for unsupported peripherals (virtual guns) and checking whether peripherals are connected or unconnected are all done on the application side.

●Policy
The peripheral acquisition process is created based on the following policy to provide flexible support to users.

●Method
(1) Number of peripherals to be acquired (2) Size of data to be acquired

(example)

Input specified value

Connection Status

Output 1: Peripheral data output
The library is divided into peripheral ID → peripheral type + data size and output.

 No.
 Peripheral type
 Data size
 Peripheral data (effective number of bytes)
 0
 pointing
 3
 Acquired data (3)
 1
 Digital
 2
 Acquired data (2)
 2
 disconnected
 disconnected
 undefined value
 3
 analog
 5
 Acquired data (3)
 4
 disconnected
 disconnected
 undefined value
 5
 disconnected
 disconnected
 undefined value
 6
 keyboard
 3
 Acquired data (3)
 7
 undefined value
 undefined value
 undefined value
 8
 undefined value
 undefined value
 undefined value

Output 2: Multi-tap information data output
 Multi-tap ID
 Number of multi-tap connectors
 Main unit terminal 1
 direct connection
 1
 Main unit terminal 2
 multi-tap connection
 6

■Calling sequence

Recommended example pattern (3) calling sequence

#difine GET_NUM (9) /* Number of peripheral data you want to get */
#difine GET_SIZE (4) /* Maximum data size of the corresponding peripheral */
#define WORKSIZE (GET_NUM * (GET_SIZE + 2) * 2) + GET_SIZE) /* Work size */
Uint32 work[WORKSIZE / 4]; /* Peripheral data acquisition work area */
                              /* Note: Be sure to define it as a global variable */
typedef struct {
                Uint8 type;
                Uint8 size;
                Uint16 data;
                Uint8 extend_data[(GET_SIZE - 2)];
}PeriData;
PerGetSys *sys_data; /* System data */

PeriData *get_per; /* Peripheral output data pointer */
PerMulInfo *mul_info;
Uint8 *get_tim; /* Time output data pointer */

- Into back initialization (1) (immediately after V-BLANK OUT processing)

PER_LInit(PER_KD_SYS, 0, 0, 0, NULL, 0); /* Specify system data acquisition */
 ...

●Intback initialization (3) (immediately after V-BLANK OUT processing)

sys_data = PER_GET_SYS(); /* Get system data */
PER_LInit(PER_KD_PERTIM, GET_NUM, GET_SIZE, work, 0);
/* Specify peripheral data + time data acquisition. V-BLANK skip count is 0 */
set_imask(0xF); /* Disable all interrupts */
INT_SetScuFunc(INT_MSK_VBLK_OUT, vblank_out ); /* Register V-BLANK_OUT interrupt function */
INT_ChgMsk(INT_MSK_VBLK_OUT, INT_MSK_NULL); /* V-BLANK_OUT interrupt enable */
set_imask(0); /* Enable all interrupts */
...

● Normally, MAIN-LOOP processing (immediately after V-BLANK OUT processing)

    ...
get_tim = PER_GET_TIM(); /* Get time */
if((mul_info[0].con + mul_info[1]) >= 3 ){ /* Check the number of valid terminals */
    if( (get_per[2].id != PER_ID_NCON_UNKNOWN) && /* Unconnected check */
        (get_per[2].id != PER_ID_PNT) ){ /* Non-mouse check */
        if(((get_per[2].data) & PER_DGT_U) == PER_DGT_U){
              /* Is the current peripheral data of connector 3 UP? */
    ...

●V-BLANK OUT interrupt processing from the second time onwards

void vblank_out(void){
    SCL_VblankEnd(); /* Give top priority to frame buffer switching */
    PER_LGetPer((PerGetPer **)&get_per, &mul_info); /* Get peripheral data */
}


BackForward
PROGRAMMER'S GUIDESMPC Interface User's Manual
Copyright SEGA ENTERPRISES, LTD., 1997