background image
SEGA Confidential
General Notice
When using this document, keep the following in mind:
1. This document is confidential. By accepting this document you acknowledge that you are bound
by the terms set forth in the non-disclosure and confidentiality agreement signed separately and /in
the possession of SEGA. If you have not signed such a non-disclosure agreement, please contact
SEGA immediately and return this document to SEGA.
2. This document may include technical inaccuracies or typographical errors. Changes are periodi-
cally made to the information herein; these changes will be incorporated in new versions of the
document. SEGA may make improvements and/or changes in the product(s) and/or the
program(s) described in this document at any time.
3. No one is permitted to reproduce or duplicate, in any form, the whole or part of this document
without SEGA'S written permission. Request for copies of this document and for technical
information about SEGA products must be made to your authorized SEGA Technical Services
representative.
4. No license is granted by implication or otherwise under any patents, copyrights, trademarks, or
other intellectual property rights of SEGA Enterprises, Ltd., SEGA of America, Inc., or any third
party.
5. Software, circuitry, and other examples described herein are meant merely to indicate the character-
istics and performance of SEGA's products. SEGA assumes no responsibility for any intellectual
property claims or other problems that may result from applications based on the examples
describe herein.
6. It is possible that this document may contain reference to, or information about, SEGA products
(development hardware/software) or services that are not provided in countries other than Japan.
Such references/information must not be construed to mean that SEGA intends to provide such
SEGA products or services in countries other than Japan. Any reference of a SEGA licensed prod-
uct/program in this document is not intended to state or simply that you can use only SEGA's
licensed products/programs. Any functionally equivalent hardware/software can be used instead.
7. SEGA will not be held responsible for any damage to the user that may result from accidents or any
other reasons during operation of the user's equipment, or programs according to this document.
(6/27/95- 002)
NOTE: A reader's comment/correction form is provided with this
document. Please address comments to :
SEGA of America, Inc., Developer Technical Support (att. Evelyn Merritt)
150 Shoreline Drive, Redwood City, CA 94065

SEGA may use or distribute whatever information you supply in any way
it believes appropriate without incurring any obligation to you.
background image
SEGA Confidential


TM
© 1994 SEGA. All Rights Reserved.
SMPC
User's Manual
Doc. # ST-169-R1-072694
background image
SEGA Confidential


READER CORRECTION/COMMENT SHEET
Chpt.
pg. #
Correction
Corrections:
General Information:
Your Name
Phone
Document number
Date
Document name
Questions/comments:
Keep us updated!
If you should come across any incorrect or outdated information while reading through the attached
document, or come up with any questions or comments, please let us know so that we can make the
required changes in subsequent revisions. Simply fill out all information below and return this form to
the Developer Technical Support Manager at the address below. Please make more copies of this form if
more space is needed. Thank you.
Fax:
(415) 802-1440
Attn: Sr. Coordinator,
Technical Publications Group
Mail:
SEGA OF AMERICA
Attn: Sr. Coordinator,
Technical Publications Group
130 Shoreline Dr.
Redwood City, CA 94065
Where to send your corrections:
ST-169-R1-072694
SMPC User's Manual
background image
SEGA Confidential

i
Introduction
Explanation of Terminology
The terminology used in this manual is explained below.
SMPC (System Manager & Peripheral Control)
Controls peripheral equipment interfaces, such as SATURN system reset control, control PAD,
etc.
The SMPC also has RTC (Real Time Clock) functions that can be backed up with a battery,
making it possible to set and acquire calendar time.
SCSP (Saturn Custom Sound Processor)
Sound source LSI for multi-function games that integrate PCM sound source and sound DSP.
DSP (Digital Signal Processor)
High-speed calculation circuit used primarily for calculations (multiplication and addition).
VDP1 (Video Display Processor 1)
The LSI that controls the drawing of sprites and polygons. VRAM and a frame buffer are
connected to the VDP1. These use the draw commands transferred to the VRAM from the CPU
and execute drawing in the frame buffer. Then the draw data from the frame buffer is trans-
ferred to the VDP2 and displayed on a display device at the request from the VDP2.
VDP2 (Video Display Processor 2)
Contains scroll screen control functions and priority functions.
PLL (Phase Locked Loop)
All of the clock types (CPU, system control, image draw/display, sound, etc., clock generator)
of the SATURN system.
background image
SEGA Confidential

ii
SCU (System Control Unit)
Contains a CPU I/F, A-Bus I/F, and B-Bus I/F controller and smoothly transfers data between
the various buses. The SCU also contains an internal DMA controller, interrupt controller, and
DSP to perform DMA control, interrupt control, and high-speed calculation processing.
Main CPU
Contains a 32-bit RISC CPU SH-2 that controls the entire system.
MC68EC000
A sound control CPU with a SCSP that has SCSP control functions.
V-BLANK-IN
One of the three types of blanking interrupts. V-BLANK-IN shows the screen display end
timing.
V-BLANK-OUT
One of the three types of blanking interrupts. V-BLANK-OUT shows the screen display start
timing.
H-BLANK-IN
One of the three types of blanking interrupts. H-BLANK-IN shows the display end timing of
one line.
Peripheral
Peripheral equipment connected to SATURN, such as control PAD, mouse, and keyboard.
background image
SEGA Confidential

iii
Symbols Used in this Manual
The following symbols are used in this manual.
Binary
Shown by a "B" placed at the end. For example, 100
B
. When only 1 bit is used, however, the
"B" is abbreviated.
Hexadecimal
Shown by an "H" at the end. For example, 00
H
or FF
H
.
Units
Shows that 1 KB is 1,024 bytes. Thus, 1 MB is 1,048,576 bytes.
MSB and LSB
In the structure of bytes and words, the left is the Most Significant Bit (MSB) and the right is
the Least Significant Bit (LSB).
Undefined Bit
Undefined bits in the sound source register or DSP register are shown by "--."
(R)
Signifies a read dedicated register.
(W)
Signifies a write dedicated register.
(R/W)
Signifies a register in which both reading and writing are possible.
BCD
Binary Coded Decimal.
background image
SEGA Confidential

iv
Table of Contents
Introduction ............................................................................................................................... (i)
Explanation of Terminology ................................................................................................ (i)
Symbols Used in this Manual ............................................................................................ (iii)
Table of Contents .................................................................................................................... (iv)
List of Figures .................................................................................................................... (v)
List of Tables .................................................................................................................... (vi)
Section 1 Overview ................................................................................................................... 1
1.1 System Configuration ................................................................................................... 2
1.2 SH-2 Interface .............................................................................................................. 5
Section 2 SMPC Commands ................................................................................................... 11
2.1 SMPC Command List ................................................................................................ 12
2.2 Command Issue ......................................................................................................... 13
2.3 Resetable System Management Commands ............................................................ 21
2.4 Non-Resetable System Management Commands..................................................... 35
2.5 RTC Commands ........................................................................................................ 45
Section 3 Peripheral Control .................................................................................................. 47
3.1 Peripheral Control Mode ............................................................................................ 48
3.2 SATURN Peripheral Standard Formats ..................................................................... 76
3.3 Support Peripheral Data Format in SMPC Control Mode ...........................................81
3.4 Support Peripheral Data Format in SH-2 Direct Mode................................................86
Index ........................................................................................................................................ 104
background image
SEGA Confidential

List of Figures
Section 1 Overview
Figure 1.1
SMPC System Configuration ........................................................................ 2
Figure 1.2
Standard Digital PAD for SATURN ................................................................ 4
Figure 1.3
SH-2 Interface Register Address Map ........................................................... 5
Figure 1.4
Parallel I/O Register Address Map ................................................................ 7
Section 2 SMPC Commands
Figure 2.1
Type A Command Flow ............................................................................... 14
Figure 2.2
Type B Command Flow ............................................................................... 14
Figure 2.3
Type C Command Flow ............................................................................... 15
Figure 2.4
Type D Command Flow ............................................................................... 16
Figure 2.5
INTBACK Command Issue Timing .............................................................. 18
Figure 2.6
INTBACK Command Issue Timing After SYSRES,
CKCHG320, CKCHG352 Command Execution ...........................................18
Figure 2.7
Issue of Other Commands .......................................................................... 19
Section 3 Peripheral Control
Figure 3.1
SMPC Control Mode Block Diagram ........................................................... 48
Figure 3.2
SMPC Control Mode Setting Example ........................................................ 49
Figure 3.3
All Peripheral Data Acquisition Sequence ................................................... 51
Figure 3.4
Peripheral Data Acquisition Cancel Sequence Due to Break Request ........ 52
Figure 3.5
Overview of Peripheral Data Collection Time Optimization.......................... 55
Figure 3.6
IREG0 (During INTBACK Command Execution) ......................................... 58
Figure 3.7
IREG0 (During Continue and Break Requests) ...........................................58
Figure 3.8
IREG1.......................................................................................................... 59
Figure 3.9
IREG2.......................................................................................................... 60
Figure 3.10
Result Parameter Standard Configuration Acquired
Using INTBACK Command ......................................................................... 62
Figure 3.11
Result Parameter Configuration when
One Port Is 0 Byte Mode ............................................................................. 63
Figure 3.12
Peripheral Data Configuration ..................................................................... 65
Figure 3.13
Peripheral Control Status ............................................................................ 66
Figure 3.14
Port Status Configuration ........................................................................... 67
Figure 3.15
SATURN Peripheral ID Configuration ......................................................... 69
Figure 3.16
Peripheral Data Configuration 1 .................................................................. 70
Figure 3.17
Peripheral Data Configuration 2 .................................................................. 71
Figure 3.18
Peripheral Data Configuration 3 .................................................................. 71
Figure 3.19
SATURN Peripheral ID when Tap Unconnected .......................................... 73
Figure 3.20
SATURN Peripheral ID when Tap Unknown ............................................... 73
Figure 3.21
SH-2 Direct Mode Block Diagram ............................................................... 74
Figure 3.22
SH-2 Direct Mode Setting Example ............................................................ 75
v
background image
SEGA Confidential

List of Tables
Section 1 Overview
Table 1.1
Initialization Status During Power On ............................................................. 3
Table 1.2
SMPC Functions ............................................................................................. 3
Table 1.3
DDR Functions ............................................................................................... 7
Table 1.4
IOSEL Functions ............................................................................................ 8
Table 1.5
EXLE Functions .............................................................................................. 9
Section 2 SMPC Commands
Table 2.1
Resetable System Management Commands ................................................12
Table 2.2
Non-Resetable System Management Commands ........................................12
Table 2.3
RTC Commands ........................................................................................... 12
Table 2.4
Command Issue Types ................................................................................. 13
Table 2.5
SH-2 Command Issue Limitations ................................................................ 20
Section 3 Peripheral Control
Table 3.1
Parallel I/O Register Default Values During Power On.................................. 49
Table 3.2
Continue and Break Issue Conditions .......................................................... 50
Table 3.3
Example Acquisition Command Parameter Setting
When Only Peripheral Data Is Required ...................................................... 54
Table 3.4
Command Parameter Setting Conditions and
Peripheral Data Configuration ...................................................................... 64
Table 3.5
Relation Between the Number of Connections and Peripherals ...................67
Table 3.6
Relation Between Connected Peripherals and Multitap ID ...........................68
Table 3.7
Multitap ID and Number of Connections....................................................... 68
Table 3.8
Combinations of Peripheral Data Size and Port Mode .................................. 70
Table 3.9
Combinations of Peripheral Data Size and Port Mode .................................. 73
Table 3.10
SATURN Digital Device Standard Format .................................................... 76
Table 3.11
SATURN Analog Device Standard Format ................................................... 77
Table 3.12
SATURN Pointing Device Standard Format ................................................. 78
Table 3.13
SATURN Keyboard Device Standard Format ................................................79
Table 3.14
Mega Drive 3-Button PAD Data Format in SMPC Control Mode...................81
Table 3.15
Mega Drive 6-Button PAD Data Format in SMPC Control Mode...................81
Table 3.16
SATURN Mouse Data Format in SMPC Control Mode .................................82
Table 3.17
SEGA Tap Port Status in SMPC Control Mode .............................................82
Table 3.18
SATURN Standard PAD Data Format in SMPC Control Mode .....................82
Table 3.19
SATURN Analog Joystick Data Format in SMPC Control Mode ...................83
Table 3.20
SATURN Keyboard Data Format in SMPC Control Mode .............................83
Table 3.21
SATURN 6P Multitap Port Status ................................................................. 85
Table 3.22
Relationship Between Port Bit Number and Port Bit Name ...........................86
Table 3.23
Port Direction Register Setting Value During Mega Drive
Peripheral ID Acquisition .............................................................................. 87
Table 3.24
Mega Drive Peripheral ID for Each Peripheral ..............................................88
Table 3.25
Mega Drive 3-Button PAD Data Format for SH-2 Direct Mode ......................90
Table 3.26
Mega Drive 6-Button PAD Data Format for SH-2 Direct Mode ......................90
Table 3.27
Data Format During SATURN Mouse Power On Reset for
SH-2 Direct Mode ......................................................................................... 91
Table 3.28
Data Format During SATURN Mouse Reset for SH-2 Direct Mode .............. 92
vi
background image
SEGA Confidential
Table 3.29
Data Format During SATURN Mouse Data Request for SH-2 Direct Mode ....... 93
Table 3.30
Data Format During SEGA Tap Power On Reset for SH-2 Direct Mode ............ 94
Table 3.31
Data Format During SEGA Tap Data Request for SH-2 Direct Mode ................ 95
Table 3.32
Connected Peripherals and ID ........................................................................... 95
Table 3.33
Mega Drive 3-Button PAD Data Format During Connection to SEGA Tap ......... 96
Table 3.34
Mega Drive 6-Button PAD Data Format During Connection to SEGA Tap ......... 96
Table 3.35
SEGA Mouse Data Format During Connection to SEGA Tap ............................ 96
Table 3.36
SATURN Standard PAD Data Format for SH-2 Direct Mode ............................. 97
Table 3.37
SATURN Analog Joystick Data Format for SH-2 Direct Mode ........................... 98
Table 3.38
SATURN Keyboard Data Format for SH-2 Direct Mode ................................... 100
Table 3.39
SATURN 6P Multitap Data Format for SH-2 Direct Mode ................................ 103
vii
background image
SEGA Confidential


SMPC User's Manual
1
Section 1 Overview
Section 1 Contents
1.1 System Configuration.................................... 2
Functions ....................................................... 3
PAD ................................................................ 4
1.2 SH-2 Interface ............................................... 5
SH-2 Interface Registers ............................... 5
Parallel I/O Registers .................................... 7
background image
SEGA Confidential

2
1.1
System Configuration
The SMPC manages SATURN system reset control when the power is turned on and
NMI requests to the master SH-2 when the reset button is pushed. In addition,
commands from SH-2 turn each LSI on and off, sets and acquires calendar time, and
collects data from peripherals. Also, the clock change command switches the hori-
zontal resolution to and from 320 dots and 352 dots.
Control
Bus
Address
Bus
Data
Bus
SNDRES
SYSRES
MSHRES
MSHNMI
SSHRES
SSHNMI
CDRES
DOTSEL
MC68EC000
MSH-2
SSH-2
Address
Buffer
Data
Buffer
SMPC
SCU
VDP1
VDP2
SCSP
PLL
I/O
I/O
SH I/F
IOSEL
4-bit CPU
Core
To CD Block
RES
NMI
RES
NMI
Peripheral
Peripheral
RES
RES
RES
RES
Figure 1.1 SMPC System Configuration
background image
SEGA Confidential



SMPC User's Manual
3
The SMPC has two sets of 7-bit parallel I/O ports. Access to I/O ports is controlled
by the SMPC's internal firmware and there are two access methods that can be se-
lected: the SMPC control mode which outputs collected data to the SMPC output
register (OREG), and the SH-2 direct mode which has direct access from the SH-2.
For details regarding the SMPC control mode and SH-2 direct mode, refer to Section 3.
During power on, the SATURN internal units are initialized as shown in Table 1.1.
Table 1.1 Initialization Status During Power On
Functions
The SMPC has three major functions: Real Time Clock (RTC), System Manager (SM),
and Peripheral Control (PC).
The SMPC's main functions are shown in Table 1.2.
Table 1.2 SMPC Functions
Status
Description
Sound CPU OFF Status
A reset enters the sound CPU. Output by a power on
vector by the SNDON command.
VDP1, VDP2, SCU, SCSP
ON Status
A status where access from the SH-2 is possible.
Slave SH OFF Status
A reset enters the slave SH-2. Output by a power on
vector by the SSHON command.
DOT SEL OFF Status
The PLL oscillation frequency is in the 320 mode
(NTSC: 26.8741 MHz, PAL: 26.6875 MHz) and the
VDP1, VDP2 and SH-2 are run at this frequency.
Changed to run in 352 mode (NTSC: 28.6364 MHz,
PAL: 28.4375 MHz) by the CKCHG352 command.
CD Block ON Status
A status where access from the SH-2 is possible.
RTC
(Real Time Clock)
· Time setting and acquisition from SH-2.
· Automatic update of date, day, time
(Battery backup is possible when main power off)
S M
(System Management)
· Sound CPU on and off
· Master SH-2 and slave SH-2 on and off
· System reset control
· Clock switching (PLL switching)
· Power on reset
· NMI request to master SH-2 when front panel
button is pushed down.
PC
(Peripheral Control)
· Can support peripheral with SATURN peripheral
interface specifications.
· Automatic collection of peripheral data from control
PAD, mouse, etc.
· Also supports Mega Drive peripherals (3-button, 6-
button, SEGA tap) (a conversion adapter is
required, however)
background image
SEGA Confidential

4
PAD
The SATURN digital standard PAD has up, down, left, right, A, B, C, X, Y, Z, L, R,
and Start buttons.
Figure 1.2 Standard Digital PAD for SATURN
background image
SEGA Confidential


