Japanese
HARDWARE ManualSMPC User's Manual
BackForward
SMPC User's Manual/Chapter 2 SMPC Commands

■2.4 Non-reset system management commands

Details of non-reset system management commands are shown in table format. The table of each command and notes are as follows. In addition, by using status flags in all commands, you can manage double issuing of commands.

●SMPC interrupt
Items marked as "occurrence" generate an SMPC interrupt to the SH-2 via the SCU at the end of the command. Additionally, interrupts can be enabled/disabled by setting the SCU.

●IREG, OREG

By using it together with status flag (SF),

can be judged.

●Execution time
The execution time is calculated from the number of steps in the SMPC internal firmware. If there is a conflict with an internal task such as RTC increment, the command execution time will change, so it is described in the range of minimum and maximum values.


List | ▲ Back | Next

No.1

INTBACK

interrupt back

(SMPC status acquisition)

Command code 10H
SMPC interrupt generation
IREG 0~2
OREG 0~31
Execution time max=320msec
        min=xxx

Functional details
Get each status and peripheral data of SMPC. This section explains how to obtain SMPC status. For information on obtaining peripheral data, see Chapter 3 .

command parameters
The command parameters of the INTBACK command when acquiring peripheral data are shown below.

●IREG0
IREG0 bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0
20100001H SMPC status acquisition switch ( 00H or 01H )
Initial value undefined/Write Only

IREG0: SMPC status acquisition switch setting value
IREG0 setting value explanation
00H date and time, cartridge code, area code, terminal status, SMEM,
Do not return reset button data
01H date and time, cartridge code, area code, terminal status, SMEM,
Return each data of reset button

When using the INTBACK command, be sure to set one of the above settings.
IREG0 is also used to control peripherals. See Chapter 3 for usage instructions.

●IREG1
IREG1 bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0
20100003H P2MD1 P2MD0 P1MD1 P1MD0 PEN 0 OPE 0
Indeterminate
W
Indeterminate
W
Indeterminate
W
Indeterminate
W
Indeterminate
W
Indeterminate
-
Indeterminate
W
Indeterminate
-

Bits 7,6: Port 2 mode
bit 7 Bit 6 explanation
P2MD1 P2MD0
0 0 15 byte mode
0 1 255 byte mode
1 0 SEGA RESERVED ( setting prohibited )
1 1 0 byte mode

Bits 5,4: Port 1 mode
bit 5 bit 4 explanation
P1MD1 P1MD0
0 0 15 byte mode
0 1 255 byte mode
1 0 SEGA RESERVED ( setting prohibited )
1 1 0 byte mode

Bit 3: Peripheral data enable
bit 3 explanation
PEN
0 do not return peripheral data
1 return peripheral data

Bit 1: Optimization of peripheral data acquisition time
Bit 1 explanation
OPE
0 Optimize
1 no optimization

●IREG2
Initial value: undefined
IREG2 bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0
20100005H F0H
Write Only

When issuing the INTBACK command, be sure to set F0H to IREG2.

Result parameters
The result parameters limited to SMPC status acquisition are shown below.

●SR
S.R. bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0
20100061H 0 1 PDE RESB

bit 5 explanation
PDE
0 No peripheral data remaining
1 There is remaining peripheral data

bit 4 explanation
PRESB
0 Reset button OFF
1 Reset button ON

●OREG0
OREG0 bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0
20100021H STE RESD

bit 7 explanation
STE
0 SMPC not SETTIME after cold reset Note 1
1 Note 1 being SETTIME after SMPC cold reset

Bit 6 explanation
RESD
0 reset enable
1 Reset disabled (default)

Note 1
SMPC cold reset occurs under the following conditions
  1. When you press the reset switch inside the battery box on the back of Sega Saturn
  2. When the main power is turned on (ON) when the battery is not installed or when the battery is exhausted
  3. When the battery is inserted while the power is OFF

●OREG1,OREG2,OREG3
bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0
OREG1 20100023H Year 1000 (BCD) Year 100 (BCD)
OREG2 20100025H Year number 10 (BCD) First place in the Western calendar (BCD)
OREG3 20100027H Day of the week (hexadecimal) Note 2 Month (hexadecimal) Note 3

Note 2
day of week Sunday Monday Tuesday Wednesday Thursday Friday Saturday
value 0H 1H 2H 3H 4H 5H 6H

Note 3
Month January February March April May June July August September October November December
value 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH

●OREG4,OREG5,OREG6,OREG7,OREG8
bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0
OREG4 20100029H 10th place per day (BCD) No. 1 per day (BCD)
OREG5 2010002BH 10th position (BCD) 1st place (BCD)
OREG6 2010002DH Tenth place (BCD) Minute 1st place (BCD)
OREG7 2010002FH Ten seconds (BCD) Second place (BCD)
OREG8 20100031H 0 0 0 0 0 0 CTG1 CTG0
CTG0: Cartridge code 0
CTG1: Cartridge code 1

●OREG9
OREG9 bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0
20100033H Area code (00H~0FH)

