Download SMPC User`s Manual
Transcript
When using this document, keep the following in mind: nti al General Notice 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. de 2. This document may include technical inaccuracies or typographical errors. Changes are periodically 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. nfi 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. Co 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 characteristics 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. GA 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 product/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. SE NOTE: A reader's comment/correction form is provided with this document. Please address comments to : (6/27/95- 002) 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. SE GA Co nfi de nti al TM SMPC User's Manual Doc. # ST-169-R1-072694 © 1994 SEGA. All Rights Reserved. nti al READER CORRECTION/COMMENT SHEET 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. General Information: Phone Document number Document name de Your Name Date ST-169-R1-072694 SMPC User's Manual Corrections: Correction nfi pg. # GA Co Chpt. SE Questions/comments: Fax: Where to send your corrections: (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 Explanation of Terminology The terminology used in this manual is explained below. SMPC (System Manager & Peripheral Control) nti al Introduction 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. de SCSP (Saturn Custom Sound Processor) Sound source LSI for multi-function games that integrate PCM sound source and sound DSP. DSP (Digital Signal Processor) VDP1 (Video Display Processor 1) nfi High-speed calculation circuit used primarily for calculations (multiplication and addition). 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 transferred to the VDP2 and displayed on a display device at the request from the VDP2. Co VDP2 (Video Display Processor 2) Contains scroll screen control functions and priority functions. PLL (Phase Locked Loop) SE GA All of the clock types (CPU, system control, image draw/display, sound, etc., clock generator) of the SATURN system. i SCU (System Control Unit) nti al 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 de One of the three types of blanking interrupts. V-BLANK-IN shows the screen display end timing. V-BLANK-OUT nfi 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 SE GA Co Peripheral equipment connected to SATURN, such as control PAD, mouse, and keyboard. ii Binary nti al Symbols Used in this Manual The following symbols are used in this manual. Shown by a “B” placed at the end. For example, 100B. When only 1 bit is used, however, the “B” is abbreviated. Hexadecimal Shown by an “H” at the end. For example, 00H or FF H. Units de 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 (R) Signifies a read dedicated register. (W) (R/W) Co Signifies a write dedicated register. nfi Undefined bits in the sound source register or DSP register are shown by “—.” Signifies a register in which both reading and writing are possible. BCD SE GA Binary Coded Decimal. iii Table of Contents nti al Introduction ............................................................................................................................... (i) Explanation of Terminology ................................................................................................ (i) Symbols Used in this Manual ............................................................................................ (iii) Table of Contents .................................................................................................................... (iv) List of Figures .................................................................................................................... (v) List of Tables .................................................................................................................... (vi) de Section 1 Overview ................................................................................................................... 1 1.1 System Configuration ................................................................................................... 2 1.2 SH-2 Interface .............................................................................................................. 5 nfi 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 Co 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 SE GA Index ........................................................................................................................................ 104 iv nti al List of Figures Section 1 Overview Figure 1.1 SMPC System Configuration ........................................................................ Figure 1.2 Standard Digital PAD for SATURN ................................................................ Figure 1.3 SH-2 Interface Register Address Map........................................................... Figure 1.4 Parallel I/O Register Address Map ................................................................ 2 4 5 7 de 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 SE GA Co nfi 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 List of Tables nti al Section 1 Overview Table 1.1 Initialization Status During Power On ............................................................. Table 1.2 SMPC Functions ............................................................................................. Table 1.3 DDR Functions ............................................................................................... Table 1.4 IOSEL Functions ............................................................................................ Table 1.5 EXLE Functions .............................................................................................. 3 3 7 8 9 de 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 SE GA Co nfi 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 Data Format During SATURN Mouse Data Request for SH-2 Direct Mode ....... 93 Data Format During SEGA Tap Power On Reset for SH-2 Direct Mode ............ 94 Data Format During SEGA Tap Data Request for SH-2 Direct Mode ................ 95 Connected Peripherals and ID ........................................................................... 95 Mega Drive 3-Button PAD Data Format During Connection to SEGA Tap ......... 96 Mega Drive 6-Button PAD Data Format During Connection to SEGA Tap ......... 96 SEGA Mouse Data Format During Connection to SEGA Tap ............................ 96 SATURN Standard PAD Data Format for SH-2 Direct Mode ............................. 97 SATURN Analog Joystick Data Format for SH-2 Direct Mode ........................... 98 SATURN Keyboard Data Format for SH-2 Direct Mode ................................... 100 SATURN 6P Multitap Data Format for SH-2 Direct Mode ................................ 103 nti al 3.29 3.30 3.31 3.32 3.33 3.34 3.35 3.36 3.37 3.38 3.39 SE GA Co nfi de Table Table Table Table Table Table Table Table Table Table Table vii nti al SE GA Co nfi de Section 1 Overview SMPC User's Manual 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 1 System Configuration nti al 1.1 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 horizontal resolution to and from 320 dots and 352 dots. SMPC Data Bus de Control Address Bus Bus CDRES SH I/F Address Buffer IOSEL To CD Block MSHRES MSHNMI MSH-2 Data Buffer nfi SSHRES RES SSHNMI SNDRES NMI SYSRES RES Co 4-bit CPU Core I/O Peripheral SSH-2 VDP1 NMI DOTSEL I/O Peripheral RES VDP2 GA RES SCSP SE SCU 2 RES MC68EC000 RES Figure 1.1 SMPC System Configuration PLL nti al 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 selected: 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 Description A reset enters the sound CPU. Output by a power on vector by the SNDON command. VDP1, VDP2, SCU, SCSP A status where access from the SH-2 is possible. ON Status 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. nfi de Status Sound CPU OFF Status Co 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 RTC (Real Time Clock) GA SM (System Management) SE PC (Peripheral Control) SMPC User's Manual • Time setting and acquisition from SH-2. • Automatic update of date, day, time (Battery backup is possible when main power off) • 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. • 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, 6button, SEGA tap) (a conversion adapter is required, however) 3 Co nfi de nti al PAD The SATURN digital standard PAD has up, down, left, right, A, B, C, X, Y, Z, L, R, and Start buttons. SE GA Figure 1.2 Standard Digital PAD for SATURN 4 1.2 SH-2 Interface b it7 b it0 W COMREG b it7 R : Read Only W : Write Only R/W: Read/Write b it0 20100061H R SR b it0 de 2010001FH nti al SH-2 Interface Registers The SH-2 interface registers are registers that are used to receive commands, command parameters, and status display from the SH-2 and to output result parameters. Figure 1.3 shows the SH-2 interface register address map. SF R/W 20100063H b it0 20100001H IREG0 20100003H IREG1 20100005H IREG2 20100007H IREG3 20100009H IREG4 2010000BH IREG5 2010000DH IREG6 W b it0 Co b it7 nfi b it7 20100021H b it7 b it0 OREG0 20100041H OREG16 OREG1 20100043H OREG17 OREG2 20100045H OREG18 OREG3 20100047H OREG19 OREG4 20100049H OREG20 OREG5 2010004BH OREG21 2010002DH OREG6 2010004DH OREG22 2010002FH OREG7 2010004FH OREG23 20100023H 20100025H 20100027H 20100029H GA 2010002BH R OREG8 20100051H OREG24 20100033H OREG9 20100053H OREG25 20100035H OREG10 20100055H OREG26 20100037H OREG11 20100057H OREG27 20100039H OREG12 20100059H OREG28 2010003BH OREG13 2010005BH OREG29 OREG14 2010005DH OREG30 OREG15 2010005FH OREG31 SE 20100031H 2010003DH 2010003FH R Only byte access is possible for all registers. SMPC User's Manual Figure 1.3 SH-2 Interface Register Address Map 5 The details on SH-2 interface registers are as follows: nti al 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 de 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 IREG0~IREG6 (W): Input REGister 0~6 nfi This flag controls command issue. Flag set is performed by the SH-2 before command 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 01H. During read, all bits except bit0 are undefined. Using this flag makes it possible to control the dual issue of commands. Co 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 SE GA 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. 6 b it6 20100075H 20100079H b it0 nti al 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. b it6 b it0 PDR1 R/W 20100077H PDR2 R/W DDR1 W 2010007BH DDR2 W b it1 b it0 IOSEL2 IOSEL1 W 2010007FH EXLE2 W : Write Only R/W: Read/Write de 2010007DH EXLE1 W Only byte access is allowed to all the registers. nfi 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. Co 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 Function Input Setting (Initial Value) Output Setting GA Bit 0 1 PDR1 (R or W): Port Data Register 1 SE 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 reading 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. SMPC User's Manual 7 PDR2 (R or W): Port Data Register 2 nti al 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 reading 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 de 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. nfi Table 1.4 IOSEL Functions Bit Function 0 Sets to SMPC control mode (Initial Value) 1 Sets to SH-2 direct mode For details regarding each mode, refer to Section 3. Co EXLE1 (W): EXternal Latch Enable 1 SE GA 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 peripheral port 1 bit 6 to be used for PAD interrupt input or VDP2 external latch input. Use byte access from the SH-2. 8 EXLE2 (W): EXternal Latch Enable 2 Table 1.5 EXLE Functions Bit 0 1 nti al 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 peripheral port 1 bit 6 to be used for PAD interrupt input or VDP2 external latch input. Use byte access from the SH-2. Function Disable (Initial Value) Enable SE GA Co nfi de 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.) SMPC User's Manual 9 SE GA Co nfi de nti al (This page is blank in the original Japanese document.) 10 nti al SE GA Co nfi de Chapter 2 SMPC Commands SMPC User's Manual 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 11 SMPC Command List nti al 2.1 SMPC commands are divided into three types; resetable system management commands, non-resetable system management commands, and RTC commands. Each of these commands is shown below. Table 2.1 Resetable System Management Commands No Command Name Command Command Code Abbreviation SMPC Interrupt SR IREG OREG Execution Time sec min 00 H Unused 2 Slave SH-2 ON SSHON 02 H Unused 3 Slave SH-2 OFF SSHOFF 03 H Unused 4 Sound ON SNDON 06 H Unused 5 Sound OFF SNDOFF 07 H Unused 6 CD ON CDON 08 H Unused 7 CD OFF CDOFF 09 H 8 Reset Entire System SYSRES 0D H 9 Clock Change 352 Mode CKCHG352 0E H 10 Clock Change 320 Mode CKCHG320 0F H 11 NMI Request NMIREQ 18 H 12 Reset Enable RESENAB 13 Reset Disable RESDISA Unused Unused 30µ 31 de MSHON Unused Unused 31 30µ Unused Unused 31 30µ Unused Unused 31 30µ Unused Unused 31 30µ Unused Unused 31 40µ 40µ nfi 1 Master SH-2 ON max Unused Unused 31 Unused Unused Unused 31 100m+ α Unused Unused Unused 31 100m+ α Unused Unused Unused 31 100m+ α Unused Unused Unused 31 30µ 19 H Unused Unused Unused 31 30µ 1A H Unused Unused Unused 31 30µ Co Unused Table 2.2 Non-Resetable System Management Commands Command Name Command Abbreviation Command SMPC Code Interrupt GA No SR IREG OREG Used 0~2 0~31 0~3 31 Execution Time sec min 1 Interrupt Back INTBACK 10H 2 SMPC Memory Setting SETSMEM 17H Used Unused Unused max 320m 40 µ Table 2.3 RTC Commands SE No Command Name 1 12 Time Setting Command Command Code Abbreviation SMPC Interrupt SR SETTIME Unused Unused 16H IREG 0~6 OREG 31 Execution Time sec min 70 µ max 2.2 Command Issue nti al 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. (2) Type B (3) Type C (4) Type D This command resets the master SH-2 after command issue or changes to exception processing, such as NMI. This command does not require the command parameter to be reset and the result parameter is not returned (except for OREG31, however). This command requires the command parameter to be reset and the result parameter is not returned (except for OREG31, however). 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. nfi Type A Co (1) de 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. SE GA 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 SMPC User's Manual 13 Waits for SF to be Reset Sets SF de Reads Command Code in COMREG nti al START nfi Endless Loop Co Figure 2.1 Type A Command Flow START GA Waits for SF to be Reset Sets SF SE Reads Command Code in COMREG 14 END Figure 2.2 Type B Command Flow Waiting for exception handling. Waits for SF to be Reset Resets SF de Sets the Command Parameter in IREG nti al START nfi Writes Command Code in COMREG END SE GA Co Figure 2.3 Type C Command Flow SMPC User's Manual 15 nti al START Waits for SF to be Reset Sets the Command Parameter in IREG nfi Writes Command Code in COMREG de Set SF END Co SMPC Interrupt Processing START Clear Interrupt Flag Look at SR and Receive OREG Result Parameter GA Depending on Peripheral Status, Issue Continue or Break to SMPC (Refer to Chapter 3 for Details) Interrupt Processing END SE Figure 2.4 Type D Command Flow Note: 16 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. nti al 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 peripheral 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 • INTBACK Command de As mentioned above, issuing commands for 300 µs from V-BLANK-IN is prohibited. nfi 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-BLANKIN.. Figure 2.5 shows the INTBACK command execution timing. The INTBACK command is used in the following three ways. Co 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. GA Here, even though a continue request has been issued after SMPC status acquisition, it is still necessary to issue an INTBACK command and request continue to begin collecting peripheral data at V-BLANK-OUT. SE SMPC status acquisition ends approximately 300 µs after INTBACK command issue, and a SMPC interrupt request is sent to the SMPC. SMPC User's Manual 17 300 µ S V-BLANK nti al : INTBACK Command Issue Period V-BLANK-IN During V-BLANK Figure 2.5 INTBACK Command Issue Timing V-BLANK-OUT de • 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. nfi The SYSRES, CKCHG320, and CKCHG352 commands must be issued 300 µs after V-BLANK-IN and before the next V-BLANK-IN. Co : INTBACK Command Issue Period SYSRES, CKCHG320, CKCHG352 Commands Command End 100 msec or More V-BLANK INTBACK Command Issue Timing After SYSRES, CKCHG320, and CKCHG352 Command Execution. GA Figure 2.6 V-BLANK-IN • Issue Timing for Other Commands SE 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. 18 nti al Other Command Issue in Frame that Does Not Issue INTBACK Command 300 µs : Other Command Issue Period V-BLANK Other Command Issue in Frame that Issues INTBACK Command : Other Command Issue Period 300 µs de : INTBACK Command Issue Period V-BLANK nfi V-BLANK-IN Figure 2.7 Issue of Other Commands Co Command Issue Limitations Following is an explanation of limitations when issuing commands. SE GA • 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. SMPC User's Manual 19 Table 2.5 SH-2 Command Issue Limitations MSHON SSHON SSHOFF SNDON SNDOFF CDON CDOFF SYSRES CKCHG352 CKCHG320 NMIREQ RESENAB RESDISA INTBACK SETSMEM SETTIME Command Execution from Master SH-2 O O O O O O O O O O O O O O O O Command Execution from Slave SH-2 Co GA SE 20 O X X O O O O O X X O O O X O O nti al Master SH-2 ON Slave SH-2 ON Slave SH-2 OFF Sound ON Sound OFF CD ON CD OFF System Overall Reset Clock Change 352 Clock Change 320 NMI Request Reset Enable Reset Disable Interrupt Back SMPC Memory Setting Time Setting Command Abbreviation nfi 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 Command Name de No. 2.3 Resetable System Management Commands nti al 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 commands. de 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. Co nfi 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) SE GA 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. SMPC User's Manual 21 MSHON SMPC Interrupt Generation Not Possible Command Code Master SH-2 ON IREG Unused Turns on master SH-2. Command Parameter None nfi Result Parameter min 30 µsec bit7 0 0 GA Co OREG31 2010005F H SE Remarks 22 max XXX Execution Time 31 de Function Description OREG 00 H nti al NO. 1 0 0 0 bit0 0 0 0 SMPC Interrupt SSHON Generation Not Possible Command Code Slave SH-2 ON IREG Unused Turns on slave SH-2. Command Parameter None 31 Execution Time max XXX min 30 µsec nfi de Function Description OREG 02 H nti al NO. 2 Result Parameter bit7 0 0 0 0 0 0 1 0 GA Co OREG31 2010005F H bit0 SE Remarks SMPC User's Manual 23 SSHOFF SMPC Interrupt Generation Not Possible Command Code Slave SH-2 OFF IREG Unused Turns off slave SH-2. Command Parameter None Execution Time 31 nfi Result Parameter 0 0 Co GA SE 24 min 30 µsec bit7 OREG31 2010005F H Remarks max XXX de Function Description OREG 03 H nti al NO. 3 0 0 0 bit0 0 1 1 SMPC Interrupt SNDON Generation Not Possible Command Code Sound ON IREG Unused OREG 31 06 H nti al NO. 4 Turns on the sound CPU (MC68EC000). Command Parameter None min 30 µsec nfi de Function Description max XXX Execution Time Result Parameter bit7 0 0 0 0 0 1 1 0 GA Co OREG31 2010005F H bit0 SE Remarks SMPC User's Manual 25 SMPC Interrupt SNDOFF Generation Not Possible Command Code Sound OFF IREG Unused OREG Execution Time 31 Turns off the sound CPU (MC68EC000). Command Parameter None max XXX min 30 µsec Result Parameter nfi de Function Description 07 H nti al NO. 5 bit7 0 0 0 0 0 1 1 1 GA Co OREG31 2010005F H bit0 Even if the sound CPU is turned off using this command, the sound memory contents (4M DRAM) will be preserved. SE Remarks 26 SMPC Interrupt CDON Command Code CD ON Generation Not Possible IREG Turns on CD. Command Parameter None OREG 31 Execution Time max XXX min 40 µsec nfi de Function Description Unused 08 H nti al NO. 6 Result Parameter bit7 0 0 0 0 1 0 0 0 GA Co OREG31 2010005F H bit0 SE Remarks SMPC User's Manual 27 Generation Not Possible Command Parameter Unused OREG 09 H Execution Time 31 Turns off CD. None max XXX min 40 µsec de Function Description IREG Result Parameter nfi SMPC Interrupt Command Code CD OFF nti al CDOFF NO. 7 bit7 0 0 0 0 1 0 0 1 GA Co OREG31 2010005F H bit0 The execution of this command will cause the CD buffer (DRAM) value not to be retained. SE Remarks 28 SYSRES SMPC Interrupt Generation Not Possible IREG Unused OREG 31 Resets the entire SATURN system. None 0D H 100 msec + α de Command Parameter Execution Time nfi Function Description Command Code Entire System Reset nti al NO. 8 Result Parameter bit7 0 0 0 0 1 1 0 1 GA Co OREG31 2010005F H bit0 SE Remarks SMPC User's Manual 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. 29 CKCHG352 SMPC Interrupt Generation Not Possible Command Code Clock Change 352 Mode IREG Unused OREG 0EH α nti al NO. 9 Execution Time 31 100 msec + Switch the SATURN system clock from 320 mode to 352 mode. Command Parameter None Result Parameter nfi de Function Description bit7 0 0 0 0 1 1 1 0 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 SE Remarks GA Co OREG31 2010005F H bit0 30 CKCHG320 SMPC Interrupt Generation Not Possible Command Code Clock Change 320 Mode IREG Unused OREG 31 0FH α nti al NO. 10 Execution Time 100 msec + Switch the SATURN system clock from 352 mode to 320 mode. Command Parameter None nfi de Function Description Result Parameter bit7 0 0 0 0 1 1 1 1 GA Co OREG31 2010005F H bit0 SE Remarks SMPC User's Manual 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 31 NMIREQ SMPC Interrupt Generation Not Possible Command Code NMI Request IREG Unused OREG Command Parameter None min 30 µsec Result Parameter nfi de Sends NMI request to master SH-2. max XXX Execution Time 31 Function Description 18 H nti al NO. 11 bit7 0 0 0 1 1 0 0 0 GA Co OREG31 2010005F H bit0 NMI is requested unconditionally even if disabled by the RESDISA command. SE Remarks 32 SMPC Interrupt RESENAB Generation Not Possible Command Code Reset Enable IREG Unused OREG 31 19 H nti al NO. 12 Execution Time Function Description This is a command to enable NMI generation. Command Parameter None max XXX min 30 µ sec nfi de In SATURN, NMI is generated when the main unit panel reset button is pushed. When power is on, the default is set disabled. Result Parameter bit7 0 0 0 1 1 0 0 1 GA Co OREG31 2010005F H bit0 SE Remarks SMPC User's Manual NMI is generated when the reset button is pushed during the 3VINT period to prevent chattering. 33 RESDISA SMPC Interrupt Generation Not Possible Function Description Command Code Reset Disable IREG Unused OREG Execution Time 31 max XXX min 30 µ sec 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. Command Parameter 1AH nti al NO. 13 Result Parameter nfi de None bit7 0 0 0 1 1 0 1 0 GA Co OREG31 2010005F H bit0 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. SE Remarks 34 2.4 Non-Resetable System Management Commands nti al 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. de 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. Co nfi 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) SE GA 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. SMPC User's Manual 35 INTBACK SMPC Interrupt Generation Interrupt Back IREG 0~2 (SMPC Status Acquisition) OREG 0 ~31 Command Code 10 H nti al NO. 1 Execution Time max 320 msec min XXX Function Description Acquires the SMPC status and peripheral data. Here status acquisition will be Command Parameter Here, the INTBACK command's command parameter during peripheral data acquisition is also displayed. de explained. The acquisition of peripheral data will be explained in Section 3. The result parameter is explained after the command parameter. Here, the result parameter, which is limited by the SMPC status acquisition is displayed. SE GA Co Result Parameter nfi Refer to command parameter on the next page. The command parameter setting method during SMPC status acquisition is explained next after result parameter. Remarks 36 Command Parameter bit0 IREG0 20100001 nti al bit7 SMPC Status Acquisition Switch (00H or 01 H) H Initial Value: Not Specified Write Only IREG0: SMPC Status Acquisition Switch Setting Value IREG0 Setting Value 00H 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. de 01H Explanation nfi 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. bit7 IREG1 20100003H bit4 P2MD1 P2MD0 P1MD1 P1MD0 bit3 PEN bit0 0 OPE 0 Unde. Unde. Unde. Unde. Unde. Unde. Unde. Unde. W W W W W --W --- GA Co Bit7, 6: Port 2 Mode Bit7 Bit 6 P2MD1 P2MD0 0 0 1 0 1 0 1 1 15-Byte Mode 255-Byte Mode SEGA RESERVED (Setting Restricted) 0-Byte Mode Explanation 15-Byte Mode 255-Byte Mode SEGA RESERVED (Setting Restricted) 0-Byte Mode SE Bit5, 4: Port 1 Mode Bit5 Bit 4 P1MD1 P1MD0 0 0 1 0 1 0 1 1 Explanation SMPC User's Manual 37 nti al Bit3: Peripheral Data Enable Bit3 Explanation PEN 0 Peripheral Data Not Returned Peripheral Data Returned 1 de Bit1: Acquisition Time Optimization Bit1 Explanation OPE 0 Peripheral Data Acquisition Time Optimized Peripheral Data Acquisition Time not Optimized 1 bit0 bit7 nfi IREG2 20100005H Initial Value: Not Specified Write Only F0H SE GA Co When executing the INTBACK command, be sure to set F0H in IREG2. 38 Result Parameter bit7 •PDE •RESB 0 PDE RESB 1 --- --- --- --- nti al SR 20100061H bit0 bit4 bit3 0: No remaining peripheral data. 1: Remaining peripheral data. 0: Reset button off. 1: Reset button on. Read can be performed without regard for the INTBACK command. bit7 OREG0 20100021H bit0 bit4 bit3 STE RESD --- --- --- --- --- 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. de •STE --- OREG1 20100023H OREG2 20100025H Year 1000s Place Year 100s Place (BCD) Year 10s Place Year 1s Place (BCD) Day Month (Hexadecimal) Note 3 Note 2 Co OREG3 20100027H bit0 nfi bit7 Note 2: Day 0H: Sun 1H: Mon 2H: Tue 3 H: Wed 4H: Thur 5H: Fri 6H: Sat Note 3: Month 1H: Jan 2 H: Feb 3H: Mar 4 H: Apr 5H: May 6 H: Jun 7H: July 8H: Aug 9 H: Sep AH: Oct BH: Nov CH: Dec bit0 bit7 Days 10s Place Days 1s Place (BCD) OREG5 2010002B H Hrs. 10s Place Hrs. 1s Place (BCD) OREG6 2010002DH Min. 10s Place Min. 1s Place (BCD) OREG7 2010002F H Sec. 10s Place Sec. 1s Place (BCD) GA OREG4 20100029H OREG8 20100031H 0 0 0 0 0 0 CTG1 CTG0 SE •CTG1: Cartridge Code 1 •CTG0: Cartridge Code 0 SMPC User's Manual 39 bit0 Area Code (00H~0FH) Area Code (00H~0FH) bit0 nti al OREG9 20100033H OREG9 bit7 bit7 System Status 1 bit7 Co OREG10 20100035H nfi de 20100033H Area Code Code Area Major Country Names, Etc. Area Code 0H Use Prohibited Code Area Major Country Names, Etc. 1H Japan Area Japan 0H Use Prohibited Taiwan, Asia NTSC 2H Japan 1H Area area Japan Philippines SEGA RESERVED 3H Asia NTSC Area Taiwan, Philippines 2H North RESERVED America area 4H SEGA U.S.A., Canada, Mexico 3H BrazilMexico 5H North Central/S. America NTSC area America Area U.S.A., Canada, 4H South Korea Korea areaAmerica NTSC Area Brazil 6H Central/S. 5H 7H Korea SEGAArea RESERVED South Korea 6H SEGARESERVED RESERVED 8H SEGA 7H SEGARESERVED RESERVED 9H SEGA 8H AH SEGA Asia PAL area East Asia, China, Middle East RESERVED 9H SEGA RESERVED BH Asia PAL Area East Asia, China, Middle East AH EuropeRESERVED PAL area, etc. Europe, Australia, South Africa CH SEGA BH Central/S. Amercia PALEurope, area DH Europe PAL Area, etc. Australia, South Africa CH SEGA RESERVED EH Central/S. America PAL Area DH Use Prohibited RESERVED FH SEGA Use Prohibited E H FH bit0 System Status 1 (Status of Control Signals Output System by SMPCStatus 0: OFF 1 1 :ON) OREG10 •b7 0B •b6 DOTSEL Signal Note •b5 1B 20100035H •b4 1B •b3 MSHNMI Signal •b2 1B System Status 1Signal (Status Control Signals •b1 SYSRES •b0ofSNDRES Signal Output by SMPC 0: OFF 1 :ON) •b7 0B •b6The DOTSEL Signal •b5 1B shown in the screen mode (horizontal resolution). Note: DOTSEL signalNote is currently •b40:1B •b31:MSHNMI Signal •b2 1B 320 352 •b1 SYSRES Signal •b0 SNDRES Signal Note: The DOTSEL signal is currently shown in the screen mode (horizontal resolution). 0: 320 1: 352 GA bit7 OREG11 20100037H bit0 System Status 2 bit7 System Status 2 (Status of Control Signals Output by SMPC 0: OFF 1 :ON) System Status 2 OREG11 •b7 RESERVED •b6 CDRES Signal •b5 RESERVED 20100037H •b4 RESERVED •b3 RESERVED •b2 RESERVED •b1 RESERVED •b0 RESERVED System Status 2 (Status of Control Signals Output by SMPC 0: OFF 1 :ON) SE •b7 RESERVED •b6 CDRES Signal •b5 RESERVED •b4 RESERVED •b3 RESERVED •b2 RESERVED •b1 RESERVED •b0 RESERVED 40 bit0 bit0 bit7 SMEM 1 Saved Data OREG13 2010003BH SMEM 2 Saved Data OREG14 2010003D H SMEM 3 Saved Data OREG15 2010003F H SMEM 4 Saved Data bit0 bit7 OREG31 2010005FH 0 nti al OREG12 20100039H 0 0 0 0 0 0 0 SE GA Co nfi de With peripheral data, however, the command code (OREG31) could be overwritten. SMPC User's Manual 41 There are three ways the INTBACK command can be used. 1) 2) 3) Acquire only SMPC status. Acquire peripheral data after acquiring SMPC status. Acquire only peripheral data. nti al How to Use INTBACK Command when Acquiring SMPC Status 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. de Method for Acquiring Only SMPC Status When acquiring status only, set the command parameter as shown below, and execute the INTBACK command. Setting Value 01H IREG1 00H IREG2 F0H All data for time, cartridge code, area code, terminal status, SMEM, and reset button mode is returned. nfi IREG0 Description 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. Co IREG Set F0H without conditions. SE GA 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. 42 nti al Method for Acquiring Peripheral Data After Acquiring SMPC Status 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. IREG0 01H IREG1 08H IREG2 F0H Description 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. de Setting Value Set F0H without conditions. nfi IREG Co 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. SE GA This method is effective for use with applications that acquire all status types for each frame and that acquire peripheral data. SMPC User's Manual 43 Function Description IREG 0 ~3 OREG max XXX Execution Time 31 min 40 µsec The SMPC has a 4-byte battery backupable memory (SMEM) This command sets data to the SMEM. Command Parameter bit0 bit7 IREG0 20100001H Setting Data to SMEM1 IREG1 20100003H Setting Data to SMEM2 IREG2 20100005H Setting Data to SMEM3 IREG3 20100007H Setting Data to SMEM4 bit0 bit7 SE 44 0 0 0 1 0 1 1 1 • 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. GA Remarks OREG31 2010005F H Co Result Parameter 17 H nti al Generation Possible Command Code SMPC Memory Setting de SMPC Interrupt SETSMEM nfi NO. 2 2.5 RTC Commands nti al 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. nfi de 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) SE GA Co 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. SMPC User's Manual 45 SETTIME SMPC Interrupt Interrupt Generation Not Possible Function Description Command Code Time Setting IREG 0~6 OREG Sets the RTC time. Command Parameter max XXX Execution Time 31 bit7 bit4 bit3 16 H nti al NO. 1 min 70 µsec bit0 IREG0 20100001H Year 1000s Place IREG1 20100003H Year 10s Place IREG2 20100005H Day IREG3 20100007H Days 10s Place Days 1s Place (BCD) IREG4 20100009H Hour 10s Place Hour 1s Place (BCD) IREG5 2010000BH Minute 10s Place Minute 1s Place (BCD) IREG6 2010000DH Second 10s Place Second 1s Place (BCD) Year 1s Place (BCD) de (BCD) nfi Month (Hexadecimal) Note 2 Co Note 1: Note 1 Year 100s Place Days 0H: Sun. 1H: Mon. 2 H: Tue. 3 H: Wed. 4H : Thur. 5H : Fri. 6H: Sat. Note 2: Month 1H: Jan 2 H: Feb 3H: Mar 4 H: Apr 5H: May 6 H: Jun 7H: July 8H: Aug 9 H: Sep AH: Oct BH: Nov CH: Dec Remarks bit7 OREG031 25FC00BC H GA Result Parameter • • 46 0 0 1 0 1 1 0 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. SE • 0 bit0 nti al GA Co nfi de Chapter 3 Peripheral Control SE 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 Section 3 Contents 3.2 SATURN Peripheral 3.1 Standard Format ..................................................................... 76 Peripheral Control Mode .......................................................... 48 Purpose of SATURN 3.2 Peripheral Standard Format .................................................... 76 SATURN Peripheral Standard Formats .................................... 76 SATURN Standard Format Types and Data Format .................................................. 76 3.3 Support Peripheral Data Format in SMPC Control Mode .........81 3.3 Support Peripheral Data Format for SMPC Control Mode ......................................... 81 3.4 Format Supportfor Peripheral Data Format in SH-2 Direct Mode ............. 86 3.4 Support Peripheral Data SH-2 Direct Mode ............................................. 86 SMPC User's Manual 47 Peripheral Control Mode nti al 3.1 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 SH-2 de 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. SMPC PDR1 nfi SH-2 Interface Register Data Bus 8 7 PDR2 Co 7 Figure 3.1 SMPC Control Mode Block Diagram Characteristics Used as an effective method to keep overhead to a minimum when accessing peripherals from inside an application. Settings for Using SMPC Control Mode SE GA Figure 3.2 shows an setting example for using the SMPC control mode for port 1. Mode settings are set independently for each port. 48 nti al SMPC Control Mode Set DDR1 to "00H" When using EXL1 "0", disable EXL1 to "0". de Set IOSEL1 to "0" Setting End nfi 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. Register Name IOSEL1/2 EXL1/2 DDR1/2 Co Table 3.1 Parallel I/O Register Default Values During Power-On Setting Value 0H 0H 00H Description SMPC control mode PAD interrupt VDP2 external latch disable Input of all bits SMPC Control Mode Use Method GA 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 generates an SMPC interrupt and sends a request for peripheral data acquisition to the SH-2. SE 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. SMPC User's Manual 49 Continue Request nti al 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 Issue to be requested Break X O O O X O Received Condition SMPC Operation Hold Request Wait Break Peripheral data collection is stopped and INTBACK command is terminated. Continue Peripheral data collection is continued. Prohibited No guarantee de Continue X X nfi Termination Conditions for INTBACK Command that Acquires Peripheral Data SE GA Co The INTBACK command that acquires peripheral data is terminated by the following 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. 50 nti al SH-2 SMPC IREG Set INTBACK Command Issued de Collect Peripheral Data and Create OREG Interrupt Generated Data Remains nfi OREG Acquisition CONTINUE Request Interrupt Generated •• • OREG Acquisition CONTINUE Request Co Data Remains Data Remains Create OREG Create OREG Interrupt Generated GA Data Remains OREG Acquisition CONTINUE Request Interrupt Generated Create OREG SE No Data Remains INTBACK Command Ends Figure 3.3 All Peripheral Data Acquisition Sequence SMPC User's Manual 51 SMPC IREG Set INTBACK Command Issued nti al SH-2 Interrupt Generated Data Remains nfi OREG Acquisition CONTINUE Request de Collect Peripheral Data and Create OREG Interrupt Generated •• • Data Remains OREG Acquisition CONTINUE Request Co Data Remains Create OREG Create OREG Interrupt Generated OREG Acquisition BREAK Request GA Data Remains INTBACK Command Ends SE Figure 3.4 Peripheral Data Acquisition Cancel Sequence Due to Break Request 52 nti al 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 nfi de 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 Co How to Acquire Only Peripheral Data SE GA 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. SMPC User's Manual 53 Table 3.3 Example Acquisition Command Parameter Setting When Only Peripheral Data Is Acquired IREG1 Description 00H The data and time, cartridge code, area code, terminal status, SMEM, and reset button mode data are not returned. Application specifications Port 2 mode (P2MD1, P2MD0)=from application (except PEN bit) specifications Port 1 mode (P1MD1, P1MD0)=from application specifications Peripheral data enable (PEN)=1B return peripheral data Acquisition time optimization (OPE)=from application specifications F0H Set unconditionally in F0H. SE GA Co nfi de IREG2 Setting Value nti al IREG IREG0 54 nti al 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 de The purpose of optimizing the peripheral data collection time is to collect the peripheral data as close to V-BLANK-IN as possible. In other words, the start of peripheral 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. OREG Acquisition Peripheral Peripheral Data Change Information is 1 nfi INTBACK Issued V-BLANK 1 Response Is Slow Co Peripheral Data Acquisition Peripheral Data Is Changed END INTBACK Issued Optimization Peripheral Data Change OREG Acquisition Peripheral Information is 2 1 ms 2 Collection Start Timing is Offset Peripheral Data Collection END SE GA V-BLANK Figure 3.5 Overview of Peripheral Data Collection Time Optimization SMPC User's Manual 55 Operations when Peripheral Data Collection Time Is Not Optimized Precautions when Peripheral Data Collection Time Is Not Optimized nti al Issue the INTBACK command after 300 µs prior to V-BLANK-IN and before VBLANK-OUT. This makes it possible to accurately start peripheral data collection at V-BLANK-OUT. Peripheral data collection starts when the SMPC detects V-BLANKOUT. The INTBACK command terminates at the time peripheral data collection is finished. 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 VBLANK-IN. de 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 nfi Issue the INTBACK command after 300 µs after V-BLANK-IN and before V-BLANKOUT. This makes it possible to accurately start peripheral data collection at VBLANK-OUT. Co 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. SE GA 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. 56 Precautions when Optimizing Peripheral Data Collection Time nti al 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. SE GA Co nfi de In addition, when using continue as well, the continue request wait-time is measured 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. SMPC User's Manual 57 IREG0 nti al 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. There are two IREG0 settings: when the INTBACK command is issued and when continue or break is requested. • When INTBACK Command Is Issued bit0 bit7 IREG0 20100001H de The IREG0 uses the SMPC status acquisition switch. Status Acquisition Switch (00H or 01H) Initial Value: Not Specified Write Only nfi IREG0: SMPC Status Acquisition Switch Setting Value IREG0 Setting Value Explanation All data for date and time, cartridge code, area code, terminal status, SMEM, and reset button mode are not returned. 01H All data for date and time, cartridge code, area code, terminal status, SMEM, and reset button mode are returned. Co 00H Figure 3.6 IREG0 (During INTBACK Command Issue) • During Continue and Break Request bit7 GA 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. IREG0 CONT BR --- --- bit0 --- --- --- --- SE 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 1H . Figure 3.7 IREG0 (During Continue and Break Requests) Note: 58 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. IREG1 bit7 IREG1 20100003H bit4 P2MD1 P2MD0 P1MD1 P1MD0 nti al The IREG1 uses the peripheral data collection mode. bit3 PEN bit0 0 OPE 0 15-Byte Mode 255-Byte Mode SEGA RESERVED (Setting Restricted) 0-Byte Mode Explanation 15-Byte Mode 255-Byte Mode SEGA RESERVED (Setting Restricted) 0-Byte Mode Co Bit5, 4: Port 1 Mode Bit7 Bit 6 P1MD1 P1MD0 0 0 1 0 1 0 1 1 Explanation nfi Bit7, 6: Port 2 Mode Bit7 Bit 6 P2MD1 P2MD0 0 0 1 0 1 0 1 1 de Unde. Unde. Unde. Unde. Unde. Unde. Unde. Unde. W W W W W --W --- Bit3: Peripheral Data Enable Bit3 Explanation PEN 0 Peripheral Data Not Returned Peripheral Data Returned 1 SE GA Bit1: Acquisition Time Optimization Bit1 Explanation OPE 0 Peripheral Data Acquisition Time Optimized Peripheral Data Acquisition Time not Optimized 1 Note: Figure 3.8 IREG1 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. SMPC User's Manual 59 nti al IREG2 bit0 bit7 F0 H IREG2 20100005H Initial Value: Not Specified Write Only SE GA Co nfi Figure 3.9 IREG2 de When issuing the INTBACK command, be sure to set F0H in IREG2. 60 nti al 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. SE GA Co nfi de The peripheral control status shows the statuses used during peripheral control mode. Port 1 status and port 2 status show their respective port peripheral connection 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. SMPC User's Manual 61 SR = 1 PDL NPE RESB nti al Peripheral Control Status P2MD1P2MD0 P1MD1 P1MD0 Num. of = Multitap ID Connectors Port 1 Status Peripheral 1 Data OREG Port 2 Data Peripheral 2 Data SATURN Peripheral ID = . Extension Data Size . Peripheral 1 1st Data . Peripheral 1 2nd Data . . Peripheral m Data SATURN Peripheral Data Size Type de Port 1 Data . . SE 62 The maximum nth is 255. Result Parameter Standard Configuration Acquired Using INTBACK Command GA Figure 3.10 0<m<15 Co Port 1 data and Port 2 data have the same structure nfi Peripheral 1 nth Data Result Parameter Configuration During 0 Byte Mode When Port 1 Mode and Port 2 Mode Are Other Than 0-Byte Mode SR Peripheral Control Status nti al 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. Port 1 Mode Is 0-Byte Mode Peripheral Control Status OREG Port 2 Mode Is 0-Byte Mode Becomes configuration where Port 1 Data portion is packed. Peripheral Control Status Port 1 Data Becomes configuration where Port 2 Data portion is removed. Co nfi Port 2 Data de Port 2 Data Port 1 Data Figure 3.11 Result Parameter Configuration when One Port is 0 Byte Mode SE GA 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. SMPC User's Manual 63 Command Parameter Setting Conditions and Peripheral Data Configuration Returns SMPC Status X X X X X X X X O O O O O O O O Result Parameter Configuration Returns Has Port 1 Has Port 2 Peripheral Data Control Control X X X X X O X O X X O O O X X O X O O O X O O O X X X X X O X O X X O O O X X O X O O O X O O O Port 1 Data X X X X X X O O X X X X X X O O SE GA Co nfi Use Prohibited SMPC Status X X X X X X X X O O O O O O O O 64 Port 2 Data nti al Command Parameter Setting Conditions de Table 3.4 X X X X X O X O X X X X X O X O Extension Data Size Peripheral 1 1st Data Peripheral 1 2nd Data OREG . . . . SATURN Peripheral ID Configuration bit7 bit4 bit3 bit0 SATURN Data Size Peripheral Type de SATURN Peripheral ID nti al 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 without the SATURN peripheral ID has a maximum of 255 bytes. Peripheral 1 nth Data nfi The extension data size is added for peripherals with data sizes of 16 bytes or more. Also, the maximum size for nth is 255. SE GA Co Figure 3.12 Peripheral Data Configuration SMPC User's Manual 65 Result Parameter Details Peripheral Control Status bit7 P2MD: RESB: NPE: PDL: RESB P2MD1 P2MD0 P1MD1 P1MD0 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.) 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.) 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.) Remaining Peripheral Existence Bit 0: No remaining data 1: Remaining data Peripheral Data Location Bit 0: 2nd or above peripheral data 1: 1st peripheral data Always 1 GA bit7: NPE de P1MD: PDL nfi 1 Co SR bit0 SE Figure 3.13 Peripheral Control Status 66 nti al 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. Port Status bit7 nti al 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. bit4 bit3 Multitap ID bit0 Number of Connectors Figure 3.14 Port Status Configuration de • Number of Connectors nfi If the peripheral is directly connected to the peripheral port, 1H 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, 0H 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 Not connected SMPC UNKNOWN peripheral is connected Peripheral is directly connected Number of taps in the multitap SE GA 1H 2H ~FH Connected Peripheral • • • • Co 0H SMPC User's Manual 67 • Multitap ID nti al 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 FH. 2) When a multitap is connected to the peripheral port, 0H~EH 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. de 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, connection 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 Data Shown in Multitap ID nfi Peripheral Connected to the Peripheral Port Peripheral is directly connected or not connected Multitap is connected UNKNOWN device is connected. FH 0H ~EH MD-PID Co 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 Multitap Name Multitap ID SE GA SEGA Tap SATURN 6P Multitap 68 0H 1H Number of Connectors 4H 6H SATURN Peripheral ID SATURN Peripheral ID Configuration bit7 nti al 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. bit4 bit3 bit0 SATURN Peripheral Type Data Size • SATURN Peripheral Type de Figure 3.15 SATURN Peripheral ID Configuration nfi 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 SE GA Co 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. SMPC User's Manual 69 SATURN Peripheral ID Details • When a Peripheral Is Directly Connected to the Peripheral Port Combinations of Peripheral Data Size and Port Mode (Peripheral Is Connected Directly to Peripheral Port) de Table 3.8 nti al 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. Port Mode (IREG1 Setting) 15 Peripheral Data Configuration 1 nfi 15 16- Peripheral Data Peripheral Data 255 Configuration 2 Configuration 3 Co Peripheral Data Size (Byte) bit7 SATURN Peripheral ID 255 bit4 bit3 OH~E H SATURN Peripheral Type bit0 1H~F H Data Size bit7 bit0 Peripheral Data 1st GA Peripheral Data Table Peripheral Data 2nd . . . Peripheral Data nth nth shows the data size. The maximum size is 15 bytes. SE Figure 3.16 Peripheral Data Configuration 1 70 nti al bit7 SATURN Peripheral ID bit4 bit3 OH~E H SATURN Peripheral Type Extension Data Size OH bit0 0H Data Size FH Peripheral Data 1st Peripheral Data 2nd . . . de Peripheral Data Table Peripheral Data 15th nfi 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. Co Figure 3.17 Peripheral Data Configuration 2 bit7 SATURN Peripheral ID GA Extension Data Size SE Peripheral Data Table SMPC User's Manual bit4 bit3 bit0 OH ~EH 0H SATURN Peripheral Type Data Size 1O H ~FFH Peripheral Data 1st Peripheral Data 2nd . . . Peripheral Data nth nth shows the data size. The maximum size is 255 bytes. Figure 3.18 Peripheral Data Configuration 3 71 • When a Multitap Is Connected to the Peripheral Port nti al 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. de 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. Co nfi 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. SE GA 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. 72 nti al Table 3.9 Combinations of Peripheral Data Size and Port Mode (Multitap) Port Mode (IREG1 Setting) 15 15 Peripheral Data Configuration 1 16-255 Peripheral Data Peripheral Data Configuration 2 Configuration 3 Not Connected Tap Peripheral Not Connected UNKNOWN bit7 bit0 FFH nfi SATURN Peripheral ID Tap Peripheral UNKNOWN de Peripheral Data Size (Byte) 255 Figure 3.19 SATURN Peripheral ID when Tap Unconnected Co bit7 SATURN Peripheral ID bit4 bit3 FH bit0 0~EH Data Size SATURN Peripheral Type The Mega Drive peripheral ID is output to the data size. It can be handled the same as the previously mentioned SMPC UNKNOWN. SE GA Figure 3.20 SATURN Peripheral ID when Tap Unknown SMPC User's Manual 73 SH-2 Direct Mode Block Diagram SH-2 nti al 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. SMPC PDR1 Data Bus 7 8 PDR2 de 7 Figure 3.21 SH-2 Direct Mode Block Diagram Characteristics SE GA Co nfi 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. 74 Settings for Using the SH-2 Direct Mode SH-2 Direct Mode de Set PDR1 nti al 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. Set DDR1 nfi Set IOSEL1 to "1" NO External Latch Required YES Co Set EXLE1 to "1" Setting End Figure 3.22 SH-2 Direct Mode Setting Example SE GA 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. SMPC User's Manual 75 3.2 SATURN Peripheral Standard Formats nti al 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 extension data, that may be sold in the future; as well as controlling previously sold applications. de 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 nfi This is a device that is only configured with buttons and is represented by the SATURN standard PAD. The basic peripheral type is 0H 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. Co 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 SATURN Peripheral ID 1st Data 2nd Data bit7 bit6 bit5 bit4 0 0 0 0 Right Left Down Up R TRG X TRG Y TRG Z TRG 3rd Data bit1 bit0 Data Size Start A TRG C TRG B TRG L TRG Extension Data Extension Data GA nth Data bit2 Extension Data : : bit3 Extension Data Extension Data SE 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. 76 nti al • 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 1H 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 bit7 bit6 bit5 bit4 1st Data 2nd Data 0 0 Right Left 0 1 Down Up bit3 de SATURN Peripheral ID Start R TRG X TRG Y TRG Z TRG L TRG 3rd Data AX7 4th Data AY7 AY6 5th Data AZ7 AZ6 AX5 AX4 AX3 bit1 bit0 Data Size A TRG C TRG B TRG Extension Data AX2 AX1 AX0 AY5 AY4 AY3 AY2 AY1 AY0- AZ5 AZ4 AZ3 AZ2 AZ1 AZ0 Extension Data nfi 6th Data AX6 bit2 : Extension Data : Extension Data nth Data Extension Data Co 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 GA 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. SE 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. SMPC User's Manual 77 SATURN Peripheral ID 1st Data 0 0 1 bit3 0 Y Over X Over Y Sign X Sign bit1 bit0 Data Size Start 2nd Data XD7 XD6 XD5 XD4 XD3 3rd Data YD7 YD6 YD5 YD4 YD3 4th Data Extension Data : Extension Data : Extension Data nth Data Extension Data Middle Right Left XD2 XD1 XD0- YD2 YD1 YD0 0: X or Y data is valid. 1: Data is over flowing. (255 exceeded) 0: X and Y data have positive values. 1: X and Y data have negative values. Absolute value of amount of mouse movement. Becomes 1 when button is pushed. de Y Over, X Over bit2 nti al Table 3.12 SATURN Pointing Device Standard Format bit7 bit6 bit5 bit4 Y Sign, X Sign XD7~XD0, YD7~YD0 Start, Middle, Right, Left nfi • Keyboard Device SE GA Co Devices used for personal computers, represented by full keyboards. The peripheral type is 3H 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. 78 Table 3.13 SATURN Keyboard Device Standard Format 1st Data 2nd Data bit6 bit5 bit4 0 0 1 1 Right Left Down Up bit3 bit2 0 4th Data D7 Caps Lock D6 Num Lock D5 bit0 Data Size Start A TRG C TRG B TRG R TRG X TRG Y TRG Z TRG L TRG 3rd Data bit1 nti al SATURN Peripheral ID bit7 Scroll Lock D4 Extension Data Make 1 1 D3 D2 D1 Extension Data : Extension Data : Extension Data nth Data Extension Data D0 de 5th Data Break 1: Caps Lock is locked (Caps Lock LED is lit.) 1: Num Lock is locked (Num Lock LED is lit.) 1: Scroll Lock is locked (Scroll Lock LED is lit.) 1 is shown when there is a valid Make code (a key that shows D7~D0 code is pushed down) in D7~D0. 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. GA For Caps Lock For Num Lock For Scroll Lock For Make Key → ← ↓ ↑ ESC Z C X Q A S D E Co Button Right Left Down Up Start A TRG C TRG B TRG R TRG X TRG Y TRG Z TRG L TRG nfi 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. SE For Break SMPC User's Manual 79 nti al Future Expansion of Standard Formats At the present time, four types of formats have been prepared. More will be prepared in the future when required. SE GA Co nfi de 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 peripheral end to make it possible to turn on and off the U, D, L, and R bits. 80 3.3 Support Peripheral Data Format in SMPC Control Mode nti al 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 bit7 1 Right bit6 1 Left bit5 1 Down bit4 0 Up bit3 0 Start bit2 bit1 bit0 0 0 1 A TRG C TRG B TRG de SATURN Peripheral ID 1st Data 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. SATURN Peripheral ID 1st Data 2nd Data nfi Table 3.15 Mega Drive 6-Button PAD Data Format in SMPC Control Mode bit7 1 Right MODE bit6 bit5 bit4 1 1 0 Left Down Up X TRG Y TRG Z TRG bit3 0 Start 1 bit2 bit1 bit0 0 1 0 A TRG C TRG B TRG 1 1 1 Co 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. SE GA SATURN Mouse (Provisional Name) Table 3.16 shows the SATURN mouse data format for SMPC control mode. SMPC User's Manual 81 Table 3.16 SATURN Mouse Data Format in SMPC Control Mode bit7 bit6 bit5 bit4 1 1 1 0 Y Over X Over Y Sign X Sign XD7 XD6 XD5 XD4 YD7 YD6 YD5 YD4 Y Over, X Over bit3 0 Start XD3 YD3 bit2 0 Middle XD2 YD2 bit1 1 Right XD1 YD1 bit0 1 Left XD0 YD0 nti al SATURN Peripheral ID 1st Data 2nd Data 3rd Data 0: X or Y data is valid. 1: Data is over-flowing. (255 exceeded) 0: X and Y data have positive values. 1: X and Y data have negative values. Absolute value of amount of mouse movement. Becomes 1 when button is pushed. Y Sign, X Sign XD7~XD0, YD7~YD0 Start, Middle, Right, Left nfi de 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 Multitap ID OH No. of Connectors 4H Co 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 SATURN Peripheral ID 1st Data 2nd Data bit7 0 Right R TRG bit6 bit5 bit4 0 0 0 Left Down Up X TRG Y TRG Z TRG bit3 bit2 bit1 bit0 0 0 1 0 Start A TRG C TRG B TRG L TRG 1 1 1 SE GA 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. 82 nti al 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 bit7 bit6 bit5 bit4 0 0 0 1 Right Left Down Up R TRG X TRG Y TRG Z TRG AX7 AX6 AX5 AX4 AY7 AY6 AY5 AY4 AZ7 AZ6 AZ5 AZ4 bit3 bit2 bit1 bit0 0 1 0 1 Start A TRG C TRG B TRG L TRG 1 1 1 AX3 AX2 AX1 AX0 AY3 AY2 AY1 AY0 AZ3 AZ2 AZ1 AZ0 de SATURN Peripheral ID 1st Data 2nd Data 3rd Data 4th Data 5th Data 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. nfi 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. Co 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 bit7 bit6 bit5 bit4 bit3 bit2 SATURN Peripheral ID 0 0 1 1 0 1 1st Data Right Left Down Up Start A TRG 2nd Data KB R TRG X TRG Y TRG Z TRG L TRG TYPE2 3rd Data Caps Num Scroll 0 Make 1 Lock Lock Lock 4th Data D7 D6 D5 D4 D3 D2 bit1 0 C TRG KB TYPE1 bit0 0 B TRG KB TYPE0 1 Break D1 D0 SE GA 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. SMPC User's Manual 83 Key → ← ↓ ↑ ESC Z C X Q A S D E 000: SATURN Keyboard 001~110: SEGA RESERVED 111: UNKNOWN nfi KBTYPE2~0 de Button Right Left Down Up Start A TRG C TRG B TRG R TRG X TRG Y TRG Z TRG L TRG nti al The corresponding values for each button and keyboard key are given below. For Break SE D7~D0 1: Caps Lock is locked (Caps Lock LED is lit.) 1: Num Lock is locked (Num Lock LED is lit.) 1: Scroll Lock is locked (Scroll Lock LED is lit.) 1 is shown when there is a valid Make code (a key that shows D7~D0 code is pushed down) in D7~D0. 1 is shown when there is a valid Break code (a key that shows D7~D0 code is pushed down) in D7~D0. Shows the key No. They are used with both Make and Break. GA For Caps Lock For Num Lock For Scroll Lock For Make Co 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. 84 nti al SATURN 6P Multitap (Provisional Name) In the SMPC control mode, the port status shown in Table 3.21 is output. The SATURN 6P multitap is connected to the Mega Drive 3-button PAD, Mega Drive 6button 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. No. of Connectors 6H SE GA Co nfi Multitap ID 1H de Table 3.21 SATURN 6P Multitap Port Status SMPC User's Manual 85 3.4 Support Peripheral Data Format in SH-2 Direct Mode nti al 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. Port Bit Number Port Bit Name bit6 TH bit5 TR bit4 TL de Table 3.22 Relationship Between Port Bit Number and Port Bit Name bit3 R bit2 L bit1 D bit0 U (TH=1) (TH=1) (TH=0) (TH=0) Co ID3=R # L ID2=D # U ID1=R # L ID0=D # U SE GA # signifies the logical sum OR. 86 nfi 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. nti al Port Setting During Mega Drive Peripheral ID Acquisition The port direction register setting values during Mega Drive peripheral ID acquisition 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 peripheral 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 TH TR Port Direction Set to Output TL R L D U Set to Input de Port Bit Name Peripheral Interface Protocol There are three types of peripheral interface protocols. Following is given an overview of each peripheral protocol and the peripherals they support. nfi TH Control Method Co 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 peripherals that support this protocol are the Mega Drive 3-button PAD and Mega Drive 6button 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 GA 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. SE Mega Drive Peripheral ID for Each Port The Mega Drive peripheral ID for each peripheral is given in Table 3.24. SMPC User's Manual 87 Table 3.24 Mega Drive Peripheral ID for Each Peripheral Mega Drive Peripheral ID DH DH &CH 3H 7H BH 5H 5H 5H nti al Peripheral Name Mega Drive 3-Button PAD Mega Drive 6-Button PAD SEGA Mouse SEGA Tap SATURN Standard PAD SATURN Analog Joystick SATURN Keyboard SATURN Multitap de 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 peripheral ID’s other than 5H is given below. SE GA Co nfi 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 5H. 88 nti al 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 5H 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. D, U = 0, 1 D, U = 0, 1 (TH=1) (TH=0) de 3-Line Handshake Method Peripherals SE GA Co nfi 3) Acquire the SATURN peripheral ID, perform the number of accesses required for the data size, and receive all peripheral data. SMPC User's Manual 89 nti al Mega Drive 3-Button PAD The Mega Drive 3-button PAD is a TH control method peripheral. The access protocol 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. de Table 3.25 Mega Drive 3-Button PAD Data Format for SH-2 Direct Mode 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 nfi Right, Left, Down, Up, Start, A TRG, C TRG, and B TRG become 0 when the button is pushed down. Co Mega Drive 6-Button PAD The Mega Drive 6-button PAD is a TH control method peripheral. The access protocol 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 3button 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 acquisition, 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 TR C TRG Start C TRG Start C TRG Start C TRG Start TL B TRG A TRG B TRG A TRG B TRG A TRG B TRG A TRG GA SE 1st Data 2nd Data 3rd Data 4th Data 5th Data 6th Data 7th Data 8th Data Output TH 1 0 1 0 1 0 1 0 Input R L Right Left 0 0 Right Left 0 0 Right Left 0 0 MD X TRG 1 1 D Down Down Down Down Down 0 Y TRG 1 U Up Up Up Up Up 0 Z TRG 1 Mega Drive Peripheral ID Acquisition Sequence Right, Left, Down, Up, Start, A TRG, C TRG, and B TRG become 0 when the button is pushed down. 90 nti al SATURN Mouse (Provisional Name) The SATURN mouse is a 3-line handshake method peripheral. There are three sequence 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 0B 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. Data Format During SATURN Mouse Power On Reset for SH-2 Direct Mode TL 0 1 R 0 0 Input L 0 0 D 0 0 U 0 0 nfi During Reset Reset Finished Output TH TR 1 1 1 1 de Table 3.27 Co 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 0B when TH is 1B. The SATURN mouse answers the request by changing TL to 0B. Initialization begins when the SH-2 changes TR to 1B. SE GA 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. SMPC User's Manual 91 U 0 0 0 0 0 nti al Table 3.28 Data Format During SATURN Mouse Reset for SH-2 Direct Mode Output Input TH TR TL R L D Initial Status 1 1 1 0 0 0 Reset Request 1 0 1 0 0 0 Reset Acknowledge 1 0 0 0 0 0 Reset Execute 1 1 0 0 0 0 Reset End 1 1 1 0 0 0 SE GA Co nfi de 3) Data Request This sequence acquires data from the mouse. It is started by changing TH to 0B, and ended by changing both TH and TR to 1B. The first data is the Mega Drive ID acquisition phase. Data is acquired by changing TH to 0B from 1B. 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. 92 Data Format During SATURN Mouse Data Request for SH-2 Direct Mode 4th Data 5th Data 6th Data 7th Data 8th Data 9th Data 10th Data End Request End TL 1 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 x 1 R 0 1 x 1 x 1 x Y Over x Start x XD7 x XD3 x YD7 x YD3 x 0 Input L 0 0 x 1 x 1 x X Over x Middle x XD6 x XD2 x YD6 x YD2 x 0 D 0 1 x 1 x 1 x Y Sign x Right x XD5 x XD1 x YD5 x YD1 x 0 U 0 1 x 1 x 1 x X Sign x Left x XD4 x XD0 x YD4 x YD0 x 0 nti al 3rd Data TR 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 1 1 de 1st Data 2nd Data Output TH 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 nfi Table 3.29 Mega Drive Peripheral ID Acquisition Sequence Y Sign, X Sign 0: X or Y data is valid. 1: Data is over flowing. (255 exceeded) 0: X and Y data have positive values. 1: X and Y data have negative values. Absolute value of amount of mouse movement. Becomes 1 when button is pushed. Co Y Over, X Over SE GA XD7~XD0, YD7~YD0 Start, Middle, Right, Left SMPC User's Manual 93 nti al 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 0B 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. Data Format During SEGA Tap Power On Reset for 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 de Table 3.30 SE GA Co nfi 2) Data Request This is the sequence to acquire data from the SEGA tap. A data request is started by changing TH to 0B and ended by changing TH and TR to 1B. The first data is the Mega Drive ID acquisition phase. Data is acquired by changing TH to 0B from 1B. After TH is changed, read R, L, D, and U after 2 µs. Acquire the data thereafter 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. 94 Data Format During SEGA Tap Data Request for SH-2 Direct Mode Output TH 1 0 0 0 0 0 0 TL 1 1 1 0 0 1 1 0 0 0 0 1 0 0 1 1 0 0 1 0 0 0 1 8th Data 0 1 9th Data and Later End Request End 0 0 1 1 0 0 1 1 3rd Data 4th Data 5th Data 6th Data 7th Data Input L 0 1 x 0 x 0 x 1P DevlD2 x 2P DevlD2 x 3P DevlD2 X 4P DevlD2 x D2 x 0 0 0 1 1 0 x 1 nfi 1st Data 2nd Data R 0 1 x 0 x 0 x 1P DevID3 x 2P DevID3 x 3P DevID3 X 4P DevID3 x D3 x 0 de TR 1 1 0 0 1 1 0 D 1 1 x 0 x 0 x 1P DevlD1 x 2P DevlD1 x 3P DevlD1 X 4P DevlD1 x D1 x 1 U 1 1 x 0 x 0 x 1P DevlD0 x 2P DevlD0 x 3P DevlD0 X 4P DevlD0 x D0 x 1 nti al Table 3.31 Mega Drive Peripheral ID Acquisition Sequence Co 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 ID Peripheral Name Mega Drive 3-button PAD Mega Drive 6-button PAD SEGA mouse Unconnected or Unknown SE GA 0H 1H 2H FH SMPC User's Manual 95 nti al 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 bit3 Right Start bit2 Left A TRG bit1 Down C TRG bit0 Up B TRG de 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. Mega Drive 6-Button PAD Data Format During Connection to SEGA Tap bit3 Right Start MODE bit2 Left A TRG X TRG nfi Table 3.34 bit1 Down C TRG Y TRG bit0 Up B TRG Z TRG Co 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 bit2 X Over Middle XD6 XD2 YD6 YD2 GA bit3 Y Over Start XD7 XD3 YD7 YD3 Y Over, X Over Y Sign, X Sign SE XD7~XD0, YD7~YD0 Start, Middle, Right, Left 96 bit1 Y Sign Right XD5 XD1 YD5 YD1 bit0 X Sign Left XD4 XD0 YD4 YD0 0: X or Y data is valid. 1: Data is over flowing. (255 exceeded) 0: X and Y data have positive values. 1: X and Y data have negative values. Absolute value of amount of mouse movement. Becomes 1 when button is pushed. nti al 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 TR 1 1 0 0 TL 1 1 1 1 R L TRG Right Start R TRG Input L 1 Left A TRG X TRG D 0 Down C TRG Y TRG U 0 Up B TRG Z TRG de 1st Data 2nd Data 3rd Data 4th Data Output TH 1 0 1 0 Mega Drive Peripheral ID Acquisition Sequence 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. nfi SATURN Analog Joystick (Provisional Name) The SATURN analog joystick is a 3-wire handshake method peripheral. Start is done by changing TH to 0B and end is done by changing TH and TR to 1B. SE GA Co The first data is the Mega Drive ID acquisition phase. Data is acquired by changing TH to 0B from 1B. 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. SMPC User's Manual 97 Table 3.37 SATURN Analog Joystick Data Format for SH-2 Direct Mode 6th Data 7th Data 8th Data 9th Data 10th Data 11th Data 12th Data 13th Data 14th Data 15th Data 16th Data End Request End nti al 5th Data Input R L D U 0 0 0 1 0 0 0 1 x x x x 0 0 0 1 x x x x 0 1 0 1 x x x x Right Left Down Up x x x x Start A TRG C TRG B TRG x x x x R TRG X TRG Y TRG Z TRG X X X X L TRG α1TRG α2TRG α3TRG x x x x AX7 AX6 AX5 AX4 x x x x AX3 AX2 AX1 AX0 x x x x AY7 AY6 AY5 AY4 x x x x AY3 AY2 AY1 AY0 x x x x AZ7 AZ6 AZ5 AZ4 x x x x AZ3 AZ2 AZ1 AZ0 x x x x 0 0 0 0 x x x x 0 0 0 1 x x x x 0 0 0 1 de 4th Data TL 1 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 x 1 nfi 3rd Data TR 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 1 1 Co 1st Data 2nd Data Output TH 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 GA Mega Drive Peripheral ID Acquisition Sequence SATURN Peripheral ID Acquisition Sequence 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). SE For AZ7~AZ0, the bottom is 0 and the top is 255. 98 nti al SATURN Keyboard The SATURN keyboard is a 3-wire handshake method peripheral. Start is done by changing TH to 0B and end is done by changing TH and TR to 1B. SE GA Co nfi de The first data is the Mega Drive ID acquisition phase. Data is acquired by changing TH to 0B from 1B. 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 keyboard data format in SH-2 direct mode. SMPC User's Manual 99 Table 3.38 SATURN Keyboard Data Format for SH-2 Direct Mode 6th Data 7th Data 8th Data 9th Data 10th Data 11th Data 12th Data 13th Data 14th Data End Request End 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 1 1 Input L 0 0 x D 0 0 x MDID3 MDID2 MDID1 U 1 1 x nti al 5th Data R 0 0 x MDID0 x x x DSIZE 3 DS9ZE 2 DSIZE 1 x 1 0 0 1 1 0 0 1 1 x Right x Start x R TRG X L TRG x x Left x A TRG x X TRG X x Down x C TRG x Y TRG X KBTYPE2 KBTYPE1 KBTYPE0 0 0 0 1 1 0 0 1 1 0 0 1 1 1 1 0 1 1 0 0 1 1 0 0 1 x 1 x Make x D7 x D3 x 0 x 0 x 0 x Caps Lock x 1 x D6 x D2 x 0 x 0 x 0 x Num Lock x 1 x D5 x D1 x 0 x 0 x 0 x Scroll Lock x Break x D4 x D0 x 0 x 1 x 1 DSIZE 0 x Up x B TRG x Z TRG X de 4th Data TL 1 1 1 0 0 1 nfi 3rd Data TR 1 1 0 0 1 1 Co 1st Data 2nd Data Output TH 1 0 0 0 0 0 Mega Drive Peripheral ID Acquisition Sequence SATURN Peripheral ID Acquisition Sequence SE GA 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. 100 Key Right Left Down Up Start A TRG C TRG B TRG R TRG X TRG Y TRG Z TRG L TRG → ← ↓ ↑ ESC Z C X Q A S D E 000: SATURN Keyboard 001~110: SEGA RESERVED 111: UNKNOWN nfi KBTYPE2~0 de Button nti al The corresponding values for each button and keyboard key are given below. For Caps Lock For Num Lock For Scroll Lock For Make For Break 1: Caps Lock is locked (Caps Lock LED is lit.) 1: Num Lock is locked (Num Lock LED is lit.) 1: Scroll Lock is locked (Scroll Lock LED is lit.) 1 is shown when there is a valid Make code (a key that shows D7~D0 code is pushed down) in D7~D0. 1 is shown when there is a valid Break code (a key that shows D7~D0 code is pushed down) in D7~D0. Shows the key No. They are used with both Make and Break. SE GA D7~D0 Co 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. SMPC User's Manual 101 nti al 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 SATURN 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. SE GA Co nfi de Data collection is started by changing TH to 0B and ended by changing TH and TR to 1B. The first data is the Mega Drive ID acquisition phase. Data is acquired by changing TH from 1B to 0B. 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 SATURN 6P multitap data format in the SH-2 direct mode. 102 Table 3.39 SATURN 6P Multitap Data Format for SH-2 Direct Mode 5th Data 6th Data 7th Data 8th Data ?th Data ?th Data ?th Data ?th Data ?th Data ?th Data ?th Data ?th Data ?th Data ?th Data ?th Data ?th Data ?th Data ?th Data GA ?th Data ?th Data nth Data SE n+1th Data end SMPC User's Manual : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : //// //// //// //// 0 1 1 1 \\\\ \\\\ //// //// //// //// Input L 0 0 x 0 \\\\ x 0 //// x //// 1 //// x //// 0 x //// //// //// //// 0 0 1 1 \\\\ ///// \\\\ //// //// //// //// D 0 0 x 0 x 0 x 1 x 0 x U 1 1 x 0 x 1 x 0 x 0 x \\\\ \\\\ //// //// //// //// //// //// //// //// \\\\ //// //// //// //// CH1-M6ID3 CH1-M6ID2 CH1-M6ID1 x x x x CH1-DSIZE2 CH1-DSIZE1 CH1-DSIZE0 CH1-DSIZE3 x CH1-DATA CH1-M6ID0 x x x CH1-DATA CH1-DATA CH1-DATA de 4th Data \\\\ R 0 0 x 0 x 0 x 0 x 0 x : : : : CH2-M6ID3 CH2-M6ID2 CH1-M6ID1 CH1-M6ID0 x x x x CH2-DSIZE3 CH2-DSIZE2 CH2-DSIZE1 CH2-DSIZE0 x x x x CH2-DATA CH2-DATA CH2-DATA CH2-DATA : : : : CH3-M6ID3 CH3-M6ID2 CH3-M6ID1 CH3-M6ID0 nfi 3rd Data TL 1 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 x x x x CH3-DSIZE3 CH3-DSIZE2 CH3-DSIZE1 CH3-DSIZE0 x x x x CH3-DATA CH3-DATA CH3-DATA CH3-DATA : : : : CH4-M6ID3 CH4-M6ID2 CH4-M6ID1 CH4-M6ID0 x x x x CH4-DSIZE3 CH4-DSIZE2 CH4-DSIZE1 CH4-DSIZE0 Co 1st Data 2nd Data TR 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 nti al Output TH 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 x x x x CH4-DATA CH4-DATA CH4-DATA CH4-DATA : : : : CH5-M6ID3 CH5-M6ID2 CH5-M6ID1 CH5-M6ID0 x x x x CH5-DSIZE3 CH5-DSIZE2 CH5-DSIZE1 CH5-DSIZE0 x x x x CH5-DATA CH5-DATA CH5-DATA CH5-DATA : : : : CH6-M6ID3 CH6-M6ID2 CH6-M6ID1 CH6-M6ID0 x x x x CH6-DSIZE3 CH6-DSIZE2 CH6-DSIZE1 CH6-DSIZE0 x x x x CH6-DATA CH6-DATA CH6-DATA CH6-DATA : : : : 0 x 0 0 0 x 0 0 0 x 0 0 0 x 1 1 Mega Drive Peripheral ID Acquisition Sequence SATURN Peripheral ID Acquisition Sequence Port Status 103 nti al Index Alphabetical Listing 3-Line Handshake Method .................................................................................................. 87 All Peripheral Data Acquisition Sequence ........................................................................ 51 Bit Name ................................................................................................................................ 86 Break Request ........................................................................................................................ 50 Break Request Precautions .................................................................................................. 50 nfi de 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 Co Data Configuration when One Port is in 0 Byte Mode ................................................... 63 Data Size........................................................................................................................... 62, 65 DDR Functions ........................................................................................................................ 7 DDR1 ........................................................................................................................................ 7 DDR2 ........................................................................................................................................ 7 DSP.......................................................................................................................................... (i) GA 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 SE 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 104 nti al 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 de 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 GA Co nfi 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 SE Reset Button ............................................................................................................................. 2 Reset Button Status ............................................................................................................... 39 Resetable System Management Commands ..................................................................... 21 RTC Command ....................................................................................................................... 3 SMPC User's Manual 105 SE GA Co nfi de nti al 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 nfi de nti al 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 SE GA Co V-BLANK-IN ........................................................................................................................ (ii) V-BLANK-IN Skip Function .............................................................................................. (ii) V-BLANK-OUT .................................................................................................................... (ii) VDP1 ................................................................................................................................... (i), 3 VDP2 ................................................................................................................................... (i), 3 SMPC User's Manual 107 Command Abbreviations de nti al 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 SE GA Co nfi 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