SMPC User's Manual
5
1.2
SH-2 Interface
SH-2 Interface Registers
The SH-2 interface registers are registers that are used to receive commands, com-
mand parameters, and status display from the SH-2 and to output result parameters.
Figure 1.3 shows the SH-2 interface register address map.
Figure 1.3 SH-2 Interface Register Address Map
2010001F
H
20100061
H
20100063
H
20100001
H
20100003
H
20100005
H
20100007
H
20100009
H
2010000B
H
2010000D
H
20100021
H
20100023
H
20100025
H
20100027
H
20100029
H
2010002B
H
2010002D
H
2010002F
H
20100031
H
20100033
H
20100035
H
20100037
H
20100039
H
2010003B
H
2010003D
H
2010003F
H
20100041
H
20100043
H
20100045
H
20100047
H
20100049
H
2010004B
H
2010004D
H
2010004F
H
20100051
H
20100053
H
20100055
H
20100057
H
20100059
H
2010005B
H
2010005D
H
2010005F
H
b it7
b it0
b it7
b it0
b it7
b it0
b it7
b it0
b it0
COMREG
SR
SF
IREG0
IREG1
IREG2
IREG3
IREG4
IREG5
IREG6
OREG0
OREG1
OREG2
OREG3
OREG4
OREG5
OREG6
OREG7
OREG8
OREG9
OREG10
OREG11
OREG12
OREG13
OREG14
OREG15
OREG16
OREG17
OREG18
OREG19
OREG20
OREG21
OREG22
OREG23
OREG24
OREG25
OREG26
OREG27
OREG28
OREG29
OREG30
OREG31
b it7
b it0
R : Read Only
W : Write Only
R/W: Read/Write
W
R
R/W
W
R
R
Only byte access is possible for all registers.
background image
SEGA Confidential

6
The details on SH-2 interface registers are as follows:
COMREG (W): COMmand REGister
This is an 8-bit register used to receive commands from the SH-2. At the same time a
command is written, the SMPC interprets and executes the command. The SMPC
has resetable system management commands, non-resetable system management
commands, and RTC commands. Use byte access from the SH-2.
SR (R): Status REGister
This 8-bit register is used to display the status after SMPC command execution. A
read from the SH-2 can be done at any time regardless of the command being issued.
For peripheral control, each peripheral control status is shown. Use byte access from
the SH-2.
SF (R/W): Status Flag
This flag controls command issue. Flag set is performed by the SH-2 before com-
mand issue and the flag is reset by the SMPC when the command is ended. When
from the SH-2, only set is possible, and when setting, write to 01
H
. During read, all
bits except bit0 are undefined. Using this flag makes it possible to control the dual
issue of commands.
IREG0~IREG6 (W): Input REGister 0~6
These 8-bit registers are used to receive command parameters from the SH-2. The
SMPC has 7 IREG registers. Use byte access from the SH-2.
OREG0~OREG31 (R): Output REGister 0~31
These 8-bit registers are used to used to output result parameter and peripheral data
to the SH-2. The SMPC has 32 OREG which are used when reading the cartridge
code, area code, peripheral data, current time, etc. Use byte access from the SH-2.
background image
SEGA Confidential


SMPC User's Manual
7
Parallel I/O Registers
These registers are used to control the peripheral interface inside the SMPC.
Figure 1.4 shows parallel I/O register address map. Write-only registers cannot be
read, so caution regarding this is required.
20100075
H
20100079
H
PDR1
b it6
b it0
20100077
H
2010007B
H
b it6
b it0
DDR1
PDR2
DDR2
2010007D
H
2010007F
H
IOSEL2
EXLE2
IOSEL1
EXLE1
b it1
b it0
W : Write Only
R/W: Read/Write
R/W
W
W
W
R/W
W
Only byte access is allowed to all the registers.
Figure 1.4 Parallel I/O Register Address Map
DDR1 (W): Data Direction Register 1
This is a 7-bit register used for setting, in bit units, the peripheral port 1 (P1) I/O
direction. "0" is written to set for input and "1" is written to set for output. Please
use byte access from the SH-2.
DDR2 (W): Data Direction Register 2
This is a 7-bit register used for setting, in bit units, the peripheral port 2 (P2) I/O
direction. "0" is written to set for input and "1" is written to set for output. Please
use byte access from the SH-2.
Table 1.3 DDR Functions
PDR1 (R or W): Port Data Register 1
The PDR1 is a 7-bit register that is used to store peripheral port 1 (P1) data. Whether
all the PDR1 bits are at the input port or the output port is determined by DDR1
setting. The port terminal status that is set to output can be changed by writing data
in this register. The port terminal status that is set to input can be changed by read-
ing this register. Also, for ports set to output, the value written in to the PDR1 is read
out rather than the terminal status. Please use byte access from the SH-2.
Bit
Function
0
Input Setting (Initial Value)
1
Output Setting
background image
SEGA Confidential


8
PDR2 (R or W): Port Data Register 2
The PDR2 is a 7-bit register that is used to store peripheral port 2 (P2) data. Whether
all the PDR2 bits are at the input port or the output port is determined by DDR2
setting. The port terminal status that is set to output can be changed by writing data
in this register. The port terminal status that is set to input can be changed by read-
ing this register. Also, for ports set to output, the value written in to the PDR2 is read
out rather than the terminal status. Please use byte access from the SH-2.
IOSEL1 (W): I/O SELect 1
The peripheral port 1 (P1) is set to SMPC control mode or SH-2 direct mode. Writing
"0" specifies the SMPC control mode and writing "1" specifies the SH-2 direct mode.
Use byte access from the SH-2.
IOSEL2 (W): I/O SELect 2
The peripheral port 2 (P2) is set to SMPC control mode or SH-2 direct mode. Writing
"0" specifies the SMPC control mode and writing "1" specifies the SH-2 direct mode.
Use byte access from the SH-2.
Table 1.4 IOSEL Functions
For details regarding each mode, refer to Section 3.
EXLE1 (W): EXternal Latch Enable 1
The peripheral port 1 (P1) bit 6 is a setting bit that is used for PAD interrupt and
VDP2 external latch input. It is disabled by writing "0," and the peripheral port 1 bit
6 is normally set as an I/O port. It is enabled by writing "1," which allows the pe-
ripheral port 1 bit 6 to be used for PAD interrupt input or VDP2 external latch input.
Use byte access from the SH-2.
Bit
Function
0
Sets to SMPC control mode (Initial Value)
1
Sets to SH-2 direct mode
background image
SEGA Confidential



SMPC User's Manual
9
EXLE2 (W): EXternal Latch Enable 2
The peripheral port 2 (P2) bit 6 is a setting bit that is used for PAD interrupt and
VDP2 external latch input. It is disabled by writing "0," and the peripheral port 1 bit
6 is normally set as an I/O port. It is enabled by writing "1," which allows the pe-
ripheral port 1 bit 6 to be used for PAD interrupt input or VDP2 external latch input.
Use byte access from the SH-2.
Table 1.5 EXLE Functions
EXLE is multiplexed in I/O port bit 6. Therefore, when using EXLE, the DDR1 and
DDR2 bit 6 must be set to input. (Refer to VDP2 external latch functions and SCU
PAD Interrupt.)
Bit
Function
0
Disable (Initial Value)
1
Enable
background image
SEGA Confidential

10
(This page is blank in the original Japanese document.)
background image
SEGA Confidential


SMPC User's Manual
11
Chapter 2 SMPC Commands
Section 2 Contents
2.1 SMPC Command List .............................................. 12
2.2 Command Issue ....................................................... 13
Command Issue Method.......................................... 13
Command Issue Timing ........................................... 17
Command Issue Limitations .................................... 19
2.3 Resetable System Management Commands ........... 21
2.4 Non-Resetable System Management Commands ... 35
2.5 RTC Commands ...................................................... 45
background image
SEGA Confidential

2.1
SMPC Command List
SMPC commands are divided into three types; resetable system management com-
mands, non-resetable system management commands, and RTC commands. Each of
these commands is shown below.
Table 2.1 Resetable System Management Commands
Table 2.2 Non-Resetable System Management Commands
1
2
Interrupt Back
SMPC Memory Setting
INTBACK
SETSMEM
10
H
17
H
Used
Unused
Used
Unused
0
~
31
31
0
~
2
0
~
3
Command
Code
No
Command Name
Command
Abbreviation
SMPC
Interrupt
SR
OREG
IREG
Execution Time
sec
max
min
40 µ
320m
Table 2.3 RTC Commands
12
1
Time Setting
SETTIME
16H
31
0~6
Unused
Unused
Command
Code
No
Command Name
Command
Abbreviation
SMPC
Interrupt
SR
OREG
IREG
Execution Time
sec
max
min
70 µ
No
Command Name
SR
OREG
IREG
Execution Time
sec
1
2
3
4
5
6
7
8
9
10
11
12
13
Master SH-2 ON
Slave SH-2 ON
Slave SH-2 OFF
Sound ON
Sound OFF
CD ON
CD OFF
Reset Entire System
Clock Change 352 Mode
Clock Change 320 Mode
NMI Request
Reset Enable
Reset Disable
31
31
31
31
31
31
31
31
31
31
31
31
31
Command
Code
Command
Abbreviation
SMPC
Interrupt
MSHON
SSHON
SSHOFF
SNDON
SNDOFF
CDON
CDOFF
SYSRES
CKCHG352
CKCHG320
NMIREQ
RESENAB
RESDISA
00
H
02
H
03
H
06
H
07
H
08
H
09
H
0D
H
0E
H
0F
H
18
H
19
H
1A
H
Unused
Unused
Unused
Unused
Unused
Unused
Unused
Unused
Unused
Unused
Unused
Unused
Unused
Unused
Unused
Unused
Unused
Unused
Unused
Unused
Unused
Unused
Unused
Unused
Unused
Unused
max
min
Unused
Unused
Unused
Unused
Unused
Unused
Unused
Unused
Unused
Unused
Unused
Unused
Unused
30µ
30µ
30µ
30µ
30µ
40µ
40µ
30µ
30µ
30µ
100m+
100m+
100m+
background image
SEGA Confidential



SMPC User's Manual
13
2.2
Command Issue
For commands to the SMPC, to issue commands when the command parameter is
required after setting the SMPC status flag (SF) to "1," set the command parameter,
and write the command code in the SMPC command register.
When the SMPC command is issued, be careful of dual command issue. Prevention
of dual issue of commands to the SMPC can be done using the SMPC status flag.
When this flag is "1," the SMPC is busy. When executing the command, verify that
the status flag is "0" and then execute the command after setting "1." The SMPC
resets the status flag to "0" when the command is completed.
Command Execution Method
SMPC commands are classified by issue procedure and result parameter acquisition
method according to the type of command execution contents, command parameter,
and result parameter. These types and corresponding commands are shown in Table
2.4, and example issue methods for each type are shown in Figures 2.1 through 2.5.
(1)
Type A
This command resets the master SH-2 after command issue or changes to
exception processing, such as NMI.
(2)
Type B
This command does not require the command parameter to be reset and
the result parameter is not returned (except for OREG31, however).
(3)
Type C
This command requires the command parameter to be reset and the result
parameter is not returned (except for OREG31, however).
(4)
Type D
This command requires the command parameter to be reset and the result
parameter is returned, and also requires a SMPC interrupt at the time the
result parameter is ready.
Table 2.4 Command Issue Types
Type
Command
A
MSHON, SYSRES, NMIREQ, CKCHG352, CKCHG320
B
SSHON, SSHOFF, SNDON, SNDOFF, CDON, CDOFF, RESENAB, RESDISA
C
SETTIME, SETSMEM
D
INTBACK
background image
SEGA Confidential
START
Waits for SF to be Reset
Reads Command Code in
COMREG
Endless Loop
Sets SF
Waiting for
exception
handling.
START
Waits for SF to be Reset
Reads Command Code in
COMREG
Sets SF
END
14
Figure 2.1 Type A Command Flow
Figure 2.2 Type B Command Flow
background image
SEGA Confidential

SMPC User's Manual
15
START
Waits for SF to be Reset
Writes Command Code in
COMREG
Resets SF
Sets the Command Parameter
in IREG
END
Figure 2.3 Type C Command Flow
background image
SEGA Confidential

16
START
Waits for SF to be Reset
Writes Command Code in
COMREG
Set SF
END
Depending on Peripheral Status,
Issue Continue or Break to SMPC
(Refer to Chapter 3 for Details)
Clear Interrupt Flag
Look at SR and Receive
OREG Result Parameter
SMPC Interrupt Processing
START
Interrupt Processing END
Sets the Command Parameter
in IREG
Note:
A routine similar to the SMPC interrupt routine can be executed by masking the
SMPC routine (SMPC interrupt is not used) and conducting polling after the SMPC
interrupt flag or SF clear is conducted.
Figure 2.4 Type D Command Flow
background image
SEGA Confidential


SMPC User's Manual
17
Command Issue Timing
The SMPC uses the V-BLANK-IN interrupt to execute internal tasks. At this time,
issuing commands for 300 ms from V-BLANK-IN is prohibited.
Also, the INTBACK command that is used to acquire the SMPC statuses and periph-
eral data has stricter issue timing than other commands. For details regarding the
INTBACK command, refer to 2.4 "Non-Resetable System Management Commands"
or Section 3 "Peripheral Control."
·
Items Common to Command Issue Timing
As mentioned above, issuing commands for 300
µ
s from V-BLANK-IN is
prohibited.
·
INTBACK Command
The INTBACK command begins collecting peripheral data at V-BLANK-OUT. To
begin collecting peripheral data at V-BLANK-OUT, the INTBACK command must
be issued in the period prior to V-BLANK-OUT after 300
µ
s following V-BLANK-
IN..
Figure 2.5 shows the INTBACK command execution timing.
The INTBACK command is used in the following three ways.
1) To acquire only the SMPC status.
2) To collect peripheral data after acquiring the SMPC status.
3) To acquire only peripheral data.
When executing (2) "To collect peripheral data after acquiring the SMPC status," a
SMPC interrupt is generated at the time the SMPC status is OREG and a request
for result parameter acquisition is made to the SH-2. The SMPC begins collecting
peripheral data after the SH-2 makes a continue request.
Here, even though a continue request has been issued after SMPC status acquisi-
tion, it is still necessary to issue an INTBACK command and request continue to
begin collecting peripheral data at V-BLANK-OUT.
SMPC status acquisition ends approximately 300
µ
s after INTBACK command
issue, and a SMPC interrupt request is sent to the SMPC.
background image
SEGA Confidential


18
V-BLANK
V-BLANK-IN
V-BLANK-OUT
During V-BLANK
300
µ
S
: INTBACK Command Issue Period
Figure 2.5 INTBACK Command Issue Timing
·
INTBACK Command Issue Timing after SYSRES, CKCHG320, CKCHG352 Command Execution
The command execution time for the above commands requires 100 msec or more.
When an INTBACK command is issued after one of these commands is executed,
wait to execute them until the next V-BLANK-IN. Figure 2.6 shows the INTBACK
command issue timing after the SYSRES, CKCHG320, and CKCHG352 commands
are executed.
The SYSRES, CKCHG320, and CKCHG352 commands must be issued 300
µ
s after
V-BLANK-IN and before the next V-BLANK-IN.
V-BLANK
V-BLANK-IN
: INTBACK Command Issue Period
100 msec or More
Command End
SYSRES, CKCHG320,
CKCHG352 Commands
Figure 2.6
INTBACK Command Issue Timing After SYSRES, CKCHG320, and
CKCHG352 Command Execution.
·
Issue Timing for Other Commands
When an INTBACK command is not issued in the same frame after one of the other
commands is executed, the command must be issued 300
µ
s after V-BLANK-IN and
before the next V-BLANK-IN. When an INTBACK command is issued in the same
frame as one of the other commands that is issued 300
µ
s after V-BLANK-IN and
before the next V-BLANK-IN, issue the INTBACK command before V-BLANK-OUT.
Figure 2.7 shows the issue timing of other commands.
background image
SEGA Confidential


SMPC User's Manual
19
V-BLANK
V-BLANK-IN
300
µ
s
: INTBACK Command Issue Period
V-BLANK
300
µ
s
: Other Command Issue Period
: Other Command Issue Period
Other Command Issue in Frame that Issues INTBACK Command
Other Command Issue in Frame that Does Not Issue INTBACK Command
Command Issue Limitations
Following is an explanation of limitations when issuing commands.
· When conducting command issue processing for the SMPC, a maximum effort
shall be made to conduct single tasks. If multiple issues are being processed,
problems, such asdual command issue, could occur, which could cause the SMPC
error or a deadlock to occur.
When multiple tasks have to be executed, and when a command must be issued
to the SMPC, always perform these executions by adding exclusion controls that
do not generate dual command issue between tasks to the above described com
mand issue methods.
· When commands are issued sequentially, always verify the status flag to make
sure commands are not dually issued and only issue the next command after the
previous command issue has finished.
· Perform real-time clock count up once every second. Also, conduct a detection of
the SMPC's internal reset button immediately after V-BLANK-IN. If a command is
issued while this processing is being conducted, this processing time will be
added to the command processing time, so be careful because this will change the
command processing time.
· SMPC commands can be issued from either the master or slave SH-2, but there are
commands for which issue is limited, such as when system operation is stopped.
Table 2.5 shows the SH-2 command issue limitations.
Figure 2.7 Issue of Other Commands
background image
SEGA Confidential

20
Table 2.5 SH-2 Command Issue Limitations
No.
Command Name
Command
Abbreviation
Command Execution
from Master SH-2
Command Execution
from Slave SH-2
1 Master SH-2 ON
MSHON
O
O
2 Slave SH-2 ON
SSHON
O
X
3 Slave SH-2 OFF
SSHOFF
O
X
4 Sound ON
SNDON
O
O
5 Sound OFF
SNDOFF
O
O
6 CD ON
CDON
O
O
7 CD OFF
CDOFF
O
O
8 System Overall Reset
SYSRES
O
O
9 Clock Change 352
CKCHG352
O
X
10 Clock Change 320
CKCHG320
O
X
11 NMI Request
NMIREQ
O
O
12 Reset Enable
RESENAB
O
O
13 Reset Disable
RESDISA
O
O
14 Interrupt Back
INTBACK
O
X
15 SMPC Memory Setting
SETSMEM
O
O
16 Time Setting
SETTIME
O
O
background image
SEGA Confidential