code region Main country names etc.
0H Do not use
1H Japan region Japan
2H Asia NTSC region Taiwan, Korea, Philippines
3H SEGA RESERVED
4H North America region United States, Canada, Latin America NTSC region (Brazil only)
5H SEGA RESERVED
6H SEGA RESERVED
7H SEGA RESERVED
8H SEGA RESERVED
9H SEGA RESERVED
AH SEGA RESERVED
BH SEGA RESERVED
CH Europe PAL region Europe, Australia, South Africa, Latin America PAL region
DH SEGA RESERVED
EH SEGA RESERVED
FH Do not use

●OREG10
OREG10 bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0
20100035H 0 DOTSEL 1 1 MSHNMI 1 SYSRES SNDRES

・System status 1 (Status of each control signal output from SMPC 0: OFF 1: ON )
- The DOTSEL signal indicates the current screen mode (horizontal resolution). ( 0:320 1:352 )

●OREG11
OREG11 bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0
20100037H CDRES

・System status 2 (Status of each control signal output from SMPC 0: OFF 1: ON )
・" - " means RESERVED.

●OREG12,OREG13,OREG14,OREG15
bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0
OREG12 20100039H SMEM1 retained data
OREG13 2010003BH SMEM2 retained data
OREG14 2010003DH SMEM3 retained data
OREG15 2010003FH SMEM4 retained data

●OREG31
OREG31 bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0
2010005FH 0 0 0 1 0 0 0 0

Note: The command code (OREG31) may be overwritten by peripheral data.

remarks

■How to use the INTBACK command
This section describes how to use the INTBACK command to obtain SMPC status.
There are three ways to use the INTBACK command:

  1. Get SMPC status only
  2. Following SMPC status acquisition, acquire peripheral data
  3. Get only peripheral data

In this chapter, we will mainly explain how to obtain SMPC status. Here, we will explain steps 1. and 2. to obtain the status, and 3. will be explained in Chapter 3.

1. How to get only SMPC status
To obtain only the status, set the command parameters as below and issue the INTBACK command.

IREG0 setting value=01H
・Returns date and time, cartridge code, area code, terminal status, SMEM, and reset button mode data

IREG1 setting value=00H
・Terminal 2 mode (P2MD1, P2MD0) = 00B → 15 byte mode
・Terminal 1 mode (P1MD1, P1MD0) = 00B → 15 byte mode
・Peripheral data enable (PEN) = 0B → Do not return peripheral data
・Optimize peripheral acquisition time (OPE) = 0B → Optimize

IREG2 setting value=F0H
・Please set F0H unconditionally.

With the above settings, SF will be cleared, the INTBACK command will end, and the result parameters will be obtained. It also requests an SMPC interrupt when the command ends. Execution time is from minimum TBD to maximum TBD.

2. How to get peripheral data after getting SMPC status
Following SMPC status acquisition, when acquiring peripheral data, set the command parameters as shown below and issue the INTBACK command. The setting value of IREG1 can be set to the desired value on the application side.

IREG0 setting value=01H
・Returns date and time, cartridge code, area code, terminal status, SMEM, and reset button mode data

IREG1 setting value=08H
・Terminal 2 mode (P2MD1, P2MD0) = 00B → 15 byte mode
・Terminal 1 mode (P1MD1, P1MD0) = 00B → 15 byte mode
・Peripheral data enable (PEN) = 1B → Return peripheral data
・Optimize peripheral acquisition time (OPE) = 0B → Optimize

IREG2 setting value=F0H
・Please set F0H unconditionally.

With the above settings, SMPC requests an SMPC interrupt when the command is executed and the result parameters are set.
SF is "1" at the time the SMPC interrupt is requested. The time from command issuance to completion of result parameter setting is from minimum TBD to maximum TBD.
After obtaining the result parameters related to the status, by inverting bit 7 of IREG0, SMPC considers it to be a continuation and continues to obtain peripheral data.

This method is useful for applications that retrieve various status and peripheral data every frame.


List | ▲ Back | Next

No.2

SETSMEM

SMPC memory settings

Command code 17H
SMPC interrupt generation disabled
IREG 0 to 3
OREG 31
Execution time max=xxx
        min=40μsec

Functional details
SMPC provides 4 bytes of battery-backed memory (SMEM). This command sets data to SMEM.

command parameters
bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0
OREG0 20100001H Data settings to SMEM1
OREG1 20100003H Data settings to SMEM2
OREG2 20100005H Data settings to SMEM3
OREG3 20100007H Data settings to SMEM4

Result parameters
OREG31 bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0
2010005FH 0 0 0 1 0 1 1 1

remarks
●The contents of SMEM are cleared to 0 at SMPC cold reset.

SMPC cold reset occurs under the following conditions
  1. When you press the reset switch inside the battery box on the back of Sega Saturn
  2. When the main power is turned on (ON) when the battery is not installed or when the battery is exhausted
  3. When the battery is inserted while the power is OFF

●The SETEMEM command sets 4 bytes at the same time. To update the contents, use the INTBACK command to read the currently held data and write it to the demo file.

●If the power is turned OFF while the SETEMEM command is being issued,

  1. If the internal processing of the SETSMEM command can be executed before the power OFF sequence, all data will be updated.
  2. If the power OFF sequence is executed first, the data before the command is issued will be retained.


BackForward
HARDWARE ManualSMPC User's Manual
Copyright SEGA ENTERPRISES, LTD., 1997