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

data specifications


Issue an intoback command


 one
View
table
 Title

data specifications

 Data

Peripheral ID data type

 Data Name

PerId

 No

1.1

A data type that indicates a peripheral ID.

 Definition value
 constant name
 explanation
 0xF0
 PER_ID_NCON_UNKNOWN
 Unconnected or non-SMPC-compatible peripherals
 0x00
 PER_ID_DGT
 digital device
 0x10
 PER_ID_ANL
 analog device
 0x20
 PER_ID_PNT
 Pointing device (Mega Drive Mouse)
 0x30
 PER_ID_KBD
 keyboard
 0xE0
 PER_ID_MD
 Mega Drive (3 buttons, 6 buttons) 


 one
View
table
 Title

data specifications

 Data

Peripheral size data type

 Data Name

PerSize

 No

1.2

A data type that indicates the peripheral size.

 Definition value
 constant name
 explanation
 0x0F
 PER_SIZE_NCON_15
 Not connected 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
 megadrive 3 button pad
 0x02
 PER_SIZE_M6BP
 megadrive 6 button pad 

 one
View
table
 Title

data specifications

 Data

Intoback type data type

 Data Name

PerKind

 No

1.3

This is a data type that indicates the type of intback.

 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 

 one
View
table
 Title

data specifications

 Data

Required number of peripherals data type

 Data Name

PerNum

 No

1.4

A data type that indicates the number of required peripherals.

 value
 meaning
 0-31
 1P~32P 

 one
View
table
 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

Please 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
 Obtained value
 PER_SS_DOTSEL
 DOTSEL signal status
 PER_SS_SYSRES
 SYSRES signal state
 PER_SS_MSHNMI
 MSHNMI signal state
 PER_SS_SNDRES
 SNDRES signal status
 PER_SS_CDRES
 CDRES signal status

Obtained value description
 value
 meaning
 0
 OFF
 1
 ON

PER_GS_SM(data)
This area is commonly used by applications and BOOT ROM.
 Definition value
 bit position constant
 Obtained value
 0xF
 PER_MSK_LANGU
 Linguistic 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<< Ten)
 PER_MSK_HELP
 HELP(0:ON,1:OFF)

language constants
 Definition 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)
 Definition value
 bit position constant
 Obtained value
 (1<< 6)
 PER_SS_RESET
 Reset mask status
 0: Reset enable (default)
 1: Reset disabled
 (1<< 7)
 PER_SS_SETTIME
 Time setting status
 0: Time has not been set after SMPC cold reset
 1: Setting the time after SMPC cold reset 

 one
View
table
 Title

data specifications

 Data

Peripheral data output data type

 Data Name

PerGetPer

 No

1.6

A data type that indicates peripheral data output.


 one
View
table
 Title

data specifications

 Data

Multi-tap information

 Data Name

PerMulInfo

 No

1.7

Indicates the connection status of the main unit's peripheral connection terminals.
You can obtain the following information for each terminal.

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

Example of acquisition:
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 currently two types of multi-tap supported:


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

Examples of structure definitions and bit position constants when accessing each peripheral data are shown below.
Please use this as a reference when defining types.

Bit position constants common items

If the bit position constants described below are buttons, their meanings are as follows:

Obtained value description
 value
 meaning
 0
 pressing the button
 1
 button not pressed 


 one
View
table
 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 bit position constants for digital devices.

Uint16 data; /* Digital device data type */
 BIT position
 bit position constant
 Obtained value
 bit15
 PER_DGT_R
 Direction key RIGHT
 bit14
 PER_DGT_L
 Directional 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 (located 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 (located at the top left of the device) 


 one
View
table
 Title

data specifications

 Data

analog device data

 Data Name

smpAnlData

 No

2.2

This is an example of defining a data type 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;


 one
View
table
 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, sign information */
    Uint8 x; /* Absolute value of X-axis movement amount (0 to 127) */
    Uint8 y; /* Absolute value of Y-axis movement amount (0 to 127) */
}smpPntData;

Below are the bit position constants that can be used for pointing devices.

Uint8 info; /* Overflow, sign information */
 BIT position
 bit position constant
 Obtained 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
 center button
 bit1
 PER_PNT_R
 right button
 bit0
 PER_PNT_L
 left button 


 one
View
table
 Title

data specifications

 Data

keyboard device data

 Data Name

smpKbdData

 No

2.4

This is an example of defining a data type 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 in each member are shown below.

 BIT position
 bit position constant
 Obtained value
 bit6
 PER_KBD_CL
 Caps Lock
 bit5
 PER_KBD_NL
 Num Lock
 bit4
 PER_KBD_SL
 Scroll Lock
 bit3
 PER_KBD_MK
 Make
(0: key pressed, 1: key not pressed)
 bit0
 PER_KBD_BR
 Break
(0: key is released, 1: key is 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 Information

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