SMPC User's Manual
21
2.3
Resetable System Management Commands
The details for the resetable system management commands are given in table
format. The way to view the command tables and precaution items are given below.
In addition, a status flag is used for each command to control the dual issue of com-
mands.
SMPC Interrupt
The word "generation" means that a SMPC interrupt is generated by the SH-2 via
the SCU when the command ends. In addition, the interrupt can be enabled or
disabled by so setting the SCU.
IREG, OREG
· Shows the details of the IREG and OREG used by commands.
· A command parameter is a parameter that is set in IREG before the command is
issued.
· A result parameter is a parameter that is set in OREG before the command is
executed.
· Result parameter OREG31 is set when the SMPC begins command processing.
The command code is output to OREG31. Also using it as a status flag (SF) makes
it possible to determine:
Which command is executing
(SF=1)
Which command has finished
(SF=0)
Execution Time
Shows the execution time calculated from the number of SMPC internal firmware
steps. When there is a collision with an internal task, such as an RTC increment, the
command execution time is changed, so the minimum and maximum range values
are given.
background image
SEGA Confidential
22
NO. 1
OREG
IREG
OREG31 2010005F
H
Turns on master SH-2.
MSHON
Master SH-2 ON
31
XXX
00
H
max
min
0
0
0
0
0
0
0
0
bit7
bit0
Function
Description
Remarks
Command
Parameter
Result
Parameter
Generation
Not Possible
Command
Code
Unused
30
µ
sec
SMPC
Interrupt
Execution
Time
None
background image
SEGA Confidential

SMPC User's Manual
23
NO. 2
OREG
IREG
OREG31 2010005F
H
Turns on slave SH-2.
SSHON
Slave SH-2 ON
31
XXX
02
H
max
min
0
0
0
0
0
0
1
0
bit7
bit0
Function
Description
Remarks
Command
Parameter
Result
Parameter
Generation
Not Possible
Command
Code
Unused
SMPC
Interrupt
Execution
Time
None
30
µ
sec
background image
SEGA Confidential
24
NO. 3
OREG
IREG
OREG31 2010005F
H
Turns off slave SH-2.
SSHOFF
Slave SH-2 OFF
31
XXX
03
H
max
min
0
0
0
0
0
0
1
1
bit7
bit0
Function
Description
Remarks
Command
Parameter
Result
Parameter
Generation
Not Possible
Command
Code
Unused
SMPC
Interrupt
Execution
Time
None
30
µ
sec
background image
SEGA Confidential

SMPC User's Manual
25
NO. 4
OREG
IREG
OREG31 2010005F
H
Turns on the sound CPU (MC68EC000).
SNDON
Sound ON
31
XXX
06
H
max
min
Function
Description
Remarks
Command
Parameter
Result
Parameter
Generation
Not Possible
Command
Code
Unused
0
0
0
0
0
1
1
0
bit7
bit0
SMPC
Interrupt
Execution
Time
None
30
µ
sec
background image
SEGA Confidential
26
NO. 5
OREG
IREG
OREG31 2010005F
H
Turns off the sound CPU (MC68EC000).
SNDOFF
31
XXX
07
H
max
min
0
0
0
0
0
1
1
1
bit7
bit0
Function
Description
Remarks
Command
Parameter
Result
Parameter
Generation
Not Possible
Command
Code
Unused
Sound OFF
SMPC
Interrupt
Execution
Time
None
Even if the sound CPU is turned off using this command, the sound memory
contents (4M DRAM) will be preserved.
30
µ
sec
background image
SEGA Confidential

SMPC User's Manual
27
NO. 6
OREG
IREG
OREG31 2010005F
H
Turns on CD.
CDON
CD ON
31
XXX
08
H
max
min
0
0
0
0
1
0
0
0
bit7
bit0
Function
Description
Remarks
Command
Parameter
Result
Parameter
Generation
Not Possible
Command
Code
Unused
SMPC
Interrupt
Execution
Time
None
40
µ
sec
background image
SEGA Confidential
28
NO. 7
OREG
IREG
OREG31 2010005F
H
Turns off CD.
CDOFF
CD OFF
31
XXX
09
H
max
min
0
0
0
0
1
0
0
1
bit7
bit0
Function
Description
Remarks
Command
Parameter
Result
Parameter
Generation
Not Possible
Command
Code
Unused
SMPC
Interrupt
Execution
Time
None
The execution of this command will cause the CD buffer (DRAM) value not to
be retained.
40
µ
sec
background image
SEGA Confidential

SMPC User's Manual
29
NO. 8
OREG
IREG
OREG31 2010005F
H
Resets the entire SATURN system.
SYSRES
Entire System Reset
31
0D
H
0
0
0
0
1
1
0
1
bit7
bit0
Execution of this command resets (initializes) all functions, causes the SH-2 to run the
power on vecter, and starts up the boot ROM.
None of the memory, except for 256 Kbit battery backup RAM, will be retained.
Function
Description
Remarks
Command
Parameter
Result
Parameter
Generation
Not Possible
Command
Code
Unused
100 msec +
SMPC
Interrupt
Execution
Time
None
background image
SEGA Confidential
30
NO. 9
OREG
IREG
OREG31 2010005F
H
Switch the SATURN system clock from 320 mode to 352 mode.
CKCHG352
Clock Change 352 Mode
31
0E
H
0
0
0
0
1
1
1
0
bit7
bit0
Issuing this command from an application is prohibited. Call the clock change
routine in the SATURN boot ROM. When clock change routine is called, all LSI
will become as follows.
· VDP1, VDP2, SCU, SCSP: Default value during power on.
· Master SH-2: Return from boot ROM clock change routine.
· Slave SH-2: OFF
· CD block: Retained
· Work RAM: Retained
· VRAM: Not retained
Function
Description
Remarks
Command
Parameter
Result
Parameter
Generation
Not Possible
Command
Code
Unused
100 msec +
SMPC
Interrupt
Execution
Time
None
background image
SEGA Confidential

SMPC User's Manual
31
NO. 10
OREG
IREG
OREG31 2010005F
H
Switch the SATURN system clock from 352 mode to 320 mode.
CKCHG320
Clock Change 320 Mode
31
0F
H
0
0
0
0
1
1
1
1
bit7
bit0
Function
Description
Remarks
Command
Parameter
Result
Parameter
Generation
Not Possible
Command
Code
Unused
100 msec +
SMPC
Interrupt
Execution
Time
None
Issuing this command from an application is prohibited. Call the clock change
routine in the SATURN boot ROM. When clock change routine is called, all LSI
will become as follows.
· VDP1, VDP2, SCU, SCSP: Default value during power on.
· Master SH-2: Return from boot ROM clock change routine.
· Slave SH-2: OFF
· CD block: Retained
· Work RAM: Retained
· VRAM: Not retained
background image
SEGA Confidential
32
NO. 11
OREG
IREG
OREG31 2010005F
H
Sends NMI request to master SH-2.
NMIREQ
NMI Request
31
XXX
18
H
max
min
Function
Description
Remarks
Command
Parameter
Result
Parameter
Generation
Not Possible
Command
Code
Unused
0
0
0
1
1
0
0
0
bit7
bit0
30
µ
sec
SMPC
Interrupt
Execution
Time
None
NMI is requested unconditionally even if disabled by the RESDISA command.
background image
SEGA Confidential

SMPC User's Manual
33
NO. 12
OREG
IREG
OREG31 2010005F
H
In SATURN, NMI is generated when the main unit panel reset button is
pushed. When power is on, the default is set disabled.
RESENAB
Reset Enable
31
XXX
19
H
max
min
Function
Description
Remarks
Command
Parameter
Result
Parameter
Generation
Not Possible
Command
Code
Unused
0
0
0
1
1
0
0
1
bit7
bit0
30
µ
sec
SMPC
Interrupt
Execution
Time
None
NMI is generated when the reset button is pushed during the 3VINT period to
prevent chattering.
This is a command to enable NMI generation.
background image
SEGA Confidential
34
NO. 13
OREG
IREG
OREG31 2010005F
H
This is a command to disable NMI generation.
In SATURN, generates NMI when main unit panel reset button is pushed.
The defaut is "disabled" when the power is turned on.
RESDISA
Reset Disable
31
XXX
1A
H
max
min
Function
Description
Remarks
Command
Parameter
Result
Parameter
Generation
Not Possible
Command
Code
Unused
0
0
0
1
1
0
1
0
bit7
bit0
30
µ
sec
SMPC
Interrupt
Execution
Time
None
The reset switch is only shown by the SR (status register) RESB bit (bit4) and
does not output an NMI to the master SH-2. The RESB bit shows the button
status at V-BLANK-IN.
background image
SEGA Confidential


SMPC User's Manual
35
2.4
Non-Resetable System Management Commands
The details for the non-resetable system management commands are given in table
format.
The way to view the command tables and precaution items are given below. Also, a
status flag is used for each command to control dual command issue.
SMPC Interrupt
The word "generation" means that a SMPC interrupt is generated by the SH-2 via
the SCU when the command ends. In addition, the interrupt can be enabled or
disabled by setting the SCU.
IREG, OREG
· Shows the details of the IREG and OREG used by commands.
· A command parameter is a parameter that is set in IREG before the command is
issued.
· A result parameter is a parameter that is set in OREG before the command is
executed.
· Result parameter OREG31 is set when the SMPC begins command processing.
The command code is output to OREG31. Also using it as a status flag (SF) makes
it possible to determine:
Which command is executing
(SF=1)
Which command has finished
(SF=0)
Execution Time
Shows the execution time calculated from the number of SMPC internal firmware
steps. When there is a collision with an internal task, such as a RTC increment, the
command execution time is changed, so the minimum and maximum range values
are given.
background image
SEGA Confidential
36
NO. 1
OREG
IREG
Acquires the SMPC status and peripheral data. Here status acquisition will be
explained. The acquisition of peripheral data will be explained in Section 3.
INTBACK
Interrupt Back
0
~
31
10
H
XXX
max
min
The result parameter is explained after the command parameter.
Here, the result parameter, which is limited by the SMPC status
acquisition is displayed.
Here, the INTBACK command's command parameter during peripheral
data acquisition is also displayed.
Refer to command parameter on the next page.
The command parameter setting method during SMPC status acquisition is
explained next after result parameter.
Function
Description
Remarks
Command
Parameter
Generation
Command
Code
Result
Parameter
320 msec
SMPC
Interrupt
Execution
Time
0
~
2
(SMPC Status Acquisition)
background image
SEGA Confidential


SMPC User's Manual
37
IREG0 20100001
H
bit7
bit0
Command Parameter
Initial Value: Not Specified
Write Only
SMPC Status Acquisition Switch (00
H
or 01
H
)
IREG0: SMPC Status Acquisition Switch Setting Value
IREG0 Setting
Value
Explanation
00
H
01
H
Does not return data for time, cartridge code, area
code, terminal status, SMEM, or reset button mode.
Returns data for time, cartridge code, area code,
terminal status, SMEM, or reset button mode.
When using the INTBACK command, be sure one of the above setting values has
been set.
IREG0 is also used to control peripherals. Refer to Section 3 for details regarding
peripheral control.
IREG1 20100003
H
P2MD1 P2MD0
P1MD1 P1MD0
PEN
0
OPE
0
bit7
bit0
bit4
bit3
Unde. Unde. Unde. Unde. Unde. Unde. Unde. Unde.
W
W
W
W
W
---
W
---
Bit7, 6: Port 2 Mode
Bit7
Bit 6
Explanation
P2MD1
P2MD0
0
1
15-Byte Mode
255-Byte Mode
SEGA RESERVED (Setting Restricted)
0-Byte Mode
0
0
0
1
1
1
Bit5, 4: Port 1 Mode
Bit5
Bit 4
Explanation
P1MD1
P1MD0
0
1
15-Byte Mode
255-Byte Mode
SEGA RESERVED (Setting Restricted)
0-Byte Mode
0
0
0
1
1
1
background image
SEGA Confidential
38
Bit3: Peripheral Data Enable
Bit3
Explanation
PEN
0
Peripheral Data Not Returned
Peripheral Data Returned
1
Bit1: Acquisition Time Optimization
Bit1
Explanation
OPE
0
Peripheral Data Acquisition Time Optimized
Peripheral Data Acquisition Time not Optimized
1
IREG2
20100005H
bit7
bit0
Initial Value: Not Specified Write Only
F0H
When executing the INTBACK command, be sure to set F0H in IREG2.
background image
SEGA Confidential


39
SMPC User's Manual
Year 1000s Place
Year 10s Place
Year 1s Place
Day
Note 2
Month (Hexadecimal)
Note 3
Days 10s Place
SR 20100061
H
OREG1 20100023
H
bit7
bit0
bit4 bit3
0
1
PDE
RESB
---
---
---
---
·PDE
0: No remaining peripheral data.
1: Remaining peripheral data.
·RESB 0: Reset button off.
1: Reset button on.
Read can be performed without regard for the INTBACK command.
Year 100s Place
Days 1s Place
Hrs. 10s Place
Hrs. 1s Place
Min. 10s Place
Sec. 10s Place
Min. 1s Place
Sec. 1s Place
Result Parameter
OREG2 20100025
H
OREG3 20100027
H
OREG4 20100029
H
OREG5 2010002B
H
OREG6 2010002D
H
OREG7 2010002F
H
bit7
bit0
OREG0 20100021
H
bit7
bit0
bit4 bit3
STE
RESD
---
---
---
---
---
---
·STE
0: Not SETTIME after SMPC cold reset
Note 1
1: SETTIME is done after SMPC cold reset Note 1
·RESD 0:
Reset enable
1: Reset disable (default)
Note 1: SMPC cold reset is generated under the following conditions.
(1) When the reset switch inside the SATURN backside battery box is pressed.
(2) When the main power is on while a battery is not installed or is dead.
(3) When a battery is installed while the power is off.
(BCD)
(BCD)
Note 2: Day
0
H
: Sun 1
H
: Mon 2
H
: Tue 3
H
: Wed 4
H
: Thur 5
H
: Fri 6
H
: Sat
Note 3: Month
1
H
: Jan 2
H
: Feb 3
H
: Mar 4
H
: Apr 5
H
: May 6
H
: Jun
7
H
: July 8
H
: Aug 9
H
: Sep A
H
: Oct B
H
: Nov C
H
: Dec
OREG8 20100031
H
0
0
0
0
0
0
CTG1 CTG0
·CTG1: Cartridge Code 1
·CTG0: Cartridge Code 0
(BCD)
(BCD)
(BCD)
(BCD)
bit7
bit0
background image
SEGA Confidential
40
System Status 1
System Status 1 (Status of Control Signals Output by SMPC 0: OFF 1 :ON)
·b7 0B ·b6 DOTSEL Signal Note ·b5 1B
·b4 1B ·b3 MSHNMI Signal ·b2 1B
·b1 SYSRES Signal ·b0 SNDRES Signal
Note: The DOTSEL signal is currently shown in the screen mode (horizontal resolution).
0: 320 1: 352
OREG10
20100035H
Area Code (00H~0FH)
OREG9
20100033H
bit7
bit0
Area Code
Code
0H
1H
2H
3H
4H
5H
6H
7H
8H
9H
AH
BH
CH
DH
E
H
FH
Area
Major Country Names, Etc.
Use Prohibited
Japan Area
Japan
Asia NTSC Area Taiwan, Philippines
SEGA RESERVED
North America Area U.S.A., Canada, Mexico
Central/S. America NTSC Area Brazil
Korea Area South Korea
SEGA RESERVED
SEGA RESERVED
SEGA RESERVED
Asia PAL Area East Asia, China, Middle East
SEGA RESERVED
Europe PAL Area, etc. Europe, Australia, South Africa
Central/S. America PAL Area
SEGA RESERVED
Use Prohibited
bit7
bit0
System Status 2 (Status of Control Signals Output by SMPC 0: OFF 1 :ON)
·b7 RESERVED ·b6 CDRES Signal ·b5 RESERVED
·b4 RESERVED ·b3 RESERVED ·b2 RESERVED
·b1 RESERVED ·b0 RESERVED
System Status 2
OREG11
20100037H
bit7
bit0
System Status 1
System Status 1 (Status of Control Signals Output by SMPC 0: OFF 1 :ON)
·b7 0B ·b6 DOTSEL Signal Note ·b5 1B
·b4 1B ·b3 MSHNMI Signal ·b2 1B
·b1 SYSRES Signal ·b0 SNDRES Signal
Note: The DOTSEL signal is currently shown in the screen mode (horizontal resolution).
0: 320 1: 352
OREG10
20100035H
Area Code (00H~0FH)
OREG9
20100033H
bit7
bit0
Area Code
Code
0H
1H
2H
3H
4H
5H
6H
7H
8H
9H
AH
BH
CH
DH
EH
FH
Area
Major Country Names, Etc.
Use Prohibited
Japan Area
Japan
System Status 2 (Status of Control Signals Output by SMPC 0: OFF 1 :ON)
·b7 RESERVED ·b6 CDRES Signal ·b5 RESERVED
·b4 RESERVED ·b3 RESERVED ·b2 RESERVED
·b1 RESERVED ·b0 RESERVED
System Status 2
OREG11
20100037H
bit7
bit0
Asia NTSC area
SEGA RESERVED
North America area
Central/S. America NTSC area
Korea area
SEGA RESERVED
Use Prohibited
SEGA RESERVED
SEGA RESERVED
SEGA RESERVED
Asia PAL area
SEGA RESERVED
Europe PAL area, etc.
Central/S. Amercia PAL area
East Asia, China, Middle East
Europe, Australia, South Africa
Taiwan, Philippines
U.S.A., Canada, Mexico
Brazil
South Korea
background image
SEGA Confidential

41
SMPC User's Manual
SMEM 1 Saved Data
OREG12 20100039
H
OREG13 2010003B
H
OREG14 2010003D
H
OREG15 2010003F
H
OREG31 2010005F
H
0
0
0
0
0
0
0
0
bit7
bit0
With peripheral data, however, the command code (OREG31) could be overwritten.
SMEM 2 Saved Data
SMEM 3 Saved Data
SMEM 4 Saved Data
bit7
bit0
background image
SEGA Confidential

