Japanese
HARDWARE ManualSMPC User's Manual
Back | ■
SMPC User's Manual/Chapter 3 Peripheral Control

■3.4 Peripheral access protocol

This section shows the peripheral access protocol in SH-2 direct mode .

●About peripheral port bit names

The configuration of the SMPC peripheral port is inherited from the Mega Drive peripheral port in order to maintain compatibility with the Mega Drive. Therefore, we have decided to inherit the port bit names from the Mega Drive. Table 3.22 shows the correspondence between port bit numbers and port bit names. From now on, this manual uses port bit names for explanations.

Table 3.22 Correspondence between port bit number and port bit name
 port bit number
 bit6
 bit5
 bit4
 bit3
 bit2
 bit1
 bit0
 port bit name
 T.H.
 T.R.
 T.L.
 R
 L
 D
 U

●Megadrive peripheral ID calculation method in SH-2 direct mode

The Mega Drive peripheral ID calculation formula is shown below.
Megadrive peripheral ID is represented by 4 bits: ID3 ID2 ID1 ID0.

ID3=R# L (TH=1) ID2=D# U (TH=1) ID1=R# L (TH=0) ID0=D# U (TH=0)

# indicates logical sum (OR).

●Port settings when acquiring Mega Drive peripheral ID

Table 3.23 shows the port direction register settings when acquiring the Mega Drive peripheral ID. You can set the port direction as shown below, read the RLDU when TH=1 and the RLDU when TH=0, and calculate the Mega Drive peripheral ID using the above formula.
Please read R, L, D, and U after 2μs after TH changes.

Table 3.23 Port direction register setting value when acquiring Mega Drive peripheral ID
 port bit name
 T.H.
 T.R.
 T.L.
 R
 L
 D
 U
 port direction
 set to output
 set to input 

●Megadrive peripheral ID of each peripheral

Table 3.24 shows the MegaDrive peripheral ID for each peripheral.

Table 3.24 MegaDrive Peripheral ID for each peripheral
 Peripheral name
 mega drive
Peripheral ID
 Megadrive 3 button PAD
 DH
 Megadrive 6 button PAD
 DH&CH
 sega mouse
 3H
 sega tap
 7H
 saturn standard pad
 BH
 saturn analog joystick
 5H
 saturn keyboard
 5H
 saturn multitap
 5H

Note: "Saturn Standard Pad", "Saturn Analog Joystick", "Saturn Keyboard", and "Saturn Multi-Tap" are development names.


Back | ■
HARDWARE ManualSMPC User's Manual
Copyright SEGA ENTERPRISES, LTD., 1997