PROGRAMMER'S GUIDESMPC Interface User's Manual
BackForward
SMPC Interface User's Manual / Reference

Data specifications


Intoback command issuance


 List
 Title

Data specifications

 Data

Peripheral ID data type

 Data Name

PerId

 No

1.1

A data type that indicates a peripheral ID.

 Defined value
 Constant name
 explanation
 0xF0
 PER_ID_NCON_UNKNOWN
 Unconnected or SMPC-incompatible peripheral
 0x00
 PER_ID_DGT
 Digital device
 0x10
 PER_ID_ANL
 Analog devices
 0x20
 PER_ID_PNT
 Pointing device (mega drive mouse)
 0x30
 PER_ID_KBD
 keyboard
 0xE0
 PER_ID_MD
 Mega drive (3 buttons, 6 buttons) 


 List
 Title

Data specifications

 Data

Peripheral size data type

 Data Name

PerSize

 No

1.2

A data type that indicates the peripheral size.

 Defined value
 Constant name
 explanation
 0x0F
 PER_SIZE_NCON_15
 Unconnected or 15-byte device
 0x02
 PER_SIZE_DGT
 Digital device
 0x05
 PER_SIZE_ANL
 Mission stick
 0x08
 PER_SIZE_ANL2
 Mission stick (2 sticks)
 0x06
 PER_SIZE_3DPAD
 Multi controller
 0x03
 PER_SIZE_STEERING
 Steering controller
 0x03
 PER_SIZE_PNT
 Pointing device (shuttle mouse)
 0x04
 PER_SIZE_KBD
 keyboard
 0x01
 PER_SIZE_M3BP
 Mega drive 3 button pad
 0x02
 PER_SIZE_M6BP
 Mega drive 6 button pad 

 List
 Title

Data specifications

 Data

Intoback type Data type

 Data Name

PerKind

 No

1.3 1.3

A data type that indicates the importback type.

 Constant name
 explanation
 PER_KD_SYS
 System data acquisition (excluding time)
 PER_KD_PER
 Peripheral data acquisition
 PER_KD_PERTIM
 Peripheral data acquisition + time data acquisition 

 List
 Title

Data specifications

 Data

Required Peripheral Number Data Type

 Data Name

PerNum

 No

1.4

A data type that indicates the required number of peripherals.

 value
 meaning
 0-31
 1P ~ 32P 

 List
 Title

Data specifications

 Data

System data output data type

 Data Name

PerGetSys

 No

1.5

A data type that indicates system data output.

PerGetSys * data
 Access macro
 Mold
 explanation
 PER_GS_CC (data)
 Uint8
 Cartridge code
 PER_GS_AC (data)
 Uint8
 Area code
 PER_GS_SS (data)
 Uint16
 System status
 PER_GS_SM (data)
 Uint32
 SMPC memory
 PER_GS_SMPC_STAT (data)
 Uint8
 SMPC status

The constants and values that can be used in each access macro are shown below.

PER_GS_CC (data)
 bit7 
 bit0
 0
 0
 0
 0
 0
 0
 CTR1
 CTR0

PER_GS_AC (data)
 bit7 
 bit0
 0
 0
 0
 0
 ACODE
3
 ACODE
2
 ACODE
1
 ACODE
0

Refer to the hardware manual for the area indicated by the area code.

reference:
"HARDWARE MANUAL / SMPC User's Manual" INTBACK command

PER_GS_SS (data)
 Bit position constant
 Acquisition value
 PER_SS_DOTSEL
 DOTSEL signal status
 PER_SS_SYSRES
 SYSRES signal status
 PER_SS_MSHNMI
 MSHNMI signal state
 PER_SS_SNDRES
 SNDRES signal state
 PER_SS_CDRES
 CDRES signal state

Acquisition value description
 value
 meaning
 0
 OFF OFF
 1
 ON

PER_GS_SM (data)
This area is commonly used by applications and BOOT ROMs.
 Defined value
 Bit position constant
 Acquisition value
 0xF
 PER_MSK_LANGU
 Language constants (see below)
 (0x1 << 8)
 PER_MSK_SE
 SE (0: ON, 1: OFF)
 (0x1 << 9)
 PER_MSK_STEREO
 STEREO or MONO (0: STEREO, 1: MONO)
 (0x1 << 10)
 PER_MSK_HELP
 HELP (0: ON, 1: OFF)

Language constants
 Defined value
 Constant name
 explanation
0x0
 PER_ENGLISH
  English
0x1
 PER_DEUTSCH
 German
0x2
 PER_FRANCAIS
 French
0x3
 PER_ESPNOL
 Spanish
0x4
 PER_ITALIANO
 Italian
0x5
 PER_JAPAN
 Japanese

PER_GS_SMPC_STAT (data)
 Defined value
 Bit position constant
 Acquisition value
 (1 << 6)
 PER_SS_RESET
 Reset mask state
 0: Reset enable (default)
 1: Reset disable
 (1 << 7)
 PER_SS_SETTIME
 Time setting status
 0: Time is not set after SMPC cold reset
 1: The time is set after SMPC cold reset. 

 List
 Title

Data specifications

 Data

Peripheral data output data type

 Data Name

PerGetPer

 No

1.6

A data type that indicates peripheral data output.


 List
 Title

Data specifications

 Data

Multi-tap information

 Data Name