42
IREG
Setting
Value
Description
IREG0
01H
IREG1
00H
All data for time, cartridge code, area code, terminal
status, SMEM, and reset button mode is returned.
Terminal 2 mode (P2MD1, P2MD0)=00B 15-byte mode
Terminal 1 mode (P1MD1, P1MD0)=00B 15-byte mode
Peripheral data enable (PEN)=0B Peripheral data not
returned
Acquisition time optimization (OPE)=0B Performs
peripheral acquisition time optimization.
IREG2
F0H
Set F0H without conditions.
This setting can clear the SF, ends the INTBACK command, and acquires the
result data. Also, when the command ends, a SMPC interrupt request is sent.
The execution time is from minimum TBD to maximum TBD.
There are three ways the INTBACK command can be used.
1) Acquire only SMPC status.
2) Acquire peripheral data after acquiring SMPC status.
3) Acquire only peripheral data.
This section primarily explains how to acquire SMPC status. Here, acquiring status
using methods 1) and 2) are explained. For an explanation regarding peripheral data
acquisition, refer to Section 3.
When acquiring status only, set the command parameter as shown below, and
execute the INTBACK command.
How to Use INTBACK Command when Acquiring SMPC Status
Method for Acquiring Only SMPC Status
background image
SEGA Confidential


43
SMPC User's Manual
When acquiring peripheral data after acquiring SMPC status acquisition, set the command
parameter as shown below and issue the INTBACK command. The IREG1 setting value can be
set to the value desired for the application.
IREG
Setting
Value
Description
IREG0
01H
IREG1
08H
All data for time, cartridge code, area code, terminal
status, SMEM, and reset button mode is returned.
Terminal 2 mode (P2MD1, P2MD0)=00B 15-byte mode
Terminal 1 mode (P1MD1, P1MD0)=00B 15-byte mode
Peripheral data enable (PEN)=1B Peripheral data
returned
Acquisition time optimization (OPE)=0B Performs
peripheral acquisition time optimization.
IREG2
F0H
Set F0H without conditions.
This setting executes the SMPC command and requests a SMPC interrupt when
the result parameter is set. When the SMPC interrupt is requested, the SF is
changed to busy "1." The execution time from command issue to result
parameter setting completion is minimum TBD to maximum TBD. After the result
parameter for the status is acquired, the value of the IREG0 bit7 is changed, then
the SMPC understands this as continue and continues acquiring peripheral data.
This method is effective for use with applications that acquire all status types for
each frame and that acquire peripheral data.
Method for Acquiring Peripheral Data After Acquiring SMPC Status
background image
SEGA Confidential
44
NO. 2
OREG
IREG
IREG0 20100001
H
SETSMEM
SMPC Memory Setting
31
XXX
17
H
max
min
bit7
bit0
OREG31 2010005F
H
0
0
0
1
0
1
1
1
bit7
bit0
Setting Data to SMEM1
The SMPC has a 4-byte battery backupable memory (SMEM)
This command sets data to the SMEM.
Function
Description
Remarks
Command
Parameter
Result
Parameter
Generation
Possible
Command
Code
40
µ
sec
SMPC
Interrupt
Execution
Time
0
~
3
IREG1 20100003
H
Setting Data to SMEM2
IREG2 20100005
H
Setting Data to SMEM3
IREG3 20100007
H
Setting Data to SMEM4
· The SMEM contents are cleared to 0 when the SMPC is cold reset.
A SMPC cold reset is generated under the following conditions.
(1) When the reset switch in the SATURN backside battery box is pushed.
(2) When the main power is turned on while no battery is installed or when
the battery is dead.
(3) Cleared to 0 when a battery is installed while the power is off. Becomes 0
after the main power is first turned on.
· With the SETSMEM command, 4 bytes can be set at the same time. When
the contents are updated, use the INTBACK command to read, modify, or
write the currently saved data.
· If the power is turned off when the SETSMEM command is issued:
(1) All data is updated when the SETSMEM command internal processing is
executed first by the power off sequence.
(2) When the power off sequence is executed first, the data before the
command was issued is saved.
background image
SEGA Confidential


45
SMPC User's Manual
2.5
RTC Commands
The details for the RTC commands are given in table format. The way to view the
command tables and precaution items are given below. Also, a status flag is used for
each command to control dual command issue.
SMPC Interrupt
The word "generation" means that a SMPC interrupt is generated by the SH-2 via
the SCU when the command ends. In addition, the interrupt can be enabled or
disabled by setting the SCU.
IREG, OREG
· Shows the details of the IREG and OREG used by commands.
· A command parameter is a parameter that is set in IREG before the command is
issued.
· A result parameter is a parameter that is set in OREG before the command is
executed.
· Result parameter OREG31 is set when the SMPC begins command processing.
The command code is output to OREG31. Also using it as a status flag (SF) makes
it possible to determine:
Which command is executing
(SF=1)
Which command has finished
(SF=0)
Execution Time
Shows the execution time calculated from the number of SMPC internal firmware
steps. When there is a collision with an internal task, such as a RTC increment, the
command execution time is changed, so the minimum and maximum range values
are given.
background image
SEGA Confidential
46
NO. 1
OREG
IREG
Year 1000s Place
Year 100s Place
Year 10s Place
Year 1s Place
Day
Note 1
Month (Hexadecimal)
Note 2
Days 10s Place
Days 1s Place
Hour 10s Place
Hour 1s Place
Minute 10s Place
IREG0 20100001
H
IREG2 20100005
H
IREG4 20100009
H
IREG6 2010000D
H
IREG1 20100003
H
IREG3 20100007
H
IREG5 2010000B
H
bit7
bit0
bit4 bit3
0
0
0
1
0
1
1
0
bit7
bit0
Sets the RTC time.
SETTIME
Time Setting
31
XXX
16
H
70
µ
sec
max
min
0
~
6
Second 10s Place
Minute 1s Place
Second 1s Place
Note 1:
Days
0
H
: Sun. 1
H
: Mon. 2
H
: Tue. 3
H
: Wed. 4
H
: Thur. 5
H
: Fri. 6
H
: Sat.
OREG031 25FC00BC
H
Function
Description
Remarks
Command
Parameter
SMPC
Interrupt
Execution
Time
Result
Parameter
Interrupt Generation
Not Possible
Command
Code
(BCD)
(BCD)
(BCD)
(BCD)
(BCD)
(BCD)
Note 2: Month
1
H
: Jan 2
H
: Feb 3
H
: Mar 4
H
: Apr 5
H
: May 6
H
: Jun
7
H
: July 8
H
: Aug 9
H
: Sep A
H
: Oct B
H
: Nov C
H
: Dec
· The time is initialized to "12/31/93 Friday 23:59:59" and the count is started
during SMPC cold reset.
The SMPC cold reset is generated under the following conditions.
(1) When the reset switch in the SATURN background battery box is
pushed
down.
(2) When the battery is not installed or is dead and the main power is on.
(3) When 0 cleared when the battery is installed when the power is off.
· When data that does not actually exist, a day higher than 7, a month higher
than 12, a date for a month not supported (correction is made for leap years
until 2099), hours above 24, minutes above 60, or seconds above 60 are set,
the set value or the count up value becomes undefined.
· If the SETTIME command is issued while the power is off:
(1) All data is updated if the SETTIME command internal processing is
executed before the power off sequence.
(2) The data before command issuance is preserved when the power off
sequence is executed first.
background image
SEGA Confidential



47
SMPC User's Manual
Chapter 3 Peripheral Control
Section 3 Contents
3.1 Peripheral Control Mode .......................................................... 48
3.2 SATURN Peripheral Standard Formats .................................... 76
3.3 Support Peripheral Data Format in SMPC Control Mode ......... 81
3.4 Support Peripheral Data Format in SH-2 Direct Mode ............. 86
Section 3 Contents
3.1 Peripheral Control Mode....................................................................................... 48
SMPC Control Mode............................................................................................. 48
INTBACK Command Use Method for SMPC Control Mode
....................................... 53
Peripheral Data Collection Time Optimization
.......................................................... 55
INTBACK Command's Command Parameters During Peripheral Data Acquisition
...... 58
INTBACK Command Result Parameter During Peripheral Data Acquisition
................ 61
Peripheral Data Configuration................................................................................ 65
Result Parameter Details
........................................................................................ 66
SATURN Peripheral ID........................................................................................... 69
SH-2 Direct Mode.................................................................................................. 74
3.2 SATURN Peripheral Standard Format
..................................................................... 76
Purpose of SATURN Peripheral Standard Format
.................................................... 76
SATURN Standard Format Types and Data Format
.................................................. 76
3.3 Support Peripheral Data Format for SMPC Control Mode
......................................... 81
3.4 Support Peripheral Data Format for SH-2 Direct Mode
............................................. 86
background image
SEGA Confidential

48
3.1
Peripheral Control Mode
The SH-2 can control peripherals via the SMPC. There are two peripheral control
methods. They are:
1) SMPC Control Mode
2) SH-2 Direct Mode
SMPC Control Mode
Block Diagram
Figure 3.1 shows the SMPC control mode block diagram. The SMPC control mode
sets the command parameter in the SH-2 interface register's IREG and is started up
by issuing an INTBACK command. The peripheral data collection results are output
to the OREG as a result parameter.
SH-2
Data Bus
SMPC
PDR1
PDR2
SH-2
Interface
Register
8
7
7
Figure 3.1 SMPC Control Mode Block Diagram
Characteristics
Used as an effective method to keep overhead to a minimum when accessing periph-
erals from inside an application.
Settings for Using SMPC Control Mode
Figure 3.2 shows an setting example for using the SMPC control mode for port 1.
Mode settings are set independently for each port.
background image
SEGA Confidential



49
SMPC User's Manual
SMPC Control Mode
Set DDR1 to "00H"
Set IOSEL1 to "0"
When using EXL1 "0",
disable EXL1 to "0".
Setting End
Figure 3.2 SMPC Control Mode Setting Example.
·
Parallel I/O Register Default Value During Power On
During power-on, the parallel I/O register is set to the default values shown in
Table 3.1.
Table 3.1 Parallel I/O Register Default Values During Power-On
SMPC Control Mode Use Method
When using the INTBACK command and acquiring peripheral data, the collected
peripheral data is output to the OREG as a result parameter. However, it is possible
that the collected peripheral data is larger than the OREG capacity. At this time, in
the SMPC control mode, peripheral data acquisition is stopped when the OREG
becomes full. When the OREG becomes full with peripheral data, the SMPC gener-
ates an SMPC interrupt and sends a request for peripheral data acquisition to the
SH-2.
Also, when there is still peripheral data that should be collected, it is displayed that
data still remains in the status register. After the SH-2 acquires the peripheral data, a
continue request is sent to the SMPC which causes the SMPC to begin acquiring
peripheral data again. When the remaining peripheral data is not needed, peripheral
data acquisition is ended by a break request.
The above sequence is illustrated in Figures 3.3 and 3.4.
Register Name
Setting Value
Description
IOSEL1/2
0
H
SMPC control mode
EXL1/2
0
H
PAD interrupt
VDP2 external latch disable
DDR1/2
00
H
Input of all bits
background image
SEGA Confidential

50
Continue Request
A continue request from the SH-2 to the SMPC is done by reversing the IREG bit 7.
Break Request
A break request from the SH-2 to the SMPC is made by writing "1" in the IREG0's
bit 6.
Precautions Regarding Continue and Break Requests
When requesting continue or break, be aware of the conditions given in Table 3.2.
Table 3.2 Continue and Break Issue Conditions
Termination Conditions for INTBACK Command that Acquires Peripheral Data
The INTBACK command that acquires peripheral data is terminated by the follow-
ing conditions.
1) When all peripheral data acquisition is completed.
2) When peripheral data collection could not be completed by V-BLANK-IN (time
over).
3) Peripheral data collection was terminated by a break request from the SH-2.
Issue to be requested
Continue
Break
Received Condition
SMPC Operation
X
X
Hold
Request Wait
X
O
Break
Peripheral data collection is stopped and
INTBACK command is terminated.
O
X
Continue
Peripheral data collection is continued.
O
O
Prohibited
No guarantee
background image
SEGA Confidential

51
SMPC User's Manual
SH-2
SMPC
IREG Set
INTBACK Command Issued
Collect Peripheral Data
and Create OREG
Data Remains
OREG Acquisition
CONTINUE Request
Create OREG
Interrupt Generated
No Data Remains
INTBACK Command Ends
Interrupt Generated
Data Remains
·
·
·
OREG Acquisition
CONTINUE Request
Interrupt Generated
Create OREG
Data Remains
Interrupt Generated
Create OREG
Data Remains
OREG Acquisition
CONTINUE Request
Figure 3.3 All Peripheral Data Acquisition Sequence
background image
SEGA Confidential
52
SH-2
SMPC
IREG Set
INTBACK Command Issued
Collect Peripheral Data
and Create OREG
Data Remains
OREG Acquisition
CONTINUE Request
Create OREG
Interrupt Generated
INTBACK Command Ends
Interrupt Generated
Data Remains
·
·
·
OREG Acquisition
CONTINUE Request
Interrupt Generated
Create OREG
Data Remains
Data Remains
OREG Acquisition
BREAK Request
Figure 3.4 Peripheral Data Acquisition Cancel Sequence Due to Break Request
background image
SEGA Confidential


53
SMPC User's Manual
Methods for Using INTBACK Command in SMPC Control Mode
Section 2 explained how to acquire SMPC status using the INTBACK command. As
was explained in Section 2, the INTBACK command can be used in three ways.
1) To acquire only the SMPC status.
2) To acquire peripheral data after acquiring SMPC status.
3) To acquire only peripheral data.
This section continues on mainly explaining the peripheral control functions by
explaining (2) "to acquire peripheral data after acquiring SMPC status" and (3) "to
acquire only peripheral data."
How to Acquire Peripheral Data After Acquiring SMPC Status
Here the procedure for acquiring peripheral data after acquiring the SMPC status is
explained. The procedure for acquiring SMPC status is explained in Section 2, so the
following only explains the procedure after status data acquisition. (Refer to Figures
3.3 and 3.4)
1) Continue request or break request (SH-2)
2) Peripheral data acquisition and result parameter setting (SMPC)
3) SMPC interrupt generation (SMPC)
4) Peripheral data acquisition (SH-2)
If peripheral data still remains, repeat processing from (1).
5) INTBACK command end
How to Acquire Only Peripheral Data
The procedure for using the INTBACK command to acquire only peripheral data is
explained below. (Refer to Figures 3.3 and 3.4)
1) Command parameter setting (SH-2).
2) INTBACK command issue (SH-2). Examples are given in Table 3.3.
3) Peripheral data collection and result parameter setting (SMPC).
4) SMPC interrupt generation (SMPC).
5) Peripheral data acquisition (SH-2)
When no peripheral data remains, the INTBACK command ends (SMPC).
6) Continue request or break request (SH-2)
7) When continue is requested the processing in (3) is repeated.
8) INTBACK command end.
background image
SEGA Confidential

54
Table 3.3
Example Acquisition Command Parameter Setting When Only Peripheral
Data Is Acquired
IREG
Setting Value
Description
IREG0
00
H
The data and time, cartridge code, area code, terminal
status, SMEM, and reset button mode data are not
returned.
IREG1
Application specifications
(except PEN bit)
Port 2 mode (P2MD1, P2MD0)=from application
specifications
Port 1 mode (P1MD1, P1MD0)=from application
specifications
Peripheral data enable (PEN)=1B return peripheral data
Acquisition time optimization (OPE)=from application
specifications
IREG2
F0
H
Set unconditionally in F0
H
.
background image
SEGA Confidential


55
SMPC User's Manual
Peripheral Data Collection Time Optimization
The application processing cycle for the SMPC was created as follows.
1) Peripheral data is prepared until V-BLANK-IN.
2) The sprite and control screen parameter in the peripheral are calculated and
output.
3) 3D calculation, etc.
4) Sprite and polygon drawing.
5) Display
The purpose of optimizing the peripheral data collection time is to collect the pe-
ripheral data as close to V-BLANK-IN as possible. In other words, the start of pe-
ripheral data collection is made as close as possible to V-BLANK-IN to shorten the
time from peripheral data collection to peripheral data acquisition by SH-2. Figure
3.5 shows an operation overview of peripheral data collection time optimization.
V-BLANK
V-BLANK
1
1
2
2
INTBACK Issued
INTBACK Issued
Peripheral Data Change
Peripheral Data Change
OREG Acquisition Peripheral
Information is
OREG Acquisition Peripheral
Information is
Peripheral Data Acquisition
Peripheral Data Is Changed
END
Response Is Slow
Optimization
END
Peripheral Data
Collection
Collection Start
Timing is Offset
1 ms
Figure 3.5 Overview of Peripheral Data Collection Time Optimization
background image
SEGA Confidential
56
Operations when Peripheral Data Collection Time Is Not Optimized
Issue the INTBACK command after 300
µ
s prior to V-BLANK-IN and before V-
BLANK-OUT. This makes it possible to accurately start peripheral data collection at
V-BLANK-OUT. Peripheral data collection starts when the SMPC detects V-BLANK-
OUT. The INTBACK command terminates at the time peripheral data collection is
finished.
Precautions when Peripheral Data Collection Time Is Not Optimized
The peripheral data collection end timing varies depending on the type and number
of peripherals that are connected. For example, for a SATURN standard PAD 2 unit
configuration, all the peripheral data is put in the OREG much faster than V-
BLANK-IN.
If an SMPC interrupt is used in this case, peripheral data can be acquired faster than
with V-BLANK-IN. Also, as above, when less than 32 OREG are used, peripheral
data can be acquired using V-BLANK-IN timing without using an SMPC interrupt.
Operations for Optimizing Peripheral Data Collection Time
Issue the INTBACK command after 300
µ
s after V-BLANK-IN and before V-BLANK-
OUT. This makes it possible to accurately start peripheral data collection at V-
BLANK-OUT.
When optimizing peripheral data collection time, the SMPC first collects peripheral
data without optimization and measures the collection time. The peripheral data
collection start timing is the timing when the SMPC detects V-BLANK-OUT, as in
the case when peripheral data collection time is not optimized.
From the next frame, a 1 msec margin is added to the measured time, and this time
is used as the peripheral data collecting time. The peripheral data is collected using
this timing. Refer to Figure 3.5 for more.
After that, the peripheral data collection time is constantly monitored and the data
collection time is optimized. Also, if a time-over occurs after optimization, the next
time optimization is be performed, V-BLANK-OUT will be used as the start timing.
background image
SEGA Confidential

57
SMPC User's Manual
Precautions when Optimizing Peripheral Data Collection Time
The peripheral data collection timing varies depending on the type and number of
peripherals that are connected. When performing peripheral data collection time
optimization, verify the types, number, and configuration of connected peripherals
and make a sufficient evaluation to prevent time-over from occurring.
In addition, when using continue as well, the continue request wait-time is mea-
sured as part of the peripheral data collection time. Therefore, make the time from
SMPC interrupt generation to continue request as short as possible, and be sure to
execute them at a set time.
background image
SEGA Confidential

58
INTBACK Command's Command Parameters During Peripheral Data Acquisition
Following is an explanation of command parameters when peripheral data is acquired
using the INTBACK command.
IREG0
There are two IREG0 settings: when the INTBACK command is issued and when con-
tinue or break is requested.
·
When INTBACK Command Is Issued
The IREG0 uses the SMPC status acquisition switch.
IREG0: SMPC Status Acquisition Switch Setting Value
IREG0 Setting
Value
Explanation
00H
All data for date and time, cartridge code, area code, terminal
status, SMEM, and reset button mode are not returned.
01H
IREG0 20100001H
bit7
bit0
Initial Value: Not Specified Write Only
Status Acquisition Switch (00H or 01H)
All data for date and time, cartridge code, area code, terminal
status, SMEM, and reset button mode are returned.
Figure 3.6 IREG0 (During INTBACK Command Issue)
·
During Continue and Break Request
The IREG0 uses the continue and break requests sent to the SMPC.
When the SMPC receives a continue request, it begins collecting the remaining
peripheral data. When it receives a break request, it stops collecting peripheral data
and terminates the INTBACK command.
bit7
bit0
IREG0 CONT
BR
---
CONT: CONTINUE Request Bit
CONTINUE is requested by changing the value of this bit.
BR:
BREAK Request Bit
A BREAK request is made by changing this bit to "1."
---:
Possible for both 0
H
and 1
H
.
---
---
---
---
---
Figure 3.7 IREG0 (During Continue and Break Requests)
Note:
When the CONT.BR request value that has reached maximum is also written in IREG0, it
cannot be guaranteed which operation the SMPC will execute. Refer to Table 3.2.
background image
SEGA Confidential

59
SMPC User's Manual
IREG1
The IREG1 uses the peripheral data collection mode.
IREG1 20100003
H
P2MD1 P2MD0
P1MD1 P1MD0
PEN
0
OPE
0
bit7
bit0
bit4
bit3
Unde. Unde. Unde. Unde. Unde. Unde. Unde. Unde.
W
W
W
W
W
---
W
---
Bit7, 6: Port 2 Mode
Bit7
Bit 6
Explanation
P2MD1
P2MD0
0
1
15-Byte Mode
255-Byte Mode
SEGA RESERVED (Setting Restricted)
0-Byte Mode
0
0
0
1
1
1
Bit5, 4: Port 1 Mode
Bit7
Bit 6
Explanation
P1MD1
P1MD0
0
1
15-Byte Mode
255-Byte Mode
SEGA RESERVED (Setting Restricted)
0-Byte Mode
0
0
0
1
1
1
Bit3: Peripheral Data Enable
Bit3
Explanation
PEN
0
Peripheral Data Not Returned
Peripheral Data Returned
1
Bit1: Acquisition Time Optimization
Bit1
Explanation
OPE
0
Peripheral Data Acquisition Time Optimized
Peripheral Data Acquisition Time not Optimized
1
Note:
When both the SH-2 direct mode and SMPC control mode are both used (example:
port 1=SH-2 direct mode, port 2=SMPC control mode), use the 0 byte mode in the
port used by SH-2 direct mode when the INTBACK command is issued.
Figure 3.8 IREG1
background image
SEGA Confidential

60
IREG2
F0
IREG2 20100005H
bit7
bit0
Initial Value: Not Specified Write Only
When issuing the INTBACK command, be sure to set F0 in IREG2.
H
H
Figure 3.9 IREG2
background image
SEGA Confidential

61
SMPC User's Manual
INTBACK Command Result Parameter During Peripheral Data Acquisition
Following is an explanation of the result parameter when peripheral data is acquired
using the INTBACK command.
Basic Configuration of Result Parameter Acquired Using INTBACK Command
When the INTBACK command is executed, the result parameter shown in Figure
3.10 is configured in the status register and OREG.
The peripheral control status shows the statuses used during peripheral control
mode. Port 1 status and port 2 status show their respective port peripheral connec-
tion states. The connected peripheral's ID and peripheral data are output in the port
1 data and port 2 data. When the peripheral is directly connected to the peripheral
port, the peripheral data for one unit is output. When a multitap is connected, the
peripheral data for several taps is output.
background image
SEGA Confidential
62
=
=
=
Peripheral Control
Status
Port 1 Data
Port 2 Data
SR
OREG
1
PDL NPE RESB
P2MD1 P2MD0 P1MD1 P1MD0
Port 1 Status
Peripheral 1 Data
Peripheral 2 Data
.
.
.
.
Peripheral m Data
Multitap ID
Num. of
Connectors
SATURN Peripheral ID
Extension Data Size
Peripheral 1 1st Data
Peripheral 1 2nd Data
.
.
.
Peripheral 1 nth Data
SATURN
Peripheral
Type
Data Size
Port 1 data and
Port 2 data have
the same structure
0<m<15
The maximum nth is 255.
Figure 3.10
Result Parameter Standard Configuration Acquired Using INTBACK Command
background image
SEGA Confidential


63
SMPC User's Manual
Result Parameter Configuration During 0 Byte Mode
When one of the ports is set to 0 byte mode, the port data set in 0 byte mode is
removed to make a smaller configuration. Figure 3.11 shows the data configuration
during 0 byte mode.
When Port 1 Mode and Port 2 Mode Are Other
Than 0-Byte Mode
SR
OREG
Peripheral Control
Status
Port 1 Data
Port 2 Data
Becomes configuration
where Port 1 Data portion
is packed.
Becomes configuration
where Port 2 Data portion
is removed.
Port 1 Mode Is
0-Byte Mode
Port 2 Mode Is
0-Byte Mode
Peripheral Control
Status
Port 2 Data
Peripheral Control
Status
Port 1 Data
Figure 3.11 Result Parameter Configuration when One Port is 0 Byte Mode
As shown above, the result parameter varies depending on the command parameter
setting conditions. Table 3.4 shows the relation between the command parameter
setting conditions and the created result parameter configuration.
background image
SEGA Confidential

64
Table 3.4
Command Parameter Setting Conditions and Peripheral Data Configuration
Command Parameter Setting Conditions
Result Parameter Configuration
Returns
SMPC Status
Returns
Peripheral Data
Has Port 1
Control
Has Port 2
Control
SMPC
Status
Port 1 Data
Port 2 Data
X
X
X
X
X
X
X
X
X
X
O
X
X
X
X
X
O
X
X
X
X
X
X
O
O
X
X
X
X
O
X
X
X
X
X
X
O
X
O
X
X
O
X
O
O
X
X
O
X
X
O
O
O
X
O
O
O
X
X
X
O
X
X
O
X
X
O
O
X
X
O
X
O
X
O
X
X
O
X
O
O
O
X
X
O
O
X
X
O
X
X
O
O
X
O
O
X
O
O
O
O
X
O
O
X
O
O
O
O
O
O
O
Use Prohibited
background image
SEGA Confidential


65
SMPC User's Manual
Peripheral Data Configuration
The peripheral data configuration is shown in Figure 3.12. Peripheral data consists
of the SATURN peripheral ID and peripheral data. The peripheral data body with-
out the SATURN peripheral ID has a maximum of 255 bytes.
OREG
SATURN Peripheral ID
Extension Data Size
Peripheral 1 1st Data
Peripheral 1 2nd Data
.
.
.
.
Peripheral 1 nth Data
SATURN Peripheral ID Configuration
bit7
bit4 bit3
bit0
SATURN
Peripheral Type
Data Size
The extension data size is added for peripherals
with data sizes of 16 bytes or more. Also, the
maximum size for nth is 255.
Figure 3.12 Peripheral Data Configuration
background image
SEGA Confidential

66
Result Parameter Details
Peripheral Control Status
The SMPC outputs the peripheral control status to the status register (SR) when the
SMPC control mode is used. The status register (SR) is a register that can be read
without regard for the INTBACK command. However, when the register is read
when the INTBACK command is not in use, all bits except the RESB bit will be
undefined.
bit7
bit0
SR
1
PDL
NPE
RESB P2MD1 P2MD0 P1MD1 P1MD0
P1MD: Port 1 Mode
00: 15-byte mode (Returns peripheral data up to a maximum of 15 bytes.)
01:
255-byte mode (Returns peripheral data up to a maximum of 255 bytes.)
10:
Unused
11: 0-byte mode (Port is not accessed.)
P2MD: Port 2 Mode
00: 15-byte mode (Returns peripheral data up to a maximum of 15 bytes.)
01:
255-byte mode (Returns peripheral data up to a maximum of 255 bytes.)
10:
Unused
11: 0-byte mode (Port is not accessed.)
RESB: Reset Button Status Bit
0: Reset Button OFF
1: Reset Button ON
Reading without regard for INTBACK command is possible. (Shows
status for each V-BLANK-IN.)
NPE:
Remaining Peripheral Existence Bit
0: No remaining data
1:
Remaining
data
PDL:
Peripheral Data Location Bit
0: 2nd or above peripheral data
1: 1st peripheral data
bit7:
Always 1
Figure 3.13 Peripheral Control Status
background image
SEGA Confidential



67
SMPC User's Manual
Port Status
The port status is 1-byte data that shows the state of the peripheral connected to the
port. Using the port status makes it possible to determine if the peripheral is directly
connected to the corresponding port or if a multitap is connected. Figure 3.14 shows
the port status configuration.
bit7
bit0
bit4 bit3
Multitap ID
Number of Connectors
Figure 3.14 Port Status Configuration
·
Number of Connectors
If the peripheral is directly connected to the peripheral port, 1
H
is shown; only one
peripheral can be connected to the port. If a multitap is connected, the number of
taps in the multitap is shown. When nothing is connected to the peripheral port,
or when a peripheral that the SMPC does not recognize is connected to the port,
0
H
is shown.
Table 3.5 shows the relation between the number of connectors and the connected
peripheral.
Table 3.5 Relation Between the Number of Connections and Peripherals
Number of Connectors
Connected Peripheral
0
H
· Not connected
· SMPC UNKNOWN peripheral is connected
1
H
· Peripheral is directly connected
2
H
~F
H
· Number of taps in the multitap
background image
SEGA Confidential



68
·
Multitap ID
The multitap ID is classified as follows depending on the peripheral connected.
1) When a peripheral is directly connected to the peripheral port, or none is
connected at all, the multitap ID is shown as F
H
.
2) When a multitap is connected to the peripheral port, 0
H
~E
H
is shown.
3) When a device not recognized by the SMPC (UNKNOWN device) is connected
to the peripheral port, the Mega Drive peripheral ID (hereafter MD PID) is
shown.
The connection of a SMPC UNKNOWN device is determined during the initial
phase between the SMPC and the peripheral by the transmission of a MD PID that
the SMPC does not support. When a justifier (Lethal Enforcers), etc., is used, con-
nection determination is performed by the SMPC control mode, and can be
handled by using the SH-2 direct mode after port status acquisition. In addition, if
an error occurs in the circuit between the SMPC and the peripheral during initial
phase, the peripheral is also determined to be UNKNOWN.
Table 3.6 Relation Between Connected Peripherals and Multitap ID
The multitap ID is collected separately from the SATURN peripheral ID. The
multitap ID is supplied by the multitap specifications. The multitap IDs and
number of connectors currently supported are shown in Table 3.7.
Table 3.7 Multitap ID and Number of Connectors
Peripheral Connected to the
Peripheral Port
Data Shown in Multitap ID
Peripheral is directly connected or
not connected
F
H
Multitap is connected
0
H
~E
H
UNKNOWN device is connected.
MD-PID
Multitap Name
Multitap ID
Number of Connectors
SEGA Tap
0
H
4
H
SATURN 6P Multitap
1
H
6
H
background image
SEGA Confidential


69
SMPC User's Manual
SATURN Peripheral ID
SATURN Peripheral ID Configuration
The SATURN peripheral ID is configured from the peripheral type and data size.
The peripheral data configuration and contents can be recognized from the SATURN
peripheral ID. The SATURN peripheral ID is shown in Figure 3.15.
bit7
bit0
bit4 bit3
SATURN Peripheral Type
Data Size
Figure 3.15 SATURN Peripheral ID Configuration
·
SATURN Peripheral Type
The SATURN peripheral type shows the type of peripheral. Therefore, it is used to
recognize how the peripheral data is aligned. Currently, four peripheral types are
defined for SATURN and are presented as the standard format. For details, please
refer to the item covering "SATURN Peripheral Standard Format."
·
Data Size
The data size shows how many bytes after the SATURN peripheral ID are being
output. Therefore, using the data size makes it possible to recognize from how
many bytes the peripheral data table is configured. It also makes it possible to
recognize where the start of the next peripheral data table is.
background image
SEGA Confidential

70
SATURN Peripheral ID Details
·
When a Peripheral Is Directly Connected to the Peripheral Port
SATURN peripherals can define a data size up to a maximum of 255 bytes.
There are two types of SATURN peripherals; those of 15 bytes or less and those of
16 bytes or more up to 255 bytes. There are also two port modes; 15-byte mode
and 255-byte mode. Therefore, as shown in Table 3.8, there are four combinations
that can be made from the peripheral data size and port mode. The SATURN
peripheral ID and peripheral data configuration are shown from Figure 3.16 to
Figure 3.18.
Table 3.8
Combinations of Peripheral Data Size and Port Mode (Peripheral Is
Connected Directly to Peripheral Port)
Peripheral Data Size
(Byte)
Port Mode (IREG1 Setting)
15
255
15
16-
255
Peripheral Data Configuration 1
Peripheral Data
Configuration 2
Peripheral Data
Configuration 3
bit7
bit0
bit4 bit3
SATURN Peripheral Type
Data Size
bit7
bit0
SATURN Peripheral ID
O
H
~E
H
1
H
~F
H
Peripheral Data Table
Peripheral Data 1st
Peripheral Data 2nd
.
.
.
Peripheral Data nth
nth shows the data size. The maximum size is 15 bytes.
Figure 3.16 Peripheral Data Configuration 1
background image
SEGA Confidential

71
SMPC User's Manual
bit7
bit0
bit4 bit3
SATURN Peripheral Type
Data Size
SATURN Peripheral ID
O
H
~E
H
0
H
Peripheral Data Table
Peripheral Data 1st
Peripheral Data 2nd
.
.
.
Peripheral Data 15th
Extension data size is limited to 15 bytes.
When accessed using 255-byte mode and the extension data
size is a combination of 0FH, permission will not be given by the
peripheral development side.
Extension Data Size
O
H
F
H
Figure 3.17 Peripheral Data Configuration 2
bit7
bit0
bit4 bit3
SATURN Peripheral Type
Data Size
SATURN Peripheral ID
O ~E
0
Peripheral Data Table
Peripheral Data 1st
Peripheral Data 2nd
.
.
.
Extension Data Size
Peripheral Data nth
nth shows the data size. The maximum size is 255 bytes.
1O ~FF
H
H
H
H
H
Figure 3.18 Peripheral Data Configuration 3
background image
SEGA Confidential

72
·
When a Multitap Is Connected to the Peripheral Port
When the multitap is connected, the port mode shows the maximum data size
that can be collected from the peripherals connected to each tap. (This is not the
total number of data that can be collected from the entire multitap.)
If the connected peripheral is 15 bytes or less, the peripheral data configuration 1
will be used whether the port mode is 15 bytes or 255 bytes. If the connected
peripheral is 16 bytes or more and the port mode is the 15-byte mode, only up to
15 bytes of data can be collected as for peripheral data configuration 2. If the
connected peripheral is 16 bytes or more and the port mode is the 255-byte mode,
all the peripheral data can be collected as in peripheral data configuration 3.
Also, if the specifications for the multitap itself are limited to 15 bytes or less, all
data of 16 bytes and beyond is cut off. With a multitap, it is possible to mix the
connection of peripherals of 15 bytes or less and 16 bytes or more. However, when
an INTBACK command is issued, the port mode can only be set to either 15-byte
or 255-byte mode.
Here, the specifications of the multitap define the maximum data size that can be
collected for each tap. When a multitap is used, the port mode setting is set to
follow the tap's maximum data size. In other words, if the multitap's specification
is a maximum of 15 bytes, the port mode should be set to 15-byte mode, and if the
multitap's maximum specification is 255 bytes, the port mode should be set to
255-byte mode.
The SATURN 6P multitap is a maximum of 15 bytes per tap. Use the 15-byte
mode for the port mode. Table 3.9 shows combinations of the multitap data size
and the port mode. The peripheral data configurations 1~3 in Table 3.9 are the
same as those shown in Figures 3.16~3.18.
The connection state of all taps when using a multitap is shown by each tap's
SATURN peripheral ID. When no peripheral is connected to the tap, or when the
connected device is UNKNOWN, the SATURN peripheral ID is output as shown
in Figures 3.19 and 3.20.
background image
SEGA Confidential

73
SMPC User's Manual
Peripheral Data
Configuration 3
Peripheral Data
Configuration 2
Peripheral Data
Size (Byte)
Port Mode (IREG1 Setting)
15
255
15
16-255
Peripheral Data Configuration 1
Not
Connected
Tap Peripheral Not Connected
UNKNOWN
Tap Peripheral UNKNOWN
bit7
bit0
SATURN Peripheral ID
FF
H
Figure 3.19 SATURN Peripheral ID when Tap Unconnected
bit7
bit0
bit4 bit3
SATURN Peripheral Type
Data Size
SATURN Peripheral ID
0~E
H
F
H
The Mega Drive peripheral ID is output to the data size.
It can be handled the same as the previously mentioned SMPC
UNKNOWN.
Figure 3.20 SATURN Peripheral ID when Tap Unknown
Table 3.9 Combinations of Peripheral Data Size and Port Mode (Multitap)
background image
SEGA Confidential

74
SH-2 Direct Mode
Block Diagram
Figure 3.21 shows the block diagram for the SH-2 direct mode. The SH-2 can directly
access peripherals via the two I/O port data registers (PDR1, PDR2) in the SMPC.
SH-2
SMPC
PDR1
PDR2
Data Bus
8
7
7
Figure 3.21 SH-2 Direct Mode Block Diagram
Characteristics
This mode becomes an effective means during the following procedures:
1) When controlling peripherals that require high-speed access that is faster than
the access speed possible in the SMPC control mode.
2) When data output from the peripherals is required.
3) When access to peripherals that need an external latch is required.
4) When access is required to a peripheral that is not supported by the SMPC.
background image
SEGA Confidential


75
SMPC User's Manual
Settings for Using the SH-2 Direct Mode
Figure 3.22 shows an example of a setting for using the SH-2 direct mode and shows
an example of a setting to port 1. Mode settings can be done independently for each
port.
SH-2 Direct Mode
Set PDR1
Set DDR1
Set IOSEL1 to "1"
External Latch Required
Set EXLE1 to "1"
Setting End
NO
YES
Figure 3.22 SH-2 Direct Mode Setting Example
When both the SH-2 direct mode and the SMPC control mode are used (example:
port 1=SH-2 direct mode, port 2=SMPC control mode), use the 0 byte mode for the
port used by the SH-2 direct mode at an INTBACK command issue.
background image
SEGA Confidential

76
3.2
SATURN Peripheral Standard Formats
Purpose of SATURN Peripheral Standard Formats
The SATURN peripheral standard format was prepared for the following purposes.
1) To be able to control multiplay even though the peripheral data configurations,
types, and meanings are different.
2) To be able to perform multiplay and to use any upward compatible peripherals,
such as increase buttons, increased number of analog channels, and added exten-
sion data, that may be sold in the future; as well as controlling previously sold
applications.
SATURN Standard Format Types and Data Formats
There are currently four SATURN standard formats that were created for the above
stated purposes. An explanation of these is given below.
·
SATURN Digital Device
This is a device that is only configured with buttons and is represented by the
SATURN standard PAD. The basic peripheral type is 0
H
and the data size is 2
bytes. The format characteristic is that the 1st Data is configured with the same
value as the Mega Drive 3 button.
Compatibility is preserved by adding the 1st Data to the application, which makes
it possible to control the application. Table 3.10 shows the SATURN digital device
format.
Table 3.10 SATURN Digital Device Standard Format
Right, Left, Down, Up, Start, A TRG, C TRG, B TRG, R TRG, X TRG, Y TRG, Z TRG, and L TRG
become 0 when the button is pushed down.
bit7
bit6
bit5
bit4
bit3
bit2
bit1
bit0
SATURN Peripheral ID
0
0
0
0
Data Size
1st Data
Right
Left
Down
Up
Start
A TRG C TRG B TRG
2nd Data
R TRG
X TRG Y TRG Z TRG
L TRG
Extension Data
3rd Data
Extension Data
:
Extension Data
:
Extension Data
nth Data
Extension Data
background image
SEGA Confidential


77
SMPC User's Manual
·
SATURN Analog Device
These devices, such as the analog joystick, analog steering wheel, and tablet,
contain an A/D converter. The basic peripheral type is 1
H
and the data size is
5 bytes. The format characteristic is that the 1st Data is configured with the same
value as the Mega Drive 3-button PAD.
Compatibility is preserved by adding the 1st Data to the application, which makes
it possible to control the application. Table 3.11 shows the SATURN analog device
standard format.
Table 3.11 SATURN Analog Device Standard Format
Right, Left, Down, Up, Start, A TRG, C TRG, B TRG, R TRG, X TRG, Y TRG, Z TRG, and L TRG
become 0 when the button is pushed down.
AX7~AX0, AY7~AY0, and AZ7~AZ0 are the absolute values of the unsigned A/D converter
output.
For AX7~AX0 and AY7~AY0, the upper left is (0,0) and the bottom right is (255,255).
For AZ7~AZ0, the bottom is 0 and the top is 255.
·
Pointing Device
This device outputs rotary encoder movement quantities, such as those from a
mouse or trackball. The peripheral type is 2H and the basic data size is 3 bytes.
The format characteristic is that unlike the data tables for digital devices, analog
devices, and keyboard devices. The data table for pointing devices does not have
data with the same value as the Mega Drive 3-button PAD.
In addition, the X and Y data movement is output as the amount of movement of
the rotary encoder (
delta), so if all three of the defined bytes are not supported,
compatibility cannot be maintained. Table 3.12 shows the SATURN pointing
device standard format.
bit7
bit6
bit5
bit4
bit3
bit2
bit1
bit0
SATURN Peripheral ID
0
0
0
1
Data Size
1st Data
Right
Left
Down
Up
Start
A TRG C TRG B TRG
2nd Data
R TRG
X TRG Y TRG Z TRG
L TRG
Extension Data
3rd Data
AX7
AX6
AX5
AX4
AX3
AX2
AX1
AX0
4th Data
AY7
AY6
AY5
AY4
AY3
AY2
AY1
AY0-
5th Data
AZ7
AZ6
AZ5
AZ4
AZ3
AZ2
AZ1
AZ0
6th Data
Extension Data
:
Extension Data
:
Extension Data
nth Data
Extension Data
background image
SEGA Confidential

78
Table 3.12 SATURN Pointing Device Standard Format
Y Over, X Over
0: X or Y data is valid.
1: Data is over flowing. (255 exceeded)
Y Sign, X Sign
0: X and Y data have positive values.
1: X and Y data have negative values.
XD7~XD0, YD7~YD0
Absolute value of amount of mouse movement.
Start, Middle, Right, Left
Becomes 1 when button is pushed.
·
Keyboard Device
Devices used for personal computers, represented by full keyboards. The periph-
eral type is 3
H
and the data size is 4 bytes. The format characteristic is that the 1st
Data is configured with the same value as for the Mega Drive 3-button PAD.
Compatibility is maintained by combining the 1st Data with the application to
control the application. Table 3.13 shows the SATURN keyboard device standard
format.
bit7
bit6
bit5
bit4
bit3
bit2
bit1
bit0
SATURN Peripheral ID
0
0
1
0
Data Size
1st Data
Y Over X Over Y Sign X Sign
Start
Middle
Right
Left
2nd Data
XD7
XD6
XD5
XD4
XD3
XD2
XD1
XD0-
3rd Data
YD7
YD6
YD5
YD4
YD3
YD2
YD1
YD0
4th Data
Extension Data
:
Extension Data
:
Extension Data
nth Data
Extension Data
background image
SEGA Confidential



79
SMPC User's Manual
Table 3.13 SATURN Keyboard Device Standard Format
Right, Left, Down, Up, Start, A TRG, C TRG, B TRG, R TRG, X TRG, Y TRG, Z TRG, and L TRG
become 0 when the button is pushed down. The corresponding values for each button and
keyboard key are given below.
For Caps Lock
1: Caps Lock is locked (Caps Lock LED is lit.)
For Num Lock
1: Num Lock is locked (Num Lock LED is lit.)
For Scroll Lock
1: Scroll Lock is locked (Scroll Lock LED is lit.)
For Make
1 is shown when there is a valid Make code (a key that shows
D7~D0 code is pushed down) in D7~D0.
For Break
1 is shown when there is a valid Break code (a key that shows
D7~D0 code is pushed down) in D7~D0.
D7~D0 show the key No. They are used with both Make and Break.
bit7
bit6
bit5
bit4
bit3
bit2
bit1
bit0
SATURN Peripheral ID
0
0
1
1
Data Size
1st Data
Right
Left
Down
Up
Start
A TRG C TRG B TRG
2nd Data
R TRG
X TRG Y TRG Z TRG
L TRG
Extension Data
3rd Data
0
Caps
Lock
Num
Lock
Scroll
Lock
Make
1
1
Break
4th Data
D7
D6
D5
D4
D3
D2
D1
D0
5th Data
Extension Data
:
Extension Data
:
Extension Data
nth Data
Extension Data
Button
Key
Right
Left
Down
Up
Start
ESC
A TRG
Z
C TRG
C
B TRG
X
R TRG
Q
X TRG
A
Y TRG
S
Z TRG
D
L TRG
E
background image
SEGA Confidential

80
Future Expansion of Standard Formats
At the present time, four types of formats have been prepared. More will be pre-
pared in the future when required.
Precautions when Using Standard Formats
Because the system conforms to standard formats, when the data is larger than the
standard format size the extra data is deleted. Further, when the data size is smaller
than the standard format, other data will be added to make up the insufficiency. In
addition, As an example of how handling is done on the peripheral end, there is
analog X-Y control as for the analog joystick. When there is no appropriate digital
input, a value that is higher than that of the analog X-Y data is used on the periph-
eral end to make it possible to turn on and off the U, D, L, and R bits.
background image
SEGA Confidential


81
SMPC User's Manual
3.3
Support Peripheral Data Format in SMPC Control Mode
This section describes the SMPC support peripheral data format in the SMPC control
mode. For detailed data on each peripheral, refer to the manual for each peripheral.
Mega Drive 3-Button PAD
Table 3.14 shows the Mega Drive 3-button PAD data format for SMPC control mode.
Table 3.14 Mega Drive 3-Button PAD Data Format in SMPC Control Mode
Right, Left, Down, Up, Start, A TRG, C TRG, and B TRG become 0 when the button is pushed.
Mega Drive 6-Button PAD
Table 3.15 shows the Mega Drive 6-button PAD data format for SMPC control mode.
Table 3.15 Mega Drive 6-Button PAD Data Format in SMPC Control Mode
Right, Left, Down, Up, Start, A TRG, C TRG, B TRG, MODE, X TRG, Y TRG, and Z TRG become 0
when the button is pushed.
SATURN Mouse (Provisional Name)
Table 3.16 shows the SATURN mouse data format for SMPC control mode.
bit7
bit6
bit5
bit4
bit3
bit2
bit1
bit0
SATURN Peripheral ID
1
1
1
0
0
0
0
1
1st Data
Right
Left
Down
Up
Start
A TRG C TRG B TRG
bit7
bit6
bit5
bit4
bit3
bit2
bit1
bit0
SATURN Peripheral ID
1
1
1
0
0
0
1
0
1st Data
Right
Left
Down
Up
Start
A TRG C TRG B TRG
2nd Data
MODE
X TRG Y TRG Z TRG
1
1
1
1
background image
SEGA Confidential

82
Table 3.16 SATURN Mouse Data Format in SMPC Control Mode
Y Over, X Over
0: X or Y data is valid.
1: Data is over-flowing. (255 exceeded)
Y Sign, X Sign
0: X and Y data have positive values.
1: X and Y data have negative values.
XD7~XD0, YD7~YD0
Absolute value of amount of mouse movement.
Start, Middle, Right, Left
Becomes 1 when button is pushed.
SEGA Tap
In the SMPC control mode, the port status shown in Table 3.17 is output. The SEGA
Tap is connected to the Mega Drive 3-button PAD, Mega Drive 6-button PAD, and
SEGA mouse. For information regarding peripheral data, refer to each peripheral
data format.
Table 3.17 SEGA Tap Port Status in SMPC Control Mode
SATURN Standard PAD (Provisional Name)
Table 3.18 shows the SATURN standard PAD data format for SMPC control mode.
Table 3.18 SATURN Standard PAD Data Format in SMPC Control Mode
Right, Left, Down, Up, Start, A TRG, C TRG, B TRG, R TRG, X TRG, Y TRG, Z TRG and L TRG
become 0 when the button is pushed.
bit7
bit6
bit5
bit4
bit3
bit2
bit1
bit0
SATURN Peripheral ID
1
1
1
0
0
0
1
1
1st Data
Y Over X Over Y Sign X Sign
Start
Middle
Right
Left
2nd Data
XD7
XD6
XD5
XD4
XD3
XD2
XD1
XD0
3rd Data
YD7
YD6
YD5
YD4
YD3
YD2
YD1
YD0
Multitap ID
No. of Connectors
O
H
4
H
bit7
bit6
bit5
bit4
bit3
bit2
bit1
bit0
SATURN Peripheral ID
0
0
0
0
0
0
1
0
1st Data
Right
Left
Down
Up
Start
A TRG C TRG B TRG
2nd Data
R TRG
X TRG Y TRG Z TRG
L TRG
1
1
1
background image
SEGA Confidential


83
SMPC User's Manual
SATURN Analog Joystick (Provisional Name)
Table 3.19 shows the SATURN analog joystick data format for SMPC control mode.
The data AX7~AX0, AY7~AY0, and AZ7~AZ0 are the absolute values output by the
A/D converter.
Table 3.19 SATURN Analog Joystick Data Format in SMPC Control Mode
Right, Left, Down, Up, Start, A TRG, C TRG, B TRG, R TRG, X TRG, Y TRG, Z TRG, and L TRG
become 0 when the button is pushed down.
AX7~AX0, AY7~AY0, and AZ7~AZ0 are the absolute values of the unsigned A/D converter
output.
For AX7~AX0 and AY7~AY0, the upper left is (0,0) and the bottom right is (255,255).
For AZ7~AZ0, the bottom is 0 and the top is 255.
SATURN Keyboard (Provisional Name)
Table 3.20 shows the SATURN keyboard data format for SMPC control mode.
Table 3.20 SATURN Keyboard Data Format in SMPC Control Mode
Right, Left, Down, Up, Start, A TRG, C TRG, B TRG, R TRG, X TRG, Y TRG, Z TRG, and L TRG
become 0 when the button is pushed down.
bit7
bit6
bit5
bit4
bit3
bit2
bit1
bit0
SATURN Peripheral ID
0
0
0
1
0
1
0
1
1st Data
Right
Left
Down
Up
Start
A TRG C TRG B TRG
2nd Data
R TRG
X TRG Y TRG Z TRG
L TRG
1
1
1
3rd Data
AX7
AX6
AX5
AX4
AX3
AX2
AX1
AX0
4th Data
AY7
AY6
AY5
AY4
AY3
AY2
AY1
AY0
5th Data
AZ7
AZ6
AZ5
AZ4
AZ3
AZ2
AZ1
AZ0
bit7
bit6
bit5
bit4
bit3
bit2
bit1
bit0
SATURN Peripheral ID
0
0
1
1
0
1
0
0
1st Data
Right
Left
Down
Up
Start
A TRG
C TRG
B TRG
2nd Data
R TRG
X TRG Y TRG Z TRG
L TRG
KB
TYPE2
KB
TYPE1
KB
TYPE0
3rd Data
0
Caps
Lock
Num
Lock
Scroll
Lock
Make
1
1
Break
4th Data
D7
D6
D5
D4
D3
D2
D1
D0
background image
SEGA Confidential

84
The corresponding values for each button and keyboard key are given below.
KBTYPE2~0
000: SATURN Keyboard
001~110: SEGA RESERVED
111: UNKNOWN
The KBTYPE shown here is used for the IBM keyboard conversion adapter format.
When IBM keyboards 101, 102, and 106 are connected to the conversion adapter, 000
is displayed. When a keyboard not supported by the conversion adapter, or when a
device not recognized as a keyboard is connected to the conversion adapter, 111 is
output. In the future, with the integration accompanying the commercialization of
the keyboard, the system will be configured to output 000.
For Caps Lock
1: Caps Lock is locked (Caps Lock LED is lit.)
For Num Lock
1: Num Lock is locked (Num Lock LED is lit.)
For Scroll Lock
1: Scroll Lock is locked (Scroll Lock LED is lit.)
For Make
1 is shown when there is a valid Make code (a key that shows
D7~D0 code is pushed down) in D7~D0.
For Break
1 is shown when there is a valid Break code (a key that shows
D7~D0 code is pushed down) in D7~D0.
D7~D0
Shows the key No. They are used with both Make and Break.
Button
Key
Right
Left
Down
Up
Start
ESC
A TRG
Z
C TRG
C
B TRG
X
R TRG
Q
X TRG
A
Y TRG
S
Z TRG
D
L TRG
E
background image
SEGA Confidential


85
SMPC User's Manual
SATURN 6P Multitap (Provisional Name)
In the SMPC control mode, the port status shown in Table 3.21 is output. The SAT-
URN 6P multitap is connected to the Mega Drive 3-button PAD, Mega Drive 6-
button PAD, SATURN standard PAD (provisional name), SATURN analog joystick
(provisional name), SATURN mouse (provisional name), and SATURN standard
keyboard (provisional name). For information regarding peripheral data, refer to
each peripheral data format.
For the SATURN 6P multitap, the maximum data size for each tap is 15 bytes. Use
the 15-byte port mode.
Table 3.21 SATURN 6P Multitap Port Status
Multitap ID
No. of Connectors
1
H
6
H
background image
SEGA Confidential

86
3.4
Support Peripheral Data Format in SH-2 Direct Mode
This section explains about peripheral access protocols and data formats in the SH-2
direct mode.
About Peripheral Port Bit Names
The SMPC peripheral ports were configured to succeed Mega Drive peripheral ports
to maintain compatibility. The naming method for port bit names was also kept.
Table 3.22 shows the relationship between the port bit number and port bit name.
Hereafter, this manual will give explanations using port bit names.
Table 3.22 Relationship Between Port Bit Number and Port Bit Name
Mega Drive Peripheral ID Computing Method in SH-2 Direct Mode
The Mega Drive peripheral ID calculation formula is given below, and is shown by
the four bits ID3, ID2, ID1, and ID0.
ID3=R # L
(TH=1)
ID2=D # U
(TH=1)
ID1=R # L
(TH=0)
ID0=D # U
(TH=0)
# signifies the logical sum OR.
Port Bit Number
bit6
bit5
bit4
bit3
bit2
bit1
bit0
Port Bit Name
TH
TR
TL
R
L
D
U
background image
SEGA Confidential


87
SMPC User's Manual
Port Setting During Mega Drive Peripheral ID Acquisition
The port direction register setting values during Mega Drive peripheral ID acquisi-
tion are shown in Table 3.23. When the port direction is set as shown below, Read is
performed when TH=1 for RLDU and TH=0 for RLDU, and the Mega Drive periph-
eral ID can be output using the above explained formula.
After TH is changed, read the R, L, D, and U after 2
µ
S.
Table 2.23
Port Direction Register Setting Value During Mega Drive Peripheral ID
Acquisition
Peripheral Interface Protocol
There are three types of peripheral interface protocols. Following is given an over-
view of each peripheral protocol and the peripherals they support.
TH Control Method
The TH control method interface protocol is a method that acquires data when TH=1
for TR, TL, R, L, D, and U and when TH=0 for TR, TL, R, L, D, and U. The peripher-
als that support this protocol are the Mega Drive 3-button PAD and Mega Drive 6-
button PAD.
TH and TR Control Method
The TH and TR control method interface protocol is a method that acquires data
when the 4-bit pattern for TH and TR is R, L, D, and U. The peripheral that supports
this protocol is the Saturn Standard PAD.
3-Line Handshake Method
The 3-line handshake method SEL (select) the peripheral when TH=0, transfers REQ
(request) from TR, and then returns an ACK (acknowledgment) to TL when the R, L,
D, and U data has been verified. The 3-line handshake method is a method that
acquires data after confirming the status using the above three control signals. The
peripherals that support this protocol are the SEGA tap, SEGA mouse, SATURN
analog joystick, SATURN keyboard, and SATURN 6P multitap.
Mega Drive Peripheral ID for Each Port
The Mega Drive peripheral ID for each peripheral is given in Table 3.24.
Port Bit Name
TH
TR
TL
R
L
D
U
Port Direction
Set to Output
Set to Input
background image
SEGA Confidential