PerMulInfo

 No

1.7 1.7

Indicates the connection status of the peripheral connection terminal of the main unit.
You can get the following information for each terminal.

typedef struct {
    PerMulId id; / * Multitap ID * /
    PerMulCon con; / * Number of connectors * /
} PerMulInfo;

Acquisition example:
PerGetPer * per_data;
PerMulInfo * mul_info;
PER_LGetPer (& per_data, & mul_info);
    mul_info [0] .id Multi-tap ID of main unit terminal 1
    mul_info [0] .con Number of connectors for main unit terminal 1 mul_info [1] .id Multi-tap ID for main unit terminal 2
    mul_info [1] .con Number of connectors for main unit terminal 2

detail:

remarks:
There are two types of multi-tap currently supported:


Device information data type (definition example) and bit position constant

The structure definition example when accessing each peripheral data and the bit position constant are shown.
Please refer to it when defining the type.

Bit position constant Common items

If the bit position constant described below is a button, the meaning is as follows:

Acquisition value description
 value
 meaning
 0
 Pressing the button
 1
 Not pressing the button 


 List
 Title

Data specifications

 Data

Digital device data

 Data Name

smpDgtData

 No

2.1

This is an example of a data type definition that indicates digital device information.

typedef struct {/ * digital device * /
    PerId id; / * Peripheral type * /
    PerSize size; / * Peripheral size * /
    Uint16 data; / * Digital device data * /
} smpDgtData;

Below are the bit position constants for digital devices.

Uint16 data; / * Digital device data type * /
 BIT position
 Bit position constant
 Acquisition value
 bit15
 PER_DGT_R
 Direction key RIGHT
 bit14
 PER_DGT_L
 Direction key LEFT
 bit13
 PER_DGT_D
 Direction key DOWN
 bit12
 PER_DGT_U
 Direction key UP
 bit11
 PER_DGT_S
 START button
 bit10
 PER_DGT_A
 A button
 bit9
 PER_DGT_C
 C button
 bit8
 PER_DGT_B
 B button
 bit7
 PER_DGT_TR
 TRG-RIGHT (at the top right of the device)
 bit6
 PER_DGT_X
 X button
 bit5
 PER_DGT_Y
 Y button
 bit4
 PER_DGT_Z
 Z button
 bit3
 PER_DGT_TL
 TRG-LEFT (at the top left of the device) 


 List
 Title

Data specifications

 Data

Analog device data

 Data Name

smpAnlData

 No

2.2

This is an example of a data type definition that indicates analog device information.

typedef struct {/ * analog device * /
	    PerId id; / * Peripheral type * /
    PerSize size; / * Peripheral size * /
    Uint16 data; / * Digital data * /
    Uint8 x; / * Analog ch0 data (0 to 255) * /
    Uint8 y; / * Analog ch1 data (0 to 255) * /
    Uint8 r; / * Analog ch2 data (0 to 255) * /
    Uint8 l; / * Analog ch3 data (0 to 255) * /
} smpAnlData;


 List
 Title

Data specifications

 Data

Pointing device data

 Data Name

smpPntData

 No

2.3

This is an example of a data type definition that indicates pointing device information.

typedef struct {/ * pointing device * /
    PerId id; / * Peripheral type * /
    PerSize size; / * Peripheral size * /
    Uint8 info; / * Overflow, code information * /
    Uint8 x; / * Absolute value of X-axis movement (0 to 127) * /
    Uint8 y; / * Absolute value of Y-axis movement (0 to 127) * /
} smpPntData;

The bit position constants that can be used for pointing devices are shown below.

Uint8 info; / * Overflow, code information * /
 BIT position
 Bit position constant
 Acquisition value
 bit7
 PER_PNT_YO
 Y-axis overflow (0: overflow, 1: non-overflow)
 bit6
 PER_PNT_XO
 X-axis overflow (0: overflow, 1: non-overflow)
 bit5
 PER_PNT_YS
 Y-axis sign (0: positive, 1: negative)
 bit4
 PER_PNT_XS
 X-axis sign (0: positive, 1: negative)
 bit3
 PER_PNT_S
 START button
 bit2
 PER_PNT_MID
 Middle button
 bit1
 PER_PNT_R
 Right button
 bit0
 PER_PNT_L
 Left button 


 List
 Title

Data specifications

 Data

Keyboard device data

 Data Name

smpKbdData

 No

2.4

This is an example of a data type definition that indicates a keyboard device.

typedef struct {/ * keyboard device data * /
    PerId id; / * Peripheral type * /
    PerSize size; / * Peripheral size * /
    PerDgtInfo dgt; / * Digital device data * /
    Uint8 skey; / * Special key * /
    Uint8 key; / * key * /
} smpKbdData;

The constants and values that can be used by each member are shown below.

 BIT position
 Bit position constant
 Acquisition value
 bit6
 PER_KBD_CL
 Caps Lock
 bit5
 PER_KBD_NL
 Num Lock
 bit4
 PER_KBD_SL
 Scrool Lock
 bit3
 PER_KBD_MK
 Make
(0: key pressed, 1: not pressed)
 bit0
 PER_KBD_BR
 Break
(0: key released, 1: key not released)
Please refer to the following information for key codes and countermeasures against simultaneous pressing.

reference:
Devloper's Information STN-45 Sega Saturn Keyboard Supplementary Explanation

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