88
Table 3.24 Mega Drive Peripheral ID for Each Peripheral
Access Sequence in SH-2 Direct Mode for Peripherals that Have a
Mega Drive ID Other Than 5H
The access sequence in SH-2 direct mode to peripherals that have Mega Drive pe-
ripheral ID's other than 5
H
is given below.
1) Acquire the Mega Drive peripheral ID.
2) Determine the type of peripheral from the Mega Drive peripheral ID. Execute the
appropriate sequence for the peripheral and acquire the data. The SATURN
peripheral ID is not returned for peripherals that have Mega Drive peripherals
other than 5
H
.
Peripheral Name
Mega Drive Peripheral ID
Mega Drive 3-Button PAD
D
H
Mega Drive 6-Button PAD
D
H
&C
H
SEGA Mouse
3
H
SEGA Tap
7
H
SATURN Standard PAD
B
H
SATURN Analog Joystick
5
H
SATURN Keyboard
5
H
SATURN Multitap
5
H
background image
SEGA Confidential


89
SMPC User's Manual
Access Sequence in SH-2 Direct Mode for Peripherals that Have a 5H
Mega Drive ID
The access sequence in SH-2 direct mode to peripherals that have a 5
H
Mega Drive
peripheral ID's.
1) Acquire the Mega Drive peripheral ID.
2) Execute the appropriate protocol required for the Mega Drive peripheral ID and
acquire the Saturn peripheral ID.
The protocol is determined by the D and U that comprise the Mega Drive
peripheral ID. Other combinations are SEGA RESERVED.
3-Line Handshake Method Peripherals
D, U = 0, 1
(TH=1)
D, U = 0, 1
(TH=0)
3) Acquire the SATURN peripheral ID, perform the number of accesses required for
the data size, and receive all peripheral data.
background image
SEGA Confidential

90
Mega Drive 3-Button PAD
The Mega Drive 3-button PAD is a TH control method peripheral. The access proto-
col operates by having the 1st Data and 2nd Data alternately output by repeatedly
changing the TH bit value. The Mega Drive peripheral ID is DH. Table 3.25 shows
the Mega Drive
3-button PAD access protocol and data format for the SH-2 direct mode.
After the TH is changed, read the TR, TL, R, L, D, and U after 2
µ
S.
Table 3.25 Mega Drive 3-Button PAD Data Format for SH-2 Direct Mode
Right, Left, Down, Up, Start, A TRG, C TRG, and B TRG become 0 when the button is pushed
down.
Mega Drive 6-Button PAD
The Mega Drive 6-button PAD is a TH control method peripheral. The access proto-
col operates by having the 1st Data to the 8th Data repeatedly output by repeatedly
changing the TH bit value. To preserve the compatibility with the Mega Drive 3-
button PAD, the Mega Drive 6-button PAD uses the same Mega Drive peripheral ID.
With the 6-button PAD, continuing ID identification until the 6th Data will change
the ID from DH to CH. Table 3.26 shows the Mega Drive 6-button PAD data format
for the SH-2 direct mode.
After the TH is changed, read the TR, TL, R, L, D, and U after 2
µ
S. After data acqui-
sition, have TH=1 remain for over 2 mS until the next acquisition.
Table 3.26 Mega Drive 6-Button PAD Data Format for SH-2 Direct Mode
Right, Left, Down, Up, Start, A TRG, C TRG, and B TRG become 0 when the button is pushed
down.
Output
Input
TH
TR
TL
R
L
D
U
1st Data
1
C TRG
B TRG
Right
Left
Down
Up
2nd Data
0
Start
A TRG
0
0
Down
Up
Mega Drive Peripheral ID Acquisition Sequence
Output
Input
TH
TR
TL
R
L
D
U
1st Data
1
C TRG
B TRG
Right
Left
Down
Up
2nd Data
0
Start
A TRG
0
0
Down
Up
3rd Data
1
C TRG
B TRG
Right
Left
Down
Up
4th Data
0
Start
A TRG
0
0
Down
Up
5th Data
1
C TRG
B TRG
Right
Left
Down
Up
6th Data
0
Start
A TRG
0
0
0
0
7th Data
1
C TRG
B TRG
MD
X TRG
Y TRG
Z TRG
8th Data
0
Start
A TRG
1
1
1
1
Mega Drive Peripheral ID Acquisition Sequence
background image
SEGA Confidential


91
SMPC User's Manual
SATURN Mouse (Provisional Name)
The SATURN mouse is a 3-line handshake method peripheral. There are three se-
quence types for the SATURN mouse: power on reset, reset, and data request.
1) Power On Reset
When the power is turned on the mouse is automatically initialized. While the
mouse is being initialized the TL bit is made 0
B
to notify the SH-2 that the mouse
is being initialized.
Do not make a data request until initialization is finished. Table 3.27 shows the
data format during SATURN mouse power on reset in SH-2 direct mode.
Table 3.27
Data Format During SATURN Mouse Power On Reset for SH-2 Direct
Mode
2) Reset
This is the sequence that resets the SATURN mouse from the SH-2.
A mouse reset request can be made by changing TR to 0
B
when TH is 1
B
. The
SATURN mouse answers the request by changing TL to 0
B
. Initialization begins
when the SH-2 changes TR to 1
B
.
Do not make a data request until initialization is completed. Table 3.28 shows the
data format during SATURN mouse reset in the SH-2 direct mode.
Output
Input
TH
TR
TL
R
L
D
U
During Reset
1
1
0
0
0
0
0
Reset Finished
1
1
1
0
0
0
0
background image
SEGA Confidential

92
Table 3.28 Data Format During SATURN Mouse Reset for SH-2 Direct Mode
3) Data Request
This sequence acquires data from the mouse. It is started by changing TH to 0
B
,
and ended by changing both TH and TR to 1
B
.
The first data is the Mega Drive ID acquisition phase. Data is acquired by chang-
ing TH to 0
B
from 1
B
. After TH is changed, read R, L, D, and U after 2
µ
s. Later
data is acquired by a handshake with TR and TL. Table 3.29 shows the data
format during SATURN mouse data request in the SH-2 direct mode.
Output
Input
TH
TR
TL
R
L
D
U
Initial Status
1
1
1
0
0
0
0
Reset Request
1
0
1
0
0
0
0
Reset Acknowledge
1
0
0
0
0
0
0
Reset Execute
1
1
0
0
0
0
0
Reset End
1
1
1
0
0
0
0
background image
SEGA Confidential


93
SMPC User's Manual
Table 3.29
Data Format During SATURN Mouse Data Request for SH-2 Direct Mode
Y Over, X Over
0: X or Y data is valid.
1: Data is over flowing. (255 exceeded)
Y Sign, X Sign
0: X and Y data have positive values.
1: X and Y data have negative values.
XD7~XD0, YD7~YD0
Absolute value of amount of mouse movement.
Start, Middle, Right, Left
Becomes 1 when button is pushed.
Output
Input
TH
TR
TL
R
L
D
U
1st Data
1
1
1
0
0
0
0
2nd Data
0
1
1
1
0
1
1
0
0
1
x
x
x
x
3rd Data
0
0
0
1
1
1
1
0
1
0
x
x
x
x
4th Data
0
1
1
1
1
1
1
0
0
1
x
x
x
x
5th Data
0
0
0
Y Over
X Over
Y Sign
X Sign
0
1
0
x
x
x
x
6th Data
0
1
1
Start
Middle
Right
Left
0
0
1
x
x
x
x
7th Data
0
0
0
XD7
XD6
XD5
XD4
0
1
0
x
x
x
x
8th Data
0
1
1
XD3
XD2
XD1
XD0
0
0
1
x
x
x
x
9th Data
0
0
0
YD7
YD6
YD5
YD4
0
1
0
x
x
x
x
10th Data
0
1
1
YD3
YD2
YD1
YD0
End Request
1
1
x
x
x
x
x
End
1
1
1
0
0
0
0
Mega Drive Peripheral ID Acquisition Sequence
background image
SEGA Confidential

94
SEGA Tap
The SEGA tap is a 3-line handshake method peripheral. There are two sequence
types for the SEGA tap: power on reset and data request.
1) Power On Reset
When the power is turned on the tap is automatically initialized. While the tap is
being initialized the TL bit is made 0
B
to notify the SH-2 that the mouse is being
initialized. Do not make a data request until initialization is finished. Table 3.30
shows the data format during SEGA tap power on reset in SH-2 direct mode.
Table 3.30
Data Format During SEGA Tap Power On Reset for SH-2 Direct Mode
2) Data Request
This is the sequence to acquire data from the SEGA tap. A data request is started
by changing TH to 0
B
and ended by changing TH and TR to 1
B
. The first data is
the Mega Drive ID acquisition phase. Data is acquired by changing TH to 0
B
from
1
B
. After TH is changed, read R, L, D, and U after 2
µ
s. Acquire the data thereaf-
ter with a handshake with TR and TL. Table 3.31 shows the data format during
SEGA tap data request in the SH-2 direct mode.
Output
Input
TH
TR
TL
R
L
D
U
During Reset
1
1
0
0
0
0
0
Reset Finished
1
1
1
0
0
0
0
background image
SEGA Confidential



95
SMPC User's Manual
Table 3.31
Data Format During SEGA Tap Data Request for SH-2 Direct Mode
The 1P~4P DevID in Table 3.31 shows the ID of the peripherals connected to SEGA
tap. The peripherals that can be connected to SEGA tap are the Mega Drive 3-button
PAD, Mega Drive 6-button PAD, and SEGA mouse. Table 3.32 shows the ID of the
connected devices.
Table 3.32 Connected Peripherals and ID
Output
Input
TH
TR
TL
R
L
D
U
1st Data
1
1
1
0
0
1
1
2nd Data
0
1
1
1
1
1
1
0
0
1
x
x
x
x
3rd Data
0
0
0
0
0
0
0
0
1
0
x
x
x
x
4th Data
0
1
1
0
0
0
0
0
0
1
x
x
x
x
5th Data
0
0
0
1P
DevID3
1P
DevlD2
1P
DevlD1
1P
DevlD0
0
1
0
x
x
x
x
6th Data
0
1
1
2P
DevID3
2P
DevlD2
2P
DevlD1
2P
DevlD0
0
0
1
x
x
x
x
7th Data
0
0
0
3P
DevID3
3P
DevlD2
3P
DevlD1
3P
DevlD0
0
1
0
X
X
X
X
8th Data
0
1
1
4P
DevID3
4P
DevlD2
4P
DevlD1
4P
DevlD0
0
0
1
x
x
x
x
9th Data and Later
0
0
0
D3
D2
D1
D0
End Request
1
1
x
x
x
x
x
End
1
1
1
0
0
1
1
Mega Drive Peripheral ID Acquisition Sequence
I D
Peripheral Name
0
H
Mega Drive 3-button PAD
1
H
Mega Drive 6-button PAD
2
H
SEGA mouse
F
H
Unconnected or Unknown
background image
SEGA Confidential

96
The data of devices connected to bits D3~D0 of the 9th Data and later from Table 3.31
continues. The data format of each device is given on the following page.
(a) Mega Drive 3-Button PAD
Table 3.33 shows the Mega Drive 3-button PAD data format when connected to
SEGA tap.
Table 3.33
Mega Drive 3-Button PAD Data Format During Connection to SEGA Tap
Right, Left, Down, Up, Start, A TRG, C TRG, and B TRG are 0 when the button is pushed down.
(b) Mega Drive 6-Button PAD
Table 3.34 shows the Mega Drive 6-button PAD data format when connected to
SEGA tap.
Table 3.34
Mega Drive 6-Button PAD Data Format During Connection to SEGA Tap
Right, Left, Down, Up, Start, A TRG, C TRG, B TRG, MODE, X TRG, Y TRG, and Z TRG are 0
when the button is pushed down.
(c) SEGA Mouse
Table 3.35 shows the SEGA mouse data format when connected to SEGA tap.
Table 3.35
SEGA Mouse Data Format During Connection to SEGA Tap
Y Over, X Over
0: X or Y data is valid.
1: Data is over flowing. (255 exceeded)
Y Sign, X Sign
0: X and Y data have positive values.
1: X and Y data have negative values.
XD7~XD0, YD7~YD0
Absolute value of amount of mouse movement.
Start, Middle, Right, Left
Becomes 1 when button is pushed.
bit3
bit2
bit1
bit0
Right
Left
Down
Up
Start
A TRG
C TRG
B TRG
bit3
bit2
bit1
bit0
Y Over
X Over
Y Sign
X Sign
Start
Middle
Right
Left
XD7
XD6
XD5
XD4
XD3
XD2
XD1
XD0
YD7
YD6
YD5
YD4
YD3
YD2
YD1
YD0
bit3
bit2
bit1
bit0
Right
Left
Down
Up
Start
A TRG
C TRG
B TRG
MODE
X TRG
Y TRG
Z TRG
background image
SEGA Confidential


97
SMPC User's Manual
SATURN Standard PAD (Provisional Name)
The SATURN standard PAD is a TH and TR control method peripheral.
Data is output by repeating the specified bit pattern in the TH and TR bits. After TH
and TR have been changed, read the R, L, D, and U after 2
µ
s. Table 3.36 shows the
SATURN standard PAD data format in the SH-2 direct mode.
Table 3.36 SATURN Standard PAD Data Format for SH-2 Direct Mode
Right, Left, Down, Up, Start, A TRG, C TRG, B TRG, R TRG, X TRG, Y TRG, Z TRG, and L TRG
become 0 when the button is pushed down.
SATURN Analog Joystick (Provisional Name)
The SATURN analog joystick is a 3-wire handshake method peripheral. Start is done
by changing TH to 0
B
and end is done by changing TH and TR to 1
B
.
The first data is the Mega Drive ID acquisition phase. Data is acquired by changing
TH to 0
B
from 1
B
. After TH is changed, read R, L, D, and U after 2
µ
s. Acquire later
data by making a handshake with TR and TL. Table 3.37 shows the SATURN analog
joystick data format in SH-2 direct mode.
Output
Input
TH
TR
TL
R
L
D
U
1st Data
1
1
1
L TRG
1
0
0
2nd Data
0
1
1
Right
Left
Down
Up
3rd Data
1
0
1
Start
A TRG
C TRG
B TRG
4th Data
0
0
1
R TRG
X TRG
Y TRG
Z TRG
Mega Drive Peripheral ID Acquisition Sequence
background image
SEGA Confidential


98
Table 3.37 SATURN Analog Joystick Data Format for SH-2 Direct Mode
Right, Left, Down, Up, Start, A TRG, C TRG, B TRG, R TRG, X TRG, Y TRG, Z TRG, and L TRG
become 0 when the button is pushed down.
AX7~AX0, AY7~AY0, and AZ7~AZ0 are the absolute values of the unsigned A/D converter output.
For AX7~AX0 and AY7~AY0, the upper left is (0,0) and the bottom right is (255,255).
For AZ7~AZ0, the bottom is 0 and the top is 255.
Output
Input
TH
TR
TL
R
L
D
U
1st Data
1
1
1
0
0
0
1
2nd Data
0
1
1
0
0
0
1
0
0
1
x
x
x
x
3rd Data
0
0
0
0
0
0
1
0
1
0
x
x
x
x
4th Data
0
1
1
0
1
0
1
0
0
1
x
x
x
x
5th Data
0
0
0
Right
Left
Down
Up
0
1
0
x
x
x
x
6th Data
0
1
1
Start
A TRG
C TRG
B TRG
0
0
1
x
x
x
x
7th Data
0
0
0
R TRG
X TRG
Y TRG
Z TRG
0
1
0
X
X
X
X
8th Data
0
1
1
L TRG
1TRG
2TRG
3TRG
0
0
1
x
x
x
x
9th Data
0
0
0
AX7
AX6
AX5
AX4
0
1
0
x
x
x
x
10th Data
0
1
1
AX3
AX2
AX1
AX0
0
0
1
x
x
x
x
11th Data
0
0
0
AY7
AY6
AY5
AY4
0
1
0
x
x
x
x
12th Data
0
1
1
AY3
AY2
AY1
AY0
0
0
1
x
x
x
x
13th Data
0
0
0
AZ7
AZ6
AZ5
AZ4
0
1
0
x
x
x
x
14th Data
0
1
1
AZ3
AZ2
AZ1
AZ0
0
0
1
x
x
x
x
15th Data
0
0
0
0
0
0
0
0
1
0
x
x
x
x
16th Data
0
1
1
0
0
0
1
End Request
1
1
x
x
x
x
x
End
1
1
1
0
0
0
1
Mega Drive Peripheral ID Acquisition Sequence
SATURN Peripheral ID Acquisition Sequence
background image
SEGA Confidential


99
SMPC User's Manual
SATURN Keyboard
The SATURN keyboard is a 3-wire handshake method peripheral. Start is done by
changing TH to 0
B
and end is done by changing TH and TR to 1
B
.
The first data is the Mega Drive ID acquisition phase. Data is acquired by changing
TH to 0
B
from 1
B
. After TH is changed, read R, L, D, and U after 2
µ
s. Acquire later
data by making a handshake with TR and TL. Table 3.38 shows the SATURN key-
board data format in SH-2 direct mode.
background image
SEGA Confidential


100
Table 3.38 SATURN Keyboard Data Format for SH-2 Direct Mode
Right, Left, Down, Up, Start, A TRG, C TRG, B TRG, R TRG, X TRG, Y TRG, Z TRG, and L TRG
become 0 when the button is pushed down.
Output
Input
TH
TR
TL
R
L
D
U
1st Data
1
1
1
0
0
0
1
2nd Data
0
1
1
0
0
0
1
0
0
1
x
x
x
x
3rd Data
0
0
0
MDID3
MDID2
MDID1
MDID0
0
1
0
x
x
x
x
4th Data
0
1
1
D S I Z E
3
DS9ZE
2
D S I Z E
1
D S I Z E
0
0
0
1
x
x
x
x
5th Data
0
0
0
Right
Left
Down
Up
0
1
0
x
x
x
x
6th Data
0
1
1
Start
A TRG
C TRG
B TRG
0
0
1
x
x
x
x
7th Data
0
0
0
R TRG
X TRG
Y TRG
Z TRG
0
1
0
X
X
X
X
8th Data
0
1
1
L TRG
KBTYPE2
KBTYPE1
KBTYPE0
0
0
1
x
x
x
x
9th Data
0
0
0
0
Caps
Lock
Num
Lock
Scroll
Lock
0
1
0
x
x
x
x
10th Data
0
1
1
Make
1
1
Break
0
0
1
x
x
x
x
11th Data
0
0
0
D7
D6
D5
D4
0
1
0
x
x
x
x
12th Data
0
1
1
D3
D2
D1
D0
0
0
1
x
x
x
x
13th Data
0
0
0
0
0
0
0
0
1
0
x
x
x
x
14th Data
0
1
1
0
0
0
1
End Request
1
1
x
x
x
x
x
End
1
1
1
0
0
0
1
Mega Drive Peripheral ID Acquisition Sequence
SATURN Peripheral ID Acquisition Sequence
background image
SEGA Confidential



101
SMPC User's Manual
The corresponding values for each button and keyboard key are given below.
KBTYPE2~0
000: SATURN Keyboard
001~110: SEGA RESERVED
111: UNKNOWN
The KBTYPE shown here is used for the IBM keyboard conversion adapter format.
When IBM keyboards 101, 102, and 106 are connected to the conversion adapter, 000
is shown. When a keyboard not supported by the conversion adapter, or when a
device not recognized as a keyboard is connected to the conversion adapter, 111 is
output. In the future, with the integration accompanying the commercialization of
the keyboard, the system will be configured to output 000.
For Caps Lock
1: Caps Lock is locked (Caps Lock LED is lit.)
For Num Lock
1: Num Lock is locked (Num Lock LED is lit.)
For Scroll Lock
1: Scroll Lock is locked (Scroll Lock LED is lit.)
For Make
1 is shown when there is a valid Make code (a key that shows D7~D0
code is pushed down) in D7~D0.
For Break
1 is shown when there is a valid Break code (a key that shows D7~D0 code
is pushed down) in D7~D0.
D7~D0
Shows the key No. They are used with both Make and Break.
Button
Key
Right
Left
Down
Up
Start
ESC
A TRG
Z
C TRG
C
B TRG
X
R TRG
Q
X TRG
A
Y TRG
S
Z TRG
D
L TRG
E
background image
SEGA Confidential

102
SATURN 6P Multitap (Provisional Name)
The SATURN 6P tap is a 3-line handshake method peripheral. The peripherals that
can be connected to this tap are the Mega Drive 3-button PAD, Mega Drive 6-button
PAD, SEGA mouse, SATURN standard PAD, SATURN analog joystick, and SAT-
URN keyboard. The maximum data size for each tap of the SATURN 6P multitap is
15 bytes. If peripherals of 16 bytes or more are connected, only the data up to 15
bytes will be collected. Data is output from the SATURN 6P multitap in the SMPC
control mode as explained previously. The SATURN peripheral ID is added as a
header to the data of all supported peripherals.
Data collection is started by changing TH to 0
B
and ended by changing TH and TR
to 1
B
. The first data is the Mega Drive ID acquisition phase. Data is acquired by
changing TH from 1
B
to 0
B
. After TH is changed, read R, L, D, and U after 2
µ
s.
Acquire later data using a handshake with TR and TL. Table 3.39 shows the SAT-
URN 6P multitap data format in the SH-2 direct mode.
background image
SEGA Confidential


103
SMPC User's Manual
Table 3.39 SATURN 6P Multitap Data Format for SH-2 Direct Mode
Output
Input
TH
TR
TL
R
L
D
U
1st Data
1
1
1
0
0
0
1
2nd Data
0
1
1
0
0
0
1
0
0
1
x
x
x
x
3rd Data
0
0
0
\ \ \ \ 0 \ \ \ \ \ \ \ \ 0 \ \ \ \ \ \ \ \ 0 \ \ \ \ \ \ \ \ 0 \ \ \ \
0
1
0
x
x
x
x
4th Data
0
1
1
/ / / / 0 / / / / / / / / 0 / / / / / / / / 0 / / / / / / / / 1 / / / /
0
0
1
/ / / / x / / / / / / / / x / / / / / / / / x / / / / / / / / x / / / /
5th Data
0
0
0
/ / / / 0 / / / / / / / / 1 / / / / / / / / 1 / / / / / / / / 0 / / / /
0
1
0
/ / / / x / / / / / / / / x / / / / / / / / x / / / / / / / / x / / / /
6th Data
0
1
1
0
0
0
0
0
0
1
x
x
x
x
7th Data
0
0
0
CH1-M6ID3
CH1-M6ID2
CH1-M6ID1
CH1-M6ID0
0
1
0
x
x
x
x
8th Data
0
1
1
CH1-DSIZE3
CH1-DSIZE2
CH1-DSIZE1
CH1-DSIZE0
0
0
1
x
x
x
x
?th Data
0
0
0
CH1-DATA
CH1-DATA
CH1-DATA
CH1-DATA
0
:
:
:
:
:
:
?th Data
0
:
:
CH2-M6ID3
CH2-M6ID2
CH1-M6ID1
CH1-M6ID0
0
:
:
x
x
x
x
?th Data
0
:
:
CH2-DSIZE3
CH2-DSIZE2
CH2-DSIZE1
CH2-DSIZE0
0
:
:
x
x
x
x
?th Data
0
:
:
CH2-DATA
CH2-DATA
CH2-DATA
CH2-DATA
0
:
:
:
:
:
:
?th Data
0
:
:
CH3-M6ID3
CH3-M6ID2
CH3-M6ID1
CH3-M6ID0
0
:
:
x
x
x
x
?th Data
0
:
:
CH3-DSIZE3
CH3-DSIZE2
CH3-DSIZE1
CH3-DSIZE0
0
:
:
x
x
x
x
?th Data
0
:
:
CH3-DATA
CH3-DATA
CH3-DATA
CH3-DATA
0
:
:
:
:
:
:
?th Data
0
:
:
CH4-M6ID3
CH4-M6ID2
CH4-M6ID1
CH4-M6ID0
0
:
:
x
x
x
x
?th Data
0
:
:
CH4-DSIZE3
CH4-DSIZE2
CH4-DSIZE1
CH4-DSIZE0
0
:
:
x
x
x
x
?th Data
0
:
:
CH4-DATA
CH4-DATA
CH4-DATA
CH4-DATA
0
:
:
:
:
:
:
?th Data
0
:
:
CH5-M6ID3
CH5-M6ID2
CH5-M6ID1
CH5-M6ID0
0
:
:
x
x
x
x
?th Data
0
:
:
CH5-DSIZE3
CH5-DSIZE2
CH5-DSIZE1
CH5-DSIZE0
0
:
:
x
x
x
x
?th Data
0
:
:
CH5-DATA
CH5-DATA
CH5-DATA
CH5-DATA
0
:
:
:
:
:
:
?th Data
0
:
:
CH6-M6ID3
CH6-M6ID2
CH6-M6ID1
CH6-M6ID0
0
:
:
x
x
x
x
?th Data
0
:
:
CH6-DSIZE3
CH6-DSIZE2
CH6-DSIZE1
CH6-DSIZE0
0
:
:
x
x
x
x
?th Data
0
:
:
CH6-DATA
CH6-DATA
CH6-DATA
CH6-DATA
0
:
:
:
:
:
:
nth Data
0
0
0
0
0
0
0
0
1
0
x
x
x
x
n+1th Data
0
1
1
0
0
0
1
end
1
1
1
0
0
0
1
Mega Drive Peripheral ID Acquisition Sequence
\\\\
SATURN Peripheral ID Acquisition Sequence
/////
Port Status
background image
SEGA Confidential

104
Index
Alphabetical Listing
3-Line Handshake Method .................................................................................................. 87
All Peripheral Data Acquisition Sequence ........................................................................ 51
Bit Name ................................................................................................................................ 86
Break Request ........................................................................................................................ 50
Break Request Precautions .................................................................................................. 50
Calendar Time ......................................................................................................................... 2
Cold Reset .............................................................................................................................. 13
Command Issuance .............................................................................................................. 13
Command Issuance Classification ..................................................................................... 13
Command Issuance Limitations ......................................................................................... 19
Command Issuance Method ............................................................................................... 13
Command Issuance Timing ................................................................................................ 17
Command Register ............................................................................................................... 13
COMREG ............................................................................................................................. 5, 6
Continue Request.................................................................................................................. 50
Continue Request Precautions ............................................................................................ 50
Data Configuration when One Port is in 0 Byte Mode ................................................... 63
Data Size........................................................................................................................... 62, 65
DDR Functions ........................................................................................................................ 7
DDR1 ........................................................................................................................................ 7
DDR2 ........................................................................................................................................ 7
DSP.......................................................................................................................................... (i)
EXLE1 ....................................................................................................................................... 8
Existence of Remaining Peripheral Data ........................................................................... 66
EXLE Functions ....................................................................................................................... 9
EXLE2 ....................................................................................................................................... 9
Extension Data Size .............................................................................................................. 76
Functions .................................................................................................................................. 3
H-BLANK-IN .......................................................................................................................(ii)
Horizontal Resolution ........................................................................................................ 2, 3
INTBACK Command End Conditions .............................................................................. 50
INTBACK Command Usage Method .......................................................................... 42, 53
Introduction ............................................................................................................................. 1
IOSEL Functions ..................................................................................................................... 8
IOSEL1 ...................................................................................................................................... 8
IOSEL2 ...................................................................................................................................... 8
IREG0 (Peripheral Control) ................................................................................................. 58
IREG0~IREG6 ...................................................................................................................... 5, 6
background image
SEGA Confidential


105
SMPC User's Manual
IREG1 (Peripheral Control) ................................................................................................. 59
IREG2 (Peripheral Control) ................................................................................................. 60
Main CPU.............................................................................................................................. (ii)
MC68EC000 .......................................................................................................................... (ii)
MDID ................................................................................................................................ 68, 88
Mega Drive 3-Button PAD ............................................................................................. 81, 90
Mega Drive 6-Button PAD ............................................................................................. 81, 90
Multitap .................................................................................................................................. 68
Multitap ID ............................................................................................................................ 68
Non-Resetable System Management Commands............................................................ 35
Number of Connectors......................................................................................................... 13
Optimization During Peripheral Data Collection ............................................................ 55
Optimization Operations During Peripheral Data Collection, Overview of ............... 55
OREG0~OREG31 ................................................................................................................ 5, 6
PAD ........................................................................................................................................... 4
Parallel I/O Register .............................................................................................................. 7
Parallel I/O Register Address Map ..................................................................................... 7
PC ............................................................................................................................................. 3
PDR1 ......................................................................................................................................... 7
PDR2 ......................................................................................................................................... 8
Peripheral Control Mode ..................................................................................................... 48
Peripheral Control Status .............................................................................................. 62, 66
Peripheral Data Acquisition Cancel Sequence Resulting from Break Request ............ 52
Peripheral Data Acquisition Method for SMPC Control Mode ..................................... 49
Peripheral Data Acquisition Sequence .............................................................................. 53
Peripheral Data Collection .................................................................................................. 62
Peripheral ID ................................................................................................................... 62, 69
Peripheral Type ............................................................................................................... 62, 70
Peripherals ............................................................................................................................ (ii)
PLL .......................................................................................................................................... (i)
Port 1 Data ................................................................................................................. 62, 63, 64
Port 2 Data ................................................................................................................. 62, 63, 64
Port Mode .................................................................................................................. 37, 59, 66
Port Status ........................................................................................................................ 62, 67
Power On, Initial Status During ........................................................................................... 3
Reset Button ............................................................................................................................. 2
Reset Button Status ............................................................................................................... 39
Resetable System Management Commands ..................................................................... 21
RTC Command ....................................................................................................................... 3
background image
SEGA Confidential

SATURN 6P Multitap ................................................................................................... 85, 102
SATURN Analog Device Data Format .............................................................................. 77
SATURN Analog Joystick .............................................................................................. 83, 97
SATURN Digital Device Data Format ............................................................................... 76
SATURN Digital Standard PAD ................................................................................... 82, 97
SATURN Keyboard ........................................................................................................ 83, 99
SATURN Keyboard Device Data Format .......................................................................... 78
SATURN Mouse .............................................................................................................. 81, 91
SATURN Peripheral ID .................................................................................................. 62, 69
SATURN Peripheral Standard Format .............................................................................. 76
SATURN Peripheral Types ............................................................................................ 62, 70
SATURN Pointing Device Data Format ............................................................................ 77
SATURN Standard PAD ................................................................................................ 82, 97
SCSP .................................................................................................................................... (i), 3
SCU .................................................................................................................................... (ii), 3
SEGA Tap ................................................................................................................... 38, 83, 94
SF ......................................................................................................................................... 5, 6
SH-2 Direct Mode ..................................................................................................... 48, 74, 86
SH-2 Direct Mode Block Diagram ...................................................................................... 74
SH-2 Direct Mode Setting Flow .......................................................................................... 75
SH-2 Direct Mode Standards .............................................................................................. 75
SH-2 Direct Mode, Access Control During (Mega Drive 3-Button PAD) ..................... 90
SH-2 Direct Mode, Access Control During (Mega Drive 6-Button PAD) ..................... 90
SH-2 Direct Mode, Access Control During (SATURN 6P Multitap) ........................... 102
SH-2 Direct Mode, Access Control During (SATURN Analog Joystick) ...................... 97
SH-2 Direct Mode, Access Control During (SATURN Keyboard)................................. 99
SH-2 Direct Mode, Access Control During (SATURN Mouse) ...................................... 91
SH-2 Direct Mode, Access Control During (SATURN Standard PAD) ......................... 97
SH-2 Direct Mode, Access Control During (SEGA Adapter) ......................................... 94
SH-2 Direct Mode, Setting to .............................................................................................. 74
SH-2 Interface .......................................................................................................................... 5
SH-2 Interface Register .......................................................................................................... 5
SH-2 Interface Register Address Map.................................................................................. 5
Slave SH-2 ................................................................................................................................ 3
SMPC ...................................................................................................................................... (i)
SMPC ........................................................................................................................................ 3
SMPC Command .................................................................................................................. 12
SMPC Command List........................................................................................................... 12
SMPC Control Mode ............................................................................................................ 48
SMPC Control Mode Block Diagram ................................................................................. 48
SMPC Control Mode Characteristics ................................................................................. 48
SMPC Control Mode Standards ......................................................................................... 49
SMPC Control Mode, Setting to ......................................................................................... 49
106
background image
SEGA Confidential


SMPC Control, Format During (Mega Drive 3-Button PAD) ......................................... 81
SMPC Control, Format During (Mega Drive 6-Button PAD) ......................................... 81
SMPC Control, Format During (SATURN 6P Adapter) .................................................. 85
SMPC Control, Format During (SATURN Analog Joystick) .......................................... 83
SMPC Control, Format During (SATURN Keyboard) .................................................... 83
SMPC Control, Format During (SATURN Mouse) .......................................................... 81
SMPC Control, Format During (SATURN Standard PAD) ............................................ 82
SMPC Control, Format During (SEGA Tap) .....................................................................82
SMPC Functions ...................................................................................................................... 3
SMPC Interrupt .....................................................................................................................13
SMPC System Configuration ................................................................................................ 2
SMPC UNKNOWN Peripheral Data Format .............................................................67, 68
Sound CPU .............................................................................................................................. 3
SR (Peripheral Control) ........................................................................................................ 66
SR .........................................................................................................................................5, 6
Standard Format ...................................................................................................................76
System Configuration ............................................................................................................ 2
TH and TR Control Method ................................................................................................ 87
TH Control Method .............................................................................................................. 87
Type A Command Flow .......................................................................................................14
Type B Command Flow .......................................................................................................14
Type C Command Flow .......................................................................................................15
Type D Command Flow .......................................................................................................16
V-BLANK-IN ........................................................................................................................ (ii)
V-BLANK-IN Skip Function .............................................................................................. (ii)
V-BLANK-OUT .................................................................................................................... (ii)
VDP1 ................................................................................................................................... (i), 3
VDP2 ................................................................................................................................... (i), 3
107
SMPC User's Manual
background image
SEGA Confidential

Command Abbreviations
CDOFF .................................................................................................................................... 28
CDON ..................................................................................................................................... 27
CKCHG320 ............................................................................................................................ 31
CKCHG352 ............................................................................................................................ 30
INTBACK ............................................................................................................................... 36
MSHON ................................................................................................................................. 22
NMIREQ ................................................................................................................................ 32
RESDISA ................................................................................................................................ 34
RESENAB............................................................................................................................... 33
SETSMEM .............................................................................................................................. 44
SETTIME ................................................................................................................................ 46
SNDOFF ................................................................................................................................. 26
SNDON .................................................................................................................................. 25
SSHOFF .................................................................................................................................. 24
SSHON ................................................................................................................................... 23
SYSRES ................................................................................................................................... 29
Command Names
CD OFF................................................................................................................................... 28
CD ON .................................................................................................................................... 27
Clock Change 320 Mode ...................................................................................................... 31
Clock Change 352 Mode ...................................................................................................... 30
Interrupt Back ........................................................................................................................ 36
Master SH-2 ON .................................................................................................................... 22
NMI Request.......................................................................................................................... 32
Entire System Reset .............................................................................................................. 29
Reset Disable ......................................................................................................................... 34
Reset Enable........................................................................................................................... 33
Slave SH-2 OFF ..................................................................................................................... 24
Slave SH-2 ON ...................................................................................................................... 23
SMPC Memory Setting ........................................................................................................ 44
Sound OFF ............................................................................................................................. 26
Sound ON .............................................................................................................................. 25
Time Setting ........................................................................................................................... 46
108