Essentials
Essentials
CONTENTS
Introduction (i) Saturn Overview
Manual Layout (i)
Related Manuals
Definitions
(ii)
(iii) Manual
List of Figures (vi)
List of Tables (vii) (temporary version 1)
Chapter 1 Introduction to Saturn 1
1.1 Highlights 2
Chapter 2 Structure 5 June 6, 1994
2.1 Hardware Specifications 6
2.2 System Configuration 7
Doc. #ST-103-R1-040194
2.3 Description of Each Part 8
Chapter 3 Functions 11
3.1 CPU 12
3.2 SCU 13
3.3 VDP1 16
3.4 VDP2 27
3.5 SCSP 38
3.6 CD-ROM 42
3.7 Other Items 51
Index 53
In translating/creating this document, certain technical words and/or phrases were interpreted with the
assistance of the technical literature listed below.
This manual gives an overview of the hardware for Saturn, Sega’s Multimedia
Home Entertainment Device, which contains a 32-bit RISC (Reduced Instruction Set
Computer) processor. This manual explains the features and functions of Saturn to
those who develop game software.
Manual Layout
This manual consists of the following chapters, supplements, and index.
Chapter 2 Structure
The internal structure of Saturn plus hardware specifications
are explained.
Chapter 3 Functions
The main functions of Saturn are explained.
• CPU
The main CPU, sound CPU, I/O controller.
• SCU
Control of each bus (A-bus, B-bus, CPU-bus),
DMA transfer, and matrix calculation (DSP).
• VDP1
Control of drawing and defines draw control.
• VDP2
Control of the scroll screen and display.
• SCSP
Sound control of the PCM/FM sound source.
• CD-ROM
An overview of the CD-ROM and MPEG.
• Miscellaneous
Explains the SMPC.
i
Related Manuals
VDP1
SATURN User's
OVERVIEW Manual
VDP2
User's
Manual
SCU
User's
Manual
SCSP
User's
Manual
SMPC
User's
Manual
ii
Definitions
Gouraud Shading
Gouraud is one type of computer algorithm.
This process computes the color of each position (dot, pixel) of each object being
displayed. Places hit by light are bright, and places shadowed are dark.
C3
An error process that corrects errors when data is read from a CD.
Frame Buffer
Frame buffer is RAM that stores pictures to be displayed. The line buffer was lim-
ited to pictures arranged in a horizontal direction, but with the RAM of the TV
screen size, there you are no longer limits in the horizontal direction.
Pixel
A unit that represents a picture element in a drawing.
Interlace
An image output scan system that obtains the screen image of a single frame by
scanning it twice.
iii
MPEG (Motion Picture (image coding) Expert Group)
An international standard of compression for color motion images (including voice)
of television and video. This standard allows the playing of Full Screen, Full Color,
Full Motion, and CD Quality Audio. Besides conforming to the international stan-
dard, it also has original special functions.
Parts
Divides textured and non-textured parts in a drawing done by the draw command.
Perspective
A technique for creating the impression of distance in computer graphics by show-
ing distance objects as small and nearby objects as large.
Sprite
Image patterns that can be rapidly moved and re-drawn. By preparing a number of
sprite patterns and re-drawing them while moving designated coordinates, an
animation effect can be produced in which the game character appears to be mov-
ing.
High Resolution
Both the normal TV and special monitor are able to display at a high resolution, but
the special monitor has a higher resolution.
Texture Mapping
A computer graphics technique that allows a pattern to be placed on an object.
iv
Effect Data
Expresses the resulting sound obtained when a sound created by the sound genera-
tor is affected by passing through the DSP.
Reverb
As one type of sound field effect, one can produce the atmosphere of a hall, stage
room, steel plate, etc.
Clipping
Clipping removes all image data located outside of the designated draw access area.
v
List of Figures
Chapter 2 Structure
Chapter 3 Functions
vi
List of Tables
Chapter 2 Structure
Table 2.1 Hardware Specifications <Main System> 6
Table 2.2 Hardware Specifications <Subsystem> 6
Chapter 3 Functions
Table 3.1 CPU Specifications 12
Table 3.2 SCU System Specifications 14
Table 3.3 VDP1 System Specifications 17
Table 3.4 Parts Classification 18
Table 3.5 Interlace 21
Table 3.6 Types of Color Operations 23
Table 3.7 VDP2 System Specifications 28
Table 3.8 Scroll Screen Functions 30
Table 3.9 SCSP System Specifications 39
Table 3.10 CD-ROM System Specifications 43
Table 3.11 CD Drive Specifications 43
Table 3.12 Corresponding Standards 50
Table 3.13 SMPC Functions 52
Table 3.14 Saturn Digital PAD Specifications 52
vii
Chapter 1 Introduction to Saturn
Contents
Highlights 2
• High-Speed Micro-Processor
• Large-Capacity Memory
• Memory
- 32 Mbits (4 Mbytes)
- 4 Mbit (512 Kbyte) CD-ROM
2
SEGA SATURN
• Development Language
- C language, Assembly language
Contents
2.1 Hardware Specifications 6
2.2 System Configuration 7
2.3 Description of each Part 8
SH-2 X 2
RAM 2MB
DMA 2 ch
SCU
DSP 14.3 MHz
VDP1: 1 MB
RAM
VDP2: 512 KB
MC68EC000
CPU
16-bit CISC 11.3 MHz
RAM 512 KB
RAM 512KB
MPEG AUDIO / VIDEO
Screen Resolution 704 dot (H) X 480 dot (V)
(optional)
30 frame/sec animation, 44.1 KHz 16-bit audio
6
2.2 System Configuration
With a DSP function built-in to the 32-bit RISC chip (SH-2) that is loaded on to the
main CPU, the system configuration has greatly improved the processing perfor-
mance.
CARTRIDGE I/F
< MAIN SYSTEM > < SUBSYSTEM >
CPU BLOCK VIDEO BLOCK
SCU VDP1
CD-ROM
DRIVE
CD OPTIONS
RAM1MB I/F
SH-2 X 2 MPEG
SH-1 VIDEO
VDP2
RAM2MB
RAM2KB
MPEG
RAM512KB VIDEO
SOUND BLOCK ROM64KB
ROM512KB
SCSP MC68EC000
SMPC RAM512KB RAM512KB
RAM512KB
L R
PAD I/F
AUDIO VIDEO
OUT OUT
Main System
SH-2 (X2)
Control of the entire system is done by the main CPU. With a RISC type high-speed
CPU, there is a noticeable difference in processing performance over conventional
systems. Processing power has been dramatically improved due to a processor
inside that has an arithmetic unit similar to that of a DSP.
MC68EC000
The MC68EC000 carries a 16-bit CPU for sound. Processing speed is much faster
than earlier systems.
RAM/ROM
The RAM has a total of 32 Mbits, with 16 Mbits in the main CPU, 4 Mbits in the
sound CPU, and the remaining 12 Mbits allocated to video. ROM contains the initial
hardware program and cartridge as well as the CD IPL program. It also contains a
CD library.
8
VDP1 (Video Display Processor 1)
VDP1 controls sprites (character). The limitation in the number of horizontal sprites
of previous systems has been eliminated, allowing more sprites (characters) to be
displayed. Polygons can also be displayed.
Cartridge I/F
This is the connector I/F for the cartridge. A maximum of 57 MB area has been
provided.
PAD I/F
This is a control pad connector I/F. Two are planned to be loaded into the main
system.
RAM/ROM
RAM is used as CD buffer RAM, MPEG work RAM, and in the data cache for CD
error correction. ROM contains programs such as the CPU CD BIOS.
CD-ROM Drive
Saturn employs a X2 speed CD-ROM drive.
MPEG (optional)
This standard allows the playing of Full Screen, Full Color, Full Motion, and CD
Quality Audio. Up to 72 minutes (30 frames per second) of images and sounds can
be recorded on a single CD. In addition, there are various application capabilities
that not only output the stretched images, but capture them within the system and
enable their processing using MPEG technology.
10
Chapter 3 Functions
Contents
3.1 CPU 12
3.2 SCU 13
3.3 VDP1 16
3.4 VDP2 27
3.5 SCSP 38
3.6 CD-ROM 42
3.7 Other Items 45
The main CPU has a 32-bit RISC chip with built-in DSP function. The sound block
has a 16-bit CPU MC68EC000. The subsystem has a SH-1. The specification of each
CPU is shown in Table 3.1.
12
3.2 SCU
The SCU smoothly executes the interface of more than one processor connected to
CPU-bus, A-bus, and B-bus. Further, inside is a DMA controller, interrupt controller,
and DSP.
System Configuration
The SPMC is connected to the CPU-bus and controls the system reset signal as well
as the control pad.
The A-bus is connected to a device that provides programs such as cartridges and
CDs.
The SCU interrupt controller controls interrupt from A-bus, B-bus, and the SMPC. It
also supports timer interrupt, can cause the screen display to synchronize and inter-
rupt (INT signal) (Figure 3.1).
14
Functions
SCU functions are shown below.
• Data transfer within Main CPU, Internal DSP, A-bus, and B-bus
The SCU has a CPU I/F, A-bus I/F, and B-bus I/F and smoothly executes the inter-
face to multiple processors, which are connected through their respective I/F and
buses. This also allows programs in the main CPU to be transferred to the DSP
within the SCU. Also, while data is being transferred between the A-bus and B-bus,
the work area can be accessed using the CPU-bus from the CPU, and process can be
executed using independent buses in parallel.
• Interrupt Control
Interrupt that extends to other processors executes through the SCU. For example,
to display the volume level on screen, a screen display request interrupt from the
SCSP for the SCU occurs. SCU recognizes the interrupt and issues the interrupt
while synchronized with the screen. Interrupt can then be issued with respect to any
point (dot) on the screen.
Internal DSP
SCU has an internal DSP. This has been provided in order to implement processes
difficult to implement when the load to the main CPU has been excessive.
Operating Frequency
The operating frequency of the DSP inside SCU runs at a frequency of 1/2 the main
CPU. See the Main CPU manual concerning the operating frequency of the main
CPU.
System Configuration
The VRAM and two frame buffer screens are connected to VDP1 (Figure 3.2). The
VRAM draw command is set through the SCU from the CPU. VDP1 reads draw
commands from the VRAM and writes (draws) draw data to the frame buffer. Infor-
mation controlling draw is set in the system register inside VDP1. Drawn frame
buffer data is displayed in the TV through VDP2 that controls image display.
VRAM
VDP1
16
Table 3.3 shows the VDP1 system specifications.
Parts, color mode, and coordinates are controlled by the VRAM command table.
Control of the frame buffer display is done by the system register.
Parts
Parts drawn by VDP1 are divided into texture and non-texture parts depending on
whether or not there is an original picture. Table 3.4 shows part classifications.
18
Texture Parts
Sprites draw character patterns. Character patterns define pixel data as character
pattern tables in VRAM.
Regular Sprites
Normal rectangular sprite.
The pattern of the original picture can be inverted up , down, and left and right.
This can be done in any sprite mode (Figure 3.3).
Scaled Sprites
For sprites that can be enlarged and reduced, it is only possible to zoom in and out
vertically and horizontally (Figure 3.4).
Reduce Vert
Normal Reduce
Horz.
Expand Horizontally
and Vertically
ORIGINAL
ROTATE
CHANGE SHAPE
20
Non-Texture Parts
Polygon
This is a four-vertex polygon. It is different with a sprite in that the flat surface
encompassed by the four points is painted over by one color. Sprites have an origi-
nal picture whereas polygons do not.
Polyline
This is a quadrilateral connected by four lines.
Line
This is a line of one color drawn between two points.
POLYGON POLYLINE
LINE
Display
A common TV is used as a display apparatus. NTSC format is the TV standard of
both Japan and the U.S. Europe uses the PAL format.
TV display is done by reading data from lead of the frame buffer for each frame (1
frame per 1/60 sec.).
Normally, one frame is equal to one field, but one frame that is interlaced is treated
as two fields, allowing the vertical resolution to be doubled (one frame per 1/30
sec.). There is single and double interlace, as shown in Table 3.5.
Double Interlace Odd numbered line, a different image is shown by even numbered lines
Single Interlace Odd numbered line, the same image is shown by even numbered lines
MSB LSB
Color Bank Palette Code
Priority
Color Operation
22
Color Operation
Gouraud Shading, shadow, half-brightness, and semi-transparent color operations
can be designated by VDP1. Table 3.6 shows the types of color operations.
TYPE DESCRIPTION
Semi-transparent A foundation at half brightness is added to the original at half
brightness. The result is drawn in the frame buffer.
Half-Brightness An object at half the brightness of the original picture is drawn
in the frame buffer. The foundation cannot be seen because i
is written over and the brightness of the original is reduced to
half.
Shadow The foundation at half-brightness is re-drawn in the frame
buffer. Here, a shadow of the character shape in the original
can be created. The character of the original is used only in th
shape of the shadow and color data is ignored.
Gouraud Shading An object in the original picture to which Gouraud shading is
applied is drawn in the frame buffer.
Gouraud Shading The brightness of an object in the original picture to which
Semi-transparent Gouraud shading is applied is reduced to half, and foundation
at half-brightness is added. The result is drawn in the frame
buffer.
Gouraud Shading The brightness of an object in the original picture to which
Half Brightness Gouraud shading is applied is reduced to half, and the object i
drawn in the frame buffer.
Gouraud Shading
Gouraud shading can be applied to parts drawn by RGB, and interpolates color
between polygon vertices which causes a flat surface to appear curved.
A surface can appear to be curved by giving brightness correction values to the four
vertices of a polygon and applying Gouraud shading within these four vertices.
Gouraud shading can be applied to polylines and lines as well. Figure 3.6 shows an
example of Gouraud shading.
Mesh Process
Mesh can be applied to all parts. A checkered pattern (every other dot) is drawn to
the part in which the mesh is applied.
0 1 2 3 4 5 6 7 8 9
0 "X coordinate value + Y coordinate
1 value" is painted only for even
2 numbered pixels; odd numbered
3 pixels are skipped and not written.
4
5
6 : not painted
7 : painted
8
9
24
Clipping
Clipping allows only the set display area to be drawn and cuts away any excess.
Clipping includes system clipping that sets the system draw area, and user clipping
that enables any setting by the software.
System Clipping
System clipping is always in effect while drawing. and the inside of the set area is
drawn (see Figure 3.10).
(0,0)
System Clipping Area
TV
User Clipping
User clipping can be selected by the software. Choose whether to make user clip-
ping effective for each part, or the inside or outside of the user clipping set area of
the effective area.
(0,0)
User Clipping Area
• By reading the frame buffer, the read start coordinate and next dot to be read can
enlarge, reduce, and rotate the entire frame buffer surface by giving X and Y
direction displacement, which designates the location.
26
3.4 VDP2
VDP2 determines priority of display of the scroll screens and the entire screen (in-
cluding sprites). Simultaneous display of scroll screens has been expanded to a
maximum of five screens. A screen can be moved up, down, left, and right, and
rotated. Priority (display priority order) can be programmably set on each character.
System Configuration
VDP2 has VRAM connected to it and color RAM built-in. Image data is defined
from the CPU through the SCU to VRAM and color RAM.
Data defined in VRAM is read according to settings of the register and becomes
image data of each scroll screen. This data, VDP1, as well as image data sent from
the external image circuits determine the display priority order according to the
register setting, then become display image data. Display image data is converted to
display color data and output to the TV (Figure 3.12).
External Image
VDP1 Circuit
(optional)
VDP2
Register TV
CPU SCU
Color
RAM
VRAM
28
Functions
VDP2 has a scroll function for controlling the display of the scroll screen, and a
priority function for determining the display priority order (Figure 3.13).
Scroll Functions
Scroll has a scroll screen for displaying pictures and windows for display control.
• Scroll Screen
Scroll screen includes a normal scroll screen that can change the number of
displayable screens, and a rotation scroll screen that can rotate a screen.
Table 3.8 shows the functions of the normal scroll screen and rotation scroll screen,
and number of character colors.
• Enlarge/Reduce Function
Enlarge and reduce the entire screen horizontally and vertically. Reduced display
horizontally limits the number of screens.
• Mosaic Function
All scroll screens are divided horizontally and vertically, and the color of upper-left
dots in each area are displayed per dots in that area.
30
The color of the dot in the upper
left corner of each area is used
Horizontal direction in all dots within that area.
Mosaic Size
Vertical direction
Area A Area B
Mosaic Size
Area C Area D
Rotation Function
• Rotation Display
The rotation scroll screen rotates along the coordinate axes (X, Y, Z axes) and the
screen axis vertical to the TV screen. Two surfaces can be displayed at the same
time.
Z axis
X axis
Y axis
• Rotation
Rotation calculation is done by the hardware according to designated parameters.
This means that rotation display can be done without straining the CPU load.
Twisted images can be displayed since coordinates can be calculated and different
values applied to each dot.
• Cell Format
The cell format scroll screen is a picture pattern consisting of cells (eight horizontal
dots by eight vertical dots), character patterns (an arrangement of cells), pages (an
arrangement of character patterns), planes (an arrangement of pages), and maps (an
arrangement of maps). Figure 3.17 shows the structure of a cell format scroll screen.
32
Character
Cell Pattern Page Plane Map
H8 dots X
V8 dots H1 cell X
V1 cell
or 32 X 32 H1 page X H2 plains X
H2 cells X or V1 page V2plains
V2 cells 64 X 64 or (Normal Scroll Screen)
character H2 pages X or
patterns V1 page H4 plains X
(64X64 cells) or V4plains
H2 pages X (Rotation Scroll Screen)
NOTE: V = vertical
H = horizontal V2 pages
Bit Map
1 dot
Figure 3.18 Bit Map Scroll Screen and Data Setting Relationship
Windows
Windows are classified into three types depending on the way the area is designated
(coordinate designation).
• Normal Rectangular Window
Designated by two coordinate points: start and end.
• Normal Line Window
Designated by the start and end points of each line coordinate.
• Sprite Window
Designated by sprite character patterns.
Priority Functions
The display priority order of sprites and scroll screens is determined by a 3-bit
priority number. The sprite priority number can set a maximum of eight values; one
of which is designated by character units.
Determining Priority
The scroll screen priority number is designated in normal surface units. (This can be
changed by character units or dot units using special priority function.)
34
Color Calculation Function
By adding multiple screens of color data, the color calculation function produces an
effect that makes the back screen appear to be seen through the front screen. This is
normally done by two screens, the top image and the second image, but can be done
with up to four screens if the expanded color calculation function is used.
transparent transparent
Back
Screen
transparent
screen the line color screen screen the line color screen
has been inserted into has been inserted into
Shadow Function
The shadow calculation function adds a shadow in the shape of the sprite character
on all screens.
+ =
• Blur-Calculation Function
The blur-calculation function adds the horizontal color data of one designated screen
at a fixed rate, and is able to create an effect of a blurred distant background.
36
Priority number = 6 Priority number = 4 Priority number = 2
transparent transparent
Screen A
Replaced as a result of
blur-calculation on
screen C
Second Image
Blur-Calculated
Screen C
Screen B
Color Operation
Color Function used in Screen C
Display Image
Blur-Calculated
Screen B Screen C
Screen A
The sum of color data is forced to be as second image in the area where the top or
second image is the designated screen. The blur-calculated picture can be displayed
by performing color calculation on the second and top images.
SCSP is custom sound LSI that unites PCM (FM) sound generation with a sound
only DSP. The goal of the audio function is to provide higher tone quality with all
interfaces for increasing expandability. Capable of creating many sounds, the opera-
tion part provides a performance that rivals that of a synthesizer. The DSP can
create multiple sound fields, such as each type of sound field play as well as the
special effects of 3D sound positioning.
System Configuration
The main CPU, sound CPU, sound memory, and D/A converter are all connected to
the SCSP. In the sound system, these can operate independent of the main processor.
The main CPU transfers the sound (CPU, DSP) program and wave form data to the
SCSP sound memory through the SCU. The sound CPU transfers wave form data to
the register inside the SCSP. SCSP reads delayed data for producing sound memory
wave form data as well as the effect. The audio is mixed and output as sound
through a D/A converter.
SCU
MIXER
D/A Convertor
38
System Specifications
Table 3.9 shows the SCSP system specifications.
Functions
The main functions of the SCSP are listed below.
• Frequency control
• Volume control
• FM operation
• LFO (Low Frequency Oscillator) modulation function
• Digital / Audio mixing
• Effect from DSP (reverb)
For example, in a racing game, reverb would be applied to the concert grounds as
BGM while reverb could be applied at the same time in producing an atmosphere
inside a tunnel for the game.
r
rrrr
roa
Reverb applied to
create a tunnel
atmosphere
Effect applied to
BGM (CD voice)
In the DSP, the effect can be applied to CD audio because the audio signals from the
sound generator, and sound signals from the CD are input. Because the CD output
level can be controlled through the SCSP, the sound signal from the sound generator
and CD can be balanced and therefore the sound from the sound source will still be
audible without being “hidden” by the CD sound. Thus, concealing the CD sound
will not conceal the sound of the sound generator.
40
Sound Position
With a high performance digital mixer, the SCSP can control the positions of all
sounds in real time. As a result, effective sounds can be produced on the screen with
character positions. This process can be done by the DSP as well. In this case, when
the character moves slowly, the sound orientation will move smoothly because more
intricate settings can be made. A sense of depth (distance) can be created by adding
reverb to this positioning.
pachinn
pachinn
pachinn
L R
Fixed Position (pan)
Besides this, indoors, outdoors, and wide open spaces can be expressed depending
on the type of reverb. Also, the type of reverb can also be set for all conditions, such
as a hall, stage room, steel plate, etc.
The CD-ROM system has its own CPU and buffer RAM, and can operate indepen-
dently of the main system. By setting in advance conditions from the main system,
flexible buffer management that suits the application configuration is attained.
System Configuration
The CD-ROM system operates only by giving commands through CD I/F from the
main system. The sub-CPU interprets commands from the main system, controls the
CD-ROM drive and CD buffer, reads data, and plays video and audio. Audio and
video playing employs the MPEG international video compression standard, and
uses the exclusive “MPEG/Video LSI” as well as “MPEG / Audio LSI.” The system
configuration is shown in Figure 3.28.
The sub-CPU, CD buffer, frame buffer, C/D I/F are connected to the MPEG / Video.
Compressed image data is received from the CD buffer and regeneration image data
is written (drawn) to the frame buffer. Drawn frame buffer data carries out the effect
according to register settings and displays in the display device through VDP2 the
controls screen display; or it is transferred to VDP1 and VDP2 VRAM through CD I/
F and SCU.
MPEG / Audio receive compressed audio data from the CD buffer and outputs
stereo 1ch audio data. This audio data is output through the SCSP as sound.
SCU
CD Buffer CD Drive
Speakers
A-bus B-bus
Audio
SubCPU SCSP
(SH-1) CD I/F
TV
Frame
Buffer
42
CD-ROM system specifications are shown in Table 3.10, and CD drive specifications
are shown in Table 3.11.
CD-ROM system first stores data read from the CD-ROM to the CD buffer. The
stored data reads/writes to the main system or MPEG in response to commands
from the main system. Figure 3.29 shows the data flow of the CD-ROM system.
CD Block
Host
Data transfer Register MPEG Register
Retrieve Write Retrieve
Host
44
Stream Select
Data flow from the CD-ROM is called a stream. A stream has audio data, image
data, and program data. The stream select function selects the classification of data
and sends it to the main system and MPEG (Figure 3.30). Control content of the
stream select function is shown below.
Select Buffer
V→
Video
↓
CD-ROM XA
A→ Main
Audio
System
↓
D A V D A V
V : Video D→
A : Audio Data
D : Data ↓
Parallel Processing
The CD-ROM system reads streams, it also selects streams and controls the CD drive
independently of the main system. Further, parallel processing can be done since
more than one stream selection mechanism is set.
Window Function
As shown in Figure 3.31, this function cuts out part of the image played and displays
it at any size on the TV screen. This function allows the display position of the
MPEG play image and display size to be changed, to select and display one of sev-
eral screens, and zoom in, and zoom out.
Expressions
such as "open
window" are
allowed
Animation (object 1) Animation (object 2)
46
The color of the dot in the upper left
corner of each area is used in the
Original Image Mosaic dots of the entire area.
24 bit, full color Mosaic size horizontal direction
Mosaic size
vertical direction
+ +
+ + + +
4 4
+ +
+ + + +
4 4
Interpolation Function
The MPEG play image is a maximum 352 X 240 dots horizontally, while vertical
interpolation can be displayed at a resolution of a maximum 704 X 480 dots to pro-
vide a smooth display with less flickering.
Shading Function
Displays a color data average of four dots that adjoin horizontally and vertically, and
can produce a distant background shading effect.
Fade Function
This is a display function that gives magnification to the coloring signal and screen
brightness, and is used for fade-in and fade-out. Because this isn’t a method of
adding and subtracting offset values, only the brightness can be correctly changed.
Further, by changing the coloring signal, the monochrome display or displayed
color can be deepened.
Chroma Key
As shown in Figure 3.33, this function plays animation that has transparent dots.
The chroma key is a technique of filming an object in front of a blue background,
taking out all parts that are not blue, then placing those parts in a separate picture.
MPEG animated images can be used only on background with the existing MPEG
LSI, but the chroma key function lets Saturn superimpose and display MPEG ani-
mated images on sprite and scrolls.
TV Screen
48
Screen Retrieve Function
Animated images played by MPEG are retrieved to the main system by this func-
tion, and are handled as sprites, used as texture data, and displayed using the VDP1
and VDP2 functions. Furthermore, this function playing of multiple animations.
The amount of MPEG animated data is 50 times the amount of data from a CD, and
because the transfer speed is faster than the transfer speed from a CD buffer, this
function can be used to rewrite texture data at high-speeds.
The freeze function memorizes animation at any frame (image memory) and allows
strobe playback.
Corresponding Standards
Table 3.12 shows the standards that correspond to the CD-ROM system.
Standard Description
CD-DA The standard name of sound entered on a CD is base on the REDBOOK
international standard. Sampling frequency 44.1 KHz, quantumization bit
16-bit stereo.
CD-G, CDEG Records data such as graphics data in the music CD format area.
Employs 16 color display and CD-DA sound quality.
CD-ROM The standard has been established to enable recording of computer data
with the same physical format as a music CD (CD-DA). Based on YELLOW
BOOK international standard.
CD-ROM XA This is an expanded CD format with a record format that makes possible
interleave recording for concurrent playing of video and audio.
EB CD-ROM software record format that is employed by the Sony Data Discma
(electronic book) (electronic book player).
50
3.7 Other Items
SMPC
SMPC resets the entire Saturn system when the reset button is pressed or the power
turned on. The command from SH-2 turns on or off the peripheral LSI inside of
Saturn, sets and retrieves the calendar and time, and collects data from peripherals.
The clock change command switches between a horizontal resolution of 320 or 352
dots.
Inside Saturn
MC68EC000
Reset Switch
SMPC System Reset
command
reset
SH-2 SH-2
PLL (master) (slave)
*Switch
PAD
(* Peripheral I/O terminal can be directly controlled from the SH-2 side.)
PAD
Table 3.14 shows the digital PAD specifications for Saturn.
52
INDEX
B
Bit map format 33
Branch play function 49
C
C3 iii
Cartridge I/F 9
CD-ROM 42
CD-ROM drive 10
CD-ROM drive specifications 43
CD-ROM system data flow 44
CD-ROM system configuration 42
CD-ROM system specifications 42
Cell format 32
Cell format scroll screen 33
Chroma key function 48
Clipping v, 25
Color bank method 22
Color calculation function 35
Color look-up table 22
Color offset function 37
Color operation 23
Compression rate variation 50
Configuration of Color bank method 22
Corresponding standards 50
CPU 6, 11
CPU specifications 11
D
D/A converter 10
Determining priority 34
Display (VDP1) 21
Double density interlace 21
DSP iii
E
Effect 40
Effect Data v
Encode 9
F
Fade function 48
Regular sprite 19
Frame buffer 26
Freeze function 49
Functions (CD-ROM) 44
Functions (SCSP) 38
Functions (SCU) 15
Functions (VDP1) 18
Functions (VDP2) 29
H
Hardware specifications <main system> 6
Hardware specifications <sub system> 6
High detail pause function 49
High Resolution iv
I
Image change by image axis 32
Image change by rotation axis 31
Image change by screen axis 32
Interlace iii, 21
Interpolation function 47
Interpolation, Shading, Mosaic Functions 47
Interrupt control (SUC) 15
IPL v
L
Line 21
Line and texture parts 21
Line color screen insert 35, 36
Line scroll function 30
M
Enlarge/Reduce function (VDP2) 30
Enlarge/Reduce Sprite (VDP1) 19
MC68EC000 8
Mesh process 24
Mosaic function 30, 48
Mosaic pattern 31
MPEG/Audio function 50
MPEG/Video function 46
MPEG functions 46
MPEG iv, 10
N
Normal line window 33
Normal rectangular window 33
O
On memory play function 50
Operating frequency (SCU) 15
54
P
PAD 52
PAD I/F 9
PAL format v
Parallel processing 45
Parts classification 18
Parts iv
Perspective iv
Pause function 49
PCM iv
Pixel iii
PLL v
Polygon 21
Polyline 21
Priority function 34
R
RAM 6, 8
Related manuals ii
Reverb v
RGB code generation 6, 8
Rotation calculation 32
Rotation display 31
Rotation function 31
S
Saturn digital PAD specifications 52
Screen retrieve function 49
Scroll function 29
Scroll screen 29
Scroll screen configuration 32
Scroll screen function 30
Scroll, Priority functions 29
SCSP 9, 38
SCSP system configuration 38
SCSP system specifications 39
SH-2 8
Shading calculation function 36, 37
Shading function 47
Shadow function 36
Simultaneous display by screen division 32
Single density interlace 21
SMPC 8, 12, 51
SMPC functions 52
SMPC system specifications 51
Special priority function 34
Sprite iv
Sprite window 33
Stream select mechanism 45
Stream selection 45
System clipping 25
System configuration (CD-ROM) 42
System configuration (SCSP) 38
T
Texture mapping iv
Texture part 19
Transformed sprite 20
Tunnel and BGM reverb 40
Types of color calculation 23
U
User clipping 25
V
VDP1 9, 16
VDP1 system configuration 16
VDP1 system specifications 17
VDP2 9, 27
VDP2 system configuration 27
VDP2 system specifications 28
Vertical scroll function 30
W
Window 33, 34
Window function 46
56
TM
Saturn
Introduction
Manual
Doc. # ST-155-062094
Introduction ............................................................................ 1
Purpose of this Manual ..................................................... 1
Who Should Use this Manual ............................................ 1
Other ................................................................................. 1
Configuration of this Manual ............................................. 2
Development Environment ..................................................... 4
Programmer Development Environment ........................... 4
Tool Configuration ............................................................. 5
Installation .............................................................................. 6
Hardware Setup ................................................................ 6
Media ................................................................................ 6
How to Install .................................................................... 6
Other
Updates are provided with the software to provide the user the most up-to-date,
accurate information, manual corrections or when more details are added. Always
read the updates provided with the software. The updates are located in the
“¥SATURN¥xxxxx¥MAN¥” directory.
We have tried to provide a manual that contains the information programmers need
in a concise, easy-to-use format. We would appreciate any comments or suggestions
that you may have. Please share your opinions with us.
1. A PROGRAMMER’S GUIDE
2
• Program Library User’s Guide 2 Graphic Related Library
· VDP1 Library
· VDP2 Library
· Numeric Calculation Library
· DSP I/F Library
In addition to the basic 2D scroll and sprite control functions, numeric
calculations used in 3D object control functions and 3D high-speed processing
programs used in DSP are provided for each level.
• Program Library User’s Guide 3
· Sound I/F Library
· DMA Library
· Cache Library
· Interrupt Control Library
· Memory Control Library
· Timer Library
· Debug Support Library
· Compression/Expansion Library
· DLL Library
We have included many libraries that are helpful when developing applica-
tions. All of these have the source code attached for free customization and
use.
• Sample Program User’s Guide
· Sample Game Program
A collection of actual sample programs are supplied to enable the programmer
to learn game programming faster. These all come with source code to
change or use while creating games.
· Sample Data
Samples of data types that are helpful in creating games are provided. Of
course, these can be freely customized and used in application software.
4. A CD TOOL GUIDE
• Simple CD Simulator
Enables files to be read from memory or a hard disk rather than from a CD and
debugged.
• Virtual CD System
Allows sector data to be read from the virtual CD the same as reading sector
data from an actual CD drive, without actually creating a CD.
• Write Once System
Used to write the CD images tested in virtual CD to a write-once CD.
MFCAT CDSIM
Graphics
Data
Converter
Compression
Tool
4
Tool Configuration
• Programming Tools
Hitachi C compiler, assembler, linker, debugger, etc.; and the various other
tools.
• CD Tools/Simple CD Simulator/SIMM System
MFCAT
Hardware Setup
• <PC Version>
Start up the PC and insert the PC version floppy into the floppy drive.
Always read the “README.DOC” that is contained in the FD root directory first.
Installation instructions are contained in this file.
• <SUN Version>
Prepare the tape device.
• <HP Version>
Prepare the DAT.
Media
Release 2 is supplied with the following media.
—————————————————————
PC Version FD
SUN Version 8mm Tape
HP Version DAT
—————————————————————
How to Install
• <PC Version>
In the PC version, installation can be performed per every library and tool.
• Software Library
Insert the floppy into the disk drive and execute the INSTALL command. Installa-
tion will occur in the current directory. All libraries are installed into the current
directory “SATURN”.
If there is no “SATURN” directory, one must be created.
It should appear as follows (if the floppy drive is A drive and the destination drive is
C drive).
C:¥USR>A:INSTALL[RET]
6
• CD Tools
Insert the floppy into the disk drive and execute the [install] command. It will
install into the current directory. In the example below, the floppy drive is A drive
and the destination drive is C.
C:¥BIN>a:install[RET]
• <SUN Version>
Libraries and tools are installed all at once.
1. Change the current directory to the install directory.
2. If the [tar xvf8mm tape special file] is used, everything from the [SATURN]
directory will be created.
(Example)
tar xvf/dev/nrst[RET]
• <HP Version>
Libraries and tools are installed all at once.
1. Insert the cartridge tape into the device.
2. Move the current directory to the directory you want to install into.
(Example:/usr/bin)
3. Execute the following command.
tar xvf/dev/update.src[RET]
4. After loading from tape, items under the [SATURN] directory are created.
Note: The identifier of each version of a file is designated with the time stamp. Please do not
change the time stamp. Always read all of the [README.DOC] and [¥MAN¥] directory
update documents.
Preliminary draft. Confidential. Property of Sega of America, Inc. July 20, 1995
Documentation ........................................................................................................................... 30
General Saturn documentation..................................................................................30
Hitachi documentation ............................................................................................... 31
SCU documentation ....................................................................................................31
CD-ROM subsystem documentation........................................................................31
Video subsystem documentation ..............................................................................31
Sound subsystem documentation ............................................................................. 32
Glossary ..................................................................................................................................................... 33
Preface
This document introduces the Saturn system, provides an overview of the video
subsystem, and summarizes some of the resources available to Saturn game
developers. You should read this document before reading any other Saturn
documentation and before attending your first Saturn training session.
• Chapter 2, “Overview of VDP 1,” describes the kinds of parts that VDP 1 can
plot, the way VDP 1 uses its VRAM when it plots parts to the frame buffer,
and some of its most important capabilities.
For more detailed information about Saturn, see the documents listed under “Saturn
Documentation” in Chapter 4.
Conventions
This document describes memory in terms of kilobytes (KB) and megabytes (MB),
not kilobits (Kbits) and megabits (Mbits). 1 Mbit = 1024 Kbits = 128 KB.
iii
Preliminary draft. Confidential. Property of Sega of America, Inc. July 20, 1995
iv Introduction to Saturn Game Development
Preliminary draft. Confidential. Property of Sega of America, Inc. July 20, 1995
Chapter 1: The Saturn System
Figure 1-1 shows the three buses and major components of the Saturn system,
including the following:
• SH-2 CPUs. The main processor is a 28-MHz Hitachi 32-bit RISC chip
(SH-2) that uses a second SH-2 as a “slave CPU” to speed processing of
calculations such as matrix transformations. Both SH-2s have access to
1.5 MB of synchronous DRAM (labeled Work RAM in Figure 1-1).
• Video subsystem. VDP 1 plots parts (including textured parts) and supports
15-bit color. VDP 2 can plot up to five backgrounds simultaneously and
supports 15-bit or 24-bit color. VDP 1 uses a dual frame buffer that allows it
to plot a new frame while the previously plotted frame is being displayed,
permitting display at 60 frames per second or at slower rates that divide
evenly into 60 frames per second.
You can program both SH-2s, the SCU DSP, the SCSP DSP, and the 68EC000 to
achieve simultaneous processing of different kinds of data. For example, Saturn
can play up to 32 sounds while calculating transformations of 3-D models and
displaying the resulting 2-D sprites in real time.
The sections that follow summarize the capabilities of Saturn’s major components.
1
Preliminary draft. Confidential. Property of Sega of America, Inc. July 20, 1995
"Slave CPU"
SH-2 SH-2
CPU CPU
IPL ROM
Cache Cache
Cart Port
SH-1
CPU
Bus
DSP Controller
"A" bus (16-bit, 28 MHz) RAM
DMA
(512 KB)
System Control
Unit (SCU)
MPEG
"B" bus
(optional)
(16-bit,
multiplexed,
28 MHz)
Sound subsystem
Frame
buffer 1 SCSP 68EC000
(256 KB) Sound CPU
DSP
VDP 1 VDP 2
RAM
Frame (512 KB)
buffer 2
VRAM (256 KB) VRAM
(512 KB) (512 KB)
Video DAC
subsystem
RGB
encoder
The SCU is built around a Harvard-architecture digital signal processor (DSP), a bus
controller, and a direct memory access (DMA) chip. The bus controller translates
addresses specified by the SH-2 CPU on the system bus into appropriate control
signals for the other buses. This allows the SCU to integrate the A bus and B bus
memory and processors into one large SH-2 memory map.
The SCU’s DSP has a small program area in its RAM and some multiplication units.
These can be useful for tasks such as 3-D transformations. For example, you can load
a program into the DSP that performs a coordinate transformation for rotating an
object. When you need to rotate that object, you send the matrix of vertices you want
to multiply through the DMA with a command that runs the program in the DSP for
each vertex. The resulting transformed matrix of vertices ends up wherever the
DMA is sending it, in this case VDP 1’s VRAM.
You must load any program you want to use into the DSP; it doesn’t contain any
hard-wired programs. Sega provides libraries of programs that perform matrix
calculations and other common tasks.
The work RAM on the system bus can also be controlled via the SCU. This allows
DMA between any parts of memory without involving the SH-2 CPU. For example,
you can DMA from work RAM to VDP 1’s VRAM or from the cartridge port ROM
to VDP 2’s RAM. For an overview of the system memory map, see “Memory
Configuration” later in this chapter.
The SMPC is built around a 4-bit single-chip Hitachi microcontroller that controls a
real-time clock and can reset either the entire system or individual microprocessors
(SH-2, SH-1, 68EC000, and SCSP). The SMPC also controls nonmaskable interrupts
sent to the SH-2 and via the SCU to the 68EC000, SCSP, VDP 1, and VDP 2. This
capability permits the SH-2, for example, to interrupt the 68EC000’s processing to
request that it play a particular sound. The SMPC runs continuously and is powered
by a battery when the system is off.
The SMPC handles all input and output using one of two modes. In direct mode, the
SH-2 CPU can access the peripheral directly. In indirect mode, the SMPC regularly
polls for and buffers the latest information from a variety of peripheral devices,
including the eight-button Saturn controller and other devices that use a 4-bit
parallel protocol, three-line handshake devices, serial devices, and Genesis
controllers like the six-button controller, the mouse, and the Genesis team player.
When you use the SMPC in direct mode, you must provide the appropriate drivers
and poll the devices as necessary.
SH-2 CPUs
The main CPU for the Saturn system is an SH-2 microprocessor with a twin “slave”
SH-2. Both chips run at 28 MHz. Because they are on a single system bus, one has to
wait for the other if they both need to access the work RAM or anything else on the
bus at the same time. However, each SH-2 includes cache RAM that you can
configure either as a 4-KB 4-way write-through unified cache or as a 2-KB 2-way
write-through unified cache plus 2 KB of RAM for use as private work RAM.
The Saturn comes with the main SH-2’s cache RAM configured as a 4-KB 4-way
cache and the slave SH-2’s cache RAM configured as a 2-KB two-way cache with
2 KB of additional RAM.
Cart port
The cartridge port has 32 MB available in the system memory map. You can plug the
CartDev system module directly into the cartridge port and perform debugging and
other tasks via a SCSI connection with a personal computer. For more information
about the CartDev system, see “Programming Tools” in Chapter 4.
CD-ROM subsystem
The CD-ROM subsystem is an independent device with its own SH-1 processor, a
“2x” CD drive that reads data at 300 KB/sec, and a 512-KB data cache. It reads
CD+G, CD Red book (audio CD), CD Yellow book (CD-ROM), and CDX-A formats.
SH-1
The 20-MHz SH-1 microprocessor provides fully independent control of the CD-
ROM subsystem. For example, if you are writing a fast-paced game and you want
the title screen to appear as soon as a player’s character gets killed, you can send
The ROM connected to the SH-1 houses the CD-ROM driver. You can’t access the
SH-1 directly; you can only request, via the driver, that the SH-1 read or write to the
data cache.
Video subsystem
VDP 1 plots parts to the frame buffer. VDP 2 integrates those parts with the
backgrounds that it plots and displays the resulting image via the RGB encoder.
VDP 1 and VDP 2 work independently of each other and of the SH-2 CPU. For
example, the SH-2 can perform matrix transformations or other processing at the
same time that VDP 1 is plotting the display list to the inactive frame buffer and
VDP 2 is displaying the contents of the active frame buffer and several backgrounds.
This section describes the basic functions of VDP 1 and VDP 2. For more
information, see Chapters 2 and 3.
VDP 1
VDP 1 plots polygons and other shapes called parts independently of the
backgrounds displayed by VDP 2. VDP 1 plots parts in the frame buffer one pixel at
a time according to a list of commands, texture bitmaps, and other information in its
VRAM.
Parts can be either textured or nontextured. A textured part, also called a sprite, is a
polygon with four vertices that’s filled with a bitmapped texture. You can specify
the colors for a textured part’s pixels as 15-bit RGB codes (from a total of 32,768
possible colors), palette offsets (from up to 256 entries) from a base address in
VDP 2’s color RAM, or entries in a 16-color color lookup table (CLUT). A
nontextured part is a polygon (interior filled), a polyline (outline colored, interior
empty), or a line. VDP 1 can apply a single RGB or paletted color to a nontextured
part.
A dual frame buffer allows VDP 1 to plot one frame while the previous frame is
being displayed by VDP 2. VDP 2 integrates each frame with the current
backgrounds, taking account of priority settings to determine how to display
overlapping pixels.
The default display rate is 60 frames per second, but you can also manually control
the way individual frames are erased and switched, which in turn determines how
many frames are displayed per second. Display at 60 frames per second makes for
smoother animation and a clearer image, but slower rates allow you to display more
parts in a single frame.
VDP 2
VDP 2 can plot up to five backgrounds based on pattern name tables, character
pattern tables, and other information in its VRAM. It can access four 128-KB banks
of VRAM simultaneously during the four- or eight-cycle display interval after it
displays one pixel and before it displays the next. You have complete control, via
registers, of the way VDP 2 uses the cycles available in the display interval to access
each bank of VRAM.
VDP 2 also includes 4 KB of color RAM that defines color palettes for use by both
VDP 1 and VDP 2. You can use either 15-bit or 24-bit color for palette entries.
Four of the five backgrounds that VDP 2 can display are scroll planes. The picture in
a scroll plane is larger than the TV display area and consists of tiled character
patterns or a single bitmap image with an RGB color assigned to each pixel. Pixels
specified with RGB colors may be 15-bit or 24-bit.
VDP 2 supports two kinds of scroll planes: normal scroll planes and rotation scroll
planes. A normal scroll plane supports vertical and horizontal scrolling and can
rotate around the z axis only. A rotation scroll plane supports two-axis rotation and
scaling as well as vertical and horizontal scrolling. VDP 2 can display four normal
scroll planes, or two normal scroll planes and one rotation scroll plane, or two
rotation scroll planes.
Sound subsystem
A number of sound tools are available, including sampling and recording tools,
a sound wave editor, and a sound compiler that creates sound banks and patch
banks. These tools are described in the sound documentation listed under
“Documentation” in Chapter 4. Sega also provides a library of general MIDI sounds.
SCSP
The custom SCSP chip has three main parts:a digital oscillator with 32 dual-purpose
(PCM/FM) slots, a sound-exclusive 128-step DSP, and a digital mixer. The SCSP also
acts as a DRAM controller for the 68EC000.
The oscillator feeds up to 32 channels into the DSP and converts the sampling
frequency of each sample to the DSP sampling frequency of 44.1 KHz. You can use
the 128-step program area in the DSP to apply various effects to all 32 channels,
including reverberation, early reflection, echo, pitch shifting, surround sound, voice
canceling, distortion, filters, panning, and parametric EQ. Sega provides tools that
allow you to construct programs for the DSP on a Macintosh and to generate code
you can download to the DSP from your program.
You can funnel output from the 32 slots into 16 input slots for the digital mixer. Each
of the mixer’s slots can accept more than one channel’s output.
68EC000
The 68EC000 is a 16-bit CPU running at 11.3 MHz. Because the 68EC000 shares RAM
on a time-sharing basis with the SCSP, the 68EC000 runs at half this speed when the
SCSP is running at full specification.
Memory configuration
The SCU integrates the A bus and B bus memory and processors into one large SH-2
memory map. The SH-2 doesn’t need to process additional instructions to access the
multiplexed B bus. Instead, the SCU translates signals as necessary to provide
transparent access to the entire system. You can access all memory and devices via
the SH-2 memory map.
The SCU uses the 25-bit SH-2 address bus and four SH-2 chip selects to create the
four 32-MB areas shown in Figure 1-2. These four areas represent the entire SH-2
memory map. The IPL ROM occupies a small portion of CS0, the SCU uses CS1 and
CS2, and CS3 is SDRAM.
0x00000000
CS1 SCU
(32 MB)
0x04000000
CS2 SCU
(32 MB)
0x06000000
CS3
SDRAM
(32 MB)
0x08000000
Figure 1-3 shows a simple Saturn memory map. Figure 1-2 and Figure 1-3 show
addresses as cache addresses. If you use these addresses, SH-2 looks first in its RAM
cache for the specified address and uses it via the cache. Alternatively, if you use a
cache through address to refer to the same location in the memory map, SH-2 looks
directly in external memory without checking the cache first, even if the cache
controller is turned on.
0x00000000
IPL ROM
0x00020000
Sound
A CS0
(Cart port)
0x05C00000
VDP I VRAM
A bus
0x04000000 0x05C80000
Frame buffers
A CS1
0x05CC0000
0x05000000 0x05D00000
A CS2 VDP1 registers
0x05800000
A CS3 0x05E00000
0x05900000
(Shown at right) VDP 2 VRAM
0x06000000 0x05F00000
Work RAM VDP 2 color RAM
(System bus)
0x07000000 0x05F80000
Work RAM VDP 2 registers
(shadow)
0x05FC0000
SMPC
0x05FE0000
SCU, DMA/DSP
0x08000000 0x06000000
You can access the 1.5 MB of work RAM on the system bus either via the SCU at
0x5900000 or from the SH-2 at 0x06000000. If you use the SCU address, you can
perform a DMA, for example, from work RAM directly through to VDP 1. In this
case the SCU generates an address for the work RAM, gets the data, puts it in the
work RAM at that address, generates an address for VDP 1, and passes the data
directly to VDP 1. This is faster than having the SH-2 perform the same task.
To SCU
"B" bus
Frame
buffer 1
(256 KB)
VDP 1
RGB
VDP 2
Registers encoder
Frame
buffer 2
VRAM (256 KB)
(512 KB)
This chapter describes the kinds of parts that VDP 1 can plot, the way VDP 1 uses its
VRAM when it plots parts to the frame buffer, and some of its most important
capabilities. For detailed information about VDP 1, see the VDP 1 Manual.
Parts can be either textured or nontextured. A textured part, also called a sprite, is a
polygon with four vertices that’s filled with a texture bitmap. VDP 1 can plot three
kinds of textured parts:
• A scaled sprite behaves like a standard sprite and can also be magnified or
reduced horizontally, vertically, or both horizontally and vertically.
• A distorted sprite behaves like a standard sprite and can also be rotated and
distorted by specifying the coordinates of four corner points. VDP 1 maps the
11
Preliminary draft. Confidential. Property of Sega of America, Inc. July 20, 1995
sprite’s bitmapped image within those coordinates. This capability is useful
for displaying 2-D transformations of 3-D objects.
You can specify colors for a sprite as RGB values, color lookup table (CLUT) entries,
or offsets within palettes in VDP 2’s color RAM. If you specify RGB colors for a
sprite, you can also apply Gouraud shading and other color calculations to it.
A nontextured part is a shape to which VDP 1 can apply a single RGB value or a
single palette color. VDP 1 can plot three kinds of nontextured parts:
• A polygon consists of an area specified by four points and filled with a single
color. VDP 1 can apply Gouraud shading and other effects to polygons.
• A line is specified by two points, and VDP 1 can color and apply Gouraud
shading and other effects to it.
When you specify Gouraud shading for a part, you must supply RGB color offsets
for each of its vertices. VDP 1 can then interpolate intervening color offsets across all
the part’s pixels. For example, if you specify color offsets for the vertices of a
polygon that’s part of a three-dimensional object, VDP 1 can interpolate the
intervening color offsets across the polygon’s pixels and shade the color smoothly as
if the polygon were reflecting light from a nearby source.
The first item in VDP 1’s VRAM is the first entry in the display list, a list of
commands that tell VDP 1 what to plot for a single frame. Each command in the
display list is specified by a command table, a 32-byte block that also indicates
which command to execute next and other information VDP requires to execute the
command successfully. For sprites, this information includes coordinates within
which to plot and the address of a sprite bitmap elsewhere in VRAM. Depending on
the command, a command table may also specify the address of a color lookup table
or a Gouraud shading table.
As long as VRAM begins with the display list, you can organize it however you like.
Figure 2-2 shows a simplified example.
Sprite bitmaps
CLUT tables
Gouraud shading tables
One way to manage VDP 1 is to maintain a shadow of the display list and related
information in the SH-2’s work RAM and replace the relevant parts of VRAM with a
copy of the shadow during the VBL interrupt. VDP 1 then plots the sprites defined
by the revised display list to the inactive frame buffer while VDP 2 is displaying the
contents of the active frame buffer. Both byte access and word access are possible
from the SH-2 or by DMA. All access to VRAM and the frame buffers occurs using
burst transfer.
A command table in VDP 1’s display list can specify one of the following
commands:
• Set User Clipping Coordinates. Defines boundaries for the clipping of sprites
that are plotted after this command. The command for each sprite specifies
whether or not to clip and if so whether to clip inside or outside the currently
defined boundaries.
• Set System Clipping Coordinates. Defines boundaries for the clipping of the
entire frame buffer.
• Set Local Coordinates. Defines local coordinates for sprites that are plotted
after this command.
• Plot Normal Sprite. Plots a normal sprite bitmap in the frame buffer.
• Plot Scaled Sprite. Plots a scaled sprite bitmap in the frame buffer.
Overview of VDP 1 13
Preliminary draft. Confidential. Property of Sega of America, Inc. July 20, 1995
• Plot Distorted Sprite. Plots a distorted sprite bitmap in the frame buffer.
• Plot Polygon. Plots a quadrangle with a colored interior in the frame buffer.
You control the order in which VDP 1 processes the command tables in the display
list by specifying a jump mode for each command. Jump modes instruct VDP to
jump (after processing the current table) or skip (without processing the current
table) to the next command table or to another command table elsewhere in the list.
You can also use jump modes to specify another command as a subroutine of the
current one, so that VDP 1 returns, after processing the subroutine, to the original
command table or the one that follows it. Thus, if you want to keep a group of
related commands that plot a particular object in one place in VRAM, you can move
them in and out of the display list by manipulating jump modes.
Commands that plot parts also enable or disable the following modes:
• End codes. If end codes are enabled and occur within a row of pixel
descriptors in VRAM, VDP 1 plots only the portion of the scan line that lies
between the end codes. End codes make it possible to display sprites with
nonrectangular shapes much faster than would otherwise be possible.
In addition, commands that plot parts specify color modes and color calculations as
described in the next sections.
For a nontextured part, VDP 1 applies either a single 15-bit RGB color or colors from
a single palette or CLUT while it plots the part. Any RGB color may be altered by the
color calculations described in the next section while VDP 1 is plotting individual
pixels to the frame buffer.
For a textured part, VDP 1 reads a sprite bitmap from VRAM and writes it to the
frame buffer. Depending on a color mode set in the command table, VDP 1
interprets the sprite bitmap data as 4-bit offsets into a CLUT, 4- to 8-bit offsets into a
color palette, or 16-bit RGB values.
VDP 1 writes a 16-bit pixel descriptor to the frame buffer for each of a sprite’s
pixels. For RGB data, this involves simply copying the pixel data from VRAM. In
this case, the high bit of each pixel descriptor is set to 1, and the remaining 15 bits
specify an RGB value. For CLUT or palette data, VDP combines bits set in the color
control word of the command table with the 4- to 8-bit offsets specified in the
bitmap to obtain the values for all 16 bits. In this case, the high bit of the color
control word (and thus of the pixel descriptors that VDP I plots to the frame buffer)
should be set to 0. Figure 2-3 shows these two basic formats for pixel descriptors.
15 14 13 12 11 10 9 8 7 6 5 4 3 2
RGB descriptor 1 B G R
15 14 13 12 11 10 9 8 7 6 5 4 3 2
Palette or CLUT descriptor 0 Variable format
The bits in a palette descriptor that are copied from the control word can specify the
descriptor’s format and, depending on the format, the pixel’s priority and
information related to color calculation. The bits in a CLUT descriptor specify the
CLUT’s base address, which VDP 1 adds to the 4-bit offset in the sprite bitmap to
locate an entry in that CLUT. The entry in the CLUT can be either a 16-bit RGB
descriptor or a complete palette descriptor. If it is a palette descriptor in a format
that permits priority settings, a CLUT entry may be used to specify the priority of an
individual pixel as well as its color.
The ability to set priorities for individual sprites is a major advantage of using
paletted colors. All sprites whose pixels are defined with RGB values have the same
priority, which is determined by a register set in VDP 2. A sprite whose bitmap is
defined using paletted colors can have its own priority as determined by the color
control word in its command table. If you want to set the priorities for a single
Overview of VDP 1 15
Preliminary draft. Confidential. Property of Sega of America, Inc. July 20, 1995
sprite, for example if you want place the sprite in front of or behind a specific
backgrounds, use paletted colors. Priority has no effect between parts; to place parts
in front of other parts, you must draw them in sequence, backmost part first.
Color calculations
VDP 1 can perform the following color calculations on any part whose pixels are
specified with RGB color:
• Replace. Writes new pixel data over any previously written pixel in the frame
buffer.
• Shadow. Divides the RGB values previously plotted in the frame buffer
under the specified pixels by two and writes the result, producing color half
as bright.
• Half luminance. Divides the RGB values of the new pixel data by two and
writes the result to the frame buffer, producing color half as bright.
• Half transparency (or half translucence). Divides the RGB values previously
plotted in the frame buffer by two, divides the RGB values of the new pixel
data by two, adds the results, and plots the sum, producing a semitransparent
effect.
• Gouraud shading. Calculates color offsets for all of a part’s pixels based on
offsets for each of its vertexes that are specified in a Gouraud shading table in
VRAM. VDP 1 interpolates the intervening color offsets across the part to
produce a smooth gradation.
VDP 1’s registers control various aspects of its operation, such as TV mode, interlace
mode, plot trigger mode, fill data for erasing, and the frame buffer change mode.
The frame buffer change mode determines the way VDP 1 changes and erases the
frame buffers, which in turn determines how many frames are displayed per second.
• Erase (manual mode). During the next cycle, VDP 1 erases each pixel in the
active frame buffer after VDP 2 displays it, but doesn’t switch the frame
buffers.
• Change (manual mode). During the next cycle, VDP 1 doesn’t erase pixels in
the active frame buffer after VDP 2 displays them, but does switch the frame
buffers.
• Erase & Change (manual mode). During the next cycle, VDP 1 erases each
pixel in the active frame buffer after VDP 2 displays it, and also switches the
frame buffers.
For example, if you want to plot to each frame buffer twice before displaying the
frame (for display at 30 frames per second), you can set the frame buffer change
mode as follows:
You can return to displaying 60 frames per second at any time by setting the
automatic 1-cycle mode, which only needs to be set once, or the Erase & Change
manual mode, which needs to be reset for each cycle.
You can set TV modes for VDP 1 that allow VDP 2 to read the frame buffer
diagonally, in effect rotating the entire frame buffer. Pixels that lie beyond the frame
buffer coordinates are treated as transparent. Clipping areas remain fixed with
respect to the frame buffer, so they are also rotated.
Overview of VDP 1 17
Preliminary draft. Confidential. Property of Sega of America, Inc. July 20, 1995
You can’t rotate the frame buffer with double interlace display or when the TV
mode is set to high resolution or HDTV.
To SCU
"B" bus
VDP 2
RGB
VDP 1 Registers encoder
Color RAM
VRAM
(512 KB)
This chapter describes the kinds of backgrounds VDP 2 can plot, the mechanism it
provides for accessing VRAM during the display interval, and some of the
calculations it can perform as it displays each pixel. For detailed information about
VDP 2, see the VDP 2 User’s Manual.
Types of backgrounds
Four of the five backgrounds that VDP 2 can display at the same time are scroll
planes. The picture in a scroll plane is larger than the TV display area and consists
either of tiled cells or a single bitmap image with an RGB color assigned to each
pixel. A cell for a scroll plane consists of the color data for an 8-by-8-pixel area,
defined either as palette offsets or as RGB colors.
19
Preliminary draft. Confidential. Property of Sega of America, Inc. July 20, 1995
• A rotation scroll plane supports two-axis rotation and scaling as well as
vertical scrolling of cells, horizontal scrolling of lines, and vertical and
horizontal flipping of cells. You can also display the contents of two pattern
name tables in different windows within a single rotation scroll plane.
VDP 2 can display the following combinations of normal and rotation scroll planes:
• One or two normal scroll planes and one rotation scroll plane.
The back plane is the same size as the TV display area and therefore can’t be
scrolled. It is visible only when all other backgrounds are transparent. The back
plane can display a single RGB color or a different RGB color for each line, but can’t
display paletted colors.
VDP 2 calculates and displays one pixel at a time based on the contents of the frame
buffer, scroll plane data it reads from VRAM, priority settings for backgrounds and
sprites, any color calculations to be performed, and various settings in its registers.
When the TV screen is in normal mode, VDP 2 has an eight-cycle display interval:
that is, it has eight clock cycles after the display of each pixel to get the scroll plane
data it needs from VRAM to display the next pixel. When the TV screen is in high-
resolution mode, VDP 2 has a four-cycle display interval.
You have complete control over how VDP 2 uses the available cycles in the display
interval. VDP 2’s VRAM consists of two 256-KB banks labeled VRAM-A and
VRAM-B. You can optionally divide each of these into two 128-KB banks, for a
total of four banks, each of which has a corresponding cycle pattern register as
shown in Figure 3-2.
VRAM-A0
128KB VRAM-A0 VRAM-A1
VRAM-B0
VRAM-B1
128KB VRAM-A1
Fig. 3-2 Four banks of VDP 2 VRAM and their corresponding cycle pattern registers
VDP 2 can access all four banks simultaneously during each cycle of the display
interval. Four eight-slot cycle pattern registers determine how VDP 2 uses the cycles
it has available. You can set each slot in each register to specify that VDP 2 read a
specific table in the corresponding bank of VRAM, provide read and write access to
that bank from the SH-2 CPU, or not allow access the bank at all during that cycle.
This means, for example, that you can calculate line scrolling for a single scroll plane
without having to calculate it for all scroll planes.
The rules governing the use of cycle pattern registers are described in the VDP 2
User’s Manual. For example, certain kinds of accesses must be performed at or before
specific cycles in the display interval. If you are trying to do something complex,
you may find that you need to use two VRAM banks and split up the accesses across
two different cycle pattern registers. Similarly, because of the additional data and
accesses required for a rotation scroll plane, you need to use two 128-KB banks and
two cycle pattern registers to plot each pixel in the plane.
If you define a scroll plane using character patterns and paletted colors, the data in a
VRAM bank consists, at a minimum, of a pattern name table, a character pattern
table, and character patterns. If you define a scroll plane using RGB colors, the data
in VRAM consists, at a minimum, of the bitmap data. In addition, a bank of VRAM
may also include the following tables, depending on the kind of scroll plane and
what you want to do with it:
• Line scroll table. Specifies coordinates and other information required for
horizontal scrolling of lines.
Overview of VDP 2 21
Preliminary draft. Confidential. Property of Sega of America, Inc. July 20, 1995
rotation, viewpoint coordinates that determine the point from which the
rotation is observed, and center coordinates that determine the point around
which the plane rotates.
• Line color screen table. Specifies line colors for use in color calculations or to
specify colors for the back screen.
• Line window table. Specifies horizontal start and end coordinates of lines
that make up a window.
You can specify the colors for a single 8-by-8-pixel cell from among 16, 256, 1024, or
2048 palette entries or from 32,768 or 16,777,216 RGB colors. The amount of RAM
required to specify each of a cell’s pixels varies from 4 bits to 32 bits, depending on
the number of colors. Cells are referenced through several levels of indirection from
tables in VRAM that identify character patterns and collections of character patterns
to be displayed as a scroll plane.
One entry in a pattern name table identifies the address of a character pattern in a
character pattern table. Depending on the way the character pattern’s colors are
specified, the pattern name table may also identify the address of a palette in color
RAM and additional information about horizontal or vertical flipping and priority
and color calculations.
A palette in VDP 2’s color RAM consists of 16, 64, 128, or 256 15- or 24-bit RGB
values. If you use 15-bit color, each palette entry occupies 16 bits and you can
specify a total of 2048 entries. If you use 24-bit color, each palette entry occupies a
To display one or more scroll planes, you load data into VRAM, initialize VDP 2’s
registers, and set the cycle pattern registers as necessary during each display
interval. Initialization includes setting the scroll rotation matrix parameters, the
color mode register (for either 15-bit or 24-bit color), and the priority registers and
clearing the color calculation and color offset registers.
To scroll a scroll plane vertically or horizontally, you can set registers that determine
the starting point within the pattern name table for display of the upper-left corner
of the plane on screen. For continuous scrolling, you should reset these values
during each VBL interrupt.
If the pattern name table is larger than you can fit into VDP 2’s VRAM, you can load
the portion that fits and then replace it with another portion that is shifted in the
appropriate direction through the original table.
For each rotation scroll plane, you must provide a table of k coefficients in addition
to a pattern name table and a character pattern table. The coefficient table
determines the rate at which VDP II steps through the original pattern name table as
it plots each pixel, thus allowing for vertical or horizontal scaling and special effects.
Each coefficient is a 4-byte representation of a decimal value and applies to a line,
groups of pixels, or (potentially) a single pixel.
To achieve smooth effects, you should replace the k coefficients each time VDP 2
displays one frame. Because VDP 2 needs continuous access to the k coefficients to
display a rotation scroll plane accurately, you should normally load new k
coefficients during the VBL interrupt, either just before or just after you swap frame
buffers. It’s also possible to load new coefficients during the HBL interrupt.
The way VDP II plots a rotation scroll plane also depends on scroll rotation
parameters set in VDP 2’s registers. These include the following:
• Perspective point coordinates determine the point from which the rotation is
observed.
Overview of VDP 2 23
Preliminary draft. Confidential. Property of Sega of America, Inc. July 20, 1995
• Rotation center coordinates determine the point around which the scroll
plane rotates.
You can rotate a rotation scroll plane on the x axis, on the x axis and z axis, on the y
axis, or on the y and z axis, but not on the x axis and y axis simultaneously.
Priority functions
VDP 2 determines the priority for the display of any given pixel according to
priority settings for each part that uses paletted colors, a single priority setting for all
parts that use RGB colors, and a single priority setting associated with each
background. For example, if you are displaying a sprite and two backgrounds, one
showing trees in front of a main background showing a landscape, you can set
priority bits for the sprite’s pixels so that Saturn displays the trees in front of the
main background and the sprite between the backgrounds. You can then bring the
sprite to the foreground by changing the priority settings for all its pixels.
You can also make any portion of a scroll plane transparent to any background
underneath it by specifying 0 as the color for those pixels.
Priority has no effect between parts; to place parts in front of other parts, you must
draw them in sequence, backmost part first.
Color processing
• Color offsets allow you to average, add, or subtract the color values for two
backgrounds. This can be useful for dissolves and related effects.
Graphics tools
Sega provides several tools for converting image formats to a form you can use in
your program. Three tools are currently available:
• SCONVERT converts a PICT or PCX file to a format you can use to specify a
sprite.
• BRIP converts a PCX file to a format you can use to specify a background.
The sections that follow describe the graphics content tools in more detail.
SCONVERT
25
Preliminary draft. Confidential. Property of Sega of America, Inc. July 20, 1995
BRIP
To simulate 3-D animation on other game machines, you first create a model with
3-D software tools such as 3D Studio and use that model to export a series of
bitmapped images. You then display the bitmapped images in a series of frames to
create the illusion of movement in three dimensions. Each bitmapped image takes
up a lot of memory and you must be able to predict all potential movements of an
object in order to provide the appropriate bitmaps.
To create 3-D animation on Saturn, you can use 3DS2SAT to convert the entire 3-D
model to the SAT3 format, the standard Saturn file format for 3-D information. For
example, suppose you want to display a rotating cube. The 3-D model consists of six
four-sided polygons, each of which is filled with a bitmapped image. When you
Each object defined by a SAT3 file includes an array of vertex coordinates for that
object, an array that defines the object’s faces by specifying their vertices, and a
variety of other information such as vertex normals used in Gouraud shading. This
arrangement allows you to perform a matrix transformation on the vertex
coordinates before associating those vertexes with specific faces, thus avoiding
repeated calculations for shared points.
Depending on the nature of the game you are programming, you may not need all
the information provided by the SAT3 file format. For example, if you don’t intend
to apply Gouraud shading to an object, you don’t need to include that information
in your program. In most cases you should create a third file from the SAT3 file that
includes only the information you need for your program.
Programming tools
Sega provides a standard GNU C compiler that has been modified to work with the
SH-2 CPU. GNU supports registerized parameters—that is, it allows you to refer to
up to four registers directly; other parameters are on the stack.
Hitachi provides an assembler, a C compiler, a link editor, and a librarian that you
can use to compile and link assembly and C files. You can also use other third-party
assemblers to compile and link assembly files. Typically, these assemblers provide a
debugger, a linker, and a command-line DOS interface that requires a DOS extender.
If you wish, you can write some parts of your program in C using the GNU compiler
and other parts in assembly language using a third-party assembler, then link both
the GNU C modules and the assembly files and output C files in the COFF file
format.
Whether you program in C, assembler, or both, you can use a variety of software
debuggers with the CartDev to debug your program, as shown in Figure 4-1.
Third-party
linker
GNU
C compiler
Third-party
debugger
CartDev
system
Fig. 4-1 Using GNU with third-party tools and the CartDev system
Alternatively, you can use Hitachi software with an E7000 series in-circuit emulator
(ICE) as a debugging system. Unlike software debuggers used with the CartDev,
ICEs provide a history display and can deal with more esoteric problems such as
interrupts or anything that requires strict tracing of code. In some cases it may be
desirable to use both the CartDev and an ICE at the same time for different
purposes.
To learn about the way the SH-2 handles pipelines and optimize for RISC
architecture, you can load files into the Sherry simulator, an SH-2 simulation
program that runs on a PC.
The sections that follow describe the CartDev, the Hitachi 7000 series ICEs, and the
Sherry simulator in more detail.
CartDev system
The CartDev is a low-cost development system that plugs into Saturn’s cartridge
port. It has its own controller that handles all communication. A SCSI (SCSI 2)
interface permits communication with the CartDev from an IBM PC, a Macintosh, or
other hosts, such as SGI workstations. The CartDev communicates with Saturn
through dual port RAM. It also includes dual-access emulation RAM (RAM that can
be read or written to from either the CartDev or from Saturn) that includes 64 KB of
static RAM, with room for up to 8 MB of optional DRAM.
The CartDev provides some hardware control (such as resets, NMIs, and interrupts)
and, when used with appropriate debugging software, allows you to set software
breakpoints, single step through code, and read and write to memory.
In addition to using the CartDev system for software debugging tasks, you can use it
to download or upload art or sound files. In general, downloads with the CartDev
are ten or twenty times faster than downloads with the E7000 ICEs. The CartDev has
an open interface that allows third parties to use its communication capabilities for
additional game development tools.
Hitachi currently provides three E7000 series in-circuit emulators (ICEs) that have
similar hardware debugging capabilities and can emulate the SH-2 processor. Each
version of the E7000 ICE knows about all internal workings of the processor on a
cycle-per-cycle basis (including pipelining), and maintains a history of previous
instructions.
• The E7000 includes a floppy drive and emulation RAM, and it has room for
up to 4 MB of expansion RAM. It is controlled through Ethernet or Cheapnet
from a host with telnet capabilities.
• The E7000PC has the same capabilities as an E7000 except that it doesn’t
include a floppy drive and is controlled by a PC via a proprietary parallel
interface card.
• The E7000 Eval Board doesn’t include a floppy drive and has 512 KB of
nonexpandable emulation RAM. It is controlled from a PC through the same
proprietary parallel interface card used with the E7000PC.
You can control any of these ICEs from a personal computer, if necessary at the
same time as the CartDev. The E7000 ICEs can be helpful with low-level problems
such as interrupts or crashes that corrupt the system, or with any problem that you
can’t isolate using a software debugger.
The Sherry simulator allows you to examine the SH-2’s pipelines. It consists of a
program you can run on a PC without any connection to Saturn or any other
hardware. If you load an S record into the Sherry program, it allows you to set
breakpoints and single step through code using a memory map that emulates the
SH-2 memory map. This is especially valuable for observing clock cycle counts for
pipelined RISC instructions and for learning how new instructions and the ordering
of instructions affect the pipeline.
Sherry has a built-in assembler and debugger and simulates all SH-2 instructions. It
only uses as much of the PC’s memory as your program requires, even if you are
addressing a larger memory space. It doesn’t simulate the cache.
You can use assembly language or high-level languages such as C to write Saturn
programs. Because the SH-2 chips are RISC, assembly-language programming for
Saturn can be more complex than for other game machines. For example, you must
deal with pipelining if you write in assembly language. This means development in
assembly language may take longer than development in a high-level language.
Although the GNU C compiler provided by Sega may produce less efficient code in
some circumstances than an assembler, it takes care of many of the complexities of
RISC programming, such as pipelining, automatically. Hand-crafted assembly code
can be useful in situations where slight performance improvements are significant,
but compiled C code works just as well for many tasks.
Documentation
This section lists the most important documents you will need as you begin writing
programs for Saturn.
Hitachi documentation
E 7000 Primer
SH 2 Hitachi Tools
SH Electrical Characteristics
SH Series C Compiler
SCU documentation
cache through address Address accessed directly, without checking the cache.
cell Color data for an 8-by-8-pixel area, defined either as palette offsets or as RGB
values.
character pattern table A block in VDP 2’s VRAM that contains the character
patterns for a scroll plane.
clipping Plotting parts only inside or outside a designated region; the area not
plotted is “clipped.”
color control word A word in the command table that specifies either a single color
for a part or information that VDP 1 combines with the offsets specified in a sprite
bitmap to obtain a pixel descriptor.
command table A 32-byte block in VDP 1’s VRAM that specifies a command, a
jump mode, and other information VDP 1 requires to execute the command.
cycle pattern registers Four eight-slot registers that determine how VDP 2 uses the
cycles in the display interval to access its VRAM.
display interval The four- or eight-cycle interval after VDP 2 displays one pixel
and before it displays the next. You have complete control, via the cycle pattern
registers, of the way VDP 2 uses the cycles available in the display interval to access
its VRAM.
display list A list of commands in VRAM that tell VDP 1 what to plot for a single
frame.
distorted sprite A textured part that behaves like a normal sprite and can also be
rotated and distorted by specifying the coordinates of four corner points.
line A nontextured part specified by two points that can be filled with a single
color.
normal scroll plane A scroll plane that supports horizontal scrolling of lines,
vertical scrolling of cells, vertical and horizontal flipping of cells, and line zooming
from 256x to 0.25x of normal size.
pattern name table A table of references to all the characters for a page.
pixel descriptor A 16-bit word that VDP draws to the frame buffer for each pixel. If
the high bit is set to 1, the remaining 15 bits specify an RGB value. If the high bit is
set to 0, the pixel descriptor consists of information from the color control word
combined with an offset in the sprite bitmap, and it specifies either an entry in a
color lookup table or a palette entry in VDP 2’s color RAM.
polygon A nontextured part specified by four points that can be filled with a
single color.
polyline A nontextured part specified by four points. Its outline (but not the area
it encloses) can be drawn with a single color.
rotation scroll plane A scroll plane that supports two-axis rotation and scaling as
well as horizontal line scrolling, vertical scrolling of cells, and horizontal and vertical
flipping of cells.
scaled sprite A textured part that behaves like a normal sprite and can also be
magnified or reduced horizontally, vertically, or both horizontally and vertically.
scroll plane Background plotted by VDP 2 using either RGB values or palette colors.
textured part A part plotted by VDP 1 that has three or four vertices and is filled
with a bitmapped image; also called a sprite.
1.0 Summary 1
1.1 Library Configuration 1
1.2 Overview of Stream System Functions 2
2.0 Definition of Terminology and Abbreviations 3
3.0 Module Configuration 5
4.0 Overview of Stream Access 6
4.1 Streams and Stream Groups 6
4.2 Stream Area 6
4.3 Stream Access Procedure 7
4.4 Resident Stream 10
4.5 Precautions when Adding or Changing
Settings During CD Play 11
5.0 Stream Access Example 12
6.0 Data Specifications 14
6.1 Data Table 14
6.2 Data Details 14
6.2.1 Stream Access Status 14
6.2.2 Transfer Gate Status 14
6.2.3 Transfer Mode 15
6.2.4 Fundamental Data 15
6.2.5 Library Handler 15
6.2.6 Stream Key
6.2.7 Stream Play Area
16
17
External
6.2.8 Sector Information
6.2.9 Error Control
17
17 Specification
6.2.10 Transfer Function 18
6.2.11 Call Function when CD BufferIs Full
6.2.12 Error Function
18
18
Document
7.0 Function Table 19
8.0 Function Details 21
8.1 Initialization 21
8.2 Stream Group 21 Saturn
8.3 Streams 23
8.4 Transfer Setting 26 Stream System
8.5 Read Information Acquisition 29
8.6 Transfer Information Acquisition 30
Doc. #ST-98-031194
8.7 Stream Server Execution 31
8.8 CD Block Operation 34
8.9 Error Handling 36
Precautionary Items Regarding Stream System
Library Ver. 0.1 37
© 1994 SEGA. All Rights Reserved.
History of Modifications
1994-02-21
Access Image Diagram Modification
• StmArea Addition
• StmSct Addition
• StmKey Change
• STM_SetCdbufFull Addition
• STM_OpenResi Addition
• STM_ConnectCdbuf Addition
• STM_MoveCdbuf Addition
• STM_StartTrans Addition
• STM_SetTrFad Addition
• STM_OpenFid Change
• STM_OpenFrange Change
• STM_SetKey Change
• STM_GetInfo Change
• STM_EraseCdbuf Change
• STM_GetSctInfo Change
• STM_GetErrStat Change
• The stream read program modification in accordance with the STM_OpenFid change.
• The transmission function specification change and the corresponding change to the 5. (2)
Transmission Function Example.
• Make it so that the word No. and not the byte No. are used for the data No.
Stream System Review and Other Items of Study
This function allows the registered function to be accessed when the capacity remaining in the CD
buffer is less than the set value.
Normally, the data that is read into the CD buffer is transmitted to the host area when the play
position reaches the transmission start FAD. Stream data that has been opened by STM_OpenResi,
however, is resident in the CD buffer even after being transmitted to the host area. This stream is
called a resident stream. When the transmission start FAD is reset (STM_SetTrFad) after residence,
data is again transmitted when the play position reaches the set transmission start FAD.
This function can handle the steam as a SIMM file or SCSI file in the same way as a file on a CD is
normally handled. In this case, however, the stream is not resident on the CD buffer, so data is read
from the SIMM or SCSI each time the stream is accessed.
5. Function Arguments
Changes were made for functions with many arguments so that performance does not degrade
when a struct is made into an argument.
1.0 Summary
This document is the external specifications for a library that will allow streams
(interleaved files, etc.) on CD to be efficiently read
Application
Application
Video1
Buffer 1
Video2
:
Audio1 Stream
CD Audio2 System Buffer 2
:
Multiple Data1
Interleaved Transfer
Data2
Streams : Function
2
2.0Definition of Terminology and Abbreviations
({SM
CI } & mask pattern == comparison pattern)
is the sector that is read.
Stream Group A collection of streams.
End Stream The stream in a stream group that is the last stream to be played.
Loop Start Stream The return stream after a stream group’s end stream has been
played back.
Transfer Start FAD The pick up position for starting the transfer of data read into the
CD buffer to the program buffer, etc.
Transfer Gate The gate when data read into the CD buffer is transferred to the
program buffer, etc. Closing this gate allows stream data to be
accumulated in the CD buffer.
CD Drive
Read
• For other terminology, use the meanings given for the CD communications
interface and the file system.
• For details regarding the directory, refer to File System (GFS) Directory.
4
3.0 Module Configuration
Application
File System
MPEG Stream
Library System
File System
Bottom Module
Hardware
CD Block SIMM, SCSI Files
The file system library and CD communications interface library are necessary to use
the stream system library.
Each library uses the following global symbols. The application program must not
use these symbols.
The end frame address is actually calculated from the total number of sectors in the
start frame address and file. In the case of interleaved files, the end frame address is
calculated as having been recorded as a defined interleave factor (set interleave).
(2) Opening the Stream by Directly Specifying the Frame Address Area
The user can open the stream by directly specifying the frame address area
(STM_OpenFrange). In this case, the specified area becomes the stream area.
The frame address area specifies the first frame address and physical sector number.
6
4.3 Stream Access Procedure
The following procedure is used to access streams.
Yes
Processing Finished?
End
Stream A
Stream B
Stream C
Play Play
FAD
(Time)
0
(f)
Yes User Transfer
Buffer Registration
Transfer Destination
Block B Function Device
No
(g)
Yes
Buffer User Proprietary
Block C Buffer Management
No
8
(a) Play Start
Of the streams in the stream group, the start FAD begins playing from stream A,
which is the front most stream.
(b) Seek
When the playing stream has finished, the pickup moves to the start position of the
next stream (stream B) and begins playing.
(c) Loop
When the last stream (stream C) has finished playing, the pickup moves to the start
position of the loop start stream (the default is the front most stream) and begins
playing.
Sector data that meets the stream key conditions is stored in a buffer block. Sector
data that does not meet the key conditions is sent to the next filter.
If the transfer register or DMA come in use during the transfer, the server function
will end at that time, and the next test transfer will start from the next stream.
When the resident stream is opened during stream access and the play position has
passed the resident stream area, care must be taken that the data is not read into the
CD buffer.
Stream Group
Resident Stream A
Stream B
Stream C
First Time
Second Time On
FAD
According to the normal stream access, the play position advances, and when it
passes the set transfer start frame address, the stream data that is resident gets
transferred.
10
Also, for resident streams, the stream data is not erased from the CD buffer even
after being transferred to the host area.
For this reason, the following functions must be initiated ten sectors or more before
the target position.
10 Sectors or More
Stream
FAD
(1) Functions that Are Delayed Until the Settings Are Valid
/* file ID acquisition */
a_id = GFS_NameTold(...);
.
.
.
abc_grp = STM_OpenGrp(); /* stream group open */
/* stream access */
while (1) {
if (STM_ExecServer() == STM_EXEC_COMPLETED) {
break; /* stream access end */
}
user(); /* user processing */
}
STM_CloseGrp(abc_grp); /* stream group close */
12
(2) Transfer Function Setting
For program (1), make the following changes when using the function
“decodeFunc” to transfer stream B’s data while it is being decompressed.
This change makes the decodeFunc operate every time the server function
STM_ExecServer is called.
Uint16readBuf[READBUF_SIZE];
(c) If data transfer has not ended when decodeFunc ends, (-1) must be returned.
(d) Transfer must be done in sector units.
When the stream cannot be accessed under the following conditions, the constant
becomes STM_EXEC_WAIT.
14
Table 6.4 Transfer Gate Status
Constant Name Transfer Gate Status
STM_GATE_OPEN Open status
STM_GATE_CLOSE Closed status
(3) Constant
(a) File No.
STM_FN_NONE No file No. is specified.
16
STM_CI_NONE Coding information is not specified.
(3) Constant
Table 6.9 Constants for Play Area Specification
Constant Name Sector Position
STM_FAD_CDTOP Disk beginning FAD
STM_FAD_CDEND Sector count when read to end of disk
6 . 2 . 1 0 Transfer Function
6 . 2 . 1 2 Error Function
18
7.0 Function Table
A list of the functions found in the stream system is given in Table 7.1.
20
8.0 Function Details
8.1 Initialization
Stream Group
Stream A
Stream C
Stream B
Stream D
FAD
[Function]
When the empty areas in the CD buffer fall below the specified value, the called
functions are registered.
[Remarks]
(a) Registered functions have the following format.
void (*StmFullFunc)(void *obj);
(b) Registered objects are turned over to the first argument of the registered
function.
22
8.3 Streams
24
Title Function Function Name No.
Function Specifications Change From Word No. to Sector No. STM_WordToSct 3.8
26
Title Function Function Name No.
Function Specifications Transfer Start In Transfer Function STM_StartTrans 4.3
28
8.5 Read Information Acquisition
30
8.7 Stream Server Execution
32
Title Function Function Name No.
Function Specifications Stream Data Transfer STM_ExecTrans 7.7
A or B
B
[Format] void STM_MoveCdbuf(StmHn src, Sint32 spos, Sint32 snum, StmHn dst)
[Input] src :Transfer source stream handler
spos :Sector position (the beginning sector is STM_CDBUF_TOP)
snum :Sector number (count) (STM_CDBUF_END when all the way to the
end)
dst :Transfer destination stream handler
[Output] None
[Function Value] None
[Function]
Moves sector data from the buffer block in the CD block to filter.
[Remarks]
(a) Moves sector data from the CD buffer block allotted to the transfer origin
stream to the filter allotted to the transfer destination stream.
34
Figure 8.3 Connection During Sector Data Move
36
Precautionary Items Regarding Stream System Library Ver. 0.1
(a) The maximum number of stream groups that can be open at the same time is 12.
(b) The number of streams that can be opened at the same time is a maximum of 24,
including the number of files currently open per file system
(c) The handling procedures for errors have not yet been set.
(d) To use the stream system, the file system and CD communication interface must
be linked.
Sega Saturn
Software Development
Standards
SOA Version 2.0
Doc. # ST-151-R4-020197
© 1995-96 SEGA. All Rights Reserved.
Table of Contents
1. Game Sequence.............................................................................................................1
1.1. Sega Brand Game Sequence .............................................................................1
1.2. Third Party Brand Game Sequence ....................................................................2
2. Peripheral Check
2.1. When Must the Checks Occur?...........................................................................3
2.2. What Must be Checked? .....................................................................................3
2.3. Mandatory Peripheral Compatibility.....................................................................3
2.3.1. Standard Digital Devices..........................................................................4
2.3.2. Multitap ....................................................................................................4
2.3.3. Analog Controllers ..................................................................................5
2.3.4. Steering Controller ...................................................................................6
4. Title Screen.....................................................................................................................9
4.1. Screen Display ....................................................................................................9
4.2. Sega Brand Game Title Logo Screen Requirements .........................................9
4.3. Third Party Brand Game Title Logo Screen Requirements .................................9
4.4. Sega Brand Game Title Copyright Display ..........................................................9
4.5. Third Party Brand Game Title Copyright Display ..............................................10
4.6. Proceeding to the Next Screen ........................................................................10
8.4. Reset.................................................................................................................39
8.4.1. Reset Implementation Requirement.......................................................39
8.4.2. Reset Method ........................................................................................39
9. Supplement...................................................................................................................43
9.1. Handling the Open CD Door State ....................................................................43
9.2. Compatible Area Codes (Territory Lockout) ......................................................43
Appendix 1 Sega Saturn Game Content, Trademark and Copyright Standards and Software
Content Library Usage Trademark/License Display Standards .........................44
Sections labeled as “Required Compliance Item” are mandatory requirements which will be noted
as A BUGS if not followed.
Sections labeled as “Recommended Compliance Item” are considered as minor bugs which will be
noted as B BUGS.
Power ON
Boot ROM
Start-Up
Sequence
Display Saturn Logo
Security check
Demo/Title
Loop Peripheral Check The application-based Sega logo is
Sequence not displayed immediately after
the boot ROM-based Sega license
logo.
Was Sega license
Yes
logo displayed?
No
Title Loop
Sequence Application-based Sega Logo
SEGA logo
Timer
Press Press
Game Title Start/Options Options Screen
Start Start
Button Screen Button Select Screen
Timer
Demonstration
Sequence
Timer
Main Game
A typical sample game sequence for a third party brand Sega Saturn
application is shown in the figure below.
Power ON
Boot ROM
Start-Up
Sequence Display Saturn Logo
Security check
Demo/Title
Loop
Sequence
Peripheral Check
Title Loop
Sequence
Company Logo
Timer
Press Press
Game Title Start/Options Options Screen
Start Start
Button Screen Button Select Screen
Timer
Demonstration
Sequence
Timer
Main Game
Required All games must support the 8-Button Control Pad, Virtua
Compliance Item Stick, 6Player, and Mission Stick peripherals as follows:
• Compatibility
• Peripheral Types
Saturn Digital Device (see the SMPC User’s Manual for more
information).
• Special Considerations
None.
2.3.2 Multitap
• Compatibility
• Peripheral Types
6Player.
Not applicable (see the SMPC User’s Manual for more information).
The 6Player supports all of the 4 Sega Saturn Standard Format Types
for protocols with a maximum data size of 15 bytes.
For single player games, the game must support operation from any
one of the 6 peripheral ports when the 6Player is connected to Control
Port 1 (left port when looking at the front of the Sega Saturn). The
use of Control Port 2 for single player games is prohibited.
• Compatibility
• Peripheral Types
Saturn Analog Device (see the SMPC User’s Manual for more
information).
• Special Considerations
The first 2 data bytes of the Saturn Analog Device Format are
identical to the first 2 data bytes of the Saturn Digital Device.
Therefore, the Mission Stick provides virtual compatibility with the
Digital Device format by inserting digital data in the Right, Left,
Down, and Up bits that correspond to movements of the stick. This 2-
axis movement is also represented by the X and Y analog data in
bytes 3 and 4.
Required All driving games must support the Arcade Racer as described
Compliance Item below in addition to the peripheral requirements already
described:
• Compatibility
• Peripheral Types
Saturn Analog Device (see the SMPC User’s Manual for more
information).
• Special Considerations
The digital mode of the Arcade Racer (used for Left and Right) is
not approved for use in any game because of inadequate (slow)
response times. For the Arcade Racer, the Up and Down bits in the
Saturn Analog Device standard format are activated by the “paddles”
on the steering column: Left Paddle = Up, and Right Paddle = Down.
Required The Arcade Racer does not provide buttons that activate the
Compliance Item RTRG and LTRG bits. Therefore, driving games that make use
of the Left and/or Right Flipper buttons on the 8-Button Control
Pad must implement an alternate means of triggering those
functions when an Arcade Racer is connected.
• At Power On:
Recommended The screen display sequence shown below should be avoided after
Compliance Item the power is turned on or the RESET switch on the Sega Saturn is
pressed:
Required The game title logo must be displayed in its final form for
Compliance Item approximately 2 seconds. In addition, the trademark
characters “™” must be shown on the upper right hand
corner of the title logo.
Recommended During the Title Screen, the game should not respond to any
Compliance Item controller input with the exception of the START Button (This
may not apply in the case of a game that requires mouse input.)
Recommended The Start/Options selection screen must not be used as the Game
Compliance Item Start Screen (The Start/Options Screen menu items should be
displayed after the START Button is pressed in the Title Screen.).
Recommended Based on the Control Pad’s or any other input peripheral device’s
Compliance Item connection status and the game start status (e.g., whether Control
Pad 1 or 2’s Start Button was pressed), disable the user’s ability
to select the menu items that cannot be supported under those
conditions.
Example:
• The user must not be able to select a two player game menu
item when a Control Pad is connected only to Control Port 1.
Recommended Provide the user with as many game options as possible unless the
Compliance Item options compromise the quality of the game or if the game is a port
from an original that does not provide an “options” feature.
Required Adjustments to the internal Sega Saturn system clock may NOT
Compliance Item be made from within the game application. Adjustments to the
system clock are supported by the internal boot ROM application.
The user must set the system clock in the “Set Clock” menu.
The standard controls for a typical Options Screen shown below are
as follows:
OPTIONS
Required Important items such as the game score and the number of
Compliance Item remaining player units (player lives) must not be displayed in
the following areas:
• The two cell area on the left/right sides of the game screen.
• The one cell area on the top/bottom of the game screen.
Recommended Sega recommends that the display of scores and high scores be
Compliance Item unified as shown below:
The display for the number of remaining player units does not
count the play unit in use.
Example:
In order to avoid confusion, the same name should not be used more
than twice within a game (especially for user-interface items).
Example:
High scores are not initialized after a reset. The player should also
be able to see the high scores as well as the score from the previous
game during the demo sequence.
• The START Button (used for the Start and Pause functions)
input must be recognized regardless of input from other
buttons.
Examples:
Action Racing
L,R Not used L,R Drift
X,Y,Z Not used X,Y,Z Not used (or may mirror
A Special attack A,B,C functions)
B Normal attack A,C Accelerate
C Jump B Brake
Fighting Shooter
L,R Defense, etc. (Typical air-to-air/ ground shooter)
X,Y,Z Weak, medium and L, R Change view
strong punches X,Y,Z Secondary attack (ground
A,B,C Weak, medium and attack)
strong kicks A,B,C Primary attack (air attack)
Important! Note that the standards contained in this document do not address
current and future Sega Saturn peripherals such as the Backup RAM
Cartridge (available now), Floppy Disk Drive (TBA), and Keyboard
(TBA). The operating procedure of “hot-plugging” peripherals to the
Saturn discussed in this document DO NOT apply to these
peripherals.
Important! It is crucial that the support for peripherals in the Sega Saturn
application be implemented in a user-friendly manner whenever
possible. More importantly, SOFTWARE MUST NEVER BE
ALLOWED TO CRASH.
Term Explanation
Compatible An input peripheral that can be used for a given application.
Peripheral
Incompatible An input peripheral that cannot be used for (is not compatible with)
Peripheral a given application.
Active Peripheral A compatible peripheral that is used in an actual play (connected
to an active port).
Control Port The two input ports that are equipped on the Sega Saturn. These
input ports are referred to as “Control Port 1” and “Control Port 2”
Port(s) When multiple ports are used with the 6 Player, each port is
assigned a port number. The port is referred to as “Port (n)”
(where “n” is a number).
Valid Port A port to which a compatible peripheral is connected.
Invalid Port A port with no compatible peripheral connected, or a port to which
an incompatible peripheral is connected.
Active Port A port that is used during actual game play. Active ports are
determined from among the valid ports for each game play session.
Inactive Port A port not used during play.
Player Number A number assigned to a player (1P, 2P, etc.). Player numbers
and active ports have a one-to-one correspondence.
System Pause This is a pause caused by the system (application), and typically
accompanied by a warning display.
User Pause This is a pause initiated by the player (by pressing the START
button).
Unused Active Port An active port whose compatible peripheral has been disconnected.
Peripheral Check
• Game Start
Recommended Detect the active ports from among the valid ports at game
Compliance Item start (e.g., prompt the player to press the START button to
activate the peripheral).
Design the user interface so that the system pause can be cleared
from any active peripheral after the disconnected active
peripheral is reconnected and detected by the application to be
usable again.
Required The detection of the active port for the above cases should
Compliance Item in the following sequence :
Required The application should not allow the selection of more active
Compliance Item ports than the maximum number of players supported by
the game.
6Player
Required All Sega Saturn applications MUST be compatible with the 6Player,
Compliance Item regardless of the number of players supported by the application.
This section describes the peripheral checks that are necessary when a
6Player is used. If a topic is not covered in detail here, apply the
guidelines supplied in section 2. Standard Peripheral Support.
• Game Start
Port 1 Port 2
[1]
6Player
[2] Port A Port F [7]
ooo
ooo
Port C Port D
[4] [5]
Port 1 Port 2
[7]
6Player
[1] Port A Port F [6]
Port C Port D
[3] [4]
Port 1 Port 2
6Player 6Player
[1] Port A Port F [6] [7] Port A Port F [12]
[1] [2] [3] [4] [5] [6] [1] [2] [3] [4] [5] [6]
[7] [7]
1P 2P 3P 4P 1P 2P 3P
[7] [8] [9] [10] [11] [12] [7] [8] [9] [10] [11] [12]
[1]-[6]
4P 5P 6P 4P 5P 6P
1P 2P 3P
[1] [2] [3] [4] [5] [6] [1] [2] [3] [4] [5] [6]
[7]-[12]
1P 2P 3P 1P 2P 3P
4P 5P 6P
Recommended In all other cases, the connection of the 6Player to the system
Compliance Item does not affect the game.
[1] [2] [3] [4] [5] [6] [1] [2] [3] [4] [5] [6]
[7]-[12]
1P 2P 3P 1P 2P 3P
[1] [2] [3] [4] [5] [6] [1] [2] [3] [4] [5] [6]
1P 2P 3P 1P 2P 3P
[7] [8] [9] [10] [11] [12] [7] [8] [9] [10] [11] [12]
4P 5P 6P 4P 5P 6P
[1] [2] [3] [4] [5] [6] [1] [2] [3] [4] [5] [6]
[7]-[12] [7]-[12]
1P 2P 3P 1P 2P 3P
Ports [7], [9], and [11] are unused active Ports [8], [10], and [12] are unused active
[1] [2] [3] [4] [5] [6] [1] [2] [3] [4] [5] [6]
[7]-[12] [7]-[12]
1P 2P 3P 1P 2P 3P
4P l*
Only port [7] is used. The compatible peripheral, which is assumed to
[9] and [11] are unused active have been connected to port [7], is ignored.
ports. Ports [8], [10] and [12] remain as unused active
ports.
Figure 3.8 Mismatched Port Example 1 Figure 3.9 Mismatched Port Example 2
2P 3P 4P
1P
2P 3P 4P
[2] [3] [4] [5] [6] [7] [2] [3] [4] [5] [6] [7]
2P 3P 4P 2P 3P 4P
[1] [1]
1P
Port [1] reverts to an active port. Port [1] remains an unused active port.
Recommended • Any peripherals that are connected to the LEFT (a side with
Compliance Item a lower port number) of a port assigned with the largest
player number are ignored. That is, the insertion of a
peripheral between 2 pre-assigned player numbers is
prohibited.
Saturn Mouse
Required All Sega Saturn applications that support the Saturn Mouse
Compliance Item must also support operations from the standard Sega Saturn
Control Pad, Virtua Stick, Mission Stick (digital mode).
Compatibility of operations with the 6Player is also required.
While the Control Pad and Button Setup guidelines in the Sega
Saturn Software Development Standards mandate that “all button
presses must have an immediate effect”, compliance with this
requirement is not necessary for the mouse. This is due to the need
to support mouse-specific functions such as “click-and-drag”
operations.
Following are some sample button setups for different game genres:
Button A (L): OK
Button B (C): Cancel
Button C (R): Special function (e.g. open/close special function
windows)
• Example 4: 3D Shooting
• Example 6: Role-Playing
It is required that all software that supports mouse input must also
support input from a standard Sega Saturn Control Pad, Virtua Stick,
and Mission Stick (digital data). Compatibility of operations with
the 6Player is also required. Add the option item below in the
“Options “ screen of the application (see section 7. Options Screen
in the Sega Saturn Software Development Standards for more
information).
Recommended During a system pause, flash a text message or a icon for the
Compliance Item appropriate compatible peripheral on the screen and notify the
user that the active peripheral will be changed to that
compatible peripheral. The application then waits for the
system pause to be cleared.
• In all other cases, use the default setup of each peripheral type.
Required When two players are playing simultaneously, the enabling and
Compliance Item disabling of pause should be allowed from either Control Pad.
In those cases, controller operations for Control Port 1 and
Control Port 2 should be independent (e.g., if a pause is set from
Control Port 1, then it should be disabled only from Control
Port 1).
Resets on the Sega Saturn include a hardware reset via the pressing of
the RESET Button on the main unit and a software reset via the
simultaneous pressing of the A+B+C+START Buttons on the Control
Pad. The outcome of each reset type is governed by its respective
reset handler code functions.
Required If buttons A+B+C and the START Button on the Control Pad
Compliance Item are pressed at the same time, then a reset is executed (In terms
of button input processing, the reset occurs when the START
Button is pressed while buttons A+B+C are depressed.).
Depending on the state of the application during the reset, the
following actions occur:
If a reset is executed during the Title Loop sequence (that is, the
screen changes to the Audio CD Control Screen), high score/pass
word/option settings may be initialized.
Recommended If the Continue function is not selected, then the screen should
Compliance Item return after a preset period of time to the application-based Sega
logo screen (the application-based company logo screen for third
party titles).
A list of all the staff member names to be used in the credits should
be created by the producer before the beta version of the software is
completed and approved by the Sega legal department.
Fonts
While there are no restrictions on the font style used in the credits,
consistency of the typeface and legibility are important.
Cautions
Using Nicknames
Prohibited Items
Copyright-Related Terminology
And Others...
Required All game applications must be coded so that they run only
Compliance Item on Sega Saturn hardware available in the intended sales region
for the software. This hardware territory lockout scheme is
implemented via “Area Codes” set within the game code as
shown below (For more details, consult document number
ST-040, Disc Format Standards Specification Sheet.).
Area Code
Japan NTSC J
Asia NTSC T
(Taiwan, Philippines, republic of Korea)
North/ South American NTSC U
(Canada, Central South America [Brazil], United
States)
East Asia PAL, Europe PAL, Central South America E
PAL
Important! For more details on the Japanese trademark and copyright usage
restrictions, please consult the Japanese version of the Sega Saturn
Software Development Standards as well as your localization service
provider.
The expression “Role Playing Game” in English may also not be used
in Japan.
The terms used in game screens and user’s manuals should conform
to the standard terms shown below in order to maintain consistency
among Sega Saturn applications.
Hardware Terms
backup memory backup memory is the generic name used to describe the backup RAM
contained internally in the Sega Saturn as well as in the Sega Saturn Backup
Memory Cartridge (sold separately).
System Memory System Memory refers to the on-board internal backup memory contained in
the Sega Saturn.
Cartridge Memory Cartridge Memory refers to the memory contained in the Sega Saturn Backup
Memory Cartridge.
Audio CD This refers to the main CD user interface contained in the boot ROM.
Control Screen While it may commonly be referred to as the Multiplayer, control panel, and
BIOS screen, the use of Audio CD Control Screen is preferable.
Memory Manager Memory Manager is the backup RAM utility contained in the boot ROM.
file file refers to the backup data handled by the Memory Manager. The word
item may also be used.
name name refers to the file names handled by the Memory Manager. The words file
name may also be used.
memory available memory available refers to the total amount of backup memory that is
available to the application.
clear clear refers to the Memory Manager function that clears all backup memory
data.
Note: The term “initialize” is not used unless the Sega Saturn’s System
Memory requires initialization. When this operation is necessary, use the
phrase “Clear all data (initialize)”.
load load refers to the loading of backup data from backup memory.
copy copy refers to the copying of backup data from one backup memory type
to another.
remove remove refers to the deletion of backup data from backup memory. delete
is also acceptable.
overwrite overwrite existing item refers to a backup memory operation that will
existing item save one backup data over existing backup data.
change name change name is a Memory Manager function that changes the name of a
backup memory file.
select memory select memory is a Memory Manager function that enables switching between
backup memory types such as the System Memory, Cartridge Memory, and
External Device.
comment A comment is information added to a backup file name that describes its
contents (10 or fewer alphanumeric or Japanese kana characters in length).
time data time data is the time stamp data of a backup memory file created by the Sega
Saturn’s internal clock.
Initialize Memory
Initialization
check Fail
Pass
Fail
Check for Data
Pass
Pass
Display Warning Display Warning
Message Message
Load
Game Start
If either one is not initialized, the user must be notified about the
memory status and instructed to perform initialization directly
from the game application or from the Sega Saturn’s boot ROM-
based Memory Manager screen The game must not be started if
either memory device remains uninitialized.
The Backup RAM BIOS calls must be used when accessing the
backup RAM. The System Memory, Cartridge Memory and External
Device must not be formatted using a backup library function other
than SEGASATURN_BACKUP_FORMAT .
Before the main game starts, check for data that can be used
by the application as well as the remaining memory space of the
System Memory and Cartridge Memory. If the application’s
data does not exist or there is insufficient amount of memory
left to save data, then display the appropriate warning message
(see section 2.8 Warning Messages).
2.3 Load
Example:
Required When multiple save files are required in a game, the first eight
Compliance Item consisting of three characters (the underscore character and 2
numbers) are allowed to change.
The legal ASCII characters that are allowed in file names and
comments are shown in the following table.
Important! The size of each file must not exceed 256K bytes in size if the copy
function in the Memory Manager is used. The copy function in the
boot ROM-based Memory Manager only supports file sizes under
256K bytes. If the file size exceeds 256K bytes, then the copy
function must be supported within the application itself.
2.5 Comments
Required All Sega Saturn memory types must be supported. The backup
Compliance Item memory data must be directly accessible from both the System
Memory, Cartridge Memory, and External Backup Memory
Devices.
Initialize Backup
Memory
Yes No
Go to Memory
Manager Screen
Does data for this No
game already exist in
memory?
Yes
Yes Yes
Yes
Disable Backup
Functions
Game Start
Figure A2.2 Initialization Sequence
• Warning Messages 1
• Warning Messages 2
Required The following warning messages are given to the user when
Compliance Item there is insufficient memory available for saving games (the
only way new files can be written to the system is by deleting
existing files or by overwriting/updating them). The user must
also be notified of the amount of memory required by the
game’s save file.
• Warning Messages 3
Required The following warning messages are displayed when 1) there are
Compliance Item no saved game files for that game, and 2) there is insufficient
memory to save game data. In essence, the save game function
cannot be used in this case. However, the user must always be
given the option to play the game with the save game function
disabled. The user must also be notified of the amount of
memory required to save the game’s backup data file.
User Selects
Backup Data
Display Warning
Load Data
Message 4
Valid
Game Start
• Warning Messages 4
Is memory No
available?
Yes
Display Warning
Message 6
Save Data
Was save No
operation succesful?
Yes
Continue or Quit
Game
• Warning Messages 5
• Warning Message 6
Required This is a message that warns the user not to turn off the power
Compliance Item to the Sega Saturn while saving data. This warning should be
displayed when necessary and appropriate during the game. A
similar warning should also be included in the instruction manual
of the application.
• Multiple discs are referred to as <disc 1>, <disc 2>, and so on. They may
also be referred to as <disc A>, <disc B>, and so on. Make sure there is
right correlation with the application CD label.
• Messages shown in <> are examples. Use them to avoid misleading users.
• The expression "launched" is used with [disc X]. This means "when
playing a game, the first disc inserted is <disc X> and currently this disc
is in the tray."
1. Basic Design
1.1 Specification Conditions
Necessary conditions
• CD check
• <License Sega logo> display
• Pad check
• Application <Sega logo> display
* Note: Skip immediately after the <license Sega logo>
display.
• <Title screen>
* Title logo, <PRESS START BUTTON> display, and (C)
notation.
• Demonstration
• <Start/Options Select Screen>
• <Options>
2. Switching Discs
2.1 Required compliance items and basic
procedures
(The user selects and determines saved data from the disc 2
content.)
2. A display on the game screen prompts Start from disc 2.
3. Reset
The title sequence exists on both discs 1 and 2; therefore, note that the reset
jump destination is partially modified.
• When resetting during the main game, make sure to maintain the
score, Options, and other settings.
4. Save function
4.1 Saving game data when switching discs
To pass game status over several discs, excluding special cases such
as passwords, the only way is to use the backup RAM to save status.
Therefore, all multi-disc applications using the backup RAM must
include specifications to ensure saving game data when switching
discs.
1) Autosave
In applications where game data are saved frequently through
autosave, game data are saved automatically immediately before
inserting a disc. Also, at certain limited points, when the
application calls for autosave, those points must be saved at the
end of play.
2) Arbitrary save
In applications where the user saves data arbitrarily, game data
must be saved immediately before a disc is inserted.
In applications using the save function for reasons other than moving
to a second disc, ensure the following warning message:
During the story line, for the user, these screens are distractions to the
flow of the game. Therefore, we recommend the following specs to
minimize these procedures:
• When using these specs, the user must be very careful not to
turn off power while leaving <transition state data> behind
(when the <disc 1> play is ended, care must be taken so that
when the power is turned off, the flow transition is not
adversely affected.
Sample Game
Program
User's Manual
Doc. # ST-159-R1-092994
1. Introduction ............................................................... 3
2 Overview ................................................................... 4
3. Game Sequence ....................................................... 5
4. Basic Function Program ......................................... 10
5. Action Control ......................................................... 12
6. Directory Structure, File Name,
Function Name, Variable Name.............................. 18
7. Compile/Execute Procedure ................................... 19
8. SIMM/VCD Compatibility ........................................ 20
2
1. Introduction
This sample program is located in the SEGAGAME directory. The sample program
structure is shown in Figure 1; however, this manual breaks it up into the following
classifications.
Game Sequence
These are display, Sega logo display, title display and program select in Figure 1.
These are common for most games.
Action Control
This is the 2D shooting game and a game demo is shown in Figure 1. The manual
explains how to create the action game in this section. The program that expresses
the action including the player (own machine), enemy (other machine), (collision
check), background scroll, etc., is also covered. This action is controlled by the
action control program.
4
3. Game Sequence
Figure 2 shows the game sequence in flow chart form. This flow is controlled within
the program by status flags called game mode variables.
void main(void)
{
SMMA_IniSystem(); /* System Initialization */
SMVl_SprCmdStart();
SMVl_SprCmdEnd();
SCL_DisplayFrame();
SMMA_MainMode = LOGO_MODE;
SMMA_Mainlevel = 0;
Depending on the game mode variables in the main function, different subroutine
functions are called up and used repeatedly. The game mode variable determines
the following operation states. Because the game mode variable is defined as an
external variable, the status can be changed from any of the subroutines. The
LOGO_MODE is held as the initialization value, so start the system at the SEGA
Logo display. The contents of the various subroutine processes are shown below.
6
SMMA_IniSystem() Initialize
Initializes the system as shown in Figure 3. Initialize the hardware, etc. within the
system initialization process.
8
SMSL_ModeSel() Execute Program Select
The program select screen is displayed as shown in Figure 6. Use the D-pad to
select, and C button to execute the sample program, game program, etc.
After the program ends, the game mode variables are set to SELECT_MODE before
return so the Program Select is executed unconditionally. When EXIT is selected, the
game mode variable is set to LOGO_MODE, and returned, so the transition occurs
to the Sega Logo display unconditionally.
The basic function program is executed by selecting as scroll sample, sprite sample,
window sample, or game sample from the game sequence program select. At first, a
selection screen similar to the program selector screen appears. Use the D-pad to
select, and the C button to execute.
The scroll sample, sprite sample and window sample menus have the items shown
below. Each item in these menus is configured to allow a simple program to be
created.Refer to the source code for the contents of each program.
Scroll Sample
1. BITMAP SCROLL
Draws points, lines and boxes. (Uses NBG0, bitmap format, RGB32768-color mode.)
2. NORMAL SCROLL
Scrolls up, down, left, and right. (Uses NBG0, cell format, 256-color mode.)
3. LINE SCROLL
Scrolls while shaking in vertical and horizontal directions. (Uses NBG0, cell
format, 256-color mode.)
4. MULTI SCROLL
Displays several layers simultaneously by giving a priority to the scroll. (Uses
NBG0~3, each surface is cell format, 16-color mode.)
5. LINE COLOR SAMPLE
Calculates the color for each line, lowering the translucency rate as it gets closer
to the center of the screen.
6. ROTATE SCROLL
Rotates scroll at an angle horizontally and vertically. (Uses RBG0, cell format,
256-color mode.)
7. <EXIT>
Sprite Sample
1. POLYGON TEST
2. POLYLINE TEST
3. TEXTURE TEST
Rotates, enlarges and reduces polygons, polylines, and textures. (Changes the
content of the sprite structure.)
4. HENKEI TEST
Scales the peripheral of the sprite. (Defines 4 points and transforms the inside
texture.)
5. LINE TEST
Moves lines in the screen while changing colors. (Sets the position of 4 points
and the move speed and varies the texture within.)
6. SHADOW TEST
Displays the sprite or polygon as a shadow. (Displays a normal or MSB shadow
while the sprite automatically calculates color while fading in and fading out.)
10
7. SPRITE TEST
Rotates, enlarges and reduces the texture while moving it around.
8. SHADING TEST
Adds different shades to each of 3 cubes. (Adds “no shading,” “flat shading”
and “Gouraud shading.”)
9. 3D TEST
Rotates, enlarges and reduces a polygon.
10. <EXIT>
Window Sample
1. NORMAL BOX WINDOW
Displays a rectangular window.
2. NORMAL LINE WINDOW
Displays a line window.
3. SPRITE WINDOW
Displays a texture form window.
4. 3WINDOW SAMPLE
Displays all windows.
5. <EXIT>
Game Sample
2D Shooting Game.
What is Action
A method called action is used in the 2D shooting game included in the sample
games to provide quasi-multitasking. Action is a function that processes the action
and player, enemy, shots, and background scroll in 1 cycle.
This function is registered individually (makeaction) and the registered functions are
run at the same time in a loop (actionloop) and executed to realize quasi-
multitasking. This sample is supplied in smp_task.c and smp_tash.h and is used in
most of the sample programs.
12
Figure 7 Basic Structure and Exclusive Structure
[Function]
void *SMTA_MakeAction(void) *execadd)
This function searches for unused actions (id=0) and registers the executable address
to the pcbuff. It then changes the action to active (id=1). In this function, the action
number within the array is undefined. This causes problems when action informa-
tion is compared. Shot and player collision (hit determination) is one example. If
the order needs to be controlled, use the following function.
void SMTA_ActionLoop(void)
Searches, in order, from the beginning of the array to the end, executing all of the
active actions. The pointer to the action structure is passed to the action as an argu-
ment.
[Macro]
SMTA_DefActWk( actname, member)
Declares an exclusive action structure. This entails using a free set member. Refer to
the program below for an example. This macro does nothing more than declare the
structure by governing the action structure information uses.
SMTA_CheckAction(ACTWK *ptr)
This macro has a true (1) value when an action was registered and a false (0) when it
did not. Refer to the example below for the usage.
[Example]
ACTWK *ptr;
SMTA_KillAction(ACTWK *ptr)
This macro changes the action to inactive by writing a 0 to the id, and normally is
described during action, and by self set action to non-action. That action will not
execute in the next actionloop.
[Example]
void PlayerAct(ACTWK *ix)
{
if (Deadflag)
SMTA_KillAction(ix);
}
14
Example of Action Control
Shows an actual example of use.
/*
* Variable definition
*/
Uint8 Mainlevel;
Uint8 Gameover;
SMTA_DefActWk(GAMEACT,
SPRITE sprite; /* SPRITE DISPLAY */
Sint16 wreg[4]; /* Universal use register
Sint16 wcnt[4]; /* Universal use counter */
Uint8 colino; /* collision table index */
Uint8 coliatr; /* collision attribute */
Uint8 coliflg; /* collision flag */
Uint8 atp; /* kougeki ryoku */
Sint16 hp; /* hit point */
); /* Declares exclusive action structure GAMEACT */
/*
*
*/
void GameMain(void);
void PlayerAct(GAMEACT *);
void EnemyAct(GAMEACT *);
void ScrollAct(GAMEACT *);
/* ####[Action Example
void GameMain(void)
{
enum {
INIT, MAIN,
};
Mainlevel = INIT;
Gameover = 0; /* Game end flag */
for(;;) {
intWait(); /* Wait for V blank */
switch(Mainlevel) {
case INIT;
InitVdp(); /* Initialize VDP */
SMTA_ActWkInit() /* Initialize action work
SMTA_MakeAction(PlayerAct);
/* Set player action */
SMTA_MakeAction(EnemyAct);
/* Set enemy action */
SMTA_MakeAction(ScrollAct);
/* Set background action */
Mainlevel++;
case MAIN:
SMTA_ActionLoop();
if (Gameover) Mainlevel++;
break;
case EXIT;
return;
}
}
}
switch(ix->level) {
case INIT:
/* Initialize player coordinates, etc. */
ix->level++;
case MAIN:
/* Move player
/* Collision judgment
break;
}
}
16
Using V Blank
The game main processing structure is similar to the game sequencing structure.
Included in that is the intWait function. The intWait function includes the screen V
blank. There are two main reasons why the action loop is after V blank wait:
1) Reduces Flicker
By executing the action after the V blank hold, the next object on the frame will
have a new area to be displayed. If an object were to move between screen
displays, the scanning line position and moving direction would cause poor
display. Figure 8 shows this condition. (a) is displayed correctly because “move-
ment” occurs during V blank, but (b) and (c) have movement during scanning
causing two objects to be displayed at the same time, or nothing at all to be
displayed.
2) Timing
Correct interval timing is required to get the character or background to move at
a fixed (constant) speed. V blank can be handled at intervals of 1/60 of a second.
Therefore, even if variation occurs by an amount equal to the processing of a
single action loop, the motion speed can be kept constant (at a fixed speed).
However, if the action loop cannot be completely processed during 1 frame, it
cannot be used as an accurate timer.
saturn
saturn
segalib
segalib
segasmp
segasmp
segadat
segadat
segabin
segabin Main Processing
segagame Main Processing
segagame
game2d
game2d
scroll
scroll
sprite
sprite
window
window
sound
sound
cgdata
cgdata
All file names start with “smp_ ”. Also, external variables and external functions
start with “SM??_”. See the table below for specific examples.
18
7. Compile/Execute Procedure
Compiling Procedure
PC Version
Execute smpmk.bat in the saturn/segagame directory.
C:/saturn/segagame>smpmk.bat [ENTER]
WS Version
Make smp.mk in the segagame directory.
saturn/segagame% make -f
Execute Procedure
PC Version
Execute the following commands from the debugger command line.
Command Comment
rs [ENTER] Reset the ICE.
g [ENTER] Execute the BOOT ROM. If it won’t
boot up, reset the target.
l ;r:smp.abs [ENTER] Load the sample program.
g 06010000 [ENTER] Execute the sample program.
WS Version
Execute the following commands from the debugger command line.
Command Comment
rs [ENTER] Reset the ICE.
g [ENTER] Execute the BOOT ROM. If it won’t
boot up, reset the target.
ftp WS name or IP address [ENTER]
User name [ENTER]
Password [ENTER]
ll ;r:smp.abs [ENTER] Loads the sample program.
g 06010000 [ENTER] Executes the sample program.
With normal software, data is not loaded (read) at the same time into work memory
when it is executed, but is broken into modules which are read into memory each
time it is required. The blocks that are resident in the work memory are only for
initializing, reading, and executing each module. That resident block is called a
kernel.
Actual game software is stored in a CD-ROM or cartridge ROM, and after (launch-
ing) reset, is in a form to be partitioned and loaded. This is emulated by SIMM or
VCD. Using a sample program as an example, modularization will be explained.
An image of the work memory when the sample program is partitioned into mod-
ules is shown in Figure 10. Also, a listing of the kernels and modules in the sample
are shown below.
Kernel
smp_krnl.bin
Modules
logo.bin
titl.bin
wind.bin
scrl.bin
gm2d.bin
sprt.bin
d214.bin
These programs are found in the segagam1 directory. Here, the rof2bin is used
during “make” to convert the kernel and module abs format file to a bin format.
Also, mfcat is used to convert each bin file to a SIMM file.
20
06000000 System
06002000 IP.BIN
06010000 Kernel
(Initialization, Main Menu)
is resident
06080000 Module
(One of Logo,
Title,
Sprite,
Scroll,
Window,
and Game)
enters as
nonresident.
Executing Procedure ia
V SIMM File
1. Program Make
WS Version make -f smp.mk[ENTER]
PC Version smpmk.bat[ENTER]
This will make a smp.lod that can be executed in a SIMM.
After a brief display of the Sega logo, the sample game is executed.
Start the VCD by moving the programming box switch to the VCD side and
executing the following commands.
chev us [ENTER]
vcdemu btsmpfs [ENTER]
Press any key at the first message and verify that SEEK2 is displayed in the
command column.
3. Program Execution
rs [ENTER]
g [ENTER]
The sample game will start after the Sega logo is momentarily displayed.
In both SIMM and VCD, rs and g start the boot ROM and execute read IP.BIN from
SIMM or VCD. The sample is executed by reading the kernel from IP.BIN.
1. PC Version
SYMADD.EXE Map File Name [ENTER]
2. WS Version
awk -f kiri.awk Map File Name [ENTER]
22
Figure 11 Module Partition Procedure
Action ....................................................................................... 12
Action Control ..................................................................... 4, 12
Basic Function Program ........................................................... 4
Compile Procedure ................................................................. 19
Execute Procedure .................................................................. 19
Game Sample........................................................................... 11
Game Sequence ......................................................................... 4
Module Classification ............................................................ 22
Scroll Sample ........................................................................... 10
SMLO_SegaLogo() Sega Logo Display .................................. 7
SMMA_IniSystem() Initialize.................................................. 7
SMSL_ModeSel() Execute Program Select ............................ 9
SMTI_Title- Title Display ......................................................... 8
Sprite Sample........................................................................... 10
V BLANK ................................................................................. 17
Window Sample ...................................................................... 11
24
TM
Sample Data
User's Manual
Doc. # ST-160-R1-092994
CONTENTS
Introduction .......... 3
Font File ................. 4
2
Introduction
“Sample data” is data that is collected so that both application software and sample
programs can use it.
This version provides the font library.
These are bit mapped fonts that are used to display characters on the game machine.
The fonts supplied include an 8 X 16 dot, a 1 byte code font and a 16 X 16 dot 2 byte
code kanji font.
• Font Specifications
- 1 byte code Font 8 X 16 dot ASCII Font
Symbol Font
Katakana font
- 2 byte code Font 16 X 16 dot JIS 1 STANDARD KANJI Font
JIS 2 STANDARD KANJI Font
• Font Format
- ASCII.FON, KANA.FON
Font data is in 16 byte units starting at the start of the file.
Character Code 00h 01h 02h FFh
- KANJI.FON
These are JIS 1 and 2 STD KANJI Fonts. Font data is in 32 byte units from
the start of the file.
4
• Font Code Table
Code tables for ASCII.FON and KANA.FON are shown in Tables 1 and 2.
Offset 1 byte
Address
00h
01h
02h
0fh
• KANJI.FON
The 2 byte code font is expressed by 16 bits X 16 and the significant address from
the top is allocated in the order of left to right.
1 byte 1 byte
Offset +0 +1
Address
00h
02h
04h
1fh
6
TM
Doc. # ST-040-R4-051795
In translating/creating this document, certain technical words and/or phrases were interpreted
with the assistance of the technical literature listed below.
Introduction ...................................................... 2
1.0 Disc Format Overview ............................. 3
2.0 Physical Disc Format .............................. 5
3.0 Logical Disc Format .............................. 14
4.0 Boot System .......................................... 24
Appendix Various Sample Code Listings ...... 33
2
1.0 Disc Format Overview
1.1 Features
The physical format of the SEGA SATURN Game-CD for this game device conforms
to the Semi CD-ROM XA standard for this game. As a result, an interleave record
that has always been dependent on the application can be recognized as the system,
and images and sound can be played concurrently.
“Semi CD-ROM XA” : CD-ROM XA with Model 1 track
4
2.0 Physical Disc Format
The physical format conforms to the CD-ROM standard (Yellow Book) and CD-
ROM XA standard. Items within these standards that are particularly restricted by
SEGA, as well as those required for application development, are described in this
section.
Information Area
Inside Lead-in Information Area Lead-out Outside
Disc Lead-in Program Lead-out
Area
Area ProgramArea
Area Area
Area
CD-ROM
CD-ROM CD-ROM XA
CD-ROM XA CD-DA
CD-DA
Area
Area Area
Area Area
Area
Tracks 2 to 99
• Track number
The CD-ROM area track number is 01. The CD-ROM XA area track number can
be set from 02 to 98 consecutively. The CD-DA area track number is from 02
when there is no CD-ROM XA area. When there is a CD-ROM XA area, it can be
set from the next track number continuously up to 99. Do not arrange track
numbers discontinuously. One track must be at least four seconds.
!! Except for the pause area, the pre gap, and post gap areas, 1 track requires 4 seconds or more.
• CD-DA tracks
Data of at least one song must be placed in the CD-DA area. When CD-DA data
is not required, a warning message like “This CD is a Game-CD. Please play this
disc on a dedicated game machine” should be entered. When the audio CD player is
turned on, it’ll display what CD it is. This message is not required when there is
data for at least one song. The user may also play the CD to listen to songs only.
6
Recording Range of the Program
Area
Track image diagram when data track is maximized (audio track is minimized)
Lead-in
Lead-in Lead-out
Lead-out
TNO
TNO
00 00 01 01 02 02 AA AA
X X
00 00 01 01 00 00
01 01 01 01
A/D
A/D Data Data Audio Audio
Data Data Audio Audio
TIME
TIME
63:04:00
00:02:00
(start sector)
00:02 63:00:00 63:04:00
(first sector) 62:58:0063:00:00
00:00:00 62:56:00 62:58:00
00:00:00 (post62:56:00
gap start)
(post gap start)
• The usable data sector is from the start sector up to 1 sector before the post gap
begins (about 566 MB.) 9 MB of data sectors are used up for every 1 minute
increase of the audio track usage time.
8
Figure 2.4 shows the relationship between the access key and track structure in order
to explain the meaning of the frame address.
Point = A0 Point = A0
PSET = 00PSET = 00
ATime (note)
ATime (see (note)
note)
Mode Mode 01 01 02
Header Header
(Min, Sec,(Min, Sec,
Frame) Frame)
Logica lSector
LogiNumber
LogicSector cSector
Number Number
(LSN) (LSN)
Frame Frame
Address Address
(FAD) (FAD)
2352 bytes
2340 bytes
2336 bytes
12 4 2048 288 bytes
CD-ROM Sector
Synchro- Header User
UserData
Date EDC/ECC etc.
ECD/ECC
Mode 1 nization
12 4 8 2324 4 bytes
CD-ROM XA Sector Sub- EDC
User ECD
Synchro- Header header User Data
Date etc.
etc.
Mode 2 Form 2 nization
Header Subheader
Recurring 4 byes
MIN SEC FRAME MODE FN CN SM CI
FN CN SM CI
1 byte * FN:
CN:
FileNumber
File Number
CN: Channel
ChannelNumber
SM: Sub Mode
Number
SM: Sub Mode
CI: Coding Information
CI: Coding Information
10
2.4.1 Header Field
The header field is composed of the sector address (absolute time) and mode byte.
The configuration of the header field is shown in Table 2.2.
A deviation may occur between the ATIME value of the subcode Q channel and
sector address inside the header. Therefore, the header value, not the subcode Q
channel, should be used when specifying a sector.
Channel 1
(Picture)
Channel 2 Sector
(Japanese) J1 J2 J3 J4 J5
Interleave
Channel 3
(English) E1 E2 E3 E4 E5
Sector
J1 E1 J2 E2 J3 E3 J4 E4 J5 E5
Channel Number 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3
(3) Submode
Submodes are used in synchronization, ending files or records, and for sector
assignments in the system. The submode byte configuration is listed in Table 2.4.
12
Data (D): Set to 1 for sector data related to the program.
When this bit is 1, the Form bit must be 0.
Audio (A): The audio sector is set to 1.
When this bit is 1, the Form bit is also set to 1.
Video (V): The video sector is set for 1.
End of Record (EOR): 1 is set when the last sector of a logical record is
reached.
When bits 1, 2, and 3 (Video, Audio, Data) are used simultaneously, only one
can be set to 1. In addition, either bit 1, 2, or 3 must be set to 1 for all sectors,
excluding the empty sector.
3.1 Overview
The CD-ROM area and CD-ROM XA area are comprised of a system area and a data
area. To describe the disc volume/file structure, a volume descriptor set, directory,
and path table are recorded at the start of the data area (Figure 3.1).
The system area, volume descriptor set, root directory, and path table must be re-
corded on the Mode 1 track.
LSN 0 16
FAD 150 166
ATIME 00:02:00 00:02:16
Mode 1 Mode 2
Data Area
System File File
Area
Volume
Volume Root
BOOT Descriptor Path File File File
System Descriptor Directory Table 1 2 1
Set
Set
Record to
Record to Mode Track 1
Mode Track 2
14
3.2 Volume / File Structure
• Overview
The volume/file structure conforms to the ISO9660. Information is added to the
directory record system area.
• Abbreviations Express Types of Data
The following abbreviations are used for the volume/file structure.
NL Least Significant Byte First LSBF notation 16/32 bit binary numeric
value Ex: recorded as hexadecimal 1234
→ 34 12
NM Most Significant Byte First MSBF notation 16/32 bit binary numeric
value. Ex: recorded as hexadecimal 1234
→ 12 34
00 Zero fill Not used. Fill the reserve areas, etc., with
(00)
Sub-
Sub-
directory
n directory
n
Patent
Parent
Directory Number
Directory Number
Patent
f3 f3
• •Directory
DirectoryBlock
Block Addres
Address s
f 3f 3
• Parent Directory Number er
• Parent Directory Numb
• •Directory
DirectoryName
Name Sub-
Sub-
directory
directory
Sub-
Sub-
directory
directory
Patent
Parent
Patent
• File
• File StartStart Sector
Sector Address
Address
• Directory
• DirectorRecord
y Record • File SizeSize
• File
• File Name
• File Name
• System
• System Info.Info.
when in Mode
when 2 2
in Mode
(File(File
Number,
Number, Form Info.,Info.,
Form etc.)etc.)
• Volume Descriptor: Arranged from the start of the data area. Fixed length
by type.
• Path Table: Set of Path Table Records.
Path Table size and address are recorded in the volume
descriptor.
• Path Table Record: Corresponds to one directory (root, sub).
The record position is the directory number (1 to n).
Directory information is described in the directory block.
• Directory Block: Set of Directory Records.
A directory block is considered as one file (directory file.)
The size of the directory block is recorded in the directory
record file size of the block start (size of own directory file.)
• Directory Record: Corresponds to one file (including directory.)
16
3.2.1 Volume Descriptor Set
The volume descriptor set is a group of volume descriptors recorded in a sector from
logical sector number 16. The following are the five types of volume descriptors.
The volume section descriptors are not used.
Volume
Volume Descriptor
Descriptor Type
Type
Standard
Standard Identifier
Identifier
Volume
Volume Descriptor
Descriptor Version
Version Number
Number
1 2 77 88
CD001
CD001 Differsaccording
Differs accordingto to type
type of of descriptor
descriptor
88 39394040 7171
72 72 2048
2048
Boot
BootSytem
Sytem Boot
Boot Not
Without
Without
Boot Record 00 CD001
00 CD001 Identifier
Identifier Identifier
Identifier Description
Defined
Definition
Primary Volume
Descriptor
Boot Record 01 CD001
01 CD001 See
SeeTable
Table3.3
3.3
Supplementary
Volume
Primary Volume 02 CD001 See Table 3.4
Descriptor
Descriptor 02 CD001 See Table 3.4
Volume Section
Supplementary 03 CD001 Not used
used in
in Saturn
SATURN Game
Game DiskDisk
Descriptor
Volume 03 CD001 Not used in Saturn Game Disk
Descriptor
Volume Descriptor
Valume
SetDescriptor
Terminals FF CD001 00
Set Terminals FF CD001 00
1. Boot Record
! In a normal Game-CD, the primary volume descriptor and volume descriptor set
! terminal are each recorded by 1 sector. These two sectors must be recorded.
!! The supplementary volume descriptor and boot record should be used after usage method
is well understood.
The areas below are defined as disc labels with the CD-ROM XA standard.
Table 3.4 CD-ROM XA Disc Labels
Byte Position Type Field Name Remarks
1025 - 1032 Identifying Signature "CD-XA001"
1033 - 1034 CD-ROM XA Flags Reserved area
1035 - 1042 D Startup Directory Start up directory name
1043 - 1050 00 Reserved Reserved area
18
3. Supplementary Volume Descriptor
A volume descriptor set contains any number of supplementary volume descrip-
tors. The supplementary volume descriptor describes volume attributes, root
directory position, positions of path table set, and others. When using Japanese,
identifiers such as the volume name and publisher identifier are recorded in the
supplementary volume descriptor. Table 3.5 lists the details of a supplementary
volume descriptor.
88characters
charactersor
orless
less
33 charcters
charactersororless,
less,can
canbebeabbreviated
abbreviated
1
1~~ 32767
32767 (Always
(normallyset
settoto1)1)
File Identification
File Identification File Name
File Name .Extension
Extension ; Version
Version Number
Number
Delimiter Charactor: 2
Delimiter Character 2
Delimiter Character 1 1
Delimiter Charactor:
Directory Name 8 characters or less
Directory Name-----8 (In
characters
the root or less
dictionary, 1 byte = $00H)
(In the root dictionary, 1 byte=00H)
20
• Format of Recorded Date and Time
• File Flag
0 Existence
1 Directory
2 Associated File (=0)
3 Record (extend attribute record
structure file)
4 Protection File (=0)
5 Reserved
6 Reserved
7 Multi-Extent File (=0)
• File Identification
Filename or directory name is stored according to the value of the File
Flag Directory bit (bit 1).
Directory bit = 0: Specifies identification information for file.
The length of the file identification is an even number; 1 byte (00H) is filled in.
• Attribute bits
0 Owner Read
1 Reserved
2 Owner execute
3 Reserved
4 Group read
5 Reserved
6 Group execute
7 Reserved
8 World read
9 Reserved
10 World execute
11 File contains Form 1 sectors Includes Form 1 sector
12 File contains Form 2 sectors Includes Form 2 sector
13 File contains interleaved sector Includes interleave sector
14 CD-DA file CD-DA file
15 Directory Directory file
Byte
Position Type Field Name Remarks
1 N Length of Directory Identifier Length of Directory Name
2 N Extended Attribute Record Length
3– 6 N Location of Extent LSN of start extent
7– 8 N Parent Directory Number Parent Directory Entry
Number
9 – (8+ D1 Directory Identifier Directory Name
LEN_DI)
9+LEN_DI 00 Padding Field Only when Directory Name is
an odd number.
22
3.3 User File
The user file is arranged in the data area. A single file is not necessarily organized
continuously, as it is generally interleaved. The Mode 2 sector mixes Form 1 and
Form 2 , and all sectors are converted to 2048 bytes. For convenience, the Mode 1
sector is handled in form as a Form 1 sector with a 0 subheader. Form 2 sector data
must be in 2324 byte units, fractional bytes are not permitted.
This material provides rules that must be followed when application software uses
the boot system. CDs that do not follow these standards are not recognized as a
SATURN Game-CD. All application software run by the SATURN must follow these
standards.
This material is an extract of the disc format standard specification, and only par-
ticularly important information is listed. Be sure to read the contents of the disc
Format Standard Specification as well.
24
4.1 System Area
The system area is placed at the beginning of the CD-ROM. System information
used during application start-up is written in the system area.
The system information and the initial program must be placed continuously within
the system area as the IP. The IP consists of the boot code and application initial
program (AIP). The boot code includes ID data, such as the game name, and secu-
rity code. Code such as the initial program is contained in the AIP.
4.2 System ID
This data is placed at the start of the system area.
0 1 2 3 4 5 6 7 8 9 A B C D E F
00H Hardware Identifier
10H Maker ID
20H Product Number Version
30H Release date Device information
40H Compatible area symbols Space
50H Compatible peripherals
60H Game Title
70H
80H
90H
A0H
B0H
C0H
D0H Reserved
E0H IP Size Reserved Stack-M Stack-S
F0H 1st Read Address 1st Read Size Reserved Reserved
Figure 4.1 System ID Structure
Basic Information
Usable Characters
All of the characters that can be used within the System ID are ASCII code English
alphanumeric characters. However, “./-:” can be used depending on the item.
All upper case and lower case characters can be used if nothing is specified.
Entering Data
• Characters are left justified unless otherwise specified. No space is inserted at
the beginning.
• All empty areas are filled in with the ASCII "space" character code 20H unless
otherwise specified.
Expression definition: “ ∆” and/or spaces in the following descriptors are con-
sidered to be ASCII code 20H.
Other Rules
RESERVED areas must be filled in with 00H.
26
Version (Start address: 2AH)
Definition: Enter the application version.
Usable characters: Upper case “V”, numbers, and “.” (period).
Number of characters: 6 characters
Entry rules: Must start with “V” followed by a 1 digit number, followed
by a “.”, and 3 digit numbers.
The final release is V1.000
Entry example: For a sample disc: “V0.801”
For a master disc: “V1.000”
Note: The area code that corresponds with the region entered here must be entered in the area
code group. (See “4.5 Area Code”)
28
IP SIZE (Start address: E0H)
Definition: Specifies the size (byte number) of the Initial Program (IP).
Size: 4 bytes.
Rules: AIP is placed immediately after the boot code, creating a
single file, and the size of the file is specified. Parameters
must be all long-word aligned (multiples of 4H).
Range: 1000 ~ 8000H
The relationship of the corresponding area symbol with the hardware sales region
and area codes are as follows.
30
4.6 Application Initial Program
This program is executed immediately after the area code is executed by placing it
after the area code group. The program then advances under the control of the
application.
SYSTEM ID Chcek
I
SEGA SATURN Security Code Check
SEGA SATURN Logo I
Logo Display Process Area Code Check
I
IP Load
AIPLoading
AIP loaded
is being AIP
loaded
• SYS_ID.SRC
This is an assembler source program for SYSTEM ID creation.
Change according to the application. (See “4.3 SYSTEM ID Description")
Be sure to place at the start of the program.
The file below is a sample source program:
\SATURN\SEGASMP\SYS\SYS_ID.SRC
• SYS_SEC.OBJ
Security code object file. (See “4.4 Security Code”)
Link and build as is.
• SYS_ARE?.OBJ
Area code object file. (See “4.5 Area Code”)
Link and build as is.
IP Placement
The IP size can be created within a range of the minimum sector and the maximum
16 sectors. If the required IP size is 8 sectors or less, multiple IPs can be recorded in
order to improve reliability. Make sure that each IP is at the starting sector bound-
ary. This increases the chances of startup even if a failure occurs when reading the
first sector.
32
APPENDIX Various Sample Code Listings
;=======================================================================
; smp_id0.src — System ID for SEGA (Ver. 1994-11-11)
;=======================================================================
.SECTION SYSID, CODE, ALIGN=4
;
.SDATA “SEGA SEGASATURN “ ;00: hardware identifier (cannot change)
.SDATA “SEGA ENTERPRISES “ ;10: maker ID
.SDATA “999999999 V1.000 “ ;20: product number, version
.SDATA “19941122CD-1/1 “ ;30: release date, device information
.SDATA “JTUE “ ;40: compatible area symbol
.SDATA “J “ ;50: compatible peripheral
.SDATA “GAME TITLE “ ;60: game title
.SDATA “ “ ;70:
.SDATA “ “ ;80:
.SDATA “ “ ;90:
.SDATA “ “ ;A0:
.SDATA “ “ ;B0:
.SDATA “ “ ;C0:
.DATA.L H’00000000, H’00000000, H’00000000, H’00000000 ;D0:
.DATA.L H’00001000, H’00000000, H’00000000, H’00000000 ;E0:
.DATA.L H’06010000, H’00000000, H’00000000, H’00000000 ;F0:
;
.END
;======== End of file ==============================================
;=======================================================================
; smpsys. lnk — SH Linkage Subcommand File for IP (Ver. 1994-11-11)
;=======================================================================
Input sys_id.obj
Input .. \ .. \segalib\lib\sys_sec.obj
Input .. \ .. \segalib\lib\sys_arej.obj
Input .. \ .. \segalib\lib\sys_aret.obj
Input .. \ .. \segalib\lib\sys_areu.obj
Input .. \ .. \segalib\lib\sys_aree.obj
Input .. \ .. \segalib\lib\sys_init.obj
Input smpsys.obj
STart SYSID (06002000)
Output
Print sys_ip.map
EXIT
;======== End of file ==============================================
34
;=======================================================================
; sample0.scr — CD-ROM (Ver. 1994-11-11)
;Note: CD-ROM (MODE1 + CD-DA) Disc Sample Script.
; Use Ver. 3.10 or later for versions VCDPRE and VCDBUILD.
; R: Required
; O:
; NC: No change, cannot change parameters (Please use without changing)
; CP: Can change parameters
;
; A command name heads the beginning of each line. Please use unchanged.
;=======================================================================
Define dirsmpdisc .\sample\ ; O CP
Disc sample0. DSK ;R CP
Session CDROM ;R NC
LeadIn MODE1 ;R NC
EndLeadIn ;R --
;
SystemArea [dirsmpdisc]sys_ip.bin ;R CP
;
Track MODE1 ;R NC
Volume ISO9660 sample0.PVD ;R CP
PrimaryVolume 00:02:16 ;R NC
SystemIdentifier “SEGA SEGASATURN” ;R NC
VolumeIdentifier “SAMPLE_GAME_TITLE” ;R CP
VolumeSetIdentifier “SAMPLE_GAME_TITLE” ;R CP
PublisherIdentifier “SEGA ENTERPRISES, LTD.” ;R CP
DataPreparerIdentifier “SEGA ENTERPRISES, LTD.” ;R CP
CopyrightFileIdentifier “SMP_CPY.TXT” ;R CP
AbstractFileIdentifier “SMP_ABS.TXT” ;R CP
BibliographicFileIdentifier “SMP_BIB.TXT” ;R CP
VolumeCreationDate 22/11/1994 00:01:02:00:36 ; O CP
VolumeModificationDate 22/11/1994 00:01:02:00:36 ; O CP
EndPrimaryVolume ;R --
EndVolume ;R --
;
File SMP_CPY.TXT ;R CP
FileSource [dirsmpdisc] smp_cpy.txt ;R CP
EndFileSource ;R --
EndFile ;R --
File SMP_ABS.TXT ;R CP
FileSource [dirsmpdisc]smp_abs.txt ;R CP
EndFileSource ;R --
EndFile ;R --
File SMP_BIB.TXT ;R CP
FileSource [dirsmpdisc]smp_bib.txt ;R CP
EndFileSource ;R --
36
;=======================================================================
; sample1.scr — CD-ROM XA (Ver. 1994-11-11)
;Note: CD-ROM XA (MODE1 + MODE2 + CD-DA) Disc Sample Script.
; Use Ver. 3.10 or later for versions VCDPRE and VCDBUILD.
; R: Required
; O:
; NC: No change, cannot change parameters (Please user without changing)
; CP: Can change parameters
;
; A command name heads the beginning of each line. Please use unchanged.
;=======================================================================
Define dirsmpdisc .\sample\ ; O CP
Disc sample1. DSK ;R CP
Session SEMIXA ;R NC
LeadIn MODE1 ;R NC
EndLeadIn ;R --
;
SystemArea [dirsmpdisc]sys_ip.bin ;R CP
;
Track MODE1 ;R NC
Volume ISO9660 sample1.PVD ;R CP
PrimaryVolume 00:02:16 ;R NC
SystemIdentifier “SEGA SEGASATURN” ;R NC
VolumeIdentifier “SAMPLE_GAME_TITLE” ;R CP
VolumeSetIdentifier “SAMPLE_GAME_TITLE” ;R CP
PublisherIdentifier “SEGA ENTERPRISES, LTD.” ;R CP
DataPreparerIdentifier “SEGA ENTERPRISES, LTD.” ;R CP
CopyrightFileIdentifier “SMP_CPY.TXT” ;R CP
AbstractFileIdentifier “SMP_ABS.TXT” ;R CP
BibliographicFileIdentifier “SMP_BIB.TXT” ;R CP
VolumeCreationDate 22/11/1994 00:01:02:00:36 ; O CP
VolumeModificationDate 22/11/1994 00:01:02:00:36 ; O CP
EndPrimaryVolume ;R --
EndVolume ;R --
;
File SMP_CPY.TXT ;R CP
FileSource [dirsmpdisc] smp_cpy.txt ;R CP
EndFileSource ;R --
EndFile ;R --
File SMP_ABS.TXT ;R CP
FileSource [dirsmpdisc]smp_abs.txt ;R CP
EndFileSource ;R --
EndFile ;R --
File SMP_BIB.TXT ;R CP
FileSource [dirsmpdisc]smp_bib.txt ;R CP
EndFileSource ;R --
EndFile ;R --
38
;
; Track ~ EndTrack ; O CP
;
LeadOut CDDA ;R NC
Empty 500 ;R NC
EndLeadOut ;R --
EndSession ;R --
EndDisc ;R --
;======== End of file ==============================================
Tone Editor
User's Manual
Addendum:
File Formats
Doc. # ST-235-030795
SCSP Format
First, SCSP is entered as an ID in 4 bytes of ASCII code, after which the total number
of bytes of the MixerChunk and VoiceChunk is contained as a 4 byte long word. Next,
VOCE is entered in 4 bytes of ASCII code as Type. The MixerChunk and VoiceChunk
data follow.
48
MixerChunk
This data is equivalent to the 16 channels of the mixer, and becomes the MixerChunk
data with the header data. MIXR takes up 4 bytes in ASCII code for the header ID,
after which the number of mixer data bytes is entered in 4 bytes. It can have mul-
tiple mixers.
Mixer
Bits 0~4 are pan data and 5~7 are send/return data. This configuration is the same
as the SCSP register, and is equivalent to 100017H if slot 0.
The VoiceChunk data is composed of the layer data that contains voice parameter
data as well as PCM data. The VoiceChunk data is completed with the addition of
the header data.
VOCE takes up 4 bytes in ASCII code as the header ID. The total number of bytes for
the voice data, layer data and wave data (PCM data) are then entered in
4 bytes, after which the number of voices (number of voice patches) is entered.
50
Voice
This is voice data. The 16 bytes of ASCII code is used for the VoiceName data at the
beginning, and the data below follows.
• Play Mode: Specifies the poly, mono, legato, portamento, legato &
portamento play back mode.
• Bend Range: Specifies the pitch bend range up to 14 steps (0~$D).
• Portamento time: Specifies the time in 128 steps (0~$7F.)
• NumberOfLayers: Number of layers used in this voice.
• VolBias: Specifies the volume of the layer within the voice. It can be
specified as signed data.
• LayerName: Name of the layer that is being used.
• WaveNumber: The wave number used in this layer is entered here.
• WaveSize: The wave size used in this layer is entered here.
SamplingRate
VLChunk
52
PEG Chunk
PLFO Chunk
•Mixer top of fset: The offset address of mixer data start location.
• VL top offset: The offset address of velocity level conversion data start location.
• PEG top offset: The offset address of PEG data start location.
• PLFO top offset: The offset address of PLFO data start location.
• Voice offset: The offset address of each Voice data.
• Mixer data: Mixer data
• VL data: Velocity level conversion data
• PEG data: Pitch envelope data
• PLFO data: Pitch LFO data
• Voice data: Voice data
• Wave data: Wave data
54
Mixer Data 0
VL Data 0
1 byte each
PEG Data 0
1 byte each
PLFO Data 0
1 byte each
Number of layers- 1
Base note
Wave Data 0
VL Conversion
Approximation value: This is the approximation value table number used for
velocity data. It is determined by calculating the velocity
points 0~3 and the velocity levels 0~3.
56
Calculation Method
The relationship between the velocity point and velocity level data is as shown be-
low. The curve of the levels is drawn as shown above for velocities 0~127. The D6-
D3 that is closest to one of the slope values out of these four curves is determined
from the table on the following page and entered in the Approximation Value Table.
The slope value is determined as follows.
Approximation value 0:
Velocity level 0
———————————————————————
Velocity point 0
Approximation value 1:
The following two tables are referred to when determining the D6-D3 value of the
Approximation Value Table.
The approximation values include ±∞, 1, 0 and the values indicated in the above
table. Determine a value that is closest to the actual slope in absolute difference
terms. The resulting D0-2 and D6-3 values are set as the approximation value.
58
PEG Related
DLY:
This is the table number of the time table for the PEG delay time. The time table
contains the number of counts per time unit. The number of counts is first deter-
mined from the delay time input in the Tone Editor. That value is then compared
with the count values contained in the Time Table. A difference of the two values are
taken. The number of counts in the Time Table that produces the smallest difference
in absolute terms is determined and its Time Table number is set here.
Number of counts = delay time (msec. unit time)
OL:
This is the offset level from the key on note when the key is activated. (OFFSET
LEVEL)
AR:
This is the level change range per unit time.
=ATTACKLEVEL/AT
AT:
This is the time table number that is used for the attack level time. The time table
contains the number of counts per time unit. The number of counts is determined
first from the ATTACK TIME input in the Tone Editor. Then the closest number of
counts is obtained from a time table by the absolute difference of the two count
values.
The resulting value is set here.
Number of counts=ATTACK TIME/2 (msec)
60
TM
Boot ROM
User's Manual
Doc. # ST-079B-R3-011895
In translating/creating this document, certain technical words and/or phrases were interpreted
with the assistance of the technical literature listed below.
2
1.0 Introduction
This manual explains the functionality of the SEGA SATURN boot ROM. Because the
boot ROM is incorporated in the SEGA SATURN hardware itself, it starts up auto-
matically when the unit is powered on or is reset.
After the SATURN's power is turned on or the reset button is pressed, the boot ROM
plays a role in determining its operation. Its main functions include displaying the
SEGA SATURN logo, booting up games, providing low-level services for applica-
tions, and executing the Multiplayer (also called the Audio CD Control Panel) that
plays various types of CDs.
Before the game begins, the boot ROM checks for a SEGA SATURN game disc and
determines if it is a standard SEGA SATURN game disc. See the DISC Format Stan-
dard Specifications (ST-040) document for more details on the standard SEGA SAT-
URN game disc format.
Refer to the System Program User’s Guide and the Backup Library User’s Manual in the
SATURN System Library User's Guide (ST-162-R1) for information on using the service
programs.
This manual supports the non-Japanese version of the SEGA SATURN boot ROM
(used in SEGA SATURN for North America NTSC, European PAL, Asian NTSC
countries other than Japan, etc.). Therefore, please be aware that certain boot ROM
functions described in this manual will operate differently on SEGA SATURN units
equipped with Japanese boot ROMs.
Process Flow
The game starts if the SEGA SATURN game disc is recognized while the SEGA
SATURN logo is displayed. The Multiplayer is executed if the SEGA SATURN game
disc is not recognized.
Power ON
or RESET
N
SMPC RESET?
Y
Set date and time
N Pressing
L and R buttons?
Y
System
Save datasettings
control
scr
screen
een
N Pressing
A button?
Game Y
cartridge?
N
SEGA SATURN logo
animation display
Y
GAME CD?
Multiplayer
GAME-CD GAME cartridge
starts starts
4
Precautions
• When a CD has not been inserted or if the CD door is open, the Multiplayer will
display the following:
• “Drive empty”
• “Drive door open”
• A game cartridge has priority of execution over the SATURN application CD-
ROM if one is inserted. To boot up the SEGA SATURN game disc, turn off the
power and remove the cartridge.
• The following messages indicate that the SEGA SATURN’s backup RAM has
failed. For more information, please call SEGA Developer Technical Support in
your area.
• “Not cleared!”
• “Not removed!”
• Do not turn off the power while initializing, deleting, or copying backup
memory. Data may be destroyed if the power is turned off during those opera-
tions. Perform initialization of backup memory if data cannot be loaded.
! These functions below are not handled by the boot ROM. Please handle them separately
within each application.
The data above can be scrolled through by pressing up or down on the D-Pad.
6
Game Startup
In order to prevent unauthorized and illegal production and sale of game software,
the SEGA SATURN game disc is checked to see whether it has a boot code before the
game begins. Be sure to insert the boot code in the designated location of the SEGA
SATURN game disc. The game will not start if the boot code cannot be recognized.
The content and preparation of the boot code are explained in the DISC Format
Standard Specifications (ST-040) document.
! This function is not handled by the boot ROM. Include this feature within each application.
For more information, see the System Program User’s Manual of the SATURN System
Library User’s Guide (ST-162-R1).
Backup Library
A search and read/write functions to a backup memory device are provided by the
Backup Library. This library must be used when accessing the internal backup
RAM. (Currently, the library must also be used to access external backup RAM
devices. Additional libraries will be distributed by SEGA for accessing external
memory devices that may be released in the future.)
For more information see the Backup Library User’s Manual of the SATURN System
Library User’s Guide (ST-162-R1).
Note: To skip one song, briefly press LEFT or RIGHT on the Control Pad. To perform a search,
press and hold down LEFT or RIGHT on the Control Pad.
8
Buttons for Basic Controls
1 2 3
4 5 6
7 8 9
1. Multi-Button
The Saturn button (the button icon resembles the planet Saturn) is displayed
when a SEGA SATURN CD is inserted.
2. System Settings
The System Settings screen for managing global system functions is displayed
when this button is pressed.
7. Repeat button
Cycles through Repeat One Song, Repeat All Songs, and Cancel Repeat settings.
8. Stop button
1 2 3
4 5 6
7 8 9
Note: The following button pairs may not be used simultaneously: Program Sequence/Tracks,
Repeat A-B/Scan Intros, Adjust Surround/Adjust Vocals. The settings of one button will
always override those made with the other button in the pair.
Mute Vocals
The Mute Vocals (voice cancellation) feature reduces the audio volume of vocals by
decreasing the center channel volume of a stereo recording. This feature will not
eliminate vocals completely. Because the audio volume of the entire song is de-
creased, voice cancellation is not recommended for songs recorded in mono. Even if
a recording is in stereo, the voice cancellation effect is generally not effective on folk
music, spoken word performances, classical music, duets, songs with strong chorus
or echo effects, and songs in which the singer's voice is not positioned in the center
channel of the stereo audio mix.
10
Changing System Settings
It is possible to change System Settings on the SEGA SATURN such as the internal
clock and the Multiplayer's language display.
Language Settings
The display language on the Multiplayer screen can be selected from the following
six languages: English, German, French, Spanish, Italian, and Japanese.
! For applications that support multilingual operation, the default language used by the applica-
tions is determined from the language selected by the user in the Set Language menu screen.
When there is a function that lets the user change the language setting within an application,
settings must be changed so that the setting will be reflected in the Multiplayer's System
Settings.
Message Displays
• “Game disc unsuitable for this system”
This message appears if a non-SEGA SATURN CD is inserted in the SEGA
SATURN. Be sure to check the type of CD being used. (The disc may still be
used as an audio CD if audio data is present.)
This message may be displayed if the data side of the CD (side on which the
game name is not printed) is dirty. In such cases, use a soft, dry cloth to remove
dirt from the data side of the disc.
• “Drive empty”
This message is displayed when a CD has not been inserted, the CD is damaged,
the CD is inserted upside down, or the type of CD inserted cannot be recognized
by the SEGA SATURN. In cases like these, check the type of CD being used.
Troubleshooting Tips
• The Multiplayer screen does not appear
.
Make sure the game cartridge is not plugged into the cartridge slot.
• The set clock screen always appears when the power is turned on. Data saved in the
SEGA SATURN's internal backup RAM is gone.
Was the lithium battery installed properly?
Is the lithium battery dead?
• The power LED does not turn on immediately after the power button is pressed.
The power LED may take 1 or 2 seconds to turn on. This is normal for the
SEGA SATURN.
12
• The SEGA SATURN game disc will not start up.
Be sure to include the boot code in the designated location of the SEGA SATURN
game disc. If the boot code cannot be recognized, the game will not start up. See
the Disc Format Standard Specifications (ST-040) document for more details.
• The SEGA SATURN game disc starts up, but does not operate with the mass-production
SEGA SATURN.
The problem is one of the following:
1) The boot code has not been included on the disc..
2) A System Disc is not being used.
The game will not operate if the maker ID is not correctly entered on the disc.
For more information, see the Disc Format Standard Specifications (ST-040)
document.
! If there is something wrong with the operation of the SEGA SATURN (besides what is listed
above), press the RESET button or turn the power button off and on. If this does not help,
remove the battery cover and press the master reset switch. (If this is done while game data is
being saved, the data may be lost instead of being saved.)
The function of the target box POWER ON RESET switch is somewhat different than a
normal power on/off cycle. If the POWER ON RESET switch does not work properly,
press the power button off and on.
The target box master reset switch is the SMPC RESET switch.
! If the system still does not run normally after the operations above are performed, remove
the power cable from the electrical outlet and contact SEGA Developer Technical Support for
assistance.
Term Meaning
CD-DA This format is used to describe a typical commercially available
music CD with pre-recorded digital audio data.
CD+G This CD format standard uses subcode data on the disc to display
text and graphics on a TV that is synced to music. Karaoke CD
systems that are capable of displaying, simple graphics and lyrics
on the TV screen use this CD+G format. The graphics resolution
supported by the CD+G format is 288H x 192V pixels. Up to 16
colors from a palette of 4096 colors may be used simultaneously.
CD+EG This format is an improvement over the CD+G format. Two
separate 256-color screen areas may be displayed simultaneously.
In addition, special video effects, such as cuts between 2 frames
and screen fade-in, are possible with this format.
14
TM
SATURN
Virtual CD System
User's Manual
Doc. # ST-129-R2-093094
In translating/creating this document, certain technical words and/or phrases were interpreted
with the assistance of the technical literature listed below.
Introduction .......................................................................................................3
Overview of CD Emulation System Configuration and Functions ..................... 3
About this Manual ............................................................................................. 4
Index................................................................................................. 70
2
Introduction
Overview of CD Emulation System Configuration and Functions
The CD-ROM emulation system configuration is shown in Figure 1.
CD Block
Main System
Board
VCD I/F CD System
Board
PC
Compatible
CD Drive
CD Emulation System
The CD emulation system consists of the Virtual CD system and a SEGA SATURN
target box. This system enables the emulation and testing of CD-ROM software
operations and verifies the operation of write-once disks that have been created.
Virtual CD (VCD)
After receiving commands from the CD Block, the VCD reads data from MS-DOS
files on the local hard disk or on a network and performs emulation. Hardware
consists of a PC-compatible computer and a VCD Interface (I/F) board. CD Emula-
tion on the PC completes the VCD system.
CD Block
The CD Block is located between the Virtual CD and the main system board and
contains the hardware and firmware that receives input from the target box, trans-
mits commands to the PC and handles data back from the PC.
VCD I/F Board
The VCD I/F Board is installed in the PC’s expansion slot and acts as the interface
between the CD Block and the PC itself.
4
Section I: VCD I/F Board Main Functions
The VCD I/F Board (RT-V1A) is an ISA expansion board for PC-compatible ma-
chines that handles transfers of commands and messages between PC-compatible
computers and the CD Block (RT-V1B) within a target box, sends CD-ROM data
from PC-compatible machines to the CD Block, and transfers CDDA data and other
types of CD-ROM data.
If the IRQ, DMA, and I/O address settings above conflict with those already set on
your PC, the Virtual CD may not start or the PC may hang up.
Be sure to fully understand each PC setting before changing the VDP I/F board
settings, and then change the board settings only if the default settings would cause
problems—for example, if the settings conflicted with those of the SCSI board DMA
channel. In such a case, the system configuration parameters would also need to be
modified. However, if the board is installed with default settings set at the factory,
the system configuration parameters do not need to be changed. For more informa-
tion on system startup procedures, see section 5.1, Preparing to Start.
1) ISA-IRQ Setting (J3)
Interrupt request numbers for the PC are selected via jumper pin settings. The de-
fault is set to IRQ10.
Pin 1-2 IRQ4(00)
Pin 3-4 IRQ3(01)
Pin 5-6 IRQ10(02)
Pin 7-8 IRQ11(03)
Pin 9-10 IRQ12(04)
Pin 11-12 IRQ15(05)
6
4.0 Installation and Setup for PC-Compatibles
One PC-compatible computer for the Virtual CD system with the following recom-
mended specifications is required:
• 486/33 MHz or greater,
• Memory: 8 MB or greater,
• Expansion Slot: ISA bus 3 slots or more (minimum),
• Video memory: 512 KB or greater,
• FDD: 3.5" X 1,
• SCSI board: Adaptec AHA-154xCF,
• HDD (1.2 GB or greater): DEC. DSP3210/DSP3107L
Note: XMS memory must be used in order to process a large number of files. Be sure to
specify HIMEM.SYS in CONFIG.SYS.
2) Setup
Unpack the VCD I/F card (RT-V1A) and insert it in the expansion slot of the PC-
compatible.
Connect the VCD I/F Board connector and the Virtual CD I/F connector of the
SEGA SATURN Programming Box with the accessory VCD I/F cable. Set up the
Programming Box and ICE according to the instructions contained in each
equipment's instruction manual.
Step 0-a
Install the VCD I/F Board in a PC before proceeding. Check the settings on the
following jumpers and write them down for later reference:
• IRQ jumper setting (J3)
• DMA jumper setting (J4)
• I/O jumper setting (J5)
When there is already a VCD I/F Board installed in the system, Step 0-b is per-
formed. In such cases, Step 1 from the environment settings may not be necessary.
Read the explanation of Step 1.
Step 0-b
Turn on the power to the PC-compatible and wait for MS-DOS to boot. When MS-
DOS boots up, the MS-DOS prompt will appear. Go on to the next step after MS-
DOS starts up.
Step 1
C:\>CHEV∆US[ENTER]
After the command is entered, the screen clears and a prompt will appear at the top
of the screen.
Next, set the system configuration parameter VCDIO. If the VCD emulator has
already been used on the PC, this variable may be set automatically when MS-DOS
boots up, so check to see whether it has already been set up. If the environment
variable is already set, stop this procedure and go to step 3.
The value of the environment variable VCDIO must reflect the setting of the VCD I/
F Board, as explained earlier in section 3.0, Setting the Jumper Pins. This example sets
the default value of the VCD I/F Board.
8
Type the following MS-DOS command:
Step 2
C:\>SET∆VCDIO=020000[ENTER]
The Virtual CD Emulator will not operate normally if the PC configuration conflicts
with the VCD I/F Board. Depending on the situation, the PC-compatible may hang
up.
The value of the environment variable changes when a jumper setting value other
than the default is used. However, the default setting may need to be changed on
the PC. For example, do the following to set the interrupt number to 01, the DMA
transfer channel number to 02, and the VCD I/F Board I/O address to 03.
C:\>SET∆VCDIO=010203[ENTER]
Next, install the sample program that accompanies the Virtual CD Emulator on the
PC compatible.
Step 3
First, a directory is created.
C:\>MD∆MYDIR[ENTER]
C:\>CD∆MYDIR[ENTER]
Sound data is generated using the sample data generator utility VCDMKDAT.
C:MYDIR>VCDMKDAT[ENTER]
The two sound data files used in the following check are created in the MYDIR
directory.
Step 4
C:MYDIR>VCDEMU∆JVC[ENTER]
The Virtual CD Emulator is launched and the screen is displayed.
Specified disk image files, CD structure data files, script files, and log data file
names are displayed on the screen. “No Log File” is displayed when no log data file
is specified. The Virtual CD Emulator at this point waits for key input for user
confirmation of the message. Pressing a key allows you to proceed to the next step.
Step 5
Press ENTER or ESC.
The program begins reading the files needed for execution. If read correctly the
following is displayed.
“Direct” should be seen in the display of the dialog box operation mode in the upper
right of the screen, meaning that the “Direct DOS File Access” operating mode is in
effect. Work is done on the target box from this point.
Step 6
Launch the SATURN program from the ICE.
• Insert Disk 1 into Drive A of the PC that controls the ICE.
• Halt the ICE by pressing CTRL-C, and reset with the following commands:
:rs[ENTER]
:g[ENTER]
Step 7
Check to make sure that the program starts normally, and that "VIRTUAL CD
CHECK PROGRAM" is displayed on the SATURN's screen.
Step 8
Operate the pad according to the instructions displayed on the screen and make sure
that the CDDA playback demo finishes properly.
10
How to Quit
Step 9
Press the SPACE key. “Menu” in the top bar is highlighted.
"Menu" and "Help" can be highlighted by entering the LEFT or RIGHT cursor keys.
Highlight the "Menu" item.
Step 10
Press ENTER or the cursor DOWN key.
Step 11
Use the DOWN key to highlight “Exit” in the menu (last item).
Step 12
Press the ENTER key to Quit the Virtual CD Emulator.
To make it possible to switch between the Virtual CD and the CD drive, a switch like
the one shown in Figure 1 has been placed between the CD Block and the CD drive.
When operating this switch, the CD trays of both the Virtual CD and the CD drive
must be in the open CD tray state. Use the Virtual CD Emulator menu item to set the
Virtual CD in the open CD tray state.
If the switch is used without performing this operation, the track information stored
in the target machine will be inconsistent with that of the CD drive (VCD).
12
Section II: CD Emulation Software
This section describes how to use the CD emulation software, which is the applica-
tion software that operates on a PC-compatible computer.
This section provides a simple explanation of the CD emulation system and de-
scribes the role of the CD emulation application software that runs on PC-compat-
ible computers.
Chapter 1 describes the general work flow of the emulation operation. Chapter 2
gives more detailed information on using emulation with three different types of
emulation models, each of which is described separately. Chapter 3 explains how to
use a script to place data on a CD. Finally, chapter 4 describes the contents of the
Virtual CD emulation screen.
MS-DOS files can be accessed in three formats: as collections of data files before
they become CD images; as files containing unaltered CD images; and as partially
revised CD images and data files.
Collections of Data Files Before they Become a CD Image
The data from these MS-DOS files (hereafter called data files) are used to create CD
images. The VCD emulator examines the file according to the access position of the
CD access command received from the VCD I/F Board, edits the data to emulate a
CD image, and sends the result to the VCD I/F Board. This process allows the target
box to receive the data in the same form as it would be input from the CD drive. This
is called “Direct DOS File Access” emulation mode. This emulation can be started
with simple preprocessing as long as the data for creating the CD image has already
been prepared. However, because the data is sent as it is being edited, it cannot be
played back with the same timing as that of the data input from the actual CD drive.
Therefore, the MPEG playback and channel interleave (described later) that requires
complex disc access cannot be supported in this emulation mode.
14
Files that Contain Unaltered CD Images
CDs have a variety of format standards. Data edited in formats and lengths that
meet those standards are saved as “CD Image Files”. The VCD emulator sends these
CD image files directly to the VCD I/F Board. In order to do this, the CD image
must be created before the emulation is started. This is called "Real-Time" emulation
mode.
In this emulation mode, actual complex sector placement (arrangement), such as
channel interleave is performed prior to the start of emulation; therefore, there are
no functional restrictions as those previously referred to in “Direct DOS File Access.”
Partial
Update
Content and Program Content and Program
Development Revision
Create
CD Configuration Game Program
Data File Execution Emulation
Figure 2 shows the work flow in summary form. The following chapters explain
these stages in detail, with examples.
Configuration Settings
This operation sets the VCD I/F Board settings into the configuration parameter
VCDIO. The VCD emulation program and the VCD I/F Board settings must be
compatible. The required settings are the numbers of three jumpers on the VCD I/F
Board. When these values conflict, the VCD emulator cannot interface correctly with
the VCD I/F Board. These settings are determined when the board is installed in a
PC, so if the values are inserted as configuration parameters in AUTOEXEC.BAT, the
parameters will be set automatically whenever the PC is turned on.
16
Developing Content and Programs
Image data and programs placed on the CD must be prepared in MS-DOS file for-
mat.
• About the CDDA file format
• MS-DOS file format binary file
• Data within the VCD PC-compatible machine must be arranged in Intel format (Little Endian),
as shown in Figure 3 below. When data is in Motorola format (Big Endian), a byte swap must be
implemented in advance.
(INTEL Format)
D7 D0 D15 D8
LSB MSB
CD Configuration Data
Specifies how MS-DOS files such as multimedia content and programs will be lo-
cated on the CD. A format that allows the CD configuration to be scripted is input
according to a preset format using a text editor. These files are called script files, and
their contents are called scripts. These script files describe CD configuration data.
Section 3.0 describes how they are created.
Update Operation
If the emulation results indicate that the disc content or code require updates, use
the appropriate CD tool to revise them. When a revision changes the size of the
content or program files, the CD configuration must also be revised using
VCDPRE.EXEor VCDBUILD.EXE. Even if there are no changes in size, the CD image
must be modified when real time emulation is executed. Verification of the new disc
image can be performed with the direct DOS file access emulation mode. Emulation
is performed by starting up the Virtual CD Emulator.
Partial Update
Run the VCDUTL.EXEprogram. Partial CD Image Update and Real Time Emulation
modes can be selected as execution options.
18
2.0 The CD Emulation Process Explained
This chapter explains the three CD emulation modes. The process is virtually the
same for each model, except that the files required to run the emulations differ.
These files are created by emulation preprocessing programs. Preprocessing pro-
grams are provided for each of the emulation types.
Real-Time Emulation
Emulation
(Partial CD Image
Update)
Real-Time Emulation
Key to flowchart:
Input File:
20
2.1 Running a Simulation Using MS-DOS Files
This section describes the operating procedures for using the Direct DOS File Access
mode.
Step 0- Delete existing .DSK files.
Direct DOS File Access mode emulation cannot take place with DSK files. The DSK file
indicates that real time emulation was run previously, resulting in the creation of the
DSK file. Before proceeding, delete all unnecessary DSK files.
Example 0 C:\>DEL∆TSTGAME.DSK[ENTER]
Step 3- Create the launch file (parameter file) for the preprocessing program (VCDPRE.EXE).
Use a text editor to create the launch file.
Example 3 The following are examples of launch files.
C:\>TYPE∆TSTGAME.PRM[ENTER]
SCR∆TSTGAME.SCR [ENTER]
RTI∆TSTGAME.RTI [ENTER]
Step 5- Change system to English mode (for users with Japanese DOS/V systems only).
The VCD emulator does not work in Japanese mode, so change the display to En-
glish mode. Enter the following command:
Example 5 C:\>CHEV∆US[ENTER]
Result 5 If the machine is in U.S. mode, the screen flashes and a
prompt appears at the top of the screen.
22
2.3 Updating Part of a CD Image
This section describes the process for “partial CD image update”. This emulation
mode can be used when a real-time emulation has been run previously. First, com-
plete the preprocessing for real-time emulation and create a file with the extension
DSK. Execute steps 1 through 4 from the previous section.
In this example the DOS file called DOSAUDIO.D01 (in the ISO9660 file called
ISO1FILE.DDD included in the CD image created by TSTGAME.SCR) is replaced with the
DOS file called DOSAUDIO.D02.
How to UseInclude
24
Comments
Characters that follow a semicolon (;) to the end of the line become comments.
Except at the start of a line, the semicolon must be preceded by a blank character in
order to differentiate it from a semicolon used to designate the version number of an
ISO9600 file name.
Blank characters:
• Space code (0x20)
• Horizontal tab code (0x09)
• Vertical tab code (0x0b)
• Home feed (0x0c)
• Line feed (0x0a)
Example:
; This is a comment. A blank character is not required when at the
start of the line.
File A ; This is also a comment. A blank character is inserted between A
and ;.
File A; Comments are not recognized if a blank character is not inserted
between A and ;.
• Identifier
Several identifiers are specified in the volume descriptor set definition. In the primary volume
descriptor, the representation can be in alphabet (uppercase), numeric, and underscore characters.
In the supplementary volume descriptor, Kanji character codes can be used. When Kanji character
codes are used, the user and the developer must decide on a code system in advance.
• Date
The format for the date is expressed as date "DD", month "MM", and year "YY" (DD/MM/YY),
which is then followed by a space that separates the date from the time, the format of which is
hh:mm:ss:cc:gg. Here "hh" is hour, "mm" is minute, "ss" is second, "cc" is 100th of a second, and
"gg" is the difference from Greenwich Mean Time. In the case of Japan, the time difference is 9
hours; therefore, gg is 36.
Version numbers range from 1 through 32767. When the version number is omitted, the default value is 1.
Defining Sessions
Sessions are defined between a <Session line> and an <EndSession line>. The <Session
line> specifies the disc type. The disc image of the session section can be output as an MS-
DOS file by specifying the file name. The file name may be omitted.
There are four valid disc types handled by the VCD system:
• CDROM (includes CDDA tracks)
• CDI (for CD-i)
• ROMXA (for CD-ROM XA)*
• SEMIXA
* When creating a CD-ROMXA that includes a MODE1 track, use SEMIXA as the session definition.
However, as listed in page 7 of the DISC Format Standard Specifications (ST-040-R4-051795) (see note),
the disk is created so that when POINT=A0h, then PSEC=00H for the Saturn game disc.
Sessions begin with a lead-in area followed immediately by a system area, volume de-
scriptor set, multiple tracks, and a lead-out at the end. When no lead-in is defined, the
track definition is not valid.
Up to 99 tracks can be defined, each of which is numbered. The first track is track 1,
with the track numbers increasing by 1 in the defined order thereafter. While there are
several types of tracks, the CDDA track must be defined in the last track group.
26
Volume Definition
The lead-in and 2-second gap are followed immediately by the system area and the
volume descriptor set portion. See the DISC Format Standard Specifications (ST-040-
R4-051795).
<SystemArea line> defines the system area. The content of the file specified as the
parameter of this line is copied to the system area. When the file length is less than
16 sectors, the remainder is filled in with 0x00. When the file is too long to fit, an
error results.
The volume descriptor set includes the following types of volume descriptors. See
page 15 of the DISC Format Standard Specifications (ST-040-R4-051795).
• Primary Volume Descriptor (PVD)
• Supplementary Volume Descriptor (SVD)
• Boot Record (BTR)
• Volume Partition Descriptor (VPD)
• Volume Descriptor Terminator (VDT)
There must be at least one PVD, which is always defined. The other volume descrip-
tors are defined as necessary. There may be multiple primary volume descriptors.
However, when several PVDs are present, the latter PVD becomes valid.
A line is provided for defining each of the volume descriptors except the last (VDT),
which is generated even when it is not specified. Therefore, there is no line that
defines this volume descriptor. The end of the volume descriptor set definition is
denoted by <EndVolume line>.
• Line for defining PVD
The PVD is defined in the section between <PrimaryVolume line> and
<EndPrimaryVolume line>.
• Line for defining SVD
The SVD is defined in the section between <SupplementaryVolume line> and
<EndSupplementaryVolume line>.
• Line for defining BTR
The BTR is defined in the section between <BootRecord line> and
<EndBootRecord line>.
• VPD is not used with the Saturn game disc.
28
• VolumeCreationDate (PVD, SVD)
Specifies the date of volume creation. When this line is not specified, the current date and time are
used.
• BootSystemIdentifier (BRT)
Specifies the boot system identifier of the boot record as a character string with a parameter.
• BootIndentifier (BRT)
Specifies the boot identifier of a boot record as a character string with a parameter.
Track Definitions
Tracks are defined between <Track line> and <EndTrack line>. Each group from the
<Track line> and ending with <EndTrack line> represents a single track. The Track
line parameter specifies the type of track. There are four track types:
• CDDA : Audio tracks
• MODE0 : Mode 0 data tracks
• MODE1 : Mode 1 data tracks
• MODE2 : Mode 2 data tracks
• Empty
Null blocks (blocks filled in with 0x00) equal to the number of blocks specified in the parameter of
this line is played back. This is used when defining lead-in or lead-out.
• Preemphasis
This line is used to specify whether to turn the preemphasis bit of the Q subcode channel ON. If the
parameter value is TRUE, the bit is turned ON; if the value is FALSE, the bit is OFF. If this line is not
specified, the default is preemphasis bit OFF.
• Copy
This line is used to specify the copy-protection status of the audio data of a given track type. If the
parameter value is TRUE, digital copying is permitted. If this line is not specified for tracks that
require specification, the default is FALSE.
• Directory Definition
Defines the CDDA track as the final track. Directories can be used to give data tracks a
hierarchical structure using directories.
Directory Definition
Directories are defined between <Directory line> and <EndDirectory line>. Each
group from <Directory line> to <EndDirectory line> represents a single directory.
A hierarchical directory structure can be defined by placing sets of <Directory line>
and <EndDirectory line> within the outer set of <Directory line> and <EndDirectory
line>. The Directory line parameter specifies the directory name.
30
Interleaved files are defined between <FileInterleaveFile line> and
<EndFileInterleaveFile line>. Information for the interleave (unit size and gap
size) is specified in the FileInterleave parameters. Unit sizes and gap sizes differ
depending on the files interleaved. A single file that is not interleaved is selected
between <FileInterleaveFile line> and <EndFileInterleaveFile line>.
Defining Files
Files are defined between a <File line> and an <EndFile line>. The ISO9660 file
name is specified per <File line> parameter. The actual file contents are specified as
file source, MPEG file, or channel interleave file. Multiple files can be specified if
they are of the same type. When an ISO9660 file uses one data file as the input
source, only <File line> and <EndFile line> need to be used to specify file names
if the names are the same.
File definition uses the following lines:
• BeginTimeS (simple files, channel-interleaved files)
Specifies the starting position of the disc location where the file is placed as the relative position
within a session. When the specified area overlaps another file, a warning message is displayed.
If this line is not specified—that is, no time is specified—the disk image is created in order and
placed after the final sector on the disk image where the file definition script is described.
32
Specify one of the following three data types for the file:
Audio
Indicates that there is audio data.
Video
Indicates that there is video data.
Data
Indicates that there is data.
• BitRate
Specifies the data bit rate in bps units.
• SubHeader
Indicates that a subheader has already been added to the file data. When this line is not specified,
it means that no subheader has been added.
• Offset
Specifies the part of the MS-DOS file that is to be input as the file source. The first argument
specifies the MS-DOS file read start position. The second argument specifies the read size. The
start position and size are in byte units.
• BitRate
Specifies the data bit rate.
• UnitSize
Specifies the unit size in sector units. When this line is not specified, it means that interleave is not
performed.
• GapSize
Specifies the gap size in sector units. When this line is specified without specifying the
UnitSize line, a warning message is displayed.
• BeginTimeF
Specifies the start position within the ISO9660 file in a relative location from the start of the file.
When the “+” symbol is specified in the parameter instead of the relative position, it is continued
in front of the previously defined file source.
• EndTimeF
Specifies the end position within the ISO9660 file in a relative location from the start of the file.
When the “-” symbol is specified in the parameter instead of the relative position, it is continued
in front of the previously defined file source.
• DataType
When the track that arranges this source data is MODE 2, specify the form. The parameter will
specify one of the following. When the specification is omitted, FORM1 will be used.
- FORM1 (for form 1 of mode 2)
- FORM2 (for form 2 of mode 2)
• Reallocation
Indicates that when another file is already specified in the location where the file source is to be
placed, the previously specified file is avoided and the source file is placed somewhere else. For
file sources that do not have this line, the file will be placed in an overlapped fashion
over the previous file.
• AutoEOR
Indicates that EOR (EndOfRecord) is recorded in the subheader of the sector that stores the final
byte of the file source. AutoEor is valid only within MODE 2-type tracks.
• CodingInformation
Shows that coding information is described in BCD.
• RealTime
Indicates that this file source is a real-time file.
34
3.2 Script Command Reference
Format Definitions of Lines
Backus Naur (BNF) notation is used for the formal format definitions of the follow-
ing lines. The areas enclosed by < > are nonterminal symbols, showing that the left
side of ::= is replaced with that of the right side. In addition, this replacement is
performed recursively.
The following notation rules are observed:
• Enclosing in [] denotes a termination symbol.
• [CR] indicates a return code.
• [SPACE] indicates a space.
• [TAB] indicates a tab code.
• <keyword> indicates an annexed table.
• The limitations of the keyword and parameter set are given in annexed tables.
• Keywords are case sensitive.
• The limits for the number of columns and characters are specified separately.
• The units used for numbers are described separately.
• Information regarding other limitations is described separately.
• Refer to specification JIS X 0606 for the definitions for <a 1 character> and <d 1
character>. Kanji characters can also be used. Generally, every command has the following
configuration: <line>::=<keyword><parameter list>[CR].
Tokens such as keywords and parameters are separated by one or more blank
spaces, which have the following meanings.
• Space code (0x20)
• Horizontal tab code (0x09)
• Vertical tab code (0x0b)
• Home feed (0x0c)
• Line feed (0x0a)
Each line consists of one line by the line feed code (0x0d).
The definition of each line is shown below.
• Words not enclosed by < > refer to reserved words or the operator input by the user.
• [CR] indicates the line feed code (0x0d).
• [SPACE] indicates a blank space (0x20).
• See standard specification JIS X 0606" for a definition of <a 1 character> and <d 1
character>.
36
<EndFile line>::= EndFile [CR]
<BeginTimeE line>::= BeginTimeE <relative time> | BeginTimeE + [CR]
<EndTimeE line>::= EndTimeE <relative time> | EndTimeE - [CR]
<BeginTimeS line>::= BeginTimeS <relative time> [CR]
<EndTimeS line>::= EndTimeS <relative time> [CR]
<SourceType line>::= SourceType <file source type> [CR]
<FileSource line>::= FileSource <input file name> [CR]
<EndFileSource line>::= EndSourceType [CR]
<SubSource line>::= SubSource <subsource file name> [CR]
<SubEmpty line>::= SubEmpty <number of blocks > [CR]
<BeginTimeF line>::= BeginTimeF <relative time> [CR] | BeginTimeF + [CR]
<EndTimeF line>::= EndTimeF <relative time> [CR] | EndTimeF - [CR]
<MpegMultiplex line>::= MpegMultiplex <output file name>opt [CR]
<EndMpegMultiplex line>::= EndMpegMultiplex [CR]
<Trigger line>::= Trigger <location inside file> [CR]
<Eors line>::= Eors <location inside file> [CR]
<MpegStream line>::= MpegStream <source file name> <data type> [CR]
<EndMpegStream line>::= EndMpegStream [CR]
<FileNo line>::= FileNo <file number > [CR]
<Channel line>::= Channel <channel number > [CR]
<EndChannel line>::= EndChannel [CR]
<SectorRate line>::= SectorRate <sector rate> [CR]
<UnitSize line>::= UnitSize <unit size> [CR]
<GapSize line>::= GapSize <gap size> [CR]
<Pack line>::= Pack [CR]
<BitRate line>::= BitRate <bit rate> <sequence number>opt [CR]
<SubHeader line>::= SubHeader [CR]
<Offset line>::= Offset <input position> <input length> [CR]
<DataType line>::= DataType <mode 2 form> [CR]
<Reallocation line>::= Reallocation [CR]
<AutoEOR line>::= AutoEOR [CR]
<CodingInformation line>::= Coding Information <coding information> [CR]
<RealTime line>::= RealTime [CR]
<SameName line>::= SameName <D + identifier> [CR]
• <d1 character string> can also be used with <D + indentifier >
• <Character strings> can describe any character (Includes SHIFT-JIS kanji. Except for control codes)
• When you want to insert [SPACE] in a character string, enclose the character string by “ “.
From here on the left side shows one token. Separator characters cannot be inserted between each
parameter.
38
<Unit size> ::= <numeric string>
<Gap size> ::= <numeric string>
<Channel number> ::= <numeric string>
<Number of blocks> ::= <numeric string>
<Number of sectors> ::= <numeric string>
<Input position> ::= <numeric string>
<Input length> ::= <numeric string>
<Catalog number> ::= <numeric string>
<File number> ::= <number string>
<Sequence number> ::= <number string>
<Coding information> ::= <number string>
<Version number> ::= <number string>
<Bit rate> ::= <number string> . <number string>
<Directory name> ::= <d character string> <d 1 character string>
<ISO9660 file name> ::= <file name> <file name> ; <version number>
<File name> ::= <file name body> . <file name extension> <file name body>
<File name extension>
<File name body> ::= <d character string> <d 1 character string>
<File name extension> ::= <d character string> <d 1 character string>
<Output file name> ::= <MS-DOS file>
<Input file name> ::= <MS-DOS file>
<Source file name> ::= <MS-DOS file>
<Subsource file name> ::= <MS-DOS file>
<MS-DOS file> ::= “<drive name>opt <MS-DOS full path name>” <drive name>opt
<MS-DOS full path name>
<Drive name> ::= <drive> :
<MS-DOS full path name> ::= <MS-DOS directory>opt \ <MS-DOS file name>
<MS-DOS file name>
<MS-DOS directory> ::= <MS-DOS directory name> \ <MS-DOS directory>
<MS-DOS directory name> ::= . .. <MS-DOS file name>
<MS-DOS file name> ::= <MS-DOS file name body> . <MS-DOS file name extension>
<MS-DOS file name body>
<MS-DOS file name body> ::= <d’character string> <d 1 character string>
<MS-DOS file name extension> ::= <d’character string> <d 1 character string>
<Drive> ::= <Roman character>
• d 1 character string can be used in the SupplementaryVolume descriptor. In other cases, only
the d character string can be used.
• d 1 character string can be used in the SupplementaryVolume descriptor. In other cases, only
the d + character string can be used.
40
Script Syntax
The syntax of the input script is indicated below.
• Items enclosed by < > denote nonterminal symbols.
• means "or". < . . >opt indicates that < . . > can be omitted.
• xxxxxxx indicates areas where the script locations and definitions were changed from the old
specifications.
• When the track is CDDA, Attributes, RecordingDate, MinLength, SameName only are valid.
• SameName is valid when SupplementaryVolume is defined.
<File Format Definition> ::= <File Source Group> <MPEG Source Command
line> <Channel Group>
<File Source Group> ::= <File Source> <File Source> <File Source Group>
<File Source> ::= <FileSource line> <File Source Definition>opt
<EndFileSource line>
<File Source Definition> ::= <File Source Definition line>
<File Source Definition line> <File Source Definition>
<File Source Definition line> ::= <SubHeader line>
<Offset line>
<BitRate line> <UnitSize line>
<GapSize line> <RealTime line> <BeginTimeF line> <EndTimeF line>
<DataType line> <AutoEOR line> <CodingInformation line>
<SourceType line>
<SubSource line> <SubEmpty line>
• When the track is CDDA, SubSource and SubEmpty only are valid.
• When the track is not CDDA, items other than SubSource and SubEmpty are valid.
42
<Extension File Definition> ::= <File Interleave Definition> <File
Interleave Definition> <Extension File Definition>
<File Interleave Definition> ::= <FileInterleave line> <File> <EndFileInterleave
line>
44
Script keywords are listed in the following tables.
46
Table 3 List of Script Keywords (3)
Keyword Parameter Description
EndFile End file definition.
BeginTimeE Relative Position Relative time from the time that extent starts at the start
position on the disk in which files are placed within EXTENT.
EndTimeE Relative position Relative time from the time that extent starts at the end position
on the disk in which files are place within EXTENT.
BeginTimeS Relative position Relative time from the time that the session starts at the start
position on the disk in which a file or channel interleave is
placed.
EndTimeS Relative position Relative time from the time that the session starts at the end
position on the disk in which a file or channel interleave is
placed.
SourceType File source type File source data type.
One out of MONO_A, MONO_B, MONO_C, STEREO_A,
STEREO_B, STEREO_C, CDDA, ISO11172, VIDEO, DATA
FileSource Input file name Specification of the MS-DOS file that becomes the ISO9660
file.
EndFileSource End of specification of the MS-DOS file that becomes the
ISO9660 file.
SubSource Input file name Specification of the MS-DOS file in which subcode data is
entered.
SubEmpty Block count Output specification of null data to the subcode area.
BeginTimeF Relative position File source placement start position.
EndTimeF Relative position File source placement end position.
MpegMultiplex Start of ISO11172 stream definition.
[Output file File that outputs multiplex results.
name]
EndMpegMultiplex End of ISO11172 stream definition.
Trigger Position within Specifies the trigger position.
the file
Eors Position within Specifies the EOR (End of Record) position.
the file
MpegStream Start of MPEG stream definition.
Source filename Specifies the EOR (End of Record) position.
Data type Either AUDIO, VIDEO, or DATA.
EndMpegStream End of MPEG stream definition.
FileNo File number File interleaved file ID number.
Channel Channel number Start of channel definition.
EndChannel End of channel definition.
SectorRate Sector rate Specifies the number of sectors transferred in a 1 second
period using interleave. Either 75 or 150. Default is 150.
UnitSize Unit size Unit (number of sectors) that places the same channel
continuously during channel interleave.
GapSize Gap size Number of sectors occupied by different channels during
channel interleave.
Pack Specifies pack operation after channel interleave.
48
Table 5 List of Script Keywords (5)
Keyword Parameter Description
VolumeExpirationDate Date Volume expiration date.
VolumeEffective Date Date Specifies the volume issue date.
ApplicationUse Filename Specifies MS-DOS files of data used for the application use
field.
ExcapeSequences Kanji code Specifies characters used by the subvolume identifier,
directory record, and path table. SHIFTJIS only is effective.
BootSystemIdentifier Identifier Specifies the boot system identifier of the boot record.
BootIdentifier Identifier Specifies the boot identifier of the boot record.
SysOwnerID Numeric string Specifies the owner ID to be recorded in directory system
information.
SysReadAttributes Specifies whether to permit reading of each user class
recorded in directory system information.
Top Bar
Buffer :00/75
Bottom Bar
50
Mode Window
The mode window displays the following three modes.
Jumper Window
This window displays jumper settings. This window is the middle window out of the
three located on the right side of the screen.
Buffer Window
This window displays the usage level of the buffers set up by the application. This
window is the lowest window of the three on the right side of the screen.
Command Display
In command display, messages are divided into data fields. The meaning of each field
is as follows, in order from left to right. The field headings are displayed on the row
directly under the top bar.
Command Atime FAD(10) Rtc Nop Out PREFD
Play 00:02:00 96 0x80 00230 0000 01000
Stop 00:00:00 00 0x80 00015 0010 11000
Pause 00:00:00 00 0x80 00030 0010 11000
Play 2 00:10:05 2F3 0x80 00224 0000 01000
• Command
Displays the command name. The number displayed after a command name
indicates whether the drive speed is single or double. A “2”shows that a double
speed command has been received.
Other Messages
Other messages, such as error messages, are not assigned to fields.
52
Menu
Log Indication
View: Always
Log Indication Error Only
FAD Form
Exit Information
TOC Information
REL Information
FILE Information
The menu item is selected by highlighting the item using the UP and DOWN cursor
keys. The selected item can then be executed by pressing the ENTER or SPACE key.
View
• Log Indication
This mode is used to see log information. When this menu item is selected, the
color of the top bar changes from purple to yellow. You are in LogView mode
when the color of the top bar is yellow.
By pressing the UP and DOWN cursor keys or the PAGE UP and PAGE
DOWN keys, it is possible to trace up to a maximum of 500 lines of log data
from the last displayed log data.
• Always
This mode displays all log data. When selected, the View display in the mode window
changes to Always.
• Error Only
When this mode is selected, only error information is reported. Selecting this mode
changes the View display in the mode window to Error.
• FAD Form
Selects the frame address display format of the log window.
• Decimal
Displays in decimal.
• Hexadecimal
Displays in hexadecimal.
Information
• TOC Indication
This mode displays TOC data. When selected, the TOC information window
opens in the center of the screen.
Use the UP/DOWN cursor keys or the PAGE UP/PAGE DOWN keys to review
the TOC data. Press the ENTER or ESC key to exit this mode.
• REL Information
This mode displays relational table data. When this menu item is selected,
the relational table data window opens in the center of the screen.
REL Information
Use the UP/DOWN cursor keys or the PAGE UP/PAGE DOWN keys to
review the relational table data. Press the ENTER or ESC key to exit this
mode.
• FILE Information
This mode displays file information on the currently selected file. When this
function is selected, the File Information window is opened in the center of
the screen.
54
File Information
Use the UP/DOWN cursor keys or the PAGE UP/PAGE DOWN keys to review
the relational table data. Press the ENTER or ESC key to exit this mode.
Open CD Tray
This function executes the "open CD tray" function of the CD drive on the VCD system.
Close CD Tray
This function executes the "close CD tray" function of the CD drive on the VCD system.
Exit
Quits out of the Virtual CD Emulator. After this menu item is selected, pressing any
key will terminate the program.
When the -f option is used, the file name for the disc image data file will be
the name specified with the option.
When the -l option is used, the log data file is created with the specified
name.
The -j option is used to set up the VCD interface board's jumper numbers.
The values are the same as the VCDIO configuration parameters.
56
Cannot find the beginning of REL info.
Unable to find the keyword within a specified RTI file that marks the start
of the relational data table.
Cannot allocate memory for ISO9660 file info.
Unable to allocate memory for storing ISO9660 file information.
Cannot allocate memory for DOS file info.
Unable to allocate memory for storing DOS file information.
Illegal relation table
Error in the relational data table.
Cannot open log file = ****
Unable to open the specified log file.
Cannot find DOS file in track **
Unable to find DOS file that matches the specified addresses in track**.
No File at this LSA **
Unable to find DOS file that matches the specified absolute time.
File <****> cannot be opened
The DOS file **** could not be opened.
Illegal offset
An address was specified that exceeds the size of the disc image file during
real-time emulation.
Not read
Failed to read data from the DOS file.
Cannot read data from disk image file
Unable to properly read data from the disk image file.
TOC is not loaded
An attempt was made to display the TOC data without it being loaded.
REL table is not loaded
An attempt was made to display the relational data table without it being
loaded.
VCDPRE.EXE
Command: VCDPRE
Command name: Creates a disc configuration data file
Function: Creates disc configuration data file required for direct DOS file access mode
CD emulation.
Format: VCDPRE startupfile [/i /d /f /c /l]
Description: A script file and a disc configuration data file are specified for the startup
file. The script is input from the specified script file and a disc configuration
data file that describes the configuration of the disc is then output. The
resulting disc configuration data is verified and error messages are output if
necessary. File names are assigned to the startup file by specifying the file
name after the keyword and a space.
Options
/i Display ISO9660 processing
/d Display input DOS file processing
/f Display file interleave placement table
/c Display channel interleave placement table
/l Large file processing switch. XMS memory is used when /l is
added.
Common Errors
The following are common text handling and command syntax errors.
String length error
The character string is too long. The maximum permissible number of charac-
ters on 1 line is 255 bytes.
Out of memory space
Unable to allocate memory. Available memory can only be expanded by
deinstalling drivers and other miscellaneous software.
Illegal character
An illegal character code is contained in the character string.
Syntax error
A syntax error.
Cannot open File ****
The file **** cannot be opened. Check to make sure that a file by that name
actually exists.
Illegal token
A syntax error. The cause of the error may be a mistake in the reserved word
at the start of the line.
Illegal parameter **
A syntax error. The source of the error may be an incorrect format of the nth
parameter in a line identified by the number **.
Illegal nesting of Include
Too many Include nests. Only 2 levels of Include are allowed.
58
Block Errors
The following errors occur when the relationship between the Block and EndBlock
statements are incorrect. The generation of this error may mean that any following
blocks may be offset. Accordingly, similar errors will occur later on. Errors of this
type may be completely resolved if the error at the beginning is corrected (i.e., fol-
lowing errors that result from the initial errors will be corrected).
Illegal nesting of Block
Too many block nests.
Illegal definition of Endblock
Too many EndBlock definitions.
Expected ****
There is no block declaration that is implied by ****. Either **** is not declared,
or there may be an unnecessary End****.
Illegal definition in **** block
This command can be defined only within the **** block.
Illegal nesting of Directory
Directory nesting is too deep. Only 8 directory levels are allowed.
**** block is not closed
**** block is not closed. **** may be unnecessary.
Parameter Errors
These errors occur when the spelling of the parameter character is incorrect or
the legal value range for the parameter is exceeded.
Attribute Errors
These errors are produced by syntactically correct statements that typically contain
setup errors.
**** is already defined
The item **** is already defined..
CDDA cannot be defined in the first track
A CDDA track cannot be specified as track 1.
Illegal command in the CDDA track
This command cannot be defined within the CDDA track. Be sure to check the
track type.
This command can be defined in the CDDA track only
This command can be defined only within the CDDA track. Be sure to check
the track type.
60
BeginTime and EndTime cannot be defined in a block
BeginTimeX and EndTimeX cannot be defined within the same block.
Filesource type error in an ISO-file
An incorrect file source type is defined within one ISO file.
Filesource type error in a Channel
An incorrect file source type is defined within one channel.
Definition error of BeginTimeE and EndTimeE
BeginTimeE and EndTimeE can be defined only within the extent block.
Definition error of **** in a Channel block
**** can be defined only with a channel block.
Illegal BeginTimeS
BeginTimeS must be a value that is greater than 00:02:16.
Illegal ExtentTime
ExtentTime must be a value that is greater than 00:02:17.
SameName can be used when the Supplementary Volume is defined
SameName is effective when the Supplementary Volume is defined.
Primary Volume is not defined
No primary volume is defined. At least one Primary Volume must be defined.
LeadIn is not defined
LeadIn is not defined before track definition.
Illegal LeadOut tracktype
The LeadOut track type is not the same as the final track. The LeadOut track
type must be the same as the final track type.
MpegMultiplex can be defined once in a block
MpegMultiplex can be defined only once in a block.
Disc is not defined
The disc is not defined.
BitRate is not defined
The BitRate is not defined.
**** is not defined
The **** block is not defined.
Illegal track number
Too many tracks. Only a maximum of 99 tracks is allowed.
Any track is not defined before LeadOut area is start
A track has not been defined before LeadOut.
Filesource definition error in the CDDA track
The file source and file definition are mixed in the CDDA track.
Illegal track type on DiscType “CDROM”
When the disk type is a CD-ROM, Mode 2 cannot be used for the track type.
This command can be used in the MODE 2 track only
This command is legal only in a Mode 2 track.
Illegal track type in LeadIn area
Only Mode 1 can be specified for the LeadIn track type.
Illegal track type in first track
Only Mode 1 can be specified for track 1 track type.
VCDBUILD.EXE
Command: VCDBUILD
Command name: Creates a CD image file.
Function: Generates and outputs the CD image to the file defined in the
script file.
Format: VCDBUILD startupfile [/i /d /f /c /l]
Description: The script file and disk configuration data files are specified in the startup file.
The script is input from the specified script file and a disc configuration data file
and a CD image are output.
Options:
/i Display ISO9660 processing
/d Display input DOS file processing
/f Display file interleave placement table
/c Display channel interleave placement table
/l Large file processing switch. XMS memory is used when
/l is added.
• Startup Messages
PreProcess for VCDEMU <VCDPRE> Ver n.nn Released at dd-mmm-yyyy
Copyright (c) 1994 Victor Company of Japan <JVC>
62
• VCDBUILD Error Messages
General Error Messages
———:nnn xxxxxxxxxx
———: open error: xxxxxxxxxx
———: write error: xxxxxxxxxx
———: read error: xxxxxxxxxx
———: read error: too big SYSTEM AREA
———: over limit of directory hierarchy: xxxxxxxxxx
———: Same Directory : xxxxxxxxxx
———: Overlapped Sector, check Unitsize and Gapsize: xxxxxxxxxx
———: Over specified File or Extent Space: xxxxxxxxxx
———: Not Specified Base End Time for EndTime {E,F} [-]): xxxxxxxxxx
———: Relocation Channel Overlapped to Same Channel: xxxxxxxxxx
———: Move Location: xxxxxxxxxx
———: Isofile or CDDA track Has No Source, Delete This Area: xxxxxxxxxx
———: Track Has No Isofile, Delete the Track: xxxxxxxxxx
———: Less Memory for This Program: xxxxxxxxxx
———: Some Fatal: xxxxxxxxxx
———: Internal Error (maybe BUG): xxxxxxxxxx
VCDUTL.EXE
Command: VCDUTL
Command name: Performs partial update of CD image.
Function: Updates files in the CD image generated by VCDBUILD.
(1) An ISO file in the CD image is replaced with a specified DOS file, and the
CD image is updated. The ISO file can either be file interleaved or
channel interleaved. This enables faster emulation without the need for
rebuilding the entire disc image.
(2) An ISO file in the CD image is replaced with a specified DOS file, and
while the CD image remains unchanged, the updated disc data is created.
The ISO file can be file interleaved, but channel interleaved file is not
updated. Only the updated part is emulated under direct DOS file access
mode.
Note: In the case of (1), the replacement DOS file must be the same size or smaller
than the DOS file that is replaced. If the size of the new file is larger than the
old file, an error message is displayed and the image is not updated. In
addition, any DOS files (with the exception of MPEG and CDDA files) can be
updated.
64
Example:
VCDUTL∆TSTGAME∆ISO1FILE.DDD∆DOSAUDIO.D01∆DOSAUDIO.D02
∆[-f∆DOSAUDIO.PAT][ENTER]
Options
-f Option
Name of the update data file used to replace the DOSAUDIO.PAT DOS file (can be a
user specified file name).
When this option is specified, the CD image itself will not be updated. This
update data file will be used during emulation.
If this option is not used, the CD image itself will be updated without the update
data file being output.
There are two methods for editing multiple DOS files for one CD image:
(1) Commands are executed repeatedly with the -f option.
(2) Commands are executed repeatedly with the -f option without
changing the update date file name.
Note that the CD image remains in an unchanged state with method (2).
Check Items
When the -f option is used, an error will occur if the ISO file containing the speci-
fied update DOS target file is channel-interleaved. After the error occurs, the com-
mand will terminate without any further processing.
When the -f option is not used, an error will occur if the DOS file size is unsuitable.
VCDMKTOC.EXE
Command: VCDMKTOC
Command Name: Creates TOC data file required by the CD writer.
Function: Extracts the TOC information necessary to create a write once CD from the
final RTI file. The data is converted and output to the file format recognized
by the writer's operating system.
Format: VCDMKTOC mainRTIfilename
Description: Input file = mainRTIfilename.RTI
Output file = mainRTIfilename.TOC
Example: VCDMKTOC∆TSTGAME
66
5.3 Sample Data
File Configuration
• JVC.SCR Sample script
• JVC.PRM PRE/BUILD startup parameter file
• PAT_1.DAT 10 KByte increment data
• PAT_10.DAT 130 KByte increment data
• JVC.RTI PRE/BUILD output data file
• JVC.PVD PRE output data file
• JVC1.ABS Ver. 1.02 Sample program for Model-S
SEGA SATURN Programming Box
• JVC1.INI Sample execution command file
• SYSTBL.TSK
• SDDRV.TSK Sound initialization file
• NEWMAP.BIN
• VCDMKDAT.EXE Creates two sound data files in the
current directory. Each file has a data
size of approximately 1.4 MBytes.
Check Items
Make sure to check the following:
VER 1.0
Startup Screen
Press the A button to move to the first test item.
68
3. CDDA Play
Plays sound using track 2 and 3 data. Audio is played back automatically.
Play track 3
Play track 4
Play tracks 3 and 4, repeat 3 times
Pause track 4
Resume play on track 4 after pause is cleared
TNO, ATIME, and status are always displayed on the screen.
COMPLETE is displayed at the bottom of the screen to indicate that the test has
ended. The program then waits for button A to be pressed.
70
TM
Virtual CD System
Supplementary
Manual
Ver. 1.0
Doc. # ST-129-R2-SP1-061995
Index ...................................................................................................................................... 26
2
1.0 Supplementary Information on the Emulator
-ib:
Sets the size of the input buffer. An integer between 2 and 8 can be specified. For
example, the following sets a size of 8 KB (4 KB x 2):
-ib 2
-vb:
Specifies the size of the transfer buffer. An integer between 14 and 37 can be speci-
fied. This option specifies the number of buffers that are each equivalent to 1 sector
in size. For example, when the following is specified,
-vb 14
14 transfer buffers are allocated. The default is 37 transfer buffers. However, fewer
buffers may be allocated depending upon the available memory in the system.
After startup, the input buffer size and the number of transfer buffers allocated are
displayed on the lower right area of the screen as follows.
Buffer: 02/07
The numerator indicates the input buffer size (in 4 KB units) and the denominator
the number of transfer buffers. The number displayed for transfer buffers is an
integer value divided by 2.
If the above options are not set at startup, the program can emulate approximately
4,000 tracks and indexes (i.e., the total number of tracks x number of indexes). With
the minimum setting of -ib 2 -vb 14, the total number is about 5,000. When the
default settings are used, approximately 40 indexes per each track with a maximum
of 99 tracks can be emulated, or a disc image with up to 50 indexes can be emulated
when the buffer setting is at a minimum.
The disc builder program VCDBUILD.EXEon the Virtual CD can create disc images for
approximately 10,000 tracks·indexes (maximum 99 tracks x 99 indexes). However,
the number of tracks·indexes that can be emulated using the emulation program
VCDEMU.EXEis limited to approximately 5,000.
4
2.0 Supplementary Description of Scripts
(8) When an ISO file includes a MpegMultiplex line, a SectorRate line must be
defined immediately after the File line.
(9) Any positive integer value between 1 and 65535 can either be specified for the
sector rate parameter defined in the SectorRate line or omitted. When omitted,
the parameter becomes 150.
<SectorRateLine>::= SectorRate<sector rate>[CR] | SectorRate [CR]
(10) The bit rate defined in the BitRate line has a decimal point. When the rate is an
integer, append a “.0” to the integer.
(11) The new file source types AUDIO and MPEG_VIDEO can be defined in the
SourceType line.
When storing audio data other than ADPCM in the 2324 byte user data area in
the form 2 sector, state AUDIO as the file source type. When using a FileSource
command to define an MPEG video stream, state MPEG_VIDEO as the file source
type. This statement identifies the file source as an MPEG video stream and
adds 16 words of “0” data immediately after the sequence_end_code stated at
the end of the MPEG video stream. This statement is necessary to properly
replay an MPEG video stream on the SEGA SATURN.
FileSource Input filename
SourceType MPEG_VIDEO
EndFileSource
In addition, when the MPEG video stream is defined using the MpegStream
command, specifying the parameter VIDEO will perform the equivalent process.
MpegStream Source filename VIDEO
6
(12) Use the CodingInformation command to set subheader coding information. The
Virtual CD system cannot set the coding information by identifying the file
source. However, if VIDEO is specified as the data type in the MpegStream line
during MpegMultiplex, the coding information is set to 0FH. When AUDIO is
specified, 7FH is set.
No particular coding information is defined for a game CD. There also are no
settings defined for AUDIO and MPEG_VIDEO (described in item 11). Please refer to
section 4.3.2.4 in the specification document CD-ROM XA II.4. for the settings
when the AUDIO sector source is ADPCM or the VIDEO sector source is ASM or
EVM.
(13) The MpegFlush command has been added as a new command keyword. An
MpegFlush line adds 16 KB of “0” data immediately prior to the
sequence_end_code recorded at the end of the MPEG video stream.
<MpegFlush line> ::= MpegFlush [CR]
<File source definition line>::=<SubHeader line>|<Offset
line>|<BitRate line>|<UnitSize line>|<GapSize line>|<RealTime
line>|<BeginTimeF line>|<EndTimeF line>|<DataType line>|<AutoEOR
line>|<CodingInformation line>|<SourceType line>|<SubSource
line>|<SubEmpty line>|<MpegFlush line>
(14) When the type of the data specified in the MpegStream line in the MPEG stream
definition is DATA, FORM1/FORM2 must be specified in a DataType line.
<MPEG stream>::=<MpegStream line> <BitRate line> <DataType line>
<MpegFlush line> <EndMpegStream line>|<MpegStream line> <BitRate
line> <DataType line><MpegFlush line> <EndMpegStream line> <MPEG
stream>
(16) A hyphen “-” can also be used in addition to a forward slash “/” as a delimiter
when specifying VCDPRE.EXE and VCDBUILD.EXEoptions. New options have
also been added.
Format:
VCDPRE Startupfile [/i /c /d /f /a]
or
VCDPRE Startupfile [-i -c -d -f -a]
Added Option:
/a or -a Specifies options i, c, d and f as a batch
Format:
VCDBUILD Startupfile [/i /c /d /f /a /n /s]
or
VCDBUILD Startupfile [-i -c -d -f -a -n -s]
Added Options:
/n or -n ECC not generated
/s or -s Execution history not displayed
LeadOut CDDA
Empty 300
EndLeadOut
EndSession
EndDisc
8
(2) Sample Script for a CD-ROM XA (MODE1+MODE2+CD-DA) Disc
Disc output filename
Session SEMIXA <output filename>opt
LeadIn MODE1
EndLeadIn
;
<SystemArea MSDOS filename>opt
;
Track MODE1
Volume ISO9660 output filename
PrimaryVolume 0:2:16
<PVD definition line>opt ;......(1)
EndPrimaryVolume
<SupplementaryVolume relative time>opt
<SVD definition line>opt ;......(2)
<EndSupplementaryVolume>opt
<BootRecord relative time>opt
<Boot record definition line>opt ;......(3)
<EndBootRecord>opt
EndVolume
;
FileISO9660 filename <output filename>opt
<file definition line>opt ;......(4)
FileSource Input filename
<file source definition line>opt ;......(5)
EndFileSource
EndFile
;
; File ~ EndFile
;
PostGap 75
EndTrack
;
Track MODE2
PreGap 150
File ISO9660 filename <output filename>opt
;Example of channel-interleaving using SectorRate line
SectorRate <positive integer>opt ; Required when defining MPEG
Channel channel number
MpegMultiplex <output filename>opt
<RealTime>opt ; When DATA is specified in MpegStream line
MpegStream Source filename {AUDIO|VIDEO|DATA}
BitRate Bit rate <sequence number>opt
<DataType {FORM1|FORM2}>opt ; When DATA is specified in
<MpegFlush>opt MpegStream line
EndMpegStream
MpegStream source filename {AUDIO|VIDEO|DATA}
:
EndMpegStream
EndMpegMultiplex
Endchannel
Channel channel number
MpegMultiplex <output filename>opt
<RealTime>opt ; When DATA is specified in MpegStream line
MpegStream Source filename {AUDIO|VIDEO|DATA}
BitRate Bit rate <sequence number>opt
<DataType {FORM1|FORM2}>opt ; When DATA is specified in
<MpegFlush>opt MpegStream line
EndMpegStream
10
(1) PVD Definition Line
<SystemIdentifier A identifier>opt
<VolumeIdentifier D identifier>opt
<LogicalBlockSize Number of blocks>opt
<OptionalLPath>opt
<OptionalMPath>opt
<VolumeSetIdentifier D identifier>opt
<PublisherIdentifier A identifier>opt
<DataPreparerIdentifier A identifier>opt
<ApplicationIdentifier A identifier>opt
<CopyrightFileIdentifier D+ identifier>opt
<AbstractFileIdentifier D+ identifier>opt
<BibliographicFileIdentifier D+ identifier>opt
<VolumeCreationDate Date>opt
<VolumeModificationDate Date>opt
<VolumeExpirationDate Date>opt
<VolumeEffectiveDate Date>opt
<ApplicationUse MS-DOS filename>opt
12
2.4 The Effects of the Pack Line on Channel-Interleaving
When channel-interleaving is used, each sector within the same ISO file can be
identified by a channel number. Use the BeginTimeF line, EndTimeF line, Realloca-
tion line, UnitSize line, GapSize line and Pack line to control the positioning of the
channels. The effects of the Pack line are described below.
The Pack line is used to increase the efficiency of disc space usage. Dummy data may
be generated in the beginning, middle or end of the ISO file depending upon the
specifications of the BeginTimeF, UnitSize and GapSize lines. The Pack line can be
specified to generate an ISO file without these dummy data areas.
Each has a beginning (BeginTime) and ending (EndTime) specification. The relation-
ships of the specified position and the actual position where data is located are shown
below.
(1) When BeginTime is specified
BeginTime
Gap Gap
Unit
14
(4) When EndTime, UnitSize and GapSize are specified
EndTime
Gap
Unit
=
BR(MV) BR(MA) BR(F1)
+ + × 2324 + BR(F2)
2296 2279 2048
This relationship must always be maintained when the data is multiplexed. It is
verified during execution and an error is returned if the relationship does not hold.
Note also that a maximum of 10 streams can be MPEG multiplexed.
16
3.0 Supplementary Description of the Updateool
T VCDUTL.EXE
3.1 Introduction
This software modifies (updates) sections of existing CD images as DOS files. Partial modi
fication of an existing CD image is best accomplished by using the disc builder software to
rebuild the CD image, though it is a time-consuming and inefficient process. This software
is intended to quickly modify CD images without having to return to the disc rebuild
process.
In this example the DOS file called DOSFILE.D01 (in the ISO9660 file called ISO1FILE.DDD
included in the CD image created by TSTGAME) is replaced with the DOS file called
DOSFILE.D02.
The underlined portions of the text below from page 65 in the main manual have also
been revised.
Example:
VCDUTL∆TSTGAME∆ISO1FILE.DDD∆DOSFILE.D01∆DOSFILE.D02
∆[f∆TSTGAME.PAT][ENTER]
Options
-f Option
TSTGAME.PAT is the name of the update data file (may be user specified) for DOS file
replacement.
When this option is specified, the CD image itself will not be updated. This update data
file will be used during emulation.
18
(2) Executing Partial Updates
To replace the DOS file pat_7.dat in the ISO file (ISOF1.DAT;1) that comprises the
disc image (test1.dsk) of project file test1 with DOS file pat_1.dat, enter the fol-
lowing. Note that the ISO file name must be specified in upper-case English.
When this results in a pat_1.dat file size that is equal to or smaller than pat_7.dat,
the pat_7.dat section of the disc image is replaced by pat_1.dat. To execute real-
time mode emulation, enter:
VCDEMU test1
When the -f option is added, the update data file is created without updating the
disc image.
VCDUTL test1 ISOF1_1.DAT;1 pat_7.dat pat_1.dat -f test1.pat
The update information file test1.pat is created as a result. To run emulation, add
the -u option and startup the VCD emulator. To execute a direct DOS access mode
emulation, enter:
VCDEMU
When,
VCDEMU test1
is entered alone, note that the pre-existing disc image test1.dsk will be used in the
real-time mode emulation.
4.1 Introduction
This software is a tool for converting data between Motorola and Intel endian for-
mats. The CD-DA data file accepted by the Virtual CD system must be in Intel's little
endian format. When the CD-DA data file is in Motorola's big endian format, con-
vert it using this tool.
4.2 Usage
Command: SWAP
Command name: Performs byte swap
Function: Converts the byte order of the specified DOS file and creates a new DOS file.
Format: SWAP [-option] Oldfilename Newfilename
Description: Oldfilename: the name of the DOS file to be byte-swapped.
Newfilename: the DOS file created as a result of the byte-swap
20
5.0 Script Keywords
22
Table 3: Script Keywords (3)
24
Table 5: Script Keywords (5)
BitRate ......................................................................................................................... 6, 16
Case sensitivity .................................................................................................................. 5
Channel numbers ............................................................................................................. 13
Channel-interleaving .............................................................................................. 6, 13, 24
Disc builder program .......................................................................................................... 4
Fast-forward scan replay.................................................................................................... 4
File source types ................................................................................................................ 6
Indexes, number of ............................................................................................................ 4
ISO9660 file name ..................................................................................... 5, 17, 22, 23, 25
MpegFlush command ......................................................................................................... 7
New options ....................................................................................................................... 3
Pack line..................................................................................................................... 13, 14
Relative Extent time ......................................................................................................... 15
Relative File time .............................................................................................................. 15
Relative position parameters .............................................................................................. 5
Relative Session time ....................................................................................................... 15
Reverse scan replay .......................................................................................................... 4
Scripts .......................................................................................................................... 8, 14
Sector rate .................................................................................................................. 16, 24
Sector rate parameters ...................................................................................................... 6
SWAP ............................................................................................................................... 20
Tracks, number of .............................................................................................................. 4
Unsupported keywords ...................................................................................................... 5
Version numbers ................................................................................................................ 5
26
TM
Virtual CD System
(Release 3)
Limitations
Doc. # ST-182-081294
Replace this IC
MEM1
Mark
Part Surface
Connector
CPU
Edge Connector
5. Install the new Ver.3.1 EP-ROM, sent with this notice, into the same location by
pressing it into the IC socket; make sure the direction of the new IC is correct
and confirm that it has been correctly installed.
6. Reverse the above procedures to reinstall the board back into the computer.
7. Install the main software and verify the operation of the new software by fol-
lowing the procedures in the operation manuals.
Items Supplied
· Virtual CD System and Sample Program
Vol 1/3 · · · 1
2/3 · · · 1
3/3 · · · 1
· Virtual CD System and Sample Program Installation method
· Virtual CD System (Release 3) Restrictions
End
2
Virtual CD System (Release 3) Limitations
VCDEMU
1. The file interleave function in direct DOS file access is not supported.
2. The channel interleave function in direct DOS file access is not supported.
(Is scheduled to be in the final specification.)
3. Scan FWD/REV is not supported.
4. Multi-index is not supported.
VCDPRE, VCDBUILD
1. The following keywords are removed from the limitations list: Pause, PreGap,
PostGap. Refer to Virtual CD Software release 2 documentation for other
limitations. (In the CD tool and software library supporting documentation.)
2. Always use the File command and the EndFile command in the CDDA track.
Currently CDDA must be defined as a ISO9660 file.
Other
1. Some script lines are scheduled to be changed for the next release.
2. VCDUTL is not included.
4
6. Reading the Program
Start the program development machine and Model M and execute the follow-
ing:
:[BOOT ROM Initialization]
:<jvc.ini(RET)
:g 6002000(RET)
For more information on virtual CD, refer to the Virtual CD System User’s
Manual.
WRITE-ONCE
CD-R System
User's Manual
Doc. # ST-201-B-092994
User’s Manual
Introduction ............................................................................................................................. 3
Installation ............................................................................................................................... 4
Hardware Installation ..................................................................................................... 4
Software Installation ........................................................................................................ 4
Troubleshooting ..................................................................................................................... 7
Image File Errors .............................................................................................................. 7
Image File Format Errors ................................................................................................ 7
IRSC Length Errors .......................................................................................................... 7
Cue Sheet Errors ............................................................................................................... 7
Errors Generated by the Relationship between the Host
Machine and CD-R Recording Unit .............................................................................. 8
CD-R Image Transmission Error ............................................................................. 8
CD-R Recording Unit Setting Errors ...................................................................... 8
Errors Returned by CD-R Recording Unit ............................................................ 8
2
Introduction
Hardware Installation
Connect the YAMAHA CDE/CDR100 CD-R recording unit (CDE100 is the model
name for CDR100 with the system case) to the host machine using the SCSI interface.
See the CDR100 manual for details and how to connect the recording unit.
Setting CDR100 SCSI ID to 5, eliminates the necessity of setting the SCSI ID to the
command segacdw argument each time.
Software Installation
Copy the segacdw execution file from the floppy disk distribution medium to the
hard disk of your host machine. Set the PATH if necessary.
4
Command Reference
Command name:
segacdw
Syntax:
segacdw [-i #] [-s #] [-t] image_prefix
Description:
This command writes to a CD image file a CD-R using YAMAHA’s CDR100
CD-R recording unit. The command is invoked from the system command
prompt.
Arguments:
The name of the CD image file is specified to the image_prefix image_prefix.
The name of CD image file is the prefix of files which have the .dsk, the .emu
and the .toc file name extensions. These files must all be in the same direc-
tory. The CD image files created with the Virtual CD System should have the
file name extension .dsk. Use the file name extension .emu for the CD image
files created with the C-Trac Builder.
Options:
-i Specifies the distination to be transmitted the CD image files by the
SCSI ID 0 to 7. In other word, specify SCSI ID of CDR 100. The default
is 5.
-s Specifies the writing speed. Specify any one out of the values 1
(normal speed), 2 (double speed) and 4 (quadruple speed). The default
is 4, which writes at quadruple speed.
-t Write with CDR100 test mode. The actual CD-R is not written on it.
Examples:
To record a CD image file consisting of test.dsk and test.toc onto a CD-R,
specify as follows.
C> segacdw test
The following is the test to record at double speed on a recording unit with a
SCSI ID of 6.
C> segacdw -i 6 -s 2 -t test
Command name:
gentoc
Syntax:
gentoc [-v] image_prefix
Description:
This command generates a TOC file from a CD image file created using C-
Trac Builder for MEGA-CD/SEGA-CD. The command is invoked from the
system prompt.
Arguments:
The name of the CD image file is specified at an image_prefix image_prefix.
The CD image file name is the prefix of a file which has the an .emu file name
extension.
Options:
-v Displays such information as the contents of the Cue sheet.
Example:
To generate TOC file test.toc from test.emu, specify as follows.
C> gentoc test
6
Troubleshooting
The following sections describe the measures against the error message display.
The following error message is displayed when the CDR100 firmware version of the
is old and cannot create CD discs for SEGA Saturn. Change to the correct version of
the CDR100 firmware.
• Firmware upgrade of CD recorder is needed to use this software.
8
• Command Sequence Error
• Medium Format Corrupted
• Write Data Error with CU
• Monitor Atip Error
• Invalid Bits in Identify Message
• Diagostic Failure
• Power-On or Self Test Failure
• Internal Controller Error
• SCSI Parity Error
• Write Operation in Progress
• Medium(Caddy) Load or Eject Failed
• Unable to Read TOC, PMA or Subcode
• Operator Medium Removal Request
• End Of User Area encountered on this Track
• Illegal Mode for this Track
• Illegal Track
• Command Currently Not Valid
• Medium Removal Is Prevented
• Stopped on Non-data block
• Invalid Start Address
• Attempt to cross track-boundary
• Illegal Medium
• Application Code Conflict
• Ilegal block-size for command
• Block-size Conflict
• Request for Fixation Failed
• End Of Medium Reached
• Illegal Track Number
• Data Track Length Error
• Buffer Under Run
• Illegal Track Mode
• Optimum Power Calibration Error
• Calibration Area Almost Full
• Current Program Area Empty
• No EFM at search address
• Link Area Encountered
• Calibration Area Full
• Dummy blocks added
• Block size format conflict
• Current Command Aborted
• BARCODE READING ERROR
• Recovery Needed
• Can’t Recover from track
• Can’t Recover from Program Memory Area
• Can’t Recover from Lead-in Area
• Can’t Recover from Lead-out Area
• Laser Current Over
Program Library
User's Guide 1
CD Library
Doc. # ST-136-R2-093094
In translating/creating this document, certain technical words and/or phrases were interpreted
with the assistance of the technical literature listed below.
2. Computer Dictionary
Kyoritsu Publishing Co., LTD.
Tokyo, Japan
1978
ii
CONTENTS
iii
8.0 Function Specifications .............................................................................................................. 32
8.1 Directory Control ........................................................................................................... 33
8.2 File Operations ............................................................................................................. 35
8.3 Return-Upon-Completion Read .................................................................................... 37
8.4 Immediate-Return Read ............................................................................................... 38
8.5 Read Parameter Settings ............................................................................................. 41
8.6 Other............................................................................................................................. 42
Appendix C ............................................................................................................................................. 48
C.1 Additional Explanation .................................................................................................. 48
C.2 Changes from the Previous Version ............................................................................. 48
iv
(This page was blank in the original Japanese document.)
v
1.0 Outline
1.1 Features
This library has the following features.
Compatible CD ROMs
· Capable of accessing ISO9660 level files.
· This library does not cover access that utilizes CD ROM XA sub-header
information.
Data Buffering
· Access is performed that assumes a CD block buffer control mechanism.
· In addition to simply reading files, pre-reads using the buffer are possible.
File Identifiers
· Access is based on file identifiers (order in directory).
· Eliminate a drop in speed caused by searching directories.
· Access by file name is possible by using a function that converts from the file
name to a file identifier.
Directory Operations
Library initialization, directory information reads, current directory settings and
other functions are provided.
Function Function performed
GFS_Init Initializes the library and mounts CDs
GFS_LoadDir Reads directory information
GFS_SetDir Sets the current directory
GFS_NameToId Converts a file name to a file identifier
GFS_IdToName Converts a file identifier to a file name
File Operations
Opens, closes, seeks and performs the other common operations on files listed be-
low.
Function Action
GFS_Open Opens a file
GFS_Close Closes a file
GFS_Seek Moves the access pointer
GFS_Tell Gets an access pointer
GFS_IsEof Checks if an access pointer is at the end of a file
GFS_ByteToSct Converts the unit from byte to sector
GFS_GetFileSize Gets the file size
GFS_GetFileInfo Gets file information
Return-Upon-Completion Read
Reads data from files. Control does not return from the function until the reading of
data is complete.
Function Action
GFS_Fread Reads data from opened files
GFS_Load Specifies a file identifier and then reads data
2
Immediate-Return Read
Reads data from files by means of a request function and a server function. The
request issued by the request function is processed by the server function one pro-
cessing unit at a time. The server function must be recalled repeatedly. By inserting
application processing into the server function call loop, execution of the application
can be continued until completion of the data read.
Function Action
GFS_NwFread Issues a data read request
GFS_NwCdRead Issues a read request to the CD buffer
GFS_NwIsComplete Checks if read processing is complete
GFS_NwStop Stops read processing
GFS_NwGetStat Gets the access status
GFS_NwExecOne A server function for one file
GFS_NwExecServer A server function for multiple files
Other
CD pickup control, registration of error processing functions, and getting the error
status are provided. The error processing function is called when an error occurs.
Function Function performed
GFS_CdMovePickup Moves the CD pickup
GFS_SetErrFunc Registers the error processing function
GFS_GetErrStat Gets the error status
Application
File System
CD Communiation
I/F Library SCSI Driver
SIMM
SCSI I/F
Hardware CD Block IBM PC
HD
Debugging Module
In order to use this library, it is necessary to link the following libraries at the same
time.
4
2.0 Basics
2.1 Glossary
The terms used to explain the file system library are defined in Table 2.1.
Grouping of names
“ABC_-” indicates several names beginning with ABC_. For example, ABC_X, ABC_Y
and ABC_Z.
Symbol Specification
“!MMM/SSS” indicates the symbol SSS defined by MMM. It is also a notation used
with E7000 commands.
Hexadecimal Notation
Numbers with an “H” affixed to them at the end are hexadecimal numbers.
In the applications that use these libraries, be careful not to use designations that
conflict with these naming conventions.
6
3.0 Directory Operations
3.1 Initialization
Before using this library, GFS_Init must be executed. GFS_Init performs the following
processing:
· Initialization of library work area
· Mount processing
Initialization
Sets the work area used by the library and initializes it. The application must provide the
work area and the directory information storage area.
Since the size of the area changes with the number of files opened at the same time, it
should be obtained using the following macro. The statement open_max is the maximum
number of files that can be opened at once.
GFS_WORK_SIZE(open_max)
Mount Processing
The root directory is read from the CD ROM and this is made the current directory. It also
initializes the CD block and erases all the sector data in the CD buffer. Since the file system
only holds the top address of the directory information storage area, the application must
not change the contents of the area.
The directory information control structure is initialized and GFS_Init called as shown
below.
#define OPEN_MAX 20 /*maximum number of files to be opened at
the same time */
#define MAX_DIR 10 /*maximum number of directories */
Uint32 work[GFS_WORK_SIZE(OPEN_MAX)/4]; */
GfsDirTbl dirtb1; /*directory information control structure
GfsDirId dir[MAX_DIR]; /*directory information storage area */
Parent
0 Self
Current directory FILE1.DAT 1 Parent
FILE1.DAT
FILE2.DAT 2
FILE3.DAT 3
4 FILE2.DAT
File identifier
Program Example FILE3.DAT
8
3.3 Sub-Directory Operations
In order to access files in a sub-directory, it is necessary to set the current directory
information by calling the following functions.
· Read directory information (GFS_LoadDir)
· Set current directory (GFS_SetDir)
A method in which the directory information is read in advance and CD ROM
access is lost when the file is opened is allowed.
(a) GFS_DIR_ID
· Does not save the file name. Files can only be accessed by means of a file
identifier.
(b) GFS_DIR_NAME
· Saves the file name and therefore an area larger than (a) above is required.
· Access by file name is allowed.
Root Directory
[Logical structure of CD ROM]
0
1
2
Directory 3
information area Sub-directories
0 File
Directory 1
Set current
information
directory 2
Read
3
GFS_SetDir GFS_LoadDir
0
Directory 1
information
2
Read
3
GFS_LoadDir
GFS_DIRTBL_TYPE(&dirtbl) = GFS_DIR_ID;
GFS_DIRTBL_NDIR(&dirtbl) = MAX_DIR;
GFS_DIRTBL_DIRID(&dirtbl) = dirid;
GFS_LoadDir(dir_fid, &dirtbl); /*reads directory information */
10
Example: Simultaneous access of multiple files in different directories
In order to access files in different directories, the target files must be opened while
switching the current directory. An example is shown in which two files in the two sub-
directories directly below the current directory are accessed simultaneously. This file
identifiers of the two sub-directories with the files to be accessed are respectively
specified by dir_fidl and dir_fid2.
#define MAX_DIR 10
GfsDirTbl curdir;
GfsDirTbl dirtbl1, dirtbl2;
GfsDirId dirid1[MAX_DIR];
GfsDirId dirid2[MAX_DIR];
Sint32 dir_fid2, dir_fid2;
Sint32 fid1, fid2;
GfsHn gfs1, gfs2
if (fid < 0) {
return NULL;
}
return GFS_Open(fid);
}
Initialization
In order to utilize the functions of the CDBFS, NULL must be specified for the
pointer to the directory control structure and GFS_Init must be called. Upon comple-
tion of processing by GFS_Init, the root directory is set by the CDBFS.
The functions GFS_Init and GFS_LoadDir, which read directory information, return
the number of directories read as the function value. When the CDBFS is used, that
number becomes the number of directories the CDBFS is holding.
An error results if a file name is used when the current directory of the CDBFS is set.
12
4.0 File Access
GFS_NwCdRead GFS_Fread
GFS_NwFread
Read Fetch
CD Block
Transferring data from the CD ROM to the CD buffer is called “reading”, and trans-
ferring data from the CD buffer to the host area is called “fetching”.
By utilizing GFS_Fread and GFS_NwFread, an application can transfer data from the
CD ROM without being aware of read processing. To control read processing from
the application, use GFS_NwCdRead.
1 sector
AP1 AP2
The opened file occupies one filter, which is a CD block resource, and one buffer
partition at a time.
14
5.0 Access Modes
The two access modes provided by this library are described below.
· Return-upon-completion access
Control is not returned to the application until completion of access.
· Immediate-return access
Control is returned as soon as an access request is received.
Example:
#define BUF_SIZE 2048
GfsHn gfs;
Sint32 fid;
Sint32 nsct = 1;
Uint32 buf[BUF_SIZE]
gfs = GFS_Open(fid);
GFS_Close(gfs);
Example:
#define BUF_SIZE 2048*2
for (;;) {
/*server function */
stat = GFS_NwExecOne(GFS); /*executes read */
if (stat == GFS_SVR_COMPLETED) {/*read complete? */
break;
}
user(); /*optional user process */
}
16
Immediate-ReturnAccess for Multiple Files
The server function for continuous access of multiple files is GFS_NwExecServer.
The request function is used in common with access of single files.
The application issues a request for access of multiple files. Following this, access is
executed sequentially by periodically passing control to the server. Access is per-
formed one at a time in the order of the requests.
Here is an example of a program that performs user processing while reading three
files.
Example:
/*number of sectors read from each file */
#define NSCT1 1
#define NSCT2 2
#define NSCT3 3
/*size of data storage area of each file (unit: byte) */
#define BSIZE1 2048*NSCT1
#define BSIZE2 2048*NSCT2
#define BSIZE3 2048*NSCT3
Example:
#define SECT_SIZE 2048
#define FILE_ SIZE 10000*SECT_SIZE
#define RD_UNIT 10
gfs = GFS_Open(fid);
GFS_NwCdRead(gfs, FILE_SIZE); /*pre-read specification for CD buffer */
GFS_SetTransPara(gfs, RD_UNIT); /*maximum RD_UNIT sector fetched once */
for (i = 0; i < FILE_SIZE / RD_UNIT; ++I) {
/*read and processing buffer settings
if (i & 1) {
rd_bp = buf1;
proc_bp = buf2;
} else {
rd_bp = buf2;
proc_bp = buf1;
}
/*executes fetch from CD buffer
GFS_NwFread(gfs, RD_UNIT, rd-bp, RD_UNIT * SECT_SIZE);
do {
if (i > 0) {
user_process(proc_bp);
} else {
user_process0();
}
GFS_NwExecOne(gfs);
GFS_NwGetStat(gfs, &stat, &nbyte);
} while (nbyte < RD_UNIT * SECT_SIZE);
}
18
6.0 Other Functions
1) Substitution
The directory information from a debugger file of the same name as the CD ROM
file is set to the directory information area in place of the corresponding CD ROM
file.
2) Addition
A debugger file for which substitution was not performed is added to the directory
information storage area.
In the substitution of the debugger file, the memory file takes precedence over the
DOS file. An example in which these processes are performed is shown below.
Figure 6.1 shows the file configuration.
The files with lines through them indicate that they have been replaced.
The files with lines through them indicate that they have been replaced.
As shown in the examples above, substitution and addition by a debugger file can
be performed on all directories of a CD ROM.
20
6.2 Error Processing Functions
By registering error processing functions, it is possible to specify that an error pro-
cessing function be called in the event an error should occur during execution of a
library function. Error processing functions are not registered in the initial state.
When an error does occur, the error processing function is executed using the fol-
lowing call format.
When control returns from the error processing function, the library function returns
control to the application using the error code as the function value.
22
7.0 Data Specifications
2) Logical Constants
These are used as logical (Boo1) values.
3) NULL Pointer
24
7.2 Constants
Title Data Data Name No.
Data specification File attribute GFS_ATR_- 2.1
The constants shown below indicate the presence or absence of their respective
attributes. These constants are used for attributes in directory information read by
GFS_Init and GFS_LoadDir and for attributes output by GFS_GetFileInfo.
The bits not shown here are undefined.
Bit 7 6 5 4 3 2 1 0
The constants shown below indicate the access status of the server. Therefore, output
using GFS_NwGetStat.
The constants below indicate the reference when moving an access pointer. These are
used as arguments for GFS_Seek.
The constants below indicate the method by which data are fetched from the CD ROM
buffer. These are used as arguments for GFS_SetGmode.
26
Title Data Data Name No.
Data specification Transfer mode GFS_TRANS_- 2.6
The constants below indicate the device that executes transfer from the CD buffer. These
are used as arguments of GFS_SetTmode.
The value of GFS_ERR_OK is "0". Other error codes have negative values.
28
7.3 Data Types
Holds information regarding file access for each file. The information is generated by
GFS_Open. Most functions that access files reference this data.
Directory information control structures can control directory information without file
names and directory information with files names. The following constants specify
which is controlled.
These are data types for controlling directory information. The directory information
table classification and its size and substance are held.
GfsDirTbl *dirtbl
Access macro Type Explanation
GFS_DIRTBL_TYPE(dirtbl) Sint32 Directory information table classification
GFS_DIRTBL_NDIR(dirtbl) Sint32 Maximum number of elements in directory
information table
GFS_DIRTBL_DIRID(dirtbl) GfsDirId * Pointer to directory information table with
no file names
GFS_DIR_NAME(dirtbl) GfsDirName * Pointer to directory information table with
file names
These are directory information structures with no file names. GFS_DIR_ID is used to
specify the type of directory information table (GFS_DIRTBL_TYPE).
GfsDirId *dir
Access macro Type Explanation
GFS_DIR_FAD(dir) Sint32 Top FAD of file
GFS_DIR_SIZE(dir) Sint32 Size of file (unit: byte)
GFS_DIR_FN(dir) Uint8 File number
GFS_DIR_ATR(dir) Uint8 File attribute
GFS_DIR_UNIT(dir) Uint8 Unit size of file (unit: sector)
GFS_DIR_GAP(dir) Uint8 Gap size of file (unit: sector)
These are directory information structures which include file names. GFS_DIR_NAME
is used to specify the type of directory information table (GFS_DIRTBL_TYPE).
GfsDirId *dir
Access macro Type Explanation
GFS_DIR_FAD(dir) Sint32 Top FAD of file
GFS_DIR_SIZE(dir) Sint32 Size of file (unit: byte)
GFS_DIR_FN(dir) Uint8 File number
GFS_DIR_ATR(dir) Uint8 File attribute
GFS_DIR_UNIT(dir) Uint8 Unit size of file (unit: sector)
GFS_DIR_GAP(dir) Uint8 Gap size of file (unit: sector)
GFS_DIR_FNAME(dir) Uint8[] File name *1
*1: The area size is 12 bytes. When the file name length is 12 bytes, the character string
does not end with '¥0.'
30
Title Data Data Name No.
Data specification Error processing function GfsErrFunc 3.5
GfsErrStat *stat
Access macro Type Explanation
GFS_ERR_FUNC(err) GFSErrFunc Pointer to error processing function
GFS_ERR_OBJ(err) void * First argument of error processing function
GFS_ERR_CODE(err) Sint32 Error code
32
8.1 Directory Control
Note: Work must be positioned in 4-byte boundaries. The CD block initialization flag,
standby time, ECC time and number of retries do not change.
When NULL is specified for dirtbl, an error will result if use of the CD block file
system is not declared with GFS_Init.
However, it is always possible to pass a pointer to an appropriate directory
information control structure other than NULL to dirtbl.
34
8.2 File Operations
In cases in which the sector length is not defined (Form1 and Form2 are mixed), then
"0" is returned.
Note: When lastsize for the file of form2 is 2048 bytes, then it must be processed as the last
sector having 2324 bytes of data.
36
Title Function Function Name No.
Function specification Get file information GFS_GetFileInfo 2.8
Syntax Sint32 GFS_Load(Sint32 fid, Sint32 off, void *buf, Sint32 bsize)
Input fid : file identifier
off : offset (unit: sector)
bsize : top limit of number of data to be loaded (unit: byte)
Output buf : data load area
Function value Number of loaded data (unit: byte); negative error code is returned in case of error.
Function Specifies file identifier and loads data from file. Open and close are performed within
the function.
If the file size is less than bsize, then data is loaded up to the end of the file. When
GFS_BUFSIZ_INF is specified for bsize, then data from the specified position up to
the end of the file is loaded
Note: Buf must be located at 4-byte boundaries.
The default values for the fetch mode, transfer mode, load parameters and fetch
parameters are used.
Syntax Sint32 GFS_Fread(GfsHn gfs, Sint32 nsct, void *buf, Sint32 bsize)
Input gfs : file handle
nsct : number of sector loaded
bsize : top limit of number of data to be loaded (unit: byte)
Output buf : data load area
Function value Number of bytes actually loaded.
Function Specifies an opened file handle and loads data from the file.
Loads nsct sectors of data from the access pointer. Of the data loaded, the data up to
the maximum bsize byte are written to buf.
The access pointer advances nsct sectors.
Note: There are restrictions on the address boundaries of buf depending on the transfer
mode.
· GFS_TMODE_SCU : no restriction
· Other than above : locate at 4-byte boundaries
Even if the access pointer is outside the file range specified by the file handle, it
undergoes read processing as part of the file. Even if the number of sectors specified
straddles the file end, the specified number of sectors undergo read processing.
Regardless of the value specified by GFS_SetReadPara, the default value is used for
the read parameter.
Syntax Sint32 GFS_NwFread(GfsHn gfs, Sint32 nsct, void *buf, Sint32 bsize)
Input fid : file handle
nsct : number of sectors loaded
bsize : size of load area (unit: number of bytes)
Output buf : data load area
Function value error code
Function Issues a request for data load in response to a server function. Upon completion of
the requested access operation, the access pointer advances nsct sectors.
Note: The same precaution as noted for GFS_Fread applies to the address boundary of buf.
Even if the access pointer is outside the file range specified by the file handle, it
undergoes read processing as part of the file. Even if the number of sectors specified
straddles the file end, the specified number of sectors undergo read processing.
38
Title Function Function Name No.
Function specification Start pre-read to CD buffer GFS_NwCdRead 4.2
40
8.5 Read Parameter Settings
42
AppendixA Utilization of Development Support Functions
44
Appendix B Error Processing Methods
The causes and remedies of the following error codes is shown below.
GFS_ERR_CDRD
Cause: Read error in CD block.
Remedy: Check CD ROM hardware and CD ROM media.
GFS_ERR_CDNODISC
Cause: The CD ROM is not set in place.
Remedy: Reset the CD ROM in place.
GFS_ERR_CDROM
Cause: A disc that is not a CD ROM has been inserted.
Remedy: Insert a disc that is a CD ROM.
GFS_ERR_DIRTBL
Cause: The contents of the directory control structure are not correct.
Remedy: Check whether a value or a correct value has been set in each mem-
ber of the directory control structure and whether that value is
correct before calling GFS_Init and GFS_LoadDir.
GFS_ERR_OPENMAX
Cause: The value for the maximum number of open files is incorrect.
Remedy: Check if the specification for the maximum number of files opened
by calling GFS_Init exceeds the range of 1 to 24.
GFS_ERR_DIR
Cause: The specified file is not a directory.
Remedy: Check correspondence between file identifiers and files.
GFS_ERR_CDBFS
Cause: An attempt to use the CD block file system was made even though
there was no use declaration.
Remedy: If the CD block file system is to be used, then specify NULL for the
directory control area address and call GFS_Init.
If the CD block file system is not going to be used, do not specify
NULL for GFS_LoadDir and GFS_SetDir.
GFS_ERR_NONAME
Cause: File names cannot be handled by the current directory.
Remedy: Specify a directory control area in which GFS_DIR_NAME has been
set to GFS_DIRTBL_TYPE and call GFS_Init or GFS_LoadDir.
GFS_ERR_NEXIST
Cause: The specified file name does not exist.
Remedy: Check if the current directory setting or the file name specification
is incorrect.
GFS_ERR_HNDL
Cause: File handle is incorrect.
Remedy: Check if the function value is set of GFS_Open in the variable in
which the file handle is stored, or that the contents of the variable
have not been destroyed.
GFS_ERR_SEEK
Cause: The seek location is incorrect.
Remedy: Check the seek position calculated from the reference position and
the offset.
GFS_ERR_ORG
Cause: The reference position of GFS_Seek is incorrect.
Remedy: Check to be sure the reference position is at one of GFS_SEEK_SET,
GFS_SEEK_CUR or GFS_SEEK_END.
GFS_ERR_NUM
Cause: A negative number of bytes was specified.
Remedy: Check the number of bytes specified by GFS_ByteToSct.
GFS_ERR_OFS
Cause: The offset is incorrect.
Remedy: Check the read start sector position specified by GFS_Load.
GFS_ERR_FBUSY
Cause: Processing of specified file handle remains to be performed.
Remedy: Correct the program so that it accesses again after completing
access of the target file, or reconsider the file structure.
GFS_ERR_PARA
Cause: Incorrect mode.
Remedy: Make sure that correct arguments are given to GFS_SetGMode,
GFS_SetTmode, GFS_SetReadPara and GFS_SetTransPara.
GFS_ERR_BUSY
Cause: Multiplex processing was attempted.
Remedy: Refer to “6.3 Multiple Processing”.
46
GFS_ERR_NOHNDL
Cause: No open file handles.
Remedy: Either increase the specification for the maximum number of files
that can be opened at the same time by GFS_Init or reduce the
number of files opened at the same time.
GFS_ERR_PUINUSE
Cause: GFS_CdMovePickup was called while the pickup was in use.
Remedy: Call GFS_CdMovePickup in a state in which file access is not being
performed.
GFS_ERR_ALIGN
Cause: The read destination of a file is not located at a word boundary.
Remedy: Position the read area at a word boundary.
GFS_ERR_TMOUT
Cause: A response was not received from the CD block in the prescribed
time period.
Remedy: Something may be wrong with the hardware.
GFS_ERR_CDOPEN
Cause: The tray on the CD drive is open.
Remedy: Close the tray and then continue.
GFS_ERR_BFUL
Cause: The CD buffer becomes full and reading is stopped when the fetch
mode is GFS_GMODE_RESIDENT.
Remedy: Adjust the order of access and the amount read to prevent the CD
buffer from becoming full , when the fetch mode is
GFS_GMODE_RESIDENT.
gfs = GFS_Open(fid);
GFS_NwRead(gfs, 100)
for (i = 0, i < 10; ++i) {
GFSNwFread(gfs, 10, buf, 10*2048);
while (GFS_NwExecOne (gfs) != GFS_SVR_COMPLETE) {
GFS_NwGetStat(gfs, &stat, &nbyte);
/*checks whether number of bytes specified by GFS_NwFread has been read */
if (nbyte >= 10*2048) {
break;
}
user(); /*application processing
}
}
48
2) Addition of CDDA File Processing Function
A CDDA file processing function has been added. When a CDDA file is read, the
music track specified by that file is played. However, in order to output sound,
SCSP must be set by the application. CDDA files and regular files have the
following differences.
• Control of files
The only controls the file system performs on CDDA files are playback and
playback range. The playback mode is an omitted value (no repeat, moves
pickup).
• Pre-read
Since the data from CDDA files does not enter the CD buffer, when they are
accessed, pre-read processing and normal access are equivalent.
• Parameters relating to file operation
The fetch mode, transfer mode, read parameters and fetch parameters cannot
be changed for CDDA files. An error is returned when the following functions
are called for CDDA files.
GFS_SetGmode
GFS_SetTmode
GFS_SetReadPara
GFS_SetTransPara
3) File attributes
The following changes were made to make the values of file attributes output by
GFS_GetFileInfo conform with the CD-ROM XA standard.
GFS_ATR_DIR 0x80
GFS_ATR_CDDA 0x40
GFS_ATR_INTLV 0x20
GFS_ATR_FORM2 0x10
GFS_ATR_FORM1 0x80
GFS_ATR_END_TBL 0x01
GFS_ATR_CDD was added because of the addition of CDDA file processing
functions. Its bit are “1” in the CDDA files. Other constant names and meanings
are unchanged.
• GFS_ERR_FATAL
This error code serves notice that the CD drive is in a fatal condition. When the
file system detects this condition, CD playback is stopped (seek home position)
and recovery from the error condition is attempted. If this error condition is
detected, try processing again.
• File identifiers
We eliminated the function that automatically added “.” and “..” (current
directory and parent directory) when a CD file is not used. Because of this, file
identifiers agree at the time of boot up.
50
TM
CD
Development Tool
Description File
Doc. # ST-211-110494
Install these tools into the directory equivalent to the software library
<SATURN¥SEGABIN¥BINCD>.
The script files (JVC.SCR and BTSMPFS.SCR) that were provided in the software
library were changed.
Translator’s Notes
• The tool was modified so that processing stops when a duplicate file name is
detected.
2
TM
SEGA SATURN
Master CD-ROM
Release Form
Doc. # ST-242-R2-010496
Company Name of
Developer:
Supported Peripherals
Suffix Virtua Fighting
Product Number 6-Player Stunner
number Stick
Mission
T- SATURN Mouse
Stick
Arcade
M- SATURN Control Pad Racer
Starts
NA File Name
from
Back System/Backup Ends
Up at
Cartridge
RAM
Backup Cartridge Number Number Total number of
of files of blocks ____ blocks per file
only ____ blocks
QSound No Yes
Cinepak No Yes
TrueMotion No Yes
Other
Alternating
Pause
Sales Region Specification Case Type
Japan Asia NTSC North America Central and South America Normal Single
Korea East Asia PAL Europe PAL Central and South America PAL Other Multi
Other:
CD-DA PCM
List below if systems other than those listed above were used. Please note that disc writers and media configurations other than those specified
by SEGA will not be approved.
Comments
• With the exception of the questions that are preceded by the H mark, ALL of the
answers in the forms must generally be answered YES.
• In the case that you give an answer other than YES, make sure to explain the
answer clearly in the spaces provided so that SEGA can verify it. Please note that
your submission will be rejected if we cannot verify your answers.
EXAMPLES
a. A bus request is made to the Z80 before the DMA-related registers are set.
YES NO N/A
Reason Check where applicable:
: Conforms to condition 1 in section 2 of Technical Bulletin #26.
Other:
a. A bus request is made to the Z80 before the DMA-related registers are set.
YES NO N/A
Reason Check where applicable:
: Conforms to condition 1 in section 2 of Technical Bulletin #26.
Other:
2. CD drive usage is kept within 33% of its duty ratio in 10 minutes of use.
YES NO N/A
Reason:
II. VDP2
The SEGA SATURN Software Library (SATURN Basic Library) is used.
YES NO
1. The color data is stored in Color RAM after the Color RAM Mode bit
(CRMD0~1) is set.
YES NO N/A
Reason:
III. SMPC
The SEGA SATURN Software Library (SATURN Basic Library) is used.
YES NO
2. Commands are always issued according to the SMPC command protocol (ex.
checking and setting the SF register).
YES NO N/A
Reason:
5. When writing to the backup memory, the Reset button is disabled by the Reset
button disable command.
YES NO N/A
Reason:
6. After the SF register is set, the program does not wait for it to be cleared
without a command code being written to the COMREG.
YES NO N/A
Reason:
8. When the interrupt back (IntBack) command is used, SMPC interrupts are
not disabled.
YES NO N/A
Reason:
10. Software branching of the game application does not occur when the B or C
buttons are pressed during the boot sequence of the game.
YES NO N/A
Reason:
IV. SCU
The SEGA SATURN Software Library (SATURN Basic Library) is used.
YES NO
6. Reads and writes are not executed in unused address areas (ex. 25FE00ACh).
YES NO N/A
Reason:
10. Writes are executed to the A-Bus set register after a dummy read is executed
during a non-access period.
YES NO N/A
Reason:
14. When the read address update bit is "1," the read address add value bit is also
set to "1."
YES NO N/A
Reason:
15. When the write address update bit is "1," the write address add value bit is set
according to the appropriate bus region.
YES NO N/A
Reason:
18. The DMA mode, address update, activation source selection register, and DMA
set register are not modified during the execution of that level's DMA.
YES NO N/A
Reason:
19. When using the indirect DMA mode, the illegal DMA interrupt status bit is not
referenced.
YES NO N/A
Reason:
20. When the DSP is activated, the program termination interrupt flag of the DSP
program control port (25FE0080h) is always set to "0."
YES NO N/A
Reason:
21. When executing a DSP DMA, the address add value for transfers from the B-
bus to the DSP data RAM is always set to 010b.
YES NO N/A
Reason:
22. A usable value within range is set in the timer 0 compare register.
YES NO N/A
Reason:
23. Data larger than the count number of 1 line is not set in the timer 1 set data
register.
YES NO N/A
Reason:
a. This software is compatible with SEGA SATURN hardware of the target sales
region.
YES NO N/A
Reason:
5. Verification with NTSC hardware for Asian countries other than Japan.
SUPPORTED UNSUPPORTED
a. Functions normally with a NTSC SATURN for Asian countries other than
Japan.
YES NO N/A
Reason:
3. All important information (such as scores) are displayed with a margin of 1 cell
from the top/bottom sides of the screen and 2 cells from the right/left sides of
the screen.
YES NO N/A
Reason:
6. The SATURN transfers control to the game application correctly from the
Audio CD Control Screen. The disc access time is appropriate.
YES NO N/A
Reason:
7. No glitches occur during playback of video sequences. (Ex. Does the video skip
or stutter?)
YES NO N/A
Reason:
III. Sound
1. There are no sound glitches or problems with sound volume levels. (Ex. Is a
sound too loud compared with other sounds?)
YES NO N/A
Reason:
3. The switching of stereo/mono audio playback during the game and the Audio
CD Control Screen is effective.
YES NO N/A
Reason:
If you've answered Unsupported, then circle N/A for all of the items below.
a. All 11 characters are used for the backup file name. (Only numbers, capitalized
alphabet, and underscore "_" characters may be used. Spaces are not acceptable.
Note that the first character of the name cannot be a number. If there is an
insufficient number of characters to fill the 11 character requirement, insert the
underscore character "_" to fill the spaces.)
YES NO N/A
Reason:
c. When the game detects damaged backup game data, a message that instructs
the player to erase the damaged data is displayed.
YES NO N/A
Reason:
d. The save procedure does not damage existing backup game data for other
games.
YES NO N/A
Reason:
f. Saved backup data can be loaded correctly by the game (there are no problems
continuing from a saved game).
YES NO N/A
Reason:
a. The Control Pad operates correctly. The button set-up/operations follow SEGA
SATURN Software Development Standards.
YES NO N/A
Reason:
d. No problems occur when a defective pad (i.e. A modified pad that allows 4
direction keys to be pressed simultaneously) is used.
YES NO N/A
Reason:
f. When a Control Pad is connected directly to Control Port 2 only, all pad button
input from that Control Pad is ignored.
YES NO N/A
Reason:
h. No problems occur when there is rapid and repeated button input. (Especially
when the Start button is pressed repeatedly).
YES NO N/A
Reason:
a. The Virtua Stick operates correctly. The button set-up/operations follow SEGA
SATURN Software Development Standards.
YES NO N/A
Reason:
e. When a Virtua Stick is connected to Control Port 2 only, all input from that
controller is ignored.
YES NO N/A
Reason:
g. No problems occur when there is rapid and repeated button input (Especially
when the Start button is pressed repeatedly).
YES NO N/A
Reason:
b. The game does not crash when a peripheral (such as a Control Pad) is
connected/disconnected from the 6Player.
YES NO N/A
Reason:
d. The pause enable/disable functions during multi-player game play have been
implemented according to SEGA SATURN Software Development Standards.
YES NO N/A
Reason:
b. The game does not crash or glitch when used with the SATURN Mouse. (This
applies even if the software does not support the SATURN Mouse.)
YES NO N/A
Reason:
c. The SATURN Mouse operates correctly when connected to either Control Port
1 or Control Port 2 by itself.
YES NO N/A
Reason:
Reason:
c. After the pause is cleared, sound continues from the pause point (The point
before the disc access lamp goes into standby status display.)
YES NO N/A
Reason:
e. The pause feature is disabled during the SEGA logo, title screen, demo, ending,
and blank screens.
YES NO N/A
Reason:
a. When the Reset button on the SATURN is pressed, the system reboots from
the SATURN logo.
YES NO N/A
Reason:
c. Normal reset occurs when the Reset button on the SATURN and other buttons
on the Control Pad are pressed simultaneously.
YES NO N/A
Reason:
f. Settings such as those found in the options screen remain intact when a
software reset is executed (Applicable only when the reset occurs DURING
game play).
YES NO N/A
Reason:
g. If the CD door is opened at any time during play, the game goes to the Audio
CD Control Screen. (Also applicable during the loading of data as well as video
playback.)
YES NO N/A
Reason:
3. The high scores are retained in memory after a software reset during game
play.
YES NO N/A
Reason:
VIII. Miscellaneous
1. For SEGA SATURN software sold in the United States, the trademark
information of the SEGA logo is correct (The SEGA logo displayed with ® must
be displayed in its final trademarked form for approximately 2 seconds.).
YES NO N/A
Reason:
2. After the conclusion of the ending sequence, the game returns to the SEGA
logo screen by button input or after a preset time period.
YES NO N/A
Reason:
3. The ending sequence and the game credits cannot be canceled by button input
(If it cannot be canceled, circle YES; if it can be cancelled, circle NO.).
YES NO N/A
Reason:
4. The game screen display sequence is correct (SEGA logo → title screen → demo
→ game → SEGA logo.)
YES NO N/A
Reason:
7. The game exhibits no problems when aged over 5 hours (After power-on, the
game is left running by itself with no player interaction.).
YES NO N/A
Reason:
8. There are no scratches longer than 1mm on the recording side of the master
disc.
YES NO N/A
Reason:
10. There are no disc errors when the disc is verified with a CD error checker.
YES NO N/A
Reason:
11. The master disc is recorded on SEGA-approved disc media. (Ex. YAMAHA 4X
CD-R disc with SEGA SATURN logo.)
YES NO
12. Are there any hidden command functions that display screens containing
messages such as copyright notices?
YES NO
13. No content problems are present in the game credits (The contents of the game
credits follow the guidelines contained in the SEGA SATURN Software
Development Standards.)
YES NO N/A
Reason:
MPEG
Stream Build
Precautions
Doc. # ST-129-R2-SP2-082495
Precautions:
When a disc builder is used to build an MPEG stream file, dummy data (empty
sectors) is filled in the file equivalent in size to the difference between the sector rate
and bit rate. This creates the following problems:
(a) The resulting file size is larger than necessary.
(b) Pre-reads to the CD buffer become ineffective.
Select the smallest sector rate permitted by the range given below to delete empty
sectors. In other words, the sector rate should be the smallest possible value, but
larger than the total bit rate.
Please refer to section 2.6, The Relationship between Sector Rates and Bit Rates on page
16 of the Virtual CD System Supplementary Manual (ST-129-R2-SP1-061995) for infor-
mation on how to calculate the sector rate.
Branching
Playback Library
User's Manual
Doc. # ST-136-D-R2-082495
The Branching Playback Library (BPL) enables seamless reading of data streams, based
on a pre-defined scenario. This allows the system to branch between streams smoothly
during reads.
The BPL, however, manages only the data streams that are necessary for branching.
Use a decode-only library such as MPEG and Cinepak in conjunction with BPL to play
back data such as audio and video.
Application
Cinepak Branching
Library Playback
MPEG (CPK) File System
Library (BPL)
Library (GFS)
(MPG)
Hardware SIMM,
CD Block
SCSI File
The Branching Playback Library requires each of the following libraries: Stream Sys-
tem, File System, and CD Communication Interface.
4
1.2 Summary of Branching Playback Library Functions
1. Setting the Branch Destination (Scenario) Information
This function sets destination stream candidates as destination (scenario) information.
Select a Application
destination
BPL
Stream handle
2.1 Definitions
Other terms that appear in this manual are based on the CD Communication Interface,
the File System, and the Stream System Libraries.
The libraries required by the BPL use the following global symbols:
6
3. How the BPLWorks
A
p
Sets branch stream infor- p
mation and destination l
Sets a scenario i
information.
(BPL_SetStmInfo c
BPL_SetBranchInfo) a
t
i
Selects a destination o
(BPL_SelectBranch) n
Branch Number
bstm6 bstm16
0
bstm2 bstm7
bstm8
bstm1 1 bstm9 bstm17 bstm19
bstm3 bstm10
2 bstm11
bstm12 bstm18
bstm4
bstm13
3 bstm14
bstm5 bstm15
(a) This scenario specifies bstm1 as the branch stream to be read first. The BPL then
starts reading bstm1.
(b) The application fetches the branch stream that is currently being read and sets it in
the decoder.
(c) After reading bstm1, the BPL begins reading branch candidates (branch streams
that may be fetched next) bstm2, bstm3, bstm4, and bstm5. Effective use of the CD
buffer and smoother branching is made possible by pre-reading branch candidate
streams.
(d) The application fetches events such as input from a control pad and selects the
destination for branching. If branch numbers 0~3 are assigned to branches bstm2,
bstm3, bstm4, and bstm5, and if 1 is specified, reading of bstm2, bstm4 and bstm5,
which is no longer needed, is canceled. If necessary, the application fetches the
destination stream and sets it in the decoder.
(e) After fetching bstm1, the BPL begins fetching bstm3.
If the application specifies the execution of branching to the Branch Play Server,
the BPL begins reading bstm9, bstm10, and bstm11, as in (c).
8
3.3 Changing Branching Playback States
Table 3.1 shows branching playback states. Figure 3.1 shows a branching playback
state transition diagram.
Initialize branching
playback
Reset branching
BPL_Reset function playback
BPL_Init function
Stop branching
ON/OFF Branching playback playback
BPL_SetStart function
complete
(BPL_SVR_COMPLETED) specifies BPL_BR_NONE
Executable in all states
BPL_SetStart function
ON
ON
OFF OFF
Wait for the selection No destination
(BPL_SVR_WAITSEL) No candidates (BPL_SVR_NOBRN)
BPL_SelBranch function
ON
OFF
Destination selected
(BPL_SVR_SELECT)
The selected destination was BPL_BR_NONE.
(See the BPL_SetBranchInfo function.)
• ON/OFF: Branch execution switch for the Branching Playback Server function BPL_ExecServer.
If ON is specified in a destination selection wait or no destination state, then branching
playback is terminated.
If ON is specified in the selected selected state, then branch streams are changed.
Branching must not be executed until the decoder finishes processing the current stream;
even when a destination is determined (to prevent truncation of the stream data that is
being decoded).
Regardless of whether normal or forced switching is performed, switching processes for
the decoder should be executed first. The branch execution switch should be turned on
only after switching is complete.
10
4. Organization of Files on Disc
The total amount of streams that can be pre-read is limited by the capacity of the CD
buffer (a maximum of 200 sectors). Therefore, streams that exceed the limit and can not
be pre-read may result in branching delays.
1. Non-interleaved branch candidates
Suppose that A’s branch candidates are B and C and that files are positioned on disc as
shown in Figure 4.1. Then, only file B can be pre-read.
There will be no problems if the pre-read data of A is sufficient to seek/branch to B or
C. However, if both B and C need to be pre-read in order to enable delayed branch
selection timing, branching to C in this example cannot be performed without delay.
A B (b1+b2+b3...)
A b1 c1 b2 c2 b3 c3 ......
C (c1+c2+c3...)
A B1 -- B2
A B1, C1 B2 C2
C1 -- C2
Note: Four branch candidate files exist: B1, B2, C1, and C2.
12
5. Basic Examples
Branch number
Button A 0 BSTM2.MPG
BSTM1.MPG
Button B 1 BSTM3.MPG
Button A is pressed while BSTM1.MPG is being played →BSTM2.MPG is played after BSTM1.MPG.
Button B is pressed while BSTM1.MPG is being played →BSTM3.MPG is played after BSTM1.MPG.
void setScenario(void)
{
StmKey key[KEY_MAX]; /* Area for setting a stream key */
Sint32 brtbl[BR_NUM]; /* Area for setting a destination */
Sint32 fid; /* File ID */
14
5.2 Branching Playback Processing
The following is an example of a branching playback program. (Refer to Section 5.1 for
the scenario.)
Sint32 work_gfs[GFS_WORK_SIZE(BSTM_MAX*KEY_MAX)/sizeof(Sint32)];
Sint32 work_stm[STM_WORK_SIZE(GRP_MAX, BSTM_MAX*KEY_MAX)/sizeof(Sint32)];
Sint32 brno; /* Branch number */
StmHn stmtbl[KEY_MAX]; /* Stream handle table */
Sint32 bpl_stat; /* Branching playback status */
Sint32 decode_stat; /* Decoder operation status */
DecodeHn dc_hn = NULL; /* Decoder handle */
Bool chgsw = OFF; /* Branch execution switch */
Bool endflag = FALSE;
Sint32 ret;
/* Branching playback */
BPL_SetStart(BSTM1_ID); /* Specify a stream to begin playback*/
BPL_GetCurStm(KEY_MAX, stmtbl); /* Fetch the first branch stream */
dc_hn = createDecodeHn(stmtbl); /* Create a decoder handle */
while (endflag == FALSE) {
bpl_stat = BPL_ExecServer(chgsw); /* Execute the Branching Playback
Server */
chgsw = OFF;
STM_ExecServer(); /* Execute the stream server */
decode_stat = execDecoder(dc_hn); /* Execute the server function of
the decoder */
switch (bpl_stat) {
case BPL_SVR_COMPLETED: /* Branching playback complete status */
endflag = TRUE;
break;
case BPL_SVR_WAITSEL: /* Destination selection wait
state */
/* Get pad input (0:button A, 1:button B, negative: no input */
brno = getPadEvent();
if (brno >= 0) {
BPL_SelectBranch(brno); /* Select a destination */
}
break;
case BPL_SVR_SELECT: /* Destination determined state */
case BPL_SVR_NOBRN: /* No-destination state */
if (decode_stat != COMPLETED) { /* Decoding completion check */
break;
}
The BPL automatically opens and closes a stream by using the Stream System. For a
description of the decoder, refer to the applicable library manuals.
16
6. Data Specifications
2. Logical Constants
Logical constants are used as Boolean values:
Constant Value Description
FALSE 0 Represents the FALSE logical value.
TRUE 1 Represents the TRUE logical value.
OFF 0 Represents the switch off (FALSE) state.
ON 1 Represents the switch on (TRUE) state.
6.2 Constants
1. Error Codes
The value of BPL_ERR_OK is 0. Other error codes take negative values.
Constant Description
BPL_ERR_OK Normal termination
BPL_ERR_KYOVRFLW Too many stream keys
BPL_ERR_BROVRFLW Too many destination settings
BPL_ERR_BSTMID Illegal branch stream ID
BPL_ERR_BRNO Illegal branch number
BPL_ERR_BRSPC Destination already specified
BPL_ERR_NOKEY No corresponding stream key set
BPL_ERR_OPNSTM Stream open failure
2. Other
Constant Value Description
BPL_STMKEY_MAX 6 Number of stream keys that can be set to a branch
stream.
18
7.1 Scenario Processing
20
Title Data Data Name No.
Function Set destination information BPL_SetBranchInfo 1.5
specifications
Constant Description
BPL_SVR_COMPLETED Branching playback completed.
BPL_SVR_WAITSEL Wait for the selection of a destination.
BPL_SVR_SELECT Destination selected.
BPL_SVR_NOBRN No destinations.
For branching playback states, see Section 3.3, Changing Branching Playback States.
22
Title Data Data Name No.
Function Get current stream BPL_GetCurStm 2.4
specifications
SMPC
User's Manual
Doc. # ST-169-R1-072694
Explanation of Terminology
The terminology used in this manual is explained below.
i
SCU (System Control Unit)
Contains a CPU I/F, A-Bus I/F, and B-Bus I/F controller and smoothly transfers data between
the various buses. The SCU also contains an internal DMA controller, interrupt controller, and
DSP to perform DMA control, interrupt control, and high-speed calculation processing.
Main CPU
Contains a 32-bit RISC CPU SH-2 that controls the entire system.
MC68EC000
A sound control CPU with a SCSP that has SCSP control functions.
V-BLANK-IN
One of the three types of blanking interrupts. V-BLANK-IN shows the screen display end
timing.
V-BLANK-OUT
One of the three types of blanking interrupts. V-BLANK-OUT shows the screen display start
timing.
H-BLANK-IN
One of the three types of blanking interrupts. H-BLANK-IN shows the display end timing of
one line.
Peripheral
Peripheral equipment connected to SATURN, such as control PAD, mouse, and keyboard.
ii
Symbols Used in this Manual
The following symbols are used in this manual.
Binary
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
Shows that 1 KB is 1,024 bytes. Thus, 1 MB is 1,048,576 bytes.
Undefined Bit
Undefined bits in the sound source register or DSP register are shown by “—.”
(R)
Signifies a read dedicated register.
(W)
Signifies a write dedicated register.
(R/W)
Signifies a register in which both reading and writing are possible.
BCD
Binary Coded Decimal.
iii
Table of Contents
iv
List of Figures
Section 1 Overview
Figure 1.1 SMPC System Configuration ........................................................................ 2
Figure 1.2 Standard Digital PAD for SATURN ................................................................ 4
Figure 1.3 SH-2 Interface Register Address Map........................................................... 5
Figure 1.4 Parallel I/O Register Address Map ................................................................ 7
v
List of Tables
Section 1 Overview
Table 1.1 Initialization Status During Power On ............................................................. 3
Table 1.2 SMPC Functions ............................................................................................. 3
Table 1.3 DDR Functions ............................................................................................... 7
Table 1.4 IOSEL Functions ............................................................................................ 8
Table 1.5 EXLE Functions .............................................................................................. 9
vi
Table 3.29 Data Format During SATURN Mouse Data Request for SH-2 Direct Mode ....... 93
Table 3.30 Data Format During SEGA Tap Power On Reset for SH-2 Direct Mode ............ 94
Table 3.31 Data Format During SEGA Tap Data Request for SH-2 Direct Mode ................ 95
Table 3.32 Connected Peripherals and ID ........................................................................... 95
Table 3.33 Mega Drive 3-Button PAD Data Format During Connection to SEGA Tap ......... 96
Table 3.34 Mega Drive 6-Button PAD Data Format During Connection to SEGA Tap ......... 96
Table 3.35 SEGA Mouse Data Format During Connection to SEGA Tap ............................ 96
Table 3.36 SATURN Standard PAD Data Format for SH-2 Direct Mode ............................. 97
Table 3.37 SATURN Analog Joystick Data Format for SH-2 Direct Mode ........................... 98
Table 3.38 SATURN Keyboard Data Format for SH-2 Direct Mode ................................... 100
Table 3.39 SATURN 6P Multitap Data Format for SH-2 Direct Mode ................................ 103
vii
Section 1 Overview
Section 1 Contents
1.1 System Configuration.................................... 2
Functions ....................................................... 3
PAD ................................................................ 4
1.2 SH-2 Interface ............................................... 5
SH-2 Interface Registers ............................... 5
Parallel I/O Registers .................................... 7
The SMPC manages SATURN system reset control when the power is turned on and
NMI requests to the master SH-2 when the reset button is pushed. In addition,
commands from SH-2 turn each LSI on and off, sets and acquires calendar time, and
collects data from peripherals. Also, the clock change command switches the hori-
zontal resolution to and from 320 dots and 352 dots.
CDRES To CD Block
Address SH I/F
Buffer
IOSEL
MSHRES
MSHNMI
RES SSHRES
Data
SSHNMI
MSH-2 Buffer
SNDRES
NMI
SYSRES
4-bit CPU
DOTSEL
Core
I/O I/O
SSH-2
NMI
VDP1 PLL
RES
VDP2
RES
SCSP
RES
MC68EC000
SCU RES
2
The SMPC has two sets of 7-bit parallel I/O ports. Access to I/O ports is controlled
by the SMPC’s internal firmware and there are two access methods that can be se-
lected: the SMPC control mode which outputs collected data to the SMPC output
register (OREG), and the SH-2 direct mode which has direct access from the SH-2.
For details regarding the SMPC control mode and SH-2 direct mode, refer to Section 3.
During power on, the SATURN internal units are initialized as shown in Table 1.1.
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.
4
1.2 SH-2 Interface
SH-2 Interface Registers
The SH-2 interface registers are registers that are used to receive commands, com-
mand parameters, and status display from the SH-2 and to output result parameters.
Figure 1.3 shows the SH-2 interface register address map.
b it7 b it0
2010001FH COMREG W
R : Read Only
b it7 b it0 W : Write Only
20100061H R R/W: Read/Write
SR
b it0
20100063H SF R/W
b it7 b it0
20100001H IREG0
20100003H IREG1
20100005H IREG2
20100007H IREG3 W
20100009H IREG4
2010000BH IREG5
2010000DH IREG6
6
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 it1 b it0
2010007DH IOSEL2 IOSEL1 W W : Write Only
2010007FH EXLE2 EXLE1 W R/W: Read/Write
8
EXLE2 (W): EXternal Latch Enable 2
The peripheral port 2 (P2) bit 6 is a setting bit that is used for PAD interrupt and
VDP2 external latch input. It is disabled by writing “0,” and the peripheral port 1 bit
6 is normally set as an I/O port. It is enabled by writing “1,” which allows the pe-
ripheral port 1 bit 6 to be used for PAD interrupt input or VDP2 external latch input.
Use byte access from the SH-2.
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.)
10
Chapter 2 SMPC Commands
Section 2 Contents
2.1 SMPC Command List .............................................. 12
2.2 Command Issue ....................................................... 13
Command Issue Method.......................................... 13
Command Issue Timing ........................................... 17
Command Issue Limitations .................................... 19
2.3 Resetable System Management Commands ........... 21
2.4 Non-Resetable System Management Commands ... 35
2.5 RTC Commands ...................................................... 45
SMPC commands are divided into three types; resetable system management com-
mands, non-resetable system management commands, and RTC commands. Each of
these commands is shown below.
Execution Time
Command Command SMPC
sec
No Command Name SR IREG OREG
Abbreviation Code Interrupt
min max
1 Master SH-2 ON MSHON 00 H Unused Unused Unused 31 30µ
2 Slave SH-2 ON SSHON 02 H Unused Unused Unused 31 30µ
3 Slave SH-2 OFF SSHOFF 03 H Unused Unused Unused 31 30µ
4 Sound ON SNDON 06 H Unused Unused Unused 31 30µ
Execution Time
Command SMPC sec
No Command Name Command Code Interrupt SR IREG OREG
Abbreviation min max
1 Interrupt Back INTBACK 10H Used Used 0~2 0~31 320m
2 SMPC Memory Setting SETSMEM 17H Unused Unused 0~3 31 40 µ
12
2.2 Command Issue
For commands to the SMPC, to issue commands when the command parameter is
required after setting the SMPC status flag (SF) to “1,” set the command parameter,
and write the command code in the SMPC command register.
When the SMPC command is issued, be careful of dual command issue. Prevention
of dual issue of commands to the SMPC can be done using the SMPC status flag.
When this flag is “1,” the SMPC is busy. When executing the command, verify that
the status flag is “0” and then execute the command after setting “1.” The SMPC
resets the status flag to “0” when the command is completed.
(1) Type A This command resets the master SH-2 after command issue or changes to
exception processing, such as NMI.
(2) Type B This command does not require the command parameter to be reset and
the result parameter is not returned (except for OREG31, however).
(3) Type C This command requires the command parameter to be reset and the result
parameter is not returned (except for OREG31, however).
(4) Type D This command requires the command parameter to be reset and the result
parameter is returned, and also requires a SMPC interrupt at the time the
result parameter is ready.
Sets SF
Endless Loop
Waiting for
exception
handling.
START
Sets SF
END
14
START
Resets SF
END
Set SF
END
Note: A routine similar to the SMPC interrupt routine can be executed by masking the
SMPC routine (SMPC interrupt is not used) and conducting polling after the SMPC
interrupt flag or SF clear is conducted.
16
Command Issue Timing
The SMPC uses the V-BLANK-IN interrupt to execute internal tasks. At this time,
issuing commands for 300 ms from V-BLANK-IN is prohibited.
Also, the INTBACK command that is used to acquire the SMPC statuses and periph-
eral data has stricter issue timing than other commands. For details regarding the
INTBACK command, refer to 2.4 “Non-Resetable System Management Commands”
or Section 3 “Peripheral Control.”
• INTBACK Command
The INTBACK command begins collecting peripheral data at V-BLANK-OUT. To
begin collecting peripheral data at V-BLANK-OUT, the INTBACK command must
be issued in the period prior to V-BLANK-OUT after 300 µs following V-BLANK-
IN..
Figure 2.5 shows the INTBACK command execution timing.
The INTBACK command is used in the following three ways.
1) To acquire only the SMPC status.
2) To collect peripheral data after acquiring the SMPC status.
3) To acquire only peripheral data.
When executing (2) “To collect peripheral data after acquiring the SMPC status,” a
SMPC interrupt is generated at the time the SMPC status is OREG and a request
for result parameter acquisition is made to the SH-2. The SMPC begins collecting
peripheral data after the SH-2 makes a continue request.
Here, even though a continue request has been issued after SMPC status acquisi-
tion, it is still necessary to issue an INTBACK command and request continue to
begin collecting peripheral data at V-BLANK-OUT.
SMPC status acquisition ends approximately 300 µs after INTBACK command
issue, and a SMPC interrupt request is sent to the SMPC.
V-BLANK
V-BLANK-IN V-BLANK-OUT
During V-BLANK
• INTBACK Command Issue Timing after SYSRES, CKCHG320, CKCHG352 Command Execution
The command execution time for the above commands requires 100 msec or more.
When an INTBACK command is issued after one of these commands is executed,
wait to execute them until the next V-BLANK-IN. Figure 2.6 shows the INTBACK
command issue timing after the SYSRES, CKCHG320, and CKCHG352 commands
are executed.
The SYSRES, CKCHG320, and CKCHG352 commands must be issued 300 µs after
V-BLANK-IN and before the next V-BLANK-IN.
V-BLANK
V-BLANK-IN
Figure 2.6 INTBACK Command Issue Timing After SYSRES, CKCHG320, and
CKCHG352 Command Execution.
18
Other Command Issue in Frame that Does Not Issue INTBACK Command
300 µs
: Other Command Issue Period
V-BLANK
V-BLANK
V-BLANK-IN
20
2.3 Resetable System Management Commands
The details for the resetable system management commands are given in table
format. The way to view the command tables and precaution items are given below.
In addition, a status flag is used for each command to control the dual issue of com-
mands.
SMPC Interrupt
The word “generation” means that a SMPC interrupt is generated by the SH-2 via
the SCU when the command ends. In addition, the interrupt can be enabled or
disabled by so setting the SCU.
IREG, OREG
• Shows the details of the IREG and OREG used by commands.
• A command parameter is a parameter that is set in IREG before the command is
issued.
• A result parameter is a parameter that is set in OREG before the command is
executed.
• Result parameter OREG31 is set when the SMPC begins command processing.
The command code is output to OREG31. Also using it as a status flag (SF) makes
it possible to determine:
Which command is executing (SF=1)
Which command has finished (SF=0)
Execution Time
Shows the execution time calculated from the number of SMPC internal firmware
steps. When there is a collision with an internal task, such as an RTC increment, the
command execution time is changed, so the minimum and maximum range values
are given.
Command None
Parameter
Result
Parameter bit7 bit0
OREG31 2010005F H 0 0 0 0 0 0 0 0
Remarks
22
Command
NO. 2 SSHON Slave SH-2 ON Code 02 H
Command None
Parameter
Result
Parameter bit7 bit0
OREG31 2010005F H 0 0 0 0 0 0 1 0
Remarks
Command None
Parameter
Result
Parameter bit7 bit0
OREG31 2010005F H 0 0 0 0 0 0 1 1
Remarks
24
Command
NO. 4 SNDON Sound ON Code 06 H
Command None
Parameter
Result
Parameter bit7 bit0
OREG31 2010005F H 0 0 0 0 0 1 1 0
Remarks
Command None
Parameter
Result
Parameter bit7 bit0
OREG31 2010005F H 0 0 0 0 0 1 1 1
Remarks Even if the sound CPU is turned off using this command, the sound memory
contents (4M DRAM) will be preserved.
26
Command
NO. 6 CDON CD ON Code 08 H
Command None
Parameter
Result
Parameter bit7 bit0
OREG31 2010005F H 0 0 0 0 1 0 0 0
Remarks
Command None
Parameter
Result
Parameter bit7 bit0
OREG31 2010005F H 0 0 0 0 1 0 0 1
Remarks The execution of this command will cause the CD buffer (DRAM) value not to
be retained.
28
Command
NO. 8 SYSRES Entire System Reset Code 0D H
SMPC
Interrupt
Generation
Not Possible IREG Unused OREG 31
Execution
Time
100 msec + α
Function Resets the entire SATURN system.
Description
Command None
Parameter
Result
Parameter bit7 bit0
OREG31 2010005F H 0 0 0 0 1 1 0 1
Remarks 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.
SMPC
Interrupt
Generation
Not Possible
IREG Unused OREG 31
Execution
Time
100 msec + α
Function Switch the SATURN system clock from 320 mode to 352 mode.
Description
Command None
Parameter
Result
Parameter bit7 bit0
OREG31 2010005F H 0 0 0 0 1 1 1 0
Remarks 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
30
Command
NO. 10 CKCHG320 Clock Change 320 Mode Code 0FH
SMPC
Interrupt
Generation
Not Possible IREG Unused OREG 31
Execution
Time
100 msec + α
Function Switch the SATURN system clock from 352 mode to 320 mode.
Description
Command None
Parameter
Result
Parameter bit7 bit0
OREG31 2010005F H 0 0 0 0 1 1 1 1
Remarks 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
Command None
Parameter
Result
Parameter bit7 bit0
OREG31 2010005F H 0 0 0 1 1 0 0 0
32
Command
NO. 12 RESENAB Reset Enable Code 19 H
Command None
Parameter
Result
Parameter bit7 bit0
OREG31 2010005F H 0 0 0 1 1 0 0 1
Remarks NMI is generated when the reset button is pushed during the 3VINT period to
prevent chattering.
Command None
Parameter
Result
Parameter bit7 bit0
OREG31 2010005F H 0 0 0 1 1 0 1 0
Remarks 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.
34
2.4 Non-Resetable System Management Commands
The details for the non-resetable system management commands are given in table
format.
The way to view the command tables and precaution items are given below. Also, a
status flag is used for each command to control dual command issue.
SMPC Interrupt
The word “generation” means that a SMPC interrupt is generated by the SH-2 via
the SCU when the command ends. In addition, the interrupt can be enabled or
disabled by setting the SCU.
IREG, OREG
• Shows the details of the IREG and OREG used by commands.
• A command parameter is a parameter that is set in IREG before the command is
issued.
• A result parameter is a parameter that is set in OREG before the command is
executed.
• Result parameter OREG31 is set when the SMPC begins command processing.
The command code is output to OREG31. Also using it as a status flag (SF) makes
it possible to determine:
Which command is executing (SF=1)
Which command has finished (SF=0)
Execution Time
Shows the execution time calculated from the number of SMPC internal firmware
steps. When there is a collision with an internal task, such as a RTC increment, the
command execution time is changed, so the minimum and maximum range values
are given.
Function Acquires the SMPC status and peripheral data. Here status acquisition will be
Description
explained. The acquisition of peripheral data will be explained in Section 3.
Remarks
36
Command Parameter
bit7 bit0
IREG0 20100001 H SMPC Status Acquisition Switch (00H or 01 H)
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 bit0
IREG2 F0H
20100005H
Initial Value: Not Specified Write Only
When executing the INTBACK command, be sure to set F0H in IREG2.
38
Result Parameter
bit7 bit4 bit3 bit0
bit7 bit0
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
bit7 bit0
OREG4 20100029H Days 10s Place Days 1s Place (BCD)
bit7 bit0
OREG11 System Status 2
20100037H
bit7 bit0
System Status 2 (Status of Control Signals Output by SMPC 0: OFF 1 :ON)
OREG11
•b7 RESERVED •b6 CDRES Signal •b5 RESERVED System Status 2
20100037H
•b4 RESERVED •b3 RESERVED •b2 RESERVED
•b1 RESERVED
System •b0 RESERVED
Status 2 (Status of Control Signals Output by SMPC 0: OFF 1 :ON)
•b7 RESERVED •b6 CDRES Signal •b5 RESERVED
•b4 RESERVED •b3 RESERVED •b2 RESERVED
•b1 RESERVED •b0 RESERVED
40
bit7 bit0
OREG12 20100039H SMEM 1 Saved Data
bit7 bit0
OREG31 2010005FH 0 0 0 0 0 0 0 0
With peripheral data, however, the command code (OREG31) could be overwritten.
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.
Setting
IREG Description
Value
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
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.
Setting Description
IREG
Value
All data for time, cartridge code, area code, terminal
IREG0 01H status, SMEM, and reset button mode is returned.
This setting executes the SMPC command and requests a SMPC interrupt when
the result parameter is set. When the SMPC interrupt is requested, the SF is
changed to busy "1." The execution time from command issue to result
parameter setting completion is minimum TBD to maximum TBD. After the result
parameter for the status is acquired, the value of the IREG0 bit7 is changed, then
the SMPC understands this as continue and continues acquiring peripheral data.
This method is effective for use with applications that acquire all status types for
each frame and that acquire peripheral data.
Command
Parameter bit7 bit0
IREG0 20100001H Setting Data to SMEM1
bit7 bit0
Result OREG31 2010005F H 0 0 0 1 0 1 1 1
Parameter
Remarks • 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.
44
2.5 RTC Commands
The details for the RTC commands are given in table format. The way to view the
command tables and precaution items are given below. Also, a status flag is used for
each command to control dual command issue.
SMPC Interrupt
The word “generation” means that a SMPC interrupt is generated by the SH-2 via
the SCU when the command ends. In addition, the interrupt can be enabled or
disabled by setting the SCU.
IREG, OREG
• Shows the details of the IREG and OREG used by commands.
• A command parameter is a parameter that is set in IREG before the command is
issued.
• A result parameter is a parameter that is set in OREG before the command is
executed.
• Result parameter OREG31 is set when the SMPC begins command processing.
The command code is output to OREG31. Also using it as a status flag (SF) makes
it possible to determine:
Which command is executing (SF=1)
Which command has finished (SF=0)
Execution Time
Shows the execution time calculated from the number of SMPC internal firmware
steps. When there is a collision with an internal task, such as a RTC increment, the
command execution time is changed, so the minimum and maximum range values
are given.
Command
bit7 bit4 bit3 bit0
Parameter
IREG0 20100001H Year 1000s Place Year 100s Place (BCD)
Note 1: 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 • 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.
46
Chapter 3 Peripheral Control
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..................................................................................................
Section 3 Contents 74
3.2 SATURN Peripheral 3.1 Standard Format .....................................................................
Peripheral Control Mode .......................................................... 76 48
Purpose of SATURN 3.2 Peripheral Standard Format ....................................................
SATURN Peripheral Standard Formats .................................... 76 76
SATURN Standard Format Types and Data Format .................................................. 76
3.3 Support Peripheral
3.3 Support Peripheral Data Format for SMPC Control Mode Data Format in SMPC Control Mode .........81
......................................... 81
3.4 Support Peripheral Data3.4 Format
Supportfor Peripheral
SH-2 Direct Data Format
Mode in SH-2 Direct Mode .............
............................................. 86 86
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
SH-2 SMPC
SH-2 PDR1
Data Bus Interface 7
8 Register
PDR2
7
Characteristics
Used as an effective method to keep overhead to a minimum when accessing periph-
erals from inside an application.
48
SMPC Control Mode
Setting End
Break Request
A break request from the SH-2 to the SMPC is made by writing “1” in the IREG0’s
bit 6.
50
SH-2 SMPC
IREG Set
Data Remains
OREG Acquisition
CONTINUE Request
Create OREG
Interrupt Generated
Data Remains
••
•
OREG Acquisition
CONTINUE Request
Data Remains
Create OREG
Interrupt Generated
Data Remains
OREG Acquisition
CONTINUE Request
Create OREG
Interrupt Generated
No Data Remains
INTBACK Command Ends
IREG Set
Data Remains
OREG Acquisition
CONTINUE Request
Create OREG
Interrupt Generated
Data Remains
••
OREG Acquisition
CONTINUE Request
•
Data Remains
Create OREG
Interrupt Generated
Data Remains
OREG Acquisition
BREAK Request
Figure 3.4 Peripheral Data Acquisition Cancel Sequence Due to Break Request
52
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.
54
Peripheral Data Collection Time Optimization
The application processing cycle for the SMPC was created as follows.
1) Peripheral data is prepared until V-BLANK-IN.
2) The sprite and control screen parameter in the peripheral are calculated and
output.
3) 3D calculation, etc.
4) Sprite and polygon drawing.
5) Display
The purpose of optimizing the peripheral data collection time is to collect the pe-
ripheral data as close to V-BLANK-IN as possible. In other words, the start of pe-
ripheral data collection is made as close as possible to V-BLANK-IN to shorten the
time from peripheral data collection to peripheral data acquisition by SH-2. Figure
3.5 shows an operation overview of peripheral data collection time optimization.
V-BLANK
1
Response Is Slow
Peripheral Data Acquisition
END Optimization
V-BLANK
1 ms
2
END
56
Precautions when Optimizing Peripheral Data Collection Time
The peripheral data collection timing varies depending on the type and number of
peripherals that are connected. When performing peripheral data collection time
optimization, verify the types, number, and configuration of connected peripherals
and make a sufficient evaluation to prevent time-over from occurring.
In addition, when using continue as well, the continue request wait-time is mea-
sured as part of the peripheral data collection time. Therefore, make the time from
SMPC interrupt generation to continue request as short as possible, and be sure to
execute them at a set time.
IREG0
There are two IREG0 settings: when the INTBACK command is issued and when con-
tinue or break is requested.
• When INTBACK Command Is Issued
The IREG0 uses the SMPC status acquisition switch.
bit7 bit0
IREG0 20100001H Status Acquisition Switch (00H or 01H)
All data for date and time, cartridge code, area code, terminal
00H status, SMEM, and reset button mode are not returned.
All data for date and time, cartridge code, area code, terminal
01H
status, SMEM, and reset button mode are returned.
bit7 bit0
Note: When the CONT.BR request value that has reached maximum is also written in IREG0, it
cannot be guaranteed which operation the SMPC will execute. Refer to Table 3.2.
58
IREG1
The IREG1 uses the peripheral data collection mode.
Note: When both the SH-2 direct mode and SMPC control mode are both used (example:
port 1=SH-2 direct mode, port 2=SMPC control mode), use the 0 byte mode in the
port used by SH-2 direct mode when the INTBACK command is issued.
bit7 bit0
IREG2 20100005H F0 H
60
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.
Figure 3.10 Result Parameter Standard Configuration Acquired Using INTBACK Command
62
Result Parameter Configuration During 0 Byte Mode
When one of the ports is set to 0 byte mode, the port data set in 0 byte mode is
removed to make a smaller configuration. Figure 3.11 shows the data configuration
during 0 byte mode.
Port 2 Data
Port 1 Data
Becomes configuration
OREG where Port 1 Data portion
is packed.
Port 2 Data Port 2 Mode Is
0-Byte Mode Peripheral Control
Status
Port 1 Data
Becomes configuration
where Port 2 Data portion
is removed.
Figure 3.11 Result Parameter Configuration when One Port is 0 Byte Mode
As shown above, the result parameter varies depending on the command parameter
setting conditions. Table 3.4 shows the relation between the command parameter
setting conditions and the created result parameter configuration.
Use Prohibited
64
Peripheral Data Configuration
The peripheral data configuration is shown in Figure 3.12. Peripheral data consists
of the SATURN peripheral ID and peripheral data. The peripheral data body with-
out the SATURN peripheral ID has a maximum of 255 bytes.
bit7 bit0
66
Port Status
The port status is 1-byte data that shows the state of the peripheral connected to the
port. Using the port status makes it possible to determine if the peripheral is directly
connected to the corresponding port or if a multitap is connected. Figure 3.14 shows
the port status configuration.
• Number of Connectors
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.
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.
68
SATURN Peripheral ID
SATURN Peripheral ID Configuration
The SATURN peripheral ID is configured from the peripheral type and data size.
The peripheral data configuration and contents can be recognized from the SATURN
peripheral ID. The SATURN peripheral ID is shown in Figure 3.15.
• Data Size
The data size shows how many bytes after the SATURN peripheral ID are being
output. Therefore, using the data size makes it possible to recognize from how
many bytes the peripheral data table is configured. It also makes it possible to
recognize where the start of the next peripheral data table is.
Table 3.8 Combinations of Peripheral Data Size and Port Mode (Peripheral Is
Connected Directly to Peripheral Port)
15 255
bit7 bit0
Peripheral Data 1st
Peripheral Data 2nd
Peripheral Data Table .
.
.
Peripheral Data nth
70
bit7 bit4 bit3 bit0
SATURN Peripheral ID OH~E H 0H
SATURN Peripheral Type Data Size
nth shows the data size. The maximum size is 255 bytes.
72
Table 3.9 Combinations of Peripheral Data Size and Port Mode (Multitap)
15 255
bit7 bit0
SATURN Peripheral ID FFH
SH-2 SMPC
PDR1
Data Bus 8 7
PDR2
7
Characteristics
This mode becomes an effective means during the following procedures:
1) When controlling peripherals that require high-speed access that is faster than
the access speed possible in the SMPC control mode.
2) When data output from the peripherals is required.
3) When access to peripherals that need an external latch is required.
4) When access is required to a peripheral that is not supported by the SMPC.
74
Settings for Using the SH-2 Direct Mode
Figure 3.22 shows an example of a setting for using the SH-2 direct mode and shows
an example of a setting to port 1. Mode settings can be done independently for each
port.
Set PDR1
Set DDR1
NO
External Latch Required
YES
Setting End
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.
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
• 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.
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).
• Pointing Device
This device outputs rotary encoder movement quantities, such as those from a
mouse or trackball. The peripheral type is 2H and the basic data size is 3 bytes.
The format characteristic is that unlike the data tables for digital devices, analog
devices, and keyboard devices. The data table for pointing devices does not have
data with the same value as the Mega Drive 3-button PAD.
In addition, the X and Y data movement is output as the amount of movement of
the rotary encoder (∆ delta), so if all three of the defined bytes are not supported,
compatibility cannot be maintained. Table 3.12 shows the SATURN pointing
device standard format.
• Keyboard Device
Devices used for personal computers, represented by full keyboards. The periph-
eral 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
bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0
SATURN Peripheral ID 0 0 1 1 Data Size
1st Data Right Left Down Up Start A TRG C TRG B TRG
2nd Data R TRG X TRG Y TRG Z TRG L TRG Extension Data
3rd Data Caps Num Scroll Break
0 Make 1 1
Lock Lock Lock
4th Data D7 D6 D5 D4 D3 D2 D1 D0
5th Data Extension Data
: Extension Data
: Extension Data
nth Data Extension 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. The corresponding values for each button and
keyboard key are given below.
Button Key
Right →
Left ←
Down ↓
Up ↑
Start ESC
A TRG Z
C TRG C
B TRG X
R TRG Q
X TRG A
Y TRG S
Z TRG D
L TRG E
For Caps Lock 1: Caps Lock is locked (Caps Lock LED is lit.)
For Num Lock 1: Num Lock is locked (Num Lock LED is lit.)
For Scroll Lock 1: Scroll Lock is locked (Scroll Lock LED is lit.)
For Make 1 is shown when there is a valid Make code (a key that shows
D7~D0 code is pushed down) in D7~D0.
For Break 1 is shown when there is a valid Break code (a key that shows
D7~D0 code is pushed down) in D7~D0.
D7~D0 show the key No. They are used with both Make and Break.
80
3.3 Support Peripheral Data Format in SMPC Control Mode
This section describes the SMPC support peripheral data format in the SMPC control
mode. For detailed data on each peripheral, refer to the manual for each peripheral.
Table 3.14 Mega Drive 3-Button PAD Data Format in SMPC Control Mode
bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0
SATURN Peripheral ID 1 1 1 0 0 0 0 1
1st Data Right Left Down Up Start A TRG C TRG B TRG
Right, Left, Down, Up, Start, A TRG, C TRG, and B TRG become 0 when the button is pushed.
Table 3.15 Mega Drive 6-Button PAD Data Format in SMPC Control Mode
bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0
SATURN Peripheral ID 1 1 1 0 0 0 1 0
1st Data Right Left Down Up Start A TRG C TRG B TRG
2nd Data MODE X TRG Y TRG Z TRG 1 1 1 1
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.
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.18 SATURN Standard PAD Data Format in SMPC Control Mode
bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0
SATURN Peripheral ID 0 0 0 0 0 0 1 0
1st Data Right Left Down Up Start A TRG C TRG B TRG
2nd Data R TRG X TRG Y TRG Z TRG L TRG 1 1 1
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
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 bit3 bit2 bit1 bit0
SATURN Peripheral ID 0 0 0 1 0 1 0 1
1st Data Right Left Down Up Start A TRG C TRG B TRG
2nd Data R TRG X TRG Y TRG Z TRG L TRG 1 1 1
3rd Data AX7 AX6 AX5 AX4 AX3 AX2 AX1 AX0
4th Data AY7 AY6 AY5 AY4 AY3 AY2 AY1 AY0
5th Data AZ7 AZ6 AZ5 AZ4 AZ3 AZ2 AZ1 AZ0
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).
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.
Button Key
Right →
Left ←
Down ↓
Up ↑
Start ESC
A TRG Z
C TRG C
B TRG X
R TRG Q
X TRG A
Y TRG S
Z TRG D
L TRG E
The KBTYPE shown here is used for the IBM keyboard conversion adapter format.
When IBM keyboards 101, 102, and 106 are connected to the conversion adapter, 000
is displayed. When a keyboard not supported by the conversion adapter, or when a
device not recognized as a keyboard is connected to the conversion adapter, 111 is
output. In the future, with the integration accompanying the commercialization of
the keyboard, the system will be configured to output 000.
For Caps Lock 1: Caps Lock is locked (Caps Lock LED is lit.)
For Num Lock 1: Num Lock is locked (Num Lock LED is lit.)
For Scroll Lock 1: Scroll Lock is locked (Scroll Lock LED is lit.)
For Make 1 is shown when there is a valid Make code (a key that shows
D7~D0 code is pushed down) in D7~D0.
For Break 1 is shown when there is a valid Break code (a key that shows
D7~D0 code is pushed down) in D7~D0.
D7~D0 Shows the key No. They are used with both Make and Break.
84
SATURN 6P Multitap (Provisional Name)
In the SMPC control mode, the port status shown in Table 3.21 is output. The SAT-
URN 6P multitap is connected to the Mega Drive 3-button PAD, Mega Drive 6-
button PAD, SATURN standard PAD (provisional name), SATURN analog joystick
(provisional name), SATURN mouse (provisional name), and SATURN standard
keyboard (provisional name). For information regarding peripheral data, refer to
each peripheral data format.
For the SATURN 6P multitap, the maximum data size for each tap is 15 bytes. Use
the 15-byte port mode.
This section explains about peripheral access protocols and data formats in the SH-2
direct mode.
Table 3.22 Relationship Between Port Bit Number and Port Bit Name
Port Bit Number bit6 bit5 bit4 bit3 bit2 bit1 bit0
Port Bit Name TH TR TL R L D U
ID3=R # L (TH=1)
ID2=D # U (TH=1)
ID1=R # L (TH=0)
ID0=D # U (TH=0)
86
Port Setting During Mega Drive Peripheral ID Acquisition
The port direction register setting values during Mega Drive peripheral ID acquisi-
tion are shown in Table 3.23. When the port direction is set as shown below, Read is
performed when TH=1 for RLDU and TH=0 for RLDU, and the Mega Drive periph-
eral ID can be output using the above explained formula.
After TH is changed, read the R, L, D, and U after 2 µS.
Table 2.23 Port Direction Register Setting Value During Mega Drive Peripheral ID
Acquisition
Port Bit Name TH TR TL R L D U
Port Direction Set to Output Set to Input
TH Control Method
The TH control method interface protocol is a method that acquires data when TH=1
for TR, TL, R, L, D, and U and when TH=0 for TR, TL, R, L, D, and U. The peripher-
als that support this protocol are the Mega Drive 3-button PAD and Mega Drive 6-
button PAD.
88
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.
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 (TH=1)
D, U = 0, 1 (TH=0)
3) Acquire the SATURN peripheral ID, perform the number of accesses required for
the data size, and receive all peripheral data.
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
Right, Left, Down, Up, Start, A TRG, C TRG, and B TRG become 0 when the button is pushed
down.
Table 3.26 Mega Drive 6-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
3rd Data 1 C TRG B TRG Right Left Down Up
4th Data 0 Start A TRG 0 0 Down Up
5th Data 1 C TRG B TRG Right Left Down Up
6th Data 0 Start A TRG 0 0 0 0
7th Data 1 C TRG B TRG MD X TRG Y TRG Z TRG
8th Data 0 Start A TRG 1 1 1 1
Right, Left, Down, Up, Start, A TRG, C TRG, and B TRG become 0 when the button is pushed
down.
90
SATURN Mouse (Provisional Name)
The SATURN mouse is a 3-line handshake method peripheral. There are three se-
quence types for the SATURN mouse: power on reset, reset, and data request.
1) Power On Reset
When the power is turned on the mouse is automatically initialized. While the
mouse is being initialized the TL bit is made 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.
Table 3.27 Data Format During SATURN Mouse 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
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.
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.
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 chang-
ing 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
Table 3.29 Data Format During SATURN Mouse Data Request for SH-2 Direct Mode
Output Input
TH TR TL R L D U
1st Data 1 1 1 0 0 0 0
2nd Data 0 1 1 1 0 1 1
0 0 1 x x x x
3rd Data 0 0 0 1 1 1 1
0 1 0 x x x x
4th Data 0 1 1 1 1 1 1
0 0 1 x x x x
5th Data 0 0 0 Y Over X Over Y Sign X Sign
0 1 0 x x x x
6th Data 0 1 1 Start Middle Right Left
0 0 1 x x x x
7th Data 0 0 0 XD7 XD6 XD5 XD4
0 1 0 x x x x
8th Data 0 1 1 XD3 XD2 XD1 XD0
0 0 1 x x x x
9th Data 0 0 0 YD7 YD6 YD5 YD4
0 1 0 x x x x
10th Data 0 1 1 YD3 YD2 YD1 YD0
End Request 1 1 x x x x x
End 1 1 1 0 0 0 0
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.
Table 3.30 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
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 thereaf-
ter with a handshake with TR and TL. Table 3.31 shows the data format during
SEGA tap data request in the SH-2 direct mode.
94
Table 3.31 Data Format During SEGA Tap Data Request for SH-2 Direct Mode
Output Input
TH TR TL R L D U
1st Data 1 1 1 0 0 1 1
2nd Data 0 1 1 1 1 1 1
0 0 1 x x x x
3rd Data 0 0 0 0 0 0 0
0 1 0 x x x x
4th Data 0 1 1 0 0 0 0
0 0 1 x x x x
1P 1P 1P 1P
5th Data 0 0 0
DevID3 DevlD2 DevlD1 DevlD0
0 1 0 x x x x
2P 2P 2P 2P
6th Data 0 1 1
DevID3 DevlD2 DevlD1 DevlD0
0 0 1 x x x x
3P 3P 3P 3P
7th Data 0 0 0
DevID3 DevlD2 DevlD1 DevlD0
0 1 0 X X X X
4P 4P 4P 4P
8th Data 0 1 1
DevID3 DevlD2 DevlD1 DevlD0
0 0 1 x x x x
9th Data and Later 0 0 0 D3 D2 D1 D0
End Request 1 1 x x x x x
End 1 1 1 0 0 1 1
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.33 Mega Drive 3-Button PAD Data Format During Connection to SEGA Tap
bit3 bit2 bit1 bit0
Right Left Down Up
Start A TRG C TRG B TRG
Right, Left, Down, Up, Start, A TRG, C TRG, and B TRG are 0 when the button is pushed down.
Table 3.34 Mega Drive 6-Button PAD Data Format During Connection to SEGA Tap
bit3 bit2 bit1 bit0
Right Left Down Up
Start A TRG C TRG B TRG
MODE X TRG Y TRG Z TRG
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.
Table 3.35 SEGA Mouse Data Format During Connection to SEGA Tap
bit3 bit2 bit1 bit0
Y Over X Over Y Sign X Sign
Start Middle Right Left
XD7 XD6 XD5 XD4
XD3 XD2 XD1 XD0
YD7 YD6 YD5 YD4
YD3 YD2 YD1 YD0
96
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
Output Input
TH TR TL R L D U
1st Data 1 1 1 L TRG 1 0 0
2nd Data 0 1 1 Right Left Down Up
3rd Data 1 0 1 Start A TRG C TRG B TRG
4th Data 0 0 1 R TRG X TRG Y TRG Z TRG
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.
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).
98
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.
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 key-
board data format in SH-2 direct mode.
Right, Left, Down, Up, Start, A TRG, C TRG, B TRG, R TRG, X TRG, Y TRG, Z TRG, and L TRG
become 0 when the button is pushed down.
100
The corresponding values for each button and keyboard key are given below.
Button Key
Right →
Left ←
Down ↓
Up ↑
Start ESC
A TRG Z
C TRG C
B TRG X
R TRG Q
X TRG A
Y TRG S
Z TRG D
L TRG E
The KBTYPE shown here is used for the IBM keyboard conversion adapter format.
When IBM keyboards 101, 102, and 106 are connected to the conversion adapter, 000
is shown. When a keyboard not supported by the conversion adapter, or when a
device not recognized as a keyboard is connected to the conversion adapter, 111 is
output. In the future, with the integration accompanying the commercialization of
the keyboard, the system will be configured to output 000.
For Caps Lock 1: Caps Lock is locked (Caps Lock LED is lit.)
For Num Lock 1: Num Lock is locked (Num Lock LED is lit.)
For Scroll Lock 1: Scroll Lock is locked (Scroll Lock LED is lit.)
For Make 1 is shown when there is a valid Make code (a key that shows D7~D0
code is pushed down) in D7~D0.
For Break 1 is shown when there is a valid Break code (a key that shows D7~D0 code
is pushed down) in D7~D0.
D7~D0 Shows the key No. They are used with both Make and Break.
102
Table 3.39 SATURN 6P Multitap Data Format for SH-2 Direct Mode
Output Input
TH TR TL R L D U
1st Data 1 1 1 0 0 0 1
2nd Data 0 1 1 0 0 0 1
0 0 1 x x x x
3rd Data 0 0 0 \\\\ 0 \\\\ \\\\ 0 \\\\ \\\\ 0 \\\\ \\\\ 0 \\\\
0 1 0 x x x x
4th Data 0 1 1 //// 0 //// //// 0 //// //// 0 //// //// 1 ////
0 0 1 //// x //// //// x //// //// x //// //// x ////
5th Data 0 0 0 //// 0 //// //// 1 //// //// 1 //// //// 0 ////
0 1 0 //// x //// //// x //// //// x //// //// x ////
6th Data 0 1 1 0 0 0 0
0 0 1 x x x x
7th Data 0 0 0 CH1-M6ID3 CH1-M6ID2 CH1-M6ID1 CH1-M6ID0
0 1 0 x x x x
8th Data 0 1 1 CH1-DSIZE3 CH1-DSIZE2 CH1-DSIZE1 CH1-DSIZE0
0 0 1 x x x x
?th Data 0 0 0 CH1-DATA CH1-DATA CH1-DATA CH1-DATA
0 : : : : : :
?th Data 0 : : CH2-M6ID3 CH2-M6ID2 CH1-M6ID1 CH1-M6ID0
0 : : x x x x
?th Data 0 : : CH2-DSIZE3 CH2-DSIZE2 CH2-DSIZE1 CH2-DSIZE0
0 : : x x x x
?th Data 0 : : CH2-DATA CH2-DATA CH2-DATA CH2-DATA
0 : : : : : :
?th Data 0 : : CH3-M6ID3 CH3-M6ID2 CH3-M6ID1 CH3-M6ID0
0 : : x x x x
?th Data 0 : : CH3-DSIZE3 CH3-DSIZE2 CH3-DSIZE1 CH3-DSIZE0
0 : : x x x x
?th Data 0 : : CH3-DATA CH3-DATA CH3-DATA CH3-DATA
0 : : : : : :
?th Data 0 : : CH4-M6ID3 CH4-M6ID2 CH4-M6ID1 CH4-M6ID0
0 : : x x x x
?th Data 0 : : CH4-DSIZE3 CH4-DSIZE2 CH4-DSIZE1 CH4-DSIZE0
0 : : x x x x
?th Data 0 : : CH4-DATA CH4-DATA CH4-DATA CH4-DATA
0 : : : : : :
?th Data 0 : : CH5-M6ID3 CH5-M6ID2 CH5-M6ID1 CH5-M6ID0
0 : : x x x x
?th Data 0 : : CH5-DSIZE3 CH5-DSIZE2 CH5-DSIZE1 CH5-DSIZE0
0 : : x x x x
?th Data 0 : : CH5-DATA CH5-DATA CH5-DATA CH5-DATA
0 : : : : : :
?th Data 0 : : CH6-M6ID3 CH6-M6ID2 CH6-M6ID1 CH6-M6ID0
0 : : x x x x
?th Data 0 : : CH6-DSIZE3 CH6-DSIZE2 CH6-DSIZE1 CH6-DSIZE0
0 : : x x x x
?th Data 0 : : CH6-DATA CH6-DATA CH6-DATA CH6-DATA
0 : : : : : :
nth Data 0 0 0 0 0 0 0
0 1 0 x x x x
n+1th Data 0 1 1 0 0 0 1
end 1 1 1 0 0 0 1
EXLE1 ....................................................................................................................................... 8
Existence of Remaining Peripheral Data ........................................................................... 66
EXLE Functions ....................................................................................................................... 9
EXLE2 ....................................................................................................................................... 9
Extension Data Size .............................................................................................................. 76
Functions .................................................................................................................................. 3
104
IREG1 (Peripheral Control) ................................................................................................. 59
IREG2 (Peripheral Control) ................................................................................................. 60
Main CPU.............................................................................................................................. (ii)
MC68EC000 .......................................................................................................................... (ii)
MDID ................................................................................................................................ 68, 88
Mega Drive 3-Button PAD ............................................................................................. 81, 90
Mega Drive 6-Button PAD ............................................................................................. 81, 90
Multitap .................................................................................................................................. 68
Multitap ID ............................................................................................................................ 68
Non-Resetable System Management Commands............................................................ 35
Number of Connectors......................................................................................................... 13
Optimization During Peripheral Data Collection ............................................................ 55
Optimization Operations During Peripheral Data Collection, Overview of ............... 55
OREG0~OREG31 ................................................................................................................ 5, 6
PAD ........................................................................................................................................... 4
Parallel I/O Register .............................................................................................................. 7
Parallel I/O Register Address Map ..................................................................................... 7
PC ............................................................................................................................................. 3
PDR1 ......................................................................................................................................... 7
PDR2 ......................................................................................................................................... 8
Peripheral Control Mode ..................................................................................................... 48
Peripheral Control Status .............................................................................................. 62, 66
Peripheral Data Acquisition Cancel Sequence Resulting from Break Request ............ 52
Peripheral Data Acquisition Method for SMPC Control Mode ..................................... 49
Peripheral Data Acquisition Sequence .............................................................................. 53
Peripheral Data Collection .................................................................................................. 62
Peripheral ID ................................................................................................................... 62, 69
Peripheral Type ............................................................................................................... 62, 70
Peripherals ............................................................................................................................ (ii)
PLL .......................................................................................................................................... (i)
Port 1 Data ................................................................................................................. 62, 63, 64
Port 2 Data ................................................................................................................. 62, 63, 64
Port Mode .................................................................................................................. 37, 59, 66
Port Status ........................................................................................................................ 62, 67
Power On, Initial Status During ........................................................................................... 3
Reset Button ............................................................................................................................. 2
Reset Button Status ............................................................................................................... 39
Resetable System Management Commands ..................................................................... 21
RTC Command ....................................................................................................................... 3
106
SMPC Control, Format During (Mega Drive 3-Button PAD) ......................................... 81
SMPC Control, Format During (Mega Drive 6-Button PAD) ......................................... 81
SMPC Control, Format During (SATURN 6P Adapter) .................................................. 85
SMPC Control, Format During (SATURN Analog Joystick) .......................................... 83
SMPC Control, Format During (SATURN Keyboard) .................................................... 83
SMPC Control, Format During (SATURN Mouse) .......................................................... 81
SMPC Control, Format During (SATURN Standard PAD) ............................................ 82
SMPC Control, Format During (SEGA Tap) ..................................................................... 82
SMPC Functions ...................................................................................................................... 3
SMPC Interrupt ..................................................................................................................... 13
SMPC System Configuration ................................................................................................ 2
SMPC UNKNOWN Peripheral Data Format ............................................................. 67, 68
Sound CPU .............................................................................................................................. 3
SR (Peripheral Control) ........................................................................................................ 66
SR ......................................................................................................................................... 5, 6
Standard Format ................................................................................................................... 76
System Configuration ............................................................................................................ 2
TH and TR Control Method ................................................................................................ 87
TH Control Method .............................................................................................................. 87
Type A Command Flow ....................................................................................................... 14
Type B Command Flow ....................................................................................................... 14
Type C Command Flow ....................................................................................................... 15
Type D Command Flow ....................................................................................................... 16
V-BLANK-IN ........................................................................................................................ (ii)
V-BLANK-IN Skip Function .............................................................................................. (ii)
V-BLANK-OUT .................................................................................................................... (ii)
VDP1 ................................................................................................................................... (i), 3
VDP2 ................................................................................................................................... (i), 3
Command Names
CD OFF................................................................................................................................... 28
CD ON .................................................................................................................................... 27
Clock Change 320 Mode ...................................................................................................... 31
Clock Change 352 Mode ...................................................................................................... 30
Interrupt Back ........................................................................................................................ 36
Master SH-2 ON .................................................................................................................... 22
NMI Request.......................................................................................................................... 32
Entire System Reset .............................................................................................................. 29
Reset Disable ......................................................................................................................... 34
Reset Enable........................................................................................................................... 33
Slave SH-2 OFF ..................................................................................................................... 24
Slave SH-2 ON ...................................................................................................................... 23
SMPC Memory Setting ........................................................................................................ 44
Sound OFF ............................................................................................................................. 26
Sound ON .............................................................................................................................. 25
Time Setting ........................................................................................................................... 46
108
TM
SEGA Saturn
Dual CPU
User's Guide
Doc. # ST-202-R1-120994
Setting Procedure
:mode;c [Return]
E7000 MODE(MD5-0)=xx? 2E [Return]
MODE SET (C:CONFIGURATION/U:USER/M:MASTER-SLAVE)=X? C [Return]
CONFIGURATION WRITE OK?(Y/N)? Y [Return]
When the clock is changed, the SMPC switches the slave CPU to reset state. The
slave CPU must therefore be restarted by the SMPC command (SSH_ON = 02H) after
the clock is changed.
2
4.0 Programming
4
6.0 Communication from Slave CPU to Master CPU
In addition to providing communication methods from the master CPU to the slave
CPU, the Sega Saturn also provides all of the same communication methods for
communication from the slave CPU to the master CPU.
The cache unit of the SH CPU does not support a bus snoop function. Therefore
when data is transferred between the master and slave CPUs, the CPU reading the
data must either perform a cache-through read or read the data after the cache of the
target area is invalidated.
The following sections shows program examples that use the slave CPU
(when the FRT Input Capture Flag is polled.)
void
InitSlaveCPU(void)
{
volatile Uint 16 i;
void
SlaveCPUmain(void)
{
/* Wait until SlaveCommand is set */
/* then call function for SlaveCommand */
set_imask(0xf);
*IPRA = 0x0000;
*IPRB = 0x0000;
*TIER = 0x01;
while(1){
/* Use “FRT InputCaptureFlag” Polling for wait command from Master */
if((*FTCSR & 0x80) == 0x80){
*FTCSR = 0x00;
/* Execute function requested from master CPU */
(*(void(*)(void))*(void**)((Uint32)&SlaveCommand+0x20000000))();
SlaveCommand = (void*)0;
}
}
}
6
Virtual CD Tool (September 27, 1994 Version)
Note that to use the virtual CD, virtual internal CD Board ROM version 3.1 must be
replaced with version 3.2. Also note that the script syntax changed when the
VCDPRE.EXE was upgraded from version 1.xx to version 2.xx.
[Restriction]
The total number of files that are currently operating is only a little more than 500. Although the
specification allows up to 1300 files to be executed as options when XMS is used, this specifica-
tion has not been announced due to a bug that was found.
Furthermore, an urgent request to support 2000 or more files has been made.
Note: In version 2.xx, the syntax of the script file is different from the syntax used in version
1.xx. Users of version 1.xx must change the script file. For details, refer to the syntax in
item 7, EXSAMPLE.SCR.
SCU
User's Manual
Third version
Doc. # ST-97-R5-072694
In translating/creating this document, certain technical words and/or phrases were interpreted
with the assistance of the technical literature listed below.
This manual explains functions of the system controller and how they are used. The system
controller transfers data rapidly and smoothly by means of the bus controls.
Explanation of Terms
The following terms are used in this manual.
SCU System Control Unit. The SCU contains the CPU I/F, A-Bus IF, B-BUS I/F, and
smoothly effects data transfers between several processors connected through
their respective I/F and bus. It also internally houses the DMA controller,
interrupt controller, and DSP, and makes possible rapid DMA control, interrupt
control, and processing of operations.
Main CPU Uses a RISC type CPU SH2 that controls the overall system. SH2 contains 32-bit
internal and external buses.
VDP1 Video Display Processor 1. Functions include character and line painting, color
indication, Gouraud Shading color operations, screen output coordinate indica-
tion, and frame buffer display control.
VDP2 Video Display Processor 2. Functions include scrolling the screen up/down/
left/right, rotating the screen, determining priority order of multiple screens, and
a priority function that controls the image process of color operations and color
offset.
SCSP Acronym for Saturn Custom Sound Processor. This is a sound source LSI for
multi-functional games that combines a PCM sound source and sound used for
the DSP.
i
SMPC System Manager and Peripheral Control. Has the functions of managing system
resets, control of interfacing with output devices (control pads, mouse, etc.), time
display by a real time clock, and battery backup.
Data A bit is the smallest unit for expressing 1 or 0. 8 bits is a byte. 16 bits (or 2 bytes)
is a word. 32 bits (or 4 bytes) is a 9 long word.
A_Bus Bus that connects external devices such as a ROM cassette or CD.
ii
Manual Notations
Binary Represented by “B” at the end as in 100B. However, “B” may be omitted
for 1 bit.
MSB, LSB The configuration of byte and word shows at the left the high order bit
(MSB, most significant bit), and atthe right the low order bit (LSB, least
significant bit).
x=2-0 This indicates that 3 types exist, 2,1, and 0. For example, DxR26-0[x=2-0]
in the read address in section 3.2 “DMA Control Register” means that
D2R26-0, D1R26-0, and D0R26-0 exist. Similarly, D2R26-0 indicates that
D2R26 ~ D2R0 exist.
iii
CONTENTS
INTRODUCTION
Explanation of Terms .............................................................................. (i)
Manual Notations .................................................................................. (iii)
iv
CHAPTER 2 OPERATION ............................................................... 15
2.1 DMA Transfer ....................................................................... 16
Basic Operation of DMA ...............................................................16
DMA Mode.................................................................................... 18
Example of a Specific Use ............................................................ 21
2.2 Interrupt Control .................................................................. 27
Blanking Interrupt ......................................................................... 29
Timer Interrupt .............................................................................. 30
DSP-End Interrupt ........................................................................ 33
Sound-Request Interrupt .............................................................. 33
SMPC Interrupt ............................................................................. 33
PAD Interrupt ................................................................................ 33
DMA End Interrupt ........................................................................ 33
DMA-Illegal Interrupt ..................................................................... 33
Sprite Draw End Interrupt .............................................................33
2.3 DSP ....................................................................................... 34
DSP Control from the Main CPU ................................................. 34
v
3.5 Interrupt Control Registers ..................................................... 57
Interrupt Mask Register ................................................................ 57
Interrupt Status Register ...............................................................58
3.6 A-Bus Control Registers .......................................................... 61
A-Bus Interrupt Acknowledge Register ........................................ 61
A-Bus Set Register ...................................................................... 62
A-Bus Refresh Register ................................................................ 72
3.7 SCU Control Registers .............................................................. 73
SCU SDRAM Select Register ...................................................... 73
SCU Version Register ................................................................... 73
vi
List of Figures
(Chapter 1 Overview)
Figure 1.1 Diagram of System .................................................................................... 2
Figure 1.2 Block Diagram ........................................................................................... 3
Figure 1.3 SCU Mapping (Cache_address) ............................................................. 4
Figure 1.4 Explanation of Cache Hit Operation ........................................................ 5
Figure 1.5 SCU Mapping (Cache_through_address) ................................................. 6
Figure 1.6 SCU Register Map .................................................................................... 7
Figure 1.7 Level 2-0 DMA Set Register Map ............................................................. 8
Figure 1.8 DMA Force-Stop Register Map .................................................................8
Figure 1.9 DMA Status Register Map ......................................................................... 9
Figure 1.10 DSP Program Control Port Map ............................................................. 9
Figure 1.11 DSP Program RAM Data Port Map ....................................................... 10
Figure 1.12 DSP Data RAM Address Port Map ....................................................... 10
Figure 1.13 DSP Data RAM Data Port Map .............................................................10
Figure 1.14 Timer 0 Compare Register Map ............................................................ 11
Figure 1.15 Timer 1 Set Data Register Map ............................................................. 11
Figure 1.16 Timer 1 Mode Register Map .................................................................. 11
Figure 1.17 Interrupt Mask Register Map ................................................................. 12
Figure 1.18 Interrupt Status Register Map ................................................................ 12
Figure 1.19 A-Bus Interrupt Acknowledge Map ....................................................... 12
Figure 1.20 A-Bus Set Register Map .................................................................. 13
Figure 1.21 A-Bus Refresh Register Map ................................................................. 13
Figure 1.22 SCU SDRAM Select Register Map ....................................................... 14
Figure 1.23 SCU Version Register Map .................................................................. 14
(Chapter 2 Operation)
Figure 2.1 DMA Transfer Basic Operation ................................................................ 16
Figure 2.2 DMA Transferable Area when Activacted from the Main CPU ................ 17
Figure 2.3 DMA Transferable Area when Activacted from the DSP ......................... 17
Figure 2.4 Direct Mode DMA Transfer Operation .................................................... 18
Figure 2.5 Indirect Mode DMA Transfer Flow .......................................................... 19
Figure 2.6 Indirect Mode DMA Transfer Operation Details ...................................... 20
Figure 2.7 Differences in DMA Operations according to the Address Update Bit .... 22
vii
Figure 2.8 Example of Data Write ............................................................................ 23
Figure 2.9 Work RAM Area Contents ...................................................................... 24
Figure 2.10 DMA Transfer by Setting Address Add Value ........................................ 26
Figure 2.11 Blanking Interrupt .................................................................................... 29
Figure 2.12 Timer 0 Interrupt Process (compare register = when 19 is set) ........... 30
Figure 2.13 Timer 1 Interrupt Process (In sync with Timer 0) .................................. 31
Figure 2.14 Timer 1 Interrupt Process (not in sync with Timer 0) ............................ 32
Figure 2.15 DSP Program Load Step 1 ....................................................................34
Figure 2.16 DSP Program Load Step 2 ....................................................................35
Figure 2.17 DSP Program Load Step 3 ....................................................................35
Figure 2.18 DSP Data Access Step 1 ....................................................................... 36
Figure 2.19 DSP Data Access Step 2 ...................................................................... 37
Figure 2.20 DSP Data Access Step 3 ...................................................................... 37
Figure 2.21 DSP Program Execution Start Control from CPU ................................. 38
Figure 2.22 DSP Program Forced Stop Control from CPU ...................................... 38
(Chapter 3 Registers)
Figure 3.1 Level 2-0 Read Address (Register: D0R, D1R, D2R) ........................... 41
Figure 3.2 Level 2-0 Write Address (Register: D0W, D1W, D2W) ......................... 41
Figure 3.3 Level 0 Transfer Byte Number (Register: D0C) .................................... 42
Figure 3.4 Level 2-1 Transfer Byte Number (Register: D1C, D2C) ........................ 42
Figure 3.5 Level 2-0 Address Add Value (Register: D0AD, D1AD, D2AD) ............. 42
Figure 3.6 Communication Units between the SCU and Processor ........................ 44
Figure 3.7 Specific Example of Transfer between the SCU and Processor ............. 44
Figure 3.8 Write Address Add Value Indication ........................................................ 45
Figure 3.9 Level 2-0 DMA Authorization Bit (Register: D0EN, D1EN, D2EN) ....... 45
Figure 3.10 Level 2-0 DMA Mode, Address Update, Start Up Factor
Select Register (Register: D0MP, D1MP, D2MP) ................................ 46
Figure 3.11 DMA Force-Stop Register (Register: DSTP) ...................................... 47
Figure 3.12 High and Low Level DMA Operation .................................................... 48
Figure 3.13 DMA Status Register (Register: DSTA) .............................................. 48
viii
Figure 3.14 DSP Program Control Port (Register: PPAF) ..................................... 51
Figure 3.15 DSP Program RAM Data Port (Register: PPD) ................................... 53
Figure 3.16 DSP Data RAM Address Port (Register: PDA) .................................... 53
Figure 3.17 DSP Data RAM Data Port (Register: PDD) ........................................ 54
Figure 3.18 Time 0 Compare Register (Register: T0C) ....................................... 55
Figure 3.19 Timer 1 Set Data Register (Register: T1S) ......................................... 55
Figure 3.20 Timer 1 Mode Register (Register: T1MD) ........................................... 56
Figure 3.21 Interrupt Mask Register (Register: IMS) ............................................. 57
Figure 3.22 Interrupt Status Register (Register: IST) ........................................... 58
Figure 3.23 A-Bus Interrupt Acknowledge Register (Register: AIAK) ...................... 61
Figure 3.24 A-Bus Set [CS0, 1 Space] (Register: ASR0) ........................................ 62
Figure 3.25 A-Bus Set [CS2, Dummy Space] (Register: ASR1) ............................. 62
Figure 3.26 Result of Previous Read Process ......................................................... 63
Figure 3.27 Timing when Setting the Pre-Charge Insert Bit after Write ................... 63
Figure 3.28 Timing when Setting the Pre-Charge Insert Bit after Read .................. 64
Figure 3.29 Differences in Timing by Setting External Wait Effective Bit ................. 64
Figure 3.30 A-Bus Refresh Register (Register: AREF) .......................................... 72
Figure 3.31 SCU SDRAM Select Bit (Register: RSEL) .......................................... 73
Figure 3.32 SCU Version Register (Register: VER) ................................................ 73
ix
List of Tables
(Chapter 2 Operation)
Table 2.1 Interrupt Factors ................................................................. 27
Table 2.2 Interrupt Factor General Names ........................................ 28
(Chapter 3 Registers)
Table 3.1 Register List ....................................................................... 40
Table 3.2 Read Address Add Value ................................................... 43
Table 3.3 Write Address Add Value ................................................... 43
Table 3.4 Starting Factors .................................................................. 46
Table 3.5 RAM Page Select ...............................................................53
Table 3.6 Timer 1 Occurrence Selection Contents ............................ 56
Table 3.7 Timer Operation Contents ................................................. 56
Table 3.8 Interrupt Status Bit Contents ............................................. 59
Table 3.9 A-Bus Interrupt Acknowledge Contents .............................. 61
Table 3.10 CS0 Space Burst Cycle Set Values .................................. 65
Table 3.11 CS0 Space Normal Cycle Set Values ............................... 65
Table 3.12 CS0 Space Burst Length Set Values ................................ 65
Table 3.13 CS0 Space Bus Size Set Values ...................................... 66
Table 3.14 CS1 Space Burst Cycle Set Values .................................. 67
Table 3.15 CS1 Space Normal Cycle Set Values ............................... 67
Table 3.16 CS1 Space Burst Length Set Values ................................ 68
Table 3.17 CS1 Space Bus Size Set Values ...................................... 68
Table 3.18 CS2 Space Burst Cycle Set Values .................................. 69
Table 3.19 CS2 Space Bus Size Set Values ...................................... 70
Table 3.20 Dummy Space Burst Cycle Set Values ............................. 71
Table 3.21 Dummy Space Normal Cycle Set Values ......................... 71
Table 3.22 Dummy Space Burst Length Set Values ........................... 71
Table 3.23 Dummy Space Bus Size Set Values ................................. 72
Table 3.24 A-Bus Refresh Wait Number ............................................. 72
x
(Chapter 4 DSP Control)
Table 4.1 List of Commands (1) ........................................................ 80
Table 4.2 List of Commands (2) ........................................................ 81
Table 4.3 List of Commands (3) ........................................................ 82
Table 4.4 List of Commands (4) ........................................................ 83
Table 4.5 Descriptions of Constants .................................................. 84
Table 4.6 Features of Data Transfer from D0 Bus to DSP ................ 87
Table 4.7 Features of Data Transfer from DSP to D0 Bus ................ 88
xi
CHAPTER 1 OVERVIEW
Chapter 1 Contents
The SCU (System Control Unit) contains a CPU I/F, A-Bus I/F, and B-Bus I/F. It
smoothly interfaces multiple processors connected through their respective I/Fs and
buses. Also contained inside are the DMA controller, interrupt controller, and DSP.
The DMA controller controls the internal level 2-0 as well as DSP total 4 channel
DMA transfer, and allows the free transfer of data between the CPU, A-Bus, and B-
Bus. Using the CPU-Bus, the CPU can access the work area while executing the
DMA of the A-Bus and B-Bus. The DSP region must be used in data transfer request
from the DSP. For instance, DMA transfer with the A-Bus and B-Bus not using the
DSP region cannot request that data be transfered from the DSP.
The interrupt controller includes interrupts from the A-Bus, B-Bus, and System
Manager, and controls all interrupts within the SCU. It also supports interrupt by
timers and can produce interrupts that are in sync with the screen.
DSP can handle processes that cannot be handled by the main CPU when its load
has been exceeded. DSP operates at half the frequency of the main CPU. As a result,
one step takes about 70 nsec.
System Diagram
A diagram of the system is shown in Figure 1.1. The Work RAM-H, Work RAM-L,
Backup RAM, IPL ROM, and SMPC are connected to the CPU-Bus. The CPU-Bus
controls the system reset signal and control pad. The medium that supplies the CD
or cartridge software is an external system connected to the A-Bus. VDP1, VDP2,
and SCSP are connected to the B-Bus and control picture and sound.
Main SCU
CPU CPU-Bus B-Bus
2
Block Diagram
A block diagram of the SCU is shown in Figure 1.2. As previously mentioned, the
CPU interface, A-Bus, and B-Bus interfaces, and the DMA controller, interrupt con-
troller, and DSP are contained in the SCU. All interfaces and controllers are con-
nected by buses, making transfer of data possible.
The CPU I/F and A-Bus I/F connections are through two buses. The upper bus is
connected through the register. The lower bus is a connection used in transferring
data. Therefore, DMA transfer is done using the lower bus.
SCU
Main CPU
INT
TIMER
00000000 H
ROM Access Region 512 Kbyte
00080000 H
00100000 H
SMPC Region 128 byte
00100080 H
00180000 H
Backup-RAM Region 64 Kbyte
00190000 H ~
External Area 1 Region ~
00200000 H
Work-RAM-L Region 1 Mbyte
00300000 H
01000000 H
MINIT Region 4 byte
01000004 H
01800000 H
SINIT Region 4 byte
01800004 H
02000000 H
A-Bus CS0 Region 32 Mbyte
04000000 H
A-Bus CS1 Region 16 Mbyte
05000000 H
A-Bus Dummy Region 8 Mbyte
05800000 H
A-Bus CS2 Region 1 Mbyte
05900000 H
1 Mbyte
05A00000 H Sound Region about 1 Mbyte
05B00EE4 H
05C00000 H VDP 1 Region 192 Kbyte
05CC0000 H
05D00000 H VDP 1 Region 24 byte
05D00018 H
05E00000 H
VDP 2 Region 512 Kbyte
05E80000 H
05F00000 H VDP 2 Region 4 Kbyte
05F01000 H
05F80000 H VDP 2 Region 288 byte
VDP 2 Region
05F80120 H 05FC0000 H
05FE0000 H SCU Register Region 208 byte
05FE00D0 H
06000000 H SCU Register Region Region
Work RAM-H 1 Mbyte
06100000 H
07FFFFFF H
4
Operation of Cache Hit
If a hit is made to the cache during access to an area that is rewritable by non-CPU
devices such as the work RAM of an I/O port, an external device, or a SCU register,
a value different from the actual value could be returned. When this happens, the
cache-through area must be accessed.
Figure 1.4 explains cache hit operations, and Figure 1.5 shows cach-through opera-
tions.
6
1.3 SCU Register Map
Figure 1.6 shows a map of the SCU register. The SCU register is assigned to the
highest address in the SCU mapping region and, as shown in Figure 1.3, maintains a
208 byte area. Next, a map of each register region is shown.
25FE0000 H
25FE0020 H
25FE0040 H
25FE0060 H
DMA Forced Stop 16 byte
25FE0070 H
DMA Status Register 16 byte
25FE0080 H DSP Program Control Port 4 byte
25FE0084 H DSP Program RAM DataPort 4 byte
25FE0088 H DSP Data RAM Address Port 4 byte
25FE008C H DSP Data RAM DataPort 4 byte
25FE0090 H Timer 0 Compare Register 4 byte
25FE0094 H Timer 1 Set Data Register 4 byte
25FE0098 H Timer 1 Mode Register 4 byte
25FE009C H Free 4 byte
25FE00A0 H Interrupt Mask Register 4 byte
25FE00A4 H Interrupt Status Register 4 byte
25FE00A8 H A-Bus Interrupt Acknowledge 4 byte
25FE00AC H Free 4 byte
25FE00B0 H A-Bus Set Register 8 byte
25FE00B8 H A-Bus Refresh Register 4 byte
25FE00BC H
Free 8 byte
31 24 16 8 0
00 H Read Address (in bytes) (R/W)
10 H 3 4 (W)
14 H 5 6 7 8 (W)
18 H
1C H
Inside graphic:
1. Read address add value 5. DMA mode bit (=0:Direct Mode / =1:Indirect Mode)
2. Write address add value 6. Read address update bit (=0:Save / =1:Revise)
3. DMA enable bit (=0:Disable / =1:Enable) 7. Write address update bit (=0:Save / =1:Update )
4. DMA starting bit 8. DMA start factor select bit
31 0
25FE0060 H 1 (W)
Inside graphic:
1. DMA force-stop bit (=1:DMA force-stop)
8
DMA Status Register
Figure 1.9 is a map of the DMA status register. This register shows level 2-0 condition
status.
31 24 16 8 0
25FE007C H 1 2 3 4 5 6 7 8 9 1011 1213 (R)
Inside graphic:
1. DMA DSP-Bus access flag (=0: no access /=1:access)
2. DMA B-Bus access flag (=0: no access / =1:access) 8. Level 1 DMA standby (=0:stop/=1:standby)
3. DMA A-Bus access flag (=0: no access / =1:access) 9. Level 1 DMA in operation (=0:stop/=1:operate)
4. Level 1 DMA interrupt(=0:stop/=1:interrupt) 10. Level 0 DMA stand by (=0:stop/=1:standby)
5. Level 0 DMA interrupt(=0:stop/=1:interrupt) 11. Level 0 DMA in operation (=0:stop/=1:operate)
6. Level 2 DMA standby (=0:stop/=1:standby) 12. DSP side DMA in stand by (=0:stop/=1:standby)
7. Level 2 DMA in operation (=0:stop/=1:operate) 13. DSP side DMA in operation (=0:stop/=1:operate)
31 26 24 16 15 7 0
25FE0080 H 12 3 4 5 6 7 8 9 1011 Prog RAM address (R/W)
Inside graphic:
1. EX = cancels pause briefly (=0: no execute/=1:execute) 7. Overflow flag
2. EX = executes pause briefly (=0: no execute/=1:execute) 8. Program end interrupt flag
3. D0 bus use DMA transfer execution flag
4. Sine flag 9. Program step execute control bit (=0:no execute/=1:execute)
5. Zero flag 10. Program execute control (=0:stop/=1:execute)
6. Carry flag 11. Program counter load authorization (=0:no execute/=1:execute)
10
Timer 0 Compare Register
Figure 1.14 is the map of the timer 0 compare register. Timer 0 gets in sync with V-
Blank-IN interrupt (See 2.2 Interrupt Control) and causes interrupt to occur. The opera-
tion is explained in section 2.2 and the register contents are explained in chapter 3.
31 9 0
05FE0090 H Counter Value (W)
Inside graphic:
1. Timer 1 mode bit =0:occurs at each line
=1:occurs only for lines designated by timer 0
2. Time operation enable bit =0: Timer operation OFF
=1 : Timer operation ON
31 15 0
05FE00A0 H 1 2 3 4 5 6 7 8 9 10 1112131415 (W)
Inside graphic:
1. A-Bus interrupt mask bit
2~15 Interrupt mask bit
31 0
05FE00A4 H 1 2 3 4 5 6 7 8 9 10 1112131415 16 171819 2021222324 252627282930 (R/W)
Inside graphic:
1~30 Interrupt status bit
31 0
25FE00A8 H 1 (R/W)
Inside graphic:
1. READ: A-Bus interrupt acknowledge significant bit (=0:insignificant / =1:significant)
WRITE: A-Bus interrupt acknowledge significant bit (=0:insignificant / =1:significant)
12
A-Bus Set Register
Figure 1.20 shows the map of the A-Bus set register. Each pre-read significant bit,
precharge insertion bit, and external wait significant bit is insignificant at 0 and
significant at 1. See chapter 3 for more information.
31 0
25FE00B0 H 1 2 3 4 5 6 7 8 9 10 1112 1314 1516171819 20 212223242526272829 30 (W)
Inside graphic:
1. CS0 space, pre-read significant bit 31. CS2 space, pre-read significant bit
2. CS0 space, precharge insertion bit after write 32. CS2 space, precharge insertion bit after write
3. CS0 space, precharge insertion bit after read 33. CS2 space, precharge insertion bit after read
4. CS0 space, external wait significant bit 34. CS2 space, external wait significant bit
5~8. CS0 space, burst cycle wait no. set 35~36. CS2 space, burst length set bit
9~12. CS0 space, single cycle wait no. set 37. Bus size set bit (0=16 bit 1=8 bit)
13~14. CS0 space, burst length set 38. Spare space, pre-read significant bit
15. CS0 space, bus size set bit (0=16bit 1=8bit) 39. Spare space, precharge insertion after write
16. CS1 space, pre-read significant bit 40. Spare space, precharge insertion after read
17. CS1 space, precharge insertion bit after write 41. Spare space, external wait significant bit
18. CS1 space, precharge insertion bit after read 42~45. Spare space, burst cycle wait no. set bit
19. CS1 space, external wait significant bit 46~49. Spare space, normal cycle wait no. set bit
20~23. CS1 space, burst cycle wait no. set 50~51. Spare space, burst length set bit
24~27. CS1 space, normal cycle wait no. set 52. Spare space, bus size set bit (0=16bit 1=8bit)
28~29. CS1 space, burst length set bit
30. CS1 space, bus size set bit (0=16bit 1=8bit)
Inside graphic:
1. A-Bus refresh output significant bit (=0:insignificant / =1:significant)
2~5. A-Bus refresh wait number set bit
31 0
25FE00C4 H 1 (R/W)
Inside graphic:
1. Work-SDRAM select bit (=0:2 Mbit x2 / =1:4 Mbit x 2)
31 0
25FE00C8 H 1 234 (R)
Inside graphic:
1~4. Version number‘
14
CHAPTER 2 OPERATION
Chapter 2 Contents
~ ~ ~ ~ ~ ~
4BH 75th byte 75th byte 50H 75th byte
76th byte 76th byte 51H 76th byte
4C H
77th byte 77th byte 77th byte
4D H 52H
78th byte 78th byte 78th byte
4EH 53H
79th byte 79th byte 79th byte
4F H 54H
80th byte 80th byte 55H 80th byte
50H
16
There are two methods of activating the SCU’s DMA transfer control.
1) activate DMA from the Main CPU
2) activate DMA from the DSP
Figure 2.2 shows the DMA transferable area when activated from the main CPU.
Figure 2.3 shows the DMA transferable area when activated from the DSP.
Figure 2.2 DMA Transferable Area when activated from the Main CPU
DSP Area
Figure 2.3 DMA Transferable Area when activated from the DSP
Direct Mode
Data is transferred only in byte numbers shown as transfer byte numbers directly
using address values of separate level DMA set registers, and from the address
memory shown by the read address register to the address memory shown by the
written address register. One transfer is implemented per start up, then DMA ends.
Figure 2.4 shows the DMA transfer operation of the direct mode.
18
Indirect Mode
The indirect mode implements DMA transfer by indirectly using the DMA set regis-
ter at a level different from the Direct mode mentioned earlier. The address value
and byte number stored by the Direct mode in the set register are stored in the
indirect mode temporary buffer by the Indirect mode, and DMA transfer is repeated
until the end code is detected. Thus, the Indirect mode can implement more than
one DMA transfer when activated once. Figure 2.5 shows the execution flow of
Indirect mode DMA.
N
End Code Exists
End
(DxW+C(N-1)H)
~ ~
End Code nth Write Address
nth Transfer Byte Number
Temporary Buffer
Read Address
Write Address
Transfer Byte Number
Transfer Source Transfer Destination
Read 1st DMA Transfer Write
Address 1 Address 1
20
Example of a Specific Use
Direct Mode
A 1 Kbyte transfer can be thought of as level 0 DMA from address 2000000H (A-Bus
area) to address 6000000H (work RAM). DMA (direct mode) can be executed when
operating in accordance with the following procedures.
1) Write the read address (200000H) to the read address register D0R. (Loads the
address that is read to address 25EF0000H from the CPU.)
2) Write the write address (6000000H) to the write address register D0W. (Loads
the address that is written to address 25EF0004H from the CPU.)
3) Write the transfer byte number (400H) to transfer byte number register D0C.
(Loads the transfer byte number from the CPU to address 25EF0008H.)
4) Write the address add value (101H) to address add value register D0AD.
(Loads the address add value from the CPU to address 25EF000CH. Details of
the address add value are listed in the address add value of this section. The
address add value indicated in the normal DMA is 101H. )
5) The DMA mode is 0, and the address update bit and DMA start factor are set as
necessary and written to mode/address/update/DMA start factor register
D0MD. For example, when address update is handled as the save mode and
V-Blank-IN is handled as the start factor, 0 is written to D0MD. (Loads 0 in
address 25EF0014H from the CPU.)
6) Set 1 in the DMA enable bit. When the start factor set by step 5) occurs, DMA
is activated and 1 Kbyte of data is transferred by level 0 from address 2000000H
(A-Bus area) to address 6000000H (work RAM).
7) After DMA has ended, DMA is activated each time the start factor set in step 5)
occurs. The operation at that time changes according to the values of the read
address update bit (D0RUP) and write address update bit (D0WUP). Figure 2.7
shows DMA operation changes by the address update bit.
Steps 1) to 5) do not have to be done in the same order. (When the start factor is set
in the DMA starting bit, DMA starts each time the DMA operation bit is set to 1 by
the CPU.)
20003FF H 60003FF H
20003FF H 6000400 H
2000000 H 6000000 H
2000400 H 60003FF H
2000000 H 6000000 H
2000400 H 6000400 H
Figure 2.7 Differences in DMA Operations according to the Address update Bit
When the read address update bit is 0, the same address is referred to (read to) both
the first and second time. When the read address update bit is 1, the second read
starts after the address following the first read.
When the write address update bit is 0, write is executed to the same address for
both the first and second time. When the write address update bit is 1, the second
write starts after the address following the first write.
22
Indirect Mode
The Indirect mode is used when executing DMA transfer more than once by starting
once. The Indirect mode is not set in a register as is the Direct mode, but uses a
method of executing DMA by accessing the register through RAM. For example,
consider a case in which three DMA transfers are to be continuously (consecutively)
executed at level 0 through work RAM area (6000000H).
(a) 20HByte DMA transfer from 4000000H to 5C00000H
(b) 10HByte DMA transfer from 5E00000H to 6080000H
(c) 15HByte DMA transfer from 5A00000H to 6081000H
DMA (Indirect mode) can be executed if operated in accord with the following steps.
1) As shown in Figure 2.8, data is written in long word units from the work RAM
area (6000000H).
6000000H 4 00 0 00 0 H
5 C0 0 00 0 H
2 0H
600000CH 5 E00 0 00 H
6 08 0 00 0 H
1 0H
6000018H 5 A00 0 00 H
6 08 1 00 0 H
8 00 0 00 1 5H
6000024H
Steps 1) to 4) do not need to be done in the same order. The read address register
(D0R), transfer byte number register (D0C), and address add value register (D0AD),
which must be set in the Direct mode, do not need to be set in the Indirect mode.
When the DMA transfers listed below are registered in memory, DMA transfer is
restarted after the above process ends. Restart can be done only by repeating the
operation in step (4) above.
(d) 30HByte DMA transfer from 5000000H to 6100000H.
(e) 25HByte DMA transfer from 5100000H to 6200000H.
The contents from the work RAM area 6000000H are shown below in Figure 2.9.
DMA starts each time the start factor set by (5) occurs.
6000000H 4 00 0 00 0 H
5 C0 0 00 0 H
2 0H
600000CH 5 E00 0 00 H
6 08 0 00 0 H
1 0H
6000018H 5 A00 0 00 H
6 08 1 00 0 H
8 00 0 00 1 5H
6000024H 5 00 0 00 0 H
6 09 0 00 0 H
3 0H
6000030H 5 10 0 00 0 H
6 0A0 0 00 H
8 00 0 00 2 5H
600003CH
24
The operation at restart differs depending on whether the DMA mode is in save
mode or update mode. Recognition of the save/update mode of the Indirect mode
is performed and judged by the write address update bit.
• For Save mode (write address update bit = 0), after one DMA transfer is
completed, because the address accessing the parameters is saved at 6000000H,
(a) ~ (c) DMA transfer is re-implemented.
• For update mode (write address update bit = 1), after one DMA transfer is
completed, because the address accessing the parameters is updated at 6000024H,
(d) ~ (e) DMA transfer is implemented.
16 bit
5C00000 H
5C00008 H
Table 1
5C00020 H
5C00028 H
Table 2
5C00030 H
5C003E0H
5C003E8H
Table 32
26
2.2 Interrupt Control
Table 2.1 shows the bit allocation of interrupt factors. Bit allocation shows the inter-
rupt register status. Level 1 is the lowest interrupt level and level F is the highest.
Details are given below for each interrupt factor.
V-Blank-IN
Blanking Interrupt V-Blank-OUT
H-Blank-IN
Timer Interrupt Timer 0
Timer 1
Level 2-DMA End Interrupt
DMA End Interrupt Level 1-DMA End Interrupt
Level 0-DMA End Interrupt
28
Blanking Interrupt
There are three types of blanking interrupt, V-Blank-IN, V-Blank-OUT, and H-Blank-
IN. Figure 2.11 details blanking interrupt. Blanking interrupt is synchronous to the
display, and notifies the user whether a drawing is at the beginning or end.
Display Direction
V-Blank-OUT H-Blank-IN
Display Screen
Non-Display Area
V-Blank-IN
V-Blank-IN
Indicates the end of a display, after which nothing will be displayed on the screen
even when attempting to display data.
V-Blank-OUT
V-Blank-OUT indicates the beginning of a display. Although a display may be about
to begin, how long before interrupt occurs must be taken into consideration since it
takes time (an interval) for the actual display to materialize. V-Blank-OUT also
clears Time 0 data.
Timer Interrupt
Time interrupt includes Timer 0 and Timer 1. Time interrupt is synchronous with
the blanking interrupt mentioned earlier and can cause interrupt to occur at dots
(points) on the screen.
Timer 0
Values are cleared by V-Blank-OUT interrupt reception and counted by
H-Blank-IN interrupt reception . Timer 0 interrupt occurs when values compared to
the Timer 0 compare register (see register details) are the same. Figure 2.12 shows
the Timer 0 occurrence process.
Display Direction
Timer 0 Clear Timer 0 Increment
(In Sync with V-Blank-OUT) (In Sync with V-Blank-IN)
Timer 0 =10
Non-Display Area
30
Timer 1
Data of the Timer 1 data set register (see register details) is set by Timer 1 with H-
Blank-In interrupt receiving. Count down is done at a frequency (1 dot painting) of
7 MHz or about 1/4 the system clock. When the value of Timer 1 becomes 0, inter-
rupt of Timer 1 occurs. Interrupt can also be made to occur at 1 point by combining
it with Timer 0 according to the Timer 1 mode register value (see register details),
and interrupt can be caused to occur at each line independently of Timer 0. Figure
2.13 shows the process up to when Timer 1 interrupt is caused to occur in sync with
Timer 0.
Display Direction
Timer 1 Data Set
(each line)
Display Screen
Timer 0
occurence
Timer 1 Interrupt Occurence
7 MHz
Non-Display Area
V-Blank-IN
Timer 1 Decrement
Display Direction
Timer 1 Data Set
(each line)
Display Screen
Timer 1 Interrupt
occurs at each
line
7 MHz
Non-Display Area
V-Blank-IN
Timer 1 Decrement
32
DSP-End Interrupt
The program execution control flag (see section 3.3, E flag of the Program Control Port)
of the program control port (see section 3.3, Program Control Port) is set by the DSP
ENDI command (see section 4.5, “Command” ENDI command) and gives notice when
the program has ended. By this, the main CPU can retrieve the results calculated by
the DSP.
Sound-Request Interrupt
This interrupt occurs from the SCSP. For example, to display the volume level meter
on the screen when a CD (Compact Disk) is connected, interrupt from SCSP is used
and reported to the main.
SMPC Interrupt
Detailed information about interrupt that occurs from SMPC is listed in the SMPC
User’s Manual.
PAD Interrupt
The occurrence of this interrupt depends on the action of the user. PAD is given as
one example but other items, such as a mouse, may be connected.
DMA-Illegal Interrupt
Notifies user that DMA cannot be executed by interrupt when executing DMA that
cannot be done using certain parameters.
Figures 2.15 to 2.17 show each step of control from the CPU.
0 0
STEP 1
Stops Program Execute
34
Program Control Port
bit 31 bit 7 bit 0
Program RAM Address
Program Transfer
Begin Address
STEP 2
Recognizes the Transfer Source Address
Data
STEP 3
Program transfer
Loads Program address counts up 1.
Control methods from the CPU for each step are shown from Figure 2.18 to
Figure 2.20.
0 0
STEP 1
Stops Program Execute
36
Data RAM Address Port
bit 31 bit 7 bit 0
Program RAM Address
STEP 2
Recognizes the Access Start Address
Data
STEP 3
Read / Write data Data access address
counts up 1.
38
CHAPTER 3 REGISTERS
Chapter 3 Contents
A list of SCU registers is given in Table 3.1. Headings are divided for each register
type and each register is explained.
DMA Control Registers Level 0-DMA Set Register 25FE0000H 25FE0017H 24 byte
Level 1-DMA Set Register 25FE0020H 25FE0037H 24 byte
Level 2-DMA Set Register 25FE0040H 25FE0057H 24 byte
DMA Force-End Register 25FE0060H 25FE0063H 4 byte
DMA Status Register 25FE007CH 25FE007FH 4 byte
DSP Control Ports DSP Program Control Port 25FE0080H 25FE0083H 4 byte
DSP Program RAM Data
Port 25FE0084H 25FE0087H 4 byte
DSP Data RAM Address
Port 25FE0088H 25FE008BH 4 byte
40
3.2 DMA Control Registers
• Read Address
Figure 3.1 is the read address register. The DMA mode includes a direct mode
and an indirect mode. The value of the meaning changes for each mode.
Figure 3.1 Level 2-0 Read Address (Register: D0R, D1R, D2R) Initail value undefined
• Write Address
The write address register is shown in Figure 3.2. The DMA mode includes a
direct mode and indirect mode; the value of the meaning changes with each
mode.
Figure 3.2 Level 2-0 Write Address (Register: D0W, D1W, D2W) Initial value undefined
Figure 3.3 Level 0 Transfer Byte Number (Register: D0C) Initial value undefined
Figure 3.4 Level 2-1 Transfer Byte Number (Register: D1C, D2C) Initial value undefined
25FE000C (Level 0)
b31 b24 b23 b16 b15 b8 b7 b0
25FE002C (Level 1) 1 2 3 4
25FE004C (Level 2)
Figure 3.5 Level 2-0 Address Add Value (Register: D0AD, D1AD, D2AD) Initial value 00000101H
42
Read Address Add Value (1 [bit 8] in Figure 3.5)
DxRA[x=2-0] (W) DMA level 2-0 Read address Addition data bit
Designates the add byte number of the read address. Table 3.2 shows the
read address add value. Since this is effective only for the CS2 space of the A-
Bus, everything else should set 1B. The register of that level prohibits writing
while DMA is operating.
SCU
B-Bus
32 16
A A
B B Processor
SCU B-Bus SCSP
C C VDP1
VDP2
D D
Figure 3.7 Specific Example of Transfer Between the SCU and Processor
44
Transfer SCU Transfer B-Bus Transfer Transfer
Source Units Units Destination
Address 1
Address 2
25FE0010 (Level 0)
b31 b24 b23 b16 b15 b8 b7
25FE0030 (Level 1) 1
25FE0050 (Level 2)
Figure 3.9 Level 2-0 DMA Enable Bit (Register: D0EN, D1EN, D2EN) Initial Value 00000000H
25FE0014 (Level 0)
b31 b24 b23 b16 b15 b8 b7 b0
25FE0034 (Level 1) 1 2 3 4 5 6
25FE0054 (Level 2)
Figure 3.10 Level 2-0 DMA Mode, Address Update, Start Factor Select
Register (Register : D0MD, D1MD, D2MD) Initial Value 00000007H
DMA Starting Factor Select Bit (4~6 [bit 2~0] in Figure 3.10)
DxFT2-0[x=2-0] (W) DMA level 2-0 starting FacTor bit 2-0
DMA sets the DMA enable bit and starts by receiving an outside signal se-
lected by the starting factor select bit. When the starting factor bit is 111B,
DMA starts by setting the DMA starting bit.
46
DMA Forced Stop Register
This is a bit in DMA control which causes DMA forced stops. This register is posi-
tioned at address 05FE0060H (32 bit area) within the SCU. Its operation is shown by
the map below.
Figure 3.11 DMA Force-Stop Register (Register: DSTP) Initial Value 00000000H
When High Level DMA starts while Low Level DMA is operating
Start
A 0 bit during interrupt or operation confirms that the DMA operation is stopped.
Figure 3.13 shows access, interrupt, stand by, and operation registers.
Figure 3.13 DMA Status Register (Register: DSTA) Initial Value 00000000H
48
Level-1 DMA Interrupt Flag (4 [bit 17] in Figure 3.13)
D1BK (R) DMA level 1 BacK ground flag
Shows Level-1 DMA transfer execution is interrupted by the effect of high
level DMA. A 1 shows that it is currently being interrupted. A 0 shows that
level 1 DMA is not interrupted.
50
3.3 DSP Control Ports
Figure 3.14 DSP Program Control Port (Register: PPAF) Initial Value 00000000H
Program Counter Transfer Enable Bit (11 [bit 15] in Figure 3.14)
LE (W) Load Enable bit
This bit decides whether or not the program RAM address (see below) is to be
loaded to the program counter. The program RAM address is loaded to the
program counter if 1 is written to the bit. The address can not be loaded
when the program is being executed (when the program execute control flag
is 1).
52
DSP Program RAM Data Port
Details of the DSP program RAM data port are shown in Figure 3.15. Data is loaded
into the program RAM by writing data stored in the program RAM area from the CPU.
After loading, the program RAM address of the program control port counts up 1.
However, write is prohibited while the program is being executed (when program
execute control flag is 1). This port is write only.
Figure 3.15 DSP Program RAM Data Port (Register: PPD) Initial Value Undefined
Figure 3.16 DSP Data RAM Address Port (Register: PDA) Initial Value 00000000H
Figure 3.17 DSP Data RAM Data Port (Register: PDD) Initial Value Undefined
54
3.4 Timer Registers
Figure 3.18 Timer 0 Compare Register (Register: T0C) Initial Value Undefined
Figure 3.19 Timer 1 Set Data Register (Register: T1S) Initial Value Undefined
Figure 3.20 Timer 1 Mode Register (Register: T1MD) Initial Value 00000000H
56
3.5 Interrupt Control Registers
Figure 3.21 Interrupt Mask Register (Register: IMS) Initial Value 0000BFFFH
Sprite Draw End Interrupt Mask Bit (2 [bit 13] in Figure 3.21)
IMS13 (W) Interrupt MaSk bit bit 13
Indicates whether to mask the sprite draw end interrupt.
Figure 3.22 Interrupt Status Register (Register: IST) Initial Value 00000000H
These status registers are all read/write registers; the read and write meanings are as
shown in Table 3.8.
58
Table 3.8 Interrupt Status Bit Contents
Access Status Result
Read 0 Interrupt does not occur
1 Interrupt does occur
Write 0 Resets interrupt
1 Maintains current interrupt status
Sprite Draw End Interrupt Status Bit (17 [bit 13] in Figure 3.22)
IST13 (R/W) Interrupt STatus bit bit 13
Shows interrupt status of sprite draw end.
DMA Illegal Interrupt Status Bit (18 [bit 12] in Figure 3.22)
IST12 (R/W) Interrupt STatus bit bit 12
Shows interrupt status of DMA illegal.
Level-0-DMA End Interrupt Status Bit (19 [bit 11] in Figure 3.22)
IST11 (R/W) Interrupt STatus bit bit 11
Shows interrupt status of level-0-DMA end.
Level-1-DMA End Interrupt Status Bit (20 [bit 10] in Figure 3.22)
IST10 (R/W) Interrupt STatus bit bit 10
Shows interrupt status of level-1-DMA end.
60
3.6 A-Bus Control Registers
Figure 3.23 A-Bus Interrupt Acknowledge Register (Register: AIACK) Initial Value 00000000H
Figure 3.24 A-Bus Set Register [CS0, CS1 Spaces] (Register: ASR0) Initial Value 00000000H
Figure 3.25 A-Bus Set Register [CS2, Dummy Spaces] (Register: ASR1) Initial Value 00000000H
62
CLK
CPU RD A B C E
A B C D E F
A-Bus RD
A-Bus DATA A B C D E F
CPU DATA A B C E
Pre-charge Insert Bit After CS0 Space Write (2 [bit 30] in Figure 3.24)
A0WPC (W) A-Bus CS0 after Write Pre-Charge insert bit
After data is written in the CS0 space, 1 clock no-process condition can be
inserted. This is the bit that decides whether the process is effective or inef-
fective: 1 shows it is effective; 0 shows it is ineffective. This bit does not
affect the operation after CS0 space read. The operation when this bit
has been set is shown in Figure 3.27.
CLK
ARD
AWR
Figure 3.27 Timing when Setting the Pre-Charge Insert Bit after Write
Pre-charge Insert Bit After CS0 Space Read (3 [bit 29] in Figure 3.24)
A0RPC (W) A-Bus CS0 Previous ReaD bit
After CS0 space data is read, 1 clock no-process condition can be inserted.
This is the bit that decides whether the process is effective or ineffective: 1
shows it is effective; 0 shows it is ineffective. This bit does not affect the
operation after CS0 space write. The operation when this bit has been set is
shown in Figure 3.28. Depending on the type of device, this bit is set because
a fixed period is required after CS is set to High until the next CS is set to
Low. This is true for write as well.
ARD
AWR
Figure 3.28 Timing when Setting the Pre-Charge Insert Bit after Read
CLK
CPU RD
A-Bus RD
AWAIT
DATA
CS0 Space Burst Cycle Wait Number Set Bit (5~8 [bit 27~24] in Figure 3.24)
A0BW3-0 (W) A-Bus CS0 Burst cycle Wait bit 3-0
In the CS0 space, the wait number is set for 1 cycle while a burst access is
being performed. Table 3.10 shows the set values.
64
Table 3.10 CS0 Space Burst Cycle Set Values
Bit Wait Number
A0BW3 A0BW2 A0BW1 A0BW0
0 0 0 0 No wait (wait does not sample)
0 0 0 1 1-cycle wait
: : : :
1 1 1 0 14-cycle wait
1 1 1 1 15-cycle wait
CS0 Normal Cycle Wait Number Set Bit (9~12 [bit 23~20] in Figure 3.24)
A0NW3-0 (W) A-Bus CS0 Normal cycle Wait bit 3-0
In the CS0 space, the wait number is set for 1 cycle during normal access.
Table 3.11 shows the set values.
CS0 Burst Length Set Bit (13~14 [bit 19~18] in Figure 3.24)
A0LN1-0 (W) A-Bus CS0 burst LeNgth bit 1-0
In the CS0 space, the length (boundary) to be accessed is designated during
burst access. Table 3.12 shows the length set values.
CS1 Space Previous Read Effective Bit (16 [bit 15] in Figure 3.24)
A1PRD (W) A-Bus CS1 Previous ReaD bit
This bit decides whether the data previous read process of CS1 space is effec-
tive or not. The data previous read processes reduces the time from access
start until data output. This is effective only for data that is stored in address
that follows the accessed data. Other addresses do not change with normal
addresses. A 1 shows it is effective, a 0 shows it is not effective. See Figure
3.26 for the result when previous read is effective.
Pre-charge Insert Bit After CS1 Space Write (17 [bit 14] in Figure 3.24)
A1WPC (W) A-Bus CS1 after Write Pre-Charge insert bit
Non-process conditions of 1 clock can be inserted after writing data to CS1
space. This is the bit that decides whether the process is effective or ineffec-
tive. A 1 shows it is effective, a 0 shows it is ineffective. This bit has no effect
on the operation after read. Figure 3.26 shows the operation when this bit
has been set.
Pre-charge Insert Bit After CS1 Space Read (18 [bit 13] in Figure 3.24)
A1RPC (W) A-Bus CS1 Read Pre-Charge insert bit
One clock worth of non-process condition can be inserted after reading data
to CS1 space. This is the bit that decides whether the process is effective or
ineffective. A 1 shows it is effective, a 0 shows it is ineffective. This bit has
no effect on the operation after write. Figure 3.28 shows the operation when
this bit has been set.
66
CS1 Space External Wait Effective Bit (19 [bit 12] in Figure 3.24)
A1EWT (W) A-Bus CS1 External WaiT effective bit
Wait can be entered by force by an external signal when accessing the CS1
space via the A-Bus; however, whether the process will be effective or not is
decided by this bit. A 1 shows that the process is effective, a 0 shows that the
process is ineffective. When the process is effective, wait will continue as
long as the external signal is “Low.” Figure 3.29 shows differences in
timing charts when external wait is effective vs. ineffective.
CS1 space Burst Cycle Wait Number Set Bit (20~23 [bit 11~8] in Figure 3.24)
A1BW3-0 (W) A-Bus CS1 Burst cycle WaiT bit 3-0
In the CS1 space, the wait number is set for 1 cycle while a burst access is
performed. Table 3.14 shows the set values.
CS1 Normal Cycle Wait Number Set Bit (24~27 [bit 7~4] in Figure 3.24)
A1NW3-0 (W) A-Bus CS1 Normal cycle Wait bit 3-0
In the CS1 space, the wait number is set for 1 cycle during a normal access.
Table 3.15 shows the set values.
CS1 space Bus Size Set Bit (30 [bit 0] in Figure 3.24)
A1SZ (W) A-Bus CS1 bus SiZe bit
Sets the A-Bus bus size in the CS1 space. Table 3.17 shows the set values.
CS2 Space Previous Read Effective Bit (1 [bit 31] in Figure 3.25)
A2PRD (W) A-Bus CS2 Previous ReaD bit
This bit decides whether the data in the previous read process of CS2 is
effective or not. The data previous read process reduces the time from
access start until data output. This is effective only for data that is stored in
the address that follows the accessed data. Other addresses do not change
with normal addresses. A 1 shows it is effective, a 0 shows it is not effective.
See Figure 3.25 for the effect when previous read is effective.
68
Pre-charge Insert Bit After Writing CS2 Space (2 [bit 30] in Figure 3.25)
A2WPC (W) A-Bus CS2 after Write Pre-Charge insert bit
A no-process condition of 1 clock can be inserted after writing data to CS2.
This is the bit that decides whether the process is effective or ineffective. A
1 shows it is effective, a 0 shows it is ineffective. This bit has no effect on the
operation after read. Figure 3.27 shows the operation when this bit has been
set.
Pre-charge Insert Bit After Reading CS2 Space (3 [bit 29] in Figure 3.25)
A2RPC (W) A-Bus CS2 Read Pre-Charge insert bit
A no-process condition of 1 clock can be inserted after reading data to CS2.
This is the bit that decides whether the process is effective or ineffective. A
1 shows it is effective, a 0 shows it is ineffective.This bit does not affect the
operation after write. Figure 3.28 shows the operation when this bit has
been set.
CS2 Space External Wait Effective Bit (4 [bit 28] in Figure 3.25)
A2EWT (W) A-Bus CS2 External Wait effective bit
Wait can be entered by force by an external signal when accessing the CS2
space via the A-Bus. Whether the process will be effective or not is decided by
this bit. A 1 shows that the process is effective, a 0 shows that the process is
ineffective. When the process is effective, wait will continue as long as the
external signal is “Low.” Figure 3.29 shows differences in timing charts
when external wait is effective vs. ineffective.
CS2 Space Burst Length Bit (5~6 [bit 19~18] in Figure 3.25)
A2LN1-0 (W) A-Bus CS2 burst LeNgth bit 1-0
The access length (boundary) is indicated while burst accessing in CS2.
Table 3.18 shows the length settings.
Dummy Space Previous Read Effective Bit (8 [bit 15] in Figure 3.25)
A3PRD (W) A-Bus CS3 Previous ReaD bit
This bit decides whether the data previous read process of dummy space is
effective or not. The data previous read process reduces the time from access
start until data output. This is effective only for data that is stored in address
that follows the accessed data. Other addresses do not change with normal
addresses. A 1 shows it is effective, a 0 shows it is not effective. See Figure
3.26 for the result when previous read is effective.
After Pre-charge Insert Bit Dummy Space Write (9 [bit 14] in Figure 3.25)
A3WPC (W) A-Bus CS3 after Write Pre-Charge insert bit
Non-process conditions of 1 clock can be inserted after writing data to
dummy space. This is the bit that decides whether the process is effective or
ineffective. A 1 shows it is effective, a 0 shows it is ineffective. This bit hasno
effect on the operation after read. Figure 3.27 shows the operation when
this bit has been set.
After Pre-charge Insert Bit Dummy Space Read (10 [bit 13] in Figure 3.25)
A3RPC (W) A-Bus CS3 Read Pre-Charge insert bit
Non-process conditions of 1 clock can be inserted after reading data to
dummy space. This is the bit that decides whether the process is effective or
ineffective. A 1 shows it is effective, a 0 shows it is ineffective. This bit does
not affect the operation after write. Figure 3.28 shows the operation when
this bit has been set.
Dummy Space External Wait Effective Bit (11 [bit 12] in Figure 3.25)
A3EWT (W) A-Bus CS3 External WaiT effective bit
Wait can be entered by force by an external signal when accessing the
dummy space via the A-Bus. Whether the process will be effective or not is
decided by this bit. A 1 shows that the process is effective, a 0 shows that the
process is ineffective. When the process is effective, wait will continue as
long as the external signal is “Low.” Figure 3.29 shows differences in
timing charts for when external wait is effective vs. when it is ineffective.
Dummy Space Burst Cycle Wait Number Set Bit (12~15 [bit 11~8] in Figure 3.25)
A3BW3-0 (W) A-Bus CS3 Burst cycle Wait bit 3-0
In dummy space, the wait number is set for 1 cycle while a burst access is
performed. Table 3.20 shows the set values.
70
Table 3.20 Dummy Space Burst Cycle Set Values
Bit Wait Number
A3BW3 A3BW2 A3BW1 A3BW0
0 0 0 0 No wait (wait not sampled)
0 0 0 1 1 cycle wait
: : : :
1 1 1 0 14 cycle wait
1 1 1 1 15 cycle wait
Dummy Space Normal Cycle Wait Number Bit (16~19 [bit 7~4] in Figure 3.25)
A3NW3-0 (W) A-Bus CS 3 Normal cycle Wait bit 3-0
In the dummy space, the wait number is set for 1 cycle during normal
accessing. Table 3.21 shows the set values.
Dummy Space Burst Length Set Bit (20~21 [bit 3~2] in Figure 3.25)
A3LN1-0 (W) A-Bus CS 3 burst Le Ngth bit 1-0
In the dummy space, the length (boundary) to be accessed is designated
during burst access. Table 3.22 shows the length set values.
Figure 3.30 A-Bus Refresh Register (Register: AREF) Initial Value 00000000H
A-Bus Refresh Wait Number Set Bit (2~5 [bit 3~0] in Figure 3.30)
ARWT3-0 (W) A-Bus Refresh WaiT bit 3-0
Sets the A-Bus refresh cycle wait number. Table 3.24 shows the details.
72
3.7 SCU Control Registers
Figure 3.31 SCU SDRAM Select Bit (Register: RSEL) Initial Value 00000000H
Figure 3.32 SCU Version Register (Register: VER) Initial Value 00000000H
74
CHAPTER 4 DSP CONTROL
Chapter 4 Contents
Figure 4.1 (on the next page) is an internal block map of the DSP.
76
Figure 4.1 Block Map Inside DSP
SHIFT L16
Imm
TOP(8) TOP(12)
RX(32) RY(32) PH(16) PL(32) ACH(16) ACL(32)
DSP
X Y B A PC(8) LEEX ES EP PR E V C Z S T0
WA0
MULTIPLIER ALU
Write address read F
P47-0 Q data data E Instruction RA0
48 48 T decoder
PROGRAM RAM C
(256 wordX32bit)
DSPexternal
H register
77
• ALU This arithmetic unit is able to output up to 48 bits. Normal calcula-
tions are executed at 32 bits. Only product sum operations become
48-bit operations.
• MULTIPLIER
This multiplier outputs a low-order 48 bit from among the 64 bit
results obtained by 32 bit X 32 bit. The calculation results are in 48 bit
data; the high-order 16 bit is stored in PH and the low order 32 bit is
stored in PL (see below).
• TOP (W) This is an 8 bit register that stores the lead address. The jump
command and subroutine execution process store the lead address in
this register and execute the process.
• LOP (W) This is a 12 bit register that stores the loop counter. The number of
loops is set by the process of repeating 1 command.
• CT0-3 (W) This is a 6 bit register that stores the access address of data RAM0-3.
• MDO-3 (R/W)
This is a 32 bit unit data port that stores the data of data
RAM0-3. There are 64 data ports in each data RAM.
• RA (W) This is the address that stores the register for accessing the data
RAM. This register is 8 bit. The RAM designation number (0-3) is
stored by a high-order 2 bit. The RAM access address is stored by a
low-order 6 bit.
• RX (W) This is the 32 bit X-bus connection register that stores the multiplier
input data.
• RY (W) This is the 32 bit Y-bus connection register that stores the multiplier
input data.
• PH (W) This register stores the high-order 16 bit within the 48 bit multiplier
output data. There is also an input data storage register that stores
the high-order 16 bit within ALU arithmetic unit input data B (48bit).
• PL (W) This register stores the low-order 32 bit within the 48 bit of multiplier
output data. There is also an input data storage register that stores
the low-order 32 bit within ALU arithmetic unit input data B (48bit).
78
• ACH (W) This register stores the high-order 16 bit within 48 bit data showing
the ALU calulation results. There is also an imput data storage
register that stores the high-order 16 bit within ALU arithmetic unit
input data A(48bit).
• ACL (W) This register stores the low-order 32 bit within the 48 bit data
showing the ALU calulation results. There is also an imput data
storage register that stores the low-order 32 bit within ALU arithmetic
unit input data A(48bit).
• D0 Bus This is a 32 bit data bus for external access. It operates at 28 MHz.
It is used in accessing the main CPU.
• X-Bus, Y-Bus
This is a 32 bit data bus for aquiring arithmetic unit input data. It
operates at 14 MHz.
• RAO (W) This is a 32 bit external address register used in external → DSP DMA
transfer. Since it takes a 4 byte unit value, the external address should
be shifted right 2 bits.
• WAO (W) This is a 32 bit external address register used in DSP → external DMA
transfer. Since it takes a 4 byte unit value, the external address should
be shifted right 2 bits.
80
Table 4.2 List of Commands (2)
82
Table 4.4 List of Commands (4)
84
4.3 Operand Execution Method
DSP controls and executes registers as shown for the following commands.
Jump
Command
Any N
Conditions?
N Conditions
Satisfied ?
Y
Stores Jump destination address
in program RAM address of
program control port
END
LOOP
BTM N
Command ?
Y Execute command
Loop End ? N
([LOP]=0)
Y Decrement
number of Loops
END
86
DMA Command Execution
This sets the DMA controller register from the DSP and explains the actual process
of DMA transfer. The DMA command is divided into the two types, shown below,
depending on the transfer direction (read / write).
1) Data transfer from the D0-Bus to the DSP.
2) Data transfer from the DSP to the D0-Bus.
MOV SImm , [CT0] ; Sets DSP data RAM0 transfer begin address
MVI Imm , [RA0] ; Sets external memory transfer begin address
DMA D0 , [MD0] , SImm ; Begins DMA transfer using the D0 Bus
Table 4.6 is a collection of the features of DMA transfer. Because DMA transfer is
executed by 1 long word units, setting of the transfer word number (SImm of the
DMA command mentioned above) must be done in long word units.
Item Feature
MOV SImm , [CT0] ; Sets DSP data RAM0 transfer begin address
MVI Imm , [WA0] ; Sets external memory transfer begin address
DMA [MD0] , D0, SImm ; Begins DMA transfer using the D0 Bus
Table 4.7 is a collection of the features of DMA transfer. Because DMA transfer is
executed in single long word units, setting of the transfer word number (SImm of
the DMA command mentioned above) must be done in long word units.
Item Feature
Flag Set T0 flag of the program control part is set
Start and End Obeys the data ready signal from outside. Transfer is done by this
signal in 1 long word units. DMA transfer is ended by the end signal
from outside, and the program control port T0 flag is reset by this
timing.
Address Change Each time 1 long word is transfered, 1 is added to the DSP data RAM
transfer address ([CT0-3]), and the external memory transfer address
([WA0]) is added according to the address add number.
Hold Status If the DMA command Hold bit (see item 4.5 "Commands" DMA
command section) is set to 1, the transfer word number ([TN0]) and
external memory transfer address ([WA0]) keep the transfer begin
values.
88
4.4 Special Process Execution
Main
Subroutine
Program Program
Designates Child
MOV $01 , [LOP]
execution 1 time
Sets subroutine
MOV Imm , [PC] program start address
Program
NOP Caution: within subroutine
Executed 2 times
Jumps after execution
Program
BTM
END
Execute pre-fetched
command of next step
90
4.5 More About Commands
Operation Commands
Operation commands use each X, Y, and D1 bus as well as an arithmetic logic unit
(ALU). Operation commands can be classified into the following four control types.
1) ALU control command
2) X-Bus control command
3) Y-Bus control command
4) D1-Bus control command
31 30 29 26 25 20 19 14 13 0
92
NOP ALU No Operation
Operation No ALU command process
Description
Label NOP
Instruction Code
b31 26 0
0 0 0 0 0 0
Flag No change
Comments
Label AND
Instruction Code
b31 26 0
0 0 0 0 01
Comments
94
OR OR Operation
Operation Takes the OR operation of [ACL] and [PL] logical sum.
Description
Label OR
Instruction Code
b31 26 0
0 0 0 01 0
Comments
Label XOR
Instruction Code
b31 26 0
0 0 0 01 1
Comments
96
ADD Addition
Operation ADDS [ACL] and [PL].
Description
Label ADD
Instruction Code
b31 26 0
0 0 01 0 0
Comments
Label SUB
Instruction Code
b31 26 0
0 0 01 01
Comments
98
AD2 Addition
Operation Adds [ACH][ACL] and [PH][PL].
Description
Label AD2
Instruction Code
b31 26 0
0 0 01 1 0
Comments
Label SR
Instruction Code
b31 26 0
0 01 0 0 0
Comments
100
RR Right Rotate 1 Bit
Operation Rotates the [ACL] value right 1 bit.
Description
MSB LSB
b31 b30 b29 b0
C
Label RR
Instruction Code
b31 26 0
0 01 0 01
Comments
Label SL
Instruction Code
b31 26 0
0 01 01 0
Comments
102
RL Left Rotate 1 Bit
Operation Rotates the [ACL] value left 1 bit.
Description
MSB LSB
b31 b30 b29 b0
C
Label RL
Instruction Code
b31 26 0
0 01 01 1
Comments
Label RL8
Instruction Code
b31 26 0
0 01 1 1 1
Comments
104
• X-Bus Control Commands
X-Bus control commands transfer data using the X-Bus to the RX register
and PH, PL registers. The following pages show more about X-Bus control
commands.
Label NOP
Instruction Code
b31 25 23 0
0 0 0 0 0
Flag No change
Comments
106
MOV [s],X Transfer (Memory →[RX])
Operation Data is transfered to [RX] from the data RAM address displayed by
[CTx(x=0~3)].
Description
[CTx] [RX]
32bit
Label
MOV [Source RAM],X
Instruction Code
b31 25 20 0
0 0 1 0 0x x x
Bit Data
Process Selections
bit 22 bit 21 bit 20
0 0 0 DATA RAM0 [RX]
0 0 1 DATA RAM1 [RX]
0 1 0 DATA RAM2 [RX]
0 1 1 DATA RAM3 [RX]
1 0 0 DATA RAM0 [RX] ,CT0++
1 0 1 DATA RAM1 [RX] ,CT1++
1 1 0 DATA RAM2 [RX] ,CT2++
1 1 1 DATA RAM3 [RX] ,CT3++
Operation The high order 16 bit of the MULTIPLIER data 48 bit is transfered to
[PH], and the low order 32 bit is transferred to [PL]
Description
MULTIPLIER
16bit 32bit
[PH] [PL]
Label
MOV MUL,P
Instruction Code
b31 25 20 0
0 0 0 1 0
Comments
108
MOV [s],P Transfer (Memory →[PL])
Operation Data is transfered to [PL] from the data RAM address displayed by
[CTx(x=0~3)]. The value of [PH] is changed by the [PL] sign
Description extension.
[CTx] [PL]
32bit
Label
MOV [Source RAM],P
Instruction Code
b31 25 20 0
0 0 0 1 1x x x
Bit Data
Process Selections
bit 22 bit 21 bit 20
0 0 0 DATA RAM0 [PL]
0 0 1 DATA RAM1 [PL ]
0 1 0 DATA RAM2 [PL]
0 1 1 DATA RAM3 [PL]
1 0 0 DATA RAM0 [PL] ,CT0++
1 0 1 DATA RAM1 [PL] ,CT1++
1 1 0 DATA RAM2 [PL] ,CT2++
1 1 1 DATA RAM3 [PL] ,CT3++
110
NOP Y-Bus No Operation
Operation No Y-Bus control process
Description
Label NOP
Instruction Code
b31 19 17 0
0 0 0 0 0
Flag No change
Comments
Operation Data is transfered to [RY] from the data RAM address displayed by
[CTx(x=0~3)].
Description
[CTx] [RY]
32bit
Label
MOV [Source RAM],Y
Instruction Code
b31 19 14 0
0 0 1 0 0x x x
Bit Data
Process Selections
bit16 bit15 bit 14
0 0 0 DATA RAM0 [RY]
0 0 1 DATA RAM1 [RY ]
0 1 0 DATA RAM2 [RY]
0 1 1 DATA RAM3 [RY]
1 0 0 DATA RAM0 [RY] ,CT0++
1 0 1 DATA RAM0 [RY] ,CT1++
1 1 0 DATA RAM0 [RY] ,CT2++
1 1 1 DATA RAM0 [RY] ,CT3++
112
CLR A 0 Clear
Operation 0 clears the [ACH] and [ACL] values.
Description
Label CLR A
Instruction Code
b31 19 14 0
0 0 0 0 1
Comments
Operation Transfers the value of the [ALU] high order 16 bit to [ACH] and the
value of the [ALU] low order 32 bit to [ACL].
Description
ALU
16bit 32bit
[ACH] [ACL]
Label
MOV ALU,A
Instruction Code
b31 19 14 0
0 0 0 1 0
Comments
114
MOV [s],A Transfer (Memory →[ACL])
Operation Data is transfered to [ACL] from the data RAM address displayed by
[CTx(x=0~3)]. The value of [ACH] is changed by the sign extension of
Description [ACL].
[CTx] [ACL]
32bit
Label
MOV [Source RAM],A
Instruction Code
b31 19 14 0
0 0 0 1 1x x x
Bit Data
Process Selections
bit16 bit15 bit 14
0 0 0DATA RAM0 [ACL]
0 0 1DATA RAM1 [ACL]
0 1 0DATA RAM2 [ACL]
0 1 1DATA RAM3 [ACL]
1 0 0DATA RAM0 [ACL] ,CT0++
1 0 1DATA RAM1 [ACL] ,CT1++
1 1 0DATA RAM2 [ACL] ,CT2++
1 1 1DATA RAM3 [ACL] ,CT3++
116
NOP D1-Bus No Operation
Operation No D1-Bus control process
Description
Label NOP
Instruction Code
b31 13 0
0 0 0 0
Flag No change
Comments
Instruction Code
b31 13 8 7 0
0 0 0 1x x x x
SImm Data
Bit Data
[d] Selections
bit11 bit10 bit 9 bit 8
0 0 0 0 DATA RAM0 ,CT0++
0 0 0 1 DATA RAM1 ,CT1++
0 0 1 0 DATA RAM2 ,CT2++
0 0 1 1 DATA RAM3 ,CT3++
0 1 0 0 [RX]
0 1 0 1 [PL]
0 1 1 0 [RA0]
0 1 1 1 [WA0]
1 0 0 0 unused
1 0 0 1 unused
1 0 1 0 [LOP]
1 0 1 1 [TOP]
1 1 0 0 [CT0]
1 1 0 1 [CT1]
1 1 1 0 [CT2]
1 1 1 1 [CT3]
118
MOV [s],[d] Transfer ([source]→[destination])
Instruction Code
b31 13 8 3 0
0 0 1 1x x x x x x x x
1 0 0 0 unused 1 0 0 0 no field
1 0 1 1 [TOP]
1 1 0 0 [CT0]
1 1 0 1 [CT1]
1 1 1 0 [CT2]
1 1 1 1 [CT3]
Flag Area selected by [d] selection is data of an area selected by [s] selectio
31 30 29 26 25 24 0
1 0 Storage
to ag 0 Immediate data
Destination
31 30 29 26 25 24 19 18 0
1 0 Storage
to ag 1 Status Immediate data
Destinat
sti ion
120
MVI Imm,[d] Unconditional Transfer (Imm →[destination])
Instruction Code
b31 24 0
1 0x x x x 0
Imm Data
Bit Data
[d] Selections
bit11 bit10 bit 9 bit 8
0 0 0 0 DATA RAM0 ,CT0++
0 0 0 1 DATA RAM1 ,CT1++
0 0 1 0 DATA RAM2 ,CT2++
0 0 1 1 DATA RAM3 ,CT3++
0 1 0 0 [RX]
0 1 0 1 [PL]
0 1 1 0 [RA0]
0 1 1 1 [WA0]
1 0 0 0 unused
1 0 0 1 unused
1 0 1 0 [LOP]
1 0 1 1 unused
1 1 0 0 [PC] → [TOP] ,[PC]
1 1 0 1 unused
1 1 1 0 unused
1 1 1 1 unused
Comments * [MCx(x=0 ~ 3)] designates DATA RAM x(x=0~3) and, after transfer,
increments [CTx(x=0~3).
Operation When the Z flag is 1, Imm data is transfered to the RAM or register
designated by [destination]. Imm data is signed 19 bit data.
Description
Can be used as execution of the subroutine program (see instruction
code**) by sending Imm data (subtroutine begin dress) to the PC and
saving the PC (jump address after subroutine ends) value to TOP. Be
aware that the address next after this command will be executed twice
once before the subroutine and once after.
Instruction Code
b31 18 0
1 0x x x x 1 1 0 0 0 0 1
Imm Data
Bit Data
[d] Selections
bit29 bit28 bit27 bit26
0 0 0 0 DATA RAM0 ,CT0++
0 0 0 1 DATA RAM1 ,CT1++
0 0 1 0 DATA RAM2 ,CT2++
0 0 1 1 DATA RAM3 ,CT3++
0 1 0 0 [RX]
0 1 0 1 [PL]
0 1 1 0 [RA0]
0 1 1 1 [WA0]
1 0 0 0 unused
1 0 0 1 unused
1 0 1 0 [LOP]
1 0 1 1 unused
1 1 0 0 [PC] → [TOP] ,[PC]
1 1 0 1 unused
1 1 1 0 unused
1 1 1 1 unused
Comments * [MCx(x=0 ~ 3)] designates DATA RAM x(x=0~3) and, after transfer,
increments [CTx(x=0~3).
122
MVI =Imm,[d]NZ Conditional Transfer (Z=0 then Imm →[destination])
Operation When the Z flag is 0, Imm data is transfered to the RAM or register
designated by [destination]. Imm data is signed 19 bit data.
Description
Can be used as execution of the subroutine program (see instruction
code**) by sending Imm data (subtroutine begin dress) to the PC and
saving the PC (jump address after subroutine ends) value to TOP. Be
aware that the address next after this command will be executed twice
once before the subroutine and once after.
Instruction Code
b31 18 0
1 0x x x x 1 1 0 0 0 0 1
Imm Data
Bit Data
[d] Selections
bit29 bit28 bit27 bit26
0 0 0 0 DATA RAM0 ,CT0++
0 0 0 1 DATA RAM1 ,CT1++
0 0 1 0 DATA RAM2 ,CT2++
0 0 1 1 DATA RAM3 ,CT3++
0 1 0 0 [RX]
0 1 0 1 [PL]
0 1 1 0 [RA0]
0 1 1 1 [WA0]
1 0 0 0 unused
1 0 0 1 unused
1 0 1 0 [LOP]
1 0 1 1 unused
1 1 0 0 [PC] → [TOP] ,[PC]
1 1 0 1 unused
1 1 1 0 unused
1 1 1 1 unused
Comments * [MCx(x=0 ~ 3)] designates DATA RAM x(x=0~3) and, after transfer ,
increments [CTx(x=0~3).
Operation When the S flag is 1, Imm data is transfered to the RAM or register
designated by [destination]. Imm data is signed 19 bit data.
Description
Can be used asexecution of the subroutine program (see instruction
code**) by sending Imm data (subtroutine begin dress) to the PC and
saving the PC (jump address after subroutine ends) value to TOP. Th
address next after this command will be executed twice, once before
the subroutine and once after.
Instruction Code
b31 18 0
1 0x x x x 1 1 0 0 0 1 0
Imm Data
Bit Data
[d] Selections
bit29 bit28 bit27 bit26
0 0 0 0 DATA RAM0 ,CT0++
0 0 0 1 DATA RAM1 ,CT1++
0 0 1 0 DATA RAM2 ,CT2++
0 0 1 1 DATA RAM3 ,CT3++
0 1 0 0 [RX]
0 1 0 1 [PL]
0 1 1 0 [RA0]
0 1 1 1 [WA0]
1 0 0 0 unused
1 0 0 1 unused
1 0 1 0 [LOP]
1 0 1 1 unused
1 1 0 0 [PC] → [TOP] ,[PC]
1 1 0 1 unused
1 1 1 0 unused
1 1 1 1 unused
Comments * [MCx(x=0 ~ 3)] designates DATA RAM x(x=0~3) and, after transfer,
increments [CTx(x=0~3).
124
MVI Imm,[d]NS Conditional Transfer (S=0 then Imm →[destination])
Operation When the S flag is 0, Imm data is transfered to the RAM or register
designated by [destination]. Imm data is signed 19 bit data.
Description
Can be used asexecution of the subroutine program (see instruction
code**) by sending Imm data (subtroutine begin dress) to the PC and
saving the PC (jump address after subroutine ends) value to TOP. Be
aware that the address next after this command will be executed twice
once before the subroutine and once after.
Instruction Code
b31 18 0
1 0x x x x 1 1 0 0 0 1 0
Imm Data
Bit Data
[d] Selections
bit29 bit28 bit27 bit26
0 0 0 0 DATA RAM0 ,CT0++
0 0 0 1 DATA RAM1 ,CT1++
0 0 1 0 DATA RAM2 ,CT2++
0 0 1 1 DATA RAM3 ,CT3++
0 1 0 0 [RX]
0 1 0 1 [PL]
0 1 1 0 [RA0]
0 1 1 1 [WA0]
1 0 0 0 unused
1 0 0 1 unused
1 0 1 0 [LOP]
1 0 1 1 unused
1 1 0 0 [PC] → [TOP] ,[PC]
1 1 0 1 unused
1 1 1 0 unused
1 1 1 1 unused
Comments * [MCx(x=0 ~ 3)] designates DATA RAM x(x=0~3) and, after transfer,
increments [CTx(x=0~3).
Operation When the C flag is 1, Imm data is transfered to the RAM or register
designated by [destination]. Imm data is signed 19 bit data.
Description
Can be used asexecution of the subroutine program (see instruction
code**) by sending Imm data (subtroutine begin dress) to the PC and
saving the PC (jump address after subroutine ends) value to TOP. Be
aware that the address next after this command will be executed twice
once before the subroutine and once after.
Instruction Code
b31 18 0
1 0x x x x 1 1 0 0 1 0 0
Imm Data
Bit Data
[d] Selections
bit29 bit28 bit27 bit26
0 0 0 0 DATA RAM0 ,CT0++
0 0 0 1 DATA RAM1 ,CT1++
0 0 1 0 DATA RAM2 ,CT2++
0 0 1 1 DATA RAM3 ,CT3++
0 1 0 0 [RX]
0 1 0 1 [PL]
0 1 1 0 [RA0]
0 1 1 1 [WA0]
1 0 0 0 unused
1 0 0 1 unused
1 0 1 0 [LOP]
1 0 1 1 unused
1 1 0 0 [PC] → [TOP] ,[PC]
1 1 0 1 unused
1 1 1 0 unused
1 1 1 1 unused
Comments * [MCx(x=0 ~ 3)] designates DATA RAM x(x=0~3) and, after transfer,
increments [CTx(x=0~3).
126
MVI Imm,[d]NC Conditional Transfer (C=0 then Imm →[destination])
Operation When the C flag is 0, Imm data is transfered to the RAM or register
designated by [destination]. Imm data is signed 19 bit data.
Description
Can be used asexecution of the subroutine program (see instruction
code**) by sending Imm data (subtroutine begin dress) to the PC and
saving the PC (jump address after subroutine ends) value to TOP. Be
aware that the address next after this command will be executed twice
once before the subroutine and once after.
Instruction Code
b31 18 0
1 0x x x x 1 1 0 0 1 0 0
Imm Data
Bit Data
[d] Selections
bit29 bit28 bit27 bit26
0 0 0 0 DATA RAM0 ,CT0++
0 0 0 1 DATA RAM1 ,CT1++
0 0 1 0 DATA RAM2 ,CT2++
0 0 1 1 DATA RAM3 ,CT3++
0 1 0 0 [RX]
0 1 0 1 [PL]
0 1 1 0 [RA0]
0 1 1 1 [WA0]
1 0 0 0 unused
1 0 0 1 unused
1 0 1 0 [LOP]
1 0 1 1 unused
1 1 0 0 [PC] → [TOP] ,[PC]
1 1 0 1 unused
1 1 1 0 unused
1 1 1 1 unused
Comments * [MCx(x=0 ~ 3)] designates DATA RAM x(x=0~3) and, after transfer,
increments [CTx(x=0~3).
Operation When the T0 flag is 1, Imm data is transfered to the RAM or register
designated by [destination]. Imm data is signed 19 bit data.
Description
Can be used asexecution of the subroutine program (see instruction
code**) by sending Imm data (subtroutine begin dress) to the PC and
saving the PC (jump address after subroutine ends) value to TOP. Be
aware that the address next after this command will be executed twice
once before the subroutine and once after.
Instruction Code
b31 18 0
1 0x x x x 1 1 0 1 0 0 0
Imm Data
Bit Data
[d] Selections
bit29 bit28 bit27 bit26
0 0 0 0 DATA RAM0 ,CT0++
0 0 0 1 DATA RAM1 ,CT1++
0 0 1 0 DATA RAM2 ,CT2++
0 0 1 1 DATA RAM3 ,CT3++
0 1 0 0 [RX]
0 1 0 1 [PL]
0 1 1 0 [RA0]
0 1 1 1 [WA0]
1 0 0 0 unused
1 0 0 1 unused
1 0 1 0 [LOP]
1 0 1 1 unused
1 1 0 0 [PC] → [TOP] ,[PC]
1 1 0 1 unused
1 1 1 0 unused
1 1 1 1 unused
Comments * [MCx(x=0 ~ 3)] designates DATA RAM x(x=0~3) and, after transfer,
increments [CTx(x=0~3).
128
MVI Imm,[d]NT0 Conditional Transfer (T0=0 then Imm →[destination])
Operation When the T0 flag is 0, Imm data is transfered to the RAM or register
designated by [destination]. Imm data is signed 19 bit data.
Description
Can be used asexecution of the subroutine program (see instruction
code**) by sending Imm data (subtroutine begin dress) to the PC and
saving the PC (jump address after subroutine ends) value to TOP. Be
aware that the address next after this command will be executed twice
once before the subroutine and once after.
Instruction Code
b31 18 0
1 0x x x x 1 0 0 1 0 0 0
Imm Data
Bit Data
[d] Selections
bit29 bit28 bit27 bit26
0 0 0 0 DATA RAM0 ,CT0++
0 0 0 1 DATA RAM1 ,CT1++
0 0 1 0 DATA RAM2 ,CT2++
0 0 1 1 DATA RAM3 ,CT3++
0 1 0 0 [RX]
0 1 0 1 [PL]
0 1 1 0 [RA0]
0 1 1 1 [WA0]
1 0 0 0 unused
1 0 0 1 unused
1 0 1 0 [LOP]
1 0 1 1 unused
1 1 0 0 [PC] → [TOP] ,[PC]
1 1 0 1 unused
1 1 1 0 unused
1 1 1 1 unused
Comments * [MCx(x=0 ~ 3)] designates DATA RAM x(x=0~3) and, after transfer,
increments [CTx(x=0~3).
Operation When the Z flag or S flag is 1, Imm data is transfered to the RAM or
register designated by [destination]. Imm data is signed 19 bit data.
Description
Can be used asexecution of the subroutine program (see instruction
code**) by sending Imm data (subtroutine begin dress) to the PC and
saving the PC (jump address after subroutine ends) value to TOP. Be
aware that the address next after this command will be executed twice
once before the subroutine and once after.
Instruction Code
b31 18 0
1 0x x x x 1 1 0 0 0 1 1
Imm Data
Bit Data
[d] Selections
bit29 bit28 bit27 bit26
0 0 0 0 DATA RAM0 ,CT0++
0 0 0 1 DATA RAM1 ,CT1++
0 0 1 0 DATA RAM2 ,CT2++
0 0 1 1 DATA RAM3 ,CT3++
0 1 0 0 [RX]
0 1 0 1 [PL]
0 1 1 0 [RA0]
0 1 1 1 [WA0]
1 0 0 0 unused
1 0 0 1 unused
1 0 1 0 [LOP]
1 0 1 1 unused
1 1 0 0 [PC] → [TOP] ,[PC]
1 1 0 1 unused
1 1 1 0 unused
1 1 1 1 unused
Comments * [MCx(x=0 ~ 3)] designates DATA RAM x(x=0~3) and, after transfer,
increments [CTx(x=0~3).
130
MVI Imm,[d]NZS Conditional Transfer (Z=0=S then Imm → [destination])
Operation When the Z flag or S flag are both 0, Imm data is transfered to the RA
or register designated by [destination]. Imm data is signed 19 bit data
Description
Can be used as execution of the subroutine program (see instruction
code**) by sending Imm data (subtroutine begin dress) to the PC and
saving the PC (jump address after subroutine ends) value to TOP. Be
aware that the address next after this command will be executed twice
once before the subroutine and once after.
Instruction Code
b31 18 0
1 0x x x x 1 0 0 0 0 1 1
Imm Data
Bit Data
[d] Selections
bit29 bit28 bit27 bit26
0 0 0 0 DATA RAM0 ,CT0++
0 0 0 1 DATA RAM1 ,CT1++
0 0 1 0 DATA RAM2 ,CT2++
0 0 1 1 DATA RAM3 ,CT3++
0 1 0 0 [RX]
0 1 0 1 [PL]
0 1 1 0 [RA0]
0 1 1 1 [WA0]
1 0 0 0 unused
1 0 0 1 unused
1 0 1 0 [LOP]
1 0 1 1 unused
1 1 0 0 [PC] → [TOP] ,[PC]
1 1 0 1 unused
1 1 1 0 unused
1 1 1 1 unused
Comments * [MCx(x=0 ~ 3)] designates DATA RAM x(x=0~3) and, after transfer,
increments [CTx(x=0~3).
31 30 29 28 27 18 17 15 14 13 12 11 10 8 7 0
d
1 1 0 0 Mod
o e H 0 dir RAM Immediate data
31 30 29 28 27 18 17 15 14 13 12 11 10 8 7 3 2 0
d
1 1 0 0 Mod
o e H 1 dir RAM SOURCE
132
DMA D0,[RAM],SImm DMA Transfer (D0[31-0] → RAM)
Destination = M0 ~ M3 *
Instruction Code
b31 28 17 15 7 0
1 1 0 0 x x x 0 0 0 0 0x x
SImm Data
Flag T0 ; becomes 1.
Operation RAM data is transfered to D0[31-0]. The external address register and
transfer word number register are updated (added) according to the
Description address add number. Only add numbers 0 and 1 are valid for the A -
Bus and the write unit is 32bit. All add numbers (0 - 64) are valid for
the B-Bus. Write unit is16bit; 32bit data is divided in half and written at
intervals of16X (0-64). The transfer word number register is a register
for storing the transfer word number in long word units. This word
number is either 0 or transfer ends when forced to end.
Source = Mo ~ M3 *
Instruction Code
b31 17 15 7 0
1 1 0 0 x x x 0 0 1 0 0x x
SImm Data
Flag T0 ; becomes 1.
134
DMA D0,[RAM],[s] DMA Transfer (D0[31-0] → RAM )
Operation [s] data designated by bit0~2 is treated as a transfer counter, and only
numbers displayed transfer D0[31-0] data to the RAM. External
Description address register and transfer word number register are updated
(added) according to the address add number. The transfer word
number register stores transfer word numbers in long word units. This
word number becomes 0 or transfer ends when forced to end.
Counter = M0 ~ M3 *,MC0~MC3*
Destination = M0~M3 *,PRG *
b31 28 7 0
1 1 0 0 0 0x 0 1 0 0x x x x x x
Flag T0 ; becomes 1. **
CTx(x0~3) ; incremented when b2=1. When b2=0, there is no change
Comments * [MCx(x=0 ~ 3)] selects DATA RAM x(x=0~3). MCx(x=0~3) selects
DATA RAM x(x=0~3), and after transfer increments CTx(x0~3).
PRG selects program RAM.
**When the END signal informing you that transfer end from outside
has been entered, T0; becomes 0.
Designating address-add adds an add number after the command an
becomes DMA0~DMA1.
Add number is 1 when address add number designation is omitted.
The transfer source address is set in advance to RA0 and the transfer
destination RAM address is set in advance to CTx.
Operation [s] data designated by bit0~2 is treated as a transfer counter, and only
numbers displayed transfer RAM data to DO[31-0] data. External
Description address register and transfer word number register are updated
(added) according to the address add number. The transfer word
number register stores transfer word numbers in long word units. But
only add numbers 0 and 1 are valid for A-Bus, and write units are 32
bits. For B-Bus, all add numbers (0-64) are valid. Write units are 16 bit;
32 bit data is divided in half and written at intervals of 16bitX (0-64). Th
transfer word number register stores transfer words in long word units.
This word number becomes 0 or transfer ends when forced to end.
Label DMA D0,[Destination],[Counter]
Counter = M0 ~ M3 *,MC0~MC3*
Source = M0~M3 *,PR*
Instruction
Code Bit Data
Add Mode Selections
Bit Data
[s] Selections
bit17 bit16 bit15 bit 2 bit1 bit 0
0 0 0 Address Add 0 0 0 0 DATA RAM 0
0 0 1 Address Add 1 0 0 1 DATA RAM 1
0 1 0 Address Add 2 0 1 0 DATA RAM 2
0 1 1 Address Add 4 0 1 1 DATA RAM 3
1 0 0 Address Add 8 1 0 0 DATA RAM 0,CT0++
1 0 1 Address Add 16 1 0 1 DATA RAM 1,CT1++
1 1 0 Address Add 32 1 1 0 DATA RAM 2,CT2++
1 1 1 Address Add 64 1 1 1 DATA RAM 3,CT3++
b31 17 7 0
1 1 0 0 x x x 0 1 1 0 0x x x x x
Bit Data
RAM Selections
bit9 bit8
0 0 DATA RAM 0
0 1 DATA RAM 1
1 0 DATA RAM 2
1 1 DATA RAM 3
Flag T0 ; becomes 1. **
CTx(x=0~3) ; incremented when b2=1. No changes when b2=0.
Comments * [MCx(x=0 ~ 3)] selects DATA RAM x(x=0~3). MCx(x=0~3) selects
DATA RAM x(x=0~3), and after transfer increments CTx(x0~3).
**When the END signal informing you that transfer end from outside
has been entered, T0; becomes 0.
Designating address-add adds an add number after the command an
becomes DMA0~DMA64.
Add number is 1 when address add number designation is omitted.
The transfer source RAM address is set in advance to CTx and the
transfer destination address is set in advance to WA0.
136
DMAH D0,[RAM],SImm DMA Transfer (D0[31-0] → RAM) by HOLD Status
Operation D0[31-0] data is transfered to the RAM. External address register and
transfer word number register save the value at the time transfer
Description begins. The transfer word number register stores the transfer word
number in long word units. This word number becomes 0 or becomes
the transfer end when forced to end.
Instruction Code
b31 28 17 15 7 0
1 1 0 0 0 0x 0 1 0 0x x x x x x
SImm Data
Operation RAM data is transfered to D0[31-0]. The external address register and
transfer word number register save the value when transfer starts.
Description The transfer word number register is a register for storing the transfer
word number in long word units. This word number is either 0 or
transfer ends when forced to end.
Source = Mo ~ M3 *
Instruction Code
b31 17 15 7 0
1 1 0 0 x x x 1 0 1 0 0x x
SImm Data
138
DMAH D0,[RAM],[s] DMA Transfer (D0[31-0] → RAM ) by HOLD Status
Operation [s] data designated by bit0~2 is treated as transfer counter, and only
numbers displayed transfer RAM data to D0(31-0) data. External
Description address register and transfer word number register save the value,
when starting transfer, to the address add number. The transfer word
number register stores transfer word numbers in long word units. This
word number becomes 0 or transfer ends when forced to end.
Counter = M0 ~ M3 *,MC0~MC3*
Destination = M0~M3 *,PR*
b31 28 7 0
1 1 0 0 0 0x 1 1 0 0x x x x x x
Flag T0 ; becomes 1. **
CTx(x0~3) ; incremented when b2=1. When b2=0, there is no change
Comments * [MCx(x=0 ~ 3)] selects DATA RAM x(x=0~3). MCx(x=0~3) selects
DATA RAM x(x=0~3), and after transfer increments CTx(x0~3).
**When the END signal informing you that transfer end from outside
has been entered, T0; becomes 0.
Designating address-add adds an add number after the command an
becomes DMAH0~DMAH1.
Add number is 1 when address add number designation is omitted.
The transfer source address is set in advance to RA0 and the transfer
destination RAM address is set in advance to CTx.
Operation [s] data designated by bit0~2 is treated as transfer counter, and only
numbers displayed transfer RAM data to D0[31-0] data. External
Description address register and transfer word number register save the value
when starting transfer. The transfer word number register stores
transfer words in long word units. This word number becomes 0 or
transfer ends when forced to end.
Counter = M0 ~ M3 *,MC0~MC3*
Source = M0~M3 *,PR*
Instruction
Code Bit Data Add Mode Bit Data
[s] Selections
bit17 bit16 bit15 Selections bit 2 bit1 bit 0
0 0 0 Address Add 0 0 0 0 Data RAM 0
0 0 1 Address Add 1 0 0 1 Data RAM 1
0 1 0 Address Add 2 0 1 0 Data RAM 2
0 1 1 Address Add 4 0 1 1 Data RAM 3
1 0 0 Address Add 8 1 0 0 Data RAM 0 ,CT0++
1 0 1 Address Add 16 1 0 1 Data RAM 1 ,CT1++
1 1 0 Address Add 32 1 1 0 Data RAM 2 ,CT2++
1 1 1 Address Add 64 1 1 1 Data RAM 3 ,CT3++
b31 17 7 0
1 1 0 0 x x x 1 1 1 0 0x x x x x
Bit Data
RAM Selections
bit9 bit8
0 0 DATA RAM 0
0 1 DATA RAM 1
1 0 DATA RAM 2
1 1 DATA RAM 3
Flag T0 ; becomes 1. **
CTx(x=0~3) ; incremented when b2=1. No changes when b2=0.
Comments * [MCx(x=0 ~ 3)] selects DATA RAM x(x=0~3). MCx(x=0~3) selects
DATA RAM x(x=0~3), and after transfer increments CTx(x0~3).
**When the END signal informing you that transfer end from outside
has been entered, T0; becomes 0.
Designating address-add adds an add number after the command and
becomes DMAH0~DMAH64.
Add number is 1 when address add number designation is omitted.
The transfer source RAM address is set in advance to CTx and the
transfer destination address is set in advance to WA0.
140
JUMP Commands
Jump commands are realized by storing immediate data in the program counter.
Figure 4.10 shows the Jump command format. Details of the command are shown in
the next few pages.
31 30 29 28 27 26 25 24 19 18 8 7 0
1 1 0 1 Status Immediate
Instruction Code
b31 25 19 7 0
1 1 0 1 0 0 0 0 0 0 0
Imm Data
Flag No change
Comments
142
JMP Z, Imm Conditional Jump (Z = 1)
Operation When the Z flag is 1, jump is in accordance with address data (Imm).
Description
Instruction Code
b31 25 19 7 0
1 1 0 1 1 1 0 0 0 0 1
Imm Data
Flag No change
Comments
Instruction Code
b31 25 19 7 0
1 1 0 1 1 0 0 0 0 0 1
Imm Data
Flag No change
Comments
144
JMP S,Imm Conditional Jump (S=1)
Operation When the S flag is 1, jump is in accordance with address data (Imm).
Description
Instruction Code
b31 25 19 7 0
1 1 0 1 1 1 0 0 0 1 0
Imm Data
Flag No change
Comments
Instruction Code
b31 25 19 7 0
1 1 0 1 1 0 0 0 0 1 0
Imm Data
Flag No change
Comments
146
JMP C,Imm Conditional Jump (C=1)
Operation When the C flag is 1, jump is in accordance with address data (Imm).
Description
Instruction Code
b31 25 19 7 0
1 1 0 1 1 1 0 0 1 0 0
Imm Data
Flag No change
Comments
Instruction Code
b31 25 19 7 0
1 1 0 1 1 0 0 0 1 0 0
Imm Data
Flag No change
Comments
148
JMP T0,Imm Conditional Jump (T0=1)
Operation When the T0 flag is 1, jump is in accordance with address data (Imm).
Description
Instruction Code
b31 25 19 7 0
1 1 0 1 1 1 0 1 0 0 0
Imm Data
Flag No change
Comments
Instruction Code
b31 25 19 7 0
1 1 0 1 1 0 01 0 0 0
Imm Data
Flag No change
Comments
150
JMP ZS,Imm Conditional Jump (Z=1 or S=1)
Operation When the Z flag or S flag is 1, jump is in accordance with address data
(Imm).
Description
Instruction Code
b31 25 19 7 0
1 1 0 1 1 1 0 0 0 1 1
Imm Data
Flag No change
Comments
Instruction Code
b31 25 19 7 0
1 1 0 1 1 0 0 0 0 1 1
Imm Data
Flag No change
Comments
152
LOOP BOTTOM Commands
Loop Bottom commands repeat one to several steps of a program. Figure 4.11 shows
the Jump command format. Details of the command are shown in the next few
pages.
31 30 29 28 27 0
1 1 1 0 MOD
Label BTM
Instruction Code
b31 29 27 0
1 1 1 0 0
Comments
154
LPS 1 Step Repeat
Operation Repeats next 1 step until the [LOP] register is 0.
Description
Label LPS
Instruction Code
b31 29 27 0
1 1 1 0 1
Comments After the process ends, PC executes LOP+1 time then ends.
31 30 29 28 27 0
1 1 1 1 IE
156
END STOP
Operation Stops the program.
Description
Label END
Instruction Code
b31 29 27 0
1 1 1 1 0
Flag EX ; is0.
Comments
Label ENDI
Instruction Code
b31 29 27 0
1 1 1 1 1
Flag E ; is 1
EX ; is0.
Comments
158
APPENDIX
This appendix contains a list of SCU register address maps.
160
D0R26 D0R25 D0R24 D0R23 D0R22 D0R21 D0R20
D0R19 D0R18 D0R17 D0R16 D0R15 D0R14 D0R13 D0R12 D0R11 D0R10 D0R9 D0R8 D0R7
D0R6 D0R5 D0R4 D0R3 D0R2 D0R1 D0R0
D0W26 D0W25 D0W24 D0W23 D0W22 D0W21 D0W20 D0W19 D0W18 D0W17 D0W16 D0W15 D0W14 D0W13 D0W12 D0W11 D0W10 D0W9 D0W8 D0W7 D0W6 D0W5 D0W4 D0W3 D0W2 D0W1 D0W0
D0C19 D0C18 D0C17 D0C16 D0C15 D0C14 D0C13 D0C12 D0C11 D0C10 D0C9
D0C8 D0C7 D0C6 D0C5 D0C4 D0C3 D0C2 D0C1 D0C0
D0EN D0GO
D0MOD D0RUP
D0WUP
D0FT2 D0FT1 D0FT0
D1C11 D1C10 D1C9 D1C8 D1C7 D1C6 D1C5 D1C4 D1C3 D1C2 D1C1 D1C0
D1EN
D1GO
D1MOD
D1RUP D1WUP D1FT2 D1FT1 D1FT0
D2C11 D2C10 D2C9 D2C8 D2C7 D2C6 D2C5 D2C4 D2C3 D2C2 D2C1` D2C0
D2EN D2GO
D2MOD
D2RUP D2WUP
D2FT2 D2FT1 D2FT0
DSTOP
DACS0 DACSB DACSA D1BK D0BK D2WT D2MV D1WT D1MV D0WT D0MV DOWT DOMV
SCU User's Manual
25FE0080(PPAF) PR EP T0 9 Z C E
V E8 EX LE P7 P6 P5 P4 P3 P2 P1 P0
25FE0084(PPD) PD31 PD30 PD29 PD28 PD27 PD26 PD25 PD24 PD23 PD22 PD21 PD20 PD19 PD18
PD17 PD16 PD15 PD14 PD13 PD12 PD11 PD10 PD9 PD8 PD7 PD6 PD5 PD4 PD3 PD2 PD1 PD0
25FE0088(PDA)
RA7 RA6 RA5 RA4 RA3 RA2 RA1 RA0
25FE008C(PDD) RD31 RD30 RD29 RD28 RD27 RD26 RD25 RD24 RD23 RD22 RD21 RD20 RD19 RD18 RD17 RD16
RD15 RD14 RD13 RD12 RD11 RD10 RD9 RD8 RD7 RD6 RD5 RD4 RD3 RD2 RD1 RD0
25FE0090(T0C)
T0C9 T0C8 T0C7 T0C6 T0C5 T0C4 T0C3 T0C2 T0C1 T0C0
25FE0094(T1S)
T198 T197 T196 T195 T194 T193 T192 T191 T190
25FE0098(T1MD)
T1MD TENB
25FE009C(—)
25FE00A0(IMS)
IMS15 IMS13 IMS12 IMS11 IMS10 IMS9 IMS8 IMS7 IMS6 IMS5 IMS4 IMS3 IMS2 IMS1 IMS0
25FE00A4(IST) IST31 IST30 IST29 IST28 IST27 IST26 IST25 IST24 IST23 IST22 IST21 IST20 IST19 IST18 IST17 IST16
IST13 IST12 IST11 IST10 IST9 IST8 IST7 IST6 IST5 IST4 IST3 IST2 IST1 IST0
25FE00A8(—)
AIACK
25FE00AC(—)
25FE00C0(—)
25FE00C4(RSEL)
RSEL
25FE00C8(VER)
VER3 VER2 VER1 VER0
25FE00CC(—)
161
Acronym Address Bit Description
AIACK 25FE00A8H 0 A-Bus interrupt acknowledge output valid bit
(=0: invalid / =1: valid)
ARFEN 25FE00B8H 4 A-Bus refresh output valid bit (=0: invalid/=1: valid)
ARWT3-0 25FE00B8H 3-0 A-Bus refresh wait number
A0BW3-0 25FE00B0H 27 - 24 CS0 space, burst cycle wait number set bit
A0EWT 25FE00B0H 28 CS0 space, external wait effective bit (=0: invalid/=1: valid)
A0LN1-0 25FE00B0H 19 - 18 CS0 space, burst length set bit
A0PRD 25FE00B0H 31 CS0 space, previous read effective bit (=0: invalid/=1: valid)
A0RPC 25FE00B0H 29 CS0 space, pre-charge insert bit after read
A0NW3-0 25FE00B0H 23 - 20 CS0 space, normal cycle wait number set bit
A0SZ 25FE00B0H 16 CS0 space, bus size set bit
A0WPC 25FE00B0H 30 CS0 space, pre-charge insert bit after write
A1BW3-0 25FE00B0H 11 - 8 CS1 space, burst cycle wait number set bit
A1EWT 25FE00B0H 12 CS1 space, external wait effctive bit (=0: invalid/=1: valid)
A1LN1-0 25FE00B0H 3-2 CS1 space, burst length set bit
A1NW3-0 25FE00B0H 7-4 CS1 space, normal cycle wait number set bit
A1PRD 25FE00B0H 15 CS1 space, previous read effective bit (=0: invalid/=1: valid)
A1RPC 25FE00B0H 13 CS1 space, pre-charge insert bit after read
A1SZ 25FE00B0H 0 CS1 space, bus size set bit
A1WPC 25FE00B0H 14 CS1 space, pre-charge insert bit after write
A2EWT 25FE00B4H 28 CS2 space, external wait effctive bit (=0: invalid/=1: valid)
A2LN1-0 25FE00B4H 19 - 18 CS2 space, burst length set bit
A2PRD 25FE00B4H 31 CS2 space, previous read effective bit (=0: invalid/=1: valid)
A2RPC 25FE00B4H 29 CS2 space, pre-charge insert bit after read
A2SZ 25FE00B4H 16 CS2 space, bus size set bit
A2WPC 25FE00B4H 30 CS2 space, pre-charge insert bit after write
A3BW3-0 25FE00B4H 11 - 8 Dummy space, burst cycle wait number set bit
A3EWT 25FE00B4H 12 Dummy space, external wait effctive bit (=0: invalid/=1: valid)
A3LN1-0 25FE00B4H 3-2 Dummy space, burst length set bit
A3NW3-0 25FE00B4H 7-4 Dummy space, normal cycle wait number set bit
A3PRD 25FE00B4H 15 Dummy space, previous read effective bit (=0: invalid/=1: valid)
A3RPC 25FE00B4H 13 Dummy space, pre-charge insert bit after read
A3SZ 25FE00B4H 0 Dummy space, bus size set bit
A3WPC 25FE00B4H 14 Dummy space, pre-charge insert bit after write
C 25FE0080H 20 DSP program control port, Carry flag
DACSA 25FE007CH 20 DMA A-Bus Access Flag (=0: no access/=1: access)
DACSB 25FE007CH 21 DMA B-Bus Access Flag (=0: no access/=1: access)
DACSD 25FE007CH 22 DMA DSP-Bus Access Flag (=0: no access/=1: access)
DDMV 25FE007CH 0 DSP side DMA operate flag (=0: stop/=1: operate)
DDWT 25FE007CH 1 DSP side DMA standby flag (=0: stop/=1: standby)
DSTOP 25FE0060H 0 DMA force-stop bit (=0: DMA operable/=1: DMA force stop)
D0BK 25FE007CH 16 DMA level 0 interrupt flag (=0: stop/=1: interrupt)
D0C19-0 25FE0008H 19 - 0 DMA level 0 transfer byte number
D0EN 25FE0010H 8 DMA level 0 enable bit (=0: Disable/=1: Enable)
162
Acronym Address Bit Description
D0FT2-0 25FE0014H 2-0 DMA level 0 starting factor selection bit
=000B: V-Blank-IN receive and enable bit set
=001B: V-Blank-OUT receive and enable bit set
=010B: H-Blank-IN receive and enable bit set
=011B: Timer 0 receive and enable bit set
=100B: Timer 1 receive and enable bit set
=101B: Sound Req receive and enable bit set
=110B: Sprite draw end and enable bit set
=111B: DMA start bit set and enable bit set
D0GO 25FE0010H 0 DMA level 0 start bit (=0: stop =1: start)
D0MOD 25FE0014H 24 DMA level 0 mode bit (=0: direct mode/=1: indirect mode)
D0MV 25FE007CH 4 DMA level 0 operating flag (=0: stop/=1: start)
D0RA 25FE000CH 8 DMA level 0 read address add value
(=0: no add/=1: adds 4 byte)
D0RUP 25FE0014H 16 DMA level 0 read address update bit
D0R26-0 25FE0000H 26 - 0 DMA level 0 read address
D0WA2-0 25FE000CH 2-0 DMA level 0 write address add value
=000B: no addition
=001B: adds 2 bytes
=010B: adds 4 bytes
=011B: adds 8 bytes
=100B: adds 16 bytes
=101B: adds 32 bytes
=110B: adds 64 bytes
=111B: adds 128 bytes
D0WT 25FE007CH 5 DMA level 0 standby flag (=0: stop/=1: standby)
D0WUP 25FE0014H 8 DMA level 0 write address update bit
D0W26-0 25FE0004H 26 - 0 DMA level 0 write address
D1BK 25FE007CH 17 DMA level 1 interrupt flag (=0: stop/=1: interrupt)
D1C11-0 25FE0028H 11 - 0 DMA level 1 transfer byte number
D1EN 25FE0030H 8 DMA level 1 enable bit (=0: Disable/=1: Enable)
D1FT2-0 25FE0034H 2-0 DMA level 1 starting factor selection bit
=000B: V-Blank-IN receive and enable bit set
=001B: V-Blank-OUT receive and enable bit set
=010B: H-Blank-IN receive and enable bit set
=011B: Timer 0 receive and enable bit set
=100B: Timer 1 receive and enable bit set
=101B: Sound Req receive and enable bit set
=110B: Sprite draw end and enable bit set
=111B: DMA start bit set and enable bit set
D1GO 25FE0030H 0 DMA level 1 start bit (=0: stop/=1: start)
D1MOD 25FE0034H 24 DMA level 1 mode bit (=0: direct mode/=1: indirect mode)
D1MV 25FE007CH 8 DMA level 1 operating flag (=0: stop/=1: start)
D1RA 25FE002CH 8 DMA level 1 read address add value
(=0: no add/=1: adds 4 bytes)
D1RUP 25FE0034H 16 DMA level 1 read address update bit
D1R26-0 25FE0020H 26 - 0 DMA level 1 read address
164
Acronym Address Bit Description
ES 25FE0080H 17 DSP Program Control Port, Program Step Execution Control Bit
(=0: don't execute / =1: execute)
EX 25FE0080H 16 DSP Program Control Port, Program Execution Control Bit
(=0: don't execute / =1: execute)
IMS0 25FE00A0H 0 V-Blank-IN Interrupt Mask Bit
IMS1 25FE00A0H 1 V-Blank-OUT Interrupt Mask Bit
IMS2 25FE00A0H 2 H-Blank-IN Interrupt Mask Bit
IMS3 25FE00A0H 3 Timer 0 Interrupt Mask Bit
IMS4 25FE00A0H 4 Timer 1 Interrupt Mask Bit
IMS5 25FE00A0H 5 DSP End Interrupt Mask Bit
IMS6 25FE00A0H 6 Sound Request Interrupt Mask Bit
IMS7 25FE00A0H 7 SMPC Interrupt Mask Bit
IMS8 25FE00A0H 8 PAD Interrupt Mask Bit
IMS9 25FE00A0H 9 Level 2-DMA End Interrupt Mask Bit
IMS10 25FE00A0H 10 Level 1-DMA End Interrupt Mask Bit
IMS11 25FE00A0H 11 Level 0-DMA End Interrupt Mask Bit
IMS12 25FE00A0H 12 DMA Illegal Interrupt Mask Bit
IMS13 25FE00A0H 13 Sprite Draw End Interrupt Mask Bit
IMS15 25FE00A0H 15 A-Bus Interrupt Mask Bit
IST0 25FE00A4H 0 V-Blank-IN Interrupt Status Bit
IST1 25FE00A4H 1 V-Blank-OUT Interrupt Status Bit
IST2 25FE00A4H 2 H-Blank-IN Interrupt Status Bit
IST3 25FE00A4H 3 Timer 0 Interrupt Status Bi
t
IST4 25FE00A4H 4 Timer 1 Interrupt Status Bit
IST5 25FE00A4H 5 DSP End Interrupt Status Bit
IST6 25FE00A4H 6 Sound request Interrupt Status Bit
IST7 25FE00A4H 7 SMPC Interrupt Status Bit
IST8 25FE00A4H 8 PAD Interrupt Status Bit
IST9 25FE00A4H 9 Level 2-DMA End Interrupt Status Bit
IST10 25FE00A4H 10 Level 1-DMA End Interrupt Status Bit
IST11 25FE00A4H 11 Level 0-DMA End Interrupt Status Bit
IST12 25FE00A4H 12 DMA Illegal Interrupt Status Bit
IST13 25FE00A4H 13 Sprite Draw End Interrupt Status Bit
IST31-16 25FE00A4H 31-16 Outside Interrupt 15-0 Status Bit
LE 25FE0080H 15 DSP Program Control Port, Program Counter Load Enable Bit (=0:
no execute/=1: execute)
PD31-0 25FE0084H 31 - 0 DSP Program RAM Data Port
PR 25FE0080H 26 DSP Program Control Port, Pause Cancel Flag while program is
executing (=0: no execute/=1: execute)
P7-0 25FE0080H 7-0 DSP Program RAM Address
RA7-0 25FE0088H 7-0 DSP Data RAM Address
RD31-0 25FE008CH 31 - 0 DSP Data RAM Data Port
RSEL 25FE00C4H 0 SDRAM Selection Bit (=0: 2 Mbit x 2 / =1: 4 Mbit x 2)
S 25FE0080H 22 DSP Program Control Port, Sine Flag
166
INDEX Numbers within ( ) shows the page of the “First” heading.
Numeric
1 command Repeat Execution...................................................................................... 89
Alphabetic
A-Bus ................................................................................................................................ ii
A-Bus Control Register ................................................................................................. 61
A-Bus Interrupt Acknowledge .................................................................................... 61
A-Bus Interrupt Acknowledge Register ..................................................................... 61
A-Bus Interrupt Acknowledge Map ........................................................................... 14
A-Bus Refresh Register ........................................................................................... 13, 71
A-Bus Refresh Register Map ........................................................................................ 13
A-Bus Refresh Wait Number ........................................................................................ 71
A-Bus Set Register (CS0, 1 spaces) .............................................................................. 62
A-Bus Set Register (CS2 and dummy spaces) ........................................................... 62
A-Bus Set Register Map ................................................................................................ 13
Access, Interrupt, Standby, Operation Registers ....................................................... 47
B-Bus ............................................................................................................................... (ii)
Blanking Interrupt ......................................................................................................... 29
Block Diagram .................................................................................................................. 3
Commands ...................................................................................................................... 91
Commands (1), List of ................................................................................................... 80
Commands (2), List of ................................................................................................... 81
Commands (3), List of ................................................................................................... 82
Commands (4), List of ................................................................................................... 83
Constants, Description of ............................................................................................. 90
CS0 Space Burst Cycle Set Value ................................................................................. 65
CS0 Space Burst Length Set Value ............................................................................... 65
CS0 Space Bus Size Set Value ....................................................................................... 66
CS0 Space Single Cycle Set Value ................................................................................ 65
CS0, 1 Space A-Bus Set Set Register ............................................................................ 62
CS1 Space Burst Cycle Set Value ................................................................................. 67
CS1 Space Burst Length Set Value ............................................................................... 68
CS1 Space Bus Size Set Value ....................................................................................... 68
CS1 Space Single Cycle Set Value ................................................................................ 67
CS2 Space Burst Cycle Value ........................................................................................ 68
CS2 Space Bus Size Set Value ....................................................................................... 70
168
Example of transfer between SCU and Processor ..................................................... 44
Features of Data Transfer to DSP from D0 Bus ................................................... 87, 88
High/Low Level DMA Operation .............................................................................. 48
Indirect Mode DMA Transfer ...................................................................................... 20
Indirect Mode DMA Transfer Flow ............................................................................. 19
Interrupt Control Register ............................................................................................ 57
Interrupt Factor .............................................................................................................. 27
Interrupt Factor, General Names ................................................................................. 28
Interrupt Mask Register ................................................................................................ 57
Interrupt Mask Register Map ....................................................................................... 12
Interrupt Status Register ............................................................................................... 58
Interrupt Status Register Contents .............................................................................. 59
Interrupt Status Register Map ..................................................................................... 12
Jump Command Execution .......................................................................................... 85
Jump Command Format ............................................................................................. 141
Level 0 Transfer Byte Number ..................................................................................... 42
Level 2-0 Address Add Value ....................................................................................... 42
Level 2-0 DMA Authorization Bit ............................................................................... 45
Level 2-0 DMA Mode, Address Renewal, Start Factor Select Register .................. 46
Level 2-0 DMA Set Register Map .................................................................................. 8
Level 2-0 Read Address ................................................................................................ 41
Level 2-0 Write Address ................................................................................................ 41
Level 2-1 Transfer Byte Number .................................................................................. 42
Load Immediate Command Format 1 (unconditional transfer) ........................... 120
Load Immediate Command Format 2 (conditional transfer) ................................ 120
Loop Bottom Command Format ............................................................................... 153
Loop Program Execution .............................................................................................. 86
Main CPU .......................................................................................................................... i
Operand Execution Method ......................................................................................... 85
Operation Command Format ...................................................................................... 91
Operation when Cache Hit ............................................................................................. 5
PAD Interrupt ................................................................................................................. 33
RAM Page Select ............................................................................................................ 53
Read Address Add Value .............................................................................................. 43
Registers, List of ............................................................................................................. 40
Results of Previous Read Process ................................................................................ 63
170
(This page is blank in the original Japanese document.)
172
DMA D0 , [RAM] , SImm .......................................................................................... 133
DMA [RAM] , D0 , SImm .......................................................................................... 134
DMA , D0 , [RAM] , [s] .............................................................................................. 135
DMA [RAM] , D0 , [s] ................................................................................................ 136
DMAH , D0 , [RAM] , SImm ..................................................................................... 137
DMAH [RAM] , D0 , SImm ....................................................................................... 138
DMAH D0 , [RAM] , [s] ............................................................................................. 139
DMAH [RAM] , D0 , [s] ............................................................................................. 140
JMP Imm ...................................................................................................................... 142
JMP Z , Imm................................................................................................................. 143
JMP NZ , Imm ............................................................................................................. 144
JMP S , Imm ................................................................................................................. 145
JMP NS , Imm .............................................................................................................. 146
JMP C , Imm ................................................................................................................ 147
JMP NC , mm .............................................................................................................. 148
JMP T0 , Imm ............................................................................................................... 149
JMP NT0 , Imm ........................................................................................................... 150
JMP ZS , Imm .............................................................................................................. 151
JMP NZS , Imm ........................................................................................................... 152
BTM ............................................................................................................................... 154
LPS ................................................................................................................................. 155
END ............................................................................................................................... 157
ENDI ........................................................................................................................ 33, 158
VDP1
User's Manual
Doc. # ST-013-R3-061694
In translating/creating this document, certain technical words and/or phrases were interpreted
with the assistance of the technical literature listed below.
2. Computer Dictionary
Kyoritsu Publishing Co., LTD.
Tokyo, Japan
1978
This manual explains the functions of the VDP1 and how they are used. The VDP1 primarily
defines draw data and performs drawing.
Definitions
VDP1
VDP1 is an integrated circuit (IC) that controls drawing. The VRAM and frame buffer (both
DRAM) are connected to the VDP1. The CPU writes draw commands to VRAM via the VDP1.
The VDP1 reads draw commands from VRAM and writes (draws) draw data to the frame
buffer, and later transfers this data to a display monitor.
The frame buffer is a bit-mapped memory, and any data written to it has a 1-to-1 correspon-
dence with the contents of the display screen. Therefore, the frame buffer is a map of the dis-
play screen. There are system registers in the VDP1 and screen display is controlled by setting
values in these registers.
Display
Televisions are commonly used as display devices. The standard used in Japan and in the
United States is NTSC. PAL system TVs are used in Europe.
Hi-res is a high resolution mode that doubles the horizontal resolution. 31KC is a system that
doubles the horizontal frequency of 15KC in order to raise the vertical resolution. Hi-vision
(HDTV), or so-called “high-definition” TV, has twice the horizontal and vertical resolution of
regular TV.
A TV display is comprised of fields and frames. A field is the time it takes a scanning line to
scan one screen. In the NTSC system, this is 1/60th of a second and in the PAL system, 1/50th
of a second. A frame is the time it takes from one change of the frame buffer to the next
change. When the change mode of the frame buffer is in a one cycle mode, one frame is equal
to one field. When the frame buffer is changed every two fields such as in single density inter-
lace, one frame comprises two fields. When the frame buffer is changed only once a second in
the manual mode, one frame comprises 60 fields in the NTSC system, and 50 fields in the PAL
system.
(1)
Before each frame is drawn, the frame buffer is automatically erased. Erase is performed by
writing (filling) a code specified in a register to the frame buffer. This operation is referred to
as erase/write.
Access
Reading and writing of data by the CPU and VDP1 in VRAM, the system registers, and frame
buffers are referred to as access. When two or more devices attempt access at the same time,
the accesses are arbitrated, with writes normally given priority over reads.
When a DMA controller is used, access of VRAM can be performed continuously and rapidly
by burst transfer. However, do not perform burst access of registers.
Data
A bit is the smallest unit of data which is represented by “0” or “1.” A combination of 8 bits is
called a byte, and 16 bits (or 2 bytes) is called a word. When a byte is divided into its upper 4
bits and its lower 4 bits, each is referred to as a nibble.
Commands
Commands include draw commands, clipping coordinate set commands, and local coordinate
set commands. Clipping is the removal of graphics outside a set area. Local coordinates change
the drawing position using the coordinates specified by the draw command as local coordi-
nates.
Commands are defined in VRAM as command tables. In addition to the command table, there
are the character pattern table, the Gouraud shading table, and the color lookup table.
Tables are defined by addresses with an 8H-byte boundary or a 20H-byte boundary, and are
stored in VRAM. A boundary is the splitting of addresses at the 8H or 20H boundary so there
is no remainder. Registers have 2H-byte (one = word) boundaries.
The VDP1 fetches command tables successively and draws according to these commands.
Fetch is the act of reading from VRAM in order to process commands.
(2)
Parts
Objects drawn by using the draw command are called parts. Parts are divided into textured
and non-textured parts. Textured parts are called sprites; non-textured parts include polygons,
polylines, and lines.
Sprites are characters and the color codes of these characters are defined in VRAM as a charac-
ter pattern table. Polygons are filled squares, polylines are non-filled squares, and lines are
straight lines that connect two points.
The VDP1 processes draw commands in VRAM and draws parts in the frame buffer 1 pixel at
a time. The color resolution of the data in the frame buffer is in 8 or 16 bits per pixel (bpp).
Color
The RGB code method and the color bank method, which uses palette codes and color banks
are used to express color. The RGB code method specifies the luminance of each of the colors:
red (R), green (G), and blue (B), in 5 bits. In the color bank method, the VDP2 color palette is
selected from a color bank, and a palette code is used to select the desired color from this
palette.
Sprite colors can be specified using the color lookup table method. The color is selected from
among the 16 colors defined in the color lookup table. The color code can be specified using
RGB or color bank codes.
Color Calculation
Color calculation is a special function of the VDP1. Gouraud shading is an example of color
calculation. The luminance of the RGB code of a particular part can be changed using the RGB
codes of four points defined in the Gouraud shading table.
(3)
Notations Used in this Manual
Units
1 Kbyte is equal to 1024 bytes. 1 Mbit is 1,048,576 bits.
MSB, LSB
In the configuration of bytes and words, the left is the most significant bit (MSB) and the right
is the least significant bit (LSB).
Undefined Bits
Bits that are not defined in the command table or the system registers are indicated by a hy-
phen “-”. Write 0B to undefined bits in the system registers. Write “0” or “1” to undefined bits
in command tables. If an entire word is unused, fill with either "0" or "1". When a word is
partially used, fill the remaining unused bits with "0".
Addresses
The addresses shown in this manual are relative VDP1 addresses . VDP1 is at the absolute
address 5C00000H of the system.
Add 5C00000H to a relative address to determine the absolute address. For example, the abso-
lute address 000000H in VRAM is address 5C00000H, and the absolute address 180000H in the
system registers becomes 5D80000H.
(4)
Table of Contents
Introduction
Definitions .................................................................................................................................. (1)
Notations Used in this Manual .................................................................................................. (4)
Contents ...................................................................................................................... (5)
List of Figures ............................................................................................................................ (8)
List of Tables............................................................................................................................ (10)
Chapter 1 Functions of the VDP1 ............................................................................. 1
1.1 VDP1 .............................................................................................................. 2
System Configuration ............................................................................ 2
Functions of the VDP1 .......................................................................... 3
Parts ..................................................................................................... 4
Textured Parts ....................................................................................... 5
Non-Textured Parts ............................................................................. 10
Color ................................................................................................... 12
1.2 Screen Modes.................................................................................................. 14
Screen Modes and Display Areas ....................................................... 14
Rotated Reading of Frame Buffer ....................................................... 15
Chapter 2 Address Map ............................................................................................................ 17
2.1 Address Map .................................................................................................... 18
VRAM ................................................................................................. 19
Frame Buffer ....................................................................................... 20
System Registers ................................................................................ 23
2.2 Tables in VRAM ............................................................................................... 24
Command Table .................................................................................. 25
Color Lookup Table ............................................................................. 26
Gouraud Shading Table ...................................................................... 26
Character Pattern Table ...................................................................... 26
Chapter 3 Processing Flow .................................................................................... 27
3.1 Draw Procedure Flow ...................................................................................... 28
3.2 Command Table Flow ...................................................................................... 30
3.3 Table Referencing ............................................................................................ 31
(5)
Chapter 4 System Registers ................................................................................... 33
4.1 TV Mode Selection Register ............................................................................ 36
4.2 Frame Buffer Change Mode Register .............................................................. 38
4.3 Plot Trigger Register ........................................................................................ 45
4.4 Erase/Write ...................................................................................................... 46
Erase/Write Data Register .................................................................. 46
Erase/Write Upper-Left Coordinate Register ...................................... 47
Erase/Write Upper-Right Coordinate Register ................................... 47
4.5 Draw Forced Termination Register .................................................................. 51
4.6 Transfer End Status Register ........................................................................... 52
4.7 Last Operation Command Address Register ................................................... 54
4.8 Current Operation Command Address Register ............................................. 55
4.9 Mode Status Register ...................................................................................... 57
Chapter 5 Tables ......................................................................................................................... 59
5.1 Character Pattern Tables ................................................................................. 60
5.2 Color Lookup Tables ........................................................................................ 62
5.3 Gouraud Shading Table ................................................................................... 64
5.4 Command Tables ............................................................................................. 66
Chapter 6 Command Tables ................................................................................... 69
6.1 CMDCTRL (Control Words) ............................................................................. 70
Commands ......................................................................................... 71
Jump Mode ......................................................................................... 72
Zoom Point ......................................................................................... 73
Character Read Direction ................................................................... 77
6.2 CMDLINK (Link Specification) ......................................................................... 78
6.3 CMDPMOD (Draw Mode Word) ....................................................................... 79
High Speed Shrink .............................................................................. 81
Pre-Clipping Disable ........................................................................... 83
User Clipping Enable .......................................................................... 84
User Clipping Mode ............................................................................ 84
Mesh Enable ....................................................................................... 85
End Code Disable ............................................................................... 86
Trasparent Pixel Disable ..................................................................... 88
Color Mode ......................................................................................... 89
Color Calculation................................................................................. 93
MSB ON .............................................................................................. 97
(6)
6.4 CMDCOLR (Color Control Word) ..................................................................... 98
Color Bank .......................................................................................... 99
Color Lookup Table ........................................................................... 101
Non-Textured Color ........................................................................... 102
6.5 CMDSRCA (Character Address) .................................................................... 103
6.6 CMDSIZE (Character Size)............................................................................ 104
6.7 CMDXA~CMDYD (Vertex Coordinate Data) ................................................. 105
6.8 CMDGRDA (Gouraud Shading Table) ........................................................... 106
Chapter 7 Commands ........................................................................................... 107
7.1 System Clipping Coordinate Set Command .................................................. 110
System Clipping ................................................................................ 111
7.2 User Clipping Coordinate Set Command ....................................................... 112
User Clipping .................................................................................... 113
7.3 Local Coordinate Set Command .................................................................... 116
Local Coordinates ............................................................................. 117
7.4 Normal Sprite Draw Command ...................................................................... 118
7.5 Scaled Sprite Draw Command....................................................................... 120
Specification of Two Coordinate Vertices ......................................... 120
Specification of Fixed Point (Scaled Sprite Draw Command) .......... 122
7.6 Distorted Sprite Draw Command ................................................................... 124
7.7 Polygon Draw Command ............................................................................... 126
7.8 Polyline Draw Command ............................................................................... 128
7.9 Line Draw Command ..................................................................................... 130
7.10 Draw End Command ..................................................................................... 132
Chapter 8 Quick Reference ................................................................................... 133
8.1 System Registers ........................................................................................... 134
8.2 Tables ............................................................................................................ 140
8.3 Command Tables ........................................................................................... 142
8.4 Commands .................................................................................................... 151
Chapter 9 Precautions for Use .............................................................................. 157
Index ................................................................................................................................................ 161
(7)
List of Figures
(Chapter 5 Tables)
Figure 5.1 Examples of Character Pattern Tables ....................................................................61
Figure 5.2 Color Lookup Table .................................................................................................. 62
Figure 5.3 Relationship between Tables in Lookup Table System ........................................... 63
Figure 5.4 RGB Code Format ................................................................................................... 64
Figure 5.5 Command Table ...................................................................................................... 66
(8)
(Chapter 6 Command Tables)
Figure 6.1 Zoom Point .............................................................................................................. 73
Figure 6.2 Drawing Area ........................................................................................................... 75
Figure 6.3 Zoom Point and Drawing Area................................................................................. 76
Figure 6.4 Character Read Direction ........................................................................................ 77
Figure 6.5 High Speed Shrink .................................................................................................. 82
Figure 6.6 Pre-Clipping ............................................................................................................ 83
Figure 6.7 Drawing Area ........................................................................................................... 84
Figure 6.8 Mesh Processing ..................................................................................................... 85
Figure 6.9 Mesh Processing of Lines and Polylines ................................................................. 85
Figure 6.10 (a) End Code Processing (1 of 2) .......................................................................... 87
Figure 6.10 (b) End Code Processing (2 of 2) .......................................................................... 87
Figure 6.11 Example of Drawing in Modes 0 and 1 .................................................................. 90
Figure 6.12 Example of Drawing in Modes 2, 3, and 4 ............................................................. 91
Figure 6.13 RGB Code Format ................................................................................................. 92
Figure 6.14 Example of Drawing in Mode 5 .............................................................................. 92
Figure 6.15 Examples of Color Calculation .............................................................................. 96
Figure 6.16 MSB ON ............................................................................................................ 97
Figure 6.17 Color Bank ............................................................................................................ 99
Figure 6.18 Color Lookup Table.............................................................................................. 101
Figure 6.19 CMDSIZE .......................................................................................................... 104
(Chapter 7 Commands)
Figure 7.1 System Clipping .................................................................................................... 111
Figure 7.2 User Clipping Settings ........................................................................................... 114
Figure 7.3 User Clipping ......................................................................................................... 115
(9)
List of Tables
(Chapter 5 Tables)
Table 5.1 Size of Character Pattern Tables .............................................................................. 60
Table 5.2 Gouraud Shading Table ............................................................................................ 64
Table 5.3 Relationship between Gouraud Shading Table Settings and Correction Values .. ... 65
(Chapter 7 Commands)
Table 7.1 Commands .......................................................................................................... 109
(10)
Chapter 1
Contents
The VDP1 is a sprite drawing IC for the SEGA SATURN because the VDP1 uses a
frame buffer, it is much faster, is characterized by an increased RAM capacity, and
can display many more sprites (characters) compared to previous systems.
System Configuration
A VRAM (4-Mbit DRAM) and a two-plane frame buffer (2-Mbit DRAM per screen)
are connected to the VDP1. The image data defined in VRAM by the CPU are output
to the display device via the frame buffer.
Draw data is sent from the CPU to the VDP1 via the system control IC and is written
in VRAM. Parts written in VRAM are drawn in the frame buffer in a 16- or 8-bit/
pixel form. The frame buffer data that is drawn is displayed on the display device
via the priority circuit in the VDP2. The priority circuit prioritizes the scroll plane
and the priority plane. The frame buffer has two screens, and draw and display are
changed every frame.
The information that controls draws is set in the VDP1 system registers by the CPU
via the system controller IC. The system registers control draws.
VRAM
(4 Mbit)
VDP1
System Display
CPU Controller System VDP2 Device
IC Registers
Frame Frame
Buffer Buffer
(2 Mbit) (2 Mbit)
2
Functions of the VDP1
The functions of the VDP1 include the drawing of parts (characters and lines), speci-
fication of colors, color calculation of Gouraud shading, specification of clipping
coordinates and local coordinates, and control of display by the frame buffer. Parts,
color, and coordinates are controlled by the command table in VRAM, and display of
the frame buffer is controlled by the system registers.
Parts
The following graphics can be drawn as parts.
· Normal sprites
· Scaled sprites (with zooming)
· Distorted sprites (includes rotation)
· Polygons (quadrangles)
· Polylines (quadrangles comprising four lines)
· Lines
Collectively, sprites are referred to as textured parts, and polygons, polylines, and
lines are referred to as non-textured parts.
Color
· The possible numbers of colors for each textured part are 16, 64, 128, 256,
and 32,768.
Special Functions
· When RGB codes are used, color calculation of half-luminance, half-trans-
parency, Gouraud shading, and shadowing are possible.
· Mesh (tiling).
Coordinate Control
· System and user clipping settings are possible.
· Local coordinates can be set during drawing.
4
Textured Parts
Textured parts are called sprites. Sprites draw character patterns. Character patterns
define pixel data as character pattern tables in VRAM. The size of the pixel data is
determined by the color mode and the size of the characters.
Sprites include normal sprites, scaled sprites, and distorted sprites. Normal sprites
can be inverted vertically and horizontally; scaled sprites can be inverted vertically
and horizontally, enlarged and reduced, and stretched; and distorted sprites can be
inverted vertically and horizontally, enlarged and reduced, stretched, rotated, and
twisted.
Normal Sprites
The character pattern is drawn at a specified position. The coordinates of the upper-
left vertex at which the character pattern is drawn are specified. The character pat-
tern is drawn from the specified coordinates to the right in the X direction and down
in the Y direction. When vertical and horizontal inversion are specified for the read-
out direction of the character pattern, the right side of the defined character pattern
is drawn from the left and the bottom side is drawn from the top.
Normal sprites cannot be rotated 90°. Specify the distorted sprite draw command to
perform 90° rotation.
Vertex (A)
A B Vertex (A)
A B
Vertical Vertical &
inversion horizontal
inversion
... .
Vertex (C)
Vertex (C)
Vertex (A)
Horizontal enlargement,
vertical reduction &
AB
Vertex (A)
... .
6
Specification of Zoom Point
Scaled sprites can be drawn by specifying the zoom point and display width. The
zoom point of the character pattern, the draw coordinates of the zoom point, and the
display width at which the character pattern is drawn are specified. The zoom point
specifies which point on the character pattern is used as a stationary point for draw-
ing. The point is selected from the left side, center, and right side in the horizontal
direction and from the top side, center, and bottom side in the vertical direction. The
display width specifies the display width in the X direction and the Y direction.
When vertical and horizontal inversions are specified for the character pattern
readout direction, each character patter is drawn inverted vertically and horizontally
with reference to each zoom point. The draw area differs depending on vertical or
horizontal inversion.
Zoom Zoom
point point A B
AB AB Display
width
Draw Display
Original width
graphic Normal size Vertical/horizontal reduction
& horizontal inversion with
zoom point at center.
Display Zoom
AB Display
width point width
Zoom
point
Horizontal enlargement,
vertical reduction & Vertical/horizontal enlargement
vertical inversion with & vertical/horizontal inverstion
zoom point at upper right. with zoom point at right center.
8
Anti-aliasing
Distorted sprites and polygons contain diagonal lines that may result in pixel drop-
out (aliasing). When this happens, holes are anti-aliased as shown below.
Polygons
Draw a quadrangle by specifying four vertices and filling the enclosed area with a
single color. The four vertices can be specified as desired. The color is specified as a
non-textured color.
Polygons contain diagonal lines that may result in pixel dropout (aliasing). When
this occurs, holes are anti-aliased. For this reason, some pixels may be written twice,
and therefore the results of half-transparency processing as well as other color
calculations cannot be guaranteed. Concave polygons can also be drawn. However,
fills may extend outside of the polygon since lines are used to fill the polygon.
Vertex (B)
Vertex (A)
Vertex (C)
Vertex (D)
Vertex (A)
Concave polygon
Vertex(B)
10
Polylines
A quadrangle is drawn by connecting four lines. Specify four vertices, and lines
connecting the vertices are drawn in order. Unlike polygons, the area enclosed by
the four vertices cannot be filled. The four vertices can be specified as desired.
Specify the color as non-textured color. Because four lines are drawn, the pixels near
the vertices are written twice. Therefore, the results of half-transparent processing
and other color calculations cannot be guaranteed.
Vertex (B)
Vertex (A)
Vertex (C)
Vertex (D)
Lines
A line is drawn in a single color between two specified coordinates. Specify the
color as a non-textured color.
Vertex A
Vertex B
MSB LSB
Priority
Color calculation
12
Part Colors
The color bank method, the color lookup table method, or the RGB code method can
be used to set the color of sprites. Set a non-textured color for each non-textured part
such as polygons, polylines, and lines.
Non-textured Color
Non-textured color is handled as pixel data without the use of a color bank or color
lookup table.
8 Bits/Pixel Color
When using high resolution or specifying a bit width of 8 bits/pixel for a rotated
frame buffer, the graphics will be written to the frame buffer in 8 bits/pixel. When
there are 8 bits/pixel, the lower 8 bits are written to the frame buffer when using a
color lookup table or non-textured color. In either case, the lower 8 bits of the 16 bits
are written to the frame buffer. This will be abbreviated as 8 bits/pixel (high resolu-
tion or rotation 8).
H = Horizontal V = Vertical
• These are coordinate ranges and are not the sizes of the areas occupied in the
frame buffer. For more information about the size of the frame buffer, see “Frame
Buffer” in Section 2.1 Address Map.
• High-resolution display has a color resolution of 8 bits/pixel, which is half the
standard mode. Rotated display of the frame buffer is not possible in high-
resolution.
• Rotated display of the frame buffer is not possible with double interlace.
• A double interlaced display system uses graphic information from both buffers
to make one frame.
• A single interlaced display system switches frame buffers every two fields and
displays the same picture in both the odd and even display lines. In both cases,
there are no gaps between the scanning lines.
• The resolution in single interlace and non-interlace are the same, and the method
of writing to the frame buffer is the same.
• In 31KC and HDTV, the same color is displayed in 4-pixel units, 2 vertical pixels
and 2 horizontal pixels. That is, the resolution is the same as 320 x 240 (31KC)
and 352 x 240 (HDTV) in the standard mode, and the method of writing to the
frame buffer is the same.
• For information about how to set the interlace, refer to the VDP2 manual.
Notes
Field: The time it takes the scanning lines to scan one screen (1/60 second).
Frame: The time period during which one image is displayed. If interlaced,
two fields make one frame (1/30 second.)
14
Rotated Reading of Frame Buffer
• By reading the frame buffer diagonally, the entire frame buffer plane can be dis-
played rotated.
• Display coordinates that exceed the frame buffer address range are handled as
transparent (XX00H for 8-bit graphics and 0000H for 16-bit graphics).
• Even if rotated reading of the frame buffer is performed, the clipping area and
erase/write area remain fixed with respect to the frame buffer plane. Therefore,
the clipping area and erase/write area become inclined with respect to the display
screen.
• To prevent dropout of any of the display screen when the frame buffer is dis-
played rotated, the coordinate range of the frame buffer must be made large. In
this case the frame buffer is set to 8 bits/pixel and the screen to 512 × 512 rather
than 512 × 256. The number of colors that can be expressed at one time becomes
fewer than 256.
• Rotation is prohibited when normal, high resolution, HDTV, or double interlace is
set.
• The read start coordinates and read movement value for rotated reading from the
frame buffer are received from the VDP2.
• Rotated reading of the frame buffer is only valid in rotation 16 and rotation 8, and
is prohibited in all other cases. In the case of non-rotation, any rotation data re-
ceived from the VDP2 are invalid and the parameters of the VDP1 become valid.
16
Chapter 2
Address Map
Contents
Figure 2.1 shows the address map for the VRAM, frame buffer, and system registers
controlled by the VDP1.
*3
000000~07FFFFH VRAM *1
(4 Mbit)
0C0000~0FFFFFH Reserved
System
100000~17FFFFH registers
Access
180000~1FFFFH prohibited
Notes
*1 The following tables are stored in VRAM.
Command tables,
Character pattern tables
Color lookup tables
Gouraud shading tables
*2 The frame buffer comprises two screens at
080000~0BFFFFH. Only the drawing screen can
be accessed. The display screen cannot be accessed.
*3 Address is absolute. To find absolute address,
add 5C00000H.
18
VRAM
• The VRAM is a 4-Mbit DRAM.
• The command table, sprite character pattern table, color lookup table, and
Gouraud shading table are defined in VRAM. It doesn’t matter where in VRAM
the data of each are, or whether they are in a nested condition. They are refer-
enced by specifying the address of each.
• Fetching of the command must be performed from the top (000000H) of VRAM.
• Fetching of VRAM is repeated in the following order:
Command table
Gouraud shading table (only when Gouraud shading is used)
Color lookup table (only when lookup table method is used)
Character pattern table (only when drawing sprites)
• When fetching of the command table goes beyond the end address (07FFFFH) of
VRAM, fetching wraps to the top address (000000H) of VRAM.
• Byte access and word access are both possible from the CPU.
• Read-write access of the VRAM by the system controller IC, and parameter read
and pattern read access by the VDP1, are performed after assigning an order of
priority.
• The order of priority of access of the VRAM is always: system controller (system
controller IC) > drawing.
• Because access is performed after assigning an order of priority, there may be
more than 10 wait cycles according to that timing, depending on the operating
clock of the CPU. The operating clock of the CPU is 28 MHz.
• Perform access from the CPU when drawing is not being performed in order to
prevent interruption of drawing. To determine if drawing is being performed, poll
the system registers, or use an interrupt signal. Access of the VRAM and frame
buffer is performed in a short period of time using burst transfer.
20
Frame Buffer Plane
The coordinates of the frame buffer plane are as follows. Coordinates increase in
value toward the lower-right.
X -1024 ≤ X ≤ 1023
Y -1024 ≤ Y ≤ 1023
Operation cannot be guaranteed when specified values exceed these values.
As shown in Figure 2.2, parts can be positioned outside the display screen. However,
nothing is written for parts that exceed the range of the frame buffer plane.
• Bit configuration when data goes through color RAM (color RAM address)
Note: b15 = 0 when RGB data are mixed; b15 can be either when not mixed.
• Bit configuration when data do not go through color RAM (RGB data)
16-color mode b7 b6 b5 b4 b3 b2 b1 b0
(4 bits/pixel)
Color bank Character data
64-color mode b7 b6 b5 b4 b3 b2 b1 b0
(6 bits/pixel)
Color bank Character data
128-color mode b7 b6 b5 b4 b3 b2 b1 b0
(7 bits/pixel)
Color bank Character data
256-color mode b7 b6 b5 b4 b3 b2 b1 b0
(8 bits/pixel)
Character data
22
System Registers
• System registers are memory used for making system settings for the VDP1. They
are housed inside the VDP1 separately from the VRAM and frame buffer.
• There are read-only registers and write-only registers.
• The write-only registers are used to control display of the frame buffer. They
select the TV mode, specify change of display and the drawing trigger, and define
the fill data and area for erase/write. Drawing can also be forcibly terminated.
• Read-only registers are used as help information during program development.
They make it possible to know the address of the command table that underwent
draw processing last.
• Read/write access from the CPU must be performed in word units.
• Do not use DMA burst transfer when accessing the system registers.
• Except for the plot trigger register (PTMR), the values in the write-only registers
become undefined after powering on and after resetting, so be sure to set the
values from the CPU. Undefined data is displayed from the frame buffer until a
suitable value is set.
• Set the unused bits of write-only system registers to “0”.
The command table, color lookup table, Gouraud shading table, and character
pattern table are defined in VRAM. Table 2.2 shows the sizes and boundaries of the
tables.
The VRAM is 4 Mbit (512 Kbyte), and it is addressed in byte units from 000000H to
07FFFFH. Table data cannot be written beyond 07FFFFH. Each table must be kept
within the size of the VRAM.
24
Command Table
• The command table is a table in VRAM where commands are defined, and in
which the VDP1 reads commands, draws parts and processes clipping.
• The commands are as follows:
Draw commands
These are divided into texture drawing and non-texture drawing. Texture
drawing includes normal sprite, scaled sprite, and distorted sprite draw
commands. Non-texture drawing includes polygon, polyline, and line
draw commands. Draw commands draw these parts.
Clipping coordinate set commands
Includes user clipping and system clipping coordinate set commands, and
they set the draw area for parts.
Local coordinate set commands
Specifies the definition of the parts draw coordinate by the local coordinate.
Draw end command
Terminates drawing.
• The size of the command table is 1EH (30) bytes, and its boundary is 20H (32)
bytes.
• Each command is read to the VDP1 and is processed. This operation is referred to
as fetching.
• Fetching of the command table is performed from the top address (000000H) of
VRAM, and the next command table is fetched according to the specification of
the jump mode.
• According to the command table specification, the color lookup table, Gouraud
shading table, and character pattern table are referenced after the command table.
26
Chapter 3
Processing Flow
Contents
28
Table Access
The procedure VDP1 uses to access the table in VRAM and draw is as follows:
Step 1. Controls drawing and display according to the instructions set in the system
registers.
Step 2. Fetches the command table at the top address of VRAM.
Step 3. The fetched command table:
(1) Terminates drawing in the case of a draw end command (goes to step
9).
(2) Is ignored when jump mode is skipped; reading of the table is termi-
nated and the table is not processed (goes to step 8).
(3) In cases other than (1) and (2), goes to step (4).
Step 4. In the case of a clipping coordinate set command or a local coordinate set
command, each is processed (goes to step 8).
Step 5. In the case of a drawing command, the Gouraud shading table and color
lookup table are read if specified.
Step 6. In the case of a textured drawing, the character pattern table is read and is
written to the frame buffer according to the specification. At this time,
processing of the color mode, color calculation, inversion, enlargement and
reduction, and rotation are performed.
Step 7. In the case of a non-textured drawing, writing to the frame buffer is per-
formed according to the specification.
Step 8. The next command table is fetched according to the specification of the
jump mode and processing of the command table is repeated (goes to step
3).
Step 9. Drawing is repeated with the start of framing (goes to step 1).
Except for the draw end command, a jump mode to the next command table to be
processed can be specified in other commands. Those jump modes include the
following.
· Jump to a command table
· Skip to a command table
· Call a command table group (subroutine)
· Return (to main routine)
Figure 3.1 shows an example of the flow of a command using a jump mode.
VRAM/Command Table
000000 H Clipping coordinates
• Fetched from the top of VRAM
Local coordinates during frame switching.
Parts
Subroutine call
Parts • The specified table receives
a subroutine call.
Parts
Jump
: • Moves to specified table.
Parts
Parts
Return
: • Returns to main routine.
Parts
Parts
Skip/parts
• Skips (this part is not drawn).
Parts
Parts
Jump
Parts
Parts
Jump
:
Terminate drawing
: • Drawing is terminated.
30
3.3 Table Referencing
Referencing of the tables stored in VRAM begins with the following command table.
VRAM
:
:
:
:
Address of Gouraud shading table
:
:
:
32
Chapter 4
System Registers
Contents
34
System Register Settings Switch Timing
The timing with which the system register settings become valid is as follows.
• Changes following the termination of display of one line after the V-blank IN
interrupt.
Enables V-blank erase/write (VBE)
The TV mode selection register (TVMR, TV mode register) enables V-blank erase
and specifies the TV display mode. It is a 16-bit write-only register, and is at address
100000H. Its value becomes undefined after powering on or resetting; therefore the
TV display mode must be set. The unused bits must be set to “0.”
TVMR bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
100000H 0 0 0 0 0 0 0 0 0 0 0 0 VBE TVM
Write-only
36
• The function of each bit is as follows.
Bit 2: HDTV enable bit
0 = NTSC, PAL
1 = HDTV, 31KC
Bit 1: Frame buffer rotation enable bit
0 = non-rotation
1 = rotation
Bit 0: Bit depth selection bit
0 = 16 bits/pixel
1 = 8 bits/ pixel
The frame buffer change mode register (FBCR, frame buffer change register) controls
drawing and display change of the frame buffer, as well as double interlace drawing.
It is a 16-bit read-only register at address 100002H. Its value becomes undefined
after powering on or resetting, and therefore the change mode must be set. Unused
bits must be set to “0.”
FBCR bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
100002H 0 0 0 0 0 0 0 0 0 0 0 EOS DIE DIL FCM FCT
Write-only
38
1-Cycle Mode
• This is the normal mode.
• One frame changes automatically every 1/60 second.
• Set the value of the VBE and FCT bits to “0.”
40
Example
Table 4.3(a) shows the frame buffer change mode being used.
Table 4.3(a) Example of Use of Frame Buffer Change Mode (Fixed at VBE = 0)
Setting1 Frame Frame Frame buffer Change
FCM FCT buffer 0 2 buffer 1 2 change mode time
0 0 Draw Display and 1-cycle mode 60 frames/sec
erase/write
Display and Draw
erase/write
Draw Display and
Erase/write
Display and Draw
erase/write
1 1 Draw Display and Manual mode
erase/write (change)3
Display Draw 20 frames/sec
Notes:
1Value written to register immediately after the V-blank OUT interrupt.
2Changes from the first of the field.
3Changes from the 1-cycle mode to the manual mode with change.
4Be sure to continue to specify erase & change.
5Specify erase in the field immediately before changing to the 1-cycle mode.
42
Double Interlace Enable (DIE): bit 3
Double Interlace Draw Line (DIL): bit 2
• In single interlace, the same picture is displayed in the even fields and the odd
fields. In double interlace, however, the vertical resolution is doubled by display-
ing different pictures (each draws only even lines and odd lines, respectively) in
the even fields and the odd fields.
• Double interlace is enabled by DIE = 1.
• The contents of the first screen displayed after changing DIE cannot be guaran-
teed.
• In double interlace, the fields are changed every 1/60 second, and therefore
FCM = FCT = 0 (1-cycle mode) is set.
line 0 line 0
line 0 line 1
line 1 line 2
line 1 line 3
line 2 line 4
line 2 line 5
line 3 line 6
line 3 line 7
44
4.3 Plot Trigger Register
The plot trigger mode register (PTMR) controls the start of drawing. It is a 16-bit
write-only register at address 100004H. Its value is reset to 00B after powering on or
resetting. Set unused bits to “0”.
PTMR bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
100004H 0 0 0 0 0 0 0 0 0 0 0 0 0 0 PTM
Write-only
• When the plot trigger mode bits are rewritten from 01B to 00B, drawing becomes
valid from the next frame. However, when the plot trigger bits are rewritten from
00B or 10B to 01B, drawing becomes valid at that point and drawing is started
even if drawing is automatically started by 10B.
• When the table is not rewritten the same drawing is performed, and therefore the
results of color calculation of half-transparency change. Use the following proce-
dure to change only the draw start mode without drawing.
1) Change the plot trigger mode bits from 10B to 00B.
2) Change the plot trigger mode bits from 00B to 01B in the next frame.
Before rendering data into the frame buffer, the VDP1 erases the contents of the
frame buffer. This erasure is referred to as erase/write, and it specifies the fill area to
be erased and the fill data to be written to that area. The three registers related to
erase/write are the erase/write data register, the erase/write left coordinate register
and the erase/write right coordinate register.
46
Erase/Write Upper-Left Coordinate Register
The erase/write left register (EWLR) sets the upper-left coordinate of the erase/
write area. It is a 16-bit write-only register at address 100008H. Its value becomes
undefined after powering on or resetting, and therefore the coordinates must be set.
Set unused bits to “0.”
EWLR bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
100008H 0 Upper-left coordinate X1 Upper-left coordinate Y1
Write-only
• The coordinates for erase/write are not checked, and therefore the registers must
be set in the CPU in advance so that X1 < X3 and Y1 ≤ Y3.
• Set the erase/write range in each TV mode within their respective memory map
ranges.
48
• If the setting is X1 ≥ X3 or Y1 > Y3, then erase/write is performed for 1 dot in the
normal or high-resolution mode and for 8 dots in the case of rotation or HDTV. In
these cases, erase/write is performed under the assumption that the area (X1, Y1)
is set to (X3 = X1 + 1, Y3 = Y1).
• When VBE = 0 in the normal or high-resolution mode, erase/write is performed
beyond the frame buffer during the display period. When setting the X3 coordi-
nate beyond the display screen, after the end of the effective data (fall of HTIM),
erase/write is continued for 4 pixels in the normal mode and for 8 pixels in the
high-resolution mode, and erase/write is not performed beyond the display
screen other than in those areas.
• When the erase/write area is set within the display screen area, no erase/write is
performed outside the display area.
• Erase/write is not affected by clipping.
• Erase/write cannot be performed on the frame buffer during display when in the
HDTV mode, when the frame buffer is enlarged or reduced, or when display is
rotated. Because erase/write is performed in the vertical blanking period (V-
BLANK), there is not enough time to erase/write the entire screen. To perform
erase/write on the entire screen, the non-erased areas must be filled with poly-
gons at the start of drawing.
• The number of pixels required for V-blank erase is expressed by
(X3 – X1 + 1) x (Y3 – Y1 + 1) x 8
If this is within the number of pixels that can be used in V-blank erase, then erase/
write is completed.
• The number of pixels that can be used in V-blank erase is given by
{(number of pixels in 1 raster) – 200}
× {(number of rasters in 1 field) – (number of display rasters)}
The respective values are shown in Tables 4.4 and 4.5.
50
4.5 Draw Forced Termination Register
The transfer end status register (EDSR) indicates the end status of the prior frame
processing. It is a 16-bit read-only register at address 100010H. Set unused bits to
“0.”
EDSR bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
100010H 0 0 0 0 0 0 0 0 0 0 0 0 0 0 CEF BEF
Read-only
• The VDP1 successively fetches the following command tables in VRAM and
draws them in the frame buffer. When the draw end command (when end bit is 1)
is fetched, the drawing of one frame is terminated. CEF is set to “1” at this time.
• When data are transferred from the CPU to VRAM while in a draw end (CEF = 1)
status, VRAM can be accessed without the overhead for stopping drawing and
without causing the CPU to wait.
• When the draw end command is fetched, the VDP1 sets CEF to “1” and generates
an interrupt signal.
• There are two methods of judging termination of drawing: one confirms the fetch
status of the end bit with CEF (polling) and the other uses the interrupt signal.
• When there is no draw end command in VRAM, or when there is one and it is
defined by the jump mode such that it cannot be fetched, this bit remains “0.”
• This bit is reset to “0” when the frame buffers are changed or when drawing is
started.
• If fetch of the draw terminate command matches when the frame buffer changes,
CEF and BEF might not become “1.”
52
Before End Bit Fetch Status (BEF): bit 0
This register indicates whether or not the end bit (draw terminate command) has
been fetched from the command table in the previous frame. When it is “0,” it indi-
cates that the end bit has not been fetched; when “1,” it indicates that the end bit has
been fetched and that drawing is terminated.
BEF End bit fetch status
0 The end bit in previous frame has not been fetched.
1 The end bit in previous frame has been fetched and drawing is terminated.
• The VDP1 successively fetches the following command tables in VRAM and
draws them in the frame buffer. When the draw terminate command (when end
bit is 1) is fetched, the drawing of one frame is terminated. If there are many
commands, or if there are many pixels to be drawn because of enlargement, draw-
ing may not be terminated in one frame. This is referred to as “transfer-over.”
This bit indicates a transfer-over status.
• When transfer-over has occurred, it is necessary to reduce the drawing commands
or to reduce the pixels drawn.
• When there is no draw terminate command in VRAM, or when there is one and it
is defined by a jump mode such that it cannot be fetched, this bit remains at “0.”
• This bit is written with the value of the CEF value when the frame buffer is
changed or at the start of drawing, and is maintained until the next frame buffer
change.
The last operation command address register (LOPR) indicates the command table
address processed at the end of the previous frame. It is a 16-bit read-only register at
address 100012H.
LOPR bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
100012H Last operation command address/8H 0 0
Read-only
Parameters Parameters
Command
read
Address
Table
address
To current
operation
command
address
To last
operation
Latch command
address
Figure 4.3 Last Operation Command and Current Operation Command Address
54
4.8 Current Operation Command Address Register
The current operation command address register (COPR) indicates the address of
the command table being processed. It is a 16-bit read-only register at address
100014H.
COPR bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
100014H Current operation command address/8H 0 0
Read-only
56
4.9 Mode Status Register
The mode register (MODR) indicates the setting of the write-only register. It is a 16-
bit read-only register at address 100016H.
MODR bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
100016H VER — — — PTM1 EOS DIE DIL FCM VBE TVM
Read-only
Because the registers at addresses from 100000H to 10000CH are write-only, they
cannot be read to confirm the settings. The settings in write-only registers can be
confirmed by this register. It is mainly used as help information during program
development. However, because these values are the actual system register settings,
they may be different from the values taken in as internal signals.
58
Chapter 5
Tables
Contents
Table Size
Depending on the color mode, 1 pixel of the character pattern becomes 4-, 8- or 16-
bit data. The character size can be specified from 8 pixels to 504 pixels horizontally
in 8-pixel units and from 1 pixel to 255 pixels vertically in 1-pixel units.
For example, in order to represent a character pattern 8 horizontal pixels by 3 verti-
cal pixels, 0CH (12) bytes is required for 4 bits/pixel, 18H (24) bytes is required for 8
bits/pixel; and 30H (48) bytes is required for 16 bits/pixel. The table of a character
pattern requires 4H bytes when the character pattern is 8 horizontal pixels by 1
vertical pixel and 4 bits/pixel, and the maximum data of a character pattern is
3EC10H (257,040) bytes when the character pattern is 504 horizontal pixels by 255
vertical pixels and 16 bits/pixel.
60
Examples of Character Pattern Tables
The examples of character patterns in Figure 5.1 are shown with a character size of 8
horizontal pixels by 3 vertical pixels:
pixel 0 1 2 3 4 5 6 7
+00H + 0 + 1 + 2 + 3 Value is relative address from
+04H + 4 + 5 + 6 + 7 character pattern address
+08H + 8 + 9 + A + B
pixel 0 1 2 3 4 5 6 7
+00H +0 +1 +2 +3 +4 +5 +6 +7
+08H +8 +9 +A +B +C +D +E +F
+10H +10 +11 +12 +13 +14 +15 +16 +17
pixel 0 1 2 3 4 5 6 7
+00H +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +A +B +C +D +E +F
+10H +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +1A +1B +1C +1D +1E +1F
+20H +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +2A +2B +2C +2D +2E +2F
The color lookup table is used to specify the color of the pixels of the character
pattern in the lookup table mode. The color lookup table defines the respective color
codes of 16 colors in VRAM as 16-bit data. In the lookup table mode, character
patterns are defined in the character pattern table in 4 bits/pixel, and 1 color of the
16 colors defined as 4-bit data in the color lookup table is selected. The 16 bits of the
color code of the selected color are written to the frame buffer, as is as the color code
of the pixel.
The size of the color lookup table is 20H (32) bytes. The table should be written from
the boundary addresses of 20H-byte units in VRAM. However, 00000H cannot be
defined. VRAM occupies up to address 7FFFFH. Do not define color lookup tables
beyond address 80000H.
The data written to the color lookup table can be either color bank code or RGB
code. If RGB code, MSB = 0. If color bank code, MSB = 0 if RGB code is mixed, and
MSB can be either 0 or 1 if RGB is not mixed. Set MSB to match data processing by
the VDP2.
62
Character Patterns
In the lookup table mode a character pattern is 4 bits/pixel and is stored in VRAM.
Command Tables
The address of the color lookup table referenced by the sprite is specified in the color
lookup table address (top address + 06H) of the command table. The specified value
is address/8H. Since the color lookup table is stored in boundaries of 20H-byte
units, the lower two bits become 00B.
The relationship between the command table, color lookup table and character
pattern table is shown below.
Command Table
Frame buffer
Address
Address
16-bit
data
MSB LSB
X B G R
4 3 2 1 0 4 3 2 1 0 4 3 2 1 0
Note: The MSB 1 bit is ignored.
Gouraud Shading
Gouraud shading can be performed on parts drawn in RGB code. Gouraud shading
specifies the amount of change in the luminance of each of R, G, and B, which are
changed in RGB code parts in a Gouraud shading table. It is only effective on RGB
color codes. The color cannot be guaranteed when Gouraud shading is specified for
color bank color codes.
64
Gouraud Shading Processing
This specifies the data for the amount of change in R, G, and B for the four points
(two points in the case of lines) of the part in the Gouraud shading table. The data
interpolated for each of R, G, and B between the four points are added to the original
color of the part. Because each of the values of R, G, and B takes the values 00H to
1FH, the result of subtracting 10H from the complementary RGB data is added to the
original color of the part. For example, if the value of RGB is 10H, the original color
is left as is; if the value is 00H, the original color becomes –10H; and if the value is
1FH, then the original color becomes +0FH. If the value after color calculation be-
comes less than 00H, then 00H is used; if it is larger than 1FH, then 1FH is used.
The relationship between Gouraud shading table settings and correction values is
shown as follows.
Table 5.3 Relationship between Gouraud Shading Table Settings and Correction Values
Table setting Correction for original Table setting Correction for original
data data
00H –10H 10H 0
01H –0FH 11H +01H
02H –0EH 12H +02H
03H –0DH 13H +03H
04H –0CH 14H +04H
05H –0BH 15H +05H
06H –0AH 16H +06H
07H –09H 17H +07H
08H –08H 18H +08H
09H –07H 19H +09H
0AH –06H 1AH +0AH
0BH –05H 1BH +0BH
0CH –04H 1CH +0CH
0DH –03H 1DH +0DH
0EH –02H 1EH +0EH
0FH –01H 1FH +0FH
Real Gouraud shading changes only the luminance, but in this system it changes
each of R, G, and B, and therefore in some cases the hue also changes. To avoid
changing the hue, define the same value for each RGB for one point defined in the
Gouraud shading table. By this means, white Gouraud shading is applied.
Gouraud shading is performed on non-textured colors in the case of lines, polylines,
and polygons and on colors referenced by the character pattern data or the color
lookup table in the case of sprites.
bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
CMDCTRL END JP ZP 0 0 Dir Comm
+00H
CMDLINK LINK specification/8H 0 0
+02H
CMDPMOD MON 0 0 HSS Pclp Clip Cmod Mesh ECD SPD Color mode Color calculation bit
+04H
CMDCOLR Color bank, color lookup table/8H (LSB is set to 00), non-textured color
+06H
CMDSRCA Character address/8H 0 0
+08H
CMDSIZE 0 0 Character size X/8 Character size Y
+0AH
CMDXA
+0CH
Code extension Point (A) X coordinate (XA) *
CMDYA Code extension Point (A) Y coordinate (YA)
+0EH
CMDXB Code extension Point (B) X coordinate (XB)
+10H
CMDYB Code extension Point (B) Y coordinate (YB)
+12H
CMDXC Code extension Point (C) X coordinate (XC)
+14H
CMDYC Code extension Point (C) Y coordinate (YC)
+16H
CMDXD Code extension Point (D) X coordinate (XD)
+18H
CMDYD Code extension Point (D) Y coordinate (YD)
+1AH
CMDGRDA Gouraud Shading Table/8H
+1CH
+1EH (Dummy) Skipped during table fetch
+20H Succeeding table
:
+60H :
:
* Note: The top bit of the vertex coordinate is a sign bit. A negative value is indicated by a
complement of 2. Extend the sign for the upper 6 bits.
66
The order in which sprites and other parts are drawn is determined by how they are
placed in the VRAM of this command table.
Drawn parts processed first are the farthest from the view point, and parts processed
last are the closest to the view point.
68
Chapter 6
Command Tables
Contents
Note: Refer to “5.4 Command Tables” for more information on command tables.
CMDCTRL specifies commands and also controls command tables and specifies the
inversion and zoom point of sprites. CMDCTRL is 16 bits at the top address + 00H
of the command table, and its bit configuration is as follows. Set unused bits to “0.”
bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
CMDCTRL
+00H END JP ZP 0 0 Dir Comm
70
Commands
Commands are determined by the end bit (END, bit 15) of CMDCTRL and the
command selection bit (Comm, bits 3~0). The commands set by the end bit and the
command selection bit are shown in Table 6.1. The content of the command table in
VRAM is determined by the command.
Jump Mode (JP): top address + 00H of command table, bits 14~12
Specifies the jump mode for jumping to the next command table to be processed.
When the jump mode is skipped (bit 14 = 1), reading of the command table is termi-
nated there and the table is not processed. There is 1 level of nesting by a jump call.
Do not use jump calls in subroutines.
JP
Bit 14 13 12 Jump mode Processing
0 0 0 Jump next Automatically jumps to next table (address +20 H) a fter this
table is processed (CMDLINK is ignored).
0 0 1 Jump assign Jumps to CMDLINK table after this table is processed.
0 1 0 Jump call CMDLINK table receives subroutine call after this table is
processed.
0 1 1 Jump return Returns to main routine after this table is processed
(CMDLINK is ignored).
1 0 0 Skip next Jumps to next table (address +20H ) a fter this table is
processed (CMDLINK is ignored).
1 0 1 Skip assign Jumps to CMDLINK table without processing this table.
1 1 0 Skip call CMDLINK table receives subroutine call without processing
this table.
1 1 1 Skip return Returns to main routine without processing this table
(CMDLINK is ignored).
When jump assign, jump call, skip assign, or skip call is specified, the address of the
table to be processed next is specified by CMDLINK.
When jump next, jump return, skip next, or skip return is specified, CMDLINK is
ignored.
72
Zoom Point
Zoom point specifies the zoom point of the character when a scaled sprite is drawn
enlarged or reduced. It functions only with scaled sprites.
Zoom Point (ZP): top address + 00H of command table, bits 11~8
Zoom point specifies the fixed point of the character when a scaled sprite is drawn
enlarged or reduced. The relationship between the value of the zoom point and the
fixed point is as follows. When the zoom point (ZP) is “0,” there is no zoom point,
and drawing is performed by specifying the upper-left coordinates and the lower-
right coordinates.
Fix the zoom point to 0H for sprites other than scaled sprites.
ZP
Bit 11 10 9 8 Code Zoom point
0 0 0 0 0H Specifies two coordinates
0 1 0 1 5H Upper-left
0 1 1 0 6H Upper-center
0 1 1 1 7H Upper-right
1 0 0 1 9H Center-left
1 0 1 0 AH Center-center
1 0 1 1 BH Center-right
1 1 0 1 DH Lower-left
1 1 1 0 EH Lower-center
1 1 1 1 FH Lower-right
Other than above Setting prohibited (do not set)
+1 +2 +3
+4
The result of adding the vertical
and horizontal values is the value
of the zoom point.
+8
+C
Center line
+10H :
+12H :
CMDXC
+14H Code extension Vertex (C), X coordinate (XC)
CMDYC
+16H Code extension Vertex (C), Y coordinate (YC)
74
Drawing Area
The zoom point coordinates are specified by CMDXA and CMDYA. The zoom point
specified by the Zoom Point (ZP) is drawn at the zoom point coordinates. The zoom
point becomes the reference point when zooming the character.
The display width is specified by CMDXB and CMDYB. The display width becomes
the size drawn.
The area in which the character is drawn is determined by the zoom point bit, zoom
point coordinates, and the display width. When the zoom point coordinate is (XA,
YA) and the display width is (XB, YB), the drawing area is as shown in Figure 6.2.
76
Character Read Direction
The read direction of the character can be specified. This specification makes it
possible to invert the character vertically and horizontally.
Character Read Direction (Dir) Bits: Command table start address + 00H, bits 5, 4
These bits specify the read direction of the character pattern. Vertical inversion,
horizontal inversion, or simultaneous vertical and horizontal inversion can be speci-
fied.
When bit 5 is “0,” the vertical (Y) direction is drawn as is, without inversion. When
bit 5 is “1,” the character pattern is inverted vertically.
When bit 4 is “0,” the horizontal (X) axis is drawn as is, without inversion. When bit
4 is “1”, then the character pattern is inverted horizontally.
When bits 4 and 5 are both “0”, then the character pattern is drawn as is with no
inversion. When bits 4 and 5 are both “1”, then the character pattern is inverted both
vertically and horizontally. Fix the character read direction to 00B for characters
other than sprites.
Dir
Y X Inversion processing
0 0 Not inverted
0 1 Inverted horizontally
1 0 Inverted vertically
1 1 Inverted vertically and horizontally
A B Draw
A B
Original graphic Dir = 00B Dir = 01B
Not inverted Inverted horizontally
CMDLINK specifies the address of the command table to be processed next when
assign or call is specified in the jump mode. The specification is made with the 16
bits at the top address + 02H of the command table.
bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
CMDLINK 0 0
+02H Link specification/8H
78
6.3 CMDPMOD (Draw Mode Word)
CMDPMOD enables or disables clipping, specifies mesh processing and the trans-
parent code, specifies the color mode, and controls color calculation and shade
processing. It occupies the 2 bytes from the top address + 04H of the command table,
and its bit configuration is as follows. Set unused bits to “0.”
bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
CMDPMOD
+04H MON 0 0 HSS Pclp Clip Cmod Mesh ECD SPD Color mode Color calculation bits
80
High Speed Shrink
HSS Processing
0 High speed shrink disabled
1 High speed shrink enabled
82
Pre-Clipping Disable
Pclp Processing
0 Pre-clipping with horizontal inversion
1 No pre-clipping and no horizontal inversion
Cmod = 0 Cmod = 1
(inside drawing mode) (outside drawing mode)
Frame buffer Frame buffer
Upper-right
coordinate of
user clipping
Drawing area
Lower-right coordinate
of user clipping
Do not set this bit to “1” when user clipping is disabled (Clip = 0). Combinations of
the user clipping enable bit and the clipping mode bit have the following results.
Clip Cmod User clipping processing
0 0 User clipping disabled
0 1 Setting prohibited (do not set)
1 0 Inside drawing mode
1 1 Outside drawing mode
84
Mesh Enable
Mesh Enable Bit: bit 8
This bit specifies whether or not mesh processing is performed when the command
is a draw command for a part. When it is “0,” the part is drawn without mesh pro-
cessing. When it is “1,” the part is drawn with mesh processing.
Mesh Mesh enable
0 Draw without mesh processing
1 Draw with mesh processing
When mesh processing is specified (Mesh = 1), every other pixel of the part is drawn
to form a mesh. Only pixels for which (X coordinate value + Y coordinate value) is
even (XLSB XOR YLSB = 0) are drawn, and odd pixels are skipped and not drawn.
When the starting point of a 45° diagonal line is an odd coordinate, nothing is
drawn. Nothing is drawn in some cases when the point of a 45° polyline is an odd
coordinate.
0 1 2 3 4 5 6 7 8 9 AB C DE F
0
1 : not drawn
2
3 : drawn
4
5
6
7
8
9
A
B
C
D
E
F
0 1 2 34 5 67 8 9 ABC DEF
0
1 : not drawn
2
3 : drawn
4
5
6
7 This line is not drawn
8
9
A This polyline is not drawn
B
C
D
E
F
The relationship between the color mode and the end code is as follows. The number
of bits of the end code differs depending on the color mode.
Color mode End code
0 16 colors (color bank mode) FH ( 4 bits)
1 16 colors (lookup table mode) FH ( 4 bits)
2 64 colors (color bank mode) FFH ( 8 bits)
3 128 colors (color bank mode) FFH ( 8 bits)
4 256 colors (color bank mode) FFH ( 8 bits)
5 32,768 colors (RGB mode) 7FFFH (16 bits)
86
An example of end code processing is shown below.
Since drawing is not allowed toward the outside from the end code when read from
the left or right, place only a transparent pixel there. Therefore, when ECD = 0, SPD
must equal 0. Do not use the combination ECD = 0 and SPD=1.
The drawing direction may be inverted by pre-clipping. When using end codes in
the original picture, do so as shown below.
:Other pixels
The relationship between the color mode and the transparent color code is as fol-
lows. The number of bits of the transparent color code differs depending on the
color mode.
Color mode Transparent color code
0 16 colors (color bank mode) 0H ( 4 bits)
1 16 colors (lookup table mode) 0H ( 4 bits)
2 64 colors (color bank mode) 00H ( 8 bits)
3 128 colors (color bank mode) 00H ( 8 bits)
4 256 colors (color bank mode) 00H ( 8 bits)
5 32,768 colors (RGB mode) 0000H (16 bits)
88
Color Mode
Color Mode Bits: bits 5~3
These bits specify the method by which the number of colors to be drawn is ex-
pressed. It is only valid for sprites. Set the color mode to 000B for non-textures. The
possible color modes include the color bank mode, which specifies the color with a
palette code and a color bank; the lookup table mode, which uses a color lookup
table; and the RGB mode, which specifies the luminance directly. In the color bank
mode, the color can be selected from among 16, 64, 128, or 256 colors, depending on
the number of bits of the pixel data. In the lookup table mode, the color can be
selected from among 16 colors. And in the RGB mode, 32,768 colors can be drawn.
The color mode bits are described in the following table.
Color mode Description Bits per
Mode Number of Mode pixel
Bit 5 4 3 colors
0 0 0 0 16 Color bank mode 4 bits
0 0 1 1 16 Lookup table mode 4 bits
0 1 0 2 64 Color bank mode 8 bits
0 1 1 3 128 Color bank mode 8 bits
1 0 0 4 256 Color bank mode 8 bits
1 0 1 5 32,768 RGB mode 16 bits
Other than above Setting prohibited (do not set)
Mode 0
This is the 16-color color bank mode. Color is expressed using palette codes and a
color bank. One pixel is represented by 4 bits. 16 colors can be drawn. 4 bytes are
necessary to express 8 pixels. The data for 2 pixels are contained in 1 byte, and when
there is no horizontal inversion, the upper 4 bits represent the left pixel and the
lower 4 bits represent the right pixel.
The palette code is represented by 4 bits, and the upper 12 bits are the color bank
added from the color bank word (top address + 06H of command table), resulting in
16-bit data being written to the frame buffer. When there are 8 bits/pixel (frame
buffer rotation or high resolution), the lower 8 bits of the 16 bits are written to the
frame buffer. The upper 8 bits are ignored. Because the draw pixel data is color bank
code, color calculation cannot be performed.
bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
+00H Pixel 0 1 2 3
+02H 4 5 6 7
Mode 1
This mode is the lookup table mode which uses a color lookup table. One pixel is
represented by 4 bits. 16 colors can be drawn. The character data is the same as in
mode 0. The data for 1 color of the 16-bit 16 colors stored in the color lookup table is
selected with 4 bits and written to the frame buffer. When there are 8 bits/pixel
(frame buffer rotation or high resolution), the lower 8 bits of the 16 bits are written to
the frame buffer.
The address of the color lookup table is written to the lookup table address (top
address + 06H of command table; also used as color bank word). Either color bank
code or RGB code can be specified as the color code of the lookup table. However,
RGB code is prohibited when there are 8 bits per pixel.
+00H → 0 1 2 3 4 5 6 7 ← +02H
+04H → 8 9 A B C D E F ← +06H
90
Mode 2, Mode 3, Mode 4
Mode 2, mode 3, and mode 4 are respectively 64-color, 128-color, and 256-color
palette bank modes. Colors are represented by palette code and a color bank.
One pixel is represented by 8 bits. In the respective modes, 64 colors, 128 colors, and
256 colors can be drawn. 8 bytes are required to represent 8 pixels.
The palette code is represented by bits 6, 7, and 8, and upper bits 10, 9, and 8 are the
color bank added from the color bank word (top address + 06H of command table),
resulting in 16-bit data being written to the frame buffer. In mode 2 and mode 3, the
respective upper 2 bits and upper 1 bit are ignored. When there are 8 bits/pixel
(frame buffer rotation or high resolution), the lower 8 bits of the 16 bits are written to
the frame buffer. Because the draw pixel data is color bank code, color calculation
cannot be performed.
bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
+00H Pixel 0 1
+02H 2 3
+04H 4 5
+06H 6 7
Mode 5
This is the 32,768-color RGB mode. The color is expressed by the respective lumi-
nances of red, green, and blue (RGB). One pixel is represented by 16 bits. It is pos-
sible to draw 32,768 colors. 16 bytes are required to express 8 pixels.
The RGB code is represented by a MSB (value 1), which indicates that the code is
RGB code, and the respective luminances of R, G, and B are represented by 5 bits
each. The respective luminances of R, G and B are represented by the values 00H to
1FH. The closer the value is to 00H, the darker the color; the closer it is to 1FH, the
brighter the color. When all of R, G, and B are 00H, the value is 8000H, which repre-
sents black; when all are 1FH, the value is FFFFH, which represents white.
RGB codes are written in their original 16-bit form to the frame buffer. When there
are 8 bits/pixel (frame buffer rotation or high resolution), this mode cannot be used.
Color calculation can be performed on RGB code.
MSB LSB
1 B G R
4 3 2 1 0 4 3 2 1 0 4 3 2 1 0
Note: The MSB is 1.
92
Color Calculation
Color Calculation Bits: bits 2~0
These bits specify Gouraud shading, shadow, half-luminance, and half-transparency.
The functions of each of the bits are as follows.
Bit Function
2 Gouraud shading enable bit
1 1/2 original graphic enable bit
0 1/2 background enable bit
94
Shadow halves the luminance of pixels in the frame buffer. To make the luminance
one fourth, set the same command table in VRAM twice. To make it one eighth, set
the same command table in VRAM three times.
In shadow, calculation is performed on the pixel data read from the coordinates to
which the pixel data of the original graphic is written. Drawing in this case slows
down, so use caution—It takes six times longer than when color calculation is not
performed.
Replace Shadow
Gouraud+Half- Gouraud
Luminance Gouraud+Half-
Transparent
96
MSB ON
MSB ON Bit (MON): bit 15
MON Processing
0 MSB of pixel data in frame buffer is not changed
1 Sets MSB of pixel data in frame buffer to 1
When a mode is set in which the VDP2 uses shadow (drops luminance of pixel data
in scroll screen) or window (displays a different screen in the specified area),
shadow and window processing are performed when the most significant bit (MSB)
is “1.”
Set the MSB to “1” (ON) for the pixels already written to the frame buffer. The color
code is valid only when the frame buffer is color bank code (this is because the MSB
is used for shadow enable and window enable in the VDP2, eliminating an RGB
recognition bit), thus making it impossible to perform color calculation. Specify
replace for color calculation.
In the case of textured parts, this can be used only when the original graphic data
has or does not have pixels (no pixels for transparent and end codes and pixels for
everything else), and therefore RGB code or color bank code can be used as the color
code. In the case of non-textured parts, the non-textured color is not reflected in the
drawing.
Do not specify color calculation (specify replace instead) when the MSB is set to “1.”
When the MSB is set to “1,” color calculation has no meaning and processing takes a
long time, so use caution.
For parts that undergo mesh processing, the MSB is set to ON in the mesh condition.
An example of MSB ON is shown below.
CMDCOLR specifies the color of the part. The function differs depending on the
part and the color mode. It specifies the color bank, the color lookup table address,
or non-textured colors. CMDCOLR is at the top address + 06H of the command table
and is 16 bits.
bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
CMDCOLR
+06H Color bank, color lookup table/8H (LSB fixed at 00), non-textured colors
98
Color Bank
• Color banks are bits added to the upper bit when the pixel data of the character
pattern are written to the frame buffer when the color mode of a textured part is
the color bank mode.
• Color bank is specified using 16 bits, but the lower 4 bits must be fixed at “0.”
Depending on the color mode, 12, 10, 9 or 8 bits are added. Figure 6.17 shows the
addition of bits.
• When there are 16 bits/pixel, the data is written to the frame buffer as is. When
there are 8 bits/pixel, the lower 8 bits are written.
When 16 bits/pixel
When 8 bits/pixel Written
Writtentotoframe
framebuffer.
buffer
RGB mode: Data of defined character patterns is written to frame buffer.
Lookup table mode: Data of lookup table referenced from defined character
patterns is written to frame buffer.
Table 6.4 Example of Relationship of Defined Data and Draw Data to Color Bank
100
Color Lookup Table
• Defines the address of the color lookup table.
• When the color mode is the lookup table mode, the 4-bit data of the character
pattern of textured parts is converted to 16-bit pixel data by referencing the color
lookup table, and is written to the frame buffer.
• The color lookup table defines 16-bit color codes for 16 colors. The 16-bit data in
the table is written as is to the frame buffer, and therefore there is no distinction
between palette bank code and RGB code in the character pattern of textured
parts. When read to the VDP2, the code is handled as color bank code when the
MSB of the 16 bits is “0,” and as RGB code when it is “1.”
• The color lookup table address defines the address/8H of the color lookup table.
Because the color lookup table is defined with 20H-byte boundaries, the two
LSBs of the lookup table address are fixed at “00.”
: : :
The 16-bit data of the color lookup table selected with the 4 bits of the character pattern is written as
is to the frame buffer as pixel data.
102
6.5 CMDSRCA (Character Address)
• Specifies an address that defines the character pattern drawn by the texture draw
command.
• This is an address in VRAM of the character pattern to be drawn, and the value
resulting from dividing the address by 8H is specified with 16 bits.
• The character address specifies the top address at which the pixel data of the
defined character pattern is stored. The pixel data of the upper-left point of the
character pattern is at the top address. Even if the character is rotated or inverted
horizontally or vertically, the address of the upper-left point of the defined char-
acter pattern is specified.
• The content of the pixel data of the character pattern is 4, 8, or 16 bits/pixel,
depending on the color mode.
• The size of the table is specified by CMDSIZE (Character size).
• Because the character pattern table is defined with 20H-byte boundaries, the two
LSBs are fixed at “00B.”
CMDSIZE specifies the size of the defined character pattern. CMDSIZE is valid for
texture draw commands. It is specified with 16 bits at the top address + 0AH of the
command table. Set unused bits to “0.”
bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
CMDSIZE
+0AH 0 0 Character size X/8 Character size Y
• Table 6.5 shows the relationships between the values defined in the command
table and the number of drawn pixels.
104
6.7 CMDXA~CMDYD (Vertex Coordinate Data)
The coordinates of clipping areas, the point coordinates for drawing sprites and
other coordinates are specified by CMDXA~CMDYD. The coordinates for a maxi-
mum of four vertex (X coordinates, Y coordinates) can be specified. They are defined
in the 16 bytes (8 words) from the top address + 0CH to 1AH of the command table.
bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
CMDXA
+0CH Code extension Vertex (A), X coordinates (XA)
CMDYA
+0EH Code extension Vertex (A), Y coordinates (YA)
CMDXB
+10H Code extension Vertex (B), X coordinates (XA); or display, X width (XB)
CMDYB
+12H Code extension Vertex (B), Y coordinates (YA); or display, Y width (YB)
CMDXC
+14H Code extension Vertex (C), X coordinates (XC)
CMDYC
+16H Code extension Vertex (C), Y coordinates (YC)
CMDXD
+18H Code extension Vertex (D), X coordinates (XD)
CMDYD
+1AH Code extension Vertex (D), Y coordinates (YD)
Note: The top bit of the vertex coordinates is a sign bit. A negative value is indicated by
a complement of two. Extend the code with the upper 6 bits.
Polyline draw command Vertex (A) Vertex (B) Vertex (C) Vertex (D)
3. The address of the Gouraud shading table is divided by 8H and is specified with
16 bits.
4. The Gouraud shading table is a table for Gouraud shading processing, and it
defines the amount of change in the luminances of R, G, and B at four vertices
(two points for lines). The size of the table is 8H bytes (4 words), and the table is
defined with 8H-byte boundaries.
106
Chapter 7
Commands
Contents
108
Commands are determined by the end bit and the command selection bits. Table 7.1
lists the commands.
Clipping is the removal of graphics outside the set display area so that they are not
drawn. Clipping includes system clipping, which sets the drawing area for the
system, and user clipping, which makes it possible to freely set the clipping area
using software.
When the command select bits (bits 3 to 0) are 1001B, the system clipping coordinate
set command is set; when they are 1000B, the user clipping coordinate set command
is set. The contents of the system clipping coordinate set command table are shown
in the following figure.
bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
CMDCTRL
+00H 0 JP 0 0 0 0 0 0 0 0 1 0 0 1
(0,0)
CMDLINK Link specification/8H 0 0
+02H
+04H TV
+06H
+08H Lower-right
+0AH Coordinate
+0CH
+0EH
+10H System clipping area
+12H
CMDXC
+14H 0 0 0 0 0 0 Lower-right X coordinate (XC) Upper-left coordinates are fixed at (0,0).
CMDYC
+16H 0 0 0 0 0 0 0 Lower-right Y coordinate (YC)
+18H
+1AH
+1CH
Note: is ignored.
110
System Clipping
System clipping coordinates are always valid when drawing, so that outside the set
area is clipped; that is, the area inside the coordinates is drawn. Clipping processing
is performed in a rectangle. The coordinates are specified by defining the values of
the lower-right coordinates (XC, YC) in the command table, since the upper-left
coordinates are fixed at (0,0).
Because the clipping coordinates are not checked, they should be set in advance so
that XC ≥ 0 and YC ≥ 0. Operation cannot be ensured if XC < 0 or YC < 0. Points on
the clipping line are treated as being inside the clipping area and are drawn. The
clipping coordinate set command rewrites the internal clipping coordinate register.
Parts subsequent to rewriting are drawn by referencing those values.
Because this command can be defined in any number in one frame, it is possible to
give part groups different clipping coordinates. The system clipping coordinates
become undefined after powering on or after resetting, and therefore they must be
set before drawing starts.
(lower-right
coordinate (C))
TV
TV
User clipping coordinates can be freely set using software. When the command
selection bits are 1000B, the user clipping coordinate set command is enabled. The
contents of the user clipping coordinate set command table are shown in the follow-
ing figure.
bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
CMDCTRL 0 JP 0 0 0 0 0 0 0 0 10 0 0
+00H
Upper-left
CMDLINK +02H Link specification/8H 0 0 coordinate
TV
+04H
+06H
Lower-right
+08H coordinate System
+0AH clipping area
0 0 0 0 0 0 Upper-left X coordinate (XA)
CMDXA +0CH
0 0 0 0 0 0 0 Upper-left Y coordinate (YA) User clipping area
CMDYA +0EH
+10H
+12H
0 0 0 0 0 0 Lower-right X coordinate (XC)
CMDXC +14H
CMDYC +16H 0 0 0 0 0 0 0
Lower-right Y coordinate (YC)
+18H
+1AH
+1CH
Note: is ignored.
112
User Clipping
User clipping can be selected using software, and it is possible to specify whether or
not user clipping is enabled for each part and whether the outside of the set area or
the inside of the set area is clipped.
User clipping coordinates can be enabled or disabled using the user clipping enable
bit (Clip bit, bit 10 at top address + 04H of command table). When this bit is dis-
abled, the user clipping coordinates become disabled, and parts are only clipped by
the system clipping coordinates. When the user clipping coordinates are enabled,
parts are clipped by both the system clipping coordinates and the user clipping
coordinates.
When user clipping is enabled, user clipping can be set to the inside drawing mode
or the outside drawing mode with the clipping mode bit (Cmod bit, bit 9 at top
address + 04H of command table). When set to the inside drawing mode, only those
parts inside the area set by the user clipping coordinates are drawn; when set to the
outside drawing mode, the area outside the coordinates is drawn. System clipping
is performed regardless of user clipping.
The clipping coordinates form a rectangle. The coordinates are the upper-left coordi-
nates (XA, YA) and the lower-right coordinates (XC, YC), and they are specified by
defining the values of the coordinates of these two points in the command table.
Because the clipping coordinates are not checked, they must be set in advance so
that XA ≤ XC and YA ≤ YC. Operation cannot be guaranteed if XC < XA or YC < YA.
Set the user clipping coordinates inside the set area (including on-line) of the system
clipping coordinates. Operation cannot be guaranteed when the user clipping coor-
dinates are set beyond the set area of the system clipping coordinates.
Points on the clipping line are treated as being inside the clipping area. They are
drawn in the inside drawing mode and not drawn in the outside drawing mode.
Two or more user clipping commands can be set in the same frame. The clipping
coordinate set commands rewrite the internal clipping coordinate registers. Parts
subsequent to rewriting are drawn by referring to these values.
Because the user clipping coordinates become undefined after powering on or after
resetting, they must be set before drawing starts.
114
(a) User clipping disabled
(upper-left coordinate (A)) User clipping area
Since user clipping is
disabled, the inside of the
(lower-right coordinate (C)) system clipping area is
drawn.
The local coordinate set command makes the coordinates specified by the draw
command local coordinates, and then makes them drawing coordinates by adding
the value specified by the local coordinate command.
When the command selection bits are 1010B, the local coordinate set command is
enabled. The contents of the command table are as shown in the following figure.
bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
CMDCTRL
+00H 0 JP 0 0 0 0 0 0 0 0 1 0 1 0
CMDLINK +02H Link specification/8H 0 0 (0,0)
+04H
TV
+06H Local Coordinates (A)
+08H
+0AH
CMDXA Code extension Local X coordinate (XA)
+0CH
CMDYA Code extension Local Y coordinate (YA)
+0EH
System clipping area
+10H
+12H
+14H
+16H
+18H
+1AH
+1CH
Note: is ignored.
116
Local Coordinates
Local coordinates are set in the local coordinate register. The values of the local
coordinates are added to the coordinates specified by the draw command, and they
become the drawing coordinates. Parts are drawn in the frame buffer using the
drawing coordinates as a reference.
When the local coordinates are (0,0), the part is drawn at the coordinates specified by
the draw command using the upper-left corner of the screen as (0,0). When (0,0) is
set approximately in the center of the screen, (160,112) are specified as the local
coordinates.
Because the local coordinates are retained in the register until they are set again, in
order to move the coordinates of several parts and draw them together, the local
coordinates are set before their respective draw commands.
Coordinate comparison in clipping is processed using the value resulting from
adding these local coordinates to the coordinates specified by drawing of the part.
Furthermore, because the local coordinates are not added to the clipping coordi-
nates, the clipping area does not move. Because the values in the local coordinate
register become undefined after powering on or after resetting, they must be set
before drawing starts.
The normal sprite draw command draws character patterns in the frame buffer.
When drawing, the character pattern can be inverted vertically or horizontally at the
specified coordinates and drawn.
When the end bit is 0B and the command selection bits are 0000B, the normal sprite
draw command is enabled. Normal sprites cannot be rotated 90°. To rotate 90°,
specify the distorted sprite draw command. The contents of the command table are
shown in the following figure.
bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
0 JP 0 0 0 0 0 0 Dir 0 0 0 0 Normal sprite
CMDCTRL +00H
Link specification/8H
CMDLINK +02H Color
Vertex (A) Vertex (B)
MO 0 0 0 Pc CI Cm Me EC SP Color mode
CMDPMOD calculation
+04H
CMDCOLR Color bank, lookup table/8H (LSB fixed at 00)
+06H
CMDSRCA Character address/8H 0 0
+08H
CMDSIZE 0 0 Character size X/8 Character size Y Vertex (D) Vertex (C)
+0AH
CMDXA Code extension Vertex (A), X coordinate (XA)
+0CH
CMDYA Code extension Vertex (A), Y coordinate (YA)
+0EH
+10H Frame buffer
+12H
+14H
+16H
+18H
+1AH
CMDGRDA Gouraud shading table/8H
+1CH
Note: is ignored.
MO = MON, HS = HSS, Pc = Pclp, Cl = Clip, Cm = Cmod,
Me = Mesh, EC = CD and SP = SPD.
118
• The user clipping enable bit and clipping mode are specified. Depending on the
clipping mode, either the outside or the inside of the user clipping area is speci-
fied.
• Mesh is enabled, end code is disabled, and transparent pixel is disabled. MSB
ON is set to perform shade processing in the VDP2.
• The color mode that defines the character pattern is set. Color bank is specified
when the color mode is the color bank mode. When the color mode is the lookup
table mode, the address of the color lookup table is defined by dividing by 8H.
• Color calculation is specified. Color calculation is enabled in the RGB mode.
When color calculation is not used, replace is specified. When Gouraud shading
is used, the address of the Gouraud shading table is specified by dividing by 8H.
Gouraud shading processing is enabled in the RGB mode.
• The address of the character pattern table is defined in CMDSRCA by dividing
by 8H. The horizontal and vertical lengths of the character size defined in the
character pattern table are defined in CMDSIZE. A value divisible by 8 is defined
for the horizontal size.
• The upper-left coordinates of the area to be drawn are defined in vertex (A)
(CMDXA, CMDYA).
bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Scaled sprite
CMDCTRL +00H 0 JP 0 0 0 0 0 0 Dir 0 0 0 1
Link specification/8H
CMDLINK +02H Vertex (A) Vertex (B)
Color
MO 0 0 HS Pc Cl Cm Me EC SP Color mode calculation
CMDPMOD +04H
CMDCOLR +06H Color bank, lookup table/8H (LSB fixed at 00)
CMDSRCA +08H Character address/8H 0 0
CMDSIZE +0AH 0 0 Character size X/8 Character size Y Vertex (D) Vertex (C)
Note: is ignored.
Specification of coordinates for two points by the scaled sprite draw command is
defined as follows:
• When the end bit is set to 0B and the command selection bits are set to 0001B, the
scaled sprite draw command is enabled.
• The jump mode is then specified. When the jump mode is assigned or called, the
address of the command table to be processed next is divided by 8H and set in
CMDLINK.
• The zoom point is set to 0000B. The coordinates for two points are specified.
120
• The read direction of the character pattern is set. The character pattern can be
drawn with vertical or horizontal inversion by the specification of the read direc-
tion. When inversion is specified twice by the read direction and by the specifica-
tion of vertex (A) (CMDXA, CMDYA) and vertex (C) (CMDXC, CMDYC), the
inversions cancel each other out and the direction returns to the original direc-
tion.
• Set high speed shrink. Specify priority to precision or to speed.
• Set pre-clipping. Specify enable or disable in consideration of the clipping area
and the drawing position of the part.
• The user clipping enable bit and clipping mode are specified. Depending on the
clipping mode, either the outside or the inside of the user clipping area is speci-
fied.
• Mesh is enabled, end code is disabled, and transparent pixel is disabled. MSB
ON is set to perform shade processing in the VDP2.
• The color mode that defines the character pattern is set. The color bank is speci-
fied when the color mode is the color bank mode. When the color mode is the
lookup table mode, the address of the color lookup table is defined by dividing
by 8H.
• Color calculation is specified. Color calculation is enabled in the RGB mode.
When color calculation is not used, replace is specified. When Gouraud shading
is used, the address of the Gouraud shading table is specified by dividing by 8H.
Gouraud shading processing is enabled in the RGB mode.
• The address of the character pattern table is defined in CMDSRCA by dividing
by 8H. The horizontal and vertical lengths of the character size defined in the
character pattern table are defined. A value divisible by 8 is defined for the
horizontal size.
• The upper-left coordinates of the area to be drawn are defined as vertex (A)
(CMDXA, CMDYA), and the lower-right coordinates are defined as vertex (C)
(CMDXC, CMDYC). Enlargement, reduction, and stretching are possible by the
specification of vertex (A) and vertex (C). Also, when X of (A) is greater than X of
(C), the part is inverted horizontally. When Y of (A) is greater than Y of (C), the
part is inverted vertically.
• When vertex A and vertex C are set at the same coordinates, they are drawn with
one pixel.
al
bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
nti
CMDCTRL 0 JP ZP 0 0 Dir 0 0 0 1
+00H
CMDLINK Link specification/8H
+02H Color
CMDPMOD MO 0 0 HS Pc Cl Cm Me EC SP Color mode calculation
+04H Scaled sprite
CMDCOLR Color bank, lookup table/8H (LSB fixed at 00)
+06H
Vertex (A) Vertex (B)
CMDSRCA Character address/8H 0 0
+08H
de
Zoom Point
CMDSIZE 0 0 Character size X/8 Character size Y
+0AH Display
CMDXA Code extension Zoom point, X coordinate (XA) width (YB)
+0CH
CMDYA Code extension Zoom point, Y coordinate (YA)
+0EH Vertex (D) Vertex (C)
CMDXB Code extension Display, X width (XB)
+10H
CMDYB Code extension Display, Y width (YB) Display width (XB)
+12H
CMDGRDA
+1AH
+1CH
+14H
+16H
+18H
nfi
Gouraud shading table/8H
Frame buffer
Co
Note: is ignored.
Specification of the zoom point of the scaled sprite draw command is defined as
follows:
• When the end bit is set to 0B and the command selection bits are set to 0001B, the
scaled sprite draw command is enabled.
• The jump mode is then specified. When the jump mode is assigned or called, the
GA
tion.
• Set high speed shrink. Specify priority to precision or to speed.
• Set pre-clipping. Specify enable or disable in consideration of the clipping area
and the drawing position of the part.
122
• The user clipping enable bit and clipping mode are specified. Depending on the
clipping mode, either the outside or the inside of the user clipping area is speci-
fied.
• Mesh is enabled, end code is disabled, and transparent pixel is disabled. MSB
ON is set to perform shade processing in the VDP2.
• The color mode that defines the character pattern is set. Color bank is specified
when the color mode is the color bank mode. When the color mode is the lookup
table mode, the address of the color lookup table is defined by dividing by 8H.
• Color calculation is specified. Color calculation is enabled in the RGB mode.
When color calculation is not used, replace is specified. When Gouraud shading
is used, the address of the Gouraud shading table is specified by dividing by 8H.
Gouraud shading processing is enabled in the RGB mode.
• The address of the character pattern table is defined in CMDSRCA by dividing
by 8H. The horizontal and vertical lengths of the character size defined in the
character pattern table are defined in CMDSIZE. A value divisible by 8 is defined
for the horizontal size.
• The coordinates of the zoom point of the character to be drawn are set at zoom
point coordinates (CMDXA, CMDYA). The display width is defined in CMDXB,
CMDYB. The character pattern can be drawn enlarged, reduced, or stretched by
specifying the display width.
• When the value of CMDXB, CMDYB is set to (0, 0), the sprite is drawn as one
pixel.
bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
JP 0 0 0 0 0 0 Dir 0 0 1 0
CMDCTRL +00H 0
CMDLINK +02H Link specification/8H 0 0
Color Distorted sprite
CMDPMOD
MO 0 0 HS Pc Cl Cm Me EC SP Color mode calculation
+04H
CMDCOLR Color bank, lookup table/8H (LSB fixed at 00) Vertex (A)
+06H Vertex (D)
CMDSRCA Character address/8H 0 0
+08H
CMDSIZE 0 0 Character size X/8 Character size Y
+0AH
CMDXA Code extension Vertex (A), X coordinate (XA)
Vertex (B)
+0CH
CMDYA Code extension Vertex (A), Y coordinate (YA) Vertex (C)
+0EH
CMDXB Code extension Vertex (B), X coordinate (XB)
+10H
CMDYB Code extension Vertex (B), Y coordinate (YB) Frame buffer
+12H
CMDXC Code extension Vertex (C), X coordinate (XC)
+14H
CMDYC Code extension Vertex (C), Y coordinate (YC)
+16H
CMDXD Code extension Vertex (D), X coordinate (XD)
+18H
CMDYD Code extension Vertex (D), Y coordinate (YD)
+1AH
CMDGRDA Gouraud shading table/8H
+1CH
Note: is ignored.
124
• The user clipping enable bit and clipping mode are specified. Depending on the
clipping mode, either the outside or the inside of the user clipping area is speci-
fied.
• Mesh is enabled, end code is disabled, and transparent pixel is disabled. MSB
ON is set to perform shade processing in the VDP2.
• The color mode that defines the character pattern is set. Color bank is specified
when the color mode is the color bank mode. When the color mode is the lookup
table mode, the address of the color lookup table is defined by dividing by 8H.
• Color calculation is specified. Color calculation is enabled in the RGB mode.
When color calculation is not used, replace is specified. When Gouraud shading
is used, the address of the Gouraud shading table is specified by dividing by 8H.
Gouraud shading processing is enabled in the RGB mode.
• The address of the character pattern table is defined in CMDSRCA by dividing
by 8H. The horizontal and vertical lengths of the character size defined in the
character pattern table are defined in CMDSIZE. A value divisible by 8 is defined
for the horizontal size.
• The upper-left coordinates of the area to be drawn are defined as vertex (A)
(CMDXA, CMDYA), the upper-right coordinates are defined as vertex (B)
(CMDXB, CMDYB), the lower-right coordinates are defined as vertex (C)
(CMDXC, CMDYC), and the lower-left coordinates are defined as vertex (D)
(CMDXD, CMDYD). The relationships between the positions of the four vertices
can be set as desired, and therefore enlargement, reduction, stretching, rotation,
and twist can be specified when drawing the character pattern by the specifica-
tion of vertex (A), vertex (B), vertex (C), and vertex (D). Vertical and horizontal
inversion are also possible.
• When two vertices are set at the same coordinates, the sprite is drawn as a tri-
angle. When four vertices are set at the same coordinates, the sprite is drawn as
one pixel.
The polygon draw command draws quadrangles in the frame buffer. The inside of
the quadrangle is filled with the specified color. When the end bit is 0B and the
command selection bits are 0100B, the polygon draw command is enabled. The
contents of the command table are shown in the following figure.
bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
CMDCTRL +00H 0 JP 0 0 0 0 0 0 0 0 0 1 0 0
Link specification/8H 0 0 Polygon
CMDLINK +02H Filled with
Color
MO 0 0 0 Pc Cl Cm Me 1 1 0 0 0 calculation non-textured
CMDPMOD +04H
Non-textured color l
CMDCOLR +06H Vertex (D) Vertex (A)
+08H
+0AH
CMDXA +0CH Code extension Vertex (A), X coordinate (XA) Vertex (B)
Vertex (C)
CMDYA +0EH Code extension Vertex (A), Y coordinate (YA)
CMDXB +10H Code extension Vertex (B), X coordinate (XB)
CMDYB +12H Code extension Vertex (B), Y coordinate (YB)
Frame buffer
CMDXC +14H Code extension Vertex (C), X coordinate (XC)
CMDYC +16H Code extension Vertex (C), Y coordinate (YC)
CMDXD +18H Code extension Vertex (D), X coordinate (XD)
CMDYD +1AH Code extension Vertex (D), Y coordinate (YD)
CMDGRDA +1CH Gouraud shading table/8H
Note: is ignored.
126
• Specify color calculation. Color calculation is enabled when the non-textured
color is in the RGB mode. When color calculation is not used, replace is specified.
When Gouraud shading is used, the address of the Gouraud shading table is
specified by dividing by 8H. Gouraud shading processing is enabled when the
non-textured color is in the RGB mode.
• The upper-left coordinates of the quadrangle to be drawn are defined as vertex
(A) (CMDXA, CMDYA), the upper-right coordinates are defined as vertex (B)
(CMDXB, CMDYB), the lower-right coordinates are defined as vertex (C)
(CMDXC, CMDYC), and the lower-left coordinates are defined as vertex (D)
(CMDXD, CMDYD). The relationships between the positions of the four vertices
can be set as desired, and therefore rotation and twist can be specified when
drawing the character pattern by the specification of vertex (A), vertex (B), vertex
(C), and vertex (D).
• When two vertices are set at the same coordinates, a polygon is drawn as a tri-
angle. When four vertices are set at the same coordinates, the polygon is drawn
as one pixel.
The polyline draw command draws quadrangles in the frame buffer. The inside of
the quadrangle is not filled. When the end bit is 0B and the command selection bits
are 0101B, the polyline draw command is enabled. The contents of the command
table are shown in the following figure.
bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
CMDCTRL
+00 H 0 JP 0 0 0 0 0 0 0 0 0 1 0 1 Polyline
CMDLINK
+02 H Link specification/8 H 0 0
CMDPMOD
+04 H MO 0 0 0 Pc C1 Cm Me 1 1 0 0 0 Color
calculation
Vertex (A)
CMDCOLR Vertex (D)
+06 H Non-textured color
+08 H
+0AH
CMDXA Vertex (B)
+0CH Code extension Vertex (A), X coordinate (XA) Vertex (C)
CMDYA
+0EH Code extension Vertex (A), Y coordinate (YA)
CMDXB
+10 H Code extension Vertex (B), X coordinate (XB)
CMDYB Frame buffer
+12 H Code extension Vertex (B), Y coordinate (YB)
CMDXC
+14 H Code extension Vertex (C), X coordinate (XC)
CMDYC
+16 H Code extension Vertex (C), Y coordinate (YC)
CMDXD
+18 H Code extension Vertex (D), X coordinate (XD)
CMDYD Code extension Vertex (D), Y coordinate (YD)
+1AH
CMDGRDA
+1CH Gouraud shading table/8 H
NOTE: is ignored.
128
• Color calculation is specified. Color calculation is enabled when the non-textured
color is in the RGB mode. When color calculation is not used, replace is specified.
When Gouraud shading is used, the address of the Gouraud shading table is
specified by dividing by 8H. Gouraud shading processing is enabled when the
non-textured color is in the RGB mode.
• When half-transparency processing is performed on polylines, two lines overlap
at each point. As a result half-transparency is applied twice, thus causing original
picture 3/4 + background 1/4.
• When shadow processing is performed on polylines, two lines overlap at each
point. As a result shadow is applied twice, thus causing one half the luminance.
• The upper-left coordinates of the quadrangle to be drawn are defined as vertex
(A) (CMDXA, CMDYA), the upper-right coordinates are defined as vertex (B)
(CMDXB, CMDYB), the lower-right coordinates are defined as vertex (C)
(CMDXC, CMDYC), and the lower-left coordinates are defined as vertex (D)
(CMDXD, CMDYD). The relationships between the positions of the four vertices
can be set as desired, and therefore rotation and twist can be specified when
drawing the character pattern by the specification of vertex (A), vertex (B), vertex
(C), and vertex (D).
• When two vertices are set at the same coordinates, a polygon is drawn as a tri-
angle. When four vertices are set at the same coordinates, the polygon is drawn
as one pixel.
The line draw command draws quadrangles in the frame buffer. The inside of the
quadrangles is not filled. When the end bit is 0B and the command selection bits are
0110B, the line draw command is enabled. The contents of the command table are
shown below.
bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
0 JP 0 0 0 0 0 0 0 0 0 1 1 0
CMDCTRL +00H
Link specification/8H 0 0
CMDLINK +02H
1 1 0 0 0 Color Line
CMDPMOD
MO 0 0 0 Pc Cl Cm Me calculation
+04H
Non-textured color
CMDCOLR
+06H Vertex (A)
+08H Vertex (B)
Note: is ignored.
130
• Color calculation is specified. Color calculation is enabled when the non-textured
color is in the RGB mode. When color calculation is not used, replace is specified.
When Gouraud shading is used, the address of the Gouraud shading table is
specified by dividing by 8H. Gouraud shading processing is enabled when the
non-textured color is in the RGB mode. Only vertex (A) and vertex (B) in the
Gouraud shading table are enabled; vertex (C) and vertex (D) are ignored.
• Vertex (A) of the line to be drawn is defined in CMDXA, CMDYA and vertex (B)
is defined in CMDXB, CMDYB.
• When the two vertices are set to the same coordinates, the line is drawn as one
pixel.
The draw end command specifies the end of drawing. When the end bit is “1”, the
draw end command is enabled. The contents of the command table are shown in the
following figure.
bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
CMDCTRL
+00H 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+02H
+04H
+06H
+08H
+0AH
+0CH
+0EH
+10H
+12H
+14H
+16H
+18H
+1AH
+1CH
Note: is ignored.
• When the +00H address is set to 8000H, the draw end command is enabled.
132
Chapter 8
Quick Reference
Contents
TVMR bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
100000H 0 0 0 0 0 0 0 0 0 0 0 0 VBE TVM
Write-only
134
Frame Buffer Change Mode Register
FBCR bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
100002H 0 0 0 0 0 0 0 0 0 0 0 EOS DIE DIL FCM FCT
Write-only
PTMR bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
100004H 0 0 0 0 0 0 0 0 0 0 0 0 0 0 PTM
Write-only
PTM
Bit 1 0 Drawing mode
0 0 Idle at frame change
0 1 Starts drawing when 01B is written
1 0 Starts drawing automatically with frame change
1 1 Setting prohibited (do not set)
EWDR
100006H bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
16 bits/pixel Erase/write Data
8 bits/pixel Erase/write data for even X coordinates Erase/write data for odd X coordinates
Write-only
136
Erase/Write Upper-Left Coordinate Register
EWLR bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
100008H 0 Upper-left coordinate X1 Upper-left coordinate Y1
Write-only
EWRR bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
10000AH Lower-right coordinate X3 Lower-right coordinate Y3
Write-only
8 bits/pixel
16 bits/pixel High Resolution Rotated 8
Value set Upper-left Lower-right Upper-left Lower-right Upper-left Lower-right
in register coordinate X1 coordinate X3 coordinate X1 coordinate X3 coordinate X1 coordinate X3
0 0 Setting 0 Setting 0 Setting
prohibited prohibited prohibited
1 8 7 16 15 16 15
2 16 15 32 31 32 31
: : : : : : :
: : : : : : :
: : : : : : :
LOPR bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
100012H Last operation table address/8H 0 0
Read-only
COPR bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
100014H Current operation table address/8H 0 0
Read-only
138
Mode Status Register
MODR bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
100016H VER — — — PTM1 EOS DIE DIL FCM VBE TVM
Read-only
pixel 0 1 2 3 4 5 6 7
+00H + 0 + 1 + 2 + 3 ← Value is local address from character pattern
+04H + 4 + 5 + 6 + 7
+08H + 8 + 9 + A + B
pixel 0 1 2 3 4 5 6 7
+00H +0 +1 +2 +3 +4 +5 +6 +7
+08H +8 +9 +A +B +C +D +E +F
+10H +10 +11 +12 +13 +14 +15 +16 +17
pixel 0 1 2 3 4 5 6 7
+00H +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +A +B +C +D +E +F
+10H +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +1A +1B +1C +1D +1E +1F
+20H +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +2A +2B +2C +2D +2E +2F
140
Gouraud Shading Table
bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
CMDCTRL END JP ZP 0 0 Dir Comm
+00H
CMDLINK LINK specification/8H 0 0
+02H
CMDPMOD MON 0 0 HSS Pclp Clip Cmod Mesh ECD SPD Color mode Color calculation bit
+04H
CMDCOLR Color bank, color lookup table/8H (LSB is set to 00), non-textured color
+06H
CMDSRCA Character address/8H 0 0
+08H
CMDSIZE 0 0 Character size X/8 Character size Y
+0AH
CMDXA
+0CH
Code extension Vertex (A) and X coordinate (XA) *
CMDYA Code extension Vertex (A) and Y coordinate (YA)
+0EH
CMDXB Code extension Vertex (B) and X coordinate (XB)
+10H
CMDYB Code extension Vertex (B) and Y coordinate (YB)
+12H
CMDXC Code extension Vertex (C) and X coordinate (XC)
+14H
CMDYC Code extension Vertex (C) and Y coordinate (YC)
+16H
CMDXD Code extension Vertex (D) and X coordinate (XD)
+18H
CMDYD Code extension Vertex (D) and Y coordinate (YD)
+1AH
CMDGRDA
+1CH Gouraud Shading Table/8H
+1EH (Dummy) Skipped during table fetch
+20H
: Succeeding table
+40H
: Succeeding table
+60H
: :
* Note: The top bit of the vertex coordinate is a sign bit. A negative value is indicated by the complement of
2. Extend the sign for the upper 6 bits.
142
CMDCTRL (Control Words)
bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
CMDCTRL
+00H END JP ZP 0 0 Dir Comm
144
Command Select (Comm): bits 3~0
bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
CMDLINK
+02H Link specification/8H 0 0
bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
CMDPMOD
+04H MON 0 0 HSS Pclp Clip Cmod Mesh ECD SPD Color mode Color calculation bits
146
End Code Disable (ECD): bit 7
HSS ECD End code processing
0 0 End code enable: drawing horizontally is disabled when second
end code is read and end code becomes transparent.
0 1 End code disable: end code is not processed,
color of code is expressed.
1& 0 End code enable: drawing horizontally is disabled when second
enlarge end code is read and end code becomes transparent.
1& 0 End code disable: end code is not processed,
reduce color of code is expressed.
1 1 End code disable: end code is not processed,
color of code is expressed.
Color
calculation Background Original Type of color Usable modes
(in Bit) MSB graphic Background calculation Original
2 1 0 graphic Background
0 0 0 — 1 0 Replace Not restricted Not restricted
0 0 1 0 0 1 Cannot rewrite Not Not restricted
1 01 1/2 Shadow restricted RGB
0 1 0 — 1/2 0 Half-luminance RGB Not restricted
0 1 1 0 1 0 Replace RGB Not restricted
1 1/2 1/2 Half-transparent RGB
1 0 0 — Gouraud 0 Gouraud shading RGB Not restricted
1 0 1 — — — Setting prohibited — —
(do not set)
1 1 0 Gouraud Gouraud shading + RGB Not restricted
— 1/2 0 Half-luminance 2
0 Gouraud 0 Gouraud shading Not restricted
1 1 1 Gouraud Gouraud shading +
1 1/2 1/2 Half- transparent3 RGB RGB
148
CMDCOLR (Color Control Word)
bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
CMDCOLR
+06H Color bank, color lookup table/8H (LSB fixed at 00), non-textured colors
bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
CMDSRCA
+08H Character address/8H 0 0
bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
CMDSIZE
+0AH 0 0 Character size X/8 Character size Y
Note: The top bit of the parameter is a sign bit. A negative value is indicated by a complement
of 2. Extend the code with the upper 6 bits.
Polyline draw command Vertex (A) Vertex (B) Vertex (C) Vertex (D)
bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
CMDGRDA
+1CH Gouraud shading table/8H
150
8.4 Commands
bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
CMDCTRL
+00H 0 JP 0 0 0 0 0 0 0 0 1 0 0 1
CMDLINK Link specification/8H 0 0
+02H
(0, 0)
+04H
+06H TV
+08H
+0AH
Lower-right Coordinate
+0CH
+0EH
System clipping area
+10H
+12H
CMDXC
+14H 0 0 0 0 0 0 Lower-right X coordinate (XC) Upper-left coordinates
CMDYC are fixed at (0, 0).
+16H 0 0 0 0 0 0 0 Lower-right Y coordinate (YC)
+18H
+1AH
+1CH
Note: is ignored.
bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
CMDCTRL
+00H 0 JP 0 0 0 0 0 0 0 0 1 0 0 0
CMDLINK Link specification/8H 0 0
+02H Upper-left
coordinate
+04H TV
+06H
+08H Lower-right
coordinate
System
clipping area
+0AH
CMDXA
+0CH 0 0 0 0 0 0 Upper-left X coordinate (XA) User clipping area
CMDYA
+0EH 0 0 0 0 0 0 0 Upper-left Y coordinate (YA)
+10H
+12H
CMDXC
+14H 0 0 0 0 0 0 Lower-right X coordinate (XC)
CMDYC
+16H 0 0 0 0 0 0 0 Lower-right Y coordinate (YC)
+18H
+1AH
+1CH
Note: is ignored.
bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
CMDCTRL 0 0 0 0 0 0 0 0 1 0 1 0
+00H 0 JP
CMDLINK Link specification/8H 0 0 (0,0)
+02H
+04H
TV
+06H Local coordinate (A)
+08H
+0AH
CMDXA
+0CH Code extension Local X coordinate (XA)
CMDYA +0EH Code extension Local Y coordinate (YA)
System clipping area
+10H
+12H
+14H
+16H
+18H
+1AH
+1CH
Note: is ignored.
bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
0 JP 0 0 0 0 0 0 Dir 0 0 0 0 Normal sprite
CMDCTRL +00H
Link specification/8H
CMDLINK +02H Color
Vertex (A) Vertex (B)
MO 0 0 0 Pc CI Cm Me EC SP Color mode
calculation
CMDPMOD +04H
Color bank, lookup table/8H (LSB fixed at 00)
CMDCOLR +06H
Character address/8H 0 0
CMDSRCA +08H
0 0 Character size X/8 Character size Y Vertex (D) Vertex (C)
CMDSIZE +0AH
CMDXA +0CH Code extension Vertex (A), X coordinate (XA)
CMDYA +0EH Code extension Vertex (A), Y coordinate (YA)
Note: is ignored.
MO = MON, HS = HSS, Pc = Pclp,
Cl = Clip, Cm = Cmod,
Me = Mesh, EC = CD and
152
Scaled Sprite Draw Command (Coordinates of 2 Points Specification )
Note: is ignored.
bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
0 JP ZP 0 0 Dir 0 0 0 1
CMDCTRL+00H
Link Specification/8H
CMDLINK+02H
Color
MO 0 0 HS Pc Cl Cm Me EC SP Color mode
calculation Scaled sprite
CMDPMOD+04H
CMDCOLR Color bank, lookup table/8H (LSB fixed at 00)
+06H Vertex (A) Vertex (B)
CMDSRCA Character address/8H 0 0
+08H Zoom Point
CMDSIZE 0 0 Character size X/8 Character size Y
Display
+0AH
Code extension Zoom point (A), X coordinate (XA) width (YB)
CMDXA+0CH
CMDYA Code extension Zoom point (A), Y coordinate (YA) Vertex (D)
+0EH Vertex (C)
Note: is ignored.
bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
0 JP 0 0 0 0 0 0 Dir 0 0 1 0
CMDCTRL +00H
Link specification/8H 0 0 Distorted sprite
CMDLINK +02H Color Color
MO 0 0 HS Pc Cl Cm Me EC SP
mode calculation
CMDPMOD
+04H Color bank, lookup table/8H (LSB fixed at 00)
CMDCOLR Vertex (D) Vertex (A)
+06H Character address/8H 0 0
CMDSRCA
+08H 0 0 Character size X/8 Character size Y
CMDSIZE
+0AH Code extension Vertex (A), X coordinate (XA)
CMDXA Vertex (B)
+0CH Code extension Vertex (A), Y coordinate (YA) Vertex (C)
CMDYA
+0EH
CMDXB Code extension Vertex (B), X coordinate (XB)
+10H
CMDYB Code extension Vertex (B), Y coordinate (YB) Frame buffer
+12H
CMDXC Code extension Vertex (C), X coordinate (XC)
+14H Code extension Vertex (C), Y coordinate (YC)
CMDYC
+16H
Code extension Vertex (D), X coordinate (XD)
CMDXD
+18H
CMDYD Code extension Vertex (D), Y coordinate (YD)
+1AH
CMDGRDA Gouraud shading table/8H
+1CH
Note: is ignored.
bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
CMDCTRL JP 0 0 0 0 0 0 0 0 0 1 0 0
+00H 0
CMDLINK+02H Link specification/8H 0 0 Polygon
Color Filled with
CMDPMOD+04H MO 0 0 0 Pc Cl Cm Me 1 1 0 0 0 calculation non-textured color
CMDCOLR Non-textured color Vertex (A)
+06H Vertex (D)
+08H
+0AH
CMDXA Code extension Vertex (A), X coordinate (XA)
+0CH Vertex (B)
CMDYA+0EH Vertex (C)
Code extension Vertex (A), Y coordinate (YA)
CMDXB Code extension
+10H Vertex (B), X coordinate (XB)
CMDYB Code extension Vertex (B), Y coordinate (YB)
+12H
CMDXC Frame buffer
+14H Code extension Vertex (C), X coordinate (XC)
CMDYC+16H Code extension Vertex (C), Y coordinate (YC)
CMDXD+18H Code extension Vertex (D), X coordinate (XD)
CMDYD
+1AH Code extension Vertex (D), Y coordinate (YD)
CMDGRDA
+1CH Gouraud shading table/8H
Note: is ignored.
154
Polyline Draw Command
bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
CMDCTRL
+00 H 0 JP 0 0 0 0 0 0 0 0 0 1 0 1 Polyline
CMDLINK
+02 H Link specification/8 H 0 0
CMDPMOD MO 0 0 0 Pc CI Cm Me 1 1 0 0 0 Color
Vertex (A)
+04 H calculation
Vertex (D)
CMDCOLR Non-textured color
+06 H
+08 H
+0AH Vertex (B)
CMDXA
Code extension Vertex (A), X coordinate (XA) Vertex (C)
CMDYA +0CH
Code extension Vertex (A), Y coordinate (YA)
+0EH
CMDXB
Code extension Vertex (B), X coordinate (XB)
CMDYB +10 H
Code extension Vertex (B), Y coordinate (YB) Frame buffer
+12 H
CMDXC
Code extension Vertex (C), X coordinate (XC)
CMDYC +14 H
Code extension Vertex (C), Y coordinate (YC)
CMDXD +16 H
Code extension Vertex (D), X coordinate (XD)
+18 H
CMDYD Code extension Vertex (D), Y coordinate (YD)
+1AH
CMDGRDA Gouraud shading table/8 H
+1CH
NOTE: is ignored.
bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
CMDCTRL +00H 0 JP 0 0 0 0 0 0 0 0 0 1 1 0
Note: is ignored.
bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
CMDCTRL
+00H 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+02H
+04H
+06H
+08H
+0AH
+0CH
+0EH
+10H
+12H
+14H
+16H
+18H
+1AH
+1CH
Note: is ignored.
156
Chapter 9
System Registers
· DMA access of the system registers is prohibited. Word access must be used.
· Be sure to set the system registers after powering on.
· Be sure to set bits not used in the system registers to “0.”
· Be sure to set DIE to “0” for rotated reading of the frame buffer. Rotated read-
ing is prohibited in double interlace.
· An undefined screen is displayed in the first frame after changing the DIE bit,
so use caution.
· When changing the TVM bit, the frame buffer must be masked. An undefined
screen is displayed for one frame during the change.
· Set FCM and FCT to “0” during double interlace. The fields can only be
changed when they are 1/60 second.
· Set the erase/write areas so that upper-left coordinate XA is less than lower-
right coordinate XC and upper-left coordinate YA is less than or equal to lower-
right coordinate YC.
Commands
· Local coordinates must be set after powering on.
· The clipping coordinate setting range is from (0, 0) to (1023, 511).
· In the clipping coordinate range, upper-left coordinate XA is less than lower-
right coordinate XC and upper-left coordinate YA is less than or equal to lower-
right coordinate YC.
· Set suitable values for clipping to match the screen mode set by the TVM bit.
· Always set the user clipping area inside the system clipping area. They can be
set on the same lines.
· The upper-left coordinate of the system clipping area is fixed at (0,0) in the
hardware.
· Set unused bits in words used in commands tables to “0.”
· Call (call, jump call, skip call) is prohibited in command subroutines.
158
· Return (return, jump return, skip return) is prohibited in command main rou-
tines.
· Only 0H, 5H, 6H, 7H, 9H, AH (10), BH (11), DH (13), EH (14,) and FH (15) are
allowed as zoom-point values. Settings other than these are prohibited.
· When HSS = 1, the end codes of the original graphic are ignored whether the
sprite is enlarged or reduced.
· Set the lower 2 bits of CMDLINK to “00”.”
· Set the lower 2 bits of lookup tables to “00.”
· When setting a color bank, set the lower 4 bits of the color bank data to “0000.”
· Set ECD and SPD to “1” and the color mode to “0” for non-textures.
· When calculating colors in non-textures, set the non-texture color using RGB
data (greater than 8000H).
· Set ECD to “0” when the color mode is set to the RGB mode and 7FFFH data
are used for the original graphic.
· Set SPD to “0” when the color mode is set to the RGB mode and 0000H data are
used for the original graphic.
· When the color mode is set to the RGB mode, the frame buffer cannot be set to
8 bits/pixel. The only color modes in which 8 bits/pixel can be set are modes 0,
1, 2, 3, and 4.
· When the frame buffer is set to 8 bits/pixel, set the color calculation mode to
“0.” Only replace is possible. Color calculation other than this is prohibited.
· When the frame buffer is set to 8 bits/pixel, the upper 8 bits of non-textured
colors are ignored. The use of RGB data is prohibited at this time.
· When the frame buffer is set to 8 bits/pixel, set the MSB ON bit (MON) to “1.”
· When the MSB ON bit (MON) is set to “1,” set the color calculation mode to
“0.”
· Store command tables to address 000000H of VRAM.
160
INDEX
#
(color) lookup table mode ............................... 89 disable (transparent pixel) ............................... 88
(color) palette code ........................................... 89 display device ...................................................... 2
1-cycle mode ...................................................... 38 display range ..................................................... 14
31KC ................................................................... 37 distorted sprite draw command ................... 124
distorted sprites .................................................. 8
A DMA burst transfer .......................................... 23
access (system registers) .................................. 23 double interlace ................................................. 43
address map ...................................................... 18 double interlace enable bit .............................. 43
double interlace draw line ............................... 43
B draw forced termination register ................... 51
background ........................................................ 94 draw command ............................................... 109
boundaries ......................................................... 24 draw mode word .............................................. 79
burst transfer (DMA)........................................ 23 draw procedure flow ........................................ 28
byte access (VRAM) ......................................... 19 draw end command ....................................... 132
dropout processing ............................................. 9
C
change (manual mode) .................................... 39 E
character address ............................................ 103 end bit ........................................................... 70, 71
character pattern (each color mode) .............. 90 end code disable................................................ 86
character pattern ............................................... 60 erase & change (manual mode) ...................... 40
character pattern table ............................... 26, 60 erase (manual mode) ........................................ 39
character read direction ................................... 77 erase/write ........................................................ 46
character size ................................................... 104 even lines ........................................................... 43
clipping coordinate set command ................ 109 even/odd coordinate selection ....................... 44
CMDCOLR ........................................................ 98
CMDCTRL ......................................................... 70 F
CMDGRDA ..................................................... 106 fetch .................................................................... 29
CMDLINK ......................................................... 78 fetch status (of end bit) .................................... 52
CMDPMOD ....................................................... 79 fill data (erase/write) ....................................... 46
CMDSIZE ......................................................... 104 fill-in (polygons) ............................................... 10
CMDSRCA ....................................................... 103 fixed point (zoom point) .................................. 73
CMDXA~CMDYD .......................................... 105 flow (of command tables) ................................ 30
color .................................................................... 12 flow (of draw procedure) ................................ 28
color bank .......................................................... 99 frame ................................................................... 38
color bank code ............................................... 100 frame buffer ................................................... 2, 20
color calculation ................................................ 93 frame buffer change mode bit ......................... 38
color control word ............................................ 98 frame buffer change mode register ................ 38
color lookup table ............................... 26, 62, 101 frame buffer change trigger bit ....................... 38
color mode ......................................................... 89
command table ...................................... 25, 66, 69 G
command table flow ......................................... 30 Gouraud shading ........................................ 64, 95
commands .................................................. 71, 109 Gouraud shading table ...................... 26, 64, 106
control words .................................................... 70
coordinate set command ................................ 109 H
CPU ....................................................................... 2
current operation table address (register) ..... 55 half-luminance .................................................. 95
half-transparent ................................................. 95
D HDTV ................................................................. 37
disable (end code) ............................................. 86 high resolution .................................................. 37
disable (pre-clipping) ....................................... 83 high speed shrink ............................................. 81
horizontal inversion ......................................... 77
L R
line draw command ....................................... 130 read direction (character) .....................................77
lines ..................................................................... 11 read/write access (VRAM)..................................19
LINK specification ............................................ 78 referencing (of tables) ...........................................31
local coordinate set command ...................... 116 registers (system) ..................................................34
local coordinates ............................................. 117 replace ....................................................................94
lookup table mode ............................................ 89 reset .........................................................................23
luminance (Gouraud shading) ........................ 64 RGB code ................................................................91
luminance (RGB) ............................................... 91 RGB mode ..............................................................89
M S
manual mode ..................................................... 39 scaled sprite .............................................................6
mesh enable ....................................................... 85 scaled sprite draw command ............................120
mode 0 (color mode) ........................................ 90 screen modes ...................................................14, 37
mode 1 (color mode) ........................................ 90 shadow (color calculation) ..................................94
mode 2 (color mode) ........................................ 91 shadow (MSB ON) ................................................97
mode 3 (color mode) ........................................ 91 single interlace ......................................................43
mode 4 (color mode) ........................................ 91 skip assign..............................................................72
mode 5 (color mode) ........................................ 91 skip call...................................................................72
mode status register ......................................... 57 skip next .................................................................72
MSB ON ............................................................. 97 skip return ..............................................................72
specification of coordinates
N of two points (scaled sprite draw command) .120
non-textured color .................................... 13, 102 specification of coordinates
non-textured parts ............................................ 10 of two points (scaled sprites) ................................6
non-textured draw commands ..................... 109 specification of zoom point
normal sprite ....................................................... 5 (scaled sprite draw command) .........................122
normal sprite draw command ...................... 118 specification of zoom point (scaled sprites) ........7
NTSC system ..................................................... 37 sprite IC ....................................................................2
subroutines (jump call, skip call)..................30, 72
O system clipping ................................................... 111
odd lines ............................................................. 43 system clipping coordinate set command....... 110
order of priority (frame buffer) ....................... 20 system controller.....................................................2
order of priority (VRAM) ................................ 19 system registers ...........................................2, 23, 34
original picture .................................................. 94
outside drawing mode ............................. 84, 115
P
PAL system ........................................................ 37
palette code ........................................................ 89
parts ...................................................................... 4
162
T
table referencing flow ....................................... 31
tables (in VRAM) ........................................ 24, 59
texture draw commands ................................ 109
textured parts ...................................................... 5
transfer end status register .............................. 52
transfer-over ...................................................... 53
transparent color code ...................................... 88
transparent pixel disable ................................. 88
trigger (draw) .................................................... 45
TV mode selection bit ....................................... 36
TV mode selection register .............................. 36
U
user clipping .................................................... 113
user clipping coordinate set command ....... 112
user clipping enable ......................................... 84
user clipping mode ........................................... 84
V
V-blank erase/write enable bit ....................... 36
VDP1 ..................................................................... 1
VDP1 Functions .................................................. 3
VDP2 ..................................................................... 2
version number ................................................. 57
vertex coordinate data.................................... 105
vertical inversion .............................................. 77
VRAM ............................................................. 2, 19
W
window (MSB ON) ........................................... 97
word access (VRAM) ........................................ 19
Z
zoom point(fixed point) ................................... 73
VDP2
User's Manual
Version 1.1
Doc. #ST-58-R2-060194
In translating/creating this document, certain technical words and/or phrases were interpreted
with the assistance of the technical literature listed below.
Manual Notations
Binary, hexadecimal
Binary notation has a B attached at the end (as in 100B); however, B may be omitted when
binary notation is obvious. Hexadecimal notation has an H attached at the end (as in 00H
and FFH).
Units
1 Kbyte is 1024 bytes. 1 Mbit is 1024 Kbits, or 1,048,576 bits.
MSB, LSB
The structure of byte and word shows the MSB (most significant bit) on the left and LSB (least
significant bit) on the right.
An undefined bit
A bit not defined by the register is shown as a dash. A “0” should be written into an undefined
bit of the register. Bits not defined by data of tables defined by VRAM are shown as shaded.
As a rule, a 0 should be written, providing that the undefined bit is ignored.
Boundary
A boundary defines data from an address divisible by a selected value. For example, data for a
20H-byte boundary is defined at addresses beginning from 20H, 40H, and so on. A word is a
2-byte boundary.
Address
All addresses defined by VDP2 are relative addresses within VDP2. The first address of VDP2
begins from 5E00000H. For example, VRAM is at 000000H address of the relative address, and
begins from 5E00000H address of the absolute address. The TV screen mode register is at
180000H address of the relative address, and is set at address 5F80000H of the absolute address.
i
Manual Structure
ii
Table 2. Functions, their chapters and sections
iv
Table 2. Functions, their chapters and sections (continued)
v
Table of Contents
Preface ............................................................................................................................ i
Manual Notation .................................................................................................. i
Manual Structure ............................................................................................... iii
List of Figures................................................................................................................ xi
List of Tables ............................................................................................................... xiv
vi
VRAM Cycle Pattern Register .............................................................. 39
3.4 Color RAM Mode ........................................................................................ 43
RAM Control Register .......................................................................... 45
vii
Chapter 5 Normal Scroll Screen ............................................................................... 121
Introduction..................................................................................................... 122
5.1 Screen Scroll Function ............................................................................. 122
Screen Scroll Value Register .............................................................. 123
5.2 Expansion/Contraction Function .............................................................. 126
Coordinate Increment Register .......................................................... 127
Reduction Enable Register ................................................................. 129
5.3 Line and Vertical Cell Scroll Function ....................................................... 131
Line Scroll Function ............................................................................131
Vertical Cell Scroll Function ................................................................ 134
Line and Vertical Cell Scroll Control Register..................................... 137
Line Scroll Table Address Register ..................................................... 140
Vertical Cell Scroll Table Address Register ........................................ 141
viii
Sprite Control Register ....................................................................... 188
Window’s Active Area for the Screen.................................................. 189
8.2 Window Process .......................................................................................190
Window Control Register .................................................................... 193
ix
Chapter 13 Color Offset Function ............................................................................. 249
Introduction..................................................................................................... 250
13.1 Color Offset Selection ............................................................................250
Color Offset Enable Register .............................................................. 251
Color Offset Select Register ............................................................... 252
Color Offset Register .......................................................................... 253
x
Table of Figures
Chapter 2 TV Screen
Figure 2.1 Display Method by Interlace Setting ............................................... 14
Figure 2.2 TV Screen Structure........................................................................ 15
Chapter 3 RAM
Figure 3.1 Different Capacities of VRAM Address Map ................................... 27
Figure 3.2 VRAM Cycle Pattern Register ......................................................... 32
Figure 3.3 Access Selection Limits of Pattern Name Table Data ..................... 33
Figure 3.4 Example of Character Pattern Data Read Access
Selection ......................................................................................... 34
Figure 3.5 Access Select Limits of Vertical Cell Scroll Table Data ................... 35
Figure 3.6 CPU Read/Write Access Selection when
VRAM is not Divided into Two Bank ............................................... 36
Figure 3.7 CPU Read/Write Access Selection when
VRAM is Divided into Two Banks ................................................... 37
Figure 3.8 VRAM Cycle Pattern Selection ....................................................... 39
Figure 3.9 Color Data Configuration on Color RAM ......................................... 44
Figure 3.10 Color Data of the Color RAM ........................................................ 45
xi
Chapter 5 Normal Scroll Screen
Figure 5.1 Screen Scroll Value Bit Configuration ........................................... 122
Figure 5.2 Configuration of Coordinate Increment Register........................... 126
Figure 5.3 Line Scroll Function ...................................................................... 131
Figure 5.4 Bit Configuration of Line Scroll Table Data ................................... 132
Figure 5.5 Line Scroll Table ............................................................................133
Figure 5.6 Vertical Cell Scroll Function .......................................................... 134
Figure 5.7 Data Configuration on Vertical Cell Scroll Table ........................... 135
Figure 5.8 Vertical Cell Scroll Table................................................................ 136
Chapter 8 Windows
Figure 8.1 Normal Rectangle Window ........................................................... 180
Figure 8.2 Normal Line Window ..................................................................... 184
Figure 8.3 Bit Configuration of Normal Line Window Table Data ................... 184
Figure 8.4 Configuration of Normal Line Window Table ................................. 185
Figure 8.5 Sprite Window ............................................................................... 187
Figure 8.6 Active Area of Windows ................................................................ 189
Figure 8.7 Window Process ........................................................................... 191
xii
Chapter 11 Priority Function
Figure 11.1 Priority Function .......................................................................... 224
Figure 11.2 Line Color Screen Insertion ......................................................... 230
xiii
List of Tables
Chapter 2 TV Screen
Table 2.1 TV Screen Mode ............................................................................... 12
Table 2.2 Register for Setting the External Screen .......................................... 21
Table 2.3 H Counter Register Bit Content ........................................................ 24
Table 2.4 V Counter Register Bit Content ........................................................ 24
Chapter 3 RAM
Table 3.1 Data Defined in VRAM ..................................................................... 26
Table 3.2 Access Numbers of Required Pattern Name Table Data
during 1 Cycle .................................................................................. 33
Table 3.3 Character Pattern Data (Bit Map Pattern Data)
Read Access Number ...................................................................... 34
Table 3.4 Character Pattern Data Read Access Selection Limits .................... 34
Table 3.5 Access Command .............................................................................40
xiv
Chapter 8 Windows
Table 8.1 Bit Content of Window Position Register for Horizontal
Coordinates. .................................................................................... 182
Table 8.2 Bit Content of Window Position Register for Vertical
Coordinates. .................................................................................... 183
xv
Chapter 1 VDP2 Functions
Introduction .......................................................... 2
1.1 System Configuration .................................. 2
1.2 Address Map ............................................... 3
VRAM .................................................... 3
Color RAM ............................................. 3
Register ................................................. 4
1.3 Scroll Function ............................................ 5
Display Screen ...................................... 5
Scroll Screen ......................................... 6
Line Screen .......................................... 7
Windows .......................................... 7
1.4 Priority Function .......................................... 8
Priority Function .................................... 8
Color Calculation Function .................... 8
Color Offset Function ............................ 8
Shadow Function ................................... 9
ST-58-R2 1
Introduction
VDP2 has a scroll and priority function. The scroll function defines the scroll screen,
moves the screen up, down, right, left, and rotates the screen. The priority function
prioritizes the display of multiple scroll screens, sprites, and external screens. It also
processes the images in operations such as color calculation and color offset.
VDP2 is connected to 4 Mbit or 8 Mbit VRAM and contains 32K bits of color RAM.
Image data is defined in the VRAM and color RAM from the CPU via the SCU.
Image display controlling information is set by each register in the same way. Data
defined by VRAM is read according to the setting of the register, then becomes the
image data of each scroll screen. Image data of each scroll screen and sprite image
data received from VDP1, as well as the external image data received from outside,
become image display data. Display priority is decided by the register setting.
When display image data is in a palette format, color data defined in the color RAM
according to that value is read and displayed. When display image data is in the
RGB format, it is shown as is. In this way, the acquired display color data is output
to the display device. The VDP2 system configuration is shown in Figure 1.1.
External Screen
VDP1 Circuitry
(OPTION)
VDP2
Register
CPU SCU Display Device
Color RAM
VRAM
2
1.2 Address Map
In order to define pattern name tables and character pattern data, VDP2 is connected
to two VRAMs. VDP2 contains 32K bits of color RAM for defining color data, and
together with internal registers control VRAM. Figure 1.2 shows VDP2 controlled
VRAM, color RAM, and register address maps.
000000H
VRAM
0FFFFFH
100000H
COLOR-RAM
17FFFFH
180000H
REGISTER
1BFFFFH
VRAM
VRAM stores scroll screen image data and data tables needed in each function.
Read access by VDP2 is always given priority over read/write access through the
CPU or DMA controller. Consequently, the wait cycle enters the CPU or DMA
controller through the access timing. Access through the CPU or DMA controller is
possible in units of byte, word, and long word.
Color RAM
Color RAM stores color data of sprites and scroll screens. It also defines the enable
bit of the color calculation function as it applies to the most significant bit when
necessary. Read/write access from the CPU or DMA controller is possible, but the
image may be disturbed by the access timing. Access through the CPU or DMA
controller is possible only in word units and long word units. Access in bytes is not
allowed.
ST-58-R2 3
Register
Registers set each VDP2 function. Because the values of most registers are cleared to
0 after power on or reset, the values must be set. Read/write access from the CPU or
DMA controller is always possible, but the image may be poor due to the access
timing. Access by the CPU or DMA controller is possible only in word units and
long word units. Access in bytes is not allowed.
4
1.3 Scroll Function
Display Screen
The TV screen mode has the following characteristics.
The scroll screen which can be displayed has the following characteristics.
ST-58-R2 5
The following windows exist:
Scroll Screen
The functions of the scroll screen are listed in the table below.
Note: *There are 2048 colors when the color RAM is in mode 1, and 1024 colors when in mode
0 or 2.
Normal scroll screen changes the number of screens that can be displayed through
each setting.
6
The normal scroll screen can be displayed simultaneously with one rotation scroll
screen. If two rotation scroll screens are displayed, the normal scroll screen cannot
be displayed (the register that sets RBG1 is used for NBG0). When an external input
screen is displayed, NBG1 cannot be displayed. The register setting the external
input screen can be used for NBG1.
Line Screen
The line color screen works for color calculation and on other screens. It can indicate
whether the entire screen consists of one color, or if there is a color for each line, but
it cannot display characters.
The back screen is displayed when all other screens are transparent. The entire
screen is displayed in one color, or a color can be selected for each line, but charac-
ters cannot be displayed.
Windows
A rectangular window can be selected by using the two screen coordinate value
points in the upper left and lower right corners of a normal window. The sprite
window is a window based on sprite characters. There are three types of windows
that can be used and stacked individually for each screen: the “transparent control
window” designates the transparent area; the “color calculation window” designates
the area in which color calculation is not performed; the “rotation parameter win-
dow” changes screens by two rotation parameters.
ST-58-R2 7
1.4 Priority Function
There are four types of VDP2 priority functions: priority function, color calculation
function, color offset function, and shadow function.
Priority Function
The display priority of the sprite and scroll screen is decided by a 3-bit priority
number. The sprite priority number can be set at a maximum value of 8, one of
which is designated by character units. The scroll screen priority number is usually
designated by surface units. When the special priority function is used, character
units and dot units can change the scroll screen priority number.
8
Shadow Function
The shadow function adds shadow to the shapes of sprite characters on each screen.
There are two types of sprite shadow: normal shadow by data, and MSB shadow.
The normal shadow can only add a shadow to the scroll screen. The MSB shadow
can add a shadow to scroll screens and to sprites.
ST-58-R2 9
(This page was blank in the original Japanese document.)
10
Chapter 2 TV Screen
ST-58-R2 11
2.1 TV Screen Mode
VDP2 can display images in 31 kHz monitors as well as high-vision monitors, and in
NTSC and PAL standards for TV. There are three kinds of image displaying TV
screen modes: normal, high-resolution, and special monitor. Screen scan format can
be selected from three types: non-interlace, single-density interlace, and double-
density interlace. A register showing TV scan conditions is also provided.
Table 2.1 shows the TV screen modes that are selectable, the graphics mode, and the
current resolution. Furthermore, special settings are required when indicating
special high-resolution graphics A and special high-resolution graphics B.
12
Special High-Resolution Graphics Mode
The graphics mode of special high-resolution graphics A or B displays one screen by
joining the NBG0 and NBG1 screens. If the following setting is not performed, the
display will not appear correctly.
ST-58-R2 13
2.2 Interlace Mode
● No n- Inter lace Mo de
●
Å Doub le Den sit y Inter lace Mo de
Sca nn in g occu rs i n ea ch o dd an d even field ,
ho weve r, sin ce di fferent pi ctures are di spl ayed ,
the ve rtica l resol ution wil l b e d ou bl e tha t i n the
Non -Interlace mod e.
1 frame p er 2 fiel ds (1/30 se c.)
14
2.3 TV Screen Structure
Hor izo nt al Tr acin g Ho rizo nt al Disp lay Hor izon tal Tra ci ng
Per iod Per iod Per iod
Boar de rA re a
ST-58-R2 15
2.4 TV Screen Mode Register
The TV screen mode register controls the TV screen display. It is a read/write 16 bit
register and is at address 180000H. After the power on or reset, the value is cleared
to 0 and therefore must be set.
15 14 13 12 11 10 9 8
TVMD DISP ~ ~ ~ ~ ~ ~ BDCLMD
180000H 7 6 5 4 3 2 1 0
LSMD1 LSMD0 VRESO1 VRESO0 ~ HRESO2 HRESO1 HRESO0
Because it is in the blank condition during the display interval when this bit is 0, the
VRAM can be accessed from the CPU or DMA controller at any time. The colors
displayed when this bit is 0 are selected by the BDCLMD bit. Please make sure to
change this bit from 0 to 1 during V blank.
Selects colors of all the standard display areas when the DISP bit is 0. However, after
the power on or reset, if this bit is set to 1 without setting DISP bit to 1 even once, the
back screen will not be correctly displayed. When the setting allows the back screen
selection by line, the color displayed in the border area will become the same color
as the lowermost line in the display area.
16
• Interlace mode bit (LSMD1, LSMD0) bits 7 and 6
Designates the interlace mode.
LSMD1 LSMD0 Process
0 0 Non-Interlace
0 1 Setting not allowed
1 0 Single-density interlace
1 1 Double-density interlace
Single-density interlace is a mode that shows the same pictures in odd and even
fields; double-density interlace is a mode that shows different pictures in odd and
even fields. In either case, the spaces between scan lines are not vacant. The vertical
resolution for double-density interlace is twice that of non-interlace, but the vertical
resolution of the actual picture for single-density interlace is the same for non-
interlace. Pictures displayed in double-density interlace are vertically half the size
of pictures displayed in single-density interlace or non-interlace. When the horizon-
tal resolution (HRESO2 to HRESO0) setting is in the exclusive monitor mode, make
sure to select the noninterlaced mode (00B).
Increments when vertical resolution is increased, then are added to the top and
bottom of the screen without changing the screen’s center. When set in the special
monitor mode, the horizontal resolution (HRESO2 to HRESO0) is set to 480 lines.
Settings of this bit are ignored.
ST-58-R2 17
• Horizontal resolution bit (HRESO2 to HRESO0), bit 2 to 0
Selects the horizontal resolution when a picture is displayed on the TV screen.
HRESO2 HRESO1 HRESO0 Horizontal Graphic Mode Display
Resolution Monitor
0 0 0 320 Pixels Normal
Graphic A
0 0 1 352 Pixels Normal NTSC
Graphic B Format or
0 1 0 640 Pixels Hi-Res PAL
Graphic A Format TV
0 1 1 704 Pixels Hi-Res
Graphic B
1 0 0 320 Pixels Exclusive Normal 31kHz Monitor
Graphic A
1 0 1 352 Pixels Exclusive Normal Hi-Vision Monitor
Graphic B
1 1 0 640 Pixels Exclusive Normal 31kHz Monitor
Graphic A
1 1 1 704 Pixels Exclusive Normal Hi-Vision Monitor
Graphic B
18
2.5 External Signals and Scan Conditions
The register controlling external signals has an external signal enable register. The
register displaying TV scan conditions has a screen status register, H counter regis-
ter, and V counter register.
When synchronizing with other devices and screen displays, set to 1 and input an
EXSYNC signal. The normal setting is 0.
ST-58-R2 19
DASEL Process
0 Displays screen image only in the set display area
1 Displays screen in the standard display area
When displaying the entire standard display area, images from external screen data
are displayed correctly. Images not in set display areas (sprite, scroll screen, etc.)
need to be made transparent using a window because they are not displayed cor-
rectly.
Because the data becomes NBG1 screen data when inputting external screen data,
the external screen settings are used for NBG1 as well. Table 2.2 shows the register
bit for setting the external screen.
20
Table 2.2 Register for setting the external screen
Address Bit Number Bit Name
180020H 9 N1TPON Transparent display enable
180028H 13,12 N1CHCN1, N1CHCN0 Character Color Count
8 N1W0A W0 window area
9 N1W0E W0 window enable
10 N1W1A W1 window area
1800D0H 11 N1W1E W1 window enable
12 N1SWA SW window area
13 N1SWE SW window enable
15 N1LOG Window logic
1800E2H 1 N1SDEN Shadow enable
1800E4H 6~4 N1CAOS2~N1CAOS0 Color RAM address offset
1800E8H 1 N1LCEN Line color screen insertion enable
1800EAH 3,2 N1SPRM1, N1SPRM0 Special priority mode
1800ECH 1 N1CCEN Color calculation enable
1800EEH 3,2 N1SCCM, N1SCCM0 Special color calculation mode
1800F8H 10~8 N1PRIN2~N1PRIN0 Priority number
180118H 12~8 N1CCRT4~N1CCRT0 Color Calculation Ratio
180110H 1 N1COEN Color offset enable
180112H 1 N1COSL Color offset select
ST-58-R2 21
• External latch flag (EXLTFG), bit 9
Through external signals, this displays whether the HV counter value is latched to
the HV counter register. Clears to 0 when the screen status register reads out.
EXLTFG HV Counter Value Status
0 Not latched in register
1 Latched in register
22
• Scan Field Flag : Odd/even field flag (ODD), bit 1
Scan conditions are shown when the TV screen mode is the interlace mode. The
non-interlace mode is always 1.
ODD Display
0 During even field scan
1 During odd field scan
H Counter Register
The H counter register shows the H counter value. This read exclusive 16-bit regis-
ter is at address 180008H.
15 14 13 12 11 10 9 8
HCNT ~ ~ ~ ~ ~ ~ HCT9 HCT8
180008H 7 6 5 4 3 2 1 0
HCT7 HCT6 HCT5 HCT4 HCT3 HCT2 HCT1 HCT0
ST-58-R2 23
Table 2.3 H counter register bit content
Graphic HCT9 HCT8 HCT7 HCT6 HCT5 HCT4 HCT3 HCT2 HCT1 HCT0
Mode
Normal H8 H7 H6 H5 H4 H3 H2 H1 H0 Invalid
Hi-Res H9 H8 H7 H6 H5 H4 H3 H2 H1 H0
Exclusive Invalid H8 H7 H6 H5 H4 H3 H2 H1 H0
Normal
Exclusive Invalid H9 H8 H7 H6 H5 H4 H3 H2 H1
Hi-Res
V Counter Register
The V counter register shows the V counter value. This read exclusive 16-bit register
is at address 18000AH.
15 14 13 12 11 10 9 8
VCNT ~ ~ ~ ~ ~ ~ VCT9 VCT8
18000AH 7 6 5 4 3 2 1 0
VCT7 VCT6 VCT5 VCT4 VCT3 VCT2 VCT1 VCT0
24
Chapter 3 RAM
Introduction...................................................................... 26
3.1 Address Map ............................................................. 26
VRAM Size Register ............................................... 28
3.2 VRAM Bank Partitioning ............................................ 29
RAM Control Register ............................................ 29
3.3 Accessing VRAM During Display Interval ................. 31
VRAM Access During Display Interval ................... 31
Image Data Access ................................................ 32
Vertical Cell Scroll Table Data Access .................... 35
Read/Write Access by the CPU .............................. 35
VRAM Cycle Pattern Selection Process................. 37
VRAM Cycle Pattern Register ................................ 39
3.4 Color RAM Mode ....................................................... 43
RAM Control Register ............................................ 45
ST-58-R2 25
Introduction
VDP2 is connected to special VRAM for defining pattern name tables, character
patterns, and so on. VRAM has two divisions called VRAM-A and VRAM-B, each
having equal capacity. VRAM-A and VRAM-B can each be divided into two banks,
called bank 0 and bank 1. Banks divided with four equal capacities are called
VRAM-A0, VRAM-A1, VRAM-B0, and VRAM-B1. VRAM data is defined in table
3.1. Also contained is color RAM for defining the color data of scroll screens and
sprites.
VDP2 can be applied to two types of VRAM: 4 Mbit and 8 Mbit. Programs created
for systems using a 4 Mbit VRAM can also be used in systems using 8 Mbit VRAM,
but programs created for systems using an 8 Mbit VRAM cannot be used in systems
using 4 Mbit VRAM.
26
The address map changes according to VRAM capacity being used in the system, as
shown in Figure 3.1.
000000H
VRAM-A0
01FFFFH
020000H
VRAM-A1
03FFFFH
040000H
VRAM-B0
05FFFFH
060000H
VRAM-B1
07FFFFH
000000H
VRAM-A0
03FFFFH
040000H
VRAM-A1
07FFFFH
080000H
VRAM-B0
0BFFFFH
0C0000H
VRAM-B1
0FFFFFH
ST-58-R2 27
VRAM Size Register
The VRAM size register indicates the VRAM capacity to be used in the system. It is
a read/write 16-bit register and is at the 180006H address. Bits 3 to 0 are exclusively
for read only. Because the value of bit15 (VRAMSZ) is cleared to 0 after the power is
turned on or reset, it must be reset.
15 14 13 12 11 10 9 8
VRSIZE VRAMSZ ~ ~ ~ ~ ~ ~ ~
180006H 7 6 5 4 3 2 1 0
~ ~ ~ ~ VER3 VER2 VER1 VER0
28
3.2 VRAM Bank Partitioning
VDP2 can access VRAM-A0, VRAM-A1, VRAM-B0, and VRAM-B1 at the same time
when both VRAM-A and VRAM-B are divided in half. As a result, more image data
can be obtained at once, a higher number of scroll screens can be displayed simulta-
neously, and a screen with multiple colors can be displayed. However, there are
limitations when selecting of VRAM read/write access through the CPU during the
display. Therefore, don’t partition the VRAM into two areas when accessing (read/
write) through the CPU during the display. Normally, accessing can be efficiently
done if divided into two areas.
ST-58-R2 29
VRxMD Process
0 Do not partition in 2 banks
1 Partition in 2 banks
Rotation Data Bank Select bit: RBG0 DataBank Select Bit (RDBSA00 to RDBSB11), Bits 7 to 0
See “6.2 Rotation Scroll Screen Display Control”.
When the CRKTE bit is 1, do not designate to allow the 4 banks of VRAM to be used
as RAM for the coefficient table data.
30
3.3 Accessing VRAM During Display Interval
VRAM Access During Display Interval
VDP2 synchronizes scroll screen data with the TV scan and displays them while
reading from VRAM. VRAM access during display repeats the cycle as four or eight
access operating units (1 cycle). When the TV screen mode is the Normal mode, 1
cycle accesses eight times. Also, 1 cycle is accessed four times when in the high-
resolution or special monitor mode. Below are the ten types of VRAM accesses
performed in one cycle:
The timing during the 1 cycle when the above (1) through (5) are performed must be
selected for each bank of VRAM-A0, VRAM-A1, VRAM-B0, and VRAM-B1. This
selection is performed by writing the values of 4 bits, called access commands, to the
VRAM cycle pattern register. Access Commands correspond to the several types of
VRAM access.
Each VRAM access in the above items (6) through (8) occupies a full one cycle,
therefore, for one bank only one type may be selected. This is accomplished by
writing the value corresponding to each VRAM access type to the RAM control
register rotation data bank select bit. The setting of the bank VRAM cycle pattern
register, which select (6) through (8) VRAM access, will become invalid.
Each VRAM access in the above items (9) and (10) occupies a full one cycle. (9) is
fixed in VRAM-B1 and (10) in VRAM-B0. While items (9) and (10) are selected auto-
matically with the display of RGB1, the setting of the VRAM-B0 and VRAM-B1
VRAM cycle pattern registers will become invalid.
ST-58-R2 31
The VRAM cycle pattern register has registers that correspond to the following
banks: VRAM-A0, VRAM-A1, VRAM-B0, VRAM-B1. When the VRAM is not di-
vided into two partitions, the VRAM-A0 register is used for VRAM-A, and the
VRAM-B0 register is used for VRAM-B. Registers for VRAM-A1 and VRAM-B1 are
not used. Registers that correspond to the various banks are separated into eight (T0
to T7) access timings. Access is performed in order, beginning from VRAM access,
showing the access command selected in the T0 bit. T0 to T7 are in effect when the
TV screen is in Normal mode, but only T0 to T3 are in effect for the high-resolution
or special monitor mode; T4 to T7 are ignored. Figure 3.2 shows the VRAM cycle
pattern register used during 1 cycle.
T0 T1 T2 T3 T4 T5 T6 T7
Fo r VRAM-A0 (o r VRAM-A )
For VRAM-A 1
Fo r VRAM-B0 (o r VRAM-B )
For VRAM-B 1
Be sure to set “do not access” for the remaining access time after selecting the VRAM
access required in the display. If the VRAM access address selected in the VRAM
cycle pattern register is not the address in the selected bank, access won’t be done
and the correct screen will not be displayed.
32
Pattern name data read access during 1 cycle must be set to a maximum of two
banks, one being either VRAM-A0 or VRAM-B0, and the other being VRAM-A1 or
VRAM-B1. When the VRAM is not divided into two partitions, the VRAM-A0
register is used as VRAM-A, and the VRAM-B0 register is used as VRAM-B; there-
fore, one or the other must be set. Any access timing may be selected if within the
register’s effective range in all TV screen modes. The access number must be the
same as the number as determined by conditions, but the related timing does not
need to be selected.
The pattern name data read access number is shown in Table 3.2. The pattern name
data read access selection limits are shown in Figure 3.3.
Table 3.2 Access numbers of required pattern name table data during 1 cycle
Item NBG0~NBG3
Reduction setting x1 x1/2 x1/4
Number of VRAM 1 2 4
accesses required
during 1 cycle
T0 T1 T2 T3 T4 T5 T6 T7
Only on e
can be For VRA M- A0 (or VRAM- A)
sel ect ed
For VRAM-A 1
As a rule, the character pattern data read access during 1 cycle can select any timing
from four banks. However, the timing that can be selected through pattern name
data access timing is limited. Only when the pattern name data access of NBG0 and
NBG1 are selected in T0 can select various character pattern data read accesses
through the timings of any of the four banks be selected with are no limits. The
access number must be selected so that it is the same as the number as determined
by the conditions. The related timing does not need to be selected. Character pattern
data read access numbers are shown in Table 3.3. Character pattern data read access
selection limits are shown in Table 3.4.
ST-58-R2 33
Table 3.3 Character pattern data (bit map pattern data) read access number
Item NBG0~NBG3
32,768 16,770,000
Character 16 256 2048
Color Count
Reduction 1 1/2 1/4 1 1/2 1 1 1
setting
Number of 1 2 4 2 4 4 4 8
VRAM
accesses
required
during 1 cycle
When the reduction setting is one, all of the character pattern data read access must
observe selection limits if the character pattern data read access is to be two or
greater. If the reduction setting is 1/2 or 1/4, the required access number when the
reduction setting is 1 (one time for 16 colors and two times for 256 colors) must
observe selection limits through one time pattern name data read access. Figure 3.4
shows character pattern data read access selection limits when the pattern name
data read access is selected in T1 and T3, with 256 colors and 1/2 reduction.
T0 T1 T2 T3 T4 T5 T6 T7
For VRA M- A1
For VRA M- B1
T1 's Pat ter n Na me Dat a Read Access with re spe ct to se le ct ab le ran ge (T0~ T3, T5~T 7)
T3 's Pat ter n Na me Dat a Read Access with re spe ct to se le ct ab le ran ge (T0~ T3, T7)
Not e: Ch ar act er Pattern Dat a Rea d Acce ss must be sel ect ed twice in each se le ct ab le
ran ge.
34
Vertical Cell Scroll Table Data Access
When using the vertical cell scroll function in NBG0 and NBG1 {Translator’s Note:
The original document reads NB1, we believe this is an error.}, vertical cell scroll table
data must also be read.
Vertical cell scroll table data read access must be performed for one surface during 1
cycle. Vertical cell scroll table data read access for NBG0 must be selected in T0 or
T1 timing. NBG1 vertical cell scroll table data read access must be selected within
the timing of T0 to T2. Also, access for NBG0 and NBG1 must be by the same bank
and NBG0 access must be selected first.
When specifying the same vertical cell scroll table data read access against multiple
banks, make sure to specify the same access timing.
Figure 3.5 shows access selection limits of vertical cell scroll table data.
T0 T1 T2 T3 T4 T5 T6 T7
For VRAM-A 1
For VRAM-B 1
NBG0 ver tical scr oll tabl e acce ss sel ect ab le ran ge (T0 , T1)
NBG1 ver tical scr oll tabl e acce ss sel ect ab le ran ge (T0 ~T2 )
Not e: For NB G0 and NBG1 access timing , NBG0 access must be first sel ect ed in
the sa me bank.
Figure 3.5 Access select limits of vertical cell scroll table data
ST-58-R2 35
VRAM access by the CPU can be selected only in units of access to VRAM-A or
VRAM-B, and can not be selected in bank units.
When selecting VRAM access by the CPU for the VRAM without two partitions, you
should select the CPU read/write access command in the VRAM cycle pattern
register of the timing performing the access. Selecting an access command that does
not access in place of the CPU read/write access command is the same as before. In
the screen display enable register, when the access command (pattern name data
read, character pattern data read, or bit map pattern data read) used for a screen not
set to be displayed is also set, it becomes the CPU read/write access. See “4.1 Screen
Display Control” about the screen display enable register.
When selecting an access command for not to access or CPU read/write with respect
to every access timing of the VRAM that is not partitioned into two areas, the CPU
access will then be always allowed during display period. This allows to use one of
the VRAMs as an auxiliary work RAM. In addition, by switching the VRAM used in
the image display as a frame buffer, the image can be displayed while being rewrit-
ten at a high speed.
Figure 3.6 illustrates the VRAM cycle pattern register selection if CPU read/write
access is being performed in T2 and T4 when VRAM-A is not partitioned.
T2 T3 T4 T5
O the r
CPU Read / No O the r VRAM Cycle Pattern
Access
Wri te Access Access Regi st er f or VRAM-A
Comm an ds Comm an ds
Figure 3.6 CPU Read/Write Access Selection when VRAM is not Divided into Two Bank
When setting the CPU read/write access for the VRAM that is partitioned into two
areas, the CPU read/write access command must be set in the VRAM cycle pattern
register of both bank 0 and bank 1 of the timing performing access. Further, in the
registers of both bank 0 and bank 1 of the timing before the set CPU read/write
access command timing, the access command that won’t access must be selected.
However, when selecting CPU read/write access in linked timing, only the timing
before the lead of the linked access timing may be selected.
Figure 3.7 illustrates the selection of the VRAM cycle pattern register when perform-
ing CPU read/write access linked to T4 and T5 while VRAM-B is divided into two
partitions.
36
T3 T4 T5 T6
CPU Re ad / Othe r
CP U Re ad / Access VRA M Cycl e pa ttern Reg ist er
NoA ccess Writ e Wr ti e Comm an ds for VRAM-B1
Figure 3.7 CPU Read/Write Access Selection when VRAM is Divided into Two Banks
ST-58-R2 37
An example of VRAM cycle pattern register selection is shown in Figure 3.8.
<Condition>
Screen Name Pattern Name Character Pattern Vertical Cell Scroll Table
NBG0 A0 B0,B1 -
NBG3 A1 A1,B0 -
N1CE N0PN N1PN N0PN NA CPU CPU NA For VRAM-A0 (or VRAM-A)
N0CG N0CG N1CG N1CG NA N0CG N0CG N3CG For VRAM-B0 (or VRAM-B)
N0PN : Pattern name data read for NBG0, N0CG : Character pattern Data Read for NBG
N1PN : Pattern name data read for NBG1, N1CG : Character pattern Data Read for NBG
N3PN : Pattern name data read for NBG3, N3CG : Character pattern Data Read for NBG
N1CE: NBG1 vertical cell scroll table data read, CPU : CPU Read/Write
NA : No access
38
VRAM Cycle Pattern Register
The VRAM cycle pattern register controls the VRAM access during the display
interval. It is a 16-bit write only register with addresses from 180010H to 18001EH.
Because the value is cleared to 0 after the power is turned on or reset, it must be
reset.
15 14 13 12 11 10 9 8
CYCA0L VCP0A03 VCP0A02 VCP0A01 VCP0A00 VCP1A03 VCP1A02 VCP1A01 VCP1A00
180010H 7 6 5 4 3 2 1 0
VCP2A03 VCP2A02 VCP2A01 VCP2A00 VCP3A03 VCP3A02 VCP3A01 VCP3A00
15 14 13 12 11 10 9 8
CYCA0U VCP4A03 VCP4A02 VCP4A01 VCP4A00 VCP5A03 VCP5A02 VCP5A01 VCP5A00
180012H 7 6 5 4 3 2 1 0
VCP6A03 VCP6A02 VCP6A01 VCP6A00 VCP7A03 VCP7A02 VCP7A01 VCP7A00
15 14 13 12 11 10 9 8
CYCA1L VCP0A13 VCP0A12 VCP0A11 VCP0A10 VCP1A13 VCP1A12 VCP1A11 VCP1A10
180014H 7 6 5 4 3 2 1 0
VCP2A13 VCP2A12 VCP2A11 VCP2A10 VCP3A13 VCP3A12 VCP3A11 VCP3A10
15 14 13 12 11 10 9 8
CYCA1U VCP4A13 VCP4A12 VCP4A11 VCP4A10 VCP5A13 VCP5A12 VCP5A11 VCP5A10
180016H 7 6 5 4 3 2 1 0
VCP6A13 VCP6A12 VCP6A11 VCP6A10 VCP7A13 VCP7A12 VCP7A11 VCP7A10
15 14 13 12 11 10 9 8
CYCB0L VCP0B03 VCP0B02 VCP0B01 VCP0B00 VCP1B03 VCP1B02 VCP1B01 VCP1B00
180018H 7 6 5 4 3 2 1 0
VCP2B03 VCP2B02 VCP2B01 VCP2B00 VCP3B03 VCP3B02 VCP3B01 VCP3B00
15 14 13 12 11 10 9 8
CYCB0U VCP4B03 VCP4B02 VCP4B01 VCP4B00 VCP5B03 VCP5B02 VCP5B01 VCP5B00
18001AH 7 6 5 4 3 2 1 0
VCP6B03 VCP6B02 VCP6B01 VCP6B00 VCP7B03 VCP7B02 VCP7B01 VCP7B00
15 14 13 12 11 10 9 8
CYCB1L VCP0B13 VCP0B12 VCP0B11 VCP0B10 VCP1B13 VCP1B12 VCP1B11 VCP1B10
18001CH 7 6 5 4 3 2 1 0
VCP2B13 VCP2B12 VCP2B11 VCP2B10 VCP3B13 VCP3B12 VCP3B11 VCP3B10
15 14 13 12 11 10 9 8
CYCB1U VCP4B13 VCP4B12 VCP4B11 VCP4B10 VCP5B13 VCP5B12 VCP5B11 VCP5B10
18001EH 7 6 5 4 3 2 1 0
VCP6B13 VCP6B12 VCP6B11 VCP6B10 VCP7B13 VCP7B12 VCP7B11 VCP7B10
ST-58-R2 39
Table 3.5 shows access command that corresponds to the content of the VRAM
access during 1 cycle.
VRAM cycle pattern (for VRAM-A0) bit: VRAM cycle pattern bit (VCP0A00 to VCP0A03,
VCP1A00 to VCP1A03, VCP2A00 to VCP2A03, VCP3A00 to VCP3A03, VCP4A00 to VCP4A03,
VCP5A00 to VCP5A03, VCP6A00 to VCP6A03, VCP7A00 to VCP7A03)
Sets the access command of VRAM access that performs in VRAM-A0 (or VRAM-A)
timing T0 to T7.
40
VCP0A00~VCP0A03 180010H Bit 12~15 VRAM-A0 (or VRAM-A) Timing for T0
VCP1A00~VCP1A03 180010H Bit 8~11 VRAM-A0 (or VRAM-A) Timing for T1
VCP2A00~VCP2A03 180010H Bit 4~7 VRAM-A0 (or VRAM-A) Timing for T2
VCP3A00~VCP3A03 180010H Bit 0~3 VRAM-A0 (or VRAM-A) Timing for T3
VCP4A00~VCP4A03 180012H Bit 12~15 VRAM-A0 (or VRAM-A) Timing for T4
VCP5A00~VCP5A03 180012H Bit 8~11 VRAM-A0 (or VRAM-A) Timing for T5
VCP6A00~VCP6A03 180012H Bit 4~7 VRAM-A0 (or VRAM-A) Timing for T6
VCP7A00~VCP7A03 180012H Bit 0~3 VRAM-A0 (or VRAM-A) Timing for T7
VRAM cycle pattern (for VRAM-A1) bit: VRAM cycle pattern bit (VCP0A10 to VCP0A13,
VCP1A10 to VCP1A13, VCP2A10 to VCP2A13, VCP3A10 to VCP3A13, VCP4A10 to VCP4A13,
VCP5A10 to VCP5A13, VCP6A10 to VCP6A13, VCP7A10 to VCP7A13)
Sets the access command of the VRAM access that performs in VRAM-A1 timing T0
to T7.
When VRAM is not partitioned in two, the value of this register is ignored.
VRAM cycle pattern (for VRAM-B0) bit: VRAM cycle pattern bit (VCP0B00 to VCP0B03,
VCP1B00 to VCP1B03, VCP2B00 to VCP2B03, VCP3B00 to VCP3B03, VCP4B00 to VCP4B03,
VCP5B00 to VCP5B03, VCP6B00 to VCP6B03, VCP7B00 to VCP7B03)
Sets the access command of VRAM access that performs in VRAM-B0 (or VRAM-B)
timing T0 to T7.
ST-58-R2 41
VCP0B00~VCP0B03 180018H Bit 12~15 VRAM-B0 (or VRAM-B) Timing for T0
VCP1B00~VCP1B03 180018H Bit 8~11 VRAM-B0 (or VRAM-B) Timing for T1
VCP2B00~VCP2B03 180018H Bit 4~7 VRAM-B0 (or VRAM-B) Timing for T2
VCP3B00~VCP3B03 180018H Bit 0~3 VRAM-B0 (or VRAM-B) Timing for T3
VCP4B00~VCP4B03 18001AH Bit 12~15 VRAM-B0 (or VRAM-B) Timing for T4
VCP5B00~VCP5B03 18001AH Bit 8~11 VRAM-B0 (or VRAM-B) Timing for T5
VCP6B00~VCP6B03 18001AH Bit 4~7 VRAM-B0 (or VRAM-B) Timing for T6
VCP7B00~VCP7B03 18001AH Bit 0~3 VRAM-B0 (or VRAM-B) Timing for T7
VRAM cycle pattern (for VRAM-B1) bit: VRAM cycle pattern bit (VCP0B10 to VCP0B13,
VCP1B10 to VCP1B13, VCP2B10 to VCP2B13, VCP3B10 to VCP3B13, VCP4B10 to VCP4B13,
VCP5B10 to VCP5B13, VCP6B10 to VCP6B13, VCP7B10 to VCP7B13).
Sets the access command of VRAM access that performs in VRAM-B1 timing T0 to
T7.
When VRAM is not partitioned into two areas, the value of this register is ignored.
42
3.4 Color RAM Mode
With 32 Kbits (2 Kword) of color RAM, color data that is stored is used for all scroll
screens and palette format sprites. The color data selects and stores either RGB-5 bit
(15 bit data) or RGB-8 bit (24 bit data). In addition, when dividing it into 16K bits
(1K word) and storing various color data of the same type, the expansion color
calculation function can also be used. There are three methods for storing color data
in color RAM:
(1) Mode 0: RGB in each of 5 bits for a total of 15 bits, 1024 color settings
(2) Mode 1: RGB in each of 5 bits for a total of 15 bits, 2048 color settings
(3) Mode 2: RGB in each of 8 bits for a total of 24 bits, 1024 color settings
Because color data must be set to RGB-8 bit when it is output, a 0 will be added to
the lowest 3 bits if RGB-5 bit color data is stored in the color RAM, . When the
special color calculation mode is set to mode 3, the most significant bit of color RAM
data becomes the color calculation enable bit. See “12.3 Special Color Calculation
Function” about the special color calculation mode.
ST-58-R2 43
Figure 3.9 shows the color data configuration of the color RAM.
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
CC 5 Bit Blue Dat a 5 Bit G re en Dat a 5 Bit Re d Data
Colo r Da ta
No te: The MSB CC is ena bl e bi t when spe cia l col or ca lcul at ion mode is mo de 3.
Bit 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Co lor Dat a CC 8 Bit Blue Dat a
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Col or Data 8 Bit Gre en Dat a 8 Bit Red Dat a
44
Color data written to the color RAM is illustrated in Figure 3.10.
Bit 0
100000H 1K Word
16 bit X 1024 Colors
Same Color Data
16 bit X 1024 Colors 1K Word
100FFFH
Bit 1
100000H
100FFFH
Bit 2
100000H
100FFFH
ST-58-R2 45
Color RAM mode bit (CRMD1, CRMD0), bits 13 and 12
Selects the color RAM mode. See “3.4 Color RAM mode.”
Set the Color RAM mode to mode 1 when the CRKTE bit is 1. At that time, color
data can no longer be stored because the second half of the color RAM (100800H ~
100FFFH) is used for the coefficient table data.
CRMD1 CRMD0 Mode Process
0 0 0 RGB each 5 bits, 1024 color settings
0 1 1 RGB each 5 bits, 2048 color settings
1 0 2 RGB each 8 bits, 1024 color settings
1 1 - Setting not allowed
Saving color data to the color RAM must be done after thes bits have been set.
When mode 0 is set, data written to the first half of the color RAM will be written to
the second half at the same time.
VRAM mode bit (VRBMD and VRAMD), bits 9 and 8. (See “ 3.2 VRAM Bank Parti-
tion.”)
Rotation data bank select bit: Data bank select bit (RDBSA01, RDBSA00, RDBSA11,
RDBSA10, RDBSB01, RDBSB00, RDBSB11, RDBSB10)
Designates the use objective of the VRAM of the rotation scroll screen. This bit is
only in effect when the rotation scroll screen is displayed. (See “6.2 Rotation Scroll
Screen Display Control.”)
46
Chapter 4 Scroll Screen
ST-58-R2 47
4.1 Screen Display Control
The scroll screen selects screens not displayed by controlling VRAM access used in
the display of each screen, and can also indicate whether to invalidate the dot color
code (transparency code) in each screen, which are the transparent dots of the screen
being displayed.
xxTPON Process
0 Validates transparency code (transparency code dots become transparent)
1 Invalidates transparency code (transparency code dots are displayed according to da
values)
Note: N0, N1, N2, N3, or R0 is entered into bit name for xx.
48
Screen display enable bit: On bit (N0ON, N1ON, N2ON, N3ON, R0ON, R1ON)
Designates whether to display each scroll screen.
N0TPON 180020H Bit 8 For NBG0 (or RBG1)
N1TPON 180020H Bit 9 For NBG1 (or EXBG)
N2TPON 180020H Bit 10 For NBG2
N3TPON 180020H Bit 11 For NBG3
R0TPON 180020H Bit 12 For RBG0
xxTPON Process
0 Validates transparency code (transparency code dots become transparent)
1 Invalidates transparency code (transparency code dots are displayed according to da
values)
Note: N0, N1, N2, N3, R0, or R1 is entered into bit name xx.
When the screen access command (which has a 0 bit) is set in the VRAM cycle pat-
tern register, the access command is ignored and the VRAM access for displaying
the screen will not be performed.
When R0ON is 0, do not set R1ON at 1.
When both R0ON and R1ON are 1, the normal scroll screen can no longer be dis-
played. At this time, VRAM-B0 is fixed in RAM used for RBG1 character pattern
tables; and VRAM-B1 is fixed in RAM used for RBG1 pattern name tables.
When a specific screens can no longer be displayed by register settings, the screen bit
should be set to 0. For example, when both R0ON and R1ON are 1, set the N0ON,
N1ON, N2ON, N3ON bits at 0. See section “6.2 Rotation Scroll Surface Display
Control” for more about rotation scroll surfaces.
ST-58-R2 49
4.2 Scroll Screen Structure
The scroll screen has two screen formats, the cell format and the bit map format.
Cell Format
The cell format scroll screen is composed of picture pattern “cells” that are 8 H dots
by 8 V dots; cells are arranged in 1 H X 1 V or 2 H X 2 V to form “character pat-
terns.” A “page” is an arrangement of character patterns in 32 H X 32 V or 64 H X 64
V. A “plane” is an arrangement of pages 1 H X 1 V, 2 H X 1 V, or 2 H X 2 V. A
“map” is an arrangement of planes 2 H X 2 V (for normal scroll screens), or 4 H X 4
V (for rotation scroll surface). Figure 4.1 shows the cell format configuration of the
scroll screen.
Cha ra ct er
Cell Pat ter n Pag e Plane Map
8 H do t
X 1 H cel l
8 V dot X
1 V cel l 32 H X 32 V
or or
2 H cel l 1 H pa ge
64 H X 64 V
X X 2 H pl an e
ch ar act er pa ttern
2 V cel l 1 V pa ge X
(64 H X 64 V ce l ) or 2 V pl an e
2 H pa ge (n or mal scr ol l scr ee n)
X or
1 V pa ge 4 H pl an e
or X
2 H pa ge 4 V pl an e
X (r ot at ion scr ol l scr ee n)
2 V pa ge
Dot color data stored as character pattern tables in VRAM becomes cell data. Color
data is composed of 4, 8, 16, or 32-bit character color. Character pattern data is cell
data arranged in one or four pieces. Page data is character pattern name data (ad-
dress of character pattern table) stored as a pattern name table. Page data arranged
in one, two, or four pieces is a plane. The map selects the lead address of the pattern
name table in the map register and map offset register. Figure 4.2 shows the con-
figuration of a cell format of the scroll screen and corresponding data settings.
50
Map Register + Ma p Offse t Reg is ter
Map
To p Addre ss of Pla n e A PN T
To p A d dre ss of Plane B PNT
Plane A Plane B
To p Address o f Pla ne C PNT
To p Addre ss of Plane D PN T
Plane C Pla ne D
C P0 Pa t e rn N a me Da ta
Pag e 0 Page 1
Page 0
CP 10 2 3 Pa tter n Na me D at a
Pag e 2 Page 3 C P0 Pat te rn N a me D a ta
Page 1
C P1 0 23 Pa t e rn N a me Da ta Page
Plane A CP0 CP31
Plane Size R egist e r CP 0 P at ter n N am e D at a
CP : Character Pattern
D ot 0 C olor D ata
Cell 0 Cell 1
C ell 0
Cell 2 Cell 3 Dot 63 Co lo r Da ta
Dot 0 Color Dat a
Dot 63 Co lo r Da ta
Dot 0 Color Dat a Dot 56 Do t 63
C ell 3
Dot 63 Co lo r Da ta C haracter C ontrol Register
N ote: Character pattern and pla ne siz e vary depen din g on the re g is ter setting; ma p siz e varie s
d epending on the scro l scre en type. T he above f ig u re is an exam ple of the ca se w hen cha ra cter
p attern is 2 H cells X 2 V ce l s. Th e plane is 2 H p ages X 2 V p ages and norm al sc roll scre en
(2 H planes X 2 V plane s) .
Figure 4.2 Scroll screen configuration of cell format and corresponding data settings.
ST-58-R2 51
Bit Map Format
The scroll screen of the bit map format is composed of a bit map pattern 512 H (or
1024) dots and 256 V (or 512) dots. When a screen is displayed by the bit map for-
mat, the size of the bit map must be set in the register and the set size of the bit map
pattern must be stored in VRAM. Figure 4.3 shows the scroll screen configuration of
the bit map format. Figure 4.4 shows the relationship of the register and the scroll
screen of the bit map format.
Bitmap
1 Do t
Map Offset Re gi st er
VRAM Cha ra ct er Con trol Reg ist er
Map Offset
Dot 0 Col or Data Cha ra ct er Colo r Coun t
Bitma p Size
Figure 4.4 Relationship of bit map format scroll screen and data settings
52
4.3 Cell
The cell is a picture pattern 8 H dots by 8 V dots, and is stored in VRAM. The char-
acter color count (number of colors per one cell) can be selected from among 16, 256,
2048, 32,768, or 16,777,216 colors. The amount of RAM required in the size of each
dot color data and in data of one cell changes according to the color count.
ST-58-R2 53
(1) 4 bi ts/ dot (32 byt es/ cel l)
bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Dot 0- 0 Dat a Dot 0- 1 Da ta Dot 0- 2 Da ta Dot 0- 3 Da ta
+00H
Dot 0 1 2 3 4 5 6 7
7 + 1C + 1D +1E +1F
Not e 1: The up pe r le ft not at ion in the cel l is dot 0- 0; to the rig ht ar e dot 0- 1,
do t 0-2 , dot 0- 3, ...
Not e 2: Num be rs in the cel ls ar e VRAM addr esses (Hexa de cim al ) of do t (2
do ts) da ta, wit h VRA M ad dr ess of dot 0- 0, 0- 1 dat a as the
ref ere nce .
54
(2) 8 bi ts/ dot (64 byt es/ cel l)
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
+00H Dot 0- 0 Dat a Dot 0- 1 Dat a
Dot 0 1 2 3 4 5 6 7
Dot 0 +00 +01 +02 +03 +04 +05 +06 +07
Not e 1: The uppe r lef t no tat ion in the ce l is dot 0- 0; to the rig ht ar e dot 0- 1,
do t 0-2 , dot 0- 3, ...
Not e 2: Num ber s in the cel ls ar e VRAM ad dr esse s (Hexad eci mal ) of do t
da ta, with VRAM ad dr ess of dot 0- 0 dat a as the ref er en ce.
ST-58-R2 55
(3) 16 bits/ do t (1 28 byt es/ ce l )
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
+00H Dot 0- 0 Dat a
+7 EH Dot 7- 7 Dat a
Dot 0 1 2 3 4 5 6 7
Dot 0 +00 +02 +04 +06 +08 +0A +0C +0E
Not e 1: The upp er lef t no tat io n in the ce ll is dot 0- 0; to the righ t ar e do t 0-1 ,
dot 0- 2, dot 0- 3, ...
Not e 2: Numb er s in the cel ls are VRAM add re sses (Hexa de cim al) of dot
dat a, with VRAM ad dr ess of dot 0- 0 da ta as the re fer en ce.
56
(4) 32 bits/ do t (2 56 byt es/ ce l )
BIT 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
+00H Dot 0- 0 Da ta (M ost si gn fi ica nt wor d)
Do t 0 1 2 3 4 5 6 7
Do t 0 +00 +04 +08 +0C +10 +14 +18 +1C
Not e 1: The uppe r lef t no tat io n in the ce l is dot 0- 0; to the rig ht ar e dot 0- 1,
do t 0-2 , dot 0- 3, ...
Not e 2: Numb er s in the cel ls ar e VRAM addr esses (Hexadeci mal ) of do t
da ta (M SW), with VRAM ad dr ess of dot 0- 0 da ta (MSW) as the
ref ere nce .
Transparent Dots
Dot color code, which are transparent dots (transparency code), changes according
to the color format. When the color format is the palette format, the transparent dot
applies when all bits per one dot is 0; when the RGB format, the transparent dot
applies when the most significant bit of the dot data is 0.
When in the palette format, lead color data of the palette corresponds to the trans-
parency code; therefore, it normally cannot be used. If the transparency code is
nullified, this color data can be used. Control is done by the screen display enable
register. Table 4.3 shows the transparent dot data values.
ST-58-R2 57
Table 4.3 Transparent dot data values
Color Format Character Color Bit Count for 1 Dot Transparency Code
Count
16 colors 4 bits/dot 0H (4 bit)
Palette Format 256 colors 8 bits/dot 00H (8 bit)
2048 colors 16 bits/dot 000H (lower 11 bits)
RGB Format 32,768 colors 16 bits/dot MSB (bit 15) is 0
16,770,000 colors 32 bits/dot MSB (bit 31) is 0
Wh en 32 76 8 Colo rs
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Tra nsp ar en t Blue Dat a Gree n Da ta Re d Da ta
Bit
7 6 5 4 3 7 6 5 4 3 7 6 5 4 3
Bit 32 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Tr an spa re nt Blue Da ta
Bit 7 6 5 4 3 2 1 0
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Gre en Dat a Red Dat a
7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0
58
4.4 Character Patterns
Character patterns are perfect squares composed of 1 or 4 cells; the size is specified
in their respective registers.
8 dot
Ce ll Da ta 1
Cel l Dat a 2
Ce ll Da ta 0 Cel l Dat a 1
16 do t
Cel l Dat a 3
Cell Data 4
16 do t
ST-58-R2 59
4.5 Character Control Register
The character control register selects cell and bit map formats, the number of charac-
ter (bit map) colors, and the size of the character pattern or bit map. This register is
a write only 16-bit register located in addresses 180028H to 18002AH. Because the
value of the register is cleared to 0 after the power is turned on or reset, the value
must be set.
15 14 13 12 11 10 9 8
CHCTLA ~ ~ N1CHCN1 N1CHCN0 N1BMSZ1 N1BMSZ0 N1BMEN N1CHSZ
180028H 7 6 5 4 3 2 1 0
~ N0CHCN2 N0CHCN1 N0CHCN0 N0BMSZ1 N0BMSZ0 N0BMEN N0CHSZ
15 14 13 12 11 10 9 8
CHCTLB ~ R0CHCN2 R0CHCN1 R0CHCN0 ~ R0BMSZ R0BMEN R0CHSZ
18002AH 7 6 5 4 3 2 1 0
~ ~ N3CHCN N3CHSZ ~ ~ N2CHCN N2CHSZ
Character color number bit (N0CHCN2 to N0CHCN0, N1CHCN1, N1CHCN0, N2CHCN, N3CHCN,
R0CHCN2 to R0CHCN0)
Designates the character color count of each screen, and the bit map color count
when displaying by the bit map format.
N0CHCN2~N0CHCN0 180028H Bit 6~4 For NBG0 (or RBG1)
N1CHCN1,N1CHCN0 180028H Bit 13,12 For NBG1 (or EXBG)
N2CHCN 18002AH Bit 1 For NBG2
N3CHCN 18002AH Bit 5 For NBG3
R0CHCN2~R0CHCN0 18002AH Bit 14~12 For RBG0
Note: Cannot be displayed by the exclusive monitor mode when used as RBG1.
60
N1CHCN1 N1CHCN0 TV Screen Mode Color Format
Normal Hi-Res Exclusive
Monitor
0 0 16 colors 16 colors 16 colors Palette Format
0 1 256 colors 256 colors 256 colors Palette Format
1 0 2048 colors 2048 colors 2048 colors Palette Format
1 1 32,786 colors 32,786 colors 32,786 colors RGB Format
Note: When used as EXBG, and when the set values are N1CHCN1 = 1, N1CHCN0 = 1 there are
16,770,000 colors
Depending on the color count of NBG0 and NBG1, the scroll screen that cannot be
displayed will appear. When NBG0 is set at 2048 or 32,768 colors, NBG2 can no
longer be displayed. When NBG0 is set at 16,770,000 colors, NBG1 to NBG3 can no
longer be displayed. When NBG1 is set at 2048 or 32,768 colors, NBG3 can no longer
be displayed.
ST-58-R2 61
Bit map size bit (N0BMSZ1, N0BMSZ0, N1BMSZ1, N1BMSZ0, R0BMSZ)
Designates the bit map size of each screen when display is in a bit map format.
N0BMSZ1,N0BMSZ0 180028H Bit 3,2 For NBG0
N1BMSZ1,N1BMSZ0 180028H Bit 11,10 For NBG1
R0BMSZ 18002AH Bit 10 For RBG0
62
Character size bit (N0CHSZ, N1CHSZ, N2CHSZ, N3CHSZ, R0CHSZ)
Designates the character size when the scroll screen is in a cell format.
N0CHSZ 180028H Bit 0 For NBG0 (or RBG1)
N1CHSZ 180028H Bit 8 For NBG1
N2CHSZ 18002AH Bit 0 For NBG2
N3CHSZ 18002AH Bit 4 For NBG3
ROCHSZ 18002AH Bit 8 For RBG0
ST-58-R2 63
4.6 Pattern Name Table (Page)
Pattern name table (or page) stores the method of arrangement when the character
pattern is in a square the size of a 64 X 64 cell in the VRAM. It also arranges pattern
name data in table form and stores it in VRAM. Pattern name data selects the lead
address of the character pattern stored in VRAM and the control information for
each character pattern. Pattern name data in a pattern name table is in one-word or
two-word. When in one-word, auxiliary data of the least significant 10 bits of the
pattern name control register is added to make up for insufficient bits.
Table 4.4 Pattern name table capacity and page boundary of one page
Pattern Name Data Character Size Contents of 1 Boundary During
Size Page VRAM Storage
1 Word 1 H Cell X 1 V Cell 8192 Bytes 2000H
2 H Cells X 2 V Cells 2048 Bytes 800H
2 Words 1 H Cell X 1 V Cell 16,384 Bytes 4000H
2 H Cells X 2 V Cells 4096 Bytes 1000H
64
(1) Pat tern Nam e Dat a Size : 1 wor d
Char act er Pat ter n Size : 1 H cel l X 1 V cel l
Pattern Nam e Ta bl e (V RA M)
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
+00 00H Cha ract er Pat ter n 0- 0 Pat ter n Name Dat a
Ch ar act er
Pattern 0 1 2 61 62 63
Char act er
Pat ter n 0 +000 0 +0002 +000 4 +007A +007C +007E
Page
No te 1: The up per -lef t no tat ion in the page is ch ar act er pa ttern 0- 0; to the right ar e
char act er pat terns 0-1 , 0-2 , 0-3 , ...
No te 2: Num be rs in the pag es are VRAM adr addresses
esse s (He
(Hexadecimal)
xad eci mal ) ofofpapattern
ttern naname
me da
data
ta
of ch ar act er pa ttern s, with VRAM addr ess of cha ra ct er pat ter n 0-0 pat ter n nam e
dat a as the ref er en ce.
ST-58-R2 65
(2) Pat tern Nam e Dat a Size : 1 wor d
Char act er Pat ter n Size : 2 H cel ls X 2 V cel ls
Pattern Nam e Ta bl e (V RA M)
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
+00 0H Cha ract er Pat ter n 0- 0 Pat ter n Name Dat a
Cha ract er
Pat ter n 0 1 2 29 30 31
Cha ra ct er +000 +002 +004 +03A +03C +03E
Pat ter n 0
Pag e
66
(3) Pat tern Nam e Dat a Size : 2 wor ds
Char act er Pat ter n Size : 1 H cel l X 1 V cel l
Pattern Nam e Ta bl e (V RA M)
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
+000 0H Ch ar act er Pattern 0- 0 Patter n Nam e Data (Most sig ni fica nt word )
+000 2H Cha ract er Pat ter n 0- 0 Pat ter n Name Dat a (Le ast si gni fican t word )
+000 4H Char act er Pat ter n 0- 1 Pat ter n Name Dat a (Mo st si gni fican t wor d)
+3F FCH Char act er Patter n 63 -6 3 Pat ter n Name Dat a (Most si gni fican t wor d)
+3F FEH Char act er Pat ter n 63 -6 3 Pat ter n Name Dat a (Le ast sig ni fican t word )
Ch ar act er
Pattern 0 1 2 61 62 63
Cha ra ct er
+0000 +0004 +0008 +00F4 +00F8 +00FC
Pat ter n 0 +0002
+0006 +000A +00F6 +00FA +00FE
Pag e
ST-58-R2 67
(4) Pat tern Nam e Dat a Size : 2 wor ds
Char act er Pat ter n Size : 2 H cel ls X 2 V cel ls
Pattern Nam e Ta bl e (V RA M)
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
+0 00 H Cha ra ct er Pat ter n 0-0 Pat tern Nam e Dat a (Mo st si gn ificant wor d)
+0 02 H Char act er Patter n 0- 0 Pat ter n Na me Dat a (Le ast si gni fica nt wo rd )
+FFCH Ch ar act er Pattern 31 -3 1 Pat ter n Na me Dat a (Most si gni fican t word )
+FFEH Char act er Patter n 31 -3 1 Pat ter n Name Dat a (Le ast sig ni fica nt word )
Ch ar act er
Pattern 0 1 2 29 30 31
Char act er +000 +004 +008 +074 +078 +07C
Pat ter n 0 +002 +006 +00A +076 +07A +07E
Pag e
+ F0 0 + F0 4 + F0 8 +F7 4 + F7 8 +F 7C
30 + F0 2 +F7 E
+ F0 6 +F0 A +F7 6 +F7 A
68
Pattern Name Data
Pattern name data is composed of the following four fields, for a total of 26 bits.
• Character number 15 bits
• Palette number 7 bits
• Special function bits 2 bits
• Reverse function bits 2 bits
The character number designates the address of the character pattern (VRAM).
The palette number designates the address of the palette (color RAM) used by the
character. The special function bits designate whether that character will use the
special function. The reverse function bits designate whether to use the up-down
reverse or left-right reverse functions.
The size of the pattern name data in the pattern name table can select either 1-word
or 2-word. Because all required pattern name data cannot be designated when 1
word is selected, it is supplemented by auxiliary data of the least significant 10 bits
of the pattern name control register. The composition of pattern name data changes
depending on character size, character number color, and the character number
auxiliary mode. The character number auxiliary mode designates the number of bits
per character number when the pattern name table size in the pattern name table is
1-word, and whether that character can use the reverse function. Table 4.5 shows the
character number auxiliary mode. Figure 4.9 shows the configuration of 2-word
pattern name data, and Figure 4.10 shows the configuration of 1 word pattern name
data.
Special Function
Bit 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Flip
Function Palette Number
Vertical PR CC 6 5 4 3 2 1 0
Horizontal
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Character Number
.
14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Figure 4.9 Bit configuration when the pattern name data is 2 word
ST-58-R2 69
Table 4.6 shows the bit configuration when the pattern name data is 1 word.
70
(1) Ch ar act er Size : 1 H cel l X 1 V cel l
Char act er Col or Coun t: 16 co lor s
Char act er Num be r Suppl eme nt Mo de : Mod e 0
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Palet te Num be r Cha ra ct er Num ber
6 5 4 9 8 7 6 5 4 3 2 1 0
Ver tical Hor izon tal
Not e: Sha de d bit is ign or ed
Sup pl em ent al Da ta in Pat tern Nam e Cont ro l Regi st er
Bit 9 8 7 6 5 4 3 2 1 0
Speci al Pal ette No . Ch ar act er Num be r
Fun ct ion PR: Spec ial Prio rit y Bi t
PR CC 14 13 12 11 10 C C: Speci al Color Calc ula tion Bi t
ST-58-R2 71
(4 ) Cha ra ct er Size : 1 H ce l X 1 V ce l
Cha ra ct er Colo r Coun t : Exce pt 16 col or s
Cha ra ct er Num ber Supp le me nt Mo de : Mod e 1
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Pal et te Numb er Cha ra ct er Numb er
6 5 4 11 10 9 8 7 6 5 4 3 2 1 0
Not e: Bot h ver tica l and hor izo nt al flip fun ct ion bi ts are se t to 0.
Shad ed bi t is ig no re d
Bit 9 8 7 6 5 4 3 2 1 0
Speci al Pal et te No. Cha ra ct er Num ber
PR: Sp ecia l Pr io ri ty Bit
Fun ct ion
PR CC 14 13 12 CC: Spec ial Colo r Calc ul atio n Bit
(5 ) Cha ra ct er Size : 2 H ce l s X 2 V ce l s
Cha ra ct er Colo r Coun t : 16 Col or s
Cha ra ct er Num ber Supp le me nt Mo de : Mod e 0
(6 ) Cha ra ct er Size : 2 H ce l s X 2 V ce l s
Cha ra ct er Colo r Coun t : 16 Col or s
Cha ract er Nu mb er Supp lem en t Mod e: Mo de 1
Figure 4.10 Configuration when pattern name data is one word (continued)
72
(7 ) Cha ra ct er Size : 2 H ce l s X 2 V ce l s
Cha ract er Co lor Cou nt : Exce pt 16 col or s
Cha ract er Nu mb er Supp lem en t Mod e: Mo de 0
(8 ) Cha ra ct er Size : 2 H ce l s X 2 V ce l s
Cha ract er Co lor Cou nt : Exce pt 16 col or s
Cha ract er Nu mb er Supp lem en t Mod e: Mo de 1
Figure 4.10 Configuration when pattern name data is one word (continued)
ST-58-R2 73
Character Number
The character number is 15-bit data, and designates the address of the character
pattern being displayed in that position. The boundary of the character pattern from
this character number is always 20H. Moreover, when the VRAM size is 4M bits, the
most significant bit of the character number (bit 14) is not used.
Palette Number
The palette number is 7-bit data, and designates the address of the color palette used
in the character pattern being displayed in that position. This data can be used only
when the color format is the palette format, not the RGB format. The palette number
is added to the dot color code of the character pattern. Because there is a total of 11
bits of dot color data, the bits that are used change depending on the character color
number. Figure 4.11 shows the configuration of 11-bit dot color data.
Do t Colo r Co de
10 9 8 7 6 5 4 3 2 1 0
74
Reverse (Flip) Function Bit
The reverse function bit is 2-bit data, and designates whether to use the reverse
function for the character pattern being displayed at that position. The reverse
function bit has a top-bottom reverse bit that reverses the top and bottom of a char-
acter pattern, and a left-right reverse bit that reverses left and right. The reverse
function bit is shown in Table 4.7, and a reverse display of a character pattern in
shown in Figure 4.12.
Hori z. Flip
Ver tical Flip Bit =0 Ver tical Flip Bit =0
Hor izon tal Flip Bit =0 Hor izo nt al Flip Bit =1
ST-58-R2 75
Pattern Name Control Register
The pattern name control register assigns pattern name data size, character number
supplement mode, and pattern name supplement data. This register is a write only
16-bit register located in addresses 180030H to 180038H. Because the value of the
register is cleared to 0 after the power is turned on or reset, the value must be set.
15 14 13 12 11 10 9 8
PNCN0 N0PNB N0CNSM ~ ~ ~ ~ N0SPR N0SCC
180030H 7 6 5 4 3 2 1 0
N0SPLT6 N0SPLT5 N0SPLT4 N0SCN4 N0SCN3 N0SCN2 N0SCN1 N0SCN0
15 14 13 12 11 10 9 8
PNCN1 N1PNB N1CNSM ~ ~ ~ ~ N1SPR N1SCC
180032H 7 6 5 4 3 2 1 0
N1SPLT6 N1SPLT5 N1SPLT4 N1SCN4 N1SCN3 N1SCN2 N1SCN1 N1SCN0
15 14 13 12 11 10 9 8
PNCN2 N2PNB N2CNSM ~ ~ ~ ~ N2SPR N2SCC
180034H 7 6 5 4 3 2 1 0
N2SPLT6 N2SPLT5 N2SPLT4 N2SCN4 N2SCN3 N2SCN2 N2SCN1 N2SCN0
15 14 13 12 11 10 9 8
PNCN3 N3PNB N3CNSM ~ ~ ~ ~ N3SPR N3SCC
180036H 7 6 5 4 3 2 1 0
N3SPLT6 N3SPLT5 N3SPLT4 N3SCN4 N3SCN3 N3SCN2 N3SCN1 N3SCN0
15 14 13 12 11 10 9 8
PNCR R0PNB R0CNSM ~ ~ ~ ~ R0SPR R0SCC
180038H 7 6 5 4 3 2 1 0
R0SPLT6 R0SPLT5 R0SPLT4 R0SCN4 R0SCN3 R0SCN2 R0SCN1 R0SCN0
Pattern name data size bit (N0PNB, N1PNB, N2PNB, N3PNB, R0PNB)
Designates the pattern name data size when displaying in the cell format.
N0PNB 180030H Bit 15 For NBG0 (or RBG 1)
N1PNB 180032H Bit 15 For NBG1
N2PNB 180034H Bit 15 For NBG2
N3PNB 180036H Bit 15 For NBG3
R0PNB 180038H Bit 15 For RBG0
76
xxPNB Pattern Name Data Size
0 2 Words
1 1 Word
Note: N0, N1, N3, or R0 is entered in bit name for xx.
Special priority bit (for pattern name supplement data): Supplementary special priority bit
(N0SPR, N1SPR, N2SPR, N3SPR, R0SPR)
Designates the pattern name supplement data as the special priority bit when the
pattern name data size is 1-word.
N0SPR 180030H Bit 9 For NBG0 (or RBG 1)
N1SPR 180032H Bit 9 For NBG1
N2SPR 180034H Bit 9 For NBG2
N3SPR 180036H Bit 9 For NBG3
R0SPR 180038H Bit 9 For RBG0
See “11.2 Special Color Priority Function” for how this bit is used.
ST-58-R2 77
Special color calculation bit (for pattern name supplement data): Supplementary special color
calculation bit (N0SCC, N1SCC, N2SCC, N3SCC, R0SCC)
The special color calculation bit is designated as pattern name supplement data
when the pattern name data size is 1-word.
N0SCC 180030H Bit 8 For NBG0 (or RBG 1)
N1SCC 180032H Bit 8 For NBG1
N2SCC 180034H Bit 8 For NBG2
N3SCC 180036H Bit 8 For NBG3
R0SCC 180038H Bit 8 For RBG0
See “12.2 Special Color Calculation Function” to learn how this bit is used.
78
4.7 Planes
Plane Size
When the plane consists of more than one pattern name table (page), the pattern
name table used by one plane should be linked to VRAM and stored. Figure 4.13
shows the relationship of the pattern name table arranged by plane size (number of
plane page) and pattern name table.
64 Cel ls
Pag e 1
Whe n 2 H pa ge s X 1 V pa ge
12 8 Cel ls
Pag e 3 Wh en 2 H pag es X 2 V page s
Pag e 0 Pag e 1
Pag e 4
12 8 Cel ls
Pag e 2 Pag e 3
12 8 Cel ls
ST-58-R2 79
Plane Size Register
The plane size register controls the plane size and setting of the screen-over process
of the rotation scroll surface. This register is a write only 16-bit register located at
address 18003AH. Because the value of the register is cleared to 0 after the power is
turned on or reset, the value must be set.
15 14 13 12 11 10 9 8
PLSZ RBOVR1 RBOVR0 RBPLSZ1 RBPLSZ0 RAOVR1 RAOVR0 RAPLSZ1 RAPLSZ0
18003AH 7 6 5 4 3 2 1 0
N3PLSZ1 N3PLSZ0 N2PLSZ1 N2PLSZ0 N1PLSZ1 N1PLSZ0 N0PLSZ1 N0PLSZ0
Plane size bit (N0PLSZ1, N0PLSZ0, N1PLSZ1, N1PLSZ0, N2PLSZ1, N2PLSZ0, N3PLSZ1,
N3PLSZ0, RAPLSZ1, RAPLSZ0, RBPLSZ1, RBPLSZ0)
Designates the plane size (number of pages) of each scroll screen.
N0PLSZ1, N0PLSZ0 18003AH Bit 1,0 For NBG0
N1PLSZ1, N1PLSZ0 18003AH Bit 3,2 For NBG1
N2PLSZ1, N2PLSZ0 18003AH Bit 5,4 For NBG2
N3PLSZ1, N3PLSZ0 18003AH Bit 7,6 For NBG3
RAPLSZ1, RAPLSZ0 18003AH Bit 9,8 For Rotation Parameter A
RBPLSZ1, RBPLSZ0 18003AH Bit 13,12 For Rotation Parameter B
Note: N0, N1, N2, N3, RA, or RB is entered in bit name for xx.
When the reduction display is set up to a factor of 1/4 in NBG0 and NBG1, do not
set the plane size of that screen to 2 H pages x 2 V pages.
80
Screen-over process bit: Over bit (RAOVR1, RAOVR0, RBOVR1, RBOVR0)
Designates control (screen-over process) when the display coordinate value exceeds
the display area in the rotation scroll surface.
RAOVR1, RAOVR0 18003AH Bit 11,10 For Rotation Parameter A
RBOVR1, RBOVR0 18003AH Bit 15,14 For Rotation Parameter B
When the rotation scroll surface is in bit map, the character pattern designated by
the screen-over pattern name register must not be set to repeat process. With the
rotation scroll surface in bit map, and when the length of the bit map is 256 dots, if
the display area is set to 0 ≤ X < 512 and 0 ≤ Y < 512 and all the outer area is set to be
transparent, two of the same images will be displayed for each 256 V dots.
ST-58-R2 81
4.8 Maps
Ma p Re gi st er B
5 4 3 2 1 0
Table 4.8 shows the address values of register and bits that are used for the map
selection register by the pattern name data size and character size.
82
Table 4.8 Address value of map designated register by setting
Plane Size Pattern Name Character Size Bits and Addresses
Data Size
1 Word 1 H Cell X 1 V Cell (Value of bit 6~0) X 2000H
1 H page X 2 H Cells X 2 V Cells (Value of bit 8~0) X 800H
1 V page 2 Words 1 H Cell X 1 V Cell (Value of bit 5~0) X 4000H
2 H Cells X 2 V Cells (Value of bit 7~0) X 1000H
1 Word 1 H Cell X 1 V Cell (Value of bit 6~1) X 4000H
2 H pages X 2 H Cells X 2 V Cells (Value of bit 8~1) X 1000H
1 V page 2 Words 1 H Cell X 1 V Cell (Value of bit 5~1) X 8000H
2 H Cells X 2 V Cells (Value of bit 7~1) X 2000H
1 Word 1 H Cell X 1 V Cell (Value of bit 6~2) X 8000H
2 H pages X 2 V Cells X 2 V Cells (Value of bit 8~2) X 2000H
2 V pages 2 Words 1 H Cell X 1 V Cell (Value of bit 5~2) X 10000H
2 H Cells X 2 V Cells (Value of bit 7~2) X 4000H
Note: When the VRAM capacity is set at 4M bits, the most significant bit among the bits used is not
used.
ST-58-R2 83
Map Size
Map size (number of planes in the map) will change depending on if the screen is a
normal scroll screen or rotation scroll surface. The normal scroll screen has a map 2
H planes X 2 V planes in each screen. The rotation scroll surface has a map 4 H
planes X 4 V planes in both of rotation parameters A and B. Figure 4.15 shows the
plane arrangements of different map sizes.
Plane Plane
A B
Plane Plane
C D
84
When NBG0 and NBG1 enable bits (N0ZMQT and N1ZMQT) are set to allow reduc-
tion up to a factor of 1/4, the map size of NBG0 and NBG1 become normal. A set
screen plane size, that can be reduced up to 1/4 should not be 2 H pages X 2 V
pages. Figure 4.16 shows the map size by the reduction setting.
Plan e A Plan e B
Plane A Plane B
For NB G2 Fo r NBG2
For NBG3 For NBG3
Plane C Pla ne D
For NBG2 For NBG2 Plan e C Plane D
For NB G3 For NBG3
15 14 13 12 11 10 9 8
MPOFN ~ N3MP8 N3MP7 N3MP6 ~ N2MP8 N2MP7 N2MP6
18003CH 7 6 5 4 3 2 1 0
~ N1MP8 N1MP7 N1MP6 ~ N0MP8 N0MP7 N0MP6
15 14 13 12 11 10 9 8
MPOFR ~ ~ ~ ~ ~ ~ ~ ~
18003EH 7 6 5 4 3 2 1 0
~ RBMP8 RBMP7 RBMP6 ~ RAMP8 RAMP7 RAMP6
ST-58-R2 85
Map offset bit (N0MP8 to N0MP6, N1MP8 to N1MP6, N2MP8 to N2MP6, N3MP8 to N3MP6,
RAMP8 to RAMP6, RBMP8 to RBMP6)
When the scroll screen display format is the cell format, the map offset value of 3 bits
is added to the highest 6 bits of the map register. This designates the bit map pattern
boundary when in the bit map format.
N0MP8~N0MP6 18003CH Bit 2~0 For NBG0
N1MP8~N1MP6 18003CH Bit 6~4 For NBG1
N2MP8~N2MP6 18003CH Bit 10~8 For NBG2
N3MP8~N3MP6 18003CH Bit 14~12 For NBG3
RAMP8~RAMP6 18003EH Bit 2~0 For Rotation Parameter A
RBMP8~RBMP6 18003EH Bit 6~4 For Rotation Parameter B
86
Normal Scroll Screen Map Register
Normal scroll screen map register designates the lead address of the pattern name
table of each plane when the normal scroll screen is displayed in the cell format.
This register is a write-only 16-bit register, with addresses located at 180040H to
18004EH. Because the value of the register is cleared to 0 after the power is turned
on or reset, the value must be set.
15 14 13 12 11 10 9 8
MPABN0 ~ ~ N0MPB5 N0MPB4 N0MPB3 N0MPB2 N0MPB1 N0MPB0
180040H 7 6 5 4 3 2 1 0
~ ~ N0MPA5 N0MPA4 N0MPA3 N0MPA2 N0MPA1 N0MPA0
15 14 13 12 11 10 9 8
MPCDN0 ~ ~ N0MPD5 N0MPD4 N0MPD3 N0MPD2 N0MPD1 N0MPD0
180042H 7 6 5 4 3 2 1 0
~ ~ N0MPC5 N0MPC4 N0MPC3 N0MPC2 N0MPC1 N0MPC0
15 14 13 12 11 10 9 8
MPABN1 ~ ~ N1MPB5 N1MPB4 N1MPB3 N1MPB2 N1MPB1 N1MPB0
180044H 7 6 5 4 3 2 1 0
~ ~ N1MPA5 N1MPA4 N1MPA3 N1MPA2 N1MPA1 N1MPA0
15 14 13 12 11 10 9 8
MPCDN1 ~ ~ N1MPD5 N1MPD4 N1MPD3 N1MPD2 N1MPD1 N1MPD0
180046H 7 6 5 4 3 2 1 0
~ ~ N1MPC5 N1MPC4 N1MPC3 N1MPC2 N1MPC1 N1MPC0
15 14 13 12 11 10 9 8
MPABN2 ~ ~ N2MPB5 N2MPB4 N2MPB3 N2MPB2 N2MPB1 N2MPB0
180048H 7 6 5 4 3 2 1 0
~ ~ N2MPA5 N2MPA4 N2MPA3 N2MPA2 N2MPA1 N2MPA0
15 14 13 12 11 10 9 8
MPCDN2 ~ ~ N2MPD5 N2MPD4 N2MPD3 N2MPD2 N2MPD1 N2MPD0
18004AH 7 6 5 4 3 2 1 0
~ ~ N2MPC5 N2MPC4 N2MPC3 N2MPC2 N2MPC1 N2MPC0
15 14 13 12 11 10 9 8
MPABN3 ~ ~ N3MPB5 N3MPB4 N3MPB3 N3MPB2 N3MPB1 N3MPB0
18004CH 7 6 5 4 3 2 1 0
~ ~ N3MPA5 N3MPA4 N3MPA3 N3MPA2 N3MPA1 N3MPA0
15 14 13 12 11 10 9 8
MPCDN3 ~ ~ N3MPD5 N3MPD4 N3MPD3 N3MPD2 N3MPD1 N3MPD0
18004EH 7 6 5 4 3 2 1 0
~ ~ N3MPC5 N3MPC4 N3MPC3 N3MPC2 N3MPC1 N3MPC0
ST-58-R2 87
Map bit (for normal scroll): (N0MPA5 to N0MPA0, N0MPB5 to N0MPB0,
N0MPC5 to N0MPC0, N0MPD5 to N0MPD0, N1MPA5 to N1MPA0, N1MPB5 to N1MPB0, N1MPC5
to N1MPC0, N1MPD5 to N1MPD0, N2MPA5 to N2MPA0, N2MPB5 to N2MPB0, N2MPC5 to
N2MPC0, N2MPD5 to N2MPD0, N3MPA5 to N3MPA0, N3MPB5 to N3MPB0, N3MPC5 to N3MPC0,
N3MPD5 to N3MPD0)
The lead address for the pattern name table is designated for each plane, when the
Normal scroll screen is displayed by the cell format.
N0MPA5~N0MPA0 180040H Bit 5~0 For NBG0 Plane A
N0MPB5~N0MPB0 180040H Bit 13~8 For NBG0 Plane B
N0MPC5~N0MPC0 180042H Bit 5~0 For NBG0 Plane C
N0MPD5~N0MPD0 180042H Bit 13~8 For NBG0 Plane D
N1MPA5~N1MPA0 180044H Bit 5~0 For NBG1 Plane A
N1MPB5~N1MPB0 180044H Bit 13~8 For NBG1 Plane B
N1MPC5~N1MPC0 180046H Bit 5~0 For NBG1 Plane C
N1MPD5~N1MPD0 180046H Bit 13~8 For NBG1 Plane D
N2MPA5~N2MPA0 180048H Bit 5~0 For NBG2 Plane A
N2MPB5~N2MPB0 180048H Bit 13~8 For NBG2 Plane B
N2MPC5~N2MPC0 18004AH Bit 5~0 For NBG2 Plane C
N2MPD5~N2MPD0 18004AH Bit 13~8 For NBG2 Plane D
N3MPA5~N3MPA0 18004CH Bit 5~0 For NBG3 Plane A
N3MPB5~N3MPB0 18004CH Bit 13~8 For NBG3 Plane B
N3MPC5~N3MPC0 18004EH Bit 5~0 For NBG3 Plane C
N3MPD5~N3MPD0 18004EH Bit 13~8 For NBG3 Plane D
88
Rotation Scroll Surface Map Register
The Rotation Scroll Surface Map Register designates the lead address of the pattern
name table arranged in each plane by rotation parameters A and B. When a write-
only 16-bit register, with addresses located at 180050H to 18006EH. Because the
value of the register is cleared to 0 after the power is turned on or reset, the value
must be set.
15 14 13 12 11 10 9 8
MPABRA ~ ~ RAMPB5 RAMPB4 RAMPB3 RAMPB2 RAMPB1 RAMPB0
180050H 7 6 5 4 3 2 1 0
~ ~ RAMPA5 RAMPA4 RAMPA3 RAMPA2 RAMPA1 RAMPA0
15 14 13 12 11 10 9 8
MPCDRA ~ ~ RAMPD5 RAMPD4 RAMPD3 RAMPD2 RAMPD1 RAMPD0
180052H 7 6 5 4 3 2 1 0
~ ~ RAMPC5 RAMPC4 RAMPC3 RAMPC2 RAMPC1 RAMPC0
15 14 13 12 11 10 9 8
MPEFRA ~ ~ RAMPF5 RAMPF4 RAMPF3 RAMPF2 RAMPF1 RAMPF0
180054H 7 6 5 4 3 2 1 0
~ ~ RAMPE5 RAMPE4 RAMPE3 RAMPE2 RAMPE1 RAMPE0
15 14 13 12 11 10 9 8
MPGHRA ~ ~ RAMPH5 RAMPH4 RAMPH3 RAMPH2 RAMPH1 RAMPH0
180056H 7 6 5 4 3 2 1 0
~ ~ RAMPG5 RAMPG4 RAMPG3 RAMPG2 RAMPG1 RAMPG0
15 14 13 12 11 10 9 8
MPIJRA ~ ~ RAMPJ5 RAMPJ4 RAMPJ3 RAMPJ2 RAMPJ1 RAMPJ0
180058H 7 6 5 4 3 2 1 0
~ ~ RAMPI5 RAMPI4 RAMPI3 RAMPI2 RAMPI1 RAMPI0
15 14 13 12 11 10 9 8
MPKLRA ~ ~ RAMPL5 RAMPL4 RAMPL3 RAMPL2 RAMPL1 RAMPL0
18005AH 7 6 5 4 3 2 1 0
~ ~ RAMPK5 RAMPK4 RAMPK3 RAMPK2 RAMPK1 RAMPK0
15 14 13 12 11 10 9 8
MPMNRA ~ ~ RAMPN5 RAMPN4 RAMPN3 RAMPN2 RAMPN1 RAMPN0
18005CH 7 6 5 4 3 2 1 0
~ ~ RAMPM5 RAMPM4 RAMPM3 RAMPM2 RAMPM1 RAMPM0
15 14 13 12 11 10 9 8
MPOPRA ~ ~ RAMPP5 RAMPP4 RAMPP3 RAMPP2 RAMPP1 RAMPP0
18005EH 7 6 5 4 3 2 1 0
~ ~ RAMPO5 RAMPO4 RAMPO3 RAMPO2 RAMPO1 RAMPO0
ST-58-R2 89
15 14 13 12 11 10 9 8
MPABRB ~ ~ RBMPB5 RBMPB4 RBMPB3 RBMPB2 RBMPB1 RBMPB0
180060H 7 6 5 4 3 2 1 0
~ ~ RBMPA5 RBMPA4 RBMPA3 RBMPA2 RBMPA1 RBMPA0
15 14 13 12 11 10 9 8
MPCDRB ~ ~ RBMPD5 RBMPD4 RBMPD3 RBMPD2 RBMPD1 RBMPD0
180062H 7 6 5 4 3 2 1 0
~ ~ RBMPC5 RBMPC4 RBMPC3 RBMPC2 RBMPC1 RBMPC0
15 14 13 12 11 10 9 8
MPEFRB ~ ~ RBMPF5 RBMPF4 RBMPF3 RBMPF2 RBMPF1 RBMPF0
180064H 7 6 5 4 3 2 1 0
~ ~ RBMPE5 RBMPE4 RBMPE3 RBMPE2 RBMPE1 RBMPE0
15 14 13 12 11 10 9 8
MPGHRB ~ ~ RBMPH5 RBMPH4 RBMPH3 RBMPH2 RBMPH1 RBMPH0
180066H 7 6 5 4 3 2 1 0
~ ~ RBMPG5 RBMPG4 RBMPG3 RBMPG2 RBMPG1 RBMPG0
15 14 13 12 11 10 9 8
MPIJRB ~ ~ RBMPJ5 RBMPJ4 RBMPJ3 RBMPJ2 RBMPJ1 RBMPJ0
180068H 7 6 5 4 3 2 1 0
~ ~ RBMPI5 RBMPI4 RBMPI3 RBMPI2 RBMPI1 RBMPI0
15 14 13 12 11 10 9 8
MPKLRB ~ ~ RBMPL5 RBMPL4 RBMPL3 RBMPL2 RBMPL1 RBMPL0
18006AH 7 6 5 4 3 2 1 0
~ ~ RBMPK5 RBMPK4 RBMPK3 RBMPK2 RBMPK1 RBMPK0
15 14 13 12 11 10 9 8
MPMNRB ~ ~ RBMPN5 RBMPN4 RBMPN3 RBMPN2 RBMPN1 RBMPN0
18006CH 7 6 5 4 3 2 1 0
~ ~ RBMPM5 RBMPM4 RBMPM3 RBMPM2 RBMPM1 RBMPM0
15 14 13 12 11 10 9 8
MPOPRB ~ ~ RBMPP5 RBMPP4 RBMPP3 RBMPP2 RBMPP1 RBMPP0
18006EH 7 6 5 4 3 2 1 0
~ ~ RBMPO5 RBMPO4 RBMPO3 RBMPO2 RBMPO1 RBMPO0
90
Map bit (for rotation scroll): Map bit (RAMPA5 to RAMPA0, RAMPB5 to RAMPB0,
RAMPC5 to RAMPC0, RAMPD5 to RAMPD0, RAMPE5 to RAMPE0,
RAMPF5 to RAMPF0, RAMPG5 to RAMPG0, RAMPH5 to RAMPH0,
RAMPI5 to RAMPI0, RAMPJ5 to RAMPJ0, RAMPK5 to RAMPK0,
RAMPL5 to RAMPL0, RAMPM5 to RAMPM0, RAMPN5 to RAMPN0,
RAMPO5 to RAMPO0, RAMPP5 to RAMPP0, RBMPA5 to RBMPA0,
RBMPB5 to RBMPB0, RBMPC5 to RBMPC0, RBMPD5 to RBMPD0,
RBMPE5 to RBMPE0, RBMPF5 to RBMPF0, RBMPG5 to RBMPG0,
RBMPH5 to RBMPH0, RAMPI5 to RBMPI0, RBMPJ5 to RBMPJ0,
RBMPK5 to RBMPK0, RBMPL5 to RBMPL0, RBMPM5 to RBMPM0,
RBMPN5 to RBMPN0, RBMPO5 to RBMPO0, RBMPP5 to RBMPP0)
When a rotation scroll surface is displayed in the cell format, it designates the lead
address of the pattern name table being arranged in each plane .
ST-58-R2 91
RAMPA5~RAMPA0 180050H Bit 5~0 Rotation Parameter A for Screen Plane A
RAMPB5~RAMPB0 180050H Bit 13~8 Rotation Parameter A for Screen Plane B
RAMPC5~RAMPC0 180052H Bit 5~0 Rotation Parameter A for Screen Plane C
RAMPD5~RAMPD0 180052H Bit 13~8 Rotation Parameter A for Screen Plane D
RAMPE5~RAMPE0 180054H Bit 5~0 Rotation Parameter A for Screen Plane E
RAMPF5~RAMPF0 180054H Bit 13~8 Rotation Parameter A for Screen Plane F
RAMPG5~RAMPG0 180056H Bit 5~0 Rotation Parameter A for Screen Plane G
RAMPH5~RAMPH0 180056H Bit 13~8 Rotation Parameter A for Screen Plane H
RAMPI5~RAMPI0 180058H Bit 5~0 Rotation Parameter A for Screen Plane I
RAMPJ5~RAMPJ0 180058H Bit 13~8 Rotation Parameter A for Screen Plane J
RAMPK5~RAMPK0 18005AH Bit 5~0 Rotation Parameter A for Screen Plane K
RAMPL5~RAMPL0 18005AH Bit 13~8 Rotation Parameter A for Screen Plane L
RAMPM5~RAMPM0 18005CH Bit 5~0 Rotation Parameter A for Screen Plane M
RAMPN5~RAMPN0 18005CH Bit 13~8 Rotation Parameter A for Screen Plane N
RAMPO5~RAMPO0 18005EH Bit 5~0 Rotation Parameter A for Screen Plane O
RAMPP5~RAMPP0 18005EH Bit 13~8 Rotation Parameter A for Screen Plane P
RBMPA5~RBMPA0 180060H Bit 5~0 Rotation Parameter B for Screen Plane A
RBMPB5~RBMPB0 180060H Bit 13~8 Rotation Parameter B for Screen Plane B
RBMPC5~RBMPC0 180062H Bit 5~0 Rotation Parameter B for Screen Plane C
RBMPD5~RBMPD0 180062H Bit 13~8 Rotation Parameter B for Screen Plane D
RBMPE5~RBMPE0 180064H Bit 5~0 Rotation Parameter B for Screen Plane E
RBMPF5~RBMPF0 180064H Bit 13~8 Rotation Parameter B for Screen Plane F
RBMPG5~RBMPG0 180066H Bit 5~0 Rotation Parameter B for Screen Plane G
RBMPH5~RBMPH0 180066H Bit 13~8 Rotation Parameter B for Screen Plane H
RBMPI5~RBMPI0 180068H Bit 5~0 Rotation Parameter B for Screen Plane I
RBMPJ5~RBMPJ0 180068H Bit 13~8 Rotation Parameter B for Screen Plane J
RBMPK5~RBMPK0 18006AH Bit 5~0 Rotation Parameter B for Screen Plane K
RBMPL5~RBMPL0 18006AH Bit 13~8 Rotation Parameter B for Screen Plane L
RBMPM5~RBMPM0 18006CH Bit 5~0 Rotation Parameter B for Screen Plane M
RBMPN5~RBMPN0 18006CH Bit 13~8 Rotation Parameter B for Screen Plane N
RBMPO5~RBMPO0 18006EH Bit 5~0 Rotation Parameter B for Screen Plane O
RBMPP5~RBMPP0 18006EH Bit 13~8 Rotation Parameter B for Screen Plane P
92
4.9 Bit Maps
When displaying the bit map format, select from sizes, 512 H dots x 256 V dots, 512
H dots x 512 V dots, 1024 H dots x 256 V dots, or 1024 H dots X 512 V dots. All dot
bit map pattern data is stored in the VRAM.
ST-58-R2 93
Table 4.10 Bit map color count
Color Format Bitmap Color Count Bitmap Pattern Data Bit Count For 1
Dot
16 colors 4 bits
Palette 256 colors 8 bits
2048 colors 16 bits (only use lower 11 bits)
RGB 32,768 colors 16 bits
16,770,000 colors 32 bits (only use MSB and lower 24 bits)
Note: 2028 colors become 1024 colors when the color RAM mode is 0 or 2.
94
Bit Map Pattern
The required VRAM capacity in a 1-bit map pattern surface depends upon the bit
map size and bit map color count (bit map pattern data size). Changes in the data
configuration of each bit map pattern stored in VRAM are identical. The bit map
size and bit map color count can be set to exceed the VRAM capacity, but the same
picture would be repeated in the vertically. Table 4.11 shows bit map pattern capaci-
ties and Figure 4.17 shows the bit map pattern configuration.
The boundary that stores bit map patterns in the VRAM is 20000H, and is indepen-
dent of the bit map size and the bit map color count. The designation is performed
in the map offset register.
ST-58-R2 95
(1) Bit ma p Size : 512 H dot s X 25 6 V dot s
Bit ma p Colo r Coun t : 4 bits/ dot (1 6 co lor s)
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
+0 00 0H Dot 0- 0 Dot 0- 1 Dot 0- 2 Dot 0- 3
Dot 0 1 2 3 50 8 50 9 51 0 511
Bitmap
25 5 +F F0 0 +F F0 1 +FFF E +FF FF
Note 1: The upp er lef t not ation in the cel l is do t 0-0 ; to the righ t are do t 0-1 ,
dot 0- 2, do t 0-3 , ...
Note 2: Nu mber s in the ce l s are VRAM ad dr esse s (h exa de cim al) of dot (2
dot s) dat a, with VRAM add re ss of do t 0-0 , 0-1 da ta as the
refer en ce.
96
(2 ) Bitmap Size : 512 H do ts X 25 6 V do ts
Bitmap Col or Coun t : 8 bit s/ do t (25 6 co lor s)
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
+00 00 0H Dot 0- 0 Do t 0-1
Bitmap
25 5 +1 FE0 0 +1F E01 +1 FE0 2 +1F E03 +1F FFC +1F FF D +1 FF FE +1F FFF
Note 1: The upp er lef t no tation in the cel l is do t 0-0 ; to the righ t are do t 0-1 ,
dot 0- 2, do t 0-3 , ...
Note 2: Nu mb er s in the ce l s are VRAM add re sses (h exadeci mal ) of do t
dat a, with VRAM add re ss of do t 0-0 da ta as the re fer ence.
ST-58-R2 97
(3) Bit ma p Size : 512 H dot s X 25 6 V dot s
Bit ma p Colo r Coun t : 16 bi ts/ dot (204 8 col or s, 327 68 col ors)
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
+00 00 0H Dot 0- 0
Dot 0 1 2 3 50 8 50 9 51 0 511
Do t 0 +00 000 +000 02 +00 004 +000 06 +0 03F 8 +0 03F A +003 FC +0 03F E
+00 400 +004 02 +00 404 +004 06 +0 07F 8 +0 07F A +007 FC +0 07F E
1
Bitmap
Not e 1: The upp er lef t no tat io n in the ce ll is dot 0- 0; to the righ t ar e do t 0-1 ,
dot 0- 2, dot 0- 3, ...
Not e 2: Numb er s in the cel ls are VRAM add re sses (hexad eci mal ) of do t
dat a, with VRAM ad dr ess of dot 0- 0 da ta as the re fer en ce.
98
(4) Bit ma p Size : 512 H dot s X 25 6 V dot s
Bit ma p Colo r Coun t : 32 bi ts/ do t (16 ,77 0, 000 col ors)
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
+0 00 00 H Dot 0-0 (upp er wor d)
+0 00 02 H Dot 0- 0 (l ow er wo rd )
Do t 255 -5 11 (up pe r wo rd )
+7 FFFCH
+7F FFEH Dot 25 5- 511 (lo wer wor d)
Dot 0 +0 000 0 +00 004 +0 000 8 +0 000 C +007 F0 +00 7F 4 +007 F8 +007 FC
Bitma p
No te 1: The up per left not ation in the cel l is do t 0-0 ; to the ri gh t are dot 0-1,
dot 0- 2, do t 0-3 , ...
No te 2: Num be rs in the ce lls ar e VRA M ad dr esse s (h exa de cim al) of dot
dat a (up pe r wo rd) , with VRAM ad dr ess of dot 0- 0 da ta (uppe r wor d) as
the ref ere nce .
ST-58-R2 99
(5 ) Bitmap Size : 512 H do ts X 51 2 V do ts
Bitmap Col or Coun t : 4 bit s/ do t (16 col ors)
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
+0 00 00H Do t 0-0 Do t 0-1 Do t 0-2 Do t 0-3
Do t 0 1 2 3 50 8 50 9 51 0 511
Bitmap
100
(6) Bitmap Size : 512 H dots X 512 V dots
Bitmap Color Count : 8 bits/dot (256 colors)
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
+00000H Dot 0-0 Dot 0-1
Bitmap
Note 1: The upper left notation in the cell is dot 0-0; to the right are dot 0-1,
dot 0-2, dot 0-3, ...
Note 2: Numbers in the cells are VRAM addresses (hexadecimal) of dot
data, with VRAM address of dot 0-0 data as the reference.
ST-58-R2 101
(7) Bitmap Size : 512 H dots X 512 V dots
Bitmap Color Count : 16 bits/dot (2048 colors, 32768 colors)
Bitmap
Note 1: The upper left notation in the cell is dot 0-0; to the right are dot 0-1,
dot 0-2, dot 0-3, ...
Note 2: Numbers in the cells are VRAM addresses (hexadecimal) of dot
data, with VRAM address of dot 0-0 data as the reference.
102
(8) Bitmap Size : 512 H dots X 512 V dots
Bitmap Color Count : 32 bits/dot (16,770,000 colors)
Bitmap
Note 1: The upper left notation in the cell is dot 0-0; to the right are dot 0-1,
dot 0-2, dot 0-3, ...
Note 2: Numbers in the cells are VRAM addresses (hexadecimal) of dot
data (upper word), with VRAM address of dot 0-0 data (upper word) as
the reference.
ST-58-R2 103
(9) Bitmap Size : 1024 H dots X 256 V dots
Bitmap Color Count : 4 bits/dot (16 colors)
Bitmap
Note 1: The upper left notation in the cell is dot 0-0; to the right are dot 0-1,
dot 0-2, dot 0-3, ...
Note 2: Numbers in the cells are VRAM addresses (hexadecimal) of dot (2
dots) data, with VRAM address of dot 0-0, 0-1 data as the
reference.
104
(10) Bitmap Size : 1024 H dots X 256 V dots
Bitmap Color Count : 8 bits/dot (256 colors)
Bitmap
Note 1: The upper left notation in the cell is dot 0-0; to the right are dot 0-1,
dot 0-2, dot 0-3, ...
Note 2: Numbers in the cells are VRAM addresses (hexadecimal) of dot
data, with VRAM address of dot 0-0 data as the reference.
ST-58-R2 105
(11) Bitmap Size : 1024 H dots X 256 V dots
Bitmap Color Count : 16 bits/dot (2048 colors, 32768 colors)
Bitmap
Note 1: The upper left notation in the cell is dot 0-0; to the right are dot 0-1,
dot 0-2, dot 0-3, ...
Note 2: Numbers in the cells are VRAM addresses (hexadecimal) of dot
data, with VRAM address of dot 0-0 data as the reference.
106
(12) Bitmap Size : 1024 H dots X 256 V dots
Bitmap Color Count : 32 bits/dot (16,770,000 colors)
Bitmap
Note 1: The upper left notation in the cell is dot 0-0; to the right are dot 0-1,
dot 0-2, dot 0-3, ...
Note 2: Numbers in the cells are VRAM addresses (hexadecimal) of dot
data (upper word), with VRAM address of dot 0-0 data (upper word)
as the reference.
ST-58-R2 107
(13) Bitmap Size : 1024 H dots X 512 V dots
Bitmap Color Count : 4 bits/dot (16 colors)
Bitmap
Note 1: The upper left notation in the cell is dot 0-0; to the right are dot 0-1,
dot 0-2, dot 0-3, ...
Note 2: Numbers in the cells are VRAM addresses (hexadecimal) of dot (2
dots) data, with VRAM address of dot 0-0, 0-1 data as the
reference.
108
(14) Bitmap Size : 1024 H dots X 512 V dots
Bitmap Color Count : 8 bits/dot (256 colors)
Bitmap
Note 1: The upper left notation in the cell is dot 0-0; to the right are dot 0-1,
dot 0-2, dot 0-3, ...
Note 2: Numbers in the cells are VRAM addresses (hexadecimal) of dot
data, with VRAM address of dot 0-0 data as the reference.
ST-58-R2 109
(15) Bitmap Size : 1024 H dots X 512 V dots
Bitmap Color Count : 16 bits/dot (2048 colors, 32768 colors)
Bitmap
Note 1: The upper left notation in the cell is dot 0-0; to the right are dot 0-1,
dot 0-2, dot 0-3, ...
Note 2: Numbers in the cells are VRAM addresses (hexadecimal) of dot
data, with VRAM address of dot 0-0 data as the reference.
110
Bit Map Palette Number
The bit map palette number designates the lead address of the palette used in the bit
map pattern. With the 3-bit data designated by the bit map palette number register,
the bit map palette number can only be used when the color format is in the palette
format. It cannot be used when in the RGB format. Because the palette number is
added to the dot color code of the bit map pattern to make an 11 bit dot color code, the
bit count that is used by the color count on each surface changes. Figure 4.18 shows
dot color data by bit map number colors.
Fixed at 0
ST-58-R2 111
Bit Map Palette Number Register
Bit map palette number register selects the palette number when the scroll screen is
displayed by the bit map format and special function bit. This register is a write-
only 16-bit register located in addresses 18002CH to 18002EH. Because the value is
cleared to 0 after the power is turned on or reset, make sure the value is set.
15 14 13 12 11 10 9 8
BMPNA ~ ~ N1BMPR N1BMCC ~ N1BMP6 N1BMP5 N1BMP4
18002CH 7 6 5 4 3 2 1 0
~ ~ N0BMPR N0BMCC ~ N0BMP6 N0BMP5 N0BMP4
15 14 13 12 11 10 9 8
BMPNB ~ ~ ~ ~ ~ ~ ~ ~
18002EH 7 6 5 4 3 2 1 0
~ ~ R0BMPR R0BMCC ~ R0BMP6 R0BMP5 R0BMP4
Special priority bit (for bit map): Bit map special priority bit (N0BMPR, N1BMPR, R0BMPR)
Designates the special priority bit when the scroll screen is displayed by the bit map
format.
N0BMPR 18002CH Bit 5 For NBG0
N1BMPR 18002CH Bit 13 For NBG1
R0BMPR 18002EH Bit 5 For RBG0
See section “11.2 Special Priority Function” on how to use this bit.
Special color calculation bit (for bit map): Bit map special color calculation bit (N0BMCC,
N1BMCC, R0BMCC)
Designates the special color calculation bit when the scroll screen is displayed by the
bit map format.
N0BMCC 18002CH Bit 4 For NBG0
N1BMCC 18002CH Bit 12 For NBG1
R0BMCC 18002EH Bit 4 For RBG0
See section “12.2 Special Color Calculation Function” on how to use this bit.
112
Palette number bit (for bit map): Bit map palette number bit (N0BMP2 to N0BMP0, N1BMP2 to
N1BMP0, R0BMP2 to R0BMP0)
Designates the highest three bits of the palette number when the scroll screen is
displayed in the bit map format.
N0BMP6~N0BMP4 18002CH Bit 2~0 For NBG0
N1BMP6~N1BMP4 18002CH Bit 10~8 For NBG1
R0BMP6~R0BMP4 18002EH Bit 2~0 For RBG0
When the bit map color count is 16 colors, a “0” is attached to the lowest four bits
and used as the 7-bit palette number.
ST-58-R2 113
4.10 Display Area
The display area of the scroll screen changes depending on the register setting. The
display area image is repeated and displayed when display coordinate values ex-
ceed the display area in the Normal scroll screen. Control is executed by the register
setting when display coordinate values exceed the display area in the rotation scroll
surface.
Display Area
The display area changes according to the plane size when scroll screen display
format is the cell format, and according to the bit map size when in the bit map
format. NBG0 and NBG1 also change by setting the reduction display up to 1/4.
Tables 4.12 and 4.13 show the display areas.
114
Screen-Over Process
While the rotation scroll surface is displayed, and if the calculated results of display
coordinate values of an display area have been exceeded, select one of the four below
and set it to the register. The setting of the screen-over process is not performed for
RBG0 and RBG1, but is performed for the scroll screen by rotation parameter A and
the scroll screen by rotation parameter B.
1. The outside of the display area repeats the image set in the display area.
2. The outside of the display area repeats the character pattern designated by the
screen-over pattern name register (only when the rotation scroll surface is in the
cell format).
3. The outside of the display area is transparent.
4. With no relationship to the plane size and bit map size, the display area is at
0 ≤ X < 512 and 0 ≤ Y < 512. The outside of the display area is all made to be
transparent.
ST-58-R2 115
Screen-Over Pattern Name Register
In the screen-over process of the rotation scroll surface, the screen-over pattern name
register selects pattern name data when the repetition of the character pattern is set.
This register is a write-only 16-bit register and is in addresses 1800B8H to 1800BAH.
Because the value is cleared to 0 after the power is turned on or reset, be sure to set
the value.
15 14 13 12 11 10 9 8
OVPNRA RAOPN15 RAOPN14 RAOPN13 RAOPN12 RAOPN11 RAOPN10 RAOPN9 RAOPN8
1800B8H 7 6 5 4 3 2 1 0
RAOPN7 RAOPN6 RAOPN5 RAOPN4 RAOPN3 RAOPN2 RAOPN1 RAOPN0
15 14 13 12 11 10 9 8
OVPNRB RBOPN15 RBOPN14 RBOPN13 RBOPN12 RBOPN11 RBOPN10 RBOPN9 RBOPN8
1800BAH 7 6 5 4 3 2 1 0
RBOPN7 RBOPN6 RBOPN5 RBOPN4 RBOPN3 RBOPN2 RBOPN1 RBOPN0
The bit configuration is the same as when the data size of the pattern name table is
one-word; and changes depending on the settings of the character size, character
color number, and character number supplement mode.
This register action is executed for the scroll screen by rotation parameter A and B,
but the character size that decides the bit configuration as well as the character
number supplement mode performs in RBG0 and RBG1. Therefore, be careful when
simultaneously displaying screens by rotation parameter A and B in RBG0.
116
4.11 Mosaic Process
The mosaic process can be done for each screen using the scroll surface. The mosaic
size can be set for the respective horizontal and vertical directions. The mosaic
process divides each scroll screen into several areas of pre-determined size. This
function displays all dots within various areas of colored dots in the upper left. The
mosaic pattern can be achieved by aligning different color areas. The size of the
mosaic area can be individually selected. Size in the horizontal direction can select
from 1 to 16 dots in single dot units. Size in the vertical direction can select from 1 to
16 dots in the non-interlace mode in single dot units, and 2 to 32 dots in the interlace
mode in two-dot units. If the register is set to do mosaic processing when in the
double-density interlace mode, the screen is made to display in the single-density
interlace mode.
When using the mosaic process in NBG0 or NBG1, the vertical cell scroll function
can no longer be used. Also, mosaic processing of RBG0 and RBG1 can only be done
in the horizontal direction. Figure 4.19 shows the mosaic pattern.
Area C Area D
ST-58-R2 117
Mosaic Control Register
The mosaic control register selects whether to perform the mosaic process. It is a
write-only 16-bit register and is in address 180022H. Because the value is cleared to
0 after the power is turned on or reset, be sure to set the value.
15 14 13 12 11 10 9 8
MZCTL MZSZV3 MZSZV2 MZSZV1 MZSZV0 MZSZH3 MZSZH2 MZSZH1 MZSZH0
180022H 7 6 5 4 3 2 1 0
~ ~ ~ R0MZE N3MZE N2MZE N1MZE N0MZE
118
MZSZV3 MZSZV2 MZSZV1 MZSZV0 Vertical Mosaic Size
Non-Interlace Interlace
0 0 0 0 1 dot 2 dots
0 0 0 1 2 dots 4 dots
0 0 1 0 3 dots 6 dots
0 0 1 1 4 dots 8 dots
0 1 0 0 5 dots 10 dots
0 1 0 1 6 dots 12 dots
0 1 1 0 7 dots 14 dots
0 1 1 1 8 dots 16 dots
1 0 0 0 9 dots 18 dots
1 0 0 1 10 dots 20 dots
1 0 1 0 11 dots 22 dots
1 0 1 1 12 dots 24 dots
1 1 0 0 13 dots 26 dots
1 1 0 1 14 dots 28 dots
1 1 1 0 15 dots 30 dots
1 1 1 1 16 dots 32 dots
Note: There is no relationship with the interlace setting.
xxMZE Process
0 Does not execute mosaic process
1 Processes mosaic process
Note: N0, N1, N2, N3, or R0 is entered in bit name for xx.
Only horizontal mosaic processing is performed when the mosaic process is in the
rotation scroll surface. If performing mosaic processing in the double-density inter-
lace mode, the screen is made to be displayed by the single-density interlace mode.
If performing mosaic processing in NBG0 or NBG1, the mosaic screen will not be
able to use the vertical cell-scroll function. As a result, the mosaic process is done on
the display screen for screens that don’t cell-scroll vertically.
ST-58-R2 119
(This page was blank in the original Japanese document)
120
Chapter 5 Normal Scroll Screen
Introduction.......................................................................... 122
5.1 Screen Scroll Function .................................................. 122
Screen Scroll Value Register ...................................... 123
5.2 Expansion/Contraction Function ................................... 126
Coordinate Increment Register .................................. 127
Reduction Enable Register ......................................... 129
5.3 Line and Vertical Cell Scroll Function ............................ 131
Line Scroll Function .................................................... 131
Vertical Cell Scroll Function ........................................ 134
Line and Vertical Cell Scroll Control Register............. 137
Line Scroll Table Address Register............................. 140
Vertical Cell Scroll Table Address Register ................ 141
ST-58-R2 121
Introduction
The normal scroll screen has four surfaces, NBG0 to NBG3; each surface can be
scrolled up and down, left and right. NBG0 and NBG1 can be expanded and re-
duced, line scrolled, and cell scrolled vertically.
All four surfaces of the normal scroll screen can dot scroll up, down, left, or right in
surface units. The screen scroll value selects, in the screen scroll value register, the
dot coordinates displayed in the upper left of the TV screen. The screen scroll value
is in effect up to and including values that don’t exceed the display area set for each
screen. The display area of the screen is repeated when a value that exceeds the
display area is selected. The fractional part of the screen scroll value for NBG0 and
NBG1 is used only in calculating coordinates; the final display coordinate values are
discarded. The horizontal (X) coordinate is selected by the horizontal screen scroll
value integer part bit and horizontal screen scroll value fractional part bit. The
vertical (Y) coordinate is selected by the vertical screen scroll value integer part bit
and vertical screen scroll value fractional part bit. The fractional part bit is added
immediately below the integer bit. Figure 5.1 shows the bit configuration.
Bit 31 26 15 8 0
Bit 15 10 0
Integer part
122
Screen Scroll Value Register
The screen scroll value register designates the screen scroll value. It is a write-only
16- or 32-bit register located at addresses 180070H to 180076H, 180080H to 180086H,
and 180090H to 180096H. Because the value is cleared to 0, it must be set after
power on or reset.
15 14 13 12 11 10 9 8
SCXIN0 ~ ~ ~ ~ ~ N0SCXI10 N0SCXI9 N0SCXI8
180070H 7 6 5 4 3 2 1 0
N0SCXI7 N0SCXI6 N0SCXI5 N0SCXI4 N0SCXI3 N0SCXI2 N0SCXI1 N0SCXI0
15 14 13 12 11 10 9 8
SCXDN0 N0SCXD1 N0SCXD2 N0SCXD3 N0SCXD4 N0SCXD5 N0SCXD6 N0SCXD7 N0SCXD8
180072H 7 6 5 4 3 2 1 0
~ ~ ~ ~ ~ ~ ~ ~
15 14 13 12 11 10 9 8
SCYIN0 ~ ~ ~ ~ ~ N0SCYI10 N0SCYI9 N0SCYI8
180074H 7 6 5 4 3 2 1 0
N0SCYI7 N0SCYI6 N0SCYI5 N0SCYI4 N0SCYI3 N0SCYI2 N0SCYI1 N0SCYI0
15 14 13 12 11 10 9 8
SCYDN0 N0SCYD1 N0SCYD2 N0SCYD3 N0SCYD4 N0SCYD5 N0SCYD6 N0SCYD7 N0SCYD8
180076H 7 6 5 4 3 2 1 0
~ ~ ~ ~ ~ ~ ~ ~
15 14 13 12 11 10 9 8
SCXIN1 ~ ~ ~ ~ ~ N1SCXI10 N1SCXI9 N1SCXI8
180080H 7 6 5 4 3 2 1 0
N1SCXI7 N1SCXI6 N1SCXI5 N1SCXI4 N1SCXI3 N1SCXI2 N1SCXI1 N1SCXI0
15 14 13 12 11 10 9 8
SCXDN1 N1SCXD1 N1SCXD2 N1SCXD3 N1SCXD4 N1SCXD5 N1SCXD6 N1SCXD7 N1SCXD8
180082H 7 6 5 4 3 2 1 0
~ ~ ~ ~ ~ ~ ~ ~
15 14 13 12 11 10 9 8
SCYIN1 ~ ~ ~ ~ ~ N1SCYI10 N1SCYI9 N1SCYI8
180084H 7 6 5 4 3 2 1 0
N1SCYI7 N1SCYI6 N1SCYI5 N1SCYI4 N1SCYI3 N1SCYI2 N1SCYI1 N1SCYI0
15 14 13 12 11 10 9 8
SCYDN1 N1SCYD1 N1SCYD2 N1SCYD3 N1SCYD4 N1SCYD5 N1SCYD6 N1SCYD7 N1SCYD8
180086H 7 6 5 4 3 2 1 0
~ ~ ~ ~ ~ ~ ~ ~
ST-58-R2 123
15 14 13 12 11 10 9 8
SCXN2 ~ ~ ~ ~ ~ N2SCX10 N2SCX9 N2SCX8
180090H 7 6 5 4 3 2 1 0
N2SCX7 N2SCX6 N2SCX5 N2SCX4 N2SCX3 N2SCX2 N2SCX1 N2SCX0
15 14 13 12 11 10 9 8
SCYN2 ~ ~ ~ ~ ~ N2SCY10 N2SCY9 N2SCY8
180092H 7 6 5 4 3 2 1 0
N2SCY7 N2SCY6 N2SCY5 N2SCY4 N2SCY3 N2SCY2 N2SCY1 N2SCY0
15 14 13 12 11 10 9 8
SCXN3 ~ ~ ~ ~ ~ N3SCX10 N3SCX9 N3SCX8
180094H 7 6 5 4 3 2 1 0
N3SCX7 N3SCX6 N3SCX5 N3SCX4 N3SCX3 N3SCX2 N3SCX1 N3SCX0
15 14 13 12 11 10 9 8
SCYN3 ~ ~ ~ ~ ~ N3SCY10 N3SCY9 N3SCY8
180096H 7 6 5 4 3 2 1 0
N3SCY7 N3SCY6 N3SCY5 N3SCY4 N3SCY3 N3SCY2 N3SCY1 N3SCY0
124
The value of the screen scroll value register is effective up to a range not exceeding
the display area of each screen. When the display area is exceeded, the screen of the
display area is repeatedly displayed. All screen scroll values must be identified as
positive values. By changing the value during the horizontal retrace, the scroll value
can also be changed in the middle of the image screen.
ST-58-R2 125
5.2 Expansion/Contraction Function
NBG0 and NBG1 can expand and reduce the entire screen both horizontally and
vertically. Controlling expansion and reduction is done by selecting horizontal and
vertical coordinate increments required in display coordinate calculations. When
reducing in horizontally, the reduction enable register must be set as certain screens
cannot be displayed, depending on this setting.
Display coordinates are calculated by the expressions below.
Note: the fractional part of the calculated results are discarded.
(display coordinate value X) = (coordinate increment X) X (H counter value) + (screen scroll value X)
(display coordinate value Y) = (coordinate increment Y) X (V counter value) + (screen scroll value Y)
Screen expansion and reduction are controlled by setting the horizontal and vertical
coordinate increments in the coordinate increment register. The horizontal coordi-
nate increment is selected by the horizontal coordinate increment integer part bit
and horizontal coordinate increment fractional part bit. The vertical coordinate
increment is selected by the vertical coordinate increment integer part bit and hori-
zontal coordinate increment fractional part bit.
The fractional part bit is added immediately below the integer bit part. Figure 5.2
shows the bit configuration
Hor izon tal and Ver tical Coo rdi na te Incr em ent s
Bit 31 18 15 8 0
126
Coordinate Increment Register
The coordinate increment register designates the coordinate increment when calcu-
lating the coordinates of the scroll screen. This is a write-only 32-bit register located
at addresses 180078H to 18007EH, and 180088H to 18008EH. Because the value of
the register is cleared to 0 after power on or reset, the value must be set.
15 14 13 12 11 10 9 8
ZMXIN0 ~ ~ ~ ~ ~ ~ ~ ~
180078H 7 6 5 4 3 2 1 0
~ ~ ~ ~ ~ N0ZMXI2 N0ZMXI1 N0ZMXI0
15 14 13 12 11 10 9 8
ZMXDN0 N0ZMXD1 N0ZMXD2 N0ZMXD3 N0ZMXD4 N0ZMXD5 N0ZMXD6 N0ZMXD7 N0ZMXD8
18007AH 7 6 5 4 3 2 1 0
~ ~ ~ ~ ~ ~ ~ ~
15 14 13 12 11 10 9 8
ZMYIN0 ~ ~ ~ ~ ~ ~ ~ ~
18007CH 7 6 5 4 3 2 1 0
~ ~ ~ ~ ~ N0ZMYI2 N0ZMYI1 N0ZMYI0
15 14 13 12 11 10 9 8
ZMYDN0 N0ZMYD1 N0ZMYD2 N0ZMYD3 N0ZMYD4 N0ZMYD5 N0ZMYD6 N0ZMYD7 N0ZMYD8
18007EH 7 6 5 4 3 2 1 0
~ ~ ~ ~ ~ ~ ~ ~
15 14 13 12 11 10 9 8
ZMXIN1 ~ ~ ~ ~ ~ ~ ~ ~
180088H 7 6 5 4 3 2 1 0
~ ~ ~ ~ ~ N1ZMXI2 N1ZMXI1 N1ZMXI0
15 14 13 12 11 10 9 8
ZMXDN1 N1ZMXD1 N1ZMXD2 N1ZMXD3 N1ZMXD4 N1ZMXD5 N1ZMXD6 N1ZMXD7 N1ZMXD8
18008AH 7 6 5 4 3 2 1 0
~ ~ ~ ~ ~ ~ ~ ~
15 14 13 12 11 10 9 8
ZMYIN1 ~ ~ ~ ~ ~ ~ ~ ~
18008CH 7 6 5 4 3 2 1 0
~ ~ ~ ~ ~ N1ZMYI2 N1ZMYI1 N1ZMYI0
15 14 13 12 11 10 9 8
ZMYDN1 N1ZMYD1 N1ZMYD2 N1ZMYD3 N1ZMYD4 N1ZMYD5 N1ZMYD6 N1ZMYD7 N1ZMYD8
18008EH 7 6 5 4 3 2 1 0
~ ~ ~ ~ ~ ~ ~ ~
ST-58-R2 127
Coordinate increment bit: Zoom bit (N0ZMXI2 to N0ZMXI0, N0ZMXD1 to
N0ZMXD8, N0ZMYI2 to N0ZMYI0, N0ZMYD1 to N0ZMYD8, N1ZMXI2 to N1ZMXI0, N1ZMXD1 to
N1ZMXD8, N1ZMYI2 to N1ZMYI0, N1ZMYD1 to N1ZMYD8)
Designates horizontal and vertical coordinate increments for calculating display
coordinates when expanding and reducing all Normal scroll screens.
N0ZMXI2~N0ZMXI0 180078H Bit 2~0 For NBG0 horizontal direction (integer part)
N0ZMXD1~N0ZMXD8 18007AH Bit 15~8 For NBG0 horizontal direction (fractional part)
N0ZMYI2~N0ZMYI0 18007CH Bit 2~0 For NBG0 vertical direction (integer part)
N0ZMYD1~N0ZMYD8 18007EH Bit 15~8 For NBG0 vertical direction (fractional part)
N1ZMXI2~N1ZMXI0 180088H Bit 2~0 For NBG1 horizontal direction (integer part)
N1ZMXD1~N1ZMXD8 18008AH Bit 15~8 For NBG1 horizontal direction (fractional part)
N1ZMYI2~N1ZMYI0 18008CH Bit 2~0 For NBG1 vertical direction (integer part)
N1ZMYD1~N1ZMYD8 18008EH Bit 15~8 For NBG1 vertical direction (fractional part)
The coordinate increment should be a value smaller than “1” in the expansion dis-
play, and larger than “1” in the reduction display. The normal display is when the
coordinate increment is 1. Selections are all by positive values. The coordinate parts
of NBG2 and NBG3 are fixed at “1”.
By changing the value during the horizontal retrace, the coordinate increment value
can also be changed.
The reduction enable register must be set when reduction display is horizontal.
Depending on the setting of the reduction enable bit, do not set horizontal coordi-
nate increment to a value other than the set range decided upon. Table 5.1 shows
coordinate increments and reduction settings in the horizontal direction.
128
Reduction Enable Register
The reduction enable register is a write-only 16 bit register that controls the horizon-
tal reduction display, and is located at address 180098H. Because the value of the
register is cleared to 0 after power on or reset, the value must be set.
15 14 13 12 11 10 9 8
ZMCTL ~ ~ ~ ~ ~ ~ N1ZMQT N1ZMHF
180098H 7 6 5 4 3 2 1 0
~ ~ ~ ~ ~ ~ N0ZMQT N0ZMHF
Reduction enable bit: Zoom quarter/half bit (N1ZMQT, N1ZMHF, N0ZMQT, N0ZMHF)
Designates the maximum reducible range of each Normal scroll screen in the hori-
zontal direction.
N0ZMHF 180098H Bit 0 For NBG0
N0ZMQT 180098H Bit 1 For NBG0
N1ZMHF 180098H Bit 8 For NBG1
N1ZMQT 180098H Bit 9 For NBG1
For reduction of up to 1/2, set the corresponding screen character color count (bit
map pattern color count) to 16 or 256 colors. For reduction of up to 1/4, set to 16
colors. The horizontal coordinate increment should not exceed the set range of these
bits.
ST-58-R2 129
Certain screens cannot display depending on the reduction setting. Limits are
shown in Table 5.2.
130
5.3 Line and Vertical Cell Scroll Function
Within the Normal scroll screen, there is a line scroll function and vertical cell scroll
function in NBG0 and NBG1. The line scroll function selects the horizontal and
vertical screen scroll value and horizontal coordinate increment in line units. The
vertical cell scroll function selects the vertical screen scroll value in horizontal cell
units. Both functions can be used without relationship to the cell format and bit map
format.
Horizontal
Line Scroll Table (VRAM) Coordinate
Horizontal Screen Scroll value Increment Scroll Screen
for 1st line
1st Line
Vertical Screen Scroll value for
1st line 2nd Line
Horiz. Coordinate 3rd Line
increment for 1st line
4th Line
Horizontal Screen Scroll value 5th Line
for 2nd line
Vertical Screen Scroll value
for 2nd line
Horiz. Coordinate
increment for 2nd line
Line scroll tables store from small addresses in order of the horizontal screen scroll
value, vertical screen scroll value, and horizontal coordinate increments. Stored line
scroll data is only composed of data required by the line scroll register setting.
ST-58-R2 131
Each horizontal screen scroll value, vertical screen scroll value, and horizontal coor-
dinate increment configuration is identical to the data configuration set in each
register. Figure 5.4 shows the bit configuration of line scroll table data. Table 5.5
shows the configuration of line scroll tables.
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
+OH Intege r Part : 11 b its
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
+2H Fr act iona l Part : 8 bit s
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
+0H Integ er Part : 3 bi ts
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
+2H Fr act iona l Part : 8 bi ts
No te: Shad ed ar ea s ar e ig no re d
132
When selecting horizontal and vertical screen scroll values and
horizontal coordinate increment for every 1 line.
ST-58-R2 133
Vertical Cell Scroll Function
The vertical cell scroll function selects the vertical screen scroll value in horizontal
cell units in each vertically separated area, and is selected by the vertical cell scroll
table stored in VRAM. The data value of the vertical cell scroll table is designated by
relative values. The value selected by the screen scroll value register is added to the
screen scroll value stored in the vertical cell scroll table, becoming the display coor-
dinate. Selection can be done in horizontal 8 dot units when displaying in bit map
format.
NBG0 and NBG1 have the only vertical cell scroll functions inside the Normal scroll
screen. This vertical cell scroll function and mosaic function can not be used simul-
taneously; the mosaic function has priority. Figure 5.6 shows the vertical cell scroll
function.
The bit configuration of the vertical screen scroll value is the same when set in all
registers. Data of the vertical cell scroll table is treated as a table in the order from
data in the left side cell of the TV screen.
When both NBG0 and NBG1 use the vertical cell scroll function, the various vertical
cell scroll table data should be alternately stored in NBG0 and NBG1, one cell at a
time.
134
Figure 5.7 shows the bit configuration of the vertical cell scroll table data. Figure 5.8
shows the vertical cell scroll table configuration.
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
+0H 11 bit integer part
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
+2H 8 bit fractional part
ST-58-R2 135
NBG0 Vertical Cell Scroll
+0AH NBG1 3rd cell vertical screen scroll value (fractional part)
+0CH NBG1 4th cell vertical screen scroll value (integer part)
+0EH NBG1 4th cell vertical screen scroll value (fractional part)
+10H NBG1 5th cell vertical screen scroll value (integer part)
+12H NBG1 5th cell vertical screen scroll value (fractional part)
136
Line and Vertical Cell Scroll Control Register
The line and vertical cell scroll control register is a write-only 16-bit register that
controls the line scroll function and vertical cell scroll function, and is at address
18009AH. Because the value of the register is cleared to 0 after the power is turned
on or reset, the value must be set.
15 14 13 12 11 10 9 8
SCRCTL ~ ~ N1LSS1 N1LSS0 N1LZMX N1LSCY N1LSCX N1VCSC
18009AH 7 6 5 4 3 2 1 0
~ ~ N0LSS1 N0LSS0 N0LZMX N0LSCY N0LSCX N0VCSC
Line Scroll Interval Bit: Line scroll select bit (N0LSS1, N0LSS0, N1LSS1, N1LSS0)
Designates the interval that reads line scroll table data from the table. The interval
changes depending on the interlace of the TV screen.
N0LSS1, N0LSS0 18009AH Bit 5, 4 For NBG0
N1LSS1, N1LSS0 18009AH Bit 13,12 For NBG1
When reading line scroll table data at intervals of two lines or greater, line horizontal
scroll screen value not read and horizontal coordinate increments use line scroll data
that has been previously read. The vertical scroll screen value is calculated from
vertical coordinate increment register value and line scroll data that was previously
read.
ST-58-R2 137
Line zoom enable bit: Line zoom X enable bit (N1LZMX, N0LZMX)
Designates whether expansion-reduction is done horizontally in line units.
N0LZMX 18009AH Bit 3 For NBG0
N1LSCX 18009AH Bit 11 For NBG1
NxLZMX Process
0 Does not scale horizontally per line units
1 Scales horizontally per line units
When using this function, the horizontal coordinate increment must be stored in the
line scroll table of VRAM. Make sure that the horizontal coordinate increment does
not exceed the reduction setting.
Line scroll enable bit (for the vertical screen scroll value): Line scroll Y enable bit (N1LSCY,
N0LSCY)
Designates whether scroll is performed by vertical line units.
N0LSCY 18009AH Bit 2 For NBG0
N1LSCY 18009AH Bit 10 For NBG1
NxLSCY Process
0 Does not scroll vertically per line units
1 Scrolls vertically per line units
When using this function, the vertical screen scroll value must be stored in the line
scroll table of VRAM.
138
Line scroll enable bit (for the horizontal screen scroll value): Line scroll X enable bit (N1LSCX,
N0LSCX)
Designates whether scroll is performed by horizontal line units.
N0LSCX 18009AH Bit 1 For NBG0
N1LSCX 18009AH Bit 9 For NBG1
NxLSCX Process
0 Does not scroll horizontally per line units
1 Scrolls horizontally per line units
When using this function, be sure to store the horizontal scroll screen value in the
VRAM line scroll table.
NxVCSC Process
0 Does not cell-scroll vertically
1 Cell-scrolls vertically
When using the vertical cell scroll function, make sure the access command of the
vertical cell scroll table data read is designated in the VRAM cycle pattern register.
In addition, vertical cell scroll data must be stored in VRAM. The vertical cell scroll
function cannot be used simultaneously with the mosaic function; the mosaic func-
tion has priority.
ST-58-R2 139
Line Scroll Table Address Register
The line scroll table address register is a write-only 32-bit register that selects the
lead address of the line scroll table, and is at addresses 1800A0H to 1800A6H. Be-
cause the value of the register is cleared to 0 after power on or reset, the value must
be set.
15 14 13 12 11 10 9 8
LSTA0U ~ ~ ~ ~ ~ ~ ~ ~
1800A0H 7 6 5 4 3 2 1 0
~ ~ ~ ~ ~ N0LSTA18 N0LSTA17 N0LSTA16
15 14 13 12 11 10 9 8
LSTA0L N0LSTA15 N0LSTA14 N0LSTA13 N0LSTA12 N0LSTA11 N0LSTA10 N0LSTA9 N0LSTA8
1800A2H 7 6 5 4 3 2 1 0
N0LSTA7 N0LSTA6 N0LSTA5 N0LSTA4 N0LSTA3 N0LSTA2 N0LSTA1 ~
15 14 13 12 11 10 9 8
LSTA1U ~ ~ ~ ~ ~ ~ ~ ~
1800A4H 7 6 5 4 3 2 1 0
~ ~ ~ ~ ~ N1LSTA18 N1LSTA17 N1LSTA16
15 14 13 12 11 10 9 8
LSTA1L N1LSTA15 N1LSTA14 N1LSTA13 N1LSTA12 N1LSTA11 N1LSTA10 N1LSTA9 N1LSTA8
1800A6H 7 6 5 4 3 2 1 0
N1LSTA7 N1LSTA6 N1LSTA5 N1LSTA4 N1LSTA3 N1LSTA2 N1LSTA1 ~
Line scroll table address bit (N0LSTA18 to N0LSTA16, N0LSTA15 to N0LSTA1, N1LSTA18 to
N1LSTA16, N1LSTA15 to N1LSTA1)
Designates the lead address of the line scroll table on the VRAM.
N0LSTA18~N0LSTA16 1800A0H Bit 2~0 For NBG0 (upper bit)
N0LSTA15~N0LSTA1 1800A2H Bit 15~1 For NBG0 (lower bit)
N1LSTA18~N1LSTA16 1800A4H Bit 2~0 For NBG1 (upper bit)
N1LSTA15~N1LSTA1 1800A6H Bit 15~1 For NBG1 (lower bit)
The actual lead VRAM address is calculated by the expression below. When the
VRAM has a 4 Mbit capacity, the address of the most significant bit is ignored.
140
Vertical Cell Scroll Table Address Register
The vertical cell scroll table address register is a write-only 32-bit register that selects
the lead address of the vertical cell scroll table, and is at addresses 18009CH to
18009EH. Because the value of the register is cleared to 0 after power on or reset, the
value must be set.
15 14 13 12 11 10 9 8
VCSTAU ~ ~ ~ ~ ~ ~ ~ ~
18009CH 7 6 5 4 3 2 1 0
~ ~ ~ ~ ~ VCSTA18 VCSTA17 VCSTA16
15 14 13 12 11 10 9 8
VCSTAL VCSTA15 VCSTA14 VCSTA13 VCSTA12 VCSTA11 VCSTA10 VCSTA9 VCSTA8
18009EH 7 6 5 4 3 2 1 0
VCSTA7 VCSTA6 VCSTA5 VCSTA4 VCSTA3 VCSTA2 VCSTA1 ~
The actual lead VRAM address is calculated by the expression below. When the
VRAM has a 4 Mbit capacity, the address of the most significant bit is ignored.
ST-58-R2 141
(This page is blank in the original Japanese document)
142
Chapter 6 Rotation Scroll Screen
ST-58-R2 143
Introduction
The rotation scroll screen has two sets of parameter tables called “Rotation param-
eter A” and “Rotation parameter B” that can be simultaneously displayed by various
parameter tables. Besides being stored as rotation parameters in VRAM, the two
sets of parameters can hold various correlated coefficient tables in VRAM.
There are two sets of rotation parameters, rotation parameter A and rotation param-
eter B, each stored in a table. RBG0 can simultaneously display one screen selected
by rotation parameter A or rotation parameter B, or two screens selected by rotation
parameter A and rotation parameter B. RBG1 can display only the screen desig-
nated by rotation parameter B. Table 6.1 shows the relationship between the rotation
scroll screen and rotation parameters.
Rotation parameter A and rotation parameter B can each have a coefficient table;
there can be multiple displays by reading the coefficient data in each line or each
dot. Using rotation parameter A, expansion-reduction rotation of sprite frame
buffers can also be done.
144
Z
X Y
Poi nt on the scr ee n bef or e Poin t disp laye d on the scro ll ma p
co nve rsi on (Sx, Sy, Sz) (X , Y, Z)
From the rotation conversion formula, view coordinates and TV screen coordinates
after conversion are expressed by the following equations.
Xp A B C Px - Cx Cz Mx
Yp = D E F Py - Cy + Cy + My
Zp G H I Pz - Cz Cz Mz
Xs A B C Sx - Cx Cz Mx
Ys = D E F Sy - Cy Cy + My
+
Zs G H I Sz - Cz Cz Mz
ST-58-R2 145
The line of vision that passes through the TV screen after rotational conversion, from
the viewpoint after rotational conversion, is expressed by the equation below.
X - Xp Y - Yp Z - Zp
Xs - Xp = Ys - Yp = Zs - Zp
Because the scroll map is fixed by the XY plane (Z = 0), display coordinates (X, Y) on
the scroll map are found by the equation below.
X = k (Xs – Xp) + Xp
Y = k (Ys – Yp) + Yp
However,
-Zp
k =
Zs - Zp
This “k”, called the perspective conversion coefficient, rotates only in the vertical
direction of the TV screen along the X axis rotation and is fixed in the horizontal
direction. Furthermore, the Y axis rotation only changes in the horizontal direction
of the TV screen, and is fixed in the vertical direction. Z axis rotation is always fixed.
Because the screen prior to rotational conversion is normally identical to the TV
screen, Sx is the horizontal coordinate value (H counter value) in the TV screen, Sy is
the vertical coordinate value (V counter value) in the TV screen, and Sz is 0. The
screen coordinate value when the screen rotates in the vertical axis (SZ axis) is found
by the equations below.
146
Zst = Msz
∆X = a
∆Y = c
∆Xst = b
∆Yst = d
Below are the calculation equations of the display coordinates (X, Y) when perform-
ing both TV screen 3 axis rotation and TV screen rotation from the equations above.
X = kx (Xsp + dX • Hcnt) + Xp
Y = ky (Ysp + dY • Hcnt) + Yp
However,
Xsp = A{(Xst + ∆Xst • Vcnt) – Px} + B{(Yst + ∆Yst • Vcnt) – Py} + C(Zst – Pz)
Ysp = D{(Xst + ∆Xst • Vcnt) – Px} + E{(Yst + ∆Yst • Vcnt) – Py} + F(Zst – Pz)
Xp = A(Px – Cx) + B(Py – Cy) + C(Pz – Cz) + Cx + Mx
Yp = D(Px – Cx) + E(Py – Cy) + F(Pz – Cz) + Cy + My
dX = A • ∆X + B • ∆Y
dY = D • ∆X + E • ∆Y
VDP2 reads per line all parameters from the rotation parameter table stored on
VRAM, calculates Xsp, Ysp, Xp, Yp, dX, dY used for the above calculation equation,
and uses these results to find the display coordinates (X, Y) of each dot. Expansion
reduction coefficients kx and ky usually use values read from the rotational param-
eter table. By using the coefficient table, values in all lines and dots can be changed.
ST-58-R2 147
6.2 Rotation Scroll Screen Display Control
The rotation scroll screen has two surfaces, RBG0 and RBG1. When RBG1 is dis-
played, RBG0 must also be displayed (RBG0 appears when only one surface is
displayed.) The Normal scroll screens can no longer be displayed at that time.
The image data (pattern name table or bitmap pattern) being displayed in the rota-
tion scroll screen cannot be with image data of the Normal scroll screen; neither can
image data of RBG0 and RBG1 be used in common. Furthermore, image data of the
rotation scroll screen must be stored in separate VRAM. Among image data, the
RBG1 pattern name table is stored in VRAM-B1, and character pattern table is stored
in VRAM-B0.
When RBG0 needs coefficient only data with lines, the coefficient table can be stored
in any VRAM bank. Image data must be stored in different banks when required
with dots.
The register that controls the display of the rotation scroll screen has a screen display
enable register and RAM control register. The screen display enable register controls
the screen display and transparency code. The register content is the same as the
Normal scroll screen. See “4.1 Screen Display Control” for details.
148
Color RAM mode bit (CRMD1, CRMD0)
See “3.4 Color RAM mode.”
Set the Color RAM mode to mode 1 when the CRKTE bit is 1. At that time, color
data can no longer be stored because the second half of the color RAM (100800H ~
100FFFH) is used for the coefficient table data.
Rotation data bank select bit: Data bank select bit (RDBSA01, RDBSA00, RDBSA11,
RDBSA10, RDBSB01, RDBSB00, RDBSB11, RDBSB10)
Designates the use objective of the VRAM of the rotation scroll screen. This bit is
only in effect when the rotation scroll screen is displayed.
RDBSA00, RDBSA01 18000EH Bit 1,0 For VRAM-A0 (or VRAM-A)
RDBSA10, RDBSA11 18000EH Bit 3,2 For VRAM-A1
RDBSB00, RDBSB01 18000EH Bit 5,4 For VRAM-B0 (or VRAM-B)
RDBSB10, RDBSB11 18000EH Bit 7,6 For VRAM-B1
When there are no bank partitions in VRAM, the VRAM-A0 bit is used for VRAM-A,
and the VRAM-B0 bit is used for VRAM-B. When coefficient data is not treated as
being needed in all dots, there is no need to set the coefficient table RAM (01B).
When displaying by the bit map format, do not set the pattern name table RAM
(10B). VRAM cycle pattern register settings of the VRAM bank selected in RAM
used for the rotational scroll are ignored. Data will not be read out when there is no
image data read-out address in the selected bank. Therefore, the correct screen can
no longer be displayed.
ST-58-R2 149
When displaying RBG1, 00B must be set in bits used for VRAM-B0 and VRAM-B1.
When the coefficient data read address is not the address within the selected bank,
the coefficient data can not be read properly and therefore correct screen image can
not be displayed. In addition, when storing the coefficient table in the color RAM,
RBG0 coefficient table RAM (01B) must not be set.
150
6.3 Rotation Parameter Control
When displaying the rotation scroll screen, be sure to store the rotation parameter on
which control is performed as a table in VRAM. The rotation scroll screen reads the
rotation parameter tables stored in VRAM for each line. The screen is displayed
according to that value. The rotation parameter is shown below.
ST-58-R2 151
Only Xst, Yst, and KAst among rotation parameters can be read by the first line of
the display screen. The value of Xst, Yst, and KAst (when ∆Xst, ∆Yst, ∆ X, ∆Y, ∆KAst,
and ∆KAx don’t change inside one screen) are expressed by the equation below.
(Screen X coordinate)
= Xst + ∆Xst x (V counter value) + ∆X x (H counter value)
(Screen Y coordinate)
= Yst + ∆Yst x (V counter value) + ∆Y x (H counter value)
Moreover, the first line can be read (in addition to Xst, Yst, and KAst) by setting the
rotation parameter read control register. Values on and after the second lines of Xst,
Yst, and KAst (when ∆Xst, ∆Yst, ∆ X, ∆Y, ∆KAst, and ∆KAx do not change within
screen one) are expressed by the equation below.
(Screen X coordinate)
= Xst
+ ∆Xst x {(V counter value) – (V counter value when Xst is read out)}
+ ∆X x (H counter value)
(Screen Y coordinate)
= Yst
+ ∆Yst x {(V counter value) – (V counter value when Yst is read out)}
+ ∆Y x (H counter value)
The rotation scroll screen has two sets of parameter tables, called “Rotation Param-
eter A” and “Rotation Parameter B.” The display screen of RBG1 is carried out by
rotation parameter B. RBG0 selects which of the two sets of parameter tables is
used, and can change within the display screen. Through this, RBG0 can simulta-
neously display two different rotation scroll screens on one screen.
152
In addition, the rotation parameter table moves by storing rotation parameter tables
using RBG0 and RBG1, and does not always have to store two sets of rotation pa-
rameter tables.
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
+0 H Sig n 12 bi t integ er par t
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
+2 H 10 bi t fract ion al par t
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
+0 H Sign 2 bi t
int eg er
par t
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
+2 H 10 bi t fract ion al par t
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
+0 H Sign 2 bi t
integ er
pa rt
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
+2 H 10 bi t fract ion al par t
ST-58-R2 153
Rotation Matrix Parameter (A, B, C, D, E, F)
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Sign 3 bit
+0H
integer part
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
+2H 10 bit fractional part
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Sign 13 bit integer part
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Sign 13 bit integer part
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
+0H Sign 13 bit integer part
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
+2H 10 bit fractional part
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
+0H Sign 7 bit integer part
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
+2H 16 bit fractional part
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
+2H 10 bit fractional part
154
Coef fici en t tabl e ver tical add re ss incr em en t (∆KAst )
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
+0 H Sig n 9 bit int eg er pa rt
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
+2 H 10 bi t fra ct ion al par t
Coe ffici en t tabl e hor izon tal add re ss incr em ent (∆KAx)
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
+0 H Sign 9 bi t int eg er pa rt
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
+2 H 10 bi t fra ct ion al par t
ST-58-R2 155
+00H Screen Start Coordinate Xst (Integer Part)
156
When storing two sets of tables of rotation parameter A and rotation parameter B,
store the rotation parameter A from the lead address of the rotation parameter table,
then enter the 20H part of invalid data and store tables of rotation parameter B. The
rotation parameter table does not always have to store two sets, but can store only
the tables needed. Figure 6.4 shows the method of storing two sets of tables from
rotation parameters A and B.
+00H
+5E H
+60 H The da ta in this ar ea is not used as
rot ation pa ra met er
+7E H
+80 H
+DE H
+EOH
15 14 13 12 11 10 9 8
RPRCTL ~ ~ ~ ~ ~ RBKASTRE RBYSTRE RBXSTRE
1800B2H 7 6 5 4 3 2 1 0
~ ~ ~ ~ ~ RAKASTRE RAYSTRE RAXSTRE
ST-58-R2 157
Parameter read enable bit (RAXSTRE, RBXSTRE, RAYSTRE, RBYSTRE, RAKASTRE,
RBKASTRE)
Designates the coefficient table start address KAst and TV screen start coordinates
Xst and Yst, and whether to read from the rotation parameter table in that line.
RxSTRE Process
0 Selected parameters are not read for that line
1 Selected parameters are read for that line
Note: AX, BX, AY, BY, AKA, or BKA is entered in bit name for x.
If this bit is 1, selected parameters are read when the next rotation parameters are
read. At the same time, this bit is cleared to 0. Therefore, to read parameters for
each 1 line, this bit must be set to 1 for each line.
15 14 13 12 11 10 9 8
RPTAU ~ ~ ~ ~ ~ ~ ~ ~
1800BCH 7 6 5 4 3 2 1 0
~ ~ ~ ~ ~ RPTA18 RPTA17 RPTA16
15 14 13 12 11 10 9 8
RPTAL RPTA15 RPTA14 RPTA13 RPTA12 RPTA11 RPTA10 RPTA9 RPTA8
1800BEH 7 6 5 4 3 2 1 0
RPTA7 RPTA6 RPTA5 RPTA4 RPTA3 RPTA2 RPTA1 ~
158
Rotation parameters table address bit (RPT
A18 to RPTA1)
Designates the lead address of rotation parameter tables.
RPTA18~RPTA16 1800BCH Bit 2~0
RPTA15~RPTA1 1800BEH Bit 15~1
RPTA6 bit is ignored even if data is written. The bit is set at 0 for rotation parameter
A, and fixed at 1 for rotation parameter B.
The actual lead address of a rotation parameter table is calculated as shown in the
equation below. When the VRAM size is 4 Mbit, the most significant bit of the
address is ignored.
For example, when 00170H or 00130H is selected, the lead address of rotation pa-
rameter A is 00260H, and the lead address of rotation parameter B is 002E0H.
Note: In order to read frame buffer rotation using rotation parameter A, VDP1 TV mode must be set
to rotation 16 or rotation 8. For details, please refer to VDP1 user manual.
ST-58-R2 159
Rotation parameters
Rotation Parameter Changetable address bit (RPTA18 to RPTA1)
Designates the lead address of rotation parameter tables.
RBG0 indicates which of two sets of rotation parameter tables is used, and can
change in part the rotation parameter on one screen display. The method of using
the rotation parameter can be selected from the four rotation parameter modes
below.
RPTA6 bit is ignored even if data is written. The bit is set at 0 for rotation parameter
A, and
Mode 0:
fixed at 1 for rotation parameter B.
Uses rotation parameter A
Mode 1: Uses rotation parameter B
The actual lead address of a rotation parameter table is calculated as shown in the
Mode 2: Changes the image by coefficient data read from the coefficient table of rotation
equation below.
parameter A When the VRAM size is 4 Mbit, the most significant bit of the
address
Mode 3: is ignored.
Changes by the rotation parameter window.
Image ob tai ne d
throug h ro tat io n The MSB=0 par t of the co ef fici ent
par am et er A tab le for ro tat io n par am eter A.
Rot ation Para met er Mo de 3: Switche d thr ou gh Rot ation Para me ter Wind ow an d di spl aye d.
Ima ge ob tai ned thr ough The pa rt di sp la yed witho ut cut tin g the scre en in
rot at ion par am et er A tran spa re nt pr oce ssin g wi ndo w.
ST-58-R2 161
Rotation Parameter Mode Register
The rotation parameter mode register is a write-only 16 bit register that controls
rotation parameter tables used in RBG0, and is at address 1800B0H. Because the
value is cleared to 0, it must be set after power on or reset.
15 14 13 12 11 10 9 8
RPMD ~ ~ ~ ~ ~ ~ ~ ~
1800B0H 7 6 5 4 3 2 1 0
~ ~ ~ ~ ~ ~ RPMD1 RPMD0
The value of this bit is always in effect, therefore, be careful in timing reloading.
When mode 2 is selected, coefficient data cannot be read to each dot from the coeffi-
cient table for rotation parameter B while coefficient data for rotation parameter A is
being read to each dot. Therefore, the designation is ignored even if a register is
designated so that coefficient data is read to each dot from the coefficient table used
for rotation parameter B.
In mode 3, coefficient data can be read to each dot in both coefficient tables for
rotation parameter A and B.
Mode 0 must be set when displaying RBG1.
162
6.4 Coefficient Table Control
The rotation scroll screen stores parameters used in calculating display coordinates
in VRAM or color RAM in a table separate from the rotation parameter table, and
can express various images by reading parameters per line or per dot. This table is
referred to as “coefficient table.”
The timing required for the coefficient table data, depending on how display coordi-
nates are calculated, falls under the following cases:
When coefficient table data is required per line, the coefficient table must be stored
in VRAM. The VRAM address to read the stored coefficient table data is specified
via KAst, ∆KAst, and ∆KAx in rotation parameter table and coefficient table address
offset register.
When coefficient table data is required per dot, the coefficient table must be stored in
either VRAM or color VRAM. When stored in VRAM, at least 1 bank in RAM control
register “rotation data bank selection” must be selected to become coefficient table.
The VRAM address to read the stored coefficient table data is specified via KAst,
∆KAst, and ∆KAx in rotation parameter table and coefficient table address offset
register. Also, when storing coefficient table in color RAM, it should be stored in the
latter half of color RAM (100800H to 100FFFH). The color RAM address to read the
stored coefficient table data is specified via KAst, ∆KAst, and ∆KAx in rotation
parameter table. As for the address to read coefficient table data, only the lower 10
bits in the integer part of the calculated coefficient table address become valid.
To select parameters for which the data read from the coefficient table are to be used,
the following 4 modes (coefficient data modes) are provided:
In mode 0, kx and ky read from the rotation parameter table become invalid; data
read from the coefficient table is used as kx and ky.
When mode 1 is selected, ky read from the rotation parameter table is used, but data
read from the coefficient table is used for kx.
ST-58-R2 163
When mode 2 is selected, kx read from the rotation parameter table is used, but data
read from the coefficient table is used for ky.
When mode 3 is selected, X direction viewpoint coordinate Xp, converted
rotationally as data read from the rotation parameter table, becomes invalid. Data
read from the coefficient table is used for Xp.
When specifying mode 0 for rotation parameter mode, line color screen per rotation
parameter A coefficient table is used. When specifying mode 1, line color screen per
rotation parameter B coefficient table is used.
When specifying mode 2, for both rotation parameter A graphics and rotation pa-
rameter B graphics, line color screen per rotation parameter A coefficient table is
used.
When specifying mode 3, for rotation parameter A graphics, line color screen per
rotation parameter A coefficient table is used, whereas for rotation parameter B
graphics, line color screen per rotation parameter B coefficient table is used.
Also, when displaying RBG1, for both RBG0 and RBG1, line color screen per rotation
parameter A coefficient table is used.
164
Bit Configuration of Coefficient Table Data
Either “1-word” or “2-word” can be chosen as the data size on the coefficient table.
The data configuration changes depending on this coefficient data size and coeffi-
cient data mode. Figure 6.7 shows the bit configuration of coefficient table data.
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
+2 H 16 bi t fra ct ion al par t
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
+2 H Int eg er pa rt LS B 8 bi ts 8 bi t fra ct ion al par t
ST-58-R2 165
Coefficient Table Lead Address
The coefficient table lead address is obtained from the coefficient table start address
(KAst integer part 16-bit) read from the coefficient table address offset register and
rotation parameter table. The coefficient table vertical address increment (∆KAst
integer part 9-bit) and coefficient table horizontal address increment (∆KA integer
part 9-bit) are also read from the rotation parameter table.
The address value of the address offset, start address and address increment change
according to the data size of the coefficient table. Table 6.3 shows the address value
showing the least significant bit of each value. For example, when 4H is 2-word (the
least significant bit of integer KAst signifies the expression of the 4H address value),
it can be calculated as shown below.
Table 6.3 Address values shown by the least significant bits of coefficient parameter data
of separate coefficient data sizes
Coefficient Address Value Indicated by the LSB
Data Size Coefficient Table Address KAst, ∆KAst, ∆KAx Integer
Offset Register Value part value
2 Words 40000H 4H
1 Word 20000H 2H
166
Table 6.4 Image processing using RBG0 coefficient data MSB value
Rotation Rotation MSB Function MSB Value Image Process
Parameter Parameter
Mode
A Transparent 0 Displays image obtained using the
coefficient data
0 1 Forces the dot to be transparent
using the coefficient data
B Not Used - -
A Not Used - -
1 B Transparent 0 Displays image obtained using the
coefficient data
1 Forces the dot to be transparent
using the coefficient data
A Parameter 0 Displays image obtained using the
coefficient data
2 Switching 1 Invalidates the coefficient data and
displays image obtained using
rotation parameter B
B Transparent 0 Displays image obtained using the
coefficient data
1 Forces the dot to be transparent
using the coefficient data
3 A, B Transparent 0 Displays image obtained using the
coefficient data
1 Forces the dot to be transparent
using the coefficient data
ST-58-R2 167
Color RAM Mode Bit: (CRMD1, CRMD0), bits 13 and 12
Please see color RAM mode in 3.4.
When CRKTE is set to 1, please set color RAM mode to 1. Here, the latter half of the
color RAM (100800H-100FFFH) will be used for coefficient table data, therefore, the
color data cannot be stored.
VRAM Mode Bit: (VRAMD, VRBMD), bits 9 and 8
Please see VRAM bank partition in 3.2.
Rotation Data Bank Select Bit: (RDBSA00-11, RDBSB00-11), bits 7 through 0
Please see rotation scroll display control in 6.2.
When CRKTE is set to 1, VRAM bank 4 may not be selected to be used as coefficient
table data RAM.
This bit uses the corresponding coefficient table and is effective only when the data
size is 2-word.
RxKLCE Process
0 Line color screen data within coefficient data is not used
1 Line color screen data within coefficient data is used
168
Coefficient data mode bit: Coefficient mode bit (RAKMD1, RAKMD0, RBKMD1, RBKMD0)
Designates what parameters the coefficient data is used as.
RAKMD1, RAKMD0 1800B4H Bit 3,2 For Rotation Parameter A
RBKMD1, RBKMD0 1800B4H Bit 11,10 For Rotation Parameter B
This bit is in effect only when the corresponding coefficient table is used.
RxKDBS Coefficient Data Size
0 2 Words
1 1 Word
Note: A or B is entered in the bit name for x.
RxKTE Process
0 Do not use coefficient table
1 Use coefficient table
ST-58-R2 169
Coefficient Table Address Offset Register
Coefficient table address offset register is a write-only 16-bit register that designates
the coefficient table lead address offset value, and is at address 1800B6H. Because
the value is cleared to 0, it must be set after power on or reset.
15 14 13 12 11 10 9 8
KTAOF ~ ~ ~ ~ ~ RBKTAOS2 RBKTAOS1 RBKTAOS0
1800B6H 7 6 5 4 3 2 1 0
~ ~ ~ ~ ~ RAKTAOS2 RAKTAOS1 RAKTAOS0
These bits are added to the highest coefficient table start address (KAst) read from
the rotation parameter table. The actual lead address of the coefficient table changes
according to the size of the coefficient data, and is calculated by the expression
below. When VRAM size is 4 Mbits, the most significant bit of the address is ig-
nored.
When the coefficient data size is 2 word:
(coefficient table lead address)
= (coefficient table address offset register value lowest 2 bits)
X 40000H + (KAst integer part 16 bit) X 4H
170
Chapter 7 Line Screen
Introduction ..........................................................................172
7.1 Line Color Screen .......................................................172
Line Color Screen Table Address Register .............. 174
7.2 Back Screen ................................................................175
Back Screen Table Address Register ....................... 176
ST-58-R2 171
Introduction
There are two line screen surfaces: the line color screen (LNCL) and the back screen
(BACK). The line screen designates the color in each line, or the entire screen in a
single color. Unlike the scroll screen, the line screen cannot display characters. The
line color screen stores the data of each line in VRAM as a line color screen table. If
single colored, lead data of the table is used in the entire screen. The line screen is
shown in Figure 7.1.
Line Screen Table (VRAM) Line Screen
Line Screen Data for
1st Line 1st Line
Note: In the case of single color, the 1st line data is used in the entire screen.
The line color screen is used only for color calculations, and chooses whether to
designate the entire screen in a single color, or designate the color for each line. The
color RAM address of the color used is stored in VRAM as line color screen data.
The line number designated by one line color screen data changes, depending on the
interlace setting. The non-interlace and double-density interlace modes can desig-
nate the color for each line; the single-density interlace mode can designate for each
two lines.
The line color screen can also be made to rotate if line color screen data is used
within coefficient data. For more about coefficient data see section “6.4 Coefficient
Table Control.” Figure 7.2 shows the configuration of the line color screen table
separate of the interlace mode. Figure 7.3 shows the configuration of data on the
line color screen table.
172
Non-interlace and double-density interlace mode
Bit 15 Line Color Screen Table (VRAM) 0
+00H 1st Line Color RAM Address
+02H 2nd Line Color RAM Address
+04H 3rd Line Color RAM Address
+06H 4th Line Color RAM Address
+08H 5th Line Color RAM Address
+0AH 6th Line Color RAM Address
Note: In the case of single color, the first line color RAM
address is used in the entire line color screen. In th
case of double-density interlace, line data of odd an
even fields are stored together.
Note: In the case of single color, the first and second line
color RAM addresses are used in the entire line
color screen.
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
11 bit color Ram address
Note: Shaded areas are ignored. Also, when color RAM is in mode 0 or mode 2,
the MSB of the address is ignored.
ST-58-R2 173
Line Color Screen Table Address Register
The line color screen table address register is a 32-bit register, and designates the
lead address of the table and the color mode of the line color screen. Its addresses
are 1800A8H through 1800AAH. Because the value is cleared to 0, it must be set
after power on, or reset.
15 14 13 12 11 10 9 8
LCTAU LCCLMD ~ ~ ~ ~ ~ ~ ~
1800A8H 7 6 5 4 3 2 1 0
~ ~ ~ ~ ~ LCTA18 LCTA17 LCTA16
15 14 13 12 11 10 9 8
LCTAL LCTA15 LCTA14 LCTA13 LCTA12 LCTA11 LCTA10 LCTA9 LCTA8
1800AAH 7 6 5 4 3 2 1 0
LCTA7 LCTA6 LCTA5 LCTA4 LCTA3 LCTA2 LCTA1 LCTA0
Line color screen mode bit: LNCL color mode bit (LCCLMD), bit 15
Designates the color mode of the line color screen.
LCCLMD Line Color Screen Color
0 Single color
1 Select per each line
Line color screen table address bit: LNCL table address bit (LCTA18 to LCTA0)
Designates the lead address of the line color screen table on the VRAM.
LCTA18~LCTA16 1800A8H Bit 2~0
LCTA15~LCTA0 1800AAH Bit 15~0
The actual lead VRAM address is calculated by the expression below. When the
VRAM size is 4 Mbits, the most significant bit of the address is ignored.
174
7.2 Back Screen
The back screen (BACK) is displayed only when other screens aren’t, and chooses
whether to designate a single color for the entire screen or for each line. Color data
used by a line is designated by each 5-bit RGB. The non-interlace and double-den-
sity interlace mode designates the color in each line, but the single-density interlace
mode can designate only in each two lines. Figure 7.4 shows the configuration of the
back screen table by the interlace mode. Figure 7.5 shows the configuration of data
on the back screen table.
Note: In the case of single color, the first line RGB data is us
in the entire line color screen. In the case of
double-density interlace, line data of odd and even fiel
are stored together.
Note: In the case of single color, the first and second line RGB
data are used in the entire line color screen.
ST-58-R2 175
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
5 bit Blue Data 5 bit Green Data 5 bit Red Data
Note: Shaded area is ignored. Add 0 bit 3 bits at a time to the lower bits of
RGB to make 8 bits.
15 14 13 12 11 10 9 8
BKTAL BKTA15 BKTA14 BKTA13 BKTA12 BKTA11 BKTA10 BKTA9 BKTA8
1800AEH 7 6 5 4 3 2 1 0
BKTA7 BKTA6 BKTA5 BKTA4 BKTA3 BKTA2 BKTA1 BKTA0
Back screen color mode bit: BACK color mode bit (BKCLMD), bit 15
Designates color mode of the back screen.
BKCLMD Back Screen Color
0 Single color
1 Select per each line
Back screen table address bit: BACK color table address bit (BKTA18 to BKTA0)
Designates the lead address of the back screen table on the VRAM.
BKTA18~BKTA16 1800ACH Bit 2~0
BKTA 15~BKTA0 1800AEH Bit 15~0
176
The actual lead VRAM address is calculated by the expression below. When the
VRAM capacity is 4 Mbits, the most significant bit of the address is ignored.
When the back screen color mode bit is set to “single color”, color data selected by
the back screen table address bit is used in the entire screen.
ST-58-R2 177
(This page is blank in the original Japanese document)
178
Chapter 8 Windows
ST-58-R2 179
8.1 Window Area
The scroll IC window has two Normal windows, W0 and W1, and one sprite win-
dow, SW. The Normal window selects start and end coordinates on the TV screen;
the sprite window designates the most significant bit value of sprite data written to
the frame buffer. Various windows can designate which scroll screen is to be put
into effect, and whether the inside or outside of the area will go into effect. More-
over, when more than one window is used, they can be overlapped other by AND or
OR logic.
The Normal window selects the Normal rectangular window designated through
the horizontal and vertical start and end coordinates, and selects the Normal line
window designated through horizontal start and end coordinates in each line. The
start and end coordinates set the coordinate values on the TV screen in each register,
and not on the scroll screen.
Window
Inside
Window Boundary
180
Window Position Register
The window position register is a write-only 16-bit register that selects the horizon-
tal and vertical start and end coordinates of the Normal window, and is located from
addresses 1800C0H through 1800CEH. Because the value is cleared to 0, it must be
set after power on or reset.
15 14 13 12 11 10 9 8
WPSX0 ~ ~ ~ ~ ~ ~ W0SX9 W0SX8
1800C0H 7 6 5 4 3 2 1 0
W0SX7 W0SX6 W0SX5 W0SX4 W0SX3 W0SX2 W0SX1 W0SX0
15 14 13 12 11 10 9 8
WPSY0 ~ ~ ~ ~ ~ ~ ~ W0SY8
1800C2H 7 6 5 4 3 2 1 0
W0SY7 W0SY6 W0SY5 W0SY4 W0SY3 W0SY2 W0SY1 W0SY0
15 14 13 12 11 10 9 8
WPEX0 ~ ~ ~ ~ ~ ~ W0EX9 W0EX8
1800C4H 7 6 5 4 3 2 1 0
W0EX7 W0EX6 W0EX5 W0EX4 W0EX3 W0EX2 W0EX1 W0EX0
15 14 13 12 11 10 9 8
WPEY0 ~ ~ ~ ~ ~ ~ ~ W0EY8
1800C6H 7 6 5 4 3 2 1 0
W0EY7 W0EY6 W0EY5 W0EY4 W0EY3 W0EY2 W0EY1 W0EY0
15 14 13 12 11 10 9 8
WPSX1 ~ ~ ~ ~ ~ ~ W1SX9 W1SX8
1800C8H 7 6 5 4 3 2 1 0
W1SX7 W1SX6 W1SX5 W1SX4 W1SX3 W1SX2 W1SX1 W1SX0
15 14 13 12 11 10 9 8
WPSY1 ~ ~ ~ ~ ~ ~ ~ W1SY8
1800CAH 7 6 5 4 3 2 1 0
W1SY7 W1SY6 W1SY5 W1SY4 W1SY3 W1SY2 W1SY1 W1SY0
15 14 13 12 11 10 9 8
WPEX1 ~ ~ ~ ~ ~ ~ W1EX9 W1EX8
1800CCH 7 6 5 4 3 2 1 0
W1EX7 W1EX6 W1EX5 W1EX4 W1EX3 W1EX2 W1EX1 W1EX0
15 14 13 12 11 10 9 8
WPEY1 ~ ~ ~ ~ ~ ~ ~ W1EY8
1800CEH 7 6 5 4 3 2 1 0
W1EY7 W1EY6 W1EY5 W1EY4 W1EY3 W1EY2 W1EY1 W1EY0
ST-58-R2 181
Window position bit (for horizontal coordinates): Window start/end X bit (W0SX9 to W0SX0,
W0EX9 to W0EX0, W1SX9 to W1SX0, W1EX9 to W1EX0)
Designates the horizontal start and end coordinates. Designated coordinate value is
the coordinate value (H counter value) on the TV screen.
W0SX9~W0SX0 1800C0H Bit 9~0 For W0 start point coordinates
W0EX9~W0EX0 1800C4H Bit 9~0 For W0 end point coordinates
W1SX9~W1SX0 1800C8H Bit 9~0 For W1 start point coordinates
W1EX9~W1EX0 1800CCH Bit 9~0 For W1 end point coordinates
The bit configuration of the register changes according to the setting of the graphics
mode. For normal graphics, the least significant bit becomes invalid data. For
exclusive normal graphics, the most significant bit becomes invalid data; moreover,
for special high-resolution graphics, the most significant bit becomes invalid data.
Since it doesn’t have an HO bit, values are in 2 pixel units. Table 8.1 shows the bit
content of the window position register by graphic mode setting.
Table 8.1 Bit content of window position register for horizontal coordinates
Graphics WxxX9 WxxX8 WxxX7 WxxX6 WxxX5 WxxX4 WxxX3 WxxX2 WxxX1 WxxX0
Mode
Normal H8 H7 H6 H5 H4 H3 H2 H1 H0 Invalid
Hi-Res H9 H8 H7 H6 H5 H4 H3 H2 H1 H0
Exclusive Invalid H8 H7 H6 H5 H4 H3 H2 H1 H0
Normal
Exclusive Invalid H9 H8 H7 H6 H5 H4 H3 H2 H1
Hi-Res
Window position bit (for vertical coordinates): Window start/end Y bit (W0SY8 to W0SY0,
W0EY8 to W0EY0, W1SY8 to W1SY0, W1EY8 to W1EY0)
Designates the vertical start and end coordinates. The designated coordinate value
is the coordinate value (V counter value) on the TV screen.
W0SY8~W0SY0 1800C2H Bit 8~0 For W0 start point coordinates
W0EY8~W0EY0 1800C6H Bit 8~0 For W0 end point coordinates
W1SY8~W1SY0 1800CAH Bit 8~0 For W1 start point coordinates
W1EY8~W1EY0 1800CEH Bit 8~0 For W1 end point coordinates
The bit configuration of the register changes according to the screen mode setting.
Single-density interlace of Normal and high-resolution modes designate the V
counter value in the respective even-numbered and odd-numbered fields.
182
The lowest significant bit is invalid for the double-density interlace of Normal and
high-resolution modes. Remaining bits designate the V counter value in various
fields. Bit content of the window position register by setting of the screen mode is
shown in Table 8.2.
Table 8.2 Bit content of the window position register used for vertical coordinates
TV Screen WxxY8 WxxY7 WxxY6 WxxY5 WxxY4 WxxY3 WxxY2 WxxY1 WxxY0
(Interlace) Mode
Normal, Hi-Res V8 V7 V6 V5 V4 V3 V2 V1 V0
(Non-interlace,
Single-Density
Interlace)
Normal, Hi-Res V7 V6 V5 V4 V3 V2 V1 V0 Invalid
(Double-Density
Interlace)
Exclusive Monitor V8 V7 V6 V5 V4 V3 V2 V1 V0
ST-58-R2 183
Normal Line Window
The Normal line window stores the horizontal start and end coordinates of each
window line as a table in VRAM, and is obtained by designating the vertical start
and end coordinates in the window position register. The area surrounded by se-
lected coordinates is inside, the rest of the area is outside. The border line of the
window is considered part of the inside. The Normal line window is illustrated in
Figure 8.2.
The bit configuration of data stored in the line window table of horizontal start and
end coordinates is shown in Figure 8.3.
Coordinates in each line can be selected in the non-interlace and double-density
interlace modes, and in the single-density interlace mode for each two lines. Con-
figuration of the Normal line window table is shown in Figure 8.4.
If the start coordinate of either the horizontal or vertical direction is larger than the
end coordinate, then the whole screen is considered an area outside the window.
TV Screen
Outside
Vertical Start
Point
Window Coordinates
Inside
Vertical End
Point
Coordinates
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
+0H Horizontal Start Point Coordinates (10 bits)
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
+2H Horizontal End Point Coordinates (10 bits)
184
Non-interlace or double-density interlace
Single-density interlace
ST-58-R2 185
Line Window Table Address Register
The line window table address register is a write-only 16-bit register that designates
whether to make the Normal window the line window, as well as the lead address of
that table. It is located from addresses 1800D8H through 1800DEH. Because the
value is cleared to 0, it must be set after power on or reset.
15 14 13 12 11 10 9 8
LWTA0U W0LWE ~ ~ ~ ~ ~ ~ ~
1800D8H 7 6 5 4 3 2 1 0
~ ~ ~ ~ ~ W0LWTA18 W0LWTA17 W0LWTA16
15 14 13 12 11 10 9 8
LWTA0L W0LWTA15 W0LWTA14 W0LWTA13 W0LWTA12 W0LWTA11 W0LWTA10 W0LWTA9 W0LWTA8
1800DAH 7 6 5 4 3 2 1 0
W0LWTA7 W0LWTA6 W0LWTA5 W0LWTA4 W0LWTA3 W0LWTA2 W0LWTA1 ~
15 14 13 12 11 10 9 8
LWTA1U W1LWE ~ ~ ~ ~ ~ ~ ~
1800DCH 7 6 5 4 3 2 1 0
~ ~ ~ ~ ~ W1LWTA18 W1LWTA17 W1LWTA16
15 14 13 12 11 10 9 8
LWTA1L W1LWTA15 W1LWTA14 W1LWTA13 W1LWTA12 W1LWTA11 W1LWTA10 W1LWTA9 W1LWTA8
1800DEH 7 6 5 4 3 2 1 0
W1LWTA7 W1LWTA6 W1LWTA5 W1LWTA4 W1LWTA3 W1LWTA2 W1LWTA1 ~
WxLWE Process
0 Does not process Normal Window to Line Window
1 Processes Normal Window to Line Window
When this bit is “1”, the line window table must be stored in VRAM.
186
Line window table address bit (W0LWTA18 to W0LWTA1, W1LWTA18 to W1LWTA1)
Designates the lead address of the line window table in VRAM.
W0LWTA18~W0LWTA16 1800D8H Bit 2~0 For W0
W0LWTA15~W0LWTA1 1800DAH Bit 15~1 For W0
W1LWTA18~W1LWTA16 1800DCH Bit 2~0 For W1
W1LWTA15~W1LWTA1 1800DEH Bit 15~1 For W1
The actual lead address is calculated by the expression below. The most significant
bit of the address is ignored when VRAM is 4 Mbits.
Sprite Window
The sprite window is obtained by selecting the most significant bit of data when all
frame buffer data of the sprite is palette format data and sprite types are 2 through 7.
The most significant single bit is inside, and the rest of the area is outside. For more
about sprite types see “Sprite types” in section “9.1 Sprite Data.” Figure 8.5 shows a
sprite window.
Frame Buffer
MSB
TV Screen
1 1 0 0 0 0 1 1
1 1 1 0 0 1 1 1 Window
1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 Inside
1 1 1 1 1 1 1 1
1 1 1 0 0 1 1 1
1 1 0 0 0 0 1 1 Outside
ST-58-R2 187
Sprite Control Register
The sprite control register controls sprites. This is a write-only 16-bit register that is
at address 1800E0H. Because the value is cleared to 0, it must be set after power on
or reset.
15 14 13 12 11 10 9 8
SPCTL ~ ~ SPCCCS1 SPCCCS0 ~ SPCCN2 SPCCN1 SPCCN0
1800E0H 7 6 5 4 3 2 1 0
~ ~ SPCLMD SPWINEN SPTYPE3 SPTYPE2 SPTYPE1 SPTYPE0
This bit is only effective when the sprite color mode is mode 0, and for only sprites
2 to 7. WHen this bit is “1”, the most significant bit of the sprite frame buffer is used
as the bit for the sprite window. As a result, MSB shadow can no longer be used.
For more about shadows see “14.1 Shadow Process.”
Do not set this bit to 1, when setting SPCLMD bit to 1.
188
Window’s Active Area for the Screen
Normal and sprite windows can designate whether to use a window in each scroll
screen. The window being used can select inside or outside, in each window, as well
as perform color calculation and transparent processes in active areas. When using
multiple windows, the method of overlap can be selected from AND or OR logic.
Figure 8.6 shows the active area when normal and sprite windows are overlaid by
AND or OR logic.
Inside Outside
Outside
Inside
Outside Inside
ST-58-R2 189
8.2 Window Process
The transparency process window forces the selected window effective area to be
transparent, and can be used in each screen.
When displaying the RBG0 screen, the rotation parameter window designates the
area displaying the image obtained by rotation parameter A, and designates which
image obtained by rotation parameter B is displayed. Images obtained by rotation
parameter B are displayed in the active area of the designated window; images
obtained by rotation parameter A are displayed outside the window’s active area.
The color calculation window is a window in which color calculation in the active
area of the designated window is not performed, and is effective for screens using
the color calculation function.
190
Window process is shown in Figure 8.7.
ABCDEFGHIJKLMNOPQ
Transparent RSTUVWXYZABCDEFGH
IJKLMNOPQRSTUVWXY
ZABCDEFGHIJKLMNOP
QRSTUVWXYZABCDEFG
HIJKLMNOPQRSTUVWX
Screen A Screen B
ABCDEFGHIJKLMNOPQ
RSTUVWXYZABCDEFGH
IJKLMNOPQRSTUVWXY
ZABCDEFGHIJKLMNOP
QRSTUVWXYZABCDEFG
HIJKLMNOPQRSTUVWX
Window
Enabled
Area
ABCDEFGHIJKLMNOPQ
RSTUVWXYZABCDEFGH
IJKLMNOPQRSTUVWXY Screen A Transparency
ZABCDEFGHIJKLMNOP Processing Window
QRSTUVWXYZABCDEFG
HIJKLMNOPQRSTUVWX
Display Image
Window
Enabled
Area
Rotation Parameter
Window
Image A Image B
Display Image
ST-58-R2 191
Color Calculation Window
Transparent
Window
Enabled
Area
Display Image
192
Window Control Register
Window control register designates the method for using windows in each screen,
and is a write-only 16-bit register that is located from addresses 1800D0H through
1800D6H. Because the value is cleared to 0, it must be set after power on or reset.
15 14 13 12 11 10 9 8
WCTLA N1LOG ~ N1SWE N1SWA N1W1E N1W1A N1W0E N1W0A
1800D0H 7 6 5 4 3 2 1 0
N0LOG ~ N0SWE N0SWA N0W1E N0W1A N0W0E N0W0A
15 14 13 12 11 10 9 8
WCTLB N3LOG ~ N3SWE N3SWA N3W1E N3W1A N3W0E N3W0A
1800D2H 7 6 5 4 3 2 1 0
N2LOG ~ N2SWE N2SWA N2W1E N2W1A N2W0E N2W0A
15 14 13 12 11 10 9 8
WCTLC SPLOG ~ SPSWE SPSWA SPW1E SPW1A SPW0E SPW0A
1800D4H 7 6 5 4 3 2 1 0
R0LOG ~ R0SWE R0SWA R0W1E R0W1A R0W0E R0W0A
15 14 13 12 11 10 9 8
WCTLD CCLOG ~ CCSWE CCSWA CCW1E CCW1A CCW0E CCW0A
1800D6H 7 6 5 4 3 2 1 0
RPLOG ~ ~ ~ RPW1E RPW1A RPW0E RPW0A
Window logic bit: Logic bit (N0LOG, N1LOG, N2LOG, N3LOG, R0LOG, SPLOG, RPLOG, CCLOG)
Designates the method of overlapping windows used in each screen.
N0LOG 1800D0H Bit 7 Transparent Process Window for NBG0 (or RBG1)
N1LOG 1800D0H Bit 15 Transparent Process Window for NBG1 (or EXBG)
N2LOG 1800D2H Bit 7 Transparent Process Window for NBG2
N3LOG 1800D2H Bit 15 Transparent Process Window for NBG3
R0LOG 1800D4H Bit 7 Transparent Process Window for RBG0
SPLOG 1800D4H Bit 15 Transparent Process Window for Sprite
RPLOG 1800D6H Bit 7 For Rotation Parameter Window
CCLOG 1800D6H Bit 15 For Color Calculation Window
ST-58-R2 193
xxLOG Overlaid Logic
0 OR
1 AND
Note: N0, N1, N2, N3, R0, SP, RP or CC is entered in bit name for xx.
When W0, W1, and SW window enable bits are all 0, with this bit set to 0, the whole
screen will be window disabled area, and with this bit set to 1, the whole screen will
become window enabled area.
Window enable bit (for W0): W0 enable bit (N0W0E, N1W0E, N2W0E, N3W0E, R0W0E, SPW0E,
RPW0E, CCW0E)
Designates whether to use the Normal window W0 in each screen.
N0W0E 1800D0H Bit 1 Transparent Process Window for NBG0 (or RBG1)
N1W0E 1800D0H Bit 9 Transparent Process Window for NBG1 (or EXBG)
N2W0E 1800D2H Bit 1 Transparent Process Window for NBG2
N3W0E 1800D2H Bit 9 Transparent Process Window for NBG3
R0W0E 1800D4H Bit 1 Transparent Process Window for RBG0
SPW0E 1800D4H Bit 9 Transparent Process Window for Sprite
RPW0E 1800D6H Bit 1 For Rotation Parameter Window
CCW0E 1800D6H Bit 9 For Color Calculation Window
xxW0E Process
0 Does not use W0 window
1 Uses W0 window
Note: N0, N1, N2, N3, R0, SP, RP, or CC is entered in bit name for xx.
Window enable bit (for W1): W1 enable bit (N0W1E, N1W1E, N2W1E, N3W1E, R0W1E, SPW1E,
RPW1E, CCW1E)
Designates whether to use the Normal window W1 in each screen.
194
N0W1E 1800D0H Bit 3 Transparent Process Window for NBG0 (or RBG1)
N1W1E 1800D0H Bit 11 Transparent Process Window for NBG1 (or EXBG)
N2W1E 1800D2H Bit 3 Transparent Process Window for NBG2
N3W1E 1800D2H Bit 11 Transparent Process Window for NBG3
R0W1E 1800D4H Bit 3 Transparent Process Window for RBG0
SPW1E 1800D4H Bit 11 Transparent Process Window for Sprite
RPW1E 1800D6H Bit 3 For Rotation Parameter Window
CCW1E 1800D6H Bit 11 For Color Calculation Window
xxW1E Process
0 Does not use W1 window
1 Uses W1 window
Note: N0, N1, N2, N3, R0, SP, RP, or CC is entered in bit name for xx.
Window enable bit (for SW): SW enable bit (N0SWE, N1SWE, N2SWE, N3SWE, R0SWE,
SPSWE, CCSWE)
Designates whether to use the sprite window SW in each screen.
N0SWE 1800D0H Bit 5 Transparent Process Window for NBG0 (or RBG1)
N1SWE 1800D0H Bit 13 Transparent Process Window for NBG1 (or EXBG)
N2SWE 1800D2H Bit 5 Transparent Process Window for NBG2
N3SWE 1800D2H Bit 13 Transparent Process Window for NBG3
R0SWE 1800D4H Bit 5 Transparent Process Window for RBG0
SPSWE 1800D4H Bit 13 Transparent Process Window for Sprite
CCSWE 1800D6H Bit 13 For Color Calculation Window
xxSWE Process
0 Does not use SW window
1 Uses SW window
Note: N0, N1, N2, N3, R0, SP, or CC is entered in bit name for xx.
When using the sprite window, set the sprite window enable bit (SPWINEN) of the
sprite control register to 1.
Window area bit (for W0): W0 area bit (N0W0A, N1W0A, N2W0A, N3W0A, R0W0A, SPW0A,
RPW0A, CCW0A)
Designates the valid area of the Normal window W0 used in each screen.
ST-58-R2 195
N0W0A 1800D0H Bit 0 Transparent Process Window for NBG0 (or RBG1)
N1W0A 1800D0H Bit 8 Transparent Process Window for NBG1 (or EXBG)
N2W0A 1800D2H Bit 0 Transparent Process Window for NBG2
N3W0A 1800D2H Bit 8 Transparent Process Window for NBG3
R0W0A 1800D4H Bit 0 Transparent Process Window for RBG0
SPW0A 1800D4H Bit 8 Transparent Process Window for Sprite
RPW0A 1800D6H Bit 0 For Rotation Parameter Window
CCW0A 1800D6H Bit 8 For Color Calculation Window
xxW0A Process
0 Enables the inside of W0 window
1 Enables the outside of W0 window
Note: N0, N1, N2, N3, R0, SP, RP, or CC is entered in bit name for xx.
Window area bit (for W1): W1 area bit (N0W1A, N1W1A, N2W1A, N3W1A, R0W1A, SPW1A,
RPW1A, CCW1A)
Designates the valid area of the Normal window W1 used in each screen.
N0W1A 1800D0H Bit 2 Transparent Process Window for NBG0 (or RBG1)
N1W1A 1800D0H Bit 10 Transparent Process Window for NBG1 (or EXBG)
N2W1A 1800D2H Bit 2 Transparent Process Window for NBG2
N3W1A 1800D2H Bit 10 Transparent Process Window for NBG3
R0W1A 1800D4H Bit 2 Transparent Process Window for RBG0
SPW1A 1800D4H Bit 10 Transparent Process Window for Sprite
RPW1A 1800D6H Bit 2 For Rotation Parameter Window
CCW1A 1800D6H Bit 10 For Color Calculation Window
xxW1A Process
0 Enables the inside of W1 window
1 Enables the outside of W1 window
Note: N0, N1, N2, N3, R0, SP, RP, or CC is entered in bit name for xx.
Window area bit (for SW): SW area bit (N0SWA, N1SWA, N2SWA, N3SWA, R0SWA, SPSWA,
CCSWA)
Designates the valid area of the sprite window SW used in each screen.
196
N0SWA 1800D0H Bit 4 Transparent Process Window for NBG0 (or RBG1)
N1SWA 1800D0H Bit 12 Transparent Process Window for NBG1 (or EXBG)
N2SWA 1800D2H Bit 4 Transparent Process Window for NBG2
N3SWA 1800D2H Bit 12 Transparent Process Window for NBG3
R0SWA 1800D4H Bit 4 Transparent Process Window for RBG0
SPSWA 1800D4H Bit 12 Transparent Process Window for Sprite
CCSWA 1800D6H Bit 12 For Color Calculation Window
xxSWA Process
0 Enables the inside of SW window
1 Enables the outside of SW window
Note: N0, N1, N2, N3, R0, SP or CC is entered in bit name for xx.
ST-58-R2 197
(This page was blank in the original Japanese document)
198
Chapter 9 Sprite Data
ST-58-R2 199
9.1 Sprite Data
Sprite frame buffer data received from VDP1 may be either 8-bit pixel or 16-bit
pixels. When the 16-bit pixel format is read, the data may be either RGB or palette
format, but the frame buffer must be either all 8-bit pixel or all 16-bit pixels.
Sprite Types
When VDP2 receives palette format sprite data written by VDP1 in the frame buffer,
there are eight types of bit configurations for 16 bits per pixel and eight types of bit
configurations for 8 bits per pixel, for a total of 16 types. These are called sprite
types. Data per one dot consists of dot color data, priority bit, color calculation ratio
bit, and shadow bit composed from dot color code and palette number. Each bit
number changes depending on the sprite type. The value of a bit not having a high
enough order in the various bits is regarded as 0.
Sprite data of RGB format is composed of data of RGB for each 5-bit and color for-
mat discriminator bit. Priority bits, color calculation ratio bits, and shadow bits are
considered to be 0.
Sprite data, when 16-bit per pixel, designates types 0 through 7; when 8 bit per pixel,
designates types 8 through F. When types C through F are designated, priority bit,
color calculation ratio bit, and dot color data bit have a shared bit. The shared bits
are shown in Table 9.1.
200
Sprite types are shown in Figure 9.1.
• Type 0
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
PR1 PR0 CC2 CC1 CC0 DC10 DC9 DC8 DC7 DC6 DC5 DC4 DC3 DC2 DC1 DC0
• Type 1
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
PR2 PR1 PR0 CC1 CC0 DC10 DC9 DC8 DC7 DC6 DC5 DC4 DC3 DC2 DC1 DC0
• Type 2
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
SD PR0 CC2 CC1 CC0 DC10 DC9 DC8 DC7 DC6 DC5 DC4 DC3 DC2 DC1 DC0
• Type 3
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
SD PR1 PR0 CC1 CC0 DC10 DC9 DC8 DC7 DC6 DC5 DC4 DC3 DC2 DC1 DC0
• Type 4
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
SD PR1 PR0 CC2 CC1 CC0 DC9 DC8 DC7 DC6 DC5 DC4 DC3 DC2 DC1 DC0
• Type 5
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
SD PR2 PR1 PR0 CC0 DC10 DC9 DC8 DC7 DC6 DC5 DC4 DC3 DC2 DC1 DC0
• Type 6
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
SD PR2 PR1 PR0 CC1 CC0 DC9 DC8 DC7 DC6 DC5 DC4 DC3 DC2 DC1 DC0
• Type 7
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
SD PR2 PR1 PR0 CC2 CC1 CC0 DC8 DC7 DC6 DC5 DC4 DC3 DC2 DC1 DC0
ST-58-R2 201
• Type 8
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
PR0 DC6 DC5 DC4 DC3 DC2 DC1 DC0
• Type 9
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
PR0 CC0 DC5 DC4 DC3 DC2 DC1 DC0
• Type A
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
PR1 PR0 DC5 DC4 DC3 DC2 DC1 DC0
• Type B
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
CC1 CC0 DC5 DC4 DC3 DC2 DC1 DC0
• Type C
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
SP0 DC6 DC5 DC4 DC3 DC2 DC1 DC0
• Type D
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
SP0 SC0 DC5 DC4 DC3 DC2 DC1 DC0
• Type E
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
SP1 SP0 DC5 DC4 DC3 DC2 DC1 DC0
• Type F
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
SC1 SC0 DC5 DC4 DC3 DC2 DC1 DC0
202
Sprite Color Mode
Sprite character data has a palette and RGB format, the same as the scroll screen.
When the bit count per one dot is 16 (bits), all 16-bits composed of bits selected by
the sprite type can be used when data inside the frame buffer is only the palette
format. However, when data of the palette and RGB formats are mixed (because the
most significant bit is used to discriminate the color format,) palette format data is
be set to 0 and RGB format set to “1”. Palette format data is then processed with the
value of the selected sprite type MSB (priority bit or shadow bit) as 0. Sprite data
when data of palette and RGB formats are mixed is shown in Figure 9.2.
Figure 9.2 Sprite data when palette format and RGB format data are mixed
ST-58-R2 203
9.2 Priority and Color Calculation
The priority of sprite and scroll screen is selected according to the size of 3-bit value
called the priority number. Sprites can designate a maximum of eight priority num-
bers and can select one for each character according to the priority bit within sprite
data.
When using the color calculation function between the sprite and scroll screen, it can
be determined whether to perform color calculation by the value of priority number
selected by sprite character. Up to eight color calculation ratios can be selected; with
one of each character being selected by color calculation ratio in sprite data.
204
Color Calculation Enable Conditions
A sprite not only designates whether to do color calculation by the entire sprite, but
can also designate by the value of the priority number selected in each character and
the value of the most significant bit of color data selected in each dot. There are four
conditions that can be selected.
The color calculation condition number is designated in the sprite control register by
the value of the priority number selected in each sprite character, and the 3-bit value
for comparing size. These conditions are in effect only when the SPCCEN bit of the
color calculation control register is 1; color calculation will not be done when the
register is 0.
ST-58-R2 205
Color Calculation Ratio Selection
The color calculation ratio of sprites select one of eight color calculation ratios in
each sprite character by the color calculation ratio bit of the designated sprite type
data. When two or less bits are used for color calculation ratio of the designated
sprite type, the low bit is read as 0. When there is no color calculation ratio bit, 8-bit
is also read as 0. When sprite data is in an RGB format, the sprite register 0 is se-
lected.
Selection of the color calculation ratio register through the value of the color calcula-
tion ratio bit is shown in Table 9.3.
206
Sprite Control Register
The sprite control register controls sprite data, and is a write-only 16-bit register
located at address 1800E0H. Because the value is cleared to 0 after power on or
reset, it must be set.
15 14 13 12 11 10 9 8
SPCTL ~ ~ SPCCCS1 SPCCCS0 ~ SPCCN2 SPCCN1 SPCCN0
1800E0H 7 6 5 4 3 2 1 0
~ ~ SPCLMD SPWINEN SPTYPE3 SPTYPE2 SPTYPE1 SPTYPE0
When the sprite color format is RGB, color calculation is always performed if
SPCCCS is set to “3”.
ST-58-R2 207
Sprite window enable bit (SPWINEN), bit 4
See “8.1 Window Area”
When sprite data are 16-bit pixels, designate type 0 to 7; and when 8-bit pixels,
designate type 8 to F.
208
Priority Number Register
The priority number register designates the priority number, and is a write-only 16-
bit register located at addresses 1800F0H through 1800F6H. Because the value is
cleared to 0 after power on or reset, it must be set.
15 14 13 12 11 10 9 8
PRISA ~ ~ ~ ~ ~ S1PRIN2 S1PRIN1 S1PRIN0
1800F0H 7 6 5 4 3 2 1 0
~ ~ ~ ~ ~ S0PRIN2 S0PRIN1 S0PRIN0
15 14 13 12 11 10 9 8
PRISB ~ ~ ~ ~ ~ S3PRIN2 S3PRIN1 S3PRIN0
1800F2H 7 6 5 4 3 2 1 0
~ ~ ~ ~ ~ S2PRIN2 S2PRIN1 S2PRIN0
15 14 13 12 11 10 9 8
PRISC ~ ~ ~ ~ ~ S5PRIN2 S5PRIN1 S5PRIN0
1800F4H 7 6 5 4 3 2 1 0
~ ~ ~ ~ ~ S4PRIN2 S4PRIN1 S4PRIN0
15 14 13 12 11 10 9 8
PRISD ~ ~ ~ ~ ~ S7PRIN2 S7PRIN1 S7PRIN0
1800F6H 7 6 5 4 3 2 1 0
~ ~ ~ ~ ~ S6PRIN2 S6PRIN1 S6PRIN0
Sprite priority number bit (for sprite) (S0PRIN2 to S0PRIN0, S1PRIN2 to S1PRIN0, S2PRIN2 to
S2PRIN0, S3PRIN2 to S3PRIN0, S4PRIN2 to S4PRIN0, S5PRIN2 to S5PRIN0, S6PRIN2 to
S6PRIN0, S7PRIN2 to S7PRIN0)
Designates the sprite priority number.
S0PRIN2~S0PRIN0 1800F0H Bit 2~0 For Sprite Register 0
S1PRIN2~S1PRIN0 1800F0H Bit 10~8 For Sprite Register 1
S2PRIN2~S2PRIN0 1800F2H Bit 2~0 For Sprite Register 2
S3PRIN2~S3PRIN0 1800F2H Bit 10~8 For Sprite Register 3
S4PRIN2~S4PRIN0 1800F4H Bit 2~0 For Sprite Register 4
S5PRIN2~S5PRIN0 1800F4H Bit 10~8 For Sprite Register 5
S6PRIN2~S6PRIN0 1800F6H Bit 2~0 For Sprite Register 6
S7PRIN2~S7PRIN0 1800F6H Bit 10~8 For Sprite Register 7
ST-58-R2 209
Display priority order increases with the size of the priority number. Sprite charac-
ters that use the register set to a priority number value of 0 are treated as transparent
and are not displayed.
15 14 13 12 11 10 9 8
CCRSB ~ ~ ~ S3CCRT4 S3CCRT3 S3CCRT2 S3CCRT1 S3CCRT0
180102H 7 6 5 4 3 2 1 0
~ ~ ~ S2CCRT4 S2CCRT3 S2CCRT2 S2CCRT1 S2CCRT0
15 14 13 12 11 10 9 8
CCRSC ~ ~ ~ S5CCRT4 S5CCRT3 S5CCRT2 S5CCRT1 S5CCRT0
180104H 7 6 5 4 3 2 1 0
~ ~ ~ S4CCRT4 S4CCRT3 S4CCRT2 S4CCRT1 S4CCRT0
15 14 13 12 11 10 9 8
CCRSD ~ ~ ~ S7CCRT4 S7CCRT3 S7CCRT2 S7CCRT1 S7CCRT0
180106H 7 6 5 4 3 2 1 0
~ ~ ~ S6CCRT4 S6CCRT3 S6CCRT2 S6CCRT1 S6CCRT0
Designates the sprite color calculation ratio. The color calculation ratio is for a value
1/32 of RGB various color data.
210
S0CCRT4~S0CCRT0 180100H Bit 4~0 For Sprite Register 0
S1CCRT4~S1CCRT0 180100H Bit 12~8 For Sprite Register 1
S2CCRT4~S2CCRT0 180102H Bit 4~0 For Sprite Register 2
S3CCRT4~S3CCRT0 180102H Bit 12~8 For Sprite Register 3
S4CCRT4~S4CCRT0 180104H Bit 4~0 For Sprite Register 4
S5CCRT4~S5CCRT0 180104H Bit 12~8 For Sprite Register 5
S6CCRT4~S6CCRT0 180106H Bit 4~0 For Sprite Register 6
S7CCRT4~S7CCRT0 180106H Bit 12~8 For Sprite Register 7
ST-58-R2 211
xxCCRT4 xxCCRT3 xxCCRT2 xxCCRT1 xxCCRT0 Color Calculation Ratio
Top Image : Second Image
0 0 0 0 0 31:1
0 0 0 0 1 30:2
0 0 0 1 0 29:3
0 0 0 1 1 28:4
0 0 1 0 0 27:5
0 0 1 0 1 26:6
0 0 1 1 0 25:7
0 0 1 1 1 24:8
0 1 0 0 0 23:9
0 1 0 0 1 22:10
0 1 0 1 0 21:11
0 1 0 1 1 20:12
0 1 1 0 0 19:13
0 1 1 0 1 18:14
0 1 1 1 0 17:15
0 1 1 1 1 16:16
1 0 0 0 0 15:17
1 0 0 0 1 14:18
1 0 0 1 0 13:19
1 0 0 1 1 12:20
1 0 1 0 0 11:21
1 0 1 0 1 10:22
1 0 1 1 0 9:23
1 0 1 1 1 8:24
1 1 0 0 0 7:25
1 1 0 0 1 6:26
1 1 0 1 0 5:27
1 1 0 1 1 4:28
1 1 1 0 0 3:29
1 1 1 0 1 2:30
1 1 1 1 0 1:31
1 1 1 1 1 0:32
This register is in effect only when the CCMD bit of the color calculation control
register is 0, and is ignored when “1”.
212
Chapter 10 Pixels
ST-58-R2 213
Introduction
When sprites and dot color data of each scroll screen are in a palette format, the
color RAM address offset register value added to the dot color data (configured from
the palette number and dot color code) becomes the color RAM address. Color data
of that address is output as color data. In the RGB format, dot color data composed
of individual red, green and blue values are pixels.
Scroll screen dot color data in a palette format designates whether to use special
priority and special color calculation functions according to the lowest 4-bit color
data.
Palette format pixels are 11 bits wide, and is the color RAM addresses that store pixel
data—the value of the color RAM address offset register of the corresponding screen
added to the highest 3-bits.
214
Palette format sprite pixels are shown in Figure 10.1. The sprite color RAM address
is shown in Figure 10.2.
Bit 10 9 8 7 6 5 4 3 2 1 0
11 Bit pixel
Bit 10 9 8 7 6 5 4 3 2 1 0
0 10 Bit pixel
Bit 10 9 8 7 6 5 4 3 2 1 0
0 0 9 Bit pixel
Bit 10 9 8 7 6 5 4 3 2 1 0
0 0 0 8 Bit pixel
Bit 10 9 8 7 6 5 4 3 2 1 0
0 0 0 0 7 Bit pixel
Bit 10 9 8 7 6 5 4 3 2 1 0
0 0 0 0 0 6 Bit pixel
+
Offset Value
Color RAM Address
Offset Value for Sprite 3 Bit 0 0 0 0 0 0 0 0
Note: When Color RAM is in mode 0 or mode 2, the MSB of the color
RAM address is ignored.
ST-58-R2 215
Scroll Dot Pixels
Scroll pixels in a palette format changes according to the designated character color
count. The color RAM address offset value corresponding to each surface is added
to the highest 3 bits of 11-bit dot color data, and is treated as the color RAM address
of that dot. When color RAM mode is set to mode 0 or mode 2, the highest bit of
color RAM address will be ignored.
Because the line color screen doesn’t have a corresponding color RAM address offset
value, the 11-bit value read from line color screen table becomes the color RAM
address. Palette format scroll dot color data is shown in Figure 10.3. The scroll
screen color RAM address is shown in Figure 10.4.
Bit 10 9 8 7 6 5 4 3 2 1 0
7 Bit Palette Number 4 Bit Dot Color Code
Bit 10 9 8 7 6 5 4 3 2 1 0
8 Bit Dot Color Code
Bit 10 9 8 7 6 5 4 3 2 1 0
11 Bit Dot Color Code
+
Color RAM Address Offset Value
Offset Value For Each 3 Bit 0 0 0 0 0 0 0 0
Scroll
Note: When the color RAM mode is 0 or 2, the color RAM address MSB is
ignored.
216
Color RAM Address Offset Register
The color RAM address offset register is a write only 16-bit register that designates
the sprite and color RAM address offset values corresponding to each scroll screen.
It is located at addresses 1800E4H through 1800E7. Because the value is cleared to 0
after power on or reset, you must set it.
15 14 13 12 11 10 9 8
CRAOFA ~ N3CAOS2 N3CAOS1 N3CAOS0 ~ N2CAOS2 N2CAOS1 N2CAOS0
1800E4H 7 6 5 4 3 2 1 0
~ N1CAOS2 N1CAOS1 N1CAOS0 ~ N0CAOS2 N0CAOS1 N0CAOS0
15 14 13 12 11 10 9 8
CRAOFB ~ ~ ~ ~ ~ ~ ~ ~
1800E6H 7 6 5 4 3 2 1 0
~ SPCAOS2 SPCAOS1 SPCAOS0 ~ R0CAOS2 R0CAOS1 R0CAOS0
The actual color RAM address offset value is calculated by the expression below.
When the color RAM mode is set to mode 0 or mode 2, the highest bit of color RAM
address that calculated the color RAM address offset value will be ignored.
ST-58-R2 217
10.2 RGB Format Pixels
RGB format dot color data is 15-bit in sprite and 15-bit or 24-bit data, depending on
character color count in scroll, and becomes dot color data without going through
color RAM. When dot color data is 15-bit, the lowest three bits of each individual is
fixed at 0 and used.
Sprite Pixels
RGB format sprite dot color data is RGB 5-bit data that outputs each of the lowest 3
bits fixed at 0. RGB format sprite dot color data is shown in Figure 10.5.
Bit 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Sprite 5 Bit Red Data
5 Bit Blue Data 5 Bit Green Data
Dot Color Data
Scroll Pixels
RGB format scroll dot color data changes according to the character color count.
When 15-bit, the lowest three bits of each individual RGB is fixed at 0 and output.
The back screen is output by fixing the lower 3-bit of each RGB at 0, the same as
when the character color count of the scroll screen is 32,768 colors.
218
Scroll dot color data of the RGB format is shown in Figure 10.6.
Bit 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Scroll
Sprite 5 Bit Blue Data 5 Bit Green Data 5 Bit Red Data
Dot Color Data
Bit 23 22 21 20 19 18 17 16
Scroll 8 Bit Blue Data
Dot Color Data
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
8 Bit Green Data 8 Bit Red Data
ST-58-R2 219
10.3 Special Function Code
The special function, which performs in all scroll screens, has two functions: the
special priority function, and the special color calculation function. When used in
every dot, the dot color code that activates the special function can designate two
special function code registers. Also, each scroll screen designates which of the two
special function code registers will be used.
The special function code register has two 8-bit registers: special function code A,
and special function code B. Each bit corresponds to two dot color code lower 4-bit
values using the special function. The dot color code changes the bit number ac-
cording to the character color count of each scroll screen. However, each bit of the
special function code register will always correspond to the value of the lowest four
bits of the dot color code. Moreover, the special function code is used only when the
color format of scroll screen is the palette format.
See “11.2 Special Priority Function” and “12.2 Special Color Calculation Function”
for using the special function. Figure 10.7 shows the dot color code that corresponds
to special function code.
Bit 10 9 8 7 6 5 4 3 2 1 0
Corresponding 4 bits
220
Special Function Code Select Register
The special function code select register is a write-only 16-bit register that designates
the special function code that activates all scroll screens. It is located at address
180024H. Because the value is cleared to 0 after power on or reset, it must be set.
15 14 13 12 11 10 9 8
SFSEL ~ ~ ~ ~ ~ ~ ~ ~
180024H 7 6 5 4 3 2 1 0
~ ~ ~ R0SFCS N3SFCS N2SFCS N1SFCS N0SFCS
xxSFCS Process
0 Enables special function code A
1 Enables special function code B
Note: N0, N1, N2, N3, or R0 is entered in bit name for xx.
ST-58-R2 221
Special Function Code Register
The special function code register is a write-only 16-bit register that designates
special function code A and special function code B. It is located at address
180026H. Because the value is cleared to 0 after power on or reset, it must be set.
15 14 13 12 11 10 9 8
SFCODE SFCDB7 SFCDB6 SFCDB5 SFCDB4 SFCDB3 SFCDB2 SFCDB1 SFCDB0
180026H 7 6 5 4 3 2 1 0
SFCDA7 SFCDA6 SFCDA5 SFCDA4 SFCDA3 SFCDA2 SFCDA1 SFCDA0
Settings Process
0 Does not use special functions
1 Uses special functions
The special function code is used when mode 2 is designated in the special priority
mode registers or when designating mode 2 in the special color calculation mode
register. For more information see “11.2 Special Priority Function” or “12.2 Special
Color Calculation Function.”
222
Chapter 11 Priority Function
Introduction ....................................................................224
11.1 Priority Function ................................................... 224
Priority Number ................................................. 224
Priority Number Register .................................. 225
11.2 Special Priority Function ...................................... 227
Special Priority Mode Register ......................... 229
11.3 Insertion of Line Color Screen ............................. 230
Line Color Screen Enable Register .................. 231
ST-58-R2 223
Introduction
VDP2 compares the priority number values of sprites and scroll screens and decides
the display priority order from the top three. The priority number of a sprite then
selects each character from a maximum of eight values. The priority number of all
scroll screens can also change the value of each dot and character by using the spe-
cial priority function.
The line color screen can be inserted into the number two position, one below the
screen, when the designated screen is at the highest priority.
Transparent
Priority Number
The scroll screen has one 3-bit priority number register in each screen. This priority
number normally is used in the entire surface, but can change the value of the least
significant bit in each dot and character according to the special priority mode. The
sprite priority number can select one of eight 3-bit priority number registers for each
character. For information about selecting a sprite priority number register see
“Priority Number Selection” in section “9.2 Priority and Color Calculation.”
224
Screen priority increases when the value of the priority number increases. When
priority numbers are equal, they follow the order shown in Table 11.1. When the
value of a priority number is OH, it is read as transparent.
15 14 13 12 11 10 9 8
PRINB ~ ~ ~ ~ ~ N3PRIN2 N3PRIN1 N3PRIN0
1800FAH 7 6 5 4 3 2 1 0
~ ~ ~ ~ ~ N2PRIN2 N2PRIN1 N2PRIN0
15 14 13 12 11 10 9 8
PRIR ~ ~ ~ ~ ~ ~ ~ ~
1800FCH 7 6 5 4 3 2 1 0
~ ~ ~ ~ ~ R0PRIN2 R0PRIN1 R0PRIN0
ST-58-R2 225
Priority number bit (for scroll screen) (N0PRIN2 to N0PRIN0, N1PRIN2 to
N1PRIN0, N2PRIN2 to N2PRIN0, N3PRIN2 to N3PRIN0, R0PRIN2 to R0PRIN0)
Designates the priority number of each screen scroll.
N0PRIN2~N0PRIN0 1800F8H Bit 2~0 For NBG0 (or RBG1)
N1PRIN2~N1PRIN0 1800F8H Bit 10~8 For NBG1 (or EXBG)
N2PRIN2~N2PRIN0 1800FAH Bit 2~0 For NBG2
N3PRIN2~N3PRIN0 1800FAH Bit 10~8 For NBG3
R0PRIN2~R0PRIN0 1800FCH Bit 2~0 For RBG0
Larger priority numbers are given a higher display priority order. When the value
of the priority number is 0, it is treated as transparent and not displayed. For more
about priority number register of sprites, see “Priority Number Register” of “9.2
Priority and Color Calculation.”
226
11.2 Special Priority Function
The special priority function changes the least significant bit of the 3-bit priority
number corresponding to every scroll screen in each character and dot. Using this
function to change the priority of a portion of the scroll screen displays one surface
as multiple screens. Furthermore, the least significant bit of the priority number
changes only by the special priority function; the highest 2 bits are used with the
register values. The special priority function has the following three modes.
1. Designates the least significant bit of the priority number in each screen
2. Designates the least significant bit of the priority number in each character
3. Designates the least significant bit of the priority number in each dot
When designating the least significant bit of the priority number in each screen, the
value of the priority number register in each scroll screen is used unchanged.
When designating each character, the value of a special priority bit within pattern
name data is used as the least significant bit of the priority number. For more infor-
mation about special priority bits, see “4.6 Pattern Name Table (Page).”
When designating each dot in character patterns designating 1 (the special priority
bit within pattern name data), only dots that coincide with the dot color code are
designated in the special function code. The least significant bit of the priority
number is set to 1, the rest are fixed at 0. Do not set this mode when the color format
of scroll screen is RGB. For more about the dot color code see “10.3 Special Function
Code.”
When the 3-bit priority number value obtained by the special priority function is
OH, that screen, character, or dots are treated as transparent. Table 11.2 shows the
special priority function by mode.
ST-58-R2 227
Table 11.2 Special priority function by mode
Special Priority Special Priority Color Format Priority Number LSB Value
Mode Selection
Mode 0 Selected per each Palette Format or RGB Priority number register LSB
screen Format value
Mode 1 Select per each Palette Format or RGB Value of the special priority bit
character Format in the pattern name data
Mode 2 Setting not allowed Palette Format When the special priority bit in
the pattern name data is equal
to one, only the dot coinciding
with the dot color code
selected for special function
code becomes 1, while the
rest become 0.
RGB Format Setting Invalid
When the display format designates mode 1 or 2 in the scroll screen of the bit map
format, it is not the special priority bit within the pattern name data, but the special
priority bit of the bit map palette number register that is used.
228
Special Priority Mode Register
The special priority mode register is a write-only 16-bit register that designates the
mode of the special priority function corresponding to each scroll screen, and is
located at address 1800EA. Because the value clears to 0 after power on or reset, it
must be set.
15 14 13 12 11 10 9 8
SFPRMD ~ ~ ~ ~ ~ ~ R0SPRM1 R0SPRM0
1800EAH 7 6 5 4 3 2 1 0
N3SPRM1 N3SPRM0 N2SPRM1 N2SPRM0 N1SPRM1 N1SPRM0 N0SPRM1 N0SPRM0
Note: N0, N1, N2, N3, or R0 is entered in bit name for xx.
Do not set mode 2 when the scroll screen color format is the RGB mode.
Do not set in EXBG any other mode but 0.
Character or dot in which priority number is 0 is considered transparent.
ST-58-R2 229
11.3 Insertion of Line Color Screen
The line color screen does not have a priority number register; it forcefully inserts
the top image as the second image, and calculates color. Meanwhile, the original
second image becomes the new third image, and the old third image becomes the
fourth image. Figure 11.2 shows insertion of the line color screen.
Transparent
230
Line Color Screen Enable Register
The line color screen enable register designates whether to insert the line color
screen when each screen is a top image. This is a write-only 16-bit register located at
address 1800E8H. Because the value is cleared to 0 after power on or reset, you must
set it.
15 14 13 12 11 10 9 8
LNCLEN ~ ~ ~ ~ ~ ~ ~ ~
1800E8H 7 6 5 4 3 2 1 0
~ ~ SPLCEN R0LCEN N3LCEN N2LCEN N1LCEN N0LCEN
xxLCEN Process
0 Does not insert the line color screen when
corresponding screen is top image
1 Inserts the line color screen when corresponding
screen is top image
Note: N0, N1, N2, N3, R0, or SP is entered in the bit name for xx.
A line color screen is inserted only in the second image section of the screen desig-
nated for insertion, thus becoming the top image. Sprites can only be designated in
their entirety. To designate each character, they must be controlled by their color
calculation ratio value. This register cannot be used at the same time as the grada-
tion calculation function.
ST-58-R2 231
(This is page was blank in the original Japanese document)
232
Chapter 12 Color Calculations
Introduction ....................................................................234
12.1 Color Calculation Function................................... 234
Normal Color Calculation .................................. 234
Extended Color Calculation Function ............... 236
12.2 Gradation Calculation Function ........................... 238
Color Calculation Control Register ................... 240
Color Calculation Ratio Register....................... 243
12.3 Special Color Calculation Function ...................... 245
Special Color Calculation Mode Register ......... 247
ST-58-R2 233
Introduction
VDP2 calculates, by a designated ratio, color data of second and top images obtained
comparing priorities of sprite and each scroll screen. The sprite and color calcula-
tion ratio can select each character from one of eight values. The color calculation
enable of every scroll screen can designate each character and dot by using the
special color calculation function.
With the second and third images at a fixed ratio, the colors of up to four screens can
be calculated by doing color calculations in the second image. In addition, distant
backgrounds can be shaded causing the gradation calculation function to be en-
abled.
The color calculation function calculates with a ratio designating the top and second
images (or three images, the second image, third image, forth image, images calcu-
lated at a set ratio) by individual RGB color, and is able to produce an effect of over-
lapping a group of semi-transparent screens. The color calculation function is
shown in Figure 12.1.
Back
Screen
234
The value of the color calculation ratio of each screen is designated in the register
when using the color calculation mode to add in proportion to the value of color
calculation ratio. The color calculation ratio of the sprite can designate one register
from a maximum of eight for each character; the scroll screen color calculation ratio
designates to the register of each screen. For more about sprite color calculation
ratio see “Color Calculation Ratio Register” in “9.2 Priority and Color Calculation.”
The color calculation ratio of each screen is designated by 5 bits, and a total of 32
steps: top image : second image = 31 : 1 to 0 : 32 can be selected. There are two kinds
of modes for designating the value of that ratio.
When designating with the top image, the sprite that becomes the top image or the
color calculation ratio value of the scroll screen is used without any relation to the
second image screen. When designating with the second image, the color calcula-
tion ratio can be changed by the screen of the second image. The sprite, scroll screen
values, line color screen, and back screen color calculation ratio values can be used.
When using the color calculation mode to add by the value, gradually rewrite from
the top image color data from 00H to the original color to create a fade-in effect of
the top image over the second image. Be aware that doing so may result in color
that is concurrent with fade-in becoming brighter than the original. Addition results
that exceed FFH are treated as FFH. Figure 12.2 shows the color calculation ratio
mode.
ST-58-R2 235
Priority Number = 6 Priority Number = 4 Priority Number = 2
Screen B Transparent
Back Screen
Screen
C
Screen A Transparent
Color Calculation Ratio Color Calculation Ratio Color Calculation Ratio Color Calculation Ratio
16:16 20:12 24:8 28:4
When selecting the top screen image When selecting the second screen image
Screen B Back Screen B Back
Screen Screen
Screen C Screen C
There is no limitation in calculating color when the TV screen mode is the Normal
mode. But when the TV screen mode is the high resolution mode or Exclusive moni-
tor mode, the color RAM mode and second image color format hav limitations.
Table 12.1 shows limitations of the color calculation function.
Table 12.1 Color calculation function when in the high resolution mode or special monitor mode
Color RAM Mode Second Image Color Format Color Calculation Function
Mode 0 Palette format or RGB format Can be used
Mode 1 Palette format Cannot be used
RGB format Can be used
Mode 2 Palette format Cannot be used
RGB format Can be used
236
When performing extended color calculation, whether to add the third and fourth
images complies with the screen color calculation enable bit of the third image
screen, and whether to add the second and third images complies with the color
calculation enable bit of the second image screen.
When the extended color calculation function is used, the extended color calculation
ratio changes according to the color RAM mode, the line color screen insertion, the
color calculation enable bit value of second and third images and color format, and
the color format of the fourth image.
Figure 12.3 shows the extended color calculation function; Table 12.2 shows the
extended color calculation ratios.
+ + +
Third image Third image Third image
+
Fourth Image
ST-58-R2 237
Table 12.2 Extended Color Calculation Ratio
Color Line Color Color Format Color Calculation Extended Color
RAM Screen Enable Bit Value Calculation Ratio
Mode
2nd Image 3rd Image 4th Image 2nd Image 3rd Image 2nd:3rd:4th (Image)
Does not Palette or Palette or - 0 - 4:0:0
Mode Insert RGB format RGB format 1 - 2:2:0
0 Palette Palette 0 0 or 1 4:0:0
Inserts - or RGB or RGB 1 0 2:2:0
format format 1 1 2:1:0
Does not Palette Palette - 0 or 1 - 4:0:0
Insert or RGB format
format RGB - 0 - 4:0:0
Mode format 1 - 2:2:0
1 Palette Palette or 0 or 1 0 or 1 4:0:0
or format RGB format
Mode Palette 0 0 or 1 4:0:0
2 Inserts - RGB format 1 0 or 1 2:2:0
format RGB 0 0 or 1 4:0:0
format 1 0 2:2:0
1 1 2:1:1
Note: The extended color calculation function cannot be used when the TV screen mode in is the
high-resolution or Exclusive monitor mode. When inserting the line color screen, the color
format of the second image becomes the palette format. The extended color calculation ratio
is for a value that is 1/4 times the individual RGB data.
(2 dots left display coordinates : (1 dot left display coordinates : (display coordinates = 1:1:2
color data) color data) color data)
Here, the added results of the area in which the designated screen becomes the top
or second images is forced to be the second image. By calculating color of the sec-
ond and top images, it is possible to display pictures in which gradation calculations
have been done. The second image of the area, in which the gradation calculation
designated screen is not a top or second image, becomes the image determined by
normal priority.
238
Screens using gradation calculation have no transparent dots. If gradation calcula-
tion is performed for screens having transparent dots, correct calculation cannot be
done by that boundary. If the gradation calculation function is used, yit is not pos-
sible to insert the line color screen. In addition, the extended color calculation func-
tion can no longer be used. Figure 12.4 shows the gradation calculation function.
ScreenB ScreenC
Screen A Screen B
The area in screen C that
is the top image or second
image is forced to switch to
shaded screen C
Second Image
Shaded
Screen C
Screen B
Color Operation
Color Function used in Screen C
Display Image
Shaded
Screen C
ScreenB
Screen A
ST-58-R2 239
Color Calculation Control Register
The color calculation control register is a write-only 16-bit register that controls color
calculation, and is located at address 1800ECH. Because the value is cleared to 0
after power on or reset, the value must be set.
15 14 13 12 11 10 9 8
1800ECH BOKEN BOKN2 BOKN1 BOKN0 ~ EXCCEN CCRTMD CCMD
7 6 5 4 3 2 1 0
~ SPCCEN LCCCEN R0CCEN N3CCEN N2CCEN N1CCEN N0CCEN
If this bit is 1, the extended color calculation function can no longer be used.
The gradation calculation function can only be used when the TV screen mode is the
Normal mode, and the color RAM mode is mode 0.
Gradation screen number bit: Gradation number bit (BOKN2 to BOKN0), bits 14 to 12
Designates the screen using the gradation (shading) calculation function.
BOKN2 BOKN1 BOKN0 Screen Using Gradation Calculation Function
0 0 0 Sprite
0 0 1 RBG0
0 1 0 NBG0 or RBG1
0 1 1 Invalid
1 0 0 NBG1 or EXBG
1 0 1 NBG2
1 1 0 NBG3
1 1 1 Invalid
240
EXCCEN Process
0 Do not use extended color calculation
1 Use extended color calculation
The above calculation function cannot be used at the same time as the gradation
calculation function. When the BOKEN bit is 1, this bit is ignored. The extended
color calculation function can only be used when in the TV screen and Normal
modes, and cannot be used when in the high-resolution mode or Exclusive monitor
mode.
The top image always designates whether to perform normal color calculation.
When in mode 1, the values of the color calculation ratio registers of each screen are
ignored.
ST-58-R2 241
Color calculation enable bit (N0CCEN, N1CCEN, N2CCEN, N3CCEN,
R0CCEN, LCCCEN, SPCCEN)
Designates whether to perform color calculation (color calculation enable)
N0CCEN 1800ECH Bit 0 For NBG0 (or RBG1)
N1CCEN 1800ECH Bit 1 For NBG1 (or EXBG)
N2CCEN 1800ECH Bit 2 For NBG2
N3CCEN 1800ECH Bit 3 For NBG3
R0CCEN 1800ECH Bit 4 For RBG0
LCCCEN 1800ECH Bit 5 For LNCL
SPCCEN 1800ECH Bit 6 For Sprite
xxCCEN Process
0 Does not color-calculate
1 Color-calculates
Note: N0, N1, N2, N3, R0, LC, or SP is entered in bit name for xx.
When calculating color between the top and second images, calculation is controlled
by the color calculation enable bit of the top image. When using the extended color
calculation function, control between the second and third images is done by the
color calculation enable bit of the second image, and control between the third and
fourth images is done by the color calculation enable bit of the third image.
242
Color Calculation Ratio Register
The color calculation ratio register is a write-only 16-bit register that designates the
color calculation ratio, and is located at addresses 180108H to 18010EH. Because the
value is cleared to 0 after power on or reset, the value must be set.
15 14 13 12 11 10 9 8
CCRNA ~ ~ ~ N1CCRT4 N1CCRT3 N1CCRT2 N1CCRT1 N1CCRT0
180108H 7 6 5 4 3 2 1 0
~ ~ ~ N0CCRT4 N0CCRT3 N0CCRT2 N0CCRT1 N0CCRT0
15 14 13 12 11 10 9 8
CCRNB ~ ~ ~ N3CCRT4 N3CCRT3 N3CCRT2 N3CCRT1 N3CCRT0
18010AH 7 6 5 4 3 2 1 0
~ ~ ~ N2CCRT4 N2CCRT3 N2CCRT2 N2CCRT1 N2CCRT0
15 14 13 12 11 10 9 8
CCRR ~ ~ ~ ~ ~ ~ ~ ~
18010CH 7 6 5 4 3 2 1 0
~ ~ ~ R0CCRT4 R0CCRT3 R0CCRT2 R0CCRT1 R0CCRT0
15 14 13 12 11 10 9 8
CCRLB ~ ~ ~ BKCCRT4 BKCCRT3 BKCCRT2 BKCCRT1 BKCCRT0
18010EH 7 6 5 4 3 2 1 0
~ ~ ~ LCCCRT4 LCCCRT3 LCCCRT2 LCCCRT1 LCCCRT0
ST-58-R2 243
xxCCRT4 xxCCRT3 xxCCRT2 xxCCRT1 xxCCRT0 Color Calculation Ratio
Top Image : Second Image
0 0 0 0 0 31:1
0 0 0 0 1 30:2
0 0 0 1 0 29:3
0 0 0 1 1 28:4
0 0 1 0 0 27:5
0 0 1 0 1 26:6
0 0 1 1 0 25:7
0 0 1 1 1 24:8
0 1 0 0 0 23:9
0 1 0 0 1 22:10
0 1 0 1 0 21:11
0 1 0 1 1 20:12
0 1 1 0 0 19:13
0 1 1 0 1 18:14
0 1 1 1 0 17:15
0 1 1 1 1 16:16
1 0 0 0 0 15:17
1 0 0 0 1 14:18
1 0 0 1 0 13:19
1 0 0 1 1 12:20
1 0 1 0 0 11:21
1 0 1 0 1 10:22
1 0 1 1 0 9:23
1 0 1 1 1 8:24
1 1 0 0 0 7:25
1 1 0 0 1 6:26
1 1 0 1 0 5:27
1 1 0 1 1 4:28
1 1 1 0 0 3:29
1 1 1 0 1 2:30
1 1 1 1 0 1:31
1 1 1 1 1 0:32
Note: N0, N1, N2, N3, R0, LC, or BK is entered in bit name for xx.
For more about the color calculation ratio register of sprites see “Color Calculation
Ratio Register” in “9.2 Priority and Color Calculation.”
244
12.3 Special Color Calculation Function
The special color calculation function designates the color calculation enable not
only by the entire screen but by character units and dot units. See the four modes
below.
When designating color calculation enable for each screen, color calculation is per-
formed when the color calculation enable bit value in the color calculation control
register that corresponds to each scroll screen is 1.
When designating each character in a scroll screen that the color calculation enable
bit has designated 1, color calculation is performed only in character patterns of a
special color calculation bit value of 1 in pattern name data. For more about the
special color calculation bit in pattern name data see “4.6 Pattern Name Table.”
When designating each dot, color calculation is performed only in dots that agree
with the dot color code designated in the special function code, and in the character
pattern designated 1 in which the value of the special color calculation bit within the
pattern name data of the scroll screen has a color calculation enable bit of 1. Do not
set this mode when the color format of the scroll screen is the RGB format. For more
about the special function code see “10.3 Special Function Code.”
When designating with the most significant bit of color data, color calculation is
performed only in dots that used color data when the most significant bit is set at 1,
and when the scroll screen where the color calculation enable bit is designated 1 is in
a palette format. Color calculation will always be performed if this mode is desig-
nated when the scroll screen, where the color calculation enable bit is designated 1,
is in the RGB format.
When mode 1 or 2 is designated in a bit map format scroll screen, the special color
calculation bit of the bit map number register is used, not the special color calcula-
tion bit within pattern name data. Table 12.3 shows the special color calculation
mode.
ST-58-R2 245
Table 12.3 Special Color Calculation Mode
Special Color Special Color Color Format Color Calculation Enable
Calculation Mode Calculation Selection Condition
Mode 0 Select per screen Palette format or RGB Color calculation enable bit =1
format
Mode 1 Select per character Palette format or RGB Color calculation bit = 1 and
format pattern name data special
color calculation bit = 1
Mode 2 Select per dot Palette format Color calculation bit = 1 and
pattern name data special
color calculation bit = 1 and
The dot that matches dot color
code selected per special
function code
RGB format Invalid
Mode 3 Select with color data Palette format Color calculation bit = 1 and
MSB The dot using color data
where MSB = 1
RGB format Color calculation enable bit =1
The special color calculation mode can designate only for top images. Otherwise, it
is fixed at 0.
246
Special Color Calculation Mode Register
The special color calculation mode register is a write-only 16-bit register that desig-
nates the special color calculation function mode for each scroll screen, and is lo-
cated at address 1800EEH. Because the value is cleared to 0 after power on or reset,
you must set the value.
15 14 13 12 11 10 9 8
SFCCMD ~ ~ ~ ~ ~ ~ R0SCCM1 R0SCCM0
1800EEH 7 6 5 4 3 2 1 0
N3SCCM1 N3SCCM0 N2SCCM1 N2SCCM0 N1SCCM1 N1SCCM0 N0SCCM1 N0SCCM0
Note: N0, N1, N2, N3, or R0 is entered in bit name for xx.
Special color calculation mode designation is effective only when each screen is a top
image. Otherwise, the mode must be set at 0. When the color format of scroll screen
is the RGB format, do not fixed at mode 2. Color is calculated by all dots when
mode 3 has been designated. Finally, do not designate modes 1 and 2 in EXBG.
ST-58-R2 247
(This page was blank in the original Japanese document)
248
Chapter 13 Color Offset Function
Introduction ....................................................................250
13.1 Color Offset Selection .......................................... 250
Color Offset Enable Register ............................ 251
Color Offset Select Register ............................. 252
Color Offset Register ........................................ 253
ST-58-R2 249
Introduction
The color offset function causes a change in the screen color without changing color
RAM data by adding the offset value when sprite and data of each screen are output.
Can also be used for fade-in and fade-out.
The color offset value can set two values, color offset A and color offset B in each
RGB, and can designate which of the two values to use for each screen. The color
offset value is 9-bit data corresponding to individual RGB. When resulting color
data added to individual RGB is smaller than 00H, the data is treated as 00H; when
larger than FFH, the data is treated as FFH.
Because the color offset function process follows the color calculation function pro-
cess, the color offset value is added to the color data resulting from color calcula-
tions. In addition, because the result screen of color calculation is treated as the top
image screen, designation of the color offset enable register is done with the screen
bit of that top image. Figure 13.1 shows the color offset data.
Bit 7 6 5 4 3 2 1 0
+
Bit 8 7 6 5 4 3 2 1 0
Color Offset A
Sign 8 Bit Color Offset Data
Color Offset B
Select per screen
Bit 7 6 5 4 3 2 1 0
250
Color Offset Enable Register
The color offset enable register is a write-only 16-bit register that designates whether
to use the color offset function for each screen, and is located at address 180110H.
Because the value is cleared to 0 after power on or reset, it must be set.
15 14 13 12 11 10 9 8
CLOFEN ~ ~ ~ ~ ~ ~ ~ ~
180110H 7 6 5 4 3 2 1 0
~ SPCOEN BKCOEN R0COEN N3COEN N2COEN N1COEN N0COEN
xxCOEN Process
0 Do not use color offset function
1 Use color offset function
Note: N0, N1, N2, N3, R0, BK, or SP is entered in bit name for xx.
Using the color calculation function designates the color offset enable bit of the top
image screen.
ST-58-R2 251
Color Offset Select Register
The color offset select register designates the color offset register used for each
screen. This is a write-only 16-bit register located at address 180112H. Because the
value is cleared to 0 after power on or reset, it must be set.
15 14 13 12 11 10 9 8
CLOFSL ~ ~ ~ ~ ~ ~ ~ ~
180112H 7 6 5 4 3 2 1 0
~ SPCOSL BKCOSL R0COSL N3COSL N2COSL N1COSL N0COSL
xxCOSL Process
0 Use color offset A value
1 Use color offset B value
Note: N0, N1, N2, N3, R0, BK, or SP is entered in bit name for xx.
When using the color calculation function, designates with the color offset select bit
of the top image screen.
252
Color Offset Register
The color offset register is a write-only 16-bit register that designates RGB individual
values of the color offset value, and is located at addresses 180114H to 18011EH.
Because the value is cleared to 0 after power on or reset, it must be set.
15 14 13 12 11 10 9 8
COAR ~ ~ ~ ~ ~ ~ ~ COARD8
180114H 7 6 5 4 3 2 1 0
COARD7 COARD6 COARD5 COARD4 COARD3 COARD2 COARD1 COARD0
15 14 13 12 11 10 9 8
COAG ~ ~ ~ ~ ~ ~ ~ COAGR8
180116H 7 6 5 4 3 2 1 0
COAGR7 COAGR6 COAGR5 COAGR4 COAGR3 COAGR2 COAGR1 COAGR0
15 14 13 12 11 10 9 8
COAB ~ ~ ~ ~ ~ ~ ~ COABL8
180118H 7 6 5 4 3 2 1 0
COABL7 COABL6 COABL5 COABL4 COABL3 COABL2 COABL1 COABL0
15 14 13 12 11 10 9 8
COBR ~ ~ ~ ~ ~ ~ ~ COBRD8
18011AH 7 6 5 4 3 2 1 0
COBRD7 COBRD6 COBRD5 COBRD4 COBRD3 COBRD2 COBRD1 COBRD0
15 14 13 12 11 10 9 8
COBG ~ ~ ~ ~ ~ ~ ~ COBGR8
18011CH 7 6 5 4 3 2 1 0
COBGR7 COBGR6 COBGR5 COBGR4 COBGR3 COBGR2 COBGR1 COBGR0
15 14 13 12 11 10 9 8
COBB ~ ~ ~ ~ ~ ~ ~ COBBL8
18011EH 7 6 5 4 3 2 1 0
COBBL7 COBBL6 COBBL5 COBBL4 COBBL3 COBBL2 COBBL1 COBBL0
Color offset value bit: Color offset data bit (COARD8 to COARD0, COAGR8 to
COAGR0, COABL8 to COABL0, COBRD8 to COBRD0, COBGR8 to COBGR0, COBBL8 to
COBBL0)
Sets the RGB individual value of color offset A and B. Negative numbers should be
set by two’s- complement values.
ST-58-R2 253
COARD8~COARD0 180114H Bit 8~0 For color offset A RED data
COAGR8~COAGR0 180116H Bit 8~0 For color offset A GREEN data
COABL8~COABL0 180118H Bit 8~0 For color offset A BLUE data
COBRD8~COBRD0 18011AH Bit 8~0 For color offset B RED data
COBGR8~COBGR0 18011CH Bit 8~0 For color offset B GREEN data
COBBL8~COBBL0 18011EH Bit 8~0 For color offset B BLUE data
254
Chapter 14 Shadow Function
Introduction ....................................................................256
14.1 Shadow Process .................................................. 256
Normal Shadow ................................................ 256
MSB Shadow .................................................... 258
Shadow Control Register .................................. 259
ST-58-R2 255
Introduction
This function projects a shadow on a sprite or scroll screen by using a sprite. There
are two types of sprite shadows: the Normal shadow and the MSB shadow. The
MSB shadow is used when the sprite is type 2 through 7, and is used when the sprite
shadow priority is highest. The shadow function is processed after the color calcula-
tion and color offset functions. The shadow function is shown in Figure 14.1.
+ =
Shadow Sprite
Normal Sprite
When the sprite priority of the Normal shadow or MSB shadow is highest, the
shadow process makes the sprite transparent and divides in half the brightness of
the part of the sprite in the top image.
Normal Shadow
With Normal shadow sprite, the number of bits to be determined by the sprite type
changes with dot color data of the least significant bit in the designated sprite type at
0, and all other dot color data at 1.
Sprite data of a Normal shadow designates the color control word such that all bits
of dot color data remaining from the dot color code are 1, with only the least signifi-
cant bit at 0. Also, sprite data of a Normal shadow is created by writing sprite char-
acters of the dot color code whose remaining bits are 1 to the frame buffer. In Figure
14.1, a shadow cannot be projected because it has already been directed to the frame
buffer. As a result, write to the frame buffer first. For more about color control
word, see “VDP1 User’s Manual.”
The scroll screen and back screen, which project a shadow by the Normal shadow
sprite, can designate in all screens.
256
A Normal shadow is shown in Figure 14.2 and sprite data of a Normal shadow is
shown in Figure 14.3.
Normal Shadow
Transparent Transparent
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 1 1 1 1 1 1 1 1 1 0
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 1 1 1 1 1 1 1 1 0
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 1 1 1 1 1 1 1 0
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 1 1 1 1 1 1 0
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 1 1 1 1 1 0
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 1 1 1 1 0
Note: The bits in the shaded areas are used in judging the normal shadow.
ST-58-R2 257
MSB Shadow
MSB shadow is enabled only when sprite types are type 2 through 7, with sprite
data MSB at 1. Depending on the value of 15 bits other than MSB, there are two
types of shadow: sprite shadow and the transparent shadow. The sprite shadow
MSB is 1 and all the values of 15 bits, other than the MSB, not 0. The transparent
shadow MSB is 1, with all the values of 15 bits, other than the MSB, at 0. When dot
color data satisfies Normal shadow conditions, it is judged to be a Normal shadow
even if sprite shadow conditions are satisfied.
MSB shadow sprite data is created by changing only MSB to 1 in the form of an MSB
shadow sprite for frame buffer data that the VDP1 has already written to. (See
“MSB On” in the “VDP1 User’s Manual.”) A shadow is added to the sprite charac-
ter when all frame buffer data bits before the MSB changes are not 0; i.e., when a
normal sprite that has already been written becomes a sprite shadow.
A shadow is added for a scroll screen priority that is one less than the sprite of the
transparent shadow when all frame buffer data bits before the MSB is changed are 0;
i.e., a transparent shadow will result when transparent. Scroll screen and back
screen that add shadows by sprites of the transparent shadow sprites can be selected
on each screen.
The MSB shadow can not be used when using the sprite window. For more details
about the sprite window, see “8.1 Window Area.” The sprite shadow and transpar-
ent shadow are shown in Figure 14.4. Sprite data of the MSB shadow is shown in
Figure 14.5.
Sprite Shadow
Transparent Shadow
Transparent Transparent
Frame Buffer before changing MSB Frame Buffer after changing MSB
258
Sprite Shadow
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 X X X X X X X X X X X X X X X
The Xed bits could be either 0 or 1 as long as the dot color data in the selected sprite
type does not meet the conditions of Normal Shadow.
Transparent Shadow
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
The sprite of a sprite shadow always uses the shadow function for itself.
ST-58-R2 259
xxSDEN Process
0 Does not use shadow function (shadow not added)
1 Uses shadow function (shadow added)
Note: N0, N1, N2, N3, R0, or BK is entered in bit name for xx.
260
Chapter 15 How to Use VDP2
ST-58-R2 261
15.1 Operation Flow
Below is an overview of the steps for defining and setting VDP2 data.
262
Step 6 Calculate the size of VRAM to determine whether the tables can be stored
there.
• VRAM size
• Character pattern (number and size)
• Pattern name table (number and size)
• Bit map pattern (number and size)
• Line scroll table
• Vertical cell scroll table
• Rotation parameter table
• Coefficient table
• Line color screen table
• Back screen table
• Line window table
Step 12 Reset the screen, redefine and reset VRAM and registers in terms of story.
ST-58-R2 263
15.2 How to Use RAM
When using VDP2, data is defined and set in VRAM, color RAM, and the register.
• VRAM
Data defined in VRAM differs depending on the scroll screen to be used, screen
format, screen size, and the image process functions to be used. Data is defined in
VRAM according to the register setting; defined addresses are set in the various
address registers. Table 15.1 shows the main register connected with data defined in
VRAM.
264
Table 15.1 Register connected with data defined in VRAM
Data Definition Register Setting Data
Pattern Name Control Register Pattern Name Data Size,
(180030H~180038H) Character Number
Supplementary Mode, Pattern
Name Supplementary Data
Plane size register (18003AH) Plane size when in displaying
in cell format
Pattern name Character pattern lead Normal scroll screen map Pattern Name Data lead
table address register (180040H~18004EH) address for each plane
Rotation scroll screen map Pattern Name Data lead
register (180050H~18006EH) address for each plane
Map offset register 3 bits map offset value
(18003CH~18003EH) attached to map register upper
bits
Character Dot data of cell Character control register Character color count,
pattern (180028H, 18002AH) character size
Bitmap pattern Bitmap pattern data Character control register Character color count (bitmap
(180028H, 18002AH) color count), bitmap size,
bitmap enable
Map offset register Boundary address of bitmap
(18003CH~18003EH) pattern
Line scroll Horizontal and vertical Line scroll table address Line scroll table lead address
table screen scroll value, register (1800A0H~1800A6H)
horizontal coordinate Line & vertical cell scroll Scroll configuration control
increment control register (18009AH) data
Vertical cell Vertical screen scroll Vertical cell scroll table Vertical cell scroll table lead
scroll table value address register (18009CH, address
18009EH)
Line & vertical cell scroll Scroll configuration control
control register (18009AH) data
RAM control register VRAM use per rotation scroll
Rotation Parameter, (18000EH) screen
Rotation Coefficient Table Rotation parameter table Parameter table lead address
parameter Related Registers address register (1800BCH,
table 1800BEH)
Rotation parameter mode Rotation parameter mode
register (1800B0H) setting
Coefficient table data RAM control register VRAM use per rotation scroll
(Zoom Coefficients kx, (18000EH) screen
Coefficient ky, and start point Coefficient table control Coefficient data mode, data
table coordinate Xp after register (1800B4H) size of coefficient data,
rotation conversion) coefficient table enable
Coefficient table address Coefficient table lead address
offset register (1800B6H) offset value
Line color Color RAM address Line color screen table Line color screen color mode,
screen table address register (1800A8H, line color screen table lead
1800AAH) address
Back screen RGB color data Back screen table address Back screen color mode, back
table register (1800ACH, screen table lead address
1800AEH)
Line window Horizontal start point Line window table address Line window enable, line
table coordinate, horizontal register window table lead address
end point coordinate (1800D8H~1800DEH)
ST-58-R2 265
• Color RAM Definition
Defines the sprite of the palette format and scroll screen color data. Color data
stored in color RAM is in RGB format and has three modes. Mode selection desig-
nates in the color RAM mode (CRMD1, CRMD0, bits 13 and 12) of the RAM control
register (18000EH).
The most significant bit of color data stored in color RAM is the enable bit when the
special color calculation mode is mode 3. Color is calculated in dot units for dots
using color data when the most significant bit color data is 1, the special color calcu-
lation mode is mode 3, the color format is the palette format, and the color calcula-
tion enable bit is 1.
• Register
The register is, as a rule, a write-only, 16-bit register that designates the VDP2 func-
tion. One function may extend in several registers, and several functions may be
arrange in one register. Set registers corresponding to the functions to be used when
needed.
266
15.3 Bit Configuration Map
Every register bit register is related to various other bits. The bit map configuration
of separate scroll screens and separate priority functions is shown in the bit map
configuration below.
TV Screen Mode
ST-58-R2 267
Screen Status
268
RAM
VRAM
VRAM Cycle Pattern (For VRAM-A0 (or VRAM-A )) (VCPnA0, 180010H, 180012H )
VRAM Cycle Pattern (For VRAM-A1 ) (VCPnA1, 180014H, 180016H )
VRAM Cycle Pattern (For VRAM-B0 (or VRAM-B )) (VCPnB0, 180018H, 18001AH )
VRAM Cycle Pattern (For VRAM-B1 ) (VCPnB1, 18001CH, 18001EH )
For Timing T0 (VCP0xx, 18001yH, bit 15~12 )
For Timing T1 (VCP1xx, 18001yH, bit 11~8 )
For Timing T2 (VCP2xx, 18001yH, bit 7~4 )
For Timing T3 (VCP3xx, 18001yH, bit 3~0 )
For Timing T4 (VCP4xx, 18001zH, bit 15~12 )
For Timing T5 (VCP5xx, 18001zH, bit 11~8 )
For Timing T6 (VCP6xx, 18001zH, bit 7~4 )
For Timing T7 (VCP7xx, 18001zH, bit 3~0 )
0000 : NBG0 Pattern Name Data Read
0001 : NBG1 Pattern Name Data Read
0010 : NBG2 Pattern Name Data Read
0011 : NBG3 Pattern Name Data Read
0100 : NBG0 Character Pattern Data Read
0101 : NBG1 Character Pattern Data Read
0110 : NBG2 Character Pattern Data Read
0111 : NBG3 Character Pattern Data Read
1100 : Vertical Cell Scroll Table Data Read for NBG0
1101 : Vertical Cell Scroll Table Data Read for NBG1
1110 : CPU Read/Write
1111 : No Access
Color RAM
Color RAM Mode (CRMD, 18000EH, bit 13~12)
00 : Mode 0 : RGB, each 5 bits; 1024 color settings
01 : Mode 1 : RGB, each 5 bits; 2048 color settings
10 : Mode 2 : RGB, each 5 bits; 1024 color settings
ST-58-R2 269
Scroll Screen
Line Screen
Line Color Screen : LNCL
Back Screen : BACK
270
Cell Format (NBG0 )
ST-58-R2 271
Normal Scroll Screen (NBG0) (continued)
Vertical Cell Scroll Table Address (VCSTA, 18009CH, bit 2~18009EH, bit 1 )
272
Normal Scroll Screen (NBG1)
(Continued)
ST-58-R2 273
Cell Format (NBG1 )
274
Normal Scroll Screen (NBG1) (Continued)
Vertical Cell Scroll Table Address (VCSTA, 18009CH, bit 2~18009EH, bit 1 )
ST-58-R2 275
Normal Scroll Screen (NBG2)
276
Cell Format (NBG2 )
ST-58-R2 277
Normal Scroll Screen (NBG3)
278
Cell Format (NBG3 )
ST-58-R2 279
Rotation Scroll Screen (RBG0 )
(Continued)
280
Cell Format (RBG0 )
ST-58-R2 281
For Rotation Parameter A (RBG0 )
282
For Rotation Parameter B (RBG0 )
ST-58-R2 283
Rotation Scroll Screen (RBG0 ) (Continued)
284
Rotation Scroll Screen (RBG1 )
ST-58-R2 285
Cell Format (RBG1 )
Pattern Name Data Size (For NBG0) (N0PNB, 180030H, bit 15)
0 : 2 Words
1 : 1 Word
Character Number Supplementary Mode (For NBG0) (N0CNSM, 180030H, bit 14)
0 : Character number in pattern name data is 10 bits, reverse function
can be selected per character unit
1 : Character number in pattern name data is 12 bits, reverse function
cannot be selected
286
Line Color Screen (LNCL)
Line Color Screen Table Address (LCTA, 1800A8H, bit 2~1800AAH, bit 0)
Window
Normal Rectangular Window
W0
W1
Normal Line Window
Sprite Window : SW
Sprite Window
ST-58-R2 287
Window Control
(Continued)
288
Window Control (Continued)
ST-58-R2 289
Sprite
290
Do t Col or Dat a
ST-58-R2 291
Priority
292
Color Calculation
ST-58-R2 293
Color Offset
Shadow Function
294
Chapter 16 Quick Reference
ST-58-R2 295
Quick reference contains registers and VRAM tables as follows:
(2) Register Bit List: Shows in order of register names; shows register
bit names, bit abbreviations, addresses and bit
positions.
(3) Register Bit Functions: Shows register bit functions in order of register
address.
296
• TV SCREEN MODE (READ ALLOWED)
15 14 13 12 11 10 9 8
TVMD DISP ~ ~ ~ ~ ~ ~ BDCLMD
180000H 7 6 5 4 3 2 1 0
LSMD1 LSMD0 VRESO1 VRESO0 ~ HRESO2 HRESO1 HRESO0
• RESERVE
15 14 13 12 11 10 9 8
~ ~ ~ ~ ~ ~ ~ ~
18000CH 7 6 5 4 3 2 1 0
~ ~ ~ ~ ~ ~ ~ ~
ST-58-R2 297
• VRAM CYCLE PATTERN (BANK A0)
15 14 13 12 11 10 9 8
CYCA0L VCP0A03 VCP0A02 VCP0A01 VCP0A00 VCP1A03 VCP1A02 VCP1A01 VCP1A00
180010H 7 6 5 4 3 2 1 0
VCP2A03 VCP2A02 VCP2A01 VCP2A00 VCP3A03 VCP3A02 VCP3A01 VCP3A00
298
• SCREEN DISPLAY ENABLE
15 14 13 12 11 10 9 8
BGON ~ ~ ~ R0TPON N3TPON N2TPON N1TPON N0TPON
180020H 7 6 5 4 3 2 1 0
~ ~ R1ON R0ON N3ON N2ON N1ON N0ON
• MOSAIC CONTROL
15 14 13 12 11 10 9 8
MZCTL MZSZV3 MZSZV2 MZSZV1 MZSZV0 MZSZH3 MZSZH2 MZSZH1 MZSZH0
180022H 7 6 5 4 3 2 1 0
~ ~ ~ R0MZE N3MZE N2MZE N1MZE N0MZE
ST-58-R2 299
• PATTERN NAME CONTROL (NBG0)
15 14 13 12 11 10 9 8
PNCN0 N0PNB N0CNSM ~ ~ ~ ~ N0SPR N0SCC
180030H 7 6 5 4 3 2 1 0
N0SPLT6 N0SPLT5 N0SPLT4 N0SCN4 N0SCN3 N0SCN2 N0SCN1 N0SCN0
• PLANE SIZE
15 14 13 12 11 10 9 8
PLSZ RBOVR1 RBOVR0 RBPLSZ1 RBPLSZ0 RAOVR1 RAOVR0 RAPLSZ1 RAPLSZ0
18003AH 7 6 5 4 3 2 1 0
N3PLSZ1 N3PLSZ0 N2PLSZ1 N2PLSZ0 N1PLSZ1 N1PLSZ0 N0PLSZ1 N0PLSZ0
300
• MAP (NBG0, PLANE A,B)
15 14 13 12 11 10 9 8
MPABN0 ~ ~ N0MPB5 N0MPB4 N0MPB3 N0MPB2 N0MPB1 N0MPB0
180040H 7 6 5 4 3 2 1 0
~ ~ N0MPA5 N0MPA4 N0MPA3 N0MPA2 N0MPA1 N0MPA0
ST-58-R2 301
• MAP (ROTATION PARAMETER A, PLANE A,B)
15 14 13 12 11 10 9 8
MPABRA ~ ~ RAMPB5 RAMPB4 RAMPB3 RAMPB2 RAMPB1 RAMPB0
180050H 7 6 5 4 3 2 1 0
~ ~ RAMPA5 RAMPA4 RAMPA3 RAMPA2 RAMPA1 RAMPA0
302
• MAP (ROTATION PARAMETER B, PLANE A,B)
15 14 13 12 11 10 9 8
MPABRB ~ ~ RBMPB5 RBMPB4 RBMPB3 RBMPB2 RBMPB1 RBMPB0
180060H 7 6 5 4 3 2 1 0
~ ~ RBMPA5 RBMPA4 RBMPA3 RBMPA2 RBMPA1 RBMPA0
ST-58-R2 303
• SCREEN SCROLL VALUE (NBG0, HORIZONTAL INTEGER PART)
15 14 13 12 11 10 9 8
SCXIN0 ~ ~ ~ ~ ~ N0SCXI10 N0SCXI9 N0SCXI8
180070H 7 6 5 4 3 2 1 0
N0SCXI7 N0SCXI6 N0SCXI5 N0SCXI4 N0SCXI3 N0SCXI2 N0SCXI1 N0SCXI0
304
• SCREEN SCROLL VALUE (NBG1, HORIZONTAL INTEGER PART)
15 14 13 12 11 10 9 8
SCXIN1 ~ ~ ~ ~ ~ N1SCXI10 N1SCXI9 N1SCXI8
180080H 7 6 5 4 3 2 1 0
N1SCXI7 N1SCXI6 N1SCXI5 N1SCXI4 N1SCXI3 N1SCXI2 N1SCXI1 N1SCXI0
ST-58-R2 305
• SCREEN SCROLL VALUE (NBG2, HORIZONTAL)
15 14 13 12 11 10 9 8
SCXN2 ~ ~ ~ ~ ~ N2SCX10 N2SCX9 N2SCX8
180090H 7 6 5 4 3 2 1 0
N2SCX7 N2SCX6 N2SCX5 N2SCX4 N2SCX3 N2SCX2 N2SCX1 N2SCX0
• REDUCTION ENABLE
15 14 13 12 11 10 9 8
ZMCTL ~ ~ ~ ~ ~ ~ N1ZMQT N1ZMHF
180098H 7 6 5 4 3 2 1 0
~ ~ ~ ~ ~ ~ N0ZMQT N0ZMHF
306
• LINE SCROLL TABLE ADDRESS (NBGO)
15 14 13 12 11 10 9 8
LSTA0U ~ ~ ~ ~ ~ ~ ~ ~
1800A0H 7 6 5 4 3 2 1 0
~ ~ ~ ~ ~ N0LSTA18 N0LSTA17 N0LSTA16
ST-58-R2 307
• ROTATION PARAMETER MODE
15 14 13 12 11 10 9 8
RPMD ~ ~ ~ ~ ~ ~ ~ ~
1800B0H 7 6 5 4 3 2 1 0
~ ~ ~ ~ ~ ~ RPMD1 RPMD0
308
• WINDOW POSITION (W0, HORIZONTAL START POINT)
15 14 13 12 11 10 9 8
WPSX0 ~ ~ ~ ~ ~ ~ W0SX9 W0SX8
1800C0H 7 6 5 4 3 2 1 0
W0SX7 W0SX6 W0SX5 W0SX4 W0SX3 W0SX2 W0SX1 W0SX0
ST-58-R2 309
• WINDOW CONTROL (NBG0, NBG1)
15 14 13 12 11 10 9 8
WCTLA N1LOG ~ N1SWE N1SWA N1W1E N1W1A N1W0E N1W0A
1800D0H 7 6 5 4 3 2 1 0
N0LOG ~ N0SWE N0SWA N0W1E N0W1A N0W0E N0W0A
1800DAH 7 6 5 4 3 2 1 0
W0LWTA7 W0LWTA6 W0LWTA5 W0LWTA4 W0LWTA3 W0LWTA2 W0LWTA1 ~
1800DEH 7 6 5 4 3 2 1 0
W1LWTA7 W1LWTA6 W1LWTA5 W1LWTA4 W1LWTA3 W1LWTA2 W1LWTA1 ~
310
• SPRITE CONTROL
15 14 13 12 11 10 9 8
SPCTL ~ ~ SPCCCS1 SPCCCS0 ~ SPCCN2 SPCCN1 SPCCN0
1800E0H 7 6 5 4 3 2 1 0
~ ~ SPCLMD SPWINEN SPTYPE3 SPTYPE2 SPTYPE1 SPTYPE0
• SHADOW CONTROL
15 14 13 12 11 10 9 8
SDCTL ~ ~ ~ ~ ~ ~ ~ TPSDSL
1800E2H 7 6 5 4 3 2 1 0
~ ~ BKSDEN R0SDEN N3SDEN N2SDEN N1SDEN N0SDEN
ST-58-R2 311
• PRIORITY NUMBER (SPRITE 0,1)
15 14 13 12 11 10 9 8
PRISA ~ ~ ~ ~ ~ S1PRIN2 S1PRIN1 S1PRIN0
1800F0H 7 6 5 4 3 2 1 0
~ ~ ~ ~ ~ S0PRIN2 S0PRIN1 S0PRIN0
• RESERVE
15 14 13 12 11 10 9 8
~ ~ ~ ~ ~ ~ ~ ~
1800FEH 7 6 5 4 3 2 1 0
~ ~ ~ ~ ~ ~ ~ ~
312
• COLOR CALCULATION RATIO (SPRITE 0,1)
15 14 13 12 11 10 9 8
CCRSA ~ ~ ~ S1CCRT4 S1CCRT3 S1CCRT2 S1CCRT1 S1CCRT0
180100H 7 6 5 4 3 2 1 0
~ ~ ~ S0CCRT4 S0CCRT3 S0CCRT2 S0CCRT1 S0CCRT0
ST-58-R2 313
• COLOR OFFSET ENABLE
15 14 13 12 11 10 9 8
CLOFEN ~ ~ ~ ~ ~ ~ ~ ~
180110H 7 6 5 4 3 2 1 0
~ SPCOEN BKCOEN R0COEN N3COEN N2COEN N1COEN N0COEN
314
16.2 Register Bit List
ST-58-R2 315
Bit Name Bit Address Bit Application
Abbreviation
• VRAM Cycle Pattern
VRAM Cycle Pattern VCPA0 180010H 15~0 For VRAM-A0
180012H 15~0 For VRAM-A0
VRAM Cycle Pattern VCPA1 180014H 15~0 For VRAM-A1
180016H 15~0 For VRAM-A1
VRAM Cycle Pattern VCPB0 180018H 15~0 For VRAM-B0
18001AH 15~0 For VRAM-B0
VRAM Cycle Pattern VCPB1 18001CH 15~0 For VRAM-B1
18001EH 15~0 For VRAM-B1
• Screen Display Enable
Transparent Display Enable N0TPON 180020H 8 For NBG0 (or RBG0)
Transparent Display Enable N1TPON 180020H 9 For NBG1 (or EXBG)
Transparent Display Enable N2TPON 180020H 10 For NBG2
Transparent Display Enable N3TPON 180020H 11 For NBG3
Transparent Display Enable R0TPON 180020H 12 For RBG0
Screen Display Enable N0ON 180020H 0 For NBG0
Screen Display Enable N1ON 180020H 1 For NBG1
Screen Display Enable N2ON 180020H 2 For NBG2
Screen Display Enable N3ON 180020H 3 For NBG3
Screen Display Enable R0ON 180020H 4 For RBG0
Screen Display Enable R1ON 180020H 5 For RBG1
• Mosaic Control
Mosaic Enable N0MZE 180022H 0 For NBG0 (or RBG1)
Mosaic Enable N1MZE 180022H 1 For NBG1
Mosaic Enable N2MZE 180022H 2 For NBG2
Mosaic Enable N3MZE 180022H 3 For NBG3
Mosaic Enable R0MZE 180022H 4 For RBG0
Mosaic Size MZSZH 180022H 11~8 For Horizontal Mosaic Size
Mosaic Size MZSZV 180022H 15~12 For Vertical Mosaic Size
• Special Function Code Select
Special Function Code Select N0SFCS 180024H 0 For NBG0 (or RBG1)
Special Function Code Select N1SFCS 180024H 1 For NBG1
Special Function Code Select N2SFCS 180024H 2 For NBG2
Special Function Code Select N3SFCS 180024H 3 For NBG3
Special Function Code Select R0SFCS 180024H 4 For RBG0
• Special Function Code
Special Function SFCDA 180026H 7~0 For Special Function Code A
Special Function SFCDB 180026H 15~8 For Special Function Code B
316
Bit Name Bit Address Bit Application
Abbreviation
• Character Control
Character Size N0CHSZ 180028H 0 For NBG0 (or RBG1)
Character Size N1CHSZ 180028H 8 For NBG1
Character Size N2CHSZ 18002AH 0 For NBG2
Character Size N3CHSZ 18002AH 4 For NBG3
Character Size R0CHSZ 18002AH 8 For RBG0
Bitmap Enable N0BMEN 180028H 1 For NBG0
Bitmap Enable N1BMEN 180028H 9 For NBG1
Bitmap Enable R0BMEN 18002AH 9 For RBG0
Bitmap Size N0BMSZ 180028H 3,2 For NBG0
Bitmap Size N1BMSZ 180028H 11,10 For NBG1
Bitmap Size R0BMSZ 18002AH 10 For RBG0
Number of Character Colors N0CHCN 180028H 6~4 For NBG0 (or RBG1)
Number of Character Colors N1CHCN 180028H 13,12 For NBG1 (or EXBG)
Number of Character Colors N2CHCN 18002AH 1 For NBG2
Number of Character Colors N3CHCN 18002AH 5 For NBG3
Number of Character Colors R0CHCN 18002AH 14,12 For RBG0
• Bitmap Palette Number
Special Priority (for Bitmap) N0BMPR 18002CH 5 For NBG0
Special Priority (for Bitmap) N1BMPR 18002CH 13 For NBG1
Special Priority (for Bitmap) R0BMPR 18002EH 5 For RBG0
Special Color Calculation (for Bitmap) N0BMCC 18002CH 4 For NBG0
Special Color Calculation (for Bitmap) N1BMCC 18002CH 12 For NBG1
Special Color Calculation (for Bitmap) R0BMCC 18002EH 4 For RBG0
Palette Number (for Bitmap) N0BMP 18002CH 2~0 For NBG0
Palette Number (for Bitmap) N1BMP 18002CH 10~8 For NBG1
Palette Number (for Bitmap) R0BMP 18002EH 2~0 For RBG0
• Pattern Name Control
Pattern Name Data Size N0PNB 180030H 15 For NBG0 (or RBG1)
Pattern Name Data Size N1PNB 180032H 15 For NBG1
Pattern Name Data Size N2PNB 180034H 15 For NBG2
Pattern Name Data Size N3PNB 180036H 15 For NBG3
Pattern Name Data Size R0PNB 180038H 15 For RBG0
Character Number N0CNSM 180030H 14 For NBG0 (or RBG1)
Supplement Mode
Character Number N1CNSM 180032H 14 For NBG1
Supplement Mode
Character Number N2CNSM 180034H 14 For NBG2
Supplement Mode
Character Number N3CNSM 180036H 14 For NBG3
Supplement Mode
Character Number R0CNSM 180038H 14 For RBG0
Supplement Mode
ST-58-R2 317
• Pattern Name Control (Continued)
Special Priority (For Pattern N0SPR 180030H 9 For NBG0 (or RBG1)
Name Supplement Data)
Special Priority (For Pattern N1SPR 180032H 9 For NBG1
Name Supplement Data)
Special Priority (For Pattern N2SPR 180034H 9 For NBG2
Name Supplement Data)
Special Priority (For Pattern N3SPR 180036H 9 For NBG3
Name Supplement Data)
Special Priority (For Pattern R0SPR 180038H 9 For RBG0
Name Supplement Data)
Special Color Calculation N0SCC 180030H 8 For NBG0 (or RBG1)
(For Pattern Name
Supplement Data)
Special Color Calculation N1SCC 180032H 8 For NBG1
(For Pattern Name Supplement
Data)
Special Color Calculation N2SCC 180034H 8 For NBG2
(For Pattern Name Supplement
Data)
Special Color Calculation N3SCC 180036H 8 For NBG3
(For Pattern Name Supplement
Data)
Special Color Calculation R0SCC 180038H 8 For RBG0
(For Pattern Name Supplement
Data)
Supplement Palette Number N0SPLT 180030H 7~5 For NBG0 (or RBG1)
Supplement Palette Number N1SPLT 180032H 7~5 For NBG1
Supplement Palette Number N2SPLT 180034H 7~5 For NBG2
Supplement Palette Number N3SPLT 180036H 7~5 For NBG3
Supplement Palette Number R0SPLT 180038H 7~5 For RBG0
Supplement Character Number N0SCN 180030H 4~0 For NBG0 (or RBG1)
Supplement Character Number N1SCN 180032H 4~0 For NBG1
Supplement Character Number N2SCN 180034H 4~0 For NBG2
Supplement Character Number N3SCN 180036H 4~0 For NBG3
Supplement Character Number R0SCN 180038H 4~0 For RBG0
• Plane Size
Plane Size N0PLSZ 18003AH 1,0 For NBG0
Plane Size N1PLSZ 18003AH 3,2 For NBG1
Plane Size N2PLSZ 18003AH 5,4 For NBG2
Plane Size N3PLSZ 18003AH 7,6 For NBG3
Plane Size RAPLSZ 18003AH 9,8 For Rotation Parameter A
Plane Size RBPLSZ 18003AH 13,12 For Rotation Parameter B
Screen Over Processing RAOVR 18003AH 11,10 For Rotation Parameter A
Screen Over Processing RBOVR 18003AH 15,14 For Rotation Parameter B
• Map Offset
Map Offset N0MP 18003CH 2~0 For NBG0
Map Offset N1MP 18003CH 6~4 For NBG1
Map Offset N2MP 18003CH 10~8 For NBG2
Map Offset N3MP 18003CH 14~12 For NBG3
Map Offset RAMP 18003EH 2~0 For Rotation Parameter A
Map Offset RBMP 18003EH 6~4 For Rotation Parameter B
318
Bit Name Bit Address Bit Application
Abbreviation
• Map
Map (For Normal Scroll) N0MPA 180040H 5~0 For NBG0 Plane A
Map (For Normal Scroll) N0MPB 180040H 13~8 For NBG0 Plane B
Map (For Normal Scroll) N0MPC 180042H 5~0 For NBG0 Plane C
Map (For Normal Scroll) N0MPD 180042H 13~8 For NBG0 Plane D
Map (For Normal Scroll) N1MPA 180044H 5~0 For NBG1 Plane A
Map (For Normal Scroll) N1MPB 180044H 13~8 For NBG1 Plane B
Map (For Normal Scroll) N1MPC 180046H 5~0 For NBG1 Plane C
Map (For Normal Scroll) N1MPD 180046H 13~8 For NBG1 Plane D
Map (For Normal Scroll) N2MPA 180048H 5~0 For NBG2 Plane A
Map (For Normal Scroll) N2MPB 180048H 13~8 For NBG2 Plane B
Map (For Normal Scroll) N2MPC 18004AH 5~0 For NBG2 Plane C
Map (For Normal Scroll) N2MPD 18004AH 13~8 For NBG2 Plane D
Map (For Normal Scroll) N3MPA 18004CH 5~0 For NBG3 Plane A
Map (For Normal Scroll) N3MPB 18004CH 13~8 For NBG3 Plane B
Map (For Normal Scroll) N3MPC 18004EH 5~0 For NBG3 Plane C
Map (For Normal Scroll) N3MPD 18004EH 13~8 For NBG3 Plane D
Map (For Rotation Scroll) RAMPA 180050H 5~0 Rotation Parameter-A Screen Plane-A
Map (For Rotation Scroll) RAMPB 180050H 13~8 Rotation Parameter-A Screen Plane-B
Map (For Rotation Scroll) RAMPC 180052H 5~0 Rotation Parameter-A Screen Plane-C
Map (For Rotation Scroll) RAMPD 180052H 13~8 Rotation Parameter-A Screen Plane-D
Map (For Rotation Scroll) RAMPE 180054H 5~0 Rotation Parameter-A Screen Plane-E
Map (For Rotation Scroll) RAMPF 180054H 13~8 Rotation Parameter-A Screen Plane-F
Map (For Rotation Scroll) RAMPG 180056H 5~0 Rotation Parameter-A Screen Plane-G
Map (For Rotation Scroll) RAMPH 180056H 13~8 Rotation Parameter-A Screen Plane-H
Map (For Rotation Scroll) RAMPI 180058H 5~0 Rotation Parameter-A Screen Plane-I
Map (For Rotation Scroll) RAMPJ 180058H 13~8 Rotation Parameter-A Screen Plane-J
Map (For Rotation Scroll) RAMPK 18005AH 5~0 Rotation Parameter-A Screen Plane-K
Map (For Rotation Scroll) RAMPL 18005AH 13~8 Rotation Parameter-A Screen Plane-L
Map (For Rotation Scroll) RAMPM 18005CH 5~0 Rotation Parameter-A Screen Plane-M
Map (For Rotation Scroll) RAMPN 18005CH 13~8 Rotation Parameter-A Screen Plane-N
Map (For Rotation Scroll) RAMPO 18005EH 5~0 Rotation Parameter-A Screen Plane-O
Map (For Rotation Scroll) RAMPP 18005EH 13~8 Rotation Parameter-A Screen Plane-P
Map (For Rotation Scroll) RBMPA 180060H 5~0 Rotation Parameter-B Screen Plane-A
Map (For Rotation Scroll) RBMPB 180060H 13~8 Rotation Parameter-B Screen Plane-B
Map (For Rotation Scroll) RBMPC 180062H 5~0 Rotation Parameter-B Screen Plane-C
Map (For Rotation Scroll) RBMPD 180062H 13~8 Rotation Parameter-B Screen Plane-D
Map (For Rotation Scroll) RBMPE 180064H 5~0 Rotation Parameter-B Screen Plane-E
Map (For Rotation Scroll) RBMPF 180064H 13~8 Rotation Parameter-B Screen Plane-F
Map (For Rotation Scroll) RBMPG 180066H 5~0 Rotation Parameter-B Screen Plane-G
Map (For Rotation Scroll) RBMPH 180066H 13~8 Rotation Parameter-B Screen Plane-H
Map (For Rotation Scroll) RBMPI 180068H 5~0 Rotation Parameter-B Screen Plane-I
Map (For Rotation Scroll) RBMPJ 180068H 13~8 Rotation Parameter-B Screen Plane-J
ST-58-R2 319
Bit Name Bit Address Bit Application
Abbreviation
• Map (Continued)
Map (For Rotation Scroll) RBMPK 18006AH 5~0 Rotation Parameter-B Screen Plane-K
Map (For Rotation Scroll) RBMPL 18006AH 13~8 Rotation Parameter-B Screen Plane-L
Map (For Rotation Scroll) RBMPM 18006CH 5~0 Rotation Parameter-B Screen Plane-M
Map (For Rotation Scroll) RBMPN 18006CH 13~8 Rotation Parameter-B Screen Plane-N
Map (For Rotation Scroll) RBMPO 18006EH 5~0 Rotation Parameter-B Screen Plane-O
Map (For Rotation Scroll) RBMPP 18006EH 13~8 Rotation Parameter-B Screen Plane-P
• Screen Scroll Value
Screen Scroll Value N0SCXI 180070H 10~0 For NBG0 Horizontal (Integer Part)
Screen Scroll Value N0SCXD 180072H 15~8 For NBG0 Horizontal (Fractional Part)
Screen Scroll Value N0SCYI 180074H 10~0 For NBG0 Vertical (Integer Part)
Screen Scroll Value N0SCYD 180076H 15~8 For NBG0 Vertical (Fractional Part)
Screen Scroll Value N1SCXI 180080H 10~0 For NBG1 Horizontal (Integer Part)
Screen Scroll Value N1SCXD 180082H 15~8 For NBG1 Horizontal (Fractional Part)
Screen Scroll Value N1SCYI 180084H 10~0 For NBG1 Vertical (Integer Part)
Screen Scroll Value N1SCYD 180086H 15~8 For NBG1 Vertical (Fractional Part)
Screen Scroll Value N2SCX 180090H 10~0 For NBG2 Horizontal
Screen Scroll Value N2SCX 180092H 10~0 For NBG2 Vertical
Screen Scroll Value N3SCY 180094H 10~0 For NBG3 Horizontal
Screen Scroll Value N3SCY 180096H 10~0 For NBG3 Vertical
• Coordinate Increment
Coordinate Increment N0ZMXI 180078H 2~0 For NBG0 Horizontal (Integer Part)
Coordinate Increment N0ZMXD 18007AH 15~8 For NBG0 Horizontal (Fractional Part)
Coordinate Increment N0ZMYI 18007CH 2~0 For NBG0 Vertical (Integer Part)
Coordinate Increment N0ZMYD 18007EH 15~8 For NBG0 Vertical (Fractional Part)
Coordinate Increment N1ZMXI 180088H 2~0 For NBG1 Horizontal (Integer Part)
Coordinate Increment N1ZMXD 18008AH 15~8 For NBG1 Horizontal (Fractional Part)
Coordinate Increment N1ZMYI 18008CH 2~0 For NBG1 Vertical (Integer Part)
Coordinate Increment N1ZMYD 18008EH 15~8 For NBG1 Vertical (Fractional Part)
• Reduction Enable
Reduction Enable N0ZMHF 180098H 0 For NBG0
Reduction Enable N0ZMQT 180098H 1 For NBG0
Reduction Enable N1ZMHF 180098H 8 For NBG1
Reduction Enable N1ZMQT 180098H 9 For NBG1
• Line & Vertical Cell Scroll Control
Vertical Cell Scroll Enable N0VCSC 18009AH 0 For NBG0
Vertical Cell Scroll Enable N1VCSC 18009AH 8 For NBG1
Line Scroll Enable (For Horiz - N0LSCX 18009AH 1 For NBG0
ontal Screen Scroll Values)
Line Scroll Enable (For Horiz - N1LSCX 18009AH 9 For NBG1
ontal Screen Scroll Values)
Line Scroll Enable (For Vertical N0LSCY 18009AH 2 For NBG0
Screen Scroll Values)
320
Bit Name Bit Address Bit Application
Abbreviation
• Line & Vertical Cell Scroll Control (Continued)
Line Scroll Enable (For Vertical N1LSCY 18009AH 10 For NBG1
Screen Scroll Values)
Line Zoom Enable N0LZMX 18009AH 3 For NBG0
Line Zoom Enable N1LZMX 18009AH 11 For NBG1
Line Scroll Space N0LSS 18009AH 5,4 For NBG0
Line Scroll Space N1LSS 18009AH 13,12 For NBG1
• Vertical Cell Scroll Table Address
Vert. Cell Scroll Table Address VCSTA 18009CH 2~0
18009EH 15~1
• Line Scroll Table Address
Line Scroll Table Address N0LSTA 1800A0H 2~0 For NBG0 (Most Significant Bits)
1800A2H 15~1 For NBG0 (Least Significant Bits)
Line Scroll Table Address N1LSTA 1800A4H 2~0 For NBG1 (Most Significant Bits)
1800A6H 15~1 For NBG1 (Least Significant Bits)
• Line Color Screen Table Address
Line Color Screen Color Mode LCCLMD 1800A8H 15
Line Color Screen Table Add. LCTA 1800A8H 2~0
1800AAH 15~0
• Back Screen Table Address
Back Screen Color Mode BKCLMD 1800ACH 15
Back Screen Table Address BKTA 1800ACH 2~0
1800AEH 15~0
• Rotation Parameter Mode
Rotation Parameter Mode RPMD 1800B0H 1,0
• Rotation Parameter Read Control
Parameter Read Enable RAXSTRE 1800B2H 0 For Rotation Parameter-A Xst
Parameter Read Enable RBXSTRE 1800B2H 8 For Rotation Parameter-B Xst
Parameter Read Enable RAYSTRE 1800B2H 1 For Rotation Parameter-A Yst
Parameter Read Enable RBYSTRE 1800B2H 9 For Rotation Parameter-B Yst
Parameter Read Enable RAKASTRE 1800B2H 2 For Rotation Parameter-A KAst
Parameter Read Enable RBKASTRE 1800B2H 10 For Rotation Parameter-B KAst
• Coefficient Table Control
Coefficient Table Enable RAKTE 1800B4H 0 For Rotation Parameter-A
Coefficient Table Enable RBKTE 1800B4H 8 For Rotation Parameter-B
Coefficient Data Size RAKDBS 1800B4H 1 For Rotation Parameter-A
Coefficient Data Size RBKDBS 1800B4H 9 For Rotation Parameter-B
Coefficient Data Mode RAKMD 1800B4H 3,2 For Rotation Parameter-A
Coefficient Data Mode RBKMD 1800B4H 11,10 For Rotation Parameter-B
Coefficient Line Color Enable RAKLCE 1800B4H 4 For Rotation Parameter-A
Coefficient Line Color Enable RBKLCE 1800B4H 12 For Rotation Parameter-B
ST-58-R2 321
Bit Name Bit Address Bit Application
Abbreviation
• Coefficient Table Address Offset
Coefficient Table Add. Offset RAKTAOS 1800B6H 2~0 For Rotation Parameter-A
Coefficient Table Add. Offset RBKTAOS 1800B6H 10~8 For Rotation Parameter-B
• Screen Over Pattern Name
Screen Over Pattern Name RAOPN 1800B8H 15~0 For Rotation Parameter-A
Screen Over Pattern Name RBOPN 1800BAH 15~0 For Rotation Parameter-B
• Rotation Parameter Table Address
Rotation Parameter Table Add. RPTA 1800BCH 2~0
1800BEH 15~1
• Window Position
Window Position W0SX 1800C0H 9~0 For W0 Start Point Coordinates
(For Horizontal Coordinates)
Window Position W0SY 1800C2H 8~0 For W0 Start Point Coordinates
(For Vertical Coordinates)
Window Position W0EX 1800C4H 9~0 For W0 End Point Coordinates
(For Horizontal Coordinates)
Window Position W0EY 1800C6H 8~0 For W0 End Point Coordinates
(For Vertical Coordinates)
Window Position W1SX 1800C8H 9~0 For W1 Start Point Coordinates
(For Horizontal Coordinates)
Window Position W1SY 1800CAH 8~0 For W1 Start Point Coordinates
(For Vertical Coordinates)
Window Position W1EX 1800CCH 9~0 For W1 End Point Coordinates
(For Horizontal Coordinates)
Window Position W1EY 1800CEH 8~0 For W1 End Point Coordinates
(For Vertical Coordinates)
• Window Control
W0 Enable N0W0E 1800D0H 1 For Transparent Processing Window NBGO
(or RBG1)
W0 Enable N1W0E 1800D0H 9 For Transparent Processing Window NBG1
(or EXBG)
W0 Enable N2W0E 1800D2H 1 For Transparent Processing Window NBG2
W0 Enable N3W0E 1800D2H 9 For Transparent Processing Window NBG3
W0 Enable R0W0E 1800D4H 1 For Transparent Processing Window RBG0
W0 Enable SPW0E 1800D4H 9 For Transparent Processing Window Sprite
W0 Enable RPW0E 1800D6H 1 For Rotation Parameter Window
W0 Enable CCW0E 1800D6H 9 For Color Calculation Window
W0 Area N0W0A 1800D0H 0 For Transparent Processing Window NBGO
(or RBG1)
W0 Area N1W0A 1800D0H 8 For Transparent Processing Window NBG1
(or EXBG)
W0 Area N2W0A 1800D2H 0 For Transparent Processing Window NBG2
W0 Area N3W0A 1800D2H 8 For Transparent Processing Window NBG3
W0 Area R0W0A 1800D4H 0 For Transparent Processing Window RBG0
W0 Area SPW0A 1800D4H 8 For Transparent Processing Window Sprite
W0 Area RPW0A 1800D6H 0 For Rotation Parameter Window
W0 Area CCW0A 1800D6H 8 For Color Calculation Window
322
Bit Name Bit Address Bit Application
Abbreviation
• Window Control (Continued)
W1 Enable N0W1E 1800D0H 3 For Transparent Processing Window NBG0
(or RBG1)
W1 Enable N1W1E 1800D0H 11 For Transparent Processing Window NBG1
(or EXBG)
W1 Enable N2W1E 1800D2H 3 For Transparent Processing Window NBG2
W1 Enable N3W1E 1800D2H 11 For Transparent Processing Window NBG3
W1 Enable R0W1E 1800D4H 3 For Transparent Processing Window RBG0
W1 Enable SPW1E 1800D4H 11 For Transparent Processing Window Sprite
W1 Enable RPW1E 1800D6H 3 For Rotation Parameter Window
W1 Enable CCW1E 1800D6H 11 For Color Calculation Window
W1 Area N0W1A 1800D0H 2 For Transparent Processing Window NBG0
(or RBG1)
W1 Area N1W1A 1800D0H 10 For Transparent Processing Window NBG1
(or EXBG)
W1 Area N2W1A 1800D2H 2 For Transparent Processing Window NBG2
W1 Area N3W1A 1800D2H 10 For Transparent Processing Window NBG3
W1 Area R0W1A 1800D4H 2 For Transparent Processing Window RBG0
W1 Area SPW1A 1800D4H 10 For Transparent Processing Window Sprite
W1 Area RPW1A 1800D6H 2 For Rotation Parameter Window
W1 Area CCW1A 1800D6H 10 For Color Calculation Window
SW Enable N0SWE 1800D0H 5 For Transparent Processing Window NBG0
(or RBG1)
SW Enable N1SWE 1800D0H 13 For Transparent Processing Window NBG1
(or EXBG)
SW Enable N2SWE 1800D2H 5 For Transparent Processing Window NBG2
SW Enable N3SWE 1800D2H 13 For Transparent Processing Window NBG3
SW Enable R0SWE 1800D4H 5 For Transparent Processing Window RBG0
SW Enable SPSWE 1800D4H 13 For Transparent Processing Window Sprite
SW Enable CCSWE 1800D6H 13 For Color Calculation Window
SW Area N0SWA 1800D0H 4 For Transparent Processing Window NBG0
(or RBG1)
SW Area N1SWA 1800D0H 12 For Transparent Processing Window NBG1
(or EXBG)
SW Area N2SWA 1800D2H 4 For Transparent Processing Window NBG2
SW Area N3SWA 1800D2H 12 For Transparent Processing Window NBG3
SW Area R0SWA 1800D4H 4 For Transparent Processing Window RBG0
SW Area SPSWA 1800D4H 12 For Transparent Processing Window Sprite
SW Area CCSWA 1800D6H 12 For Color Calculation Window
Window Logic N0LOG 1800D0H 7 For Transparent Processing Window NBG0
(or RBG1)
Window Logic N1LOG 1800D0H 15 For Transparent Processing Window NBG1
(or EXBG)
Window Logic N2LOG 1800D2H 7 For Transparent Processing Window NBG2
Window Logic N3LOG 1800D2H 15 For Transparent Processing Window NBG3
Window Logic R0LOG 1800D4H 7 For Transparent Processing Window RBG0
Window Logic SPLOG 1800D4H 15 For Transparent Processing Window Sprite
ST-58-R2 323
Bit Name Bit Address Bit Application
Abbreviation
• Window Control (Continued)
Window Logic RPLOG 1800D6H 7 For Rotation Parameter Window
Window Logic CCLOG 1800D6H 15 For Color Calculation Window
• Line Window Table Address
Line Window Enable W0LWE 1800D8H 15 For W0
Line Window Enable W1LWE 1800DCH 15 For W1
Line Window Table Address W 0LWTA 1800D8H 2~0 For W0
1800DAH 15~1 For W0
Line Window Table Address W 1LWTA 1800DCH 2~0 For W1
1800DEH 15~1 For W1
• Sprite Control
Sprite Type SPTYPE 1800E0H 3~0
Sprite Window Enable SPWINEN 1800E0H 4
Sprite Color Mode SPCLMD 1800E0H 5
Sprite Color Calculation SPCCCS 1800E0H 13,12
Condition
Sprite Color Calculation SPCCN 1800E0H 10~8
Number
• Shadow Control
Transparent Shadow Select TPSDSL 1800E2H 8
Shadow Enable N0SDEN 1800E2H 0 For NBG0 (or RBG1)
Shadow Enable N1SDEN 1800E2H 1 For NBG1 (or EXBG)
Shadow Enable N2SDEN 1800E2H 2 For NBG2
Shadow Enable N3SDEN 1800E2H 3 For NBG3
Shadow Enable R0SDEN 1800E2H 4 For RBG0
Shadow Enable BKSDEN 1800E2H 5 For Back
• Color RAM Address Offset
Color RAM Address Offset N0CAOS 1800E4H 2~0 For NBG0 (or RBG1)
Color RAM Address Offset N1CAOS 1800E4H 6~4 For NBG1 (or EXBG)
Color RAM Address Offset N2CAOS 1800E4H 10~8 For NBG2
Color RAM Address Offset N3CAOS 1800E4H 14~12 For NBG3
Color RAM Address Offset R0CAOS 1800E6H 2~0 For RBG0
Color RAM Address Offset SPCAOS 1800E6H 6~4 For Sprite
• Line Color Screen Enable
Line Color Screen Insertion N0LCEN 1800F8H 0 For NBG0 (or RBG1)
Enable
Line Color Screen Insertion N1LCEN 1800F8H 1 For NBG1 (or EXBG)
Enable
Line Color Screen Insertion N2LCEN 1800F8H 2 For NBG2
Enable
Line Color Screen Insertion N3LCEN 1800F8H 3 For NBG3
Enable
Line Color Screen Insertion R0LCEN 1800F8H 4 For RBG0
Enable
Line Color Screen Insertion SPLCEN 1800F8H 5 For Sprite
Enable
324
Bit Name Bit Address Bit Application
Abbreviation
• Special Priority Mode
Special Priority Mode N0SPRM 1800EAH 1,0 For NBG0 (or RBG1)
Special Priority Mode N1SPRM 1800EAH 3,2 For NBG1 (or EXBG)
Special Priority Mode N2SPRM 1800EAH 5,4 For NBG2
Special Priority Mode N3SPRM 1800EAH 7,6 For NBG3
Special Priority Mode R0SPRM 1800EAH 9,8 For RBG0
• Color Calculation Control
Color Calculation Enable N0CCEN 1800ECH 0 For NBG0 (or RBG1)
Color Calculation Enable N1CCEN 1800ECH 1 For NBG1 (or EXBG)
Color Calculation Enable N2CCEN 1800ECH 2 For NBG2
Color Calculation Enable N3CCEN 1800ECH 3 For NBG3
Color Calculation Enable R0CCEN 1800ECH 4 For RBG0
Color Calculation Enable LCCCEN 1800ECH 5 For LNCL
Color Calculation Enable SPCCEN 1800ECH 6 For Sprite
Color Calculation Mode CCMD 1800ECH 8
Color Calculation Ratio Mode CCRTMD 1800ECH 9
Extended Color Calculation EXCCEN 1800ECH 10
Enable
Gradation Calculation Enable BOKEN 1800ECH 15
Gradation Screen Number BOKN 1800ECH 14~12
• Special Color Calculation Mode
Special Color Calculation Mode N0SCCM 1800EEH 1,0 For NBG0 (or RBG1)
Special Color Calculation Mode N1SCCM 1800EEH 3,2 For NBG1 (or EXBG)
Special Color Calculation Mode N2SCCM 1800EEH 5,4 For NBG2
Special Color Calculation Mode N3SCCM 1800EEH 7,6 For NBG3
Special Color Calculation Mode R0SCCM 1800EEH 9,8 For RBG0
• Priority Number
Priority Number (for Sprite) S0PRIN 1800F0H 2~0 For Sprite Register 0
Priority Number (for Sprite) S1PRIN 1800F0H 10~8 For Sprite Register 1
Priority Number (for Sprite) S2PRIN 1800F2H 2~0 For Sprite Register 2
Priority Number (for Sprite) S3PRIN 1800F2H 10~8 For Sprite Register 3
Priority Number (for Sprite) S4PRIN 1800F4H 2~0 For Sprite Register 4
Priority Number (for Sprite) S5PRIN 1800F4H 10~8 For Sprite Register 5
Priority Number (for Sprite) S6PRIN 1800F6H 2~0 For Sprite Register 6
Priority Number (for Sprite) S7PRIN 1800F6H 10~8 For Sprite Register 7
ST-58-R2 325
Bit Name Bit Address Bit Application
Abbreviation
• Priority Number (Continued)
Priority Number N0PRIN 1800F8H 2~0 For NBG0 (or RBG1)
(for Scroll Screen)
Priority Number for N1PRIN 1800F8H 10~8 For NBG1 (or EXBG)
(for Scroll Screen)
Priority Number for N2PRIN 1800FAH 2~0 For NBG2
(for Scroll Screen)
Priority Number for N3PRIN 1800FAH 10~8 For NBG3
(for Scroll Screen)
Priority Number for R0PRIN 1800FCH 2~0 For RBG0
(for Scroll Screen)
• Color Calculation Ratio
Color Calculation Ratio (For Sprite) S0CCRT 180100H 4~0 For Sprite Register 0
Color Calculation Ratio (For Sprite) S1CCRT 180100H 12~8 For Sprite Register 1
Color Calculation Ratio (For Sprite) S2CCRT 180102H 4~0 For Sprite Register 2
Color Calculation Ratio (For Sprite) S3CCRT 180102H 12~8 For Sprite Register 3
Color Calculation Ratio (For Sprite) S4CCRT 180104H 4~0 For Sprite Register 4
Color Calculation Ratio (For Sprite) S5CCRT 180104H 12~8 For Sprite Register 5
Color Calculation Ratio (For Sprite) S6CCRT 180106H 4~0 For Sprite Register 6
Color Calculation Ratio (For Sprite) S7CCRT 180106H 12~8 For Sprite Register 7
Color Calculation Ratio (For Scroll N0CCRT 180108H 4~0 For NBG0 (or RBG1)
Screen)
Color Calculation Ratio (For Scroll N1CCRT 180108H 12~8 For NBG1 (or EXBG)
Screen)
Color Calculation Ratio (For Scroll N2CCRT 18010AH 4~0 For NBG2
Screen)
Color Calculation Ratio (For Scroll N3CCRT 18010AH 12~8 For NBG3
Screen)
Color Calculation Ratio (For Scroll R0CCRT 18010CH 4~0 For RBG0
Screen)
Color Calculation Ratio (For Scroll LCCCRT 18010EH 4~0 For LNCL
Screen)
Color Calculation Ratio (For Scroll BKCCRT 18010EH 12~8 For BACK
Screen)
• Color Offset Enable
Color Offset Enable N0COEN 180110H 0 For NBG0 (or RBG1)
Color Offset Enable N1COEN 180110H 1 For NBG1 (or EXBG)
Color Offset Enable N2COEN 180110H 2 For NBG2
Color Offset Enable N3COEN 180110H 3 For NBG3
Color Offset Enable R0COEN 180110H 4 For RBG0
Color Offset Enable BKCOEN 180110H 5 For BACK
Color Offset Enable SPCOEN 180110H 6 For Sprite
• Color Offset Select
Color Offset Select N0COSL 180112H 0 For NBG0 (or RBG1)
Color Offset Select N1COSL 180112H 1 For NBG1 (or EXBG)
Color Offset Select N2COSL 180112H 2 For NBG2
Color Offset Select N3COSL 180112H 3 For NBG3
Color Offset Select R0COSL 180112H 4 For RBG0
Color Offset Select BKCOSL 180112H 5 For BACK
Color Offset Select SPCOSL 180112H 6 For Sprite
326
Bit Name Bit Address Bit Application
Abbreviation
• Color Offset
Color Offset Value COARD 180114H 8~0 For Color Offset A Red Data
Color Offset Value COAGR 180116H 8~0 For Color Offset A Green Data
Color Offset Value COABL 180118H 8~0 For Color Offset A Blue Data
Color Offset Value COBRD 18011AH 8~0 For Color Offset B Red Data
Color Offset Value COBGR 18011CH 8~0 For Color Offset B Green Data
Color Offset Value COBBL 18011EH 8~0 For Color Offset B Blue Data
ST-58-R2 327
16.3 Register Bit Functions
15 14 13 12 11 10 9 8
TVMD DISP ~ ~ ~ ~ ~ ~ BDCLMD
180000H 7 6 5 4 3 2 1 0
LSMD1 LSMD0 VRESO1 VRESO0 ~ HRESO2 HRESO1 HRESO0
DISP Process
0 Picture is not displayed on TV screen
1 Picture is displayed on TV screen
BDCLMD Process
0 Displays black
1 Display back screen
328
Horizontal resolution bit (HRESO2 to HRESO0), bit 2 to 0
Selects the horizontal resolution when a picture is displayed on the TV screen.
15 14 13 12 11 10 9 8
EXTEN ~ ~ ~ ~ ~ ~ EXLTEN EXSYEN
180002H 7 6 5 4 3 2 1 0
~ ~ ~ ~ ~ ~ DASEL EXBGEN
EXLTEN Condition
0 Latches when reading external signal enable register
1 Latches through external signal
EXSYEN Process
0 Does not input external sync signal
1 Inputs external sync signal, and synchronizes TV screen display with the
external
ST-58-R2 329
Display area select bit (DASEL), bit1
Designates the image display area. Valid only when the EXBGEN bit is 1.
DASEL Process
0 Displays screen image only in the set display area
1 Displays screen in the standard display area
EXBGEN Process
0 Does not input external screen data
1 Inputs external screen data
15 14 13 12 11 10 9 8
TVSTAT ~ ~ ~ ~ ~ ~ EXLTFG EXSYFG
180004H 7 6 5 4 3 2 1 0
~ ~ ~ ~ VBLANK HBLANK ODD PAL
330
Vertical blank flag (VBLANK), bit 3
Displays the vertical scan status of the TV screen.
ODD Display
0 During even field scan
1 During odd field scan
PAL Display
0 NTSC standard
1 PAL standard
15 14 13 12 11 10 9 8
VRSIZE VRAMSZ ~ ~ ~ ~ ~ ~ ~
180006H 7 6 5 4 3 2 1 0
~ ~ ~ ~ VER3 VER2 VER1 VER0
ST-58-R2 331
VRAM size bit (VRAMSZ), bit 15.
Indicates the VRAM capacity used in the system.
15 14 13 12 11 10 9 8
HCNT ~ ~ ~ ~ ~ ~ HCT9 HCT8
180008H 7 6 5 4 3 2 1 0
HCT7 HCT6 HCT5 HCT4 HCT3 HCT2 HCT1 HCT0
Graphic HCT9 HCT8 HCT7 HCT6 HCT5 HCT4 HCT3 HCT2 HCT1 HCT0
Mode
Normal H8 H7 H6 H5 H4 H3 H2 H1 H0 Invalid
Hi-Res H9 H8 H7 H6 H5 H4 H3 H2 H1 H0
Exclusive Invalid H8 H7 H6 H5 H4 H3 H2 H1 H0
Normal
Exclusive Invalid H9 H8 H7 H6 H5 H4 H3 H2 H1
Hi-Res
15 14 13 12 11 10 9 8
VCNT ~ ~ ~ ~ ~ ~ VCT9 VCT8
18000AH 7 6 5 4 3 2 1 0
VCT7 VCT6 VCT5 VCT4 VCT3 VCT2 VCT1 VCT0
332
V counter value bit : V counter bit (VCT9~VCT0), bit 9 to 0
Signals controlled through EXLTEN external signal enable register show the latched
V counter values.
TV Screen VCT9 VCT8 VCT7 VCT6 VCT5 VCT4 VCT3 VCT2 VCT1 VCT0
(Interlace) Mode
Normal Hi-Res V8 V7 V6 V5 V4 V3 V2 V1 V0 Invalid
(Non-Interlace,
Single-Density
Interlace)
Normal Hi-Res V8 V7 V6 V5 V4 V3 V2 V1 V0 0: Odd fields
(Double-Density 1: Even fields
Interlace)
Exclusive V9 V8 V7 V6 V5 V4 V3 V2 V1 V0
Monitor
15 14 13 12 11 10 9 8
RAMCTL CRKTE ~ CRMD1 CRMD0 ~ ~ VRBMD VRAMD
18000EH 7 6 5 4 3 2 1 0
RDBSB11 RDBSB10 RDBSB01 RDBSB00 RDBSA11 RDBSA10 RDBSA01 RDBSA00
CRKTE Process
0 Coefficient table is stored in VRAM.
1 Coefficient table is stored in color RAM.
ST-58-R2 333
VRAMD 18000EH Bit 8 For VRAM-A
VRBMD 18000EH Bit 9 For VRAM-B
VRxMD Process
0 Do not partition in 2 banks
1 Partition in 2 banks
Note: Enter A or B into bit name for x.
Rotation data bank select bit: Data bank select bit (RDBSA01, RDBSA00, RDBSA11,
RDBSA10, RDBSB01, RDBSB00, RDBSB11, RDBSB10)
Designates the use objective of the VRAM of the rotation scroll screen. This bit is
only in effect when the rotation scroll screen is displayed.
15 14 13 12 11 10 9 8
CYCA0L VCP0A03 VCP0A02 VCP0A01 VCP0A00 VCP1A03 VCP1A02 VCP1A01 VCP1A00
180010H 7 6 5 4 3 2 1 0
VCP2A03 VCP2A02 VCP2A01 VCP2A00 VCP3A03 VCP3A02 VCP3A01 VCP3A00
15 14 13 12 11 10 9 8
CYCA0U VCP4A03 VCP4A02 VCP4A01 VCP4A00 VCP5A03 VCP5A02 VCP5A01 VCP5A00
180012H 7 6 5 4 3 2 1 0
VCP6A03 VCP6A02 VCP6A01 VCP6A00 VCP7A03 VCP7A02 VCP7A01 VCP7A00
VRAM cycle pattern (for VRAM-A0) bit: VRAM cycle pattern bit (VCP0A00 to
VCP0A03, VCP1A00 to VCP1A03, VCP2A00 to VCP2A03, VCP3A00 to VCP3A03,
VCP4A00 to VCP4A03, VCP5A00 to VCP5A03, VCP6A00 to VCP6A03, VCP7A00 to
VCP7A03)
334
Sets the access command of VRAM access that performs in VRAM-A0 (or VRAM-
A) timing T0 to T7.
15 14 13 12 11 10 9 8
CYCA1L VCP0A13 VCP0A12 VCP0A11 VCP0A10 VCP1A13 VCP1A12 VCP1A11 VCP1A10
180014H 7 6 5 4 3 2 1 0
VCP2A13 VCP2A12 VCP2A11 VCP2A10 VCP3A13 VCP3A12 VCP3A11 VCP3A10
15 14 13 12 11 10 9 8
CYCA1U VCP4A13 VCP4A12 VCP4A11 VCP4A10 VCP5A13 VCP5A12 VCP5A11 VCP5A10
180016H 7 6 5 4 3 2 1 0
VCP6A13 VCP6A12 VCP6A11 VCP6A10 VCP7A13 VCP7A12 VCP7A11 VCP7A10
VRAM cycle pattern (for VRAM-A1) bit: VRAM cycle pattern bit (VCP0A10 to
VCP0A13, VCP1A10 to VCP1A13, VCP2A10 to VCP2A13, VCP3A10 to VCP3A13,
VCP4A10 to VCP4A13, VCP5A10 to VCP5A13, VCP6A10 to VCP6A13, VCP7A10 to
VCP7A13)
Sets the access command of the VRAM access that performs in VRAM-A1 timing T0
to T7.
ST-58-R2 335
• VRAM Cycle Pattern (Bank B0)
15 14 13 12 11 10 9 8
CYCB0L VCP0B03 VCP0B02 VCP0B01 VCP0B00 VCP1B03 VCP1B02 VCP1B01 VCP1B00
180018H 7 6 5 4 3 2 1 0
VCP2B03 VCP2B02 VCP2B01 VCP2B00 VCP3B03 VCP3B02 VCP3B01 VCP3B00
15 14 13 12 11 10 9 8
CYCB0U VCP4B03 VCP4B02 VCP4B01 VCP4B00 VCP5B03 VCP5B02 VCP5B01 VCP5B00
18001AH 7 6 5 4 3 2 1 0
VCP6B03 VCP6B02 VCP6B01 VCP6B00 VCP7B03 VCP7B02 VCP7B01 VCP7B00
VRAM cycle pattern (for VRAM-B0) bit: VRAM cycle pattern bit
(VCP0B00 to VCP0B03, VCP1B00 to VCP1B03, VCP2B00 to VCP2B03, VCP3B00 to
VCP3B03, VCP4B00 to VCP4B03, VCP5B00 to VCP5B03, VCP6B00 to VCP6B03,
VCP7B00 to VCP7B03)
Sets the access command of VRAM access that performs in VRAM-B0 (or VRAM-B)
timing T0 to T7.
15 14 13 12 11 10 9 8
CYCB1L VCP0B13 VCP0B12 VCP0B11 VCP0B10 VCP1B13 VCP1B12 VCP1B11 VCP1B10
18001CH 7 6 5 4 3 2 1 0
VCP2B13 VCP2B12 VCP2B11 VCP2B10 VCP3B13 VCP3B12 VCP3B11 VCP3B10
15 14 13 12 11 10 9 8
CYCB1U VCP4B13 VCP4B12 VCP4B11 VCP4B10 VCP5B13 VCP5B12 VCP5B11 VCP5B10
18001EH 7 6 5 4 3 2 1 0
VCP6B13 VCP6B12 VCP6B11 VCP6B10 VCP7B13 VCP7B12 VCP7B11 VCP7B10
336
VRAM cycle pattern (for VRAM-B1) bit: VRAM cycle pattern bit
(VCP0B10 to VCP0B13, VCP1B10 to VCP1B13, VCP2B10 to VCP2B13, VCP3B10 to
VCP3B13, VCP4B10 to VCP4B13, VCP5B10 to VCP5B13, VCP6B10 to VCP6B13,
VCP7B10 to VCP7B13).
Sets the access command of VRAM access that performs in VRAM-B1 timing T0 to
T7.
ST-58-R2 337
• Screen Display Enable
15 14 13 12 11 10 9 8
BGON ~ ~ ~ R0TPON N3TPON N2TPON N1TPON N0TPON
180020H 7 6 5 4 3 2 1 0
~ ~ R1ON R0ON N3ON N2ON N1ON N0ON
xxTPON Process
0 Validates transparency code (transparency code dots become transparent)
1 Invalidates transparency code (transparency code dots are displayed according to data
values)
Note: N0, N1, N2, N3, or R0 is entered into bit name for xx.
Screen display enable bit: On bit (N0ON, N1ON, N2ON, N3ON, R0ON, R1ON)
Designates whether to display each scroll screen.
xxON Process
0 Cannot display (Does not execute VRAM access for display)
1 Can display
Note: N0, N1, N2, N3, R0, or R1 is entered into bit name xx.
• Mosaic Control
15 14 13 12 11 10 9 8
MZCTL MZSZV3 MZSZV2 MZSZV1 MZSZV0 MZSZH3 MZSZH2 MZSZH1 MZSZH0
180022H 7 6 5 4 3 2 1 0
~ ~ ~ R0MZE N3MZE N2MZE N1MZE N0MZE
338
Mosaic size bit (MZSZH3 to MZSZH0, MZSZV3 to MZSZV0)
Designates the horizontal and vertical mosaic size.
ST-58-R2 339
Mosaic enable bit (N0MZE, N1MZE, N2MZE, N3MZE, R0MZE)
Designates the screen performing mosaic process.
xxMZE Process
0 Does not execute mosaic process
1 Processes mosaic process
Note: N0, N1, N2, N3, or R0 is entered in bit name for xx.
15 14 13 12 11 10 9 8
SFSEL ~ ~ ~ ~ ~ ~ ~ ~
180024H 7 6 5 4 3 2 1 0
~ ~ ~ R0SFCS N3SFCS N2SFCS N1SFCS N0SFCS
xxSFCS Process
0 Enables special function code A
1 Enables special function code B
Note: N0, N1, N2, N3, or R0 is entered in bit name for xx.
340
• Special Function Code
15 14 13 12 11 10 9 8
SFCODE SFCDB7 SFCDB6 SFCDB5 SFCDB4 SFCDB3 SFCDB2 SFCDB1 SFCDB0
180026H 7 6 5 4 3 2 1 0
SFCDA7 SFCDA6 SFCDA5 SFCDA4 SFCDA3 SFCDA2 SFCDA1 SFCDA0
Settings Process
0 Does not use special functions
1 Uses special functions
15 14 13 12 11 10 9 8
CHCTLA ~ ~ N1CHCN1 N1CHCN0 N1BMSZ1 N1BMSZ0 N1BMEN N1CHSZ
180028H 7 6 5 4 3 2 1 0
~ N0CHCN2 N0CHCN1 N0CHCN0 N0BMSZ1 N0BMSZ0 N0BMEN N0CHSZ
15 14 13 12 11 10 9 8
CHCTLB ~ R0CHCN2 R0CHCN1 R0CHCN0 ~ R0BMSZ R0BMEN R0CHSZ
18002AH 7 6 5 4 3 2 1 0
~ ~ N3CHCN N3CHSZ ~ ~ N2CHCN N2CHSZ
ST-58-R2 341
Character color number bit (N0CHCN2 to N0CHCN0, N1CHCN1, N1CHCN0, N2CHCN,
N3CHCN, R0CHCN2 to R0CHCN0)
Designates the character color count of each screen and the bit map color count
when displaying by the bit map format.
342
R0CHCN2 R0CHCN1 R0CHCN0 TV Screen Mode Color
Exclusive Monitor
Normal Hi-Res Format
0 0 0 16 colors 16 colors Cannot Display Palette Format
0 0 1 256 colors 256 colors Cannot Display Palette Format
0 1 0 2048 colors 2048 colors Cannot Display Palette Format
0 1 1 32,786 colors 32,786 colors Cannot Display RGB Format
1 0 0 16,770,000 Setting not Cannot Display RGB Format
colors allowed
1 0 1 Setting not allowed (Please do not set.)
1 1 0 Setting not allowed (Please do not set.)
1 1 1 Setting not allowed (Please do not set.)
ST-58-R2 343
xxBMEN Screen Display Format
0 Cell Format
1 Bitmap Format
Note: N0, N1, or R0 is entered in bit name for xx.
15 14 13 12 11 10 9 8
BMPNA ~ ~ N1BMPR N1BMCC ~ N1BMP6 N1BMP5 N1BMP4
18002CH 7 6 5 4 3 2 1 0
~ ~ N0BMPR N0BMCC ~ N0BMP6 N0BMP5 N0BMP4
15 14 13 12 11 10 9 8
BMPNB ~ ~ ~ ~ ~ ~ ~ ~
18002EH 7 6 5 4 3 2 1 0
~ ~ R0BMPR R0BMCC ~ R0BMP6 R0BMP5 R0BMP4
Special priority bit (for bit map): Bit map special priority bit (N0BMPR, N1BMPR,
R0BMPR)
Designates the special priority bit when the scroll screen is displayed by the bit map
format.
344
Special color calculation bit (for bit map): Bit map special color calculation bit
(N0BMCC, N1BMCC, R0BMCC)
Designates the special color calculation bit when the scroll screen is displayed by the
bit map format.
Palette number bit (for bit map): Bit map palette number bit (N0BMP6 to N0BMP4,
N1BMP6 to N1BMP4, R0BMP6 to R0BMP4)
Designates the highest 3 bits of the palette number when the scroll screen is
displayed in the bit map format.
15 14 13 12 11 10 9 8
PNCN0 N0PNB N0CNSM ~ ~ ~ ~ N0SPR N0SCC
180030H 7 6 5 4 3 2 1 0
N0SPLT6 N0SPLT5 N0SPLT4 N0SCN4 N0SCN3 N0SCN2 N0SCN1 N0SCN0
15 14 13 12 11 10 9 8
PNCN1 N1PNB N1CNSM ~ ~ ~ ~ N1SPR N1SCC
180032H 7 6 5 4 3 2 1 0
N1SPLT6 N1SPLT5 N1SPLT4 N1SCN4 N1SCN3 N1SCN2 N1SCN1 N1SCN0
15 14 13 12 11 10 9 8
PNCN2 N2PNB N2CNSM ~ ~ ~ ~ N2SPR N2SCC
180034H 7 6 5 4 3 2 1 0
N2SPLT6 N2SPLT5 N2SPLT4 N2SCN4 N2SCN3 N2SCN2 N2SCN1 N2SCN0
15 14 13 12 11 10 9 8
PNCN3 N3PNB N3CNSM ~ ~ ~ ~ N3SPR N3SCC
180036H 7 6 5 4 3 2 1 0
N3SPLT6 N3SPLT5 N3SPLT4 N3SCN4 N3SCN3 N3SCN2 N3SCN1 N3SCN0
ST-58-R2 345
• Pattern Name Control (RBG0)
15 14 13 12 11 10 9 8
PNCR R0PNB R0CNSM ~ ~ ~ ~ R0SPR R0SCC
180038H 7 6 5 4 3 2 1 0
R0SPLT6 R0SPLT5 R0SPLT4 R0SCN4 R0SCN3 R0SCN2 R0SCN1 R0SCN0
Pattern name data size bit (N0PNB, N1PNB, N2PNB, N3PNB, R0PNB)
Designates the pattern name data size when displaying in the cell format.
346
Special priority bit (for pattern name supplement data): Supplement special priority bit
(N0SPR, N1SPR, N2SPR, N3SPR, R0SPR)
Designates the pattern name supplement data as the special priority bit when the
pattern name data size is 1-word.
Special color calculation bit (for pattern name supplement data): Supplementary
special color calculation bit (N0SCC, N1SCC, N2SCC, N3SCC, R0SCC)
The special color calculation bit is designated as pattern name supplement data
when the pattern name data size is 1-word.
ST-58-R2 347
Designates the character number bit as the pattern name supplement data when the
pattern name data size is 1-word. Five bits are added to the palette number bit of the
pattern name data for the supplementary palette number bit.
Plane Size
15 14 13 12 11 10 9 8
PLSZ RBOVR1 RBOVR0 RBPLSZ1 RBPLSZ0 RAOVR1 RAOVR0 RAPLSZ1 RAPLSZ0
18003AH 7 6 5 4 3 2 1 0
N3PLSZ1 N3PLSZ0 N2PLSZ1 N2PLSZ0 N1PLSZ1 N1PLSZ0 N0PLSZ1 N0PLSZ0
348
Screen-over process bit: Over bit (RAOVR1, RAOVR0, RBOVR1, RBOVR0)
Designates control (screen-over process) when the display coordinate value exceeds
the display area in the rotation scroll screen.
15 14 13 12 11 10 9 8
MPOFN ~ N3MP8 N3MP7 N3MP6 ~ N2MP8 N2MP7 N2MP6
18003CH 7 6 5 4 3 2 1 0
~ N1MP8 N1MP7 N1MP6 ~ N0MP8 N0MP7 N0MP6
15 14 13 12 11 10 9 8
MPOFR ~ ~ ~ ~ ~ ~ ~ ~
18003EH 7 6 5 4 3 2 1 0
~ RBMP8 RBMP7 RBMP6 ~ RAMP8 RAMP7 RAMP6
Map offset bit (N0MP8 to N0MP6, N1MP8 to N1MP6, N2MP8 to N2MP6, N3MP8 to
N3MP6, RAMP8 to RAMP6, RBMP8 to RBMP6)
When the scroll screen display format is the cell format, the map offset value of 3
bits is added to the highest 6 bits of the map register. This designates the bit map
pattern boundary when in the bit map format.
ST-58-R2 349
• Map (NBG0, Plane A, B)
15 14 13 12 11 10 9 8
MPABN0 ~ ~ N0MPB5 N0MPB4 N0MPB3 N0MPB2 N0MPB1 N0MPB0
180040H 7 6 5 4 3 2 1 0
~ ~ N0MPA5 N0MPA4 N0MPA3 N0MPA2 N0MPA1 N0MPA0
15 14 13 12 11 10 9 8
MPCDN0 ~ ~ N0MPD5 N0MPD4 N0MPD3 N0MPD2 N0MPD1 N0MPD0
180042H 7 6 5 4 3 2 1 0
~ ~ N0MPC5 N0MPC4 N0MPC3 N0MPC2 N0MPC1 N0MPC0
15 14 13 12 11 10 9 8
MPABN1 ~ ~ N1MPB5 N1MPB4 N1MPB3 N1MPB2 N1MPB1 N1MPB0
180044H 7 6 5 4 3 2 1 0
~ ~ N1MPA5 N1MPA4 N1MPA3 N1MPA2 N1MPA1 N1MPA0
15 14 13 12 11 10 9 8
MPCDN1 ~ ~ N1MPD5 N1MPD4 N1MPD3 N1MPD2 N1MPD1 N1MPD0
180046H 7 6 5 4 3 2 1 0
~ ~ N1MPC5 N1MPC4 N1MPC3 N1MPC2 N1MPC1 N1MPC0
15 14 13 12 11 10 9 8
MPABN2 ~ ~ N2MPB5 N2MPB4 N2MPB3 N2MPB2 N2MPB1 N2MPB0
180048H 7 6 5 4 3 2 1 0
~ ~ N2MPA5 N2MPA4 N2MPA3 N2MPA2 N2MPA1 N2MPA0
15 14 13 12 11 10 9 8
MPCDN2 ~ ~ N2MPD5 N2MPD4 N2MPD3 N2MPD2 N2MPD1 N2MPD0
18004AH 7 6 5 4 3 2 1 0
~ ~ N2MPC5 N2MPC4 N2MPC3 N2MPC2 N2MPC1 N2MPC0
15 14 13 12 11 10 9 8
MPABN3 ~ ~ N3MPB5 N3MPB4 N3MPB3 N3MPB2 N3MPB1 N3MPB0
18004CH 7 6 5 4 3 2 1 0
~ ~ N3MPA5 N3MPA4 N3MPA3 N3MPA2 N3MPA1 N3MPA0
350
• Map (NBG3, Plane C, D)
15 14 13 12 11 10 9 8
MPCDN3 ~ ~ N3MPD5 N3MPD4 N3MPD3 N3MPD2 N3MPD1 N3MPD0
18004EH 7 6 5 4 3 2 1 0
~ ~ N3MPC5 N3MPC4 N3MPC3 N3MPC2 N3MPC1 N3MPC0
ST-58-R2 351
• Map (Rotation Parameter A, Plane A, B)
15 14 13 12 11 10 9 8
MPBRAB ~ ~ RAMPB5 RAMPB4 RAMPB3 RAMPB2 RAMPB1 RAMPB0
180050H 7 6 5 4 3 2 1 0
~ ~ RAMPA5 RAMPA4 RAMPA3 RAMPA2 RAMPA1 RAMPA0
15 14 13 12 11 10 9 8
MPCDRA ~ ~ RAMPD5 RAMPD4 RAMPD3 RAMPD2 RAMPD1 RAMPD0
180052H 7 6 5 4 3 2 1 0
~ ~ RAMPC5 RAMPC4 RAMPC3 RAMPC2 RAMPC1 RAMPC0
15 14 13 12 11 10 9 8
MPEFRA ~ ~ RAMPF5 RAMPF4 RAMPF3 RAMPF2 RAMPF1 RAMPF0
180054H 7 6 5 4 3 2 1 0
~ ~ RAMPE5 RAMPE4 RAMPE3 RAMPE2 RAMPE1 RAMPE0
15 14 13 12 11 10 9 8
MPGHRA ~ ~ RAMPH5 RAMPH4 RAMPH3 RAMPH2 RAMPH1 RAMPH0
180056H 7 6 5 4 3 2 1 0
~ ~ RAMPG5 RAMPG4 RAMPG3 RAMPG2 RAMPG1 RAMPG0
15 14 13 12 11 10 9 8
MPIJRA ~ ~ RAMPJ5 RAMPJ4 RAMPJ3 RAMPJ2 RAMPJ1 RAMPJ0
180058H 7 6 5 4 3 2 1 0
~ ~ RAMPI5 RAMPI4 RAMPI3 RAMPI2 RAMPI1 RAMPI0
15 14 13 12 11 10 9 8
MPKLRA ~ ~ RAMPL5 RAMPL4 RAMPL3 RAMPL2 RAMPL1 RAMPL0
18005AH 7 6 5 4 3 2 1 0
~ ~ RAMPK5 RAMPK4 RAMPK3 RAMPK2 RAMPK1 RAMPK0
15 14 13 12 11 10 9 8
MPMNRA ~ ~ RAMPN5 RAMPN4 RAMPN3 RAMPN2 RAMPN1 RAMPN0
18005CH 7 6 5 4 3 2 1 0
~ ~ RAMPM5 RAMPM4 RAMPM3 RAMPM2 RAMPM1 RAMPM0
352
• Map (Rotation Parameter A, Plane O, P)
15 14 13 12 11 10 9 8
MPOPRA ~ ~ RAMPP5 RAMPP4 RAMPP3 RAMPP2 RAMPP1 RAMPP0
18005EH 7 6 5 4 3 2 1 0
~ ~ RAMPO5 RAMPO4 RAMPO3 RAMPO2 RAMPO1 RAMPO0
15 14 13 12 11 10 9 8
MPABRB ~ ~ RBMPB5 RBMPB4 RBMPB3 RBMPB2 RBMPB1 RBMPB0
180060H 7 6 5 4 3 2 1 0
~ ~ RBMPA5 RBMPA4 RBMPA3 RBMPA2 RBMPA1 RBMPA0
15 14 13 12 11 10 9 8
MPCDRB ~ ~ RBMPD5 RBMPD4 RBMPD3 RBMPD2 RBMPD1 RBMPD0
180062H 7 6 5 4 3 2 1 0
~ ~ RBMPC5 RBMPC4 RBMPC3 RBMPC2 RBMPC1 RBMPC0
15 14 13 12 11 10 9 8
MPEFRB ~ ~ RBMPF5 RBMPF4 RBMPF3 RBMPF2 RBMPF1 RBMPF0
180064H 7 6 5 4 3 2 1 0
~ ~ RBMPE5 RBMPE4 RBMPE3 RBMPE2 RBMPE1 RBMPE0
• Map (Rotation Parameter B, Plane G, H)
15 14 13 12 11 10 9 8
MPGHRB ~ ~ RBMPH5 RBMPH4 RBMPH3 RBMPH2 RBMPH1 RBMPH0
180066H 7 6 5 4 3 2 1 0
~ ~ RBMPG5 RBMPG4 RBMPG3 RBMPG2 RBMPG1 RBMPG0
15 14 13 12 11 10 9 8
MPIJRB ~ ~ RBMPJ5 RBMPJ4 RBMPJ3 RBMPJ2 RBMPJ1 RBMPJ0
180068H 7 6 5 4 3 2 1 0
~ ~ RBMPI5 RBMPI4 RBMPI3 RBMPI2 RBMPI1 RBMPI0
15 14 13 12 11 10 9 8
MPKLRB ~ ~ RBMPL5 RBMPL4 RBMPL3 RBMPL2 RBMPL1 RBMPL0
18006AH 7 6 5 4 3 2 1 0
~ ~ RBMPK5 RBMPK4 RBMPK3 RBMPK2 RBMPK1 RBMPK0
ST-58-R2 353
• Map (Rotation Parameter B, Plane M, N)
15 14 13 12 11 10 9 8
MPMNRB ~ ~ RBMPN5 RBMPN4 RBMPN3 RBMPN2 RBMPN1 RBMPN0
18006CH 7 6 5 4 3 2 1 0
~ ~ RBMPM5 RBMPM4 RBMPM3 RBMPM2 RBMPM1 RBMPM0
15 14 13 12 11 10 9 8
MPOPRB ~ ~ RBMPP5 RBMPP4 RBMPP3 RBMPP2 RBMPP1 RBMPP0
18006EH 7 6 5 4 3 2 1 0
~ ~ RBMPO5 RBMPO4 RBMPO3 RBMPO2 RBMPO1 RBMPO0
Map bit (for rotation scroll): Map bit (RAMPA5 to RAMPA0, RAMPB5 to RAMPB0,
RAMPC5 to RAMPC0, RAMPD5 to RAMPD0, RAMPE5 to RAMPE0,
RAMPF5 to RAMPF0, RAMPG5 to RAMPG0, RAMPH5 to RAMPH0,
RAMPI5 to RAMPI0, RAMPJ5 to RAMPJ0, RAMPK5 to RAMPK0,
RAMPL5 to RAMPL0, RAMPM5 to RAMPM0, RAMPN5 to RAMPN0,
RAMPO5 to RAMPO0, RAMPP5 to RAMPP0, RBMPA5 to RBMPA0,
RBMPB5 to RBMPB0, RBMPC5 to RBMPC0, RBMPD5 to RBMPD0,
RBMPE5 to RBMPE0, RBMPF5 to RBMPF0, RBMPG5 to RBMPG0,
RBMPH5 to RBMPH0, RAMPI5 to RBMPI0, RBMPJ5 to RBMPJ0,
RBMPK5 to RBMPK0, RBMPL5 to RBMPL0, RBMPM5 to RBMPM0,
RBMPN5 to RBMPN0, RBMPO5 to RBMPO0, RBMPP5 to RBMPP0)
Designates the lead address of the pattern name table being arranged in each plane
when a rotation scroll screen is displayed in the cell format.
354
RAMPA5~RAMPA0 180050H Bit 5~0 Rotation Parameter A for Screen Plane A
RAMPB5~RAMPB0 180050H Bit 13~8 Rotation Parameter A for Screen Plane B
RAMPC5~RAMPC0 180052H Bit 5~0 Rotation Parameter A for Screen Plane C
RAMPD5~RAMPD0 180052H Bit 13~8 Rotation Parameter A for Screen Plane D
RAMPE5~RAMPE0 180054H Bit 5~0 Rotation Parameter A for Screen Plane E
RAMPF5~RAMPF0 180054H Bit 13~8 Rotation Parameter A for Screen Plane F
RAMPG5~RAMPG0 180056H Bit 5~0 Rotation Parameter A for Screen Plane G
RAMPH5~RAMPH0 180056H Bit 13~8 Rotation Parameter A for Screen Plane H
RAMPI5~RAMPI0 180058H Bit 5~0 Rotation Parameter A for Screen Plane I
RAMPJ5~RAMPJ0 180058H Bit 13~8 Rotation Parameter A for Screen Plane J
RAMPK5~RAMPK0 18005AH Bit 5~0 Rotation Parameter A for Screen Plane K
RAMPL5~RAMPL0 18005AH Bit 13~8 Rotation Parameter A for Screen Plane L
RAMPM5~RAMPM0 18005CH Bit 5~0 Rotation Parameter A for Screen Plane M
RAMPN5~RAMPN0 18005CH Bit 13~8 Rotation Parameter A for Screen Plane N
RAMPO5~RAMPO0 18005EH Bit 5~0 Rotation Parameter A for Screen Plane O
RAMPP5~RAMPP0 18005EH Bit 13~8 Rotation Parameter A for Screen Plane P
RBMPA5~RBMPA0 180060H Bit 5~0 Rotation Parameter B for Screen Plane A
RBMPB5~RBMPB0 180060H Bit 13~8 Rotation Parameter B for Screen Plane B
RBMPC5~RBMPC0 180062H Bit 5~0 Rotation Parameter B for Screen Plane C
RBMPD5~RBMPD0 180062H Bit 13~8 Rotation Parameter B for Screen Plane D
RBMPE5~RBMPE0 180064H Bit 5~0 Rotation Parameter B for Screen Plane E
RBMPF5~RBMPF0 180064H Bit 13~8 Rotation Parameter B for Screen Plane F
RBMPG5~RBMPG0 180066H Bit 5~0 Rotation Parameter B for Screen Plane G
RBMPH5~RBMPH0 180066H Bit 13~8 Rotation Parameter B for Screen Plane H
RBMPI5~RBMPI0 180068H Bit 5~0 Rotation Parameter B for Screen Plane I
RBMPJ5~RBMPJ0 180068H Bit 13~8 Rotation Parameter B for Screen Plane J
RBMPK5~RBMPK0 18006AH Bit 5~0 Rotation Parameter B for Screen Plane K
RBMPL5~RBMPL0 18006AH Bit 13~8 Rotation Parameter B for Screen Plane L
RBMPM5~RBMPM0 18006CH Bit 5~0 Rotation Parameter B for Screen Plane M
RBMPN5~RBMPN0 18006CH Bit 13~8 Rotation Parameter B for Screen Plane N
RBMPO5~RBMPO0 18006EH Bit 5~0 Rotation Parameter B for Screen Plane O
RBMPP5~RBMPP0 18006EH Bit 13~8 Rotation Parameter B for Screen Plane P
ST-58-R2 355
• Screen Scroll Value (NBG0, Horizontal Integer Part)
15 14 13 12 11 10 9 8
SCXIN0 ~ ~ ~ ~ ~ N0SCXI10 N0SCXI9 N0SCXI8
180070H 7 6 5 4 3 2 1 0
N0SCXI7 N0SCXI6 N0SCXI5 N0SCXI4 N0SCXI3 N0SCXI2 N0SCXI1 N0SCXI0
15 14 13 12 11 10 9 8
SCXDN0 N0SCXD1 N0SCXD2 N0SCXD3 N0SCXD4 N0SCXD5 N0SCXD6 N0SCXD7 N0SCXD8
180072H 7 6 5 4 3 2 1 0
~ ~ ~ ~ ~ ~ ~ ~
15 14 13 12 11 10 9 8
SCYIN0 ~ ~ ~ ~ ~ N0SCYI10 N0SCYI9 N0SCYI8
180074H 7 6 5 4 3 2 1 0
N0SCYI7 N0SCYI6 N0SCYI5 N0SCYI4 N0SCYI3 N0SCYI2 N0SCYI1 N0SCYI0
15 14 13 12 11 10 9 8
SCYDN0 N0SCYD1 N0SCYD2 N0SCYD3 N0SCYD4 N0SCYD5 N0SCYD6 N0SCYD7 N0SCYD8
180076H 7 6 5 4 3 2 1 0
~ ~ ~ ~ ~ ~ ~ ~
15 14 13 12 11 10 9 8
ZMXIN0 ~ ~ ~ ~ ~ ~ ~ ~
180078H 7 6 5 4 3 2 1 0
~ ~ ~ ~ ~ N0ZMXI2 N0ZMXI1 N0ZMXI0
15 14 13 12 11 10 9 8
ZMXDN0 N0ZMXD1 N0ZMXD2 N0ZMXD3 N0ZMXD4 N0ZMXD5 N0ZMXD6 N0ZMXD7 N0ZMXD8
18007AH 7 6 5 4 3 2 1 0
~ ~ ~ ~ ~ ~ ~ ~
15 14 13 12 11 10 9 8
ZMYIN0 ~ ~ ~ ~ ~ ~ ~ ~
18007CH 7 6 5 4 3 2 1 0
~ ~ ~ ~ ~ N0ZMYI2 N0ZMYI1 N0ZMYI0
356
• Coordinate Increment (NBG0, Vertical Fractional Part)
15 14 13 12 11 10 9 8
ZMYDN0 N0ZMYD1 N0ZMYD2 N0ZMYD3 N0ZMYD4 N0ZMYD5 N0ZMYD6 N0ZMYD7 N0ZMYD8
18007EH 7 6 5 4 3 2 1 0
~ ~ ~ ~ ~ ~ ~ ~
15 14 13 12 11 10 9 8
SCXIN1 ~ ~ ~ ~ ~ N1SCXI10 N1SCXI9 N1SCXI8
180080H 7 6 5 4 3 2 1 0
N1SCXI7 N1SCXI6 N1SCXI5 N1SCXI4 N1SCXI3 N1SCXI2 N1SCXI1 N1SCXI0
15 14 13 12 11 10 9 8
SCXDN1 N1SCXD1 N1SCXD2 N1SCXD3 N1SCXD4 N1SCXD5 N1SCXD6 N1SCXD7 N1SCXD8
180082H 7 6 5 4 3 2 1 0
~ ~ ~ ~ ~ ~ ~ ~
15 14 13 12 11 10 9 8
SCYIN1 ~ ~ ~ ~ ~ N1SCYI10 N1SCYI9 N1SCYI8
180084H 7 6 5 4 3 2 1 0
N1SCYI7 N1SCYI6 N1SCYI5 N1SCYI4 N1SCYI3 N1SCYI2 N1SCYI1 N1SCYI0
15 14 13 12 11 10 9 8
SCYDN1 N1SCYD1 N1SCYD2 N1SCYD3 N1SCYD4 N1SCYD5 N1SCYD6 N1SCYD7 N1SCYD8
180086H 7 6 5 4 3 2 1 0
~ ~ ~ ~ ~ ~ ~ ~
15 14 13 12 11 10 9 8
ZMXIN1 ~ ~ ~ ~ ~ ~ ~ ~
180088H 7 6 5 4 3 2 1 0
~ ~ ~ ~ ~ N1ZMXI2 N1ZMXI1 N1ZMXI0
15 14 13 12 11 10 9 8
ZMXDN1 N1ZMXD1 N1ZMXD2 N1ZMXD3 N1ZMXD4 N1ZMXD5 N1ZMXD6 N1ZMXD7 N1ZMXD8
18008AH 7 6 5 4 3 2 1 0
~ ~ ~ ~ ~ ~ ~ ~
ST-58-R2 357
• Coordinate Increment (NBG1, Vertical Integer Part)
15 14 13 12 11 10 9 8
ZMYIN1 ~ ~ ~ ~ ~ ~ ~ ~
18008CH 7 6 5 4 3 2 1 0
~ ~ ~ ~ ~ N1ZMYI2 N1ZMYI1 N1ZMYI0
15 14 13 12 11 10 9 8
ZMYDN1 N1ZMYD1 N1ZMYD2 N1ZMYD3 N1ZMYD4 N1ZMYD5 N1ZMYD6 N1ZMYD7 N1ZMYD8
18008EH 7 6 5 4 3 2 1 0
~ ~ ~ ~ ~ ~ ~ ~
15 14 13 12 11 10 9 8
SCXN2 ~ ~ ~ ~ ~ N2SCX10 N2SCX9 N2SCX8
180090H 7 6 5 4 3 2 1 0
N2SCX7 N2SCX6 N2SCX5 N2SCX4 N2SCX3 N2SCX2 N2SCX1 N2SCX0
15 14 13 12 11 10 9 8
SCYN2 ~ ~ ~ ~ ~ N2SCY10 N2SCY9 N2SCY8
180092H 7 6 5 4 3 2 1 0
N2SCY7 N2SCY6 N2SCY5 N2SCY4 N2SCY3 N2SCY2 N2SCY1 N2SCY0
15 14 13 12 11 10 9 8
SCXN3 ~ ~ ~ ~ ~ N3SCX10 N3SCX9 N3SCX8
180094H 7 6 5 4 3 2 1 0
N3SCX7 N3SCX6 N3SCX5 N3SCX4 N3SCX3 N3SCX2 N3SCX1 N3SCX0
15 14 13 12 11 10 9 8
SCYN3 ~ ~ ~ ~ ~ N3SCY10 N3SCY9 N3SCY8
180096H 7 6 5 4 3 2 1 0
N3SCY7 N3SCY6 N3SCY5 N3SCY4 N3SCY3 N3SCY2 N3SCY1 N3SCY0
358
N0SCXI10~N0SCXI0 180070H Bit 10~0 For NBG0 horizontal direction (integer part)
N0SCXD1~N0SCXD8 180072H Bit 15~8 For NBG0 horizontal direction (fractional part)
N0SCYI10~N0SCYI0 180074H Bit 10~0 For NBG0 vertical direction (integer part)
N0SCYD1~N0SCYD8 180076H Bit 15~8 For NBG0 vertical direction (fractional part)
N1SCXI10~N1SCXI0 180080H Bit 10~0 For NBG1 horizontal direction (integer part)
N1SCXD1~N1SCXD8 180082H Bit 15~8 For NBG1 horizontal direction (fractional part)
N1SCYI10~N1SCYI0 180084H Bit 10~0 For NBG1 vertical direction (integer part)
N1SCYD1~N1SCYD8 180086H Bit 15~8 For NBG1 vertical direction (fractional part)
N2SCX10~N2SCX0 180090H Bit 10~0 For NBG2 horizontal direction
N2SCY10~N2SCY0 180092H Bit 10~0 For NBG2 vertical direction
N3SCX10~N3SCX0 180094H Bit 10~0 For NBG3 horizontal direction
N3SCY10~N3SCY0 180096H Bit 10~0 For NBG3 vertical direction
N0ZMXI2~N0ZMXI0 180078H Bit 2~0 For NBG0 horizontal direction (integer part)
N0ZMXD1~N0ZMXD8 18007AH Bit 15~8 For NBG0 horizontal direction (fractional part)
N0ZMYI2~N0ZMYI0 18007CH Bit 2~0 For NBG0 vertical direction (integer part)
N0ZMYD1~N0ZMYD8 18007EH Bit 15~8 For NBG0 vertical direction (fractional part)
N1ZMXI2~N1ZMXI0 180088H Bit 2~0 For NBG1 horizontal direction (integer part)
N1ZMXD1~N1ZMXD8 18008AH Bit 15~8 For NBG1 horizontal direction (fractional part)
N1ZMYI2~N1ZMYI0 18008CH Bit 2~0 For NBG1 vertical direction (integer part)
N1ZMYD1~N1ZMYD8 18008EH Bit 15~8 For NBG1 vertical direction (fractional part)
• Reduction Enable
15 14 13 12 11 10 9 8
ZMCTL ~ ~ ~ ~ ~ ~ N1ZMQT N1ZMHF
180098H 7 6 5 4 3 2 1 0
~ ~ ~ ~ ~ ~ N0ZMQT N0ZMHF
Reduction enable bit: Zoom quarter/half bit (N1ZMQT, N1ZMHF, N0ZMQT, N0ZMHF)
Designates the maximum reducible range of each Normal scroll screen in the
horizontal direction.
ST-58-R2 359
N0ZMHF 180098H Bit 0 For NBG0
N0ZMQT 180098H Bit 1 For NBG0
N1ZMHF 180098H Bit 8 For NBG1
N1ZMQT 180098H Bit 9 For NBG1
15 14 13 12 11 10 9 8
SCRCTL ~ ~ N1LSS1 N1LSS0 N1LZMX N1LSCY N1LSCX N1VCSC
18009AH 7 6 5 4 3 2 1 0
~ ~ N0LSS1 N0LSS0 N0LZMX N0LSCY N0LSCX N0VCSC
Line Scroll Interval Bit: Line scroll select bit (N0LSS1, N0LSS0, N1LSS1, N1LSS0)
Designates the interval that reads line scroll table data from the table. The interval
changes depending on the interlace of the TV screen.
Line zoom enable bit: Line zoom X enable bit (N1LZMX, N0LZMX)
Designates whether expansion-reduction is done horizontally in line units.
360
NxLZMX Process
0 Does not scale horizontally per line units
1 Scales horizontally per line units
Note: 0 or 1 is entered in bit name for x.
Line scroll enable bit (for the vertical screen scroll value): Line scroll Y enable bit
(N1LSCY, N0LSCY)
Designates whether scroll is performed by vertical line units.
NxLSCY Process
0 Does not scroll vertically per line units
1 Scrolls vertically per line units
Note: 0 or 1 is entered in bit name for x.
Line scroll enable bit (for the horizontal screen scroll value): Line scroll X enable bit
(N1LSCX, N0LSCX)
Designates whether scroll is performed by horizontal line units.
NxLSCX Process
0 Does not scroll horizontally per line units
1 Scrolls horizontally per line units
Note: 0 or 1 is entered in bit name for x.
NxVCSC Process
0 Does not cell-scroll vertically
1 Cell-scrolls vertically
Note: 0 or 1 is entered in bit name for x.
ST-58-R2 361
• Vertical Cell Scroll Table Address (NBG0, NBG1)
15 14 13 12 11 10 9 8
VCSTAU ~ ~ ~ ~ ~ ~ ~ ~
18009CH 7 6 5 4 3 2 1 0
~ ~ ~ ~ ~ VCSTA18 VCSTA17 VCSTA16
15 14 13 12 11 10 9 8
VCSTAL VCSTA15 VCSTA14 VCSTA13 VCSTA12 VCSTA11 VCSTA10 VCSTA9 VCSTA8
18009EH 7 6 5 4 3 2 1 0
VCSTA7 VCSTA6 VCSTA5 VCSTA4 VCSTA3 VCSTA2 VCSTA1 ~
15 14 13 12 11 10 9 8
LSTA0U ~ ~ ~ ~ ~ ~ ~ ~
1800A0H 7 6 5 4 3 2 1 0
~ ~ ~ ~ ~ N0LSTA18 N0LSTA17 N0LSTA16
15 14 13 12 11 10 9 8
LSTA0L N0LSTA15 N0LSTA14 N0LSTA13 N0LSTA12 N0LSTA11 N0LSTA10 N0LSTA9 N0LSTA8
1800A2H 7 6 5 4 3 2 1 0
N0LSTA7 N0LSTA6 N0LSTA5 N0LSTA4 N0LSTA3 N0LSTA2 N0LSTA1 ~
15 14 13 12 11 10 9 8
LSTA1U ~ ~ ~ ~ ~ ~ ~ ~
1800A4H 7 6 5 4 3 2 1 0
~ ~ ~ ~ ~ N1LSTA18 N1LSTA17 N1LSTA16
15 14 13 12 11 10 9 8
LSTA1L N1LSTA15 N1LSTA14 N1LSTA13 N1LSTA12 N1LSTA11 N1LSTA10 N1LSTA9 N1LSTA8
1800A6H 7 6 5 4 3 2 1 0
N1LSTA7 N1LSTA6 N1LSTA5 N1LSTA4 N1LSTA3 N1LSTA2 N1LSTA1 ~
362
Line scroll table address bit (N0LSTA18 to N0LSTA16, N0LSTA15 to N0LSTA1,
N1LSTA18 to N1LSTA16, N1LSTA15 to N1LSTA1)
Designates the lead address of the line scroll table on the VRAM.
15 14 13 12 11 10 9 8
LCTAU LCCLMD ~ ~ ~ ~ ~ ~ ~
1800A8H 7 6 5 4 3 2 1 0
~ ~ ~ ~ ~ LCTA18 LCTA17 LCTA16
15 14 13 12 11 10 9 8
LCTAL LCTA15 LCTA14 LCTA13 LCTA12 LCTA11 LCTA10 LCTA9 LCTA8
1800AAH 7 6 5 4 3 2 1 0
LCTA7 LCTA6 LCTA5 LCTA4 LCTA3 LCTA2 LCTA1 LCTA0
Line color screen mode bit: LNCL color mode bit (LCCLMD), bit 15
Designates the color mode of the line color screen.
Line color screen table address bit: LNCL table address bit (LCTA18 to LCTA0)
Designates the lead address of the line color screen table on the VRAM.
15 14 13 12 11 10 9 8
BKTAU BKCLMD ~ ~ ~ ~ ~ ~ ~
1800ACH 7 6 5 4 3 2 1 0
~ ~ ~ ~ ~ BKTA18 BKTA17 BKTA16
ST-58-R2 363
• Back Screen Table Address
15 14 13 12 11 10 9 8
BKTAL BKTA15 BKTA14 BKTA13 BKTA12 BKTA11 BKTA10 BKTA9 BKTA8
1800AEH 7 6 5 4 3 2 1 0
BKTA7 BKTA6 BKTA5 BKTA4 BKTA3 BKTA2 BKTA1 BKTA0
Back screen color mode bit: BACK color mode bit (BKCLMD), bit 15
Designates color mode of the back screen.
Back screen table address bit: BACK color table address bit (BKTA18 to BKTA0)
Designates the lead address of the back screen table on the VRAM.
15 14 13 12 11 10 9 8
RPMD ~ ~ ~ ~ ~ ~ ~ ~
1800B0H 7 6 5 4 3 2 1 0
~ ~ ~ ~ ~ ~ RPMD1 RPMD0
15 14 13 12 11 10 9 8
RPRCTL ~ ~ ~ ~ ~ RBKASTRE RBYSTRE RBXSTRE
1800B2H 7 6 5 4 3 2 1 0
~ ~ ~ ~ ~ RAKASTRE RAYSTRE RAXSTRE
364
Parameter read enable bit (RAXSTRE, RBXSTRE, RAYSTRE, RBYSTRE, RAKASTRE,
RBKASTRE)
Designates the coefficient table start address KAst and TV screen start coordinates Xst
and Yst and whether to read from the rotation parameter table in that line.
RxSTRE Process
0 Selected parameters are not read for that line
1 Selected parameters are read for that line
Note: AX, BX, AY, BY, AKA, or BKA is entered in bit name for x.
15 14 13 12 11 10 9 8
KTCTL ~ ~ ~ RBKLCE RBKMD1 RBKMD0 RBKDBS RBKTE
1800B4H 7 6 5 4 3 2 1 0
~ ~ ~ RAKLCE RAKMD1 RAKMD0 RAKDBS RAKTE
RxKLCE Process
0 Line color screen data within coefficient data is not used
1 Line color screen data within coefficient data is used
Note: A or B is entered in the bit name for x.
Coefficient data mode bit: Coefficient mode bit (RAKMD1, RAKMD0, RBKMD1,
RBKMD0)
Designates what parameters the coefficient data is used as.
ST-58-R2 365
RxKMD1 RxKMD0 Mode Coefficient Data Function
0 0 0 Use as scale coefficient kx, ky
0 1 1 Use as scale coefficient kx
1 0 2 Use as scale coefficient ky
1 1 3 Use as viewpoint Xp after rotation conversion
Note: A or B is entered in the bit name for x.
RxKTE Process
0 Do not use coefficient table
1 Use coefficient table
Note: A or B is entered in the bit name for x.
15 14 13 12 11 10 9 8
KTAOF ~ ~ ~ ~ ~ RBKTAOS2 RBKTAOS1 RBKTAOS0
1800B6H 7 6 5 4 3 2 1 0
~ ~ ~ ~ ~ RAKTAOS2 RAKTAOS1 RAKTAOS0
366
RAKTAOS2~RAKTAOS0 1800B6H Bit 2~0 For Rotation Parameter A
RBKTAOS2~RBKTAOS0 1800B6H Bit 10~8 For Rotation Parameter B
15 14 13 12 11 10 9 8
OVPNRA RAOPN15 RAOPN14 RAOPN13 RAOPN12 RAOPN11 RAOPN10 RAOPN9 RAOPN8
1800B8H 7 6 5 4 3 2 1 0
RAOPN7 RAOPN6 RAOPN5 RAOPN4 RAOPN3 RAOPN2 RAOPN1 RAOPN0
15 14 13 12 11 10 9 8
OVPNRB RBOPN15 RBOPN14 RBOPN13 RBOPN12 RBOPN11 RBOPN10 RBOPN9 RBOPN8
1800BAH 7 6 5 4 3 2 1 0
RBOPN7 RBOPN6 RBOPN5 RBOPN4 RBOPN3 RBOPN2 RBOPN1 RBOPN0
15 14 13 12 11 10 9 8
RPYAU ~ ~ ~ ~ ~ ~ ~ ~
1800BCH 7 6 5 4 3 2 1 0
~ ~ ~ ~ ~ RPTA18 RPTA17 RPTA16
15 14 13 12 11 10 9 8
RPTAL RPTA15 RPTA14 RPTA13 RPTA12 RPTA11 RPTA10 RPTA9 RPTA8
1800BEH 7 6 5 4 3 2 1 0
RPTA7 RPTA6 RPTA5 RPTA4 RPTA3 RPTA2 RPTA1 ~
ST-58-R2 367
• Window Position (W0, Horizontal Start Point)
15 14 13 12 11 10 9 8
WPSX0 ~ ~ ~ ~ ~ ~ W0SX9 W0SX8
1800C0H 7 6 5 4 3 2 1 0
W0SX7 W0SX6 W0SX5 W0SX4 W0SX3 W0SX2 W0SX1 W0SX0
15 14 13 12 11 10 9 8
WPSY0 ~ ~ ~ ~ ~ ~ ~ W0SY8
1800C2H 7 6 5 4 3 2 1 0
W0SY7 W0SY6 W0SY5 W0SY4 W0SY3 W0SY2 W0SY1 W0SY0
15 14 13 12 11 10 9 8
WPEX0 ~ ~ ~ ~ ~ ~ W0EX9 W0EX8
1800C4H 7 6 5 4 3 2 1 0
W0EX7 W0EX6 W0EX5 W0EX4 W0EX3 W0EX2 W0EX1 W0EX0
15 14 13 12 11 10 9 8
WPEY0 ~ ~ ~ ~ ~ ~ ~ W0EY8
1800C6H 7 6 5 4 3 2 1 0
W0EY7 W0EY6 W0EY5 W0EY4 W0EY3 W0EY2 W0EY1 W0EY0
15 14 13 12 11 10 9 8
WPSX1 ~ ~ ~ ~ ~ ~ W1SX9 W1SX8
1800C8H 7 6 5 4 3 2 1 0
W1SX7 W1SX6 W1SX5 W1SX4 W1SX3 W1SX2 W1SX1 W1SX0
15 14 13 12 11 10 9 8
WPSY1 ~ ~ ~ ~ ~ ~ ~ W1SY8
1800CAH 7 6 5 4 3 2 1 0
W1SY7 W1SY6 W1SY5 W1SY4 W1SY3 W1SY2 W1SY1 W1SY0
15 14 13 12 11 10 9 8
WPEX1 ~ ~ ~ ~ ~ ~ W1EX9 W1EX8
1800CCH 7 6 5 4 3 2 1 0
W1EX7 W1EX6 W1EX5 W1EX4 W1EX3 W1EX2 W1EX1 W1EX0
368
• Window Position (W1, Vertical End Point)
15 14 13 12 11 10 9 8
WPEY1 ~ ~ ~ ~ ~ ~ ~ W1EY8
1800CEH 7 6 5 4 3 2 1 0
W1EY7 W1EY6 W1EY5 W1EY4 W1EY3 W1EY2 W1EY1 W1EY0
Window position bit (for horizontal coordinates): Window start/end X bit (W0SX9 to
W0SX0, W0EX9 to W0EX0, W1SX9 to W1SX0, W1EX9 to W1EX0)
Designates the horizontal start and end coordinates. Designated coordinate value is
the coordinate value (H counter value) on the TV screen
Graphics WxxX9 WxxX8 WxxX7 WxxX6 WxxX5 WxxX4 WxxX3 WxxX2 WxxX1 WxxX0
Mode
Normal H8 H7 H6 H5 H4 H3 H2 H1 H0 Invalid
Hi-Res H9 H8 H7 H6 H5 H4 H3 H2 H1 H0
Exclusive Invalid H8 H7 H6 H5 H4 H3 H2 H1 H0
Normal
Exclusive Invalid H9 H8 H7 H6 H5 H4 H3 H2 H1
Hi-Res
Note: 0S, 0E, 1S, or 1E is entered in bit name for xx.
Window position bit (for vertical coordinates): Window start/end Y bit (W0SY8 to
W0SY0, W0EY8 to W0EY0, W1SY8 to W1SY0, W1EY8 to W1EY0)
Designates the vertical start and end coordinates. The designated coordinate value
is the coordinate value (V counter value) on the TV screen.
ST-58-R2 369
TV Screen WxxY8 WxxY7 WxxY6 WxxY5 WxxY4 WxxY3 WxxY2 WxxY1 WxxY0
(Interlace) Mode
Normal, Hi-Res V8 V7 V6 V5 V4 V3 V2 V1 V0
(Non-interlace,
Single-Density
Interlace)
Normal, Hi-Res V7 V6 V5 V4 V3 V2 V1 V0 Invalid
(Double-Density
Interlace)
Exclusive Monitor V8 V7 V6 V5 V4 V3 V2 V1 V0
Note: 0S, 0E, 1S or 1E is entered in bit name for xx.
15 14 13 12 11 10 9 8
WCTLA N1LOG ~ N1SWE N1SWA N1W1E N1W1A N1W0E N1W0A
1800D0H 7 6 5 4 3 2 1 0
N0LOG ~ N0SWE N0SWA N0W1E N0W1A N0W0E N0W0A
15 14 13 12 11 10 9 8
WCTLB N3LOG ~ N3SWE N3SWA N3W1E N3W1A N3W0E N3W0A
1800D2H 7 6 5 4 3 2 1 0
N2LOG ~ N2SWE N2SWA N2W1E N2W1A N2W0E N2W0A
15 14 13 12 11 10 9 8
WCTLC SPLOG ~ SPSWE SPSWA SPW1E SPW1A SPW0E SPW0A
1800D4H 7 6 5 4 3 2 1 0
R0LOG ~ R0SWE R0SWA R0W1E R0W1A R0W0E R0W0A
15 14 13 12 11 10 9 8
WCTLD CCLOG ~ CCSWE CCSWA CCW1E CCW1A CCW0E CCW0A
1800D6H 7 6 5 4 3 2 1 0
RPLOG ~ ~ ~ RPW1E RPW1A RPW0E RPW0A
Window logic bit: Logic bit (N0LOG, N1LOG, N2LOG, N3LOG, R0LOG, SPLOG,
RPLOG, CCLOG)
Designates the method of overlapping windows used in each screen.
370
N0LOG 1800D0H Bit 7 Transparent Process Window for NBG0 (or RBG1)
N1LOG 1800D0H Bit 15 Transparent Process Window for NBG1 (or EXBG)
N2LOG 1800D2H Bit 7 Transparent Process Window for NBG2
N3LOG 1800D2H Bit 15 Transparent Process Window for NBG3
R0LOG 1800D4H Bit 7 Transparent Process Window for RBG0
SPLOG 1800D4H Bit 15 Transparent Process Window for Sprite
RPLOG 1800D6H Bit 7 For Rotation Parameter Window
CCLOG 1800D6H Bit 15 For Color Calculation Window
Window enable bit (for W0): W0 enable bit (N0W0E, N1W0E, N2W0E, N3W0E, R0W0E,
SPW0E, RPW0E, CCW0E)
Designates whether to use the Normal window W0 in each screen.
N0W0E 1800D0H Bit 1 Transparent Process Window for NBG0 (or RBG1)
N1W0E 1800D0H Bit 9 Transparent Process Window for NBG1 (or EXBG)
N2W0E 1800D2H Bit 1 Transparent Process Window for NBG2
N3W0E 1800D2H Bit 9 Transparent Process Window for NBG3
R0W0E 1800D4H Bit 1 Transparent Process Window for RBG0
SPW0E 1800D4H Bit 9 Transparent Process Window for Sprite
RPW0E 1800D6H Bit 1 For Rotation Parameter Window
CCW0E 1800D6H Bit 9 For Color Calculation Window
xxW0E Process
0 Does not use W0 window
1 Uses W0 window
Note: N0, N1, N2, N3, R0, SP, RP, or CC is entered in bit name for xx.
Window enable bit (for W1): W1 enable bit (N0W1E, N1W1E, N2W1E, N3W1E, R0W1E,
SPW1E, RPW1E, CCW1E)
Designates whether to use the Normal window W1 in each screen.
ST-58-R2 371
N0W1E 1800D0H Bit 3 Transparent Process Window for NBG0 (or RBG1)
N1W1E 1800D0H Bit 11 Transparent Process Window for NBG1 (or EXBG)
N2W1E 1800D2H Bit 3 Transparent Process Window for NBG2
N3W1E 1800D2H Bit 11 Transparent Process Window for NBG3
R0W1E 1800D4H Bit 3 Transparent Process Window for RBG0
SPW1E 1800D4H Bit 11 Transparent Process Window for Sprite
RPW1E 1800D6H Bit 3 For Rotation Parameter Window
CCW1E 1800D6H Bit 11 For Color Calculation Window
xxW1E Process
0 Does not use W1 window
1 Uses W1 window
Note: N0, N1, N2, N3, R0, SP, RP, or CC is entered in bit name for xx.
Window enable bit (for SW): SW enable bit (N0SWE, N1SWE, N2SWE, N3SWE,
R0SWE, SPSWE, CCSWE)
Designates whether to use the sprite window SW in each screen.
N0SWE 1800D0H Bit 5 Transparent Process Window for NBG0 (or RBG1)
N1SWE 1800D0H Bit 13 Transparent Process Window for NBG1 (or EXBG)
N2SWE 1800D2H Bit 5 Transparent Process Window for NBG2
N3SWE 1800D2H Bit 13 Transparent Process Window for NBG3
R0SWE 1800D4H Bit 5 Transparent Process Window for RBG0
SPSWE 1800D4H Bit 13 Transparent Process Window for Sprite
CCSWE 1800D6H Bit 13 For Color Calculation Window
xxSWE Process
0 Does not use SW window
1 Uses SW window
Note: N0, N1, N2, N3, R0, SP, or CC is entered in bit name for xx.
Window area bit (for W0): W0 area bit (N0W0A, N1W0A, N2W0A, N3W0A, R0W0A,
SPW0A, RPW0A, CCW0A)
Designates which area is the valid area of the Normal window W0 used in each
screen.
372
N0W0A 1800D0H Bit 0 Transparent Process Window for NBG0 (or RBG1)
N1W0A 1800D0H Bit 8 Transparent Process Window for NBG1 (or EXBG)
N2W0A 1800D2H Bit 0 Transparent Process Window for NBG2
N3W0A 1800D2H Bit 8 Transparent Process Window for NBG3
R0W0A 1800D4H Bit 0 Transparent Process Window for RBG0
SPW0A 1800D4H Bit 8 Transparent Process Window for Sprite
RPW0A 1800D6H Bit 0 For Rotation Parameter Window
CCW0A 1800D6H Bit 8 For Color Calculation Window
xxW0A Process
0 Enables the inside of W0 window
1 Enables the outside of W0 window
Note: N0, N1, N2, N3, R0, SP, RP, or CC is entered in bit name for xx.
Window area bit (for W1): W1 area bit (N0W1A, N1W1A, N2W1A, N3W1A, R0W1A,
SPW1A, RPW1A, CCW1A)
Designates which area is the valid area of the Normal window W1 used in each
screen.
N0W1A 1800D0H Bit 2 Transparent Process Window for NBG0 (or RBG1)
N1W1A 1800D0H Bit 10 Transparent Process Window for NBG1 (or EXBG)
N2W1A 1800D2H Bit 2 Transparent Process Window for NBG2
N3W1A 1800D2H Bit 10 Transparent Process Window for NBG3
R0W1A 1800D4H Bit 2 Transparent Process Window for RBG0
SPW1A 1800D4H Bit 10 Transparent Process Window for Sprite
RPW1A 1800D6H Bit 2 For Rotation Parameter Window
CCW1A 1800D6H Bit 10 For Color Calculation Window
xxW1A Process
0 Enables the inside of W1 window
1 Enables the outside of W1 window
Note: N0, N1, N2, N3, R0, SP, RP, or CC is entered in bit name for xx.
Window area bit (for SW): SW area bit (N0SWA, N1SWA, N2SWA, N3SWA, R0SWA,
SPSWA, CCSWA)
Designates which area is the valid area of the sprite window SW used in each
screen.
ST-58-R2 373
N0SWA 1800D0H Bit 4 Transparent Process Window for NBG0 (or RBG1)
N1SWA 1800D0H Bit 12 Transparent Process Window for NBG1 (or EXBG)
N2SWA 1800D2H Bit 4 Transparent Process Window for NBG2
N3SWA 1800D2H Bit 12 Transparent Process Window for NBG3
R0SWA 1800D4H Bit 4 Transparent Process Window for RBG0
SPSWA 1800D4H Bit 12 Transparent Process Window for Sprite
CCSWA 1800D6H Bit 12 For Color Calculation Window
xxSWA Process
0 Enables the inside of SW window
1 Enables the outside of SW window
Note: N0, N1, N2, N3, R0, SP or CC is entered in bit name for xx.
15 14 13 12 11 10 9 8
LWTA0U W0LWE ~ ~ ~ ~ ~ ~ ~
1800D8H 7 6 5 4 3 2 1 0
~ ~ ~ ~ ~ W0LWTA18 W0LWTA17 W0LWTA16
15 14 13 12 11 10 9 8
LWTA0L W0LWTA15 W0LWTA14 W0LWTA13 W0LWTA12 W0LWTA11 W0LWTA10 W0LWTA9 W0LWTA8
1800DAH 7 6 5 4 3 2 1 0
W0LWTA7 W0LWTA6 W0LWTA5 W0LWTA4 W0LWTA3 W0LWTA2 W0LWTA1 ~
15 14 13 12 11 10 9 8
LWTA1U W1LWE ~ ~ ~ ~ ~ ~ ~
1800DCH 7 6 5 4 3 2 1 0
~ ~ ~ ~ ~ W1LWTA18 W1LWTA17 W1LWTA16
15 14 13 12 11 10 9 8
LWTA1L W1LWTA15 W1LWTA14 W1LWTA13 W1LWTA12 W1LWTA11 W1LWTA10 W1LWTA9 W1LWTA8
1800DEH 7 6 5 4 3 2 1 0
W1LWTA7 W1LWTA6 W1LWTA5 W1LWTA4 W1LWTA3 W1LWTA2 W1LWTA1 ~
374
WxLWE Process
0 Does not process Normal Window to Line Window
1 Processes Normal Window to Line Window
Note: 0 or 1 is entered in bit name for x.
• Sprite Control
15 14 13 12 11 10 9 8
SPCTL ~ ~ SPCCCS1 SPCCCS0 ~ SPCCN2 SPCCN1 SPCCN0
1800E0H 7 6 5 4 3 2 1 0
~ ~ SPCLMD SPWINEN SPTYPE3 SPTYPE2 SPTYPE1 SPTYPE0
ST-58-R2 375
SPCLMD Sprite Color Format Data
0 Sprite data is all in palette format
1 Sprite data is in palette format and RGB format
SPWINEN Process
0 Does not use sprite window
1 Uses sprite window
• Shadow Control
15 14 13 12 11 10 9 8
SDCTL ~ ~ ~ ~ ~ ~ ~ TPSDSL
1800E2H 7 6 5 4 3 2 1 0
~ ~ BKSDEN R0SDEN N3SDEN N2SDEN N1SDEN N0SDEN
376
N0SDEN 1800E2H Bit 0 For NBG0 (or RBG1)
N1SDEN 1800E2H Bit 1 For NBG1 (or EXBG)
N2SDEN 1800E2H Bit 2 For NBG2
N3SDEN 1800E2H Bit 3 For NBG3
R0SDEN 1800E2H Bit 4 For RBG0
BKSDEN 1800E2H Bit 5 For Back
xxSDEN Process
0 Does not use shadow function (shadow not added)
1 Uses shadow function (shadow added)
Note: N0, N1, N2, N3, R0, or BK is entered in bit name for xx.
TPSDSL Process
0 Disables transparent shadow sprite
1 Enables transparent shadow sprite
15 14 13 12 11 10 9 8
CRAOFA ~ N3CAOS2 N3CAOS1 N3CAOS0 ~ N2CAOS2 N2CAOS1 N2CAOS0
1800E4H 7 6 5 4 3 2 1 0
~ N1CAOS2 N1CAOS1 N1CAOS0 ~ N0CAOS2 N0CAOS1 N0CAOS0
15 14 13 12 11 10 9 8
CRAOFB ~ ~ ~ ~ ~ ~ ~ ~
1800E6H 7 6 5 4 3 2 1 0
~ SPCAOS2 SPCAOS1 SPCAOS0 ~ R0CAOS2 R0CAOS1 R0CAOS0
ST-58-R2 377
N0CAOS2~N0CAOS0 1800E4H Bit 2~0 For NBG0 (or RBG1)
N1CAOS2~N1CAOS0 1800E4H Bit 6~4 For NBG1 (or EXBG)
N2CAOS2~N2CAOS0 1800E4H Bit 10~8 For NBG2
N3CAOS2~N3CAOS0 1800E4H Bit 14~12 For NBG3
R0CAOS2~R0CAOS0 1800E6H Bit 2~0 For RBG0
SPCAOS2~SPCAOS0 1800E6H Bit 6~4 For Sprite
15 14 13 12 11 10 9 8
LNCLEN ~ ~ ~ ~ ~ ~ ~ ~
1800E8H 7 6 5 4 3 2 1 0
~ ~ SPLCEN R0LCEN N3LCEN N2LCEN N1LCEN N0LCEN
xxLCEN Process
0 Does not insert the line color screen when
corresponding screen is top image
1 Inserts the line color screen when corresponding
screen is top image
Note: N0, N1, N2, N3, R0, or SP is entered in the bit name for xx.
15 14 13 12 11 10 9 8
SFPRMD ~ ~ ~ ~ ~ ~ R0SPRM1 R0SPRM0
1800EAH 7 6 5 4 3 2 1 0
N3SPRM1 N3SPRM0 N2SPRM1 N2SPRM0 N1SPRM1 N1SPRM0 N0SPRM1 N0SPRM0
378
N0SPRM1, N0SPRM0 1800EAH Bit 1,0 For NBG0 (or RBG1)
N1SPRM1, N1SPRM0 1800EAH Bit 3,2 For NBG1 (or EXBG)
N2SPRM1, N2SPRM0 1800EAH Bit 5,4 For NBG2
N3SPRM1, N3SPRM0 1800EAH Bit 7,6 For NBG3
R0SPRM1, R0SPRM0 1800EAH Bit 9,8 For RBG0
15 14 13 12 11 10 9 8
CCCTL BOKEN BOKN2 BOKN1 BOKN0 ~ EXCCEN CCRTMD CCMD
1800ECH 7 6 5 4 3 2 1 0
~ SPCCEN LCCCEN R0CCEN N3CCEN N2CCEN N1CCEN N0CCEN
BOKEN Process
0 Do not use gradation calculation function
1 Use gradation calculation function
Gradation screen number bit: Gradation number bit (BOKN2 to BOKN0), bits 14 to 12
Designates the screen using the gradation (shading) calculation function
ST-58-R2 379
Extended color calculation enable bit (EXCCEN), bit 10
Designates whether to use the extended color calculation function
EXCCEN Process
0 Do not use extended color calculation
1 Use extended color calculation
xxCCEN Process
0 Does not color-calculate
1 Color-calculates
Note : N0, N1, N2, N3, R0, LC, or SP is entered in bit name for xx.
380
• Special Color Calculation Mode
15 14 13 12 11 10 9 8
SFCCMD ~ ~ ~ ~ ~ ~ R0SCCM1 R0SCCM0
1800EEH 7 6 5 4 3 2 1 0
N3SCCM1 N3SCCM0 N2SCCM1 N2SCCM0 N1SCCM1 N1SCCM0 N0SCCM1 N0SCCM0
15 14 13 12 11 10 9 8
PRISA ~ ~ ~ ~ ~ S1PRIN2 S1PRIN1 S1PRIN0
1800F0H 7 6 5 4 3 2 1 0
~ ~ ~ ~ ~ S0PRIN2 S0PRIN1 S0PRIN0
15 14 13 12 11 10 9 8
PRISB ~ ~ ~ ~ ~ S3PRIN2 S3PRIN1 S3PRIN0
1800F2H 7 6 5 4 3 2 1 0
~ ~ ~ ~ ~ S2PRIN2 S2PRIN1 S2PRIN0
15 14 13 12 11 10 9 8
PRISC ~ ~ ~ ~ ~ S5PRIN2 S5PRIN1 S5PRIN0
1800F4H 7 6 5 4 3 2 1 0
~ ~ ~ ~ ~ S4PRIN2 S4PRIN1 S4PRIN0
ST-58-R2 381
• Priority Number (Sprite 6, 7)
15 14 13 12 11 10 9 8
PRISD ~ ~ ~ ~ ~ S7PRIN2 S7PRIN1 S7PRIN0
1800F6H 7 6 5 4 3 2 1 0
~ ~ ~ ~ ~ S6PRIN2 S6PRIN1 S6PRIN0
Sprite priority number bit (for sprite) (S0PRIN2 to S0PRIN0, S1PRIN2 to S1PRIN0,
S2PRIN2 to S2PRIN0, S3PRIN2 to S3PRIN0, S4PRIN2 to S4PRIN0, S5PRIN2 to
S5PRIN0, S6PRIN2 to S6PRIN0, S7PRIN2 to S7PRIN0)
Designates the sprite priority number.
15 14 13 12 11 10 9 8
PRINA ~ ~ ~ ~ ~ N1PRIN2 N1PRIN1 N1PRIN0
1800F8H 7 6 5 4 3 2 1 0
~ ~ ~ ~ ~ N0PRIN2 N0PRIN1 N0PRIN0
15 14 13 12 11 10 9 8
PRINB ~ ~ ~ ~ ~ N3PRIN2 N3PRIN1 N3PRIN0
1800FAH 7 6 5 4 3 2 1 0
~ ~ ~ ~ ~ N2PRIN2 N2PRIN1 N2PRIN0
15 14 13 12 11 10 9 8
PRIR ~ ~ ~ ~ ~ ~ ~ ~
1800FCH 7 6 5 4 3 2 1 0
~ ~ ~ ~ ~ R0PRIN2 R0PRIN1 R0PRIN0
Priority number bit (for scroll screen) (N0PRIN2 to N0PRIN0, N1PRIN2 to N1PRIN0,
N2PRIN2 to N2PRIN0, N3PRIN2 to N3PRIN0, R0PRIN2 to R0PRIN0)
Designates the priority number of each screen scroll.
382
N0PRIN2~N0PRIN0 1800F8H Bit 2~0 For NBG0 (or RBG1)
N1PRIN2~N1PRIN0 1800F8H Bit 10~8 For NBG1 (or EXBG)
N2PRIN2~N2PRIN0 1800FAH Bit 2~0 For NBG2
N3PRIN2~N3PRIN0 1800FAH Bit 10~8 For NBG3
R0PRIN2~R0PRIN0 1800FCH Bit 2~0 For RBG0
• Reserve
15 14 13 12 11 10 9 8
1800FEH ~ ~ ~ ~ ~ ~ ~ ~
7 6 5 4 3 2 1 0
~ ~ ~ ~ ~ ~ ~ ~
15 14 13 12 11 10 9 8
CCRSA ~ ~ ~ S1CCRT4 S1CCRT3 S1CCRT2 S1CCRT1 S1CCRT0
180100H 7 6 5 4 3 2 1 0
~ ~ ~ S0CCRT4 S0CCRT3 S0CCRT2 S0CCRT1 S0CCRT0
15 14 13 12 11 10 9 8
CCRSB ~ ~ ~ S3CCRT4 S3CCRT3 S3CCRT2 S3CCRT1 S3CCRT0
180102H 7 6 5 4 3 2 1 0
~ ~ ~ S2CCRT4 S2CCRT3 S2CCRT2 S2CCRT1 S2CCRT0
15 14 13 12 11 10 9 8
CCRSC ~ ~ ~ S5CCRT4 S5CCRT3 S5CCRT2 S5CCRT1 S5CCRT0
180104H 7 6 5 4 3 2 1 0
~ ~ ~ S4CCRT4 S4CCRT3 S4CCRT2 S4CCRT1 S4CCRT0
15 14 13 12 11 10 9 8
CCRSD ~ ~ ~ S7CCRT4 S7CCRT3 S7CCRT2 S7CCRT1 S7CCRT0
180106H 7 6 5 4 3 2 1 0
~ ~ ~ S6CCRT4 S6CCRT3 S6CCRT2 S6CCRT1 S6CCRT0
ST-58-R2 383
S0CCRT4~S0CCRT0 180100H Bit 4~0 For Sprite Register 0
S1CCRT4~S1CCRT0 180100H Bit 12~8 For Sprite Register 1
S2CCRT4~S2CCRT0 180102H Bit 4~0 For Sprite Register 2
S3CCRT4~S3CCRT0 180102H Bit 12~8 For Sprite Register 3
S4CCRT4~S4CCRT0 180104H Bit 4~0 For Sprite Register 4
S5CCRT4~S5CCRT0 180104H Bit 12~8 For Sprite Register 5
S6CCRT4~S6CCRT0 180106H Bit 4~0 For Sprite Register 6
S7CCRT4~S7CCRT0 180106H Bit 12~8 For Sprite Register 7
15 14 13 12 11 10 9 8
CCRNA ~ ~ ~ N1CCRT4 N1CCRT3 N1CCRT2 N1CCRT1 N1CCRT0
180108H 7 6 5 4 3 2 1 0
~ ~ ~ N0CCRT4 N0CCRT3 N0CCRT2 N0CCRT1 N0CCRT0
15 14 13 12 11 10 9 8
CCRNB ~ ~ ~ N3CCRT4 N3CCRT3 N3CCRT2 N3CCRT1 N3CCRT0
18010AH 7 6 5 4 3 2 1 0
~ ~ ~ N2CCRT4 N2CCRT3 N2CCRT2 N2CCRT1 N2CCRT0
15 14 13 12 11 10 9 8
CCRR ~ ~ ~ ~ ~ ~ ~ ~
18010CH 7 6 5 4 3 2 1 0
~ ~ ~ R0CCRT4 R0CCRT3 R0CCRT2 R0CCRT1 R0CCRT0
15 14 13 12 11 10 9 8
CCRLB ~ ~ ~ BKCCRT4 BKCCRT3 BKCCRT2 BKCCRT1 BKCCRT0
18010EH 7 6 5 4 3 2 1 0
~ ~ ~ LCCCRT4 LCCCRT3 LCCCRT2 LCCCRT1 LCCCRT0
Color calculation ratio bit (for scroll screens): (N0CCRT4 to N0CCRT0, N1CCRT4 to
N1CCRT0, N2CCRT4 to N2CCRT0, N3CCRT4 to N3CCRT0, R0CCRT4 to R0CCRT0,
LCCCRT4 to LCCCRT0, BKCCRT4 to BKCCRT0)
Designates the color calculation ratio of each scroll screen. The color calculation
ratio corresponds to a value 1/32 times R,G,B color data.
384
N0CCRT4~NOCCRT0 180108H Bit 4~0 For NBG0 (or RBG1)
N1CCRT4~N1CCRT0 180108H Bit 12~8 For NBG1 (or EXBG)
N2CCRT4~N2CCRT0 18010AH Bit 4~0 For NBG2
N3CCRT4~N3CCRT0 18010AH Bit 12~8 For NBG3
R0CCRT4~R0CCRT0 18010CH Bit 4~0 For RBG0
LCCCRT4~LCCCRT0 18010EH Bit 4~0 For LNCL
BKCCRT4~BKCCRT0 18010EH Bit 12~8 For Back
Note: N0, N1, N2, N3, R0, LC, or BK is entered in bit name for xx.
ST-58-R2 385
• Color Offset Enable
15 14 13 12 11 10 9 8
CLOFEN ~ ~ ~ ~ ~ ~ ~ ~
180110H 7 6 5 4 3 2 1 0
~ SPCOEN BKCOEN R0COEN N3COEN N2COEN N1COEN N0COEN
xxCOEN Process
0 Do not use color offset function
1 Use color offset function
Note: N0, N1, N2, N3, R0, BK, or SP is entered in bit name for xx.
15 14 13 12 11 10 9 8
CLOFSL ~ ~ ~ ~ ~ ~ ~ ~
180112H 7 6 5 4 3 2 1 0
~ SPCOSL BKCOSL R0COSL N3COSL N2COSL N1COSL N0COSL
386
N0COSL 180112H Bit 0 For NBG0 (or RBG1)
N1COSL 180112H Bit 1 For NBG1 (or EXBG)
N2COSL 180112H Bit 2 For NBG2
N3COSL 180112H Bit 3 For NBG3
R0COSL 180112H Bit 4 For RBG0
BKCOSL 180112H Bit 5 For Back
SPCOSL 180112H Bit 6 For Sprite
xxCOSL Process
0 Use color offset A value
1 Use color offset B value
Note: N0, N1, N2, N3, R0, BK, or SP is entered in bit name for xx.
15 14 13 12 11 10 9 8
COAR ~ ~ ~ ~ ~ ~ ~ COARD8
180114H 7 6 5 4 3 2 1 0
COARD7 COARD6 COARD5 COARD4 COARD3 COARD2 COARD1 COARD0
15 14 13 12 11 10 9 8
COAG ~ ~ ~ ~ ~ ~ ~ COAGR8
180116H 7 6 5 4 3 2 1 0
COAGR7 COAGR6 COAGR5 COAGR4 COAGR3 COAGR2 COAGR1 COAGR0
15 14 13 12 11 10 9 8
COAB ~ ~ ~ ~ ~ ~ ~ COABL8
180118H 7 6 5 4 3 2 1 0
COABL7 COABL6 COABL5 COABL4 COABL3 COABL2 COABL1 COABL0
15 14 13 12 11 10 9 8
COBR ~ ~ ~ ~ ~ ~ ~ COBRD8
18011AH 7 6 5 4 3 2 1 0
COBRD7 COBRD6 COBRD5 COBRD4 COBRD3 COBRD2 COBRD1 COBRD0
15 14 13 12 11 10 9 8
COBG ~ ~ ~ ~ ~ ~ ~ COBGR8
18011CH 7 6 5 4 3 2 1 0
COBGR7 COBGR6 COBGR5 COBGR4 COBGR3 COBGR2 COBGR1 COBGR0
ST-58-R2 387
• Color Offset B (BLUE)
15 14 13 12 11 10 9 8
COBB ~ ~ ~ ~ ~ ~ ~ COBBL8
18011EH 7 6 5 4 3 2 1 0
COBBL7 COBBL6 COBBL5 COBBL4 COBBL3 COBBL2 COBBL1 COBBL0
Color offset value bit: Color offset data bit (COARD8 to COARD0, COAGR8 to
COAGR0, COABL8 to COABL0, COBRD8 to COBRD0, COBGR8 to COBGR0, COBBL8
to COBBL0)
Sets the RGB individual value of color offset A and color offset B. Negative
numbers should be set by two complements.
388
16.4 Table List
ST-58-R2 389
• Character Pattern Table Data Specifications
bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Dot 0- 0 Dat a Dot 0- 1 Da ta Dot 0- 2 Da ta Dot 0- 3 Da ta
+00H
Dot 0 1 2 3 4 5 6 7
7 + 1C + 1D +1E +1F
Not e 1: The up pe r le ft not at ion in the cel l is dot 0- 0; to the rig ht ar e dot 0- 1,
do t 0-2 , dot 0- 3, ...
Not e 2: Num be rs in the cel ls ar e VRAM addr esses (Hexa de cim al ) of do t (2
do ts) da ta, wit h VRA M ad dr ess of dot 0- 0, 0- 1 dat a as the
ref ere nce .
390
• Character Pattern Table (Continued)
(2) 8 bi ts/ dot (64 byt es/ cel l)
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
+00H Dot 0- 0 Dat a Dot 0- 1 Dat a
Dot 0 1 2 3 4 5 6 7
Dot 0 +00 +01 +02 +03 +04 +05 +06 +07
Not e 1: The uppe r lef t no tat ion in the ce l is dot 0- 0; to the rig ht ar e dot 0- 1,
do t 0-2 , dot 0- 3, ...
Not e 2: Num ber s in the cel ls ar e VRAM ad dr esse s (Hexad eci mal ) of do t
da ta, with VRAM ad dr ess of dot 0- 0 dat a as the ref er en ce.
ST-58-R2 391
• Character Pattern Table (Continued)
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
+00H Dot 0- 0 Dat a
+7 EH Dot 7- 7 Dat a
Dot 0 1 2 3 4 5 6 7
Dot 0 +00 +02 +04 +06 +08 +0A +0C +0E
Not e 1: The upp er lef t no tat io n in the ce ll is dot 0- 0; to the righ t ar e do t 0-1 ,
dot 0- 2, dot 0- 3, ...
Not e 2: Numb er s in the cel ls are VRAM add re sses (Hexa de cim al) of dot
dat a, with VRAM ad dr ess of dot 0- 0 da ta as the re fer en ce.
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
+0H 11 bit integer part
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
+2H 8 bit fractional part
392
• Character Pattern Table (Continued)
(4) 32 bits/ do t (2 56 byt es/ ce l )
BIT 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
+00H Dot 0- 0 Da ta (M ost si gn fi ica nt wor d)
Do t 0 1 2 3 4 5 6 7
Do t 0 +00 +04 +08 +0C +10 +14 +18 +1C
Not e 1: The uppe r lef t no tat io n in the ce l is dot 0- 0; to the rig ht ar e dot 0- 1,
do t 0-2 , dot 0- 3, ...
Not e 2: Numb er s in the cel ls ar e VRAM addr esses (Hexadeci mal ) of do t
da ta (M SW), with VRAM ad dr ess of dot 0- 0 da ta (MSW) as the
ref ere nce .
ST-58-R2 393
• Pattern Name Table Data Specifications
Pattern Name Data Size Character Size Contents of 1 Page Boundary During VRAM
Storage
1 Word 1 H Cell X 1 V Cell 8192 Bytes 2000H
2 H Cells X 2 V Cells 2048 Bytes 800H
2 Words 1 H Cell X 1 V Cell 16,384 Bytes 4000H
2 H Cells X 2 V Cells 4096 Bytes 1000H
Pattern Nam e Ta bl e (V RA M)
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
+00 00H Cha ract er Pat ter n 0- 0 Pat ter n Name Dat a
Ch ar act er
Pattern 0 1 2 61 62 63
Char act er
Pat ter n 0 +000 0 +0002 +000 4 +007A +007C +007E
Page
No te 1: The up per -lef t no tat ion in the page is ch ar act er pa ttern 0- 0; to the right ar e
char act er pat terns 0-1 , 0-2 , 0-3 , ...
No te 2: Num be rs in the pag es are VRAM adr esse s (He xad eci mal ) of pa ttern na me dat a
of ch ar act er pa ttern s, with VRAM addr ess of cha ra ct er pat ter n 0-0 pat ter n nam e
dat a as the ref er en ce.
394
• Pattern Name Table (Continued)
(2) Pat tern Nam e Dat a Size : 1 wor d
Char act er Pat ter n Size : 2 H cel ls X 2 V cel ls
Pattern Nam e Ta bl e (V RA M)
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
+00 0H Cha ract er Pat ter n 0- 0 Pat ter n Name Dat a
Cha ract er
Pat ter n 0 1 2 29 30 31
Cha ra ct er
+000 +002 +004 +03A +03C +03E
Pat ter n 0
Pag e
ST-58-R2 395
• Pattern Name Table (Continued)
(3) Pat tern Nam e Dat a Size : 2 wor ds
Char act er Pat ter n Size : 1 H cel l X 1 V cel l
Pattern Nam e Ta bl e (V RA M)
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
+000 0H Ch ar act er Pattern 0- 0 Patter n Nam e Data (Most sig ni fica nt word )
+000 2H Cha ract er Pat ter n 0- 0 Pat ter n Name Dat a (Le ast si gni fican t word )
+000 4H Char act er Pat ter n 0- 1 Pat ter n Name Dat a (Mo st si gni fican t wor d)
+3F FCH Char act er Patter n 63 -6 3 Pat ter n Name Dat a (Most si gni fican t wor d)
+3F FEH Char act er Pat ter n 63 -6 3 Pat ter n Name Dat a (Le ast sig ni fican t word )
Ch ar act er
Pattern 0 1 2 61 62 63
Cha ra ct er
+0000 +0004 +0008 +00F4 +00F8 +00FC
Pat ter n 0 +0002
+0006 +000A +00F6 +00FA +00FE
Pag e
396
• Pattern Name Table (Continued)
(4) Pat tern Nam e Dat a Size : 2 wor ds
Char act er Pat ter n Size : 2 H cel ls X 2 V cel ls
Pattern Nam e Ta bl e (V RA M)
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
+0 00 H Cha ra ct er Pat ter n 0-0 Pat tern Nam e Dat a (Mo st si gn ificant wor d)
+0 02 H Char act er Patter n 0- 0 Pat ter n Na me Dat a (Le ast si gni fica nt wo rd )
+FFCH Ch ar act er Pattern 31 -3 1 Pat ter n Na me Dat a (Most si gni fican t word )
+FFEH Char act er Patter n 31 -3 1 Pat ter n Name Dat a (Le ast sig ni fica nt word )
Ch ar act er
Pattern 0 1 2 29 30 31
Char act er +000 +004 +008 +074 +078 +07C
Pat ter n 0 +002 +006 +00A +076 +07A +07E
Pag e
+ F0 0 + F0 4 + F0 8 +F7 4 + F7 8 +F 7C
30 + F0 2 + F0 6 +F0 A +F7 6 +F7 A +F7 E
ST-58-R2 397
• Bitmap Pattern Data Specifications
Bitmap Size Bitmap Pattern Bitmap Color Count Size per Surface
Data Size
4 bits/dot 16 colors 64K bytes (512K bits)
512 H dots X 8 bits/dot 256 colors 128K bytes (1M bits)
256 V dots 16 bits/dot 2048 colors, 32,768 colors 256K bytes (2M bits)
32 bits/dot 16,770,000 colors 512K bytes (4M bits)
4 bits/dot 16 colors 128K bytes (1M bits)
512 H dots X 8 bits/dot 256 colors 256K bytes (2M bits)
512 V dots 16 bits/dot 2048 colors, 32,768 colors 512K bytes (4M bits)
32 bits/dot 16,770,000 colors 1024K bytes (8M bits)
4 bits/dot 16 colors 128K bytes (1M bits)
1024 H dots X 8 bits/dot 256 colors 256K bytes (2M bits)
256 V dots 16 bits/dot 2048 colors, 32,768 colors 512K bytes (4M bits)
32 bits/dot 16,770,000 colors 1024K bytes (8M bits)
1024 H dots X 4 bits/dot 16 colors 256K bytes (2M bits)
512 V dots 8 bits/dot 256 colors 512K bytes (4M bits)
16 bits/dot 2048 colors, 32,768 colors 1024K bytes (8M bits)
398
• Bitmap Pattern
(1) Bit ma p Size : 512 H dot s X 25 6 V dot s
Bit ma p Colo r Coun t : 4 bits/ dot (1 6 co lor s)
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
+0 00 0H Dot 0- 0 Dot 0- 1 Dot 0- 2 Dot 0- 3
Dot 0 1 2 3 50 8 50 9 51 0 511
Bitmap
25 5 +F F0 0 +F F0 1 +FFF E +FF FF
Note 1: The upp er lef t not ation in the cel l is do t 0-0 ; to the righ t are do t 0-1 ,
dot 0- 2, do t 0-3 , ...
Note 2: Nu mber s in the ce l s are VRAM ad dr esse s (h exa de cim al) of dot (2
dot s) dat a, with VRAM add re ss of do t 0-0 , 0-1 da ta as the
refer en ce.
ST-58-R2 399
Bitmap Pattern (Continued)
(2 ) Bitmap Size : 512 H do ts X 25 6 V do ts
Bitmap Col or Coun t : 8 bit s/ do t (25 6 co lor s)
Bitmap
25 5 +1 FE0 0 +1F E01 +1 FE0 2 +1F E03 +1F FFC +1F FF D +1 FF FE +1F FFF
Note 1: The upp er lef t no tation in the cel l is do t 0-0 ; to the righ t are do t 0-1 ,
dot 0- 2, do t 0-3 , ...
Note 2: Nu mb er s in the ce l s are VRAM add re sses (h exadeci mal ) of do t
dat a, with VRAM add re ss of do t 0-0 da ta as the re fer ence.
400
• Bitmap Pattern (Continued)
(3) Bit ma p Size : 512 H dot s X 25 6 V dot s
Bit ma p Colo r Coun t : 16 bi ts/ dot (204 8 col or s, 327 68 col ors)
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
+00 00 0H Dot 0- 0
Dot 0 1 2 3 50 8 50 9 51 0 511
Do t 0 +00 000 +000 02 +00 004 +000 06 +0 03F 8 +0 03F A +003 FC +0 03F E
+00 400 +004 02 +00 404 +004 06 +0 07F 8 +0 07F A +007 FC +0 07F E
1
Bitmap
Not e 1: The upp er lef t no tat io n in the ce ll is dot 0- 0; to the righ t ar e do t 0-1 ,
dot 0- 2, dot 0- 3, ...
Not e 2: Numb er s in the cel ls are VRAM add re sses (hexad eci mal ) of do t
dat a, with VRAM ad dr ess of dot 0- 0 da ta as the re fer en ce.
ST-58-R2 401
• Bitmap Pattern (Continued)
(4) Bit ma p Size : 512 H dot s X 25 6 V dot s
Bit ma p Colo r Coun t : 32 bi ts/ do t (16 ,77 0, 000 col ors)
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
+0 00 00 H Dot 0-0 (upp er wor d)
+0 00 02 H Dot 0- 0 (l ow er wo rd )
Do t 255 -5 11 (up pe r wo rd )
+7 FFFCH
+7F FFEH Dot 25 5- 511 (lo wer wor d)
Dot 0 +0 000 0 +00 004 +0 000 8 +0 000 C +007 F0 +00 7F 4 +007 F8 +007 FC
Bitma p
No te 1: The up per left not ation in the cel l is do t 0-0 ; to the ri gh t are dot 0-1,
dot 0- 2, do t 0-3 , ...
No te 2: Num be rs in the ce lls ar e VRA M ad dr esse s (h exa de cim al) of dot
dat a (up pe r wo rd) , with VRAM ad dr ess of dot 0- 0 da ta (uppe r wor d) as
the ref ere nce .
402
• Bitmap Pattern (Continued)
(5 ) Bitmap Size : 512 H do ts X 51 2 V do ts
Bitmap Col or Coun t : 4 bit s/ do t (16 col ors)
Do t 0 1 2 3 50 8 50 9 51 0 511
Bitmap
ST-58-R2 403
• Bitmap Pattern (Continued)
(6) Bitmap Size : 512 H dots X 512 V dots
Bitmap Color Count : 8 bits/dot (256 colors)
Bitmap
Note 1: The upper left notation in the cell is dot 0-0; to the right are dot 0-1,
dot 0-2, dot 0-3, ...
Note 2: Numbers in the cells are VRAM addresses (hexadecimal) of dot
data, with VRAM address of dot 0-0 data as the reference.
404
• Bitmap Pattern (Continued)
(7) Bitmap Size : 512 H dots X 512 V dots
Bitmap Color Count : 16 bits/dot (2048 colors, 32768 colors)
Bitmap
Note 1: The upper left notation in the cell is dot 0-0; to the right are dot 0-1,
dot 0-2, dot 0-3, ...
Note 2: Numbers in the cells are VRAM addresses (hexadecimal) of dot
data, with VRAM address of dot 0-0 data as the reference.
ST-58-R2 405
• Bitmap Pattern (Continued)
(8) Bitmap Size : 512 H dots X 512 V dots
Bitmap Color Count : 32 bits/dot (16,770,000 colors)
Bitmap
Note 1: The upper left notation in the cell is dot 0-0; to the right are dot 0-1,
dot 0-2, dot 0-3, ...
Note 2: Numbers in the cells are VRAM addresses (hexadecimal) of dot
data (upper word), with VRAM address of dot 0-0 data (upper word) as
the reference.
406
• Bitmap Pattern (Continued)
(9) Bitmap Size : 1024 H dots X 256 V dots
Bitmap Color Count : 4 bits/dot (16 colors)
Bitmap
Note 1: The upper left notation in the cell is dot 0-0; to the right are dot 0-1,
dot 0-2, dot 0-3, ...
Note 2: Numbers in the cells are VRAM addresses (hexadecimal) of dot (2
dots) data, with VRAM address of dot 0-0, 0-1 data as the
reference.
ST-58-R2 407
• Bitmap Pattern (Continued)
(10) Bitmap Size : 1024 H dots X 256 V dots
Bitmap Color Count : 8 bits/dot (256 colors)
Bitmap
Note 1: The upper left notation in the cell is dot 0-0; to the right are dot 0-1,
dot 0-2, dot 0-3, ...
Note 2: Numbers in the cells are VRAM addresses (hexadecimal) of dot
data, with VRAM address of dot 0-0 data as the reference.
408
• Bitmap Pattern (Continued)
(11) Bitmap Size : 1024 H dots X 256 V dots
Bitmap Color Count : 16 bits/dot (2048 colors, 32768 colors)
Bitmap
Note 1: The upper left notation in the cell is dot 0-0; to the right are dot 0-1,
dot 0-2, dot 0-3, ...
Note 2: Numbers in the cells are VRAM addresses (hexadecimal) of dot
data, with VRAM address of dot 0-0 data as the reference.
ST-58-R2 409
• Bitmap Pattern (Continued)
(12) Bitmap Size : 1024 H dots X 256 V dots
Bitmap Color Count : 32 bits/dot (16,770,000 colors)
Bitmap
Note 1: The upper left notation in the cell is dot 0-0; to the right are dot 0-1,
dot 0-2, dot 0-3, ...
Note 2: Numbers in the cells are VRAM addresses (hexadecimal) of dot
data (upper word), with VRAM address of dot 0-0 data (upper word)
as the reference.
410
• Bitmap Pattern (Continued)
(13) Bitmap Size : 1024 H dots X 512 V dots
Bitmap Color Count : 4 bits/dot (16 colors)
Bitmap
Note 1: The upper left notation in the cell is dot 0-0; to the right are dot 0-1,
dot 0-2, dot 0-3, ...
Note 2: Numbers in the cells are VRAM addresses (hexadecimal) of dot (2
dots) data, with VRAM address of dot 0-0, 0-1 data as the
reference.
ST-58-R2 411
• Bitmap Pattern (Continued)
(14) Bitmap Size : 1024 H dots X 512 V dots
Bitmap Color Count : 8 bits/dot (256 colors)
Bitmap
Note 1: The upper left notation in the cell is dot 0-0; to the right are dot 0-1,
dot 0-2, dot 0-3, ...
Note 2: Numbers in the cells are VRAM addresses (hexadecimal) of dot
data, with VRAM address of dot 0-0 data as the reference.
412
• Bitmap Pattern (Continued)
(15) Bitmap Size : 1024 H dots X 512 V dots
Bitmap Color Count : 16 bits/dot (2048 colors, 32768 colors)
Bitmap
Note 1: The upper left notation in the cell is dot 0-0; to the right are dot 0-1,
dot 0-2, dot 0-3, ...
Note 2: Numbers in the cells are VRAM addresses (hexadecimal) of dot
data, with VRAM address of dot 0-0 data as the reference.
ST-58-R2 413
• Line Scroll Table Data Bit Configuration
Hor izon tal , Vert ica l Scr ee n Scro ll Va lue
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
+OH Intege r Part : 11 b its
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
+2H Fr act iona l Part : 8 bit s
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
+0H Integ er Part : 3 bi ts
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
+2H Fr act iona l Part : 8 bi ts
No te: Shad ed ar ea s ar e ig no re d
414
• Example of Line Scroll Table
When selecting horizontal and vertical screen scroll values and
horizontal coordinate increment for every 1 line.
ST-58-R2 415
• Vertical Cell Scroll Table Data Bit Configuration
Vertical Screen Scroll Value
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
+0H 11 bit integer part
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
+2H 8 bit fractional part
416
• Example of Vertical Cell Scroll Table
NBG0 Vertical Cell Scroll
ST-58-R2 417
• Rotation Parameter Table
418
Mode 0: Used as Scale Coefficients kx and ky
Mode 1: Used as Scale Coefficients coefficient kx
Mode 2: Used as Scale Coefficients coefficient ky
Mode 3: Used as viewpoint coordinate Xp after rotation conversion
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
+2 H 16 bi t fra ct ion al par t
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
+2 H Int eg er pa rt LS B 8 bi ts 8 bi t fra ct ion al par t
ST-58-R2 419
• Line Color Screen Table Data Bit Configuration
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
11 bit color Ram address
Note: Shaded are is ignored. Also, when color RAM is in mode 0 or mode 2, the
MSB of the address is ignored.
Note: In the case of single color, the 1st line color RAM
address is used in the entire line color screen. In the case of
double-density interlace, line data of odd and even fields are
stored together.
Note: In the case of single color, the 1st and 2nd line color
RAM addresses are used in the entire line color screen.
420
• Back Screen Table Data Bit Configuration
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
5 bit Blue Data 5 bit Green Data 5 bit Red Data
Note: Shaded area is ignored. Add 0 bit 3 bits at a time to the lower bits
of RGB to make 8 bits.
Note: In the case of single color, the 1st line RGB data is used
in the entire line color screen. In the case of double-density
interlace, line data of odd and even fields are stored together.
Note: In the case of single color, the 1st and 2nd line RGB data
are used in the entire line color screen.
ST-58-R2 421
• Normal Line Window Table Data Bit Configuration
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
+0H Horizontal Start Point Coordinates (10 bits)
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
+2H Horizontal End Point Coordinates (10 bits)
Single-density interlace
422
TM
SEGA SATURN
SCU Final Specifications:
Precautions
(Version 1)
Doc. # ST-210-110194
In translating/creating this document, certain technical words and/or phrases were interpreted
with the assistance of the technical literature listed below.
This document contains the final specifications and items of note about the SEGA
Saturn SCU. Since it consists of material which is not included in the previous
manual, be sure to check the contents against this newest manual.
[Revision History]
No. 15 Read of DMA transfer register transfer byte number is prohibited (write only).
No. 16 Restrictions by the address accessing the DMA read address add value.
No. 17 Value of the address add value bit when setting the DMA read address update bit.
No. 18 Restrictions by the address accessing the DMA write address add value.
No. 19 Value of the address add value bit when setting the DMA write address update bit.
No. 20 2 channels can be used for simultaneous use of DMA.
No. 21 DMA activation method specification change.
No. 22 Specification when DMA start trigger occurs during DMA execution.
No. 23 Writing to the register of the corresponding level while activating DMA is prohibited.
No. 24 DMA illegal interrupt does not occur during DMA execution in the indirect mode.
No. 25 DMA indirect mode table specification change.
No. 26 Clears the program end interrupt flag when starting DSP.
No. 27 Address add value restriction when transferring from the DSP DMA command B-Bus to the
DSP Data RAM.
No. 28 When debugging with ICE, starting DMA operation is delayed if a BREAK is performed.
No. 29 Must be the BREQ enable condition when debugging in ICE.
No. 30 Caution when using the Timer 0 compare register (address 25FE0090
H).
No. 31 Caution when using the Timer 1 set data register (address 25FE0094
H).
No. 32 Caution during read access of A-Bus and B-Bus areas (2000000H ~ 5FFFFFFH).
No. 33 A-Bus refresh initial value when Power ON is reset (address 25FE00B8
H).
2
2. SCU Final Specification Reference Items
Item No. 01, 02, 04, 08, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29 and 3
Item No. 01, 08, 09, 10, 11, 12, 17, 18, 19 and 32
Item No. 07, 09, 10, 11, 13, 14, 15, 23 and 24
VDP1 register write access must be in word (2 byte) units. Access in long word (4 bytes) byte units is
prohibited. VDP1 read access can be in byte and long word units.
Work RAM-H (SDRAM: 1 Mbyte) is the only Work RAM that can be used with SCU-DMA. Work RAM-L
(DRAM: 1 Mbyte) cannot be used.
No. 05 Access to the SCU register must use the cache through address.
Register access to the SCU must be done by the cache-through address. This is because a register i
which read is prohibited may be accessed if the cache address is used since the CPU runs in the
following way when the cache is full.
• When 0H address data is read by the cache address
4H address read→ 8H address read→ CH address read→ 0H address read→ cache register
• When 4H address data is read by the cache address
8H address read→ CH address read→ 0H address read→ 4H address read→ cache register
• When 8H address data is read by the cache address
CH address read→ 0H address read→ 4H address read→ 8H address read→ cache register
• When CH address data is read by the cache address
0H address read→ 4H address read→ 8H address read→ CH address read→ cache register
Reading and writing to unused areas are prohibited. Reading and writing to address 25FE00AC
H is
especially prohibited.
When writing to the interrupt status register, the bit used to create interrupt may not be active.
Therefore, writing to the interrupt status register is prohibited.
4
No. 08 ← → B-Bus is prohibited.
Access to A-Bus and B-Bus from the CPU during DMA operation of A-Bus
During the DMA operation of A-Bus to B-Bus and B-Bus to A-Bus, access from the CPU to the A-Bus
and B-Bus is prohibited. Refresh is not generated for SDRAM while waiting and may hang up.
The A-Bus preread function was deleted. The following register bits listed in the 2nd version manual
(May 31, 1994) must be set to 0.
1. A-Bus set register [CS0, 1 space] (address: 25FE00B0H, register: ASR0)
→ [bit 31] and [bit 15] must be set to 0.
2. A-Bus set register [CS2, reserved space] (address: 25FE00B4 H, register: ASR1)
→ [bit 31] and [bit 15] must be set to 0.
No. 10 Address change of the A-Bus interrupt acknowledge register (address 25FE00A8
H).
The A-Bus set register enables to write to the A-Bus only when not accessing. Write after completing
read of the A-Bus (dummy).
No. 12 A-Bus ← → B-Bus SCU-DMA start standby when the CPU writes to the A-Bus and B-Bus.
The write process by the CPU to the A-Bus and B-Bus is higher in priority than the SCU-DMA start
between the A-Bus and B-Bus. For example, while continuous write is performed by the CPU to VDP
(B-Bus), SCU-DMA does not start until continuous write ends even if SCU-DMA initial activation for
VDP2 (B-Bus) from the A-Bus. However, while starting SCU-DMA, CPU access to A-Bus and B-Bus is
on standby.
The function that returns the address set value of DMA while stopped and the status of levels 0, 1, 2
been deleted. Part of the specification change is reflected in the 2nd version manual (May 31, 1994)
(The DMA read address, write address, and transfer byte number while stopped were deleted.)
No. 14 Delete the DMA forced quit register function. (Address 25FE0060
H).
DMA forced quit register functions was deleted. Writing to this register is prohibited.
The value reading the number of transfer bytes number of the DMA transfer register is not guarantee
This register cannot be read. This is a write-only register. (address, level 0, 25FE0008
H : D0C, level 1,
25FE0028H : D1C, level 2, 25FE0048 H : D2C).
No. 16 Restrictions by the address accessing the DMA read address add value.
The value that can be set in the read address add value changes by the address that is to be access
This applies to DMA commands of the DSP.
External area 4 (A-Bus I/O area) → Able to set 0B and 1B .
Other → Able to set 1B only.
(Address: level 0, 25FE000CH: D0RA, level 1, 25FE002C H: D1RA, level 2, 25FE004CH: D2RA)
No. 17 Value of the address add value bit when setting the DMA read address update bit.
1 is 1, the read address add value bit*
When the read address update bit* 2 must be 1.
*1 Read address update bit
Address: level 0, 25FE0014H: D0RUP, level 1, 25FE0034H: D1RUP, level 2, 25FE0054H: D2RUP
*2 Read address add value bit
Address: level 0, 25FE000CH: D0RA, level 1, 25FE002C H: D1RA, level 2, 25FE004C
H: D2RA
No. 18 Restrictions by the address accessing the DMA write address add value.
Values that can be set in the write address add value change according to the address that is access
This applies to DMA commands of the DSP.
WORK RAM-H → Able to set 010B
External area 1 ~ 3 → Able to set 010B
External area 4 (A-Bus I/O area) → Able to set 000B and 010B .
VDP1, VDP2, SCSP → All settings are possible.
(Address: level 0, 25FE000CH: D0WA, level 1, 25FE002C H: D1WA, level 2, 25FE004C H: D2WA)
No. 19 Value of the address add value bit when setting the DMA write address refresh bit.
When the write address update bit1 *is 1, the write address add value bit2 *must be set by the bus space
to be accessed as shown below.
External area 1 ~ 4 (A-Bus) → Able to set 010B
VDP1, VDP2, and SCSP (B-Bus) → Able to set 001B
Work RAM-H ((C-Bus) → Able to set 010B
*1 Write address update bit
Address: level 0, 25FE0014H: D0WUP, level 1, 25FE0034 H: D1WUP, level 2, 25FE0054 H: D2WUP
*2 Write address add value bit
Address: level 0, 25FE000CH: D0WA, level 1, 25FE002C H: D1WA, level 2, 25FE004C H: D2WA
6
No. 20 2 channels are available for the simultaneous use of DMA.
Up to 2 channels can be used concurrently which guarantee the priority order of DMA . If 3 channels
used concurrently, the priority order is ignored. (The DSP DMA command is also counted as 1 chann
The start method of DMA has been changed and a DMA enable bit has been provided separately.
No. 22 Specification when a DMA start trigger occurred during DMA execution.
If a DMA start trigger occurs while DMA is being executed, and it holds the trigger, then execute
activation after DMA ends. For example, when set so that DMA starts at H-Blank, operation becomes
unstable if the set data size is larger than the size enabling transfer within 1 line (until the next H-blank
When such DMA start is executed in this way, please note the transfer data size. The trigger hold hol
only for 1 time.
No. 23 Writing to the register of the corresponding level while starting DMA is prohibited.
Rewriting the contents of DMA mode, address update, activation factor selection register*1 and DMA
set register*2 is not allowed during DMA activation at this level. Hang up occurs if rewritten.
*1 DMA mode, address update, start factor select register
Address: Level 0, 25FE0014H, level 1 25FE0034H, level 2 25FE0054H
*2 DMA set register
Address: Level 0, 25FE000CH, level 1 25FE002CH, level 2 25FE004CH
No. 24 DMA illegal interrupt does not occur during DMA execution in the indirect mode.
The DMA illegal interrupt status bit [bit 12] of the DMA status register (address 25FE00A4
H) does not
occur in the indirect mode while DMA is executing. When DMA is used in the indirect mode, do not re
to the DMA illegal interrupt status bit.
No. 26 Clears the program end interrupt flag when starting DSP.
Be sure the program end interrupt flag [bit 18 : E] of the DSP program control port (address 25FE00
H) 8
is 0 when starting DSP. If the flag is 1, DSP program end interrupt does not occur even if the DSP
program ends by the ENDI command.
No. 27 Address add value restriction when transferring from the DMA command B-Bus of the DSP
to the Data RAM of the DSP.
No. 28 When debugging in ICE, starting DMA operation is delayed if a BREAK is performed.
SCU DMA must be executed by the CPU. If there is a break while debugging in ICE, the start of the
SCU-DMA operation will be delayed. Operation of the SCU-DMA is normally performed when the IC E
execution condition is the parallel mode (prompt is the # condition).
8
No. 29 Must be the BREQ enable condition when debugging in ICE.
When SCU-DMA is used in ICE, the input condition of the EXECUTION_MODE (EM) command BREQ
(bus right request) signal must be E (always enabled). Changing the E7000 system of ICE is
unnecessary because BREQ is E by default.
No. 30 Caution when using the Timer 0 compare register (address 25FE0090
H)
It is possible to set up to 10 bits of data, but if data that does not exist, interrupt won't occur . Be sure
set a value within a range that can be used. In case of an NTSC non-interface (1 screen 263 lines,
effective screen 224 lines), for example, interrupt will occur as follows:
T0C9–0 = 1 → Occurs at the start of H-Blank-IN just before the first 1 line of the effective scree
T0C9–0 = 2 → Occurs at the start of H-Blank-IN just before the first 2 line of the effective scree
T0C9–0 = 224 → Occurs at the start of H-Blank-IN just before the last 1 line of the effective scree
T0C9–0 = 225 → Occurs at the start of H-Blank-IN just after the effective screen ends.
T0C9–0 = 263 → Occurs at the start of H-Blank-IN just 1 line before the beginning of the effectiv e
screen.
T0C9–0 = 264 ~ 1023 → Interrupt does not occur.
T0C9–0 = 0 → Interrupt occurs with the same timing as V-Blank-OUT.
No. 31 Caution when using the Timer 1 set data register (address 25FE0094
H)
Loading the value of Timer 1 set data register to Timer 1 occurs "when Timer 1 is stopped and H-Blan
occurs." If data larger than the count number of 1 line is set to the Timer 1 set data register, Timer 1
interrupt no longer occurs for each line.
[Count Number Range]
For 1 line 320 dots: 1 ~ 1AAH
For 352 dots 1 ~ 1C6H
For 424 dots 1 ~ D3H
For 426 dots 1 ~ D4H
(Be aware that this becomes 512 when a count number of 0 is specified)
No. 32 Caution during read access of A-Bus and B-Bus areas (2000000
H ~ 5FFFFFFH)
The internal CPU operation and external operation are different for read access of the A-Bus and B-B
areas (2000000H ~ 5FFFFFFH). Even for byte or word (2 bytes) read access from the SH2, the externa
is accessed by long word (4 bytes) units. When performing byte unit read of a continuous area in -the
Bus and B-Bus areas, more process time than for byte unit write is required. Internal operations and
external operations are the same for write access. (External access becomes byte access when
accessed in byte units.)
The initial value of the A-Bus refresh output effective bit when resetting power on is changed to an
effective condition (ARFEN = 1). This bit should not be changed by the user.
The SDRAM selection bit becomes 2 Mbits X 2 (RSEL = 0) by resetting the power on. Reset to RSEL
1 and change to 4 Mbits X 2. This change in setting is done within the Boot ROM and requires no
change by the user.
A malfunction can occur when DMA level 2 is activated while starting DMA at level 1. Do not start DM
level 2 while DMA level 1 is activated.
No. 36 Caution when reading the DSP program control port (address 25FE0080
H).
Be aware that the following phenomenon occurs when reading the DSP program control port.
1. V-Flag (overflow flag) is cleared away.
A check of the V-Flag cannot be done while executing DSP.
2. The DSP end interrupt factor may not occur.
Because the DSP end interrupt may not occur when the program end interrupt flag is read while
DSP is being executed, please do not read this address for the program obtained by DSP end
interrupt.
10
TM
The SATURN
SCU DSP Simulator
User's Manual
Addendum
Doc. # ST-240-B-SP1-052295
Introduction
The DSP simulator (dspsim.exe) is a simple, command-line-oriented software emulator which makes
it possible to load, execute, and debug programs written for the DSP that is a part of the SATURN
System Control Unit (SCU).
Addresses in the DSP’s internal memory are 32-bit-word-addresses, while addresses in external
memory are byte addresses. Nonetheless, the simulator will only access external memory in 32-bit
chunks that are aligned on 32-bit boundaries, so all external memory addresses used in commands to
the simulator should be divisible by 4.
Command Summary
A Mini-assembler
B Breakpoints
D Dump memory
E Enter one or more values into memory
F Fill a range of memory with a specified value
G Go
H Execution history
L Load a binary or S-record file
M Move memory
P Set program memory size
Q Quit
R Display and set registers
S Single step
U Disassemble (unassemble)
W Write a binary or S-record file
^ Command history
!! Repeat last command
! Repeat specified command
? Display on-line command summary
Activate the mini-assembler, storing instructions starting at the specified address. The assembler
accepts all DSP mnemonics, but it does not accept labels, assembler directives, or expressions.
Exit the mini-assembler by entering a blank line.
B <prog addr> sets an execution breakpoint at the specified address in program memory.
B lists all current breakpoints.
B- deletes all breakpoints.
BX [<n>] deletes the breakpoint that occupies the specified position in the list of breakpoints. If the
parameter is omitted, BX is the same as B-.
Dump memory from <addr1> through <addr2>. The <ram> parameter specifies the type of
memory to be dumped. Substitute p for program RAM, m for external RAM, or r0, r1, r2, or r3
for one of the DSP’s four banks of data RAM. If <ram> is omitted, it defaults to the most-recently-
referenced memory area. If <addr2> is omitted, it defaults to <addr1> + 0x3f for program or data
memory and <addr1> + 0xff for external memory. If all of the parameters are omitted, the next 64
32-bit words are displayed.
Enter one or more 32-bit numbers into memory. The <ram> parameter specifies the type of memory
to use. Substitute p for program RAM, m for external RAM, or r0, r1, r2, or r3 for one of the DSP’s
four banks of data RAM. If <ram> is omitted, it defaults to the most-recently-referenced memory
area. If <value> is omitted, then the simulator enters a command mode in which a series of values
may be entered into consecutive memory addresses. When in this mode, the simulator prompts with
an address and accepts one of the following commands:
<value> Store the value to the current address and go to the next address.
@ Go to the next address without altering the contents of the current address.
^ Back up to the previous address without altering the contents of the current address.
. Exit the data-entry mode and return to the simulator’s main command prompt.
<enter> Same as @.
Fill a range of memory with a single 32-bit value. The <ram> parameter specifies the type of memory
to be filled. Substitute p for program RAM, m for external RAM, or r0, r1, r2, or r3 for one of
the DSP’s four banks of data RAM. If <ram> is omitted, it defaults to the most-recently-referenced
memory area.
Start executing instructions at the specified address in program memory. If a second address is
specified, execution terminates at that address.
2
H [<n>], H+, H-, H@
H [<n>] displays a history of register values extending back for the specified number of instruc-
tions. The default is 10.
H+ enables the history mechanism (the default).
H- disables the history mechanism.
H@ clears the history buffer.
Load a binary or S-record file. File names having the extensions “.s” or “.mot” are presumed to be S-
record files. Files having other extensions are presumed to be binary files. The <ram> parameter
specifies the type of memory to be loaded. Substitute p for program RAM, m for external RAM, or
r0, r1, r2, or r3 for one of the DSP’s four banks of data RAM. When loading an S-record file,
the <addr> parameter is added to the addresses contained in the S-record file.
Move a range of memory to the specified address. The <ram1> and <ram2> parameters specify the
types of memory to be read and written. Substitute p for program RAM, m for external RAM, or r0,
r1, r2, or r3 for one of the DSP’s four banks of data RAM. If <ram2> is omitted, it defaults to
<ram1>. Overlapping source and destination ranges are handled correctly.
P, PE, PR
S [<n>]
Disassemble (unassemble) the specified range of program memory. If <prog addr2> is omitted, it
defaults to <prog addr1> + 0xf. The disassembled data is formatted so that the so-called “Opera-
tion Commands” (instructions controlling the ALU, the X-bus, the Y-bus, and the D1-bus) are aligned
in columns according to which subcomponent of the DSP they use. This makes it easier to see which
subcomponents are idle at any given time, which in turn makes it easier to increase parallelism.
V, VM, VS
Write the specified range of memory to a binary or S-record file. File names having the extensions
“.s” or “.mot” will be written as S-record files. Files having other extensions will be written as binary
files. The <ram> parameter specifies the type of memory to be written. Substitute p for program
RAM, m for external RAM, or r0, r1, r2, or r3 for one of the DSP’s four banks of data RAM. The
S-record files produced by this command are UNIX-flavored, i.e. they contain no carriage returns,
only linefeeds, so you may wish to convert them with a utility such as unix2dos.exe.
^ [<n>]
Display the last n entries in the command history (default is 20). The command history buffer holds
the most recent 50 commands.
!!
! <n>
<enter>
If the last command was S, D, or U (with or without parameters), then pressing <enter> is equiva-
lent to typing S, D, or U without parameters, i.e. it executes the next instruction, or it dumps or
disassembles the next chunk of memory. Otherwise, it does nothing.
4
Notes
Memory addresses and values to be stored in memory must be expressed in hexadecimal. Other
numerical parameters must be expressed in decimal.
Any address parameter may be appended with the letter L, which causes it to be multiplied by four.
This is intended as a convenience in addressing external memory. For example, to move the second
32-bit word (word 1) of program memory to the third 32-bit word (bytes 8 through 11) of external
memory, you could say either M P 1 1 M 8 or M P 1 1 M 2L. For what it’s worth, this notation
can be used with memory data parameters as well.
You can create a batch file of simulator commands that will be executed when the simulator is
launched. Create a text file containing one simulator command per line, then invoke the simulator
with a command of the form dspsim batchfil.
Bugs
Version 2.11 of the simulator contains a bug in the implementation of the V flag, which is used to
detect signed arithmetic overflows caused by the ADD, AD2, and SUB instructions. In the actual
DSP, the V flag is set when addition or subtraction results in a signed arithmetic overflow (e.g. adding
two positive numbers and getting a negative result). If there is no overflow, the V flag is cleared. In
the simulator, the V flag is set whenever the C flag is set as a result of addition or subtraction, and it is
never cleared. To clear it, you must issue the command r v 0.
SEGA SATURN
SMPC Sample Program
(tentative title)
User's Manual
Ver. 0.56/Edition 0.2
Doc. # ST-214-111594
In translating/creating this document, certain technical words and/or phrases were interpreted
with the assistance of the technical literature listed below.
2. Computer Dictionary
Kyoritsu Publishing Co., LTD.
Tokyo, Japan
1978
Version 0.56
User’s Manual
Edition 0.2
0. Introduction
0.1 Terms Used in This Manual ......................................... 3
0.2 Changes from Version 0.50 ......................................... 3
2
0. Introduction
Peripheral: General term for control pads, joysticks, etc., which are connected
into the port(s) at the front of the Saturn unit and are primarily
used to control characters, etc., in games.
Port: Refers to the connectors on the front of the Saturn unit. Looking at
the front of the Saturn unit, the connector on the left is port 1 and
the connector on the right is port 2.
Port Number: This is 1 or 2 when a peripheral is connected directly to a port. If a
Multi-tap, etc., for expanding the number of ports is connected,
then the numbers are 1-1, 2-3, and etc.
4
2. Main Menu
2.1 Main Menu Screen
The following menu is displayed first once the program is executed.
>PORT MONITOR(SPRITE)
PORT MONITOR(RBG)
SMPC STATUS DISPLAY
GAME
PAINT TOOL
COMMAND TEST
Select the functions to be executed from the menu using the pad.
3. If no peripherals that can be used in menu operation are connected, then a mes-
sage is displayed in the window at the bottom right of the screen indicating that
the unit is waiting for a peripheral to be connected.
NOT This message is displayed when a
READY! peripheral is not connected.
4. If another peripheral that can be used in menu screens is connected, pressing the
peripheral start button permits operation of menus on that peripheral.
5. If a peripheral that is being used to operate menu screens is disconnected when
other peripherals that are used to operate menu screens are still connected, the
control shifts to the peripheral connected to the port with the smallest number.
6. The triangular cursor is moved by pressing the top or bottom of the + key and
selection is made by pressing the A or C button. If the selected menu item cannot
be executed, then “NOT AVAILABLE” is displayed and returns to the menu.
7. To return to the main menu from any menu other than the main menu, press the
C button and START button at the same time on any peripheral that is connected.
Menu operations are then performed by the peripheral on which the C button
and START button were pressed.
The port monitor displays data from the various types of peripherals connected to
the peripheral ports of the Saturn unit. With this version, the maximum number of
peripherals that can be used is 30 (when a clocked serial 15P is connected to both
ports 1 and 2). However, the peripherals displayed on the screen are only the first
seven connected to each of ports 1 and 2.
6
2. Peripheral Name Display Area
Displays the types and ID of connected peripherals. When multi-terminal 6 or
SEGA tap is connected, a number is affixed at the beginning of the peripheral
name.
Display (Saturn ID) Peripheral
------------------------------- (FF) Nothing is connected or a device that SMPC does not
identify is connected.
SATURN PAD (02) Saturn standard pad
ANALOG STICK (15) Analog joy stick
KEY BOARD (14) Saturn keyboard
STEERING CTRL (13) Steering controller
MD 3B PAD (E1) Mega Drive 3-button pad
MD 6B PAD (E2) Mega Drive 6-button pad
SEGA MOUSE (E3) SEGA mouse
Peripherals not listed in the above table are not compatible with this version.
Peripheral Operation
Saturn standard pad + key Ball movement
Mega Drive 3-button pad A button Quadruple-speed while depressed
Mega Drive 6-button pad X button Toggles between variable and fixed enlargement
modes
Y button Enlargement
Z button Reduction
Start Moves to initial position and changes to fixed mode
Analog joy stick Joy stick Moves (digital, analog)
A button Quadruple-speed while depressed (only during
digital movement)
B button Digital movement while depressed
X button Toggles between variable and fixed enlargement
modes
Throttle Enlarges and reduces ball
Start Moves to initial position and changes to fixed mode
SEGA mouse Move Moves ball
Left click Enlarges ball horizontally by two times
Right click Enlarges ball vertically by two times
Start Moves to initial position
Steering controller Steering Moves ball left and right (digital, analog)
Shift lever Moves ball up and down
A button Quadruple-speed while depressed (only during
digital movement)
B button Digital movement while depressed
X button Toggles between variable and fixed enlargement
modes
Y button Enlargement
Z button Reduction
Start Moves to initial position and changes to fixed mode
Saturn keyboard Cursor keys Moves ball
Z key Quadruple-speed while depressed
A key Toggles between variable and fixed enlargement
modes
S key Enlargement
D key Reduction
ESC key Moves to initial position and changes to fixed mode
8
3.3 RBG Version Operation
The RBG version of the port monitor is basically the same as the sprite version; the
data display screen is operated by the peripheral and not by the sprite.
The peripherals that operates in the RBG version are the peripherals used in the
menu screen. The operating method is shown in the table below.
Button Function
+ key Scrolls the screen up and down, and left and right
A button Enlarges the screen
B button Reduces the screen
C button Not used
X button Not used
Y button Not used
Z button Not used
L button Not used
R button Not used
START Returns the screen to its initial status
Displays OREG0-15, i.e., SMPC status, in hexadecimal or binary. See the SMPC
manual for details on OREG.
No particular operations are performed in the SMPC STATUS DISPLAY. Return to
the main menu by simultaneously pressing the C button and START button on a
peripheral that can be used to operate menus.
00 (00:00000000) STE/RESD
01 (19:00011001) YEAR H
02 (94:10010100) YEAR L
03 (61:01100001)) WEEKDAY/MONTH
04 (11:00010001)) DAY
05 (01:00000001)) HOUR
06 (34:00110100) MINUTE
07 (28:00101000) SECOND
08 (03:00000011) CART CODE
09 (0F:00001111) AREA CODE
10 (2F:00101111) SYSTEM STATUS 1
11 (40:01000000) SYSTEM STATUS 2
12 (00:00000000) SMEM1 DATA
13 (00:00000000) SMEM2 DATA
14 (00:00000000) SMEM3 DATA
15 (00:00000000) SMEM4 DATA
10
5. Game (Tentative Title)
Paint tools allows the drawing of points, lines and circles on the screen with the
mouse. The following three functions are used in this version; curved lines (upper
left icon), straight lines (adjacent icon) and boxes (icon below the free-hand icon).
Use the left button on the mouse to select an icon. There is no action when icons
other than above are selected.
Straight-Line Tool
Click the left mouse button where the line is to be started and click it again
where the line to be end. When a line is drawn, the end point becomes the
starting point of the next line, thus allowing line to be drawn continuously.
Box Tool
As with the straight-line tool, use the mouse to set the starting and ending
corners of rectangles. To draw boxes continuously, begin with the starting
corner again.
Always connect the mouse to be used for the paint tools to port 1-1.
To return to the menu, press the C button and START button simultaneously on
a peripheral other than the mouse.
Of the 16 different commands, 14 (other than clock check) can be issued for the SMPC.
00 (80:10000000)
>MSHON SYSRES 01 (19:00011001)
02 (94:10010100)
SSHON SSHOFF 03 (00:10000000)
04 (61:01100001)
SNDON SNDOFF
05 (11:00000000)
CDON CDOFF 06 (01:00010000)
07 (34:00110100)
CKCHG352 CKCHG320 08 (28:00101000)
09 (03:00000011)
RESENAB RESDISA 10 (0F:00001111)
11 (2F:00101111)
NMIREQ INTBACK 12 (00:00000000)
13 (00:00000000)
SETSMEM SETTIME 14 (00:00000000)
15 (00:00000000)
MASTER SH2' ON 00
1. Command Menu
A list of the commands issued to the SMPC is displayed here. Select the command
to be issue from them.
12
7.2 SMPC Command Test Operation
The command test operation is nearly the same as that of the main menu. Select a
command using the + key and enter it using the A or C button.
Press the B button to return to the main menu. Do not press the C and START but-
tons at the same time.
SATURN CartDev
Rev. B
Hardware Installation
Guide
Doc. # CART-08-030195
Configuration 1
Interface Cable
AC Power
SEGA CartDev Cable
5V Power
Supply/Cable
Figure 1
Saturn NMI Cable
AC Power
Cable
Seepage
See page 43 for
for NMI
NMI
cableconnection
cable connection
instructions
instructions
Interface Cable
TM
Programming Box
NMI Cable
SegaCartDev 5V Power
Supply/Cable
Figure 2
1 2
Figure 3
Figure 4
3
Connector CN8
NMI Cable
Figure 5
TM
Front RESET
STATUS
1
POWER
1
DC IN
+9.2V/1.2A
SCSI TERM SATURN CONTROL
SCSI INTERFACE AUX
Back -GND ID 1
Figure 6
6. Turn Saturn (or Programming Box) power off prior to turning CartDev power off.
When developing CD-ROM software for the Saturn, note the following restriction:
The duty ratio of the Saturn CD drive must be 33% or less after approximately
10 minutes.
• Duty Ratio Definition: Duty ratio = [seek time/(seek time + nonseek time)] x 100
Note: Nonseek time refers to the time used for operations other than seek (such as play
or pause).
SEGA SATURN TECHNICAL BULLETIN #2
Reason:
In the Saturn, the digital-to-analog converter (DAC) at the final level controls the emphasis.
Therefore, when a preemphasized CD-DA is played, the sound output from the SCSP is
also deemphasized.
SEGA SATURN TECHNICAL BULLETIN #3
1. If any hardware and/or software other than those listed below are needed, approval
from Sega must be acquired first. Materials related to the approval process will be
distributed at a later date.
• Write-once writer
- Yamaha CD Expert CDE 100
• Media
- Sega private media: Model number CDM12PS71 (with Sega Saturn logo)
- Sega MEGA CD-R 1.25 m/s (blue-labeled disc with Sega logo for MEGA-CD)
Note: The product names and model numbers provided above are those sold by the
distributors.
2. The following is a sample Script file for building a write-once SEGA Saturn CD.
Please note that the first file in the script MUST be named 0.
Disc SAMPLE.DSK
CatalogNo 0
Session CDROM
LeadIn MODE1
EndLeadIn
SystemArea IP.BIN
Track MODE1
Volume ISO9660 SAMPLE.PVD
PrimaryVolume 0:2:16
EndPrimaryVolume
EndVolume
File 0
File A.BIN
FileSource TEST.BIN
EndFileSource
EndFile
File SDDRVS.TSK
FileSource SDDRVS.TSK
EndFileSource
EndFile
File NEWMAP.TSK
FileSource NEWMAP.TSK
EndFileSource
EndFile
Directory SMPD101
File SMP001.DAT
FileSource SMP101.DAT
EndFileSource
EndFile
File SMP002.DAT
FileSource SMP002.DAT
EndFileSource
EndFile
EndDirectory
Directory SMPD102
File SMP003.DAT
FileSource SMP003.DAT
EndFileSource
EndFile
EndDirectory
PostGap 300
EndTrack
Track CDDA
Pause 150
File CDDA1
FileSource SND8_1.DAT
EndFileSOurce
EndFile
EndTrack
Track CDDA
File CDDA2
FileSource SND8_3.DAT
EndFileSource
EndFile
EndTrack
LeadOut CDDA
Empty 300
EndLeadOut
EndSession
EndDisc
SEGA SATURN TECHNICAL BULLETIN #4
When creating a CD-ROM for Saturn, always execute a read retry to ensure that there are
no data errors. (Mandatory)
Explanation:
Although CD-ROMs have a high error correction ability, uncorrectable errors may occur
due to drive deterioration, scratches or dust on the disc, or an eccentric disc.
Therefore to ensure that there are no data errors, in addition to implementing the "method
for increasing the ECC count," always execute a read retry.
However, note that executing a retry during debugging may obscure error causes.
SEGA SATURN TECHNICAL BULLETIN #6
The following table lists system libraries and object files for security codes and area code
groups that are provided by SEGA. Use these files without any modifications when
accessing resources for the items listed in the table.
• For details on each function, see the "Disc Format Standard Specification V.1.0 (ST-
040-R3-011805, 12/94)" and the "Saturn System Library User's Manual Version 1.0
(ST-162-R1-092994)" in the "Programmer's Guide Volume 1."
SEGA SATURN TECHNICAL BULLETIN #7
The standard specifications for the Sega Saturn disc format will be changed as follows:
• The first frame and first sector must be the times shown above. The last sector and
last frame must the times shown above or smaller values.
2. The following figure is an image of the tracks when the data track is maximized
(audio track is minimized).
Lead-in Lead-out
TNO 00 01 02 AA
X 00 01 00 01 01
A/D Data Data Audio Audio
TIME
63:04:00
00:02:00 63:00:00
(first sector) 62:58:00
00:00:00 62:56:00 (start of post gap)
• The portion of the track that can actually be used as the data sector is from the first
sector to one sector before the start of the post gap (approximately 566 megabytes).
For each minute that the audio track usage time increases, the data sector decreases
by 9 megabytes.
SEGA SATURN TECHNICAL BULLETIN #8
This Saturn technical bulletin is an update to the Saturn “CD Communication Interface User’s
Manual Version 0.9 “, which can be found in the “System Library User’s Guide (ST-162-
060294).”
CD Communication Interface: Supplemental Material
♦ Errata
Page Location Error Correction
41–42 Figures 5.1, MPEG buffer MPG sector buffer
5.2
44 Figure 5.5 ∑ Np ∑ Np
p=20 p=0
77 No. 1.5 WAIT results in <OPEN> or WAIT is returned during TOC
No. 1.6 <NODISC> status. read. In <OPEN> or <NODISC>
status, all information that can be
obtained becomes FFFFFFFFH.
78 No. 1.7 Standby time (lower 8 bits) Standby time (lower 16 bits)
82 No. 2.1 (3) Move the pickup */ Do not move the pickup */
85 No. 3.2 Subcode flag (lower bit) Subcode flag (lower 8 bits)
94 No. 6.6 (3) Becomes CDC_SOPS_END. Becomes CDC_SPOS_END.
100 No. 8.4 CdcFile file[256] CdcFile file[254];
Example
• Page 31
(3) Periodic response
The periodic response is the response that the CD block returns based on the CD drive
communication timing. This response allows the host to obtain information (status and CD report)
without issuing a command.
The communication cycle with the CD drive is updated periodically. (The update timing for the
SCDQ flag is the same.)
• Standard-speed play: 13.3 ms
Update cycle for the periodic response • Double-speed play: 6.7 ms
• Other: 16.7 ms or less
The periodic response is not updated during command or response processing. After a response is
read by a command, the response is updated at the next CD drive communication timing and can be
obtained.
[Note]
The update cycles shown here for the scheduled response (SCDQ flag) are the normal values. The
update cycles may increase depending on the CD drive and other communication conditions (for
example if communication with the CD drive fails because of disc scratches).
• Pages 37 to 38
4.2 CD Drive Operation
The frame address (current FAD) reported during CD play indicates the sector being read. The
sector of the current FAD is not yet stored in the CD buffer and cannot be fetched. The host can
access the sector immediately preceding the current FAD (for a CD-ROM).
After play ends, the FAD becomes the "end position + 1." (If the end position is disc end, the
same processing occurs and the FAD points to the lead-out area.)
When the status is switched from <PLAY> to another status, whether the sector being read is
stored is undefined. If the status is switched to a status other than <BUSY>, the sector that should
be stored is fixed.
At <PLAY> status, issue the PAUSE command. When the status switches to <PAUSE>, the
FAD indicated by the "storage sector + 1" is reported.
As described below, repeat processing takes place when the current position moves out of the play
range during CD play.
• After the end position frame is played (FAD = end position + 1)
• If the FAD ends up outside the play range after the play range is changed
• If pause release (play restart) is executed while the pause is outside the play area
Both the repeat notification count (0H to EH) and the maximum specification count (OH to FH) are
displayed with 4 bits. The repeat processing sequence (repeat processing determination) is as
follows:
(a) If the repeat count is less than the maximum repeat count, repeat is performed. The CD
drive seeks the start position and switches to <PLAY> status. If the repeat count is less than EH
(14), the repeat count is incremented by 1.
(b) If the repeat count is greater than or equal to the maximum repeat count, repeat is not
performed. The <PAUSE> status occurs at the current position, and the PEND flat of the interrupt
cause register becomes 1.
If the play range or maximum repeat count is changed, the repeat count is cleared to 0. Both the
repeat count and the play range are not affected by tray opening/closing or a seek operation during
play.
(4) Play range and frame address
If the user executes CD play without moving the pickup, operation switches to <PLAY> status is
the current position is within the new play range. If the user executes CD play during <PLAY>,
operation remains in <PLAY> status.
The FAD moves outside the play range (FAD < start position, FAD > end position) when the
following operations are performed:
• When play end, play range modification, seek, or scan play is executed
• When pause release is executed while the pause is outside the play area
The operation outside the play range depends on whether or not there is a repeat.
For example, if play ends without a repeat, operations switches to <PAUSE> status at "FAD=end
position + 1," and the PEND rank switches to 1.
This modification changes the function specifications. The function value CdcRet becomes Sint32
and returns an error code. If the status is necessary when the command is issued, use the
"previous CD status information retrieval" function (CDC_GetLastStat).
<Program Corrections>
Implement the following corrections:
Before correction After correction
CdcRet ret; Sint32 ret;
CDC_RET_ERR(ret) ret
CDC_RET_STATUS(ret) CdcStat stat;
Execute CDC_GetLastStat(&stat);
and reference
CDC_STAT_STATUS(&stat).
[NOTE]
The standard speed for the CD-ROM data read speed cannot be specified.
• Page 100
Title Function Function Name [S-] No.
Function Gets the scope of the file information being CDC_GetFileScope 8.3
specification held
This flag reports that the scope of the file information being held includes the last directory record
in the directory block. This flag can be used to determine whether there are subsequent directory
records.
[Remark]
Because a file always has its own directory and a parent directory, these two directories are not
included in the file information count.
• Page 102
Title Function Function Name [--] No.
Function Gets the data transfer register pointer CDC_GetDataPtr 9.1
specification
Data accessed in long word units is stored in upper word-lower word sequence. When an odd-
number of words are transferred, the last work of the last long word access is undefined.
• Page 103
Title Function Function Name [--] No.
Function Gets the MPEG register pointer CDC_GetMpegPtr 9.6
specification
The access methods for the MPEG register are the same as for the data transfer register. For notes
on this function, see the notes for getting the data transfer register pointer.
SEGA SATURN TECHNICAL BULLETIN #9
The size value displayed in the SEGA Saturn Memory Manager must be calculated in the
following manner:
Although there is no name given for the “Size” value shown in the Memory Manager,
ALWAYS use the term “block” as the unit of measure when referring to this value within
an application.
(3) Important !
The size of a file stored in a SEGA Saturn storage device varies depending on the device
type (such as the internal backup RAM, backup RAM cartridge, and other memory
expansion peripherals such as the SEGA Saturn floppy disc drive). Because of this, there
will be cases when the “Size” value that was increased and the “Memory Available” value
that was decreased do not match. That is, the total sum of the “Size” values and the
“Memory Available” value do not match with the total available memory size.
SEGA SATURN TECHNICAL BULLETIN #1 0
This material describes restrictions and notes that results from changes to the SCU
specifications. Be sure to read this material as it contains important information.
Note
This material supplements the "SCU User's Manual /Ver. 2(ST-097-R3-052594)" in the
"Hardware Manual Volume 1," which you should already have. Please file this material
together with that manual.
SEGASATURN
Ver. 1
This document describes specification changes and notes related to the SCU of SEGA
SATURN. This information is not included in the current distribution of the "SCU User's
Manual /Ver. 2(ST-097-R3-052594)." Therefore be sure to compare the contents of the
current manual with the information presented in this document, and note the changes.
[Modification History]
Execute write-access to the VDP1 register in word (2-byte) units. Access in long word (4-
byte) and byte units is prohibited.
The only WORKRAM that the SCU-DMA can use is WORKRAM-H (SDRAM: 1
megabyte). The SCU-DMA cannot use WORKRAM-L (DRAM: 1 megabyte).
When accessing SCU registers, always use cache-through addresses. If cache addresses
are used, a read-prohibited register may be accessed because the CPU operates as follows
when the cache is full:
Read and write to unused areas are prohibited. Read and write are prohibited especially for
address 25FE00ACH.
When data is written to the interrupt status register, the bit that should be raised to indicate
an error occurrence is sometimes not raised. For this reason, write to the interrupt status
register is prohibited.
No. 08 A-bus and B-bus access from CPU prohibited during DMA operation of A-bus B-
bus
Access to the A-bus and B-bus from the CPU is prohibited during DMA operation of the
B-bus from the A-bus or DMA operation of the A-bus from the B-bus. The reason is that
the system may hang during wait state even when SDRAM refresh does not occur.
The A-bus advance read function was deleted. Set the following register bits, which are
described in Ver. 2 (5/31/94) of the current manual, to 0:
• A-bus setting register [CS2, reserved space] (address: 25FE00B4H; register: ASR1)
→ Set bit 31 and bit 15 to 0.
No. 10 Address change for A-bus interrupt acknowledge register (address 25FE00A8H)
The address for the A-bus interrupt acknowledge register was changed to 25FE00A8H.
This change is implemented in Ver. 2 (5/31/94) of the current manual.
Data can be written to the A-bus setting registers only when the A-bus is not being
accessed. Before writing to the A-bus setting registers, first execute a dummy read of the
A-bus.
No. 12 Activation of A-bus B-bus from SCU-DMA on standby during CPU write to A-bus
or B-bus
Write processing to the A-bus and B-bus from the CPU has priority over SCU-DMA
activation between the A-bus and B-bus. For example, if the A-bus executes SCU-DMA
activation for VDP2 (B-bus) while the CPU is executing a continuous write to VDP1 (B-
bus), SC-DMA is not activated until the continuos write ends.
However, during SCU-DMA activation, CPU access to the A-bus and B-bus is queued.
Address setting values for a terminated DMA and the function that returns the level 0, 1, or
2 status were deleted.
Part of this specification change is implemented in the Ver. 2 (5/31/94) of the current
manual. (Read address, write address, and transfer byte count for a terminated DMA have
been deleted.)
The function of the DMA forced termination register was deleted. Do not write to this
register.
If the transfer byte count of the DMA transfer register is read, the read value is not
guaranteed. This register is a write-only register and cannot be read.
No. 16 Restriction on read address addition value for DMA based on access address
The values that can be set to the read address addition value differ depending on the address
to be accessed. This specification applies also to the DMA instruction of DSP.
External area 4 (A-bus I/O area) → Values 0B and 1B can be set.
Other areas → Only value 1B can be set.
When the read address update bit (*1) is 1, the read address addition bit (*2) must be 1.
No. 18 Restriction on write address addition value in DMA based on access address
The values that can be set to the write address addition value differ depending on the
address to be accessed. This specification applies also to the DMA instruction of DSP.
WORKRAM-H → Value 010B can be set.
External areas 1 to 3 → Value 010B can be set.
External area 4 (A-bus I/O area) → Values 000B and 010B can be set.
VDP1, VDP2, SCSP → All values can be set.
No. 19 Value of address addition value bit when write address update bit is set in DMA
When the write address update bit (*1) is 1, the write address addition value bit (*2) must
be set according to the bus space to be accessed, as follows:
External areas 1 to 4 (A-bus) → Set 010B.
VDP1, VDP2, SCSP (B-bus) → Set 001B.
WORKRAM-H (C-bus) → Set 010B.
Up to two channels can be used concurrently with the DMA priority sequence guaranteed.
If three channels are used concurrently, the priority sequence is ignored. (The DMA
instruction of DSP is counted as a channel.)
No. 21 Specification changes to DMA activation method
The DMA activation method was changed, and DMA enable bits were added.
Activation cause DMA activation condition
000 Enable bit =1 and VBLANK-IN
001 Enable bit =1 and VBLANK-OUT
010 Enable bit =1 and HBLANK-IN
011 Enable bit =1 and timer 0
100 Enable bit =1 and timer 1
101 Enable bit =1 and SCSP request
110 Enable bit =1 and script draw termination
111 Enable bit =1 and DMA activation bit = 1
These changes have been implemented to Ver. 2 (5/31/94) of the current manual.
No. 22 Specifications for DMA activation triggers that occur during DMA execution
If a DMA activation trigger occurs during DMA execution, the trigger is held until the DMA
being executed ends. Then the held activation is executed.
For example, if H blank is set to activate DMA and a data size larger than can be transferred
in one line (up to the next H blank) is set, operation becomes unstable.
When executing this type of DMA execution, be sure to check the data size to be
transferred.
The selection register for DMA mode, address update, and activation factor (*1) and the
DMA set register (2) cannot be rewritten during DMA activation of the corresponding level.
If either of these registers is rewritten, the system hangs.
*1 Selection register for DMA mode, address update, and activation factor
Address level 0 25FE0014H, level 1 25FE0034H, level 2 25FE0054H
No. 24 Nonoccurrence of illegal DMA interrupt during DMA execution in indirect mode
The DMA illegal interrupt status bit (bit 12) of the DMA status register (address
25FE00A4H) is not issued during DMA execution in indirect mode.
When using the DMA in indirect mode, do not reference the DMA illegal interrupt status
bit.
No. 25 Specification changes for DMA indirect mode table
The specifications for the DMA indirect mode table were changed as follows:
[Changes]
• The table structure was changed from a 4-long word structure to a 3-long word
structure.
• The read and write addresses were reversed.
• Based on the table size (n × 12 bytes), the table start addresses (m value in the figure
below) must be placed on a 32-, 64-, 128-, 256-, 512-, 1024-, ...- byte boundary. An
example is shown below.
• Table size is 24 bytes or less: Place the start address on a 32-byte boundary.
• Table size is 252 bytes or less: Place the start address on a 256 byte boundary.
• Table size is 1020 bytes or less: Place the start address on a 1024-byte boundary.
• Always set 1 to bit 31 of the final (nth) read address.
When activating DSP, set 0 to the program termination interrupt flag (bit 18: E) of the DPS
program control port (address 25FE0080H). When the flag is 1, the DSP program
termination interrupt is not issued even if the DSP program is terminated with the ENDI
instruction.
No. 27 Restriction on address addition value during DSP DMA instruction transfer from B-
bus to DSP data RAM
When a DSP DMA instruction (DMA or DMAH) is used to transfer data from the B-bus to
the DSP data RAM, the address addition value must be 010B.
No. 28 Delay in DMA activation startup if break is executed during debugging with ICE
The SCU-DMA operates only when the CPU is operating. If a break occurs during
debugging on the ICE, start of SCU-DMA operation is delayed. When the ICE execution
status is parallel mode (prompt is #), the SCU-DMA operates normally.
When using the SCU-DMA under an ICE, set E (always enabled) as the input state of the
BREQ (bus permission request) signal of the EXECUTION_MODE (EM) command.
In the ICE E7000 system, no change is necessary because the BREQ default is E.
Although 10 data bits can be set to the register, an interrupt will not occur if improbable
data is set. Always set a value in the usable range.
For NTSC non-interlaced (one screen 263 lines, effective screen 224 lines), for example,
interrupts occur as follows:
T0C9-0 = 1 → Interrupt occurs at the beginning of the HBLANK-IN immediately
before the first line of the effective screen.
T0C9-0 = 2 → Interrupt occurs at the beginning of the HBLANK-IN immediately
before the first two lines of the effective screen.
T0C9-0 = 224 → Interrupt occurs at the beginning of the HBLANK-IN immediately
before the last line of the effective screen.
T0C9-0 = 225 → Interrupt occurs at the beginning of the HBLANK-IN immediately
after the effective screen ends.
T0C9-0 = 263 → Interrupt occurs at the beginning of the HBLANK-IN immediately
before the line preceding the effective screen.
T0C9-0 = 264 to → Interrupt does not occur.
1023
T0C9-0 = 0 → Interrupt occurs at the same timing as VBLANK-OUT.
No. 31 Notes on using the timer 1 set data register (address 25FE0094EH)
The value of the timer 1 set data register is loaded to timer 1 when both of the following
conditions are satisfied: timer 1 is stopped and HBLANK-IN occurs.
If a data value larger than the number of counts in one line is set to the timer 1 set data
register, a timer 1 interrupt no longer occurs at each line.
[Range for number of counts]
If one line is 320 dots: 1 to 1AAH
If one line is 352 dots: 1 to 1C6H
If one line is 424 dots: 1 to D3H
If one line is 426 dots: 1 to D4H
(Note that if 0 is specified as the number of counts, the value becomes 512.)
No. 32 Notes on read access of A-bus and B-bus areas (2000000H to 5FFFFFFH)
In read access to the A-bus and B-bus area (2000000H to 5FFFFFFH), the internal CPU
operation is different from the external operation. Even if the SH2 executes read access in
byte or word (2-byte) units, the external operation becomes long word (4 -byte) access.
If byte-unit read of a continuous area is executed for the A-bus and B-bus area, processing
takes longer than byte-unit write.
In write access, the internal operation and the external operation are the same (If the area is
accessed in byte units, the external access is also byte access.
At power on reset, the initial value of the A-bus refresh output effective bit changes to
effective state (ARFEN=1). This bit should not be changed by the user.
At power on reset, the SDRAM selection bit is 2M bit × 2 (RSEL = 0). The bit must be
reset to RSEL = 1 so that the value changes to 4M bit × 2. This setting change is executd
within the boot ROM. User modification is not necessary.
A operation error may occur if DMA level 2 is activated during DMA level 1 activation. To
prevent such operation errors, do not activate DMA level 2 during DMA level 1 operation.
No. 36 Notes on reading the DSP program control port (address 25FE0080H)
When the DSP program control port is read, note that the following phenomena occur:
This report provides a material on the latest information on the boot system for the Sega
Saturn.
Notes:
1. The boot system information (Saturn Boot ROM Ver. 0.9 User's Manual [ST-
079B-R1-062294]; Rel.2 is printed in red) included in the current "Programmer's
Guide Volume 1/Disc Format Standard Specifications" is old and should not be
used.
2. After the distribution of the "Disc Format Standard Specifications (Rel. 3) (ST-
079B-R3-011895)," the information described in the standard specifications will be
the formal information.
Normal Info
Information type: If the current version has no bugs, it will also be used in
Software Library Release 4.
Introduction
This document prescribes conventions that must be followed when writing an application
software uses the boot system. CDs that do not follow these standards will not be
recognized as a Game-CD. All applications software that operate in this game system must
follow these standards.
1. System Area
The system area is that area that is located at the beginning of the CD-ROM.
The data written to the system area includes system information for application startup and
the initial program. These data items must be placed contiguously in the system area as the
initial program (IP). The IP consists of the boot codes and the application initial program
(AIP). The boot codes include IDs, such as the game name, and a security code. The AIP
includes code for the initial program.
Figure 1 IP structure
0 1 2 3 4 5 6 7 8 9 A B C D E F
00H Hardware identifier
10H Manufacturer ID
20H Product number Version
30H Release date Device information
40H Target area symbol Space
50H Compatible peripheral
60H Game name
70H
80H
90H
A0H
B0H
C0H
D0H Reserved
E0H IP size Reserved Stack-M Stack-S
F0H 1st read address 1st read size Reserved Reserved
3. System ID Description
• Conventions
Allowed characters
The characters that can be used in the system ID are all ASCII code alphanumeric
characters. For some items, the following characters can also be used: ., /, -, and :.
Unless otherwise indicated, both uppercase and lowercase characters can be used.
Entries
• Unless otherwise indicated, left-justify all entries. Do not add preceding spaces.
• Unless otherwise indicated, fill all unused spaces with ASCII code 20H.
Representation definition
In the following descriptions, "∆" and "space" represent ASCII code 20H.
Other
Fill reserved areas with 00H.
• Item Description
For a definition of fully compatible, see the pad check items in the "Software Creation
Standards."
Place the security code immediately after the system ID. SEGA provides the code an object
code. Use the code without adding any changes. The code contains a program and data
that display the SEGA license. If the application does not have a correct security code, it
will not be recognized as a Sega Saturn CD and the game will not start.
Name of security code presentation file: Directory contents after the software library disc is
installed
/SATURN/SEGALIB/LIB/ SYS_SEC.OBJ
5. Area Codes
Place the area codes immediately after the security code. SEGA provides these codes as
object codes. Use the codes without adding any changes. Although there are eight area
codes, one for each hardware sales area, enter the area codes for the "corresponding area
symbols" of the system ID. When specifying multiple area codes, the specification
sequences for the "corresponding area symbols" and the "area codes" do not need to match.
The area codes can be changed easily because each area code has the same size. Also a
common disc can be created to link multiple area codes. (See item 9, "Program Samples.")
Name of area code presentation file: Directory contents after software library disc
installation
The following table shows the relationships between the hardware sale areas, area codes,
and corresponding area symbols.
By using the application initial program and 1st read file effectively, you can create a highly
efficient application.
System ID check
IP load
AIP is loaded
• SYS_ID.SRC
This is the assembler sample source program for system ID creation. Modify this program
according to the application. (See item 3, "System ID Description.") Place this program at
the beginning of the initial program.
Name of sample presentation file: Directory contents after software library disc installation
/SATURN/SEGASMP/SYS/ SYS_ID.SRC
• SYS_SEC.OBJ
• SYS_ARE?.OBJ
Create the SYS_IP.BIN file by linking these files in the following sequence:
SYS_ID.OBJ, SYS_SEC.OBJ, SYS_ARE?.OBJ
;======================================================================
; smp_id0.src -- System ID for SEGA (Ver.1994-11-11)
;======================================================================
.SECTION SYSID,CODE,ALIGN=4
;
.SDATA "SEGA SEGASATURN " ;00:Hardware identifier (fixed)
.SDATA "SEGA ENTERPRISES" ;10:Manufacturer ID
.SDATA "GS-9099 V1.000" ;20:Product number, version
.SDATA "19941122CD-1/1 " ;30:Release date, device information
.SDATA "JTUBKAEL " ;40:Target area symbols
.SDATA "J " ;50:Compatible peripheral
.SDATA "GAME TITLE " ;60:Game name
.SDATA " " :70:
.SDATA " " :80:
.SDATA " " :90:
.SDATA " " :A0:
.SDATA " " :B0:
.SDATA " " :C0:
.DATA.LH'00000000,H'00000000,H'00000000,H'00000000 ;D0:
.DATA.LH'00001000,H'00000000,H'00000000,H'00000000 ;E0:
.DATA.LH'06010000,H'00000000,H'00000000,H'00000000 ;F0:
;
.END
;====== End of file ===================================================
.
;======================================================================
; smp_id1.src -- System ID for 3rd Party (Ver.1994-11-11)
;======================================================================
.SECTION SYSID,CODE,ALIGN=4
;
.SDATA "SEGA SEGASATURN " ;00:Hardware identifier (fixed)
.SDATA "SEGA TP T-999 " ;10:Manufacturer ID
.SDATA "T-99901G V1.000" ;20:Product number, version
.SDATA "19941122CD-1/1 " ;30:Release date, device information
.SDATA "JTUBKAEL " ;40:Target area symbols
.SDATA "J " ;50:Compatible peripheral
.SDATA "GAME TITLE " ;60:Game name
.SDATA " " :70:
.SDATA " " :80:
.SDATA " " :90:
.SDATA " " :A0:
.SDATA " " :B0:
.SDATA " " :C0:
.DATA.LH'00000000,H'00000000,H'00000000,H'00000000 ;D0:
.DATA.LH'00001000,H'00000000,H'00000000,H'00000000 ;E0:
.DATA.LH'06010000,H'00000000,H'00000000,H'00000000 ;F0:
;
.END
;====== End of file ===================================================
.
;======================================================================
; smpsys.lnk -- SH Linkage Subcommand File for IP (Ver.1994-11-11)
;======================================================================
Input sys_id_obj
Input ../ /segalib/lib/sys_sec.obj
Input ../ /segalib/lib/sys_arej.obj
Input ../ /segalib/lib/sys_aret.obj
Input ../ /segalib/lib/sys_areu.obj
Input ../ /segalib/lib/sys_areb.obj
Input ../ /segalib/lib/sys_arek.obj
Input ../ /segalib/lib/sys_area.obj
Input ../ /segalib/lib/sys_aree.obj
Input ../ /segalib/lib/sys_arel.obj
Input ../ /segalib/lib/sys_init.obj
Input smpsys.obj
STart SYSID(060020000)
Output sys_ip.abs
Print sys_ip.map
EXIt
;====== End of file ===================================================
.
;=======================================================================
; sample0.scr -- CD-ROM (Ver.1994-11-11)
;Note: Sample script for CD-ROM (MODE1 + CD-DA) disc
; For VCDPRE and VCDBUILD, use Ver. 3.10 or above
; R: Required.
; 0: Optional, can be omitted.
; N: Parameter cannot be modified. (Use without modification.)
; Y: Parameter can be modified.
; -: No parameter.
; The first word in each line is the command name.
; Do not change the command names.
;=======================================================================
Define dirsmpdisc ./sample/ ; O Y
Disc sample0.DSK ;R Y
Session CDROM ;R N
LeadIn MODE1 ;R N
EndLeadIn ;R -
;
SystemArea [dirsmpdisc]sys_ip.bin ;R Y
;
Track MODE1 ;R N
Volume ISO9660 sample0.PVD ;R Y
PrimaryVolume 00:02:16 ;R N
SystemIdentifier "SEGA SEGASATURN" ;R N
VolumeIdentifier "SAMPLE_GAME_TITLE" ;R Y
VolumeSetIdentifier "SAMPLE_GAME_TITLE" ;R Y
PublisherIdentifier "SEGA ENTERPRISES,LTD.";R Y
DataPreparerIdentifier "SEGA ENTERPRISES,LTD.";R Y
CopyrightFileIdentifier "SMP_CPY.TXT" ;R Y
AbstractFileIdentifier "SMP_ABS.TXT" ;R Y
BibliographicFileIdentifier "SMP_BIB.TXT" ;R Y
VolumeCreationDate 22/11/1994 00:01:02:00:36 ; O Y
VolumeModificationDate 22/11/1994 00:01:02:00:36 ; O Y
EndPrimaryVolume ;R -
EndVolume ;R -
;
File SMP_CPY.TXT ;R Y
FileSource [dirsmpdisc]smp_cpy.txt ;R Y
EndFileSource ;R -
EndFile ;R -
File SMP_ABS.TXT ;R Y
FileSource [dirsmpdisc]smp_abs.txt ;R Y
EndFileSource ;R -
EndFile ;R -
File SMP_BIB.TXT ;R Y
FileSource [dirsmpdisc]smp_bib.txt ;R Y
EndFileSource ;R -
EndFile ;R -
;
File FILE0.BIN ; O Y
FileSource [dirsmpdisc]file0.bin ; O Y
EndFileSource ; O -
EndFile ; O -
;
; File to EndFile ; O Y
;
PostGap 150 ;R N
EndTrack ;R -
;
Track CDDA ;R N
Pause 150 ;R N
FileSource [dirsmpdisc]sound0.da ;R Y
EndFileSource ;R -
EndTrack ;R -
;
; Track to EndTrack ; O Y
;
LeadOut CDDA ;R N
Empty 500 ;R N
EndLeadOut ;R N
EndSession ;R N
;====== End of file ====================================================
.
;=======================================================================
; sample1.scr -- CD-ROM XA (Ver.1994-11-11)
;Note: Sample script for CD-ROM XA (MODE1 + MODE2 + CD-DA) disc
; For VCDPRE and VCDBUILD, use Ver. 3.10 or above
; R: Required.
; 0: Optional, can be omitted.
; N: Parameter cannot be modified. (Use without modification.)
; Y: Parameter can be modified.
; -: No parameter.
; The first word in each line is the command name.
; Do not change the command names.
;=======================================================================
Define dirsmpdisc ./sample/ ; O Y
Disc sample1.DSK ;R Y
Session SEMIXA ;R N
LeadIn MODE1 ;R N
EndLeadIn ;R -
;
SystemArea [dirsmpdisc]sys_ip.bin ;R Y
;
Track MODE1 ;R N
Volume ISO9660 sample1.PVD ;R Y
PrimaryVolume 00:02:16 ;R N
SystemIdentifier "SEGA SEGASATURN" ;R N
VolumeIdentifier "SAMPLE_GAME_TITLE" ;R Y
VolumeSetIdentifier "SAMPLE_GAME_TITLE" ;R Y
PublisherIdentifier "SEGA ENTERPRISES,LTD.";R Y
DataPreparerIdentifier "SEGA ENTERPRISES,LTD.";R Y
CopyrightFileIdentifier "SMP_CPY.TXT" ;R Y
AbstractFileIdentifier "SMP_ABS.TXT" ;R Y
BibliographicFileIdentifier "SMP_BIB.TXT" ;R Y
VolumeCreationDate 22/11/1994 00:01:02:00:36 ; O Y
VolumeModificationDate 22/11/1994 00:01:02:00:36 ; O Y
EndPrimaryVolume ;R -
EndVolume ;R -
;
File SMP_CPY.TXT ;R Y
FileSource [dirsmpdisc]smp_cpy.txt ;R Y
EndFileSource ;R -
EndFile ;R -
File SMP_ABS.TXT ;R Y
FileSource [dirsmpdisc]smp_abs.txt ;R Y
EndFileSource ;R -
EndFile ;R -
File SMP_BIB.TXT ;R Y
FileSource [dirsmpdisc]smp_bib.txt ;R Y
EndFileSource ;R -
EndFile ;R -
;
File FILE0.BIN ; O Y
FileSource [dirsmpdisc]file0.bin ; O Y
EndFileSource ; O -
EndFile ; O -
;
; File to EndFile ; O Y
;
PostGap 150 ;R N
Endtrack ;R -
;
Track MODE2 ;R N
PreGap 150 ;R N
Extent ;R -
FileInterleave 13 ; O Y
File INTFILE0.BIN ; O Y
FileSource [dirsmpdisc]intfile0.bin ; O Y
EndFileSource ; O -
EndFile ; O -
EndFileInterleave ; O -
FileInterleave 13 ; O Y
File INTFILE1.BIN ; O Y
FileSource [dirsmpdisc]intfile1.bin ; O Y
EndFileSource ; O -
EndFile ; O -
EndFileInterleave ; O -
FileInterleave 13 ; O Y
File INTFILE2.BIN ; O Y
FileSource [dirsmpdisc]intfile2.bin ; O Y
EndFileSource ; O -
EndFile ; O -
EndFileInterleave ; O -
FileInterleave 13 ; O Y
File INTFILE3.BIN ; O Y
FileSource [dirsmpdisc]intfile3.bin ; O Y
EndFileSource ; O -
EndFile ; O -
EndFileInterleave ; O -
EndExtent ;R -
PostGap 150 ;R N
EndTrack ;R -
;
Track CDDA ;R N
Pause 150 ;R N
FileSource [dirsmpdisc]sound0.da ;R Y
EndFileSource ;R -
EndTrack ;R -
;
; Track to EndTrack ; O Y
;
LeadOut CDDA ;R N
Empty 500 ;R N
EndLeadOut ;R N
EndSession ;R N
;====== End of file ====================================================
SEGA SATURN TECHNICAL BULLETIN #12
Always use the BOOT ROM’s internal service routine when switching the
resolution in horizontal direction.
VBLANK bit of the screen status register (TVSTAT: 180004H) becomes valid, only when
DISP bit of TV screen mode register (TVMD: 180000H) is “ 1 “.
The storage areas for pattern name data in the scroll screen are restricted as follows,
regardless of whether the screen is a normal scroll screen or a rotation scroll screen:
Although the VDP2 must be used to display images with 16.77-million colors (VDP1 displays
only up to 32,768 colors), the drawback of using VDP2 is that the VRAM addresses are not
continuous when image data is transferred by the DMA.
This report explains in detail a technique for setting up continuous VRAM addresses for any bit
map size when VDP2 is used.
1. Principles: Page 1
• This section explains the principles used to implement a continuous address bit map of any
size.
2. Application: Page 5
• This section explains how the principles can be applied to move a bit map smaller than the
television screen to any position on the television screen.
3. Summary: Page 9
• Summary, notes, merits, supplement
VDP2 Bit Map
The minimum size of a VDP2 bit map is 512-dot (horizontal) × 256-dot (vertical). However,
when VDP2 is used with a demo, the VRAM addresses are not continuous when the DMA
transfers image data. Because of this drawback, many software applications use VDP1 (sprites).
However, VDP1 can only display pictures that have up to 32,768 colors. VDP2 must be used to
display pictures with 16.77 million colors.
This document explains how to use a VDP2 bit map and produce continuous VRAM addresses
with any bit map size.
1. Principles
This section explains the principles used to implement continuous addresses bit maps of any size.
For example, suppose that the bit map size is set at "512-dot (horizontal) × 256-dot (vertical)," and
the VRAM addresses continue from coordinates (0, 0) to (511, 0). The next address after (511, 0)
is (0, 1). To arrange a "320-dot (horizontal) × 224-dot (vertical) bit map into continuous
addresses, change the display coordinates for displaying the bit map on the screen as shown in the
following figure.
To implement the display coordinates shown in this figure, use the line scroll function and the
vertical cell scroll function. The explanations that follow assume the following: The size of the
VDP2 bit map is set to 512-dot (horizontal) × 256-dot (vertical), the horizontal direction of the
display bit map is a multiple of 8, the display start line is n=0, and the display start cell is w=0.
1) Horizontal coordinates
For horizontal display coordinates that change for each line, use the line scroll function and set the
horizontal display coordinates of the left end as the horizontal line scroll value.
The expression for calculating the horizontal line scroll value of line n is:
(Horizontal line scroll value of line n) = {00010000H × (horizontal size) × n} & 01ff0000H
2) Vertical coordinates
For vertical display coordinates that change for each line or in the middle of a line, combine the line
scroll function and the vertical cell scroll function.
First, set the vertical cell scroll value so that the fraction portion of the display coordinate value
calculated from the scroll value is discarded and the vertical display coordinate increases by 1 in the
middle of the line. The expression for calculating the vertical cell scroll value of cell w is:
(Vertical cell scroll value of cell w) = 00000400H × w
Next, set the vertical line scroll value based on the vertical cell scroll value. Calculate the vertical
line scroll value as follows:
Step Ι: Calculate the integer portion I(n) of the vertical display coordinate value for line n.
I (n) = {00000080H × (horizontal size) × n} & 01ff0000H
Step II: For line n, calculate the cell number m at which the vertical display coordinate value
increases by 1.
A(n) = 64 {(I(n)/00010000H) + 1}
B(n) = {(horizontal size)/8} × (n + 1)
If A(n) ≥ B(n): m = 64
If A(n) < B(n): m = A(n) - B(n-1)
Step III: Calculate the vertical line scroll value for line n.
(Vertical line scroll value for line n) = I(n) + {00000400H × (64 - m)}
3) Setting example
This item explains in detail a setting example in which a full-screen, full-color bit map (NBG0,
320x224, 16.77 million colors) is displayed and the VRAM addresses become continuous.
• Bit map leading address = 25E00000H
• Line scroll table address = 25E60000H
• Vertical cell scroll table address = 25E70000H
This section explains how to use the principles described in the previous section to place a bit map
smaller that the TV screen at any location on the TV screen.
The easiest way to place a bit map at any location on the TV screen is to use the screen scroll
function. However, simply scrolling the screen does not produce good results because the
following two problems occur:
These two problems can be corrected by using the window function and changing the calculation
expression for line scroll values.
1) Window function
Problem I can be corrected easily with the window function. At the location where the bit map is
to be displayed, set a transparent processing window of the same size as the bit map, and validate
the outside of the window.
Step i: Calculate the horizontal line scroll value for line My+n.
(Horizontal line scroll value) = {00010000H × (horizontal size) × n} & 01ff0000H
Step ii: Calculate the integer portion I(n) of the vertical display coordinate value for line My+n.
I(n) = {00000080H × (horizontal size) × n} & 01ff0000H
Step iii: For line n of the display bit map, calculate cell number m at which the vertical display
coordinate value increases by 1.
A(n) = 64 × {(I(n)/00010000H) + 1}
B(n) = {(horizontal size)/8} × (n + 1)
If A(n) ≥ B(n): m = 64
If A(n) < B(n): m = A(n) - B(n-1) + (rounded up value of Mx/8)
Step iv: Calculate the vertical line scroll value for line My+n.
ii Set the values calculated from the calculation expression into the vertical cell scroll table.
iii Set the values calculated from the calculation format into the line scroll table.
iv Set the back screen table (25E7FFFEH) to black (0000H).
This setup produces a continuous address bit map of 192-dot (horizontal) × 144-dot (vertical). In
this example, VRAM-A and VRAM-B can be configured as double buffers because the bit map
data fits into one bank. However, in this case, the vertical cell scroll table must be set in both
VRAM-A and VRAM-B because it must be set in the side that is not the display VRAM.
3. Summary
Described below is the procedure for displaying a continuous address bit map of a specific size at
any location on a TV screen. However, the horizontal size of the display bit map must be a
multiple of 8.
(Horizontal line scroll value for line My+n) = {00010000H × Sx × n} & 01ff0000H
(Vertical line scroll value for line My+n) = I(n) + {00000400H × (64 - m)}
5) Merits
• The amount of VRAM that must be allocated to bit map data can be kept to a minimum.
• The VRAM addresses become continuous, regardless of the specified number of bit map
colors.
• For bit map data of 16.77-million colors that fits in one bank or bit map data of 32,768 colors,
the VRAM can be configured as a double buffer, which allows pictures to be updated even
when they are displayed.
6) Comments
• The window setup is not necessary for a full-screen display.
• If the horizontal size of the display bit map is 8-dot, 16-dot, 32-dot, 64-dot, 128-dot, or 256-
dot, the vertical cell scroll is not necessary. Also, calculation of the vertical line scroll value is
simplified.
SEGA SATURN TECHNICAL BULLETIN #15
The following is a correction for page 79 of the VDP1 User’s Manual Version 1(2/20/94):
Error: Position of “clipping mode bit” and “user clipping valid bit” is different in the
drawing and the explanation.
bit 10 9
bit 10 9
MOV [ s ], [ d ] transfer([source]->[destination])
•••
operation
discription (function) •••
instruction code
bit Data
1 0 1 0 [ALU HIGH]
Note that some of the specifications for the mission stick differ from the specifications for
the trail-version analog joy stick.
• 1. The digital RLDU stick was discontinued. The digital RLDU returns a value
according to the analog stick (see figure below).
• 2. The mission stick features a center-adjust function. When the power is turned on,
the stick position is automatically assumed to be the center (=128). Structurally,
however, the center may shift after extended use.
In addition, if the stick is intentionally tilted when the power is turned on, it will not
operate properly because of this center-adjust function. This item will be added to the
operating instructions as a note.
• 3. For X, Y, and Z of the mission stick, a minimum value of 0 and a maximum value
of 255 are guaranteed. The minimum and maximum values are output before the
mechanical movement limits.
The following function is used to register a default interrupt processing routine that cancels
the registration of a previously registered interrupt processing routine:
SYS_SETSINT(Num, 0);
If this function is used from the slave SH, the correct default is not written to the
corresponding vector in the slave vector table of vector number Num.
When registering a default from the slave SH, do not register a default that specifies 0 as
the address.
There are no problems operating a slave or master vector table from the master SH.
To return a slave vector to the default registration, use the following methods:
The file system initialization function (GFS_Init) executes the CD block initialization
function (CDC_CdInit) to set the ECC and retry counts to the maximum values. The actual
settings are as follows:
• Initialization flag: Default value
• Standby time: Default value
• ECC count: 5
• Retry count: 15
CDC_CdInit(0, 0, 5, 0x0f);
To change these settings when using GFS, call GFS_Init, then execute the CDC_CdInit
function. The program can be specified so that only the target parameters are changed
while the other parameters remain the same.
• Program example
#include "sega_gfs.h"
Sint32 sampleInit(void)
{
Sint32 ret;
The following information lists corrections to the Saturn “Program Library User’s Guide 1
(ST-136-R2-093094)”.
• Errata
Page Location Error Correction
11 Example in OpenByName(Uint8 *fname) OpenByName(Sint8 *fname)
3.4
23, 27 No. 2.6 GFS_TRANS_... GFS_TMODE_...
30 No. 3.4 GFS_DIR_FNAME(dir) Uint8[] GFS_DIR_FNAME(dir) Sint8[]
34 No. 1.4 GFS_NameTold(Uint8 *fname) GFS_NameTold(Sint8 *fname)
34 No. 1.5 const Uint8 *GFS_IdToName Sint8 *GFS_IdToName
35 No. 2.3 off ofs
36 No. 2.7 (does not include last sector) (includes last sector)
Output
37 No. 3.1 off ofs
39 No. 4.2 GFS_NwIsCompleted function GFS_NwIsComplete function
Remark
40 No. 4.6 GFS_EXEC_... GFS_SVR_...
49 C.2 (3) GFS_ATR_FORM1 0 x 80 GFS_ATR_FORM1 0 x 08
[Remark] In files containing both Form1 and Form2, both sctsize and lastsize become
0.
If an error occurs with the GFS_Init or GFS_LoadDir function, perform the corrective
action described below. A program sample is shown on the following page.
To handle these errors, set up a recovery processing as shown in the program sample in the
attachment. In the recovery processing, issue the PAUSE command, wait for the
<PAUSE> status, and then reissue the function. Set the number of execution repetitions to
at least 3.
If the error persists even after the repeated executions, there may unrecoverable scratch on
the disc. Display a message or switch to the multiplayer.
With the product version, the only corrective action is to switch to the multiplayer.
• Program Example
# include "sega_cdc.h"
Sint32 recovGfsInit(void);
Sint32 waitStat(Sint32 sts);
/* Recovery processing for GFS_Init and GFS_LoadDir */
Sint32 recovGfsInit(void)
{
Sint32 ret;
CdcPos pos;
/* Issue PAUSE command */
CDC_POS_PTYPE(&pos) = CDC_PTYPE_NOCHG;
ret = CDC_CdSeek(&pos);
if (ret != CDC_ERR_OK) {
return NG;
}
/* Wait until <PAUSE> status */
ret = waitStat(CDC_ST_PAUSE);
return ret;
}
The following table shows the specifications of the horizontal resolution settings for VDP1 and
VDP2.
VDP2 setting (HRESO value) VDP1 setting (TVM value) Setting status
Normal mode Normal (000) Enabled
(000 or 001) High-resolution (001) Disabled
Rotation 16 (010) Enabled
Rotation 8 (011) Enabled
HDTV (100) Disabled
High-resolution mode Normal (000) Enabled *
(010 or 011) High-resolution (001) Enabled
Rotation 16 (010) Enabled *
Rotation 8 (011) Enabled *
HDTV (100) Disabled
Dedicated monitor mode Normal (000) Disabled
(100, 101, 110, or 111) High-resolution (001) Disabled
Rotation 16 (010) Disabled
Rotation 8 (011) Disabled
HDTV (100) Enabled
Note: The asterisks in the table indicate combinations for which the specification has changed.
SEGA SATURN TECHNICAL BULLETIN #23
The following graphics will be displayed by the interlace setting of VDP2 (LSMD bit) and
VDP1 (DIE bit):
00 0 non-interlace non-interlace
10 0 single-density single-density
interlace interlace
1 single-density double-density
interlace interlace
11 0 double-density single-density
interlace interlace
1 double-density double-density
interlace interlace
SEGA SATURN TECHNICAL BULLETIN #24
The following cautionary items are to be noted when changing from VDP2’s TV screen
mode to high-resolution mode:
• Normal scroll screen (NBG 0~3) is displayed as if a normal mode picture is reduced by
half, in the horizontal direction.
• Rotational scroll (RBG 0, 1) can be displayed, however, the picture resolution will be the
same as the normal mode’s.
• VRAM cycle pattern register becomes valid only for T0~T3, and becomes invalid for
T4~T7.
• Expanded color calculation function and blur (gradation) calculation function is not
available.
SEGA SATURN TECHNICAL BULLETIN #25
When palette-format sprites are used, the picture may not be displayed for certain palette codes and
color bank values. The picture is not displayed because the dot data is processed as dot data
(normal shadow data) for the VDP2 shadow function. The table on the next page shows the sprite
data that is processed as normal shadow data for each sprite type set in VDP2.
For details on this topic, see Section 6.4, "CMDCOLR (Color Control Word)," in the VDP1
Hardware Manual (ST-013-R3-052794) and Section 14.1, "Shadow Processing," in the VDP2
Hardware Manual.
In order to get the directory information from the directory information table in the file
system library, the following function is to be used. The following function is available
and can be used from the ver1.10 (Disk ver 11/11/94) of the Software Library.
When in monoral or language setting, the following limitations have to be followed. As for
the method and reference of the setting values, please refer to the “Programmer’s Guide /
System Library User’s Guide / SMPC I/F User’s Manual.
3. Important !
The user setting contents which are set by the following multiplayers must not be changed
from within the application.
This manual explains how to use two CPUs (SH2) in the SEGA SATURN.
When the SEGA SATURN is activated, it operates with only the main CPU. To
activate the slave CPU, perform the procedures explained in this manual.
This manual is intended for readers who have a general knowledge of the SEGA
SATURN hardware and software. When reading this manual, use the following
manuals as references:
• “SH7095 Hardware Manual”
• “SCU User ’s Manual (Hardware Manual Vol. 1)”
• “System Program User’s Manual (Programmer’s Guide Vol. 1 System Library)”
• Software library document files
(See MANSYS.DOC in /SATURN/SEGALIB/MAN.)
• “SEGA SATURN Target Box User’s Manual” (shipped with the Target Box)
This section gives an overview of dual CPU operation in the SEGA SATURN.
2.2 Dual CPU Communications Using the Free Running Timer (FRT)
One of the ways the master and slave CPUs communicate in the SEGA SATURN is
by using the input capture signal of the free running timer (FRT) in an internal SH2
on-chip module.
Specifically, the FRT input capture signal can be input to the slave CPU by writing
any 16-bit value to address 21000000H. The FRT input capture signal can also be
input to the master CPU by writing any 16-bit value to address 21800000H.
With the first method, the performance of the master CPU may drop
because an external address (VDP2 address) is accessed.
➁ Using the interrupt mask when control is returned
To prevent reception of the same interrupt, use the interrupt mask that
was saved in the stack and do not return the interrupt mask during the
blank period even after the interrupt function returns control.
Timer interrupts must be used to implement this method. However, when
the H-blank-in and V-blank-in timer interrupts are used, the internal
interrupt must be set to a higher level than the timer interrupts.
2
3. Setting Up a Development Environment for Dual CPU Operation
This section describes how to set up a development environment for dual CPU
operation as well as debug methods.
: mode;c(RET)
E7000 MODE(MD5-0)=xx? 2E(RET)
MODE SET (C:CONFIGURATION/U:USER/M:MASTER-SLAVE)=X? C(RET)
CONFIGURATION WRITE OK?(Y/N)? Y(RET)
[Release method]
: m 2010001f;b(RET)
2010001f xx ? 02(RET)
20100020 xx ? .(RET)
The above set up starts the EVA board connected to the slave CPU.
4
4. Programming with a Slave CPU
(2) The slave CPU vector table in work RAM is not modified when the slave SH2 is
turned on or off.
6
6. Data Transfer Between the Master and Slave CPUs
The SH2 CPU cache unit does not have a snoop function. To transfer data between
the master and slave CPUs, execute a cache-through read from the CPU that reads
the data, or execute read after purging the cache of the target area. (For details on
the cache, refer to chapter 8, “Cache,” in the “SH7095 Hardware Manual.”)
This section shows a sample program that uses the slave CPU. The program demon-
strates the use of the FRT input capture flag polling.
7.1 Initialization and Activation Functions for the Slave CPU
The following program uses functions that initialize and activate the slave CPU and is
executed in the master CPU.
volatile Uint8 *SMPC_SF =(Uint8 *)0x20100063; /* SMPC status flag */
volatile Uint8 *SMPC_COM =(Uint8 *)0x2010001F; /* SMPC command register */
const Uint8 SMPC_SSHON = 0x02; /* SMPC slave SH on command */
const Uint8 SMPC_SSHOFF = 0x03; /* SMPC slave SH off command */
void InitSlaveCPU(void)
{
volatile Uint16 i;
/* Set Slave SH to reset state */
while((*SMPC_SF & 0x01) == 0x01);
*SMPC_SF = 1; /* — SMPC StatusFlag Set */
*SMPC_COM = SMPC_SSHOFF; /* — Slave SH OFF SET */
while((*SMPC_SF & 0x01) == 0x01);
SYS_SETSINT(0x94, (void *)&SlaveCPUmain); /* Set Entry Function */
/* Clear reset state of Slave SH */
*SMPC_SF = 1; /* — SMPC StatusFlag Set */
*SMPC_COM = SMPC_SSHON; /* — Slave SH ON SET */
while((*SMPC_SF & 0x01) == 0x01);
}
8
7.3 Function Execution Requests from Master CPU to Slave CPU
extern void SlaveFunction(void);
SlaveCommand = SlaveFunction;
*(Uint16 *)0x21000000 = 0xffff;/* FRT Input Capture for Slave */
The following two methods can be used to debug dual CPU applications with one
PC Compatible connected to an E7000 PC and an EVA board.
(These settings must not interfere with the settings of other expansion boards.)
(1) Setting up the physical memory address of the PC interface board
The master CPU's PC interface board (master board) and the slave CPU's PC
interface board (slave board) must have different physical address settings. In
the set up example above, the address for the master board is set to D000:0000H.
The address for the slave board is set to D400:0000H.
(2) Setting up CONFIG.SYS
If a virtual EMS memory driver is incorporated into CONFIG.SYS, the
CONFIG.SYS settings must be changed. For set up instructions, refer to pages 6
and 7 in the “IBM PC Interface Software User’s Manual.” In the set up example
above, the memory address ranges (D0000H to D3FFFH and D4000H to D7FFFH)
of the master and slave boards are set outside the range of the virtual EMS
driver. To set the base address of the EMS page frame to E0000H, specify the
following line:
DEVICE=C:\WINDOWS\EMM386.EXE RAM /X=D000-D7FF FRAME=E000
Note: If the E7000 PC is being used on the slave side, the E7000 PC system program must also be
installed to \SYS2.
At the E7000 monitor menu, enter “S” or “R” to load the E7000 PC system
program. After the E7000 PC prompt “:” is displayed, activate the slave.
After the EVA board prompt “:” is displayed, activate the EVA board
according to the procedure described in Section 3.3, “Setting Up the EVA
Board.”
10
8.2 Set Up and Operation When GUISH Is Used
Two copies of GUISH (GUI software for the E7000) cannot be run simultaneously.
Operate GUISH for one side and IPI for the other. The set up procedure for execut-
ing IPI and GUISH simultaneously is explained below. It is assumed that E7000 PCs
are connected to both the master side and the slave side.
• Connection example
Tool used Software used PC interface board (Dip SW)
Address (1–5) Interrupt level (6–7)
Master side E7000 PC GUISH.EXE D000:0000 H IRQ11
Slave side E7000 PC IPI.EXE D400:0000 H IRQ12
(These settings must not interfere with the settings of other expansion boards.)
(1) Setting the physical memory address of the PC interface board
The memory address of the PC interface used by GUISH must be higher than
the memory address of the PC interface used by IPI.
In the set up example above, GUISH is used on the master side. Therefore,
the memory address for the master side is set to D000:0000H, which is higher
than D400:0000H, the memory address for the slave side.
At the E7000 PC monitor menu, enter “S” or “R” to load the E7000 PC
system program. After the E7000 PC prompt “:” is displayed, activate the
slave.
12
SEGA SATURN TECHNICAL BULLETIN #29
When setting the CD-DA volume in SEGASATURN applications, lower the CD-DA level
by 6 dB. This change reduces the difference between the CD-DA volume and the sound
CD play volume in the multi-player screen.
Instructions
The following describes detailed setting instructions for:
1. Setting the hardware directly
2. Setting the CD-DA volume with the Saturn Sound Driver.
3. Setting the CD-DA volume with the sound interface library
Supplement
To produce a special effect or to change the CD-DA level dramatically, use the sound CD
level in the multi-player screen as a reference and match the sound levels as closely as
possible.
For each slot, change the setting for the EFSDL[2:0] control register from 111B (-0 dB) to
110B (-6 dB). Details are described below.
The left and right slot numbers for CD-DA are 16 and 17.
When accessing the channels from the main CPU, use the following addresses:
Left channel = 25B00200H + 16H
Right channel = 25B00220H + 16H
Use word access when accessing the addresses from the main CPU.
For details, see Section 4.1, "Register Map," on page 24 of the "Hardware Manual Vol.
1/SCSP User's Manual /Rel. 2(ST-077-R2-052594)."
2. Setting the CD-DA volume with the Saturn Sound Driver.
Use the CD-DA Level command (command number 80H) of the Saturn control commands,
and change the data from E0H (-0 dB) to C0H (-6 dB). Specifically, write the following
data to command block 1 (+00H) of the host interface work (700H):
Data = 80H, 00H, C0H, C0H
Meaning = command, dummy, left level, right level
For details, see "Sound Control Commands" on page 22 of the "Saturn Sound Driver
System Interface /Ver. 3.01(ST-166-R4-012595)" in the "CD Tools and Software Library
Supplementary Document."
Use the Function DC-DA Level setting. Change the setting values for both left and right
from 7 (-0 dB) to 6 (-6 dB). The actual format is as follows:
SND_SetCdDaLev(6, 6)
For details, see page 2 of the "Programmer's Guide Vol. 1/Program Library User's
Guide/Sound Interface Library/Rel. 3(ST-135-R3-012395)."
SEGA SATURN TECHNICAL BULLETIN #30
When a disc image is built or preprocessed with the virtual CD, the following temporary
files are created in addition to the generation files. Consider these files when allocating the
necessary HDD capacity.
VCDBUILD
The following files are created in addition to the "*.dsk" and "*.rti" files. These temporary
files are deleted when processing of the corresponding ISO files ends.
• Temporary file when the MPEG ISO file is processed. The file size is:
12 bytes x (number of sectors in ISO file)
• Temporary file when a channel interleaved ISO file is processed. The file size is:
2 bytes x (number of sectors in ISO file)
VCDPRE
The following files are created in addition to the "*.pvd" and "*.rti" files. These temporary
files are deleted when processing of the corresponding ISO files ends.
• Temporary file when the MPEG ISO file is processed. The file size is:
12 bytes x (number of sectors in ISO file)
• Temporary file when a channel interleaved ISO file is processed. The file size is:
2 bytes x (number of sectors in ISO file)
• "*.qsb" file for each source DOS file used for audio tracks. The file size is:
98 bytes x (number of sectors)
SEGA SATURN TECHNICAL BULLETIN #31
The area symbols for Sega Saturn territory identifiers have changed as follows:
• The hex numbers denote the area symbols set in the Sega Saturn hardware.
• Although noted throughout in the manual as "area code", the terminology has now been changed to
"area symbol".
Cautions
• The area codes "K", "B", "A" and "L" are no longer used. Please note that the
information regarding these areas contained in the explanation of the Boot
System in Sega Saturn Technical Bulletin #11 is no longer valid.
• The area symbols 5H, 6H, AH, and DH are now all SEGA RESERVED. Please replace
pages 39 and 40 in the SMPC User's Manual with the following pages that reflect
the changes.
Result Parameters
bit 7 bit 4 bit 3 bit 0
SR 201006H 0 1 PDE RESB — — — —
bit 7 bit 0
OREG0-2010021H STE RESD — — — — — —
bit 7 bit 0
OREG1 2010023H "1000" place in Western calendar "100" place in Western calendar (BCD)
year year
OREG2 2010025H "10" place in Western calendar "1" place in Western calendar (BCD)
year year
OREG3 2010027H Day of the weekNote 2 Month (hexadecimal) Note 3 (BCD)
Note 2
Day of the week: 0H: Sunday, 1H: Monday, 2H Tuesday, 3H: Wednesday, 4H: Thursday, 5H: Friday, 6H:
Saturday
Note 3
Month: 1H: January, 2H: February, 3H March, 4H: April, 5H: May, 6H: June, 7H: July, 8H:
August, 9H: September, AH: October, BH: November, CH: December
bit 7 bit 0
OREG4 2010029H "10" place in date "1" place in date (BCD)
OREG5 201002BH "10" place in hour "1" place in hour (BCD)
OREG6 201002DH "10" place in minute "1" place in minute (BCD)
OREG7 201002FH "10" place in second "1" place in second (BCD)
OREG8 2010031H 0 0 0 0 0 0 CTG1 CTG0
bit 7 bit 0
OREG9 2010033H Area code (00H-0FH)
Area Symbols
bit 7 bit 0
OREG10 2010035H System status 1
System Status 1 (Status of control signals output from SMPC, 0: OFF, 1: ON)
• b7 0B • b6 DOTSEL signal* • b5 1B
• b4 1B • b3 MSHNMI signal • b2 1B
• b1 SYSRES signal • b0 SNDRES signal
* The DOTSEL signal indicates the current screen mode (horizontal resolution- 0:
320, 1: 352).
bit 7 bit 0
OREG11 2010037H System status 2
System Status 2 (Status of control signals output from SMPC, 0: OFF, 1: ON)
• For 1, the color is black and the shape differs greatly. The European and the US
versions are the same.
• For 2, the grip and buttons B and C are larger. The European and US versions are the
same.
• For 4, the START and butterfly-shaped shifter are gray in color. The European and US
versions are the same.
• For 3, 5, 6, and 7, everything is black. The European and US versions are the same.
4 . Addenda
For areas other than the US, Europe, and Japan, please contact Sega Technical Support.
SEGA SATURN TECHNICAL BULLETIN #33
References
VDP2 User Manual (Rel. 2), page 75, "Horizontal Flip Function Bits".
Always use the boot ROM's internal service routines when switching the horizontal
screen resolution.
The VBLANK bit (bit 3) of the screen status register (TVSTAT: 180004H) is valid
only when the DISP bit of the TV screen mode register (TVMD: 180000H) is 1. When
the DISP bit is 0, the VBLANK bit is always 1.
4 . Restriction on Horizontal Flip Function Bits (NEW)
The horizontal flip function bits of the cell-format normal scroll screen (NBG0 and
NBG1) are only valid when the number of character colors is 16 or 256. Otherwise, do
not set NBG0 or NBG1 to "1".
SEGA SATURN TECHNICAL BULLETIN #34
The Sega Saturn Mission Stick is composed of a base unit and a detachable stick unit.
The base unit has two stick connector ports (Main Control and Sub Control) as well as
A, B, C, X, Y, Z, L, R and START buttons. The connector on the base unit is plugged
into a control port on the Sega Saturn. The stick unit is composed of a three-axis (AX,
AY, AZ) joystick equipped with three trigger buttons A, B and C. It is connected to the
Main Control port of the base unit. Digital data bits (Right, Left, Down, Up) are
output for AX and AY.
Note: When there is only one stick available, it must always be connected to the Main
Control port of the base unit.
• Six-Axis Mode
Connect the optional stick (sold separately) to the Sub Control port to enable the six-
axis mode. Digital data bits (Right, Left, Down, Up) are output only from the stick
connected to the Main Control port. Moreover, the A, B and C trigger buttons of the
stick connected to the Main Control port are output to ATRG, BTRG and CTRG, while
the A, B and C triggers of the stick connected to the Sub Control port are output to
XTRG, YTRG and ZTRG.
Reference
See pages 77, 83 and 97 of Hardware Manual Vol. 1, Rel. 2, SMPC User Manual for
more information.
The following pages show the data formats for the Mission Stick's three-axis mode and
six-axis modes.
Sega Saturn Mission Stick Data Formats
1 . Three-Axis Mode
Saturn Peripheral ID
Saturn Peripheral Type: 1H (Analog device)
Data Size: 5H (5 bytes)
• Start, ATRG, CTRG, BTRG, RTRG, XTRG, YTRG, ZTRG and LTRG become 0 when
the button is pressed.
• For AX7~AX0, AY7~AY0 and AZ7~AZ0, the absolute values of the unsigned A/D
converter output is issued.
• For AX7~AX0 and AY7~AY0, the upper left is (0,0) and the lower right is (255,255).
• For AZ7~AZ0, down is 0 and up is 255.
The digital bits (Right, Left, Up, Down) that are used to enable the user to navigate
around menu screens such as the Sega Saturn's CD control screen change according to
the AX and AY threshold values shown below.
AY
00 UP
ON 86
OFF 107
ON OFF OFF ON
AX
00 86 107 149 170 255
LEFT RIGHT
OFF 149
ON 170
255 DOWN
• Right becomes 0 (ON) when AX is 170 or higher and 1 (OFF) when AX is 147 or
lower.
• Left becomes 0 (ON) when AX is 86 or lower and 1 (OFF) when AX is 107 or higher.
• Down becomes 0 (ON) when AY is 170 or higher and 1 (OFF) when AY is 147 or
lower.
• Up becomes 0 (ON) when AY is 86 or lower and 1 (OFF) when AY is 107 or higher.
2 . Six-Axis Mode
Saturn Peripheral ID
Saturn Peripheral Type: 1H (Analog device)
Data Size: 9H (9 bytes)
• The 7th~9th data are used as the analog data of the second stick connected to the Sub
Control port of the base unit.
• Data is undefined for the bits shown with asterisks in the table above. As a result, the
digital bits (Right, Left, Up, Down) of the second stick cannot be used.
Note: Digital bits are valid only for the stick connected to the Main Control port of
the base unit. They have the same threshold values as in the three-axis mode.
• Start, ATRG, BTRG, CTRG, RTRG, XTRG, YTRG, ZTRG and LTRG become 0 when
the button is pressed.
• The Main Control stick data for triggers A, B and C are output as ATRG, BTRG and
CTRG, respectively.
• The Sub Control stick data for triggers A, B and C are output as XTRG, YTRG and
ZTRG, respectively.
• For AX7~AX0, AY7~AY0, BX7~BX0 and BY7~BY0, the upper left is (0,0) and lower
right, (255,255).
• For AZ7~AZ0 and BZ7~BZ0, down is 0 and up, 255.
Before After
6002000H + IP Size 6002000H + IP Size
System Area
60FFFFFH 60FFFFFH
The 1st read file cannot be loaded into the memory area between 60FF000H to 60FFFFFH
since it is used by the system. After 1st read file is loaded, the area is released to the
application.
• Addresses 6000000H to 6001FFFH are used by the system, so they cannot be used by
the application. However, 6000E00H to 6001FFFH may be used for stacks.
• After the IP process finishes and the application is running, up to 6001000H can be
used by the application if a stack is set up elsewhere. Similarly, up to 6000E00H can be
used by the application if a stack is set up elsewhere.
Example
6000000H
Vectors,
Resident Routines
6000E00H
Slave SH Stack
6001000H
Master SH Stack
6002000H
SEGA SATURN TECHNICAL BULLETIN #36
Important:
Always observe the guidelines found in the Saturn software/hardware
development manuals regarding hardware restrictions and undefined operations.
The effects of these restrictions and operations will differ between different
revisions of the Saturn hardware.
Also, make sure to initialize each hardware chip device with your application.
Since the default values set by the boot ROM in the VDP1, VDP2, and SCSP during
the boot process remain in those devices after startup, never allow the application to
use those values as default settings.
Example 1: Caution on bits ECD and SPD of the polygon draw command:
To use the polygon draw command, set the ECD and SPD bits (bits 7, 6)
of the draw mode word (CMDPMOD) to the fixed value "1". The
operation is not guaranteed when "0" is specified.
Refer to: Section 7.7 Polygon Draw Command on page 126 of the Hardware
Manual Vol. 2 /VDP1 User's Manual Rel. 2.
Example 2: Caution on the Clip bit in the draw mode word of each draw
command:
When using user specified clipping, be sure to always issue the user
clipping coordinate set command when the Clip bit (bit 10) of the
draw mode word (CMDPMOD) is set to "1". When coordinates are not
specified, the value is not guaranteed.
Refer to: Section 7.2 User Clipping Coordinate Set Command on page 112 of the
Hardware Manual Vol. 2 /VDP1 User's Manual Rel. 2.
SEGA SATURN TECHNICAL BULLETIN #37
Incorrect
Table 2.4 V-Counter register bits
TV Screen Mode VCT9 VCT8 VCT7 VCT6 VCT5 VCT4 VCT3 VCT2 VCT1 VCT0
Normal,
High Resolution V8 V7 V6 V5 V4 V3 V2 V1 V0 Invalid
(Non-Interlaced)
Correct
Table 2.4 V-Counter register bits
TV Screen Mode VCT9 VCT8 VCT7 VCT6 VCT5 VCT4 VCT3 VCT2 VCT1 VCT0
Normal,
High Resolution V9 V8 V7 V6 V5 V4 V3 V2 V1 V0
(Non-Interlaced)
Incorrect
Table 3.4 Character pattern data read access restrictions
TV Screen Pattern Name Table Data Access Timing
Mode T0 T1 T2 T3 T4 T5 T6 T7
High T0~T2 T1~T3 T0, T0, T1, — — — —
Resolution T2, T3 T3
Correct
Table 3.4 Character pattern data read access restrictions
TV Screen Pattern Name Table Data Access Timing
Mode T0 T1 T2 T3 T4 T5 T6 T7
High T0~T2 T1~T3 T2, T3 T3 — — — —
Resolution
The Arcade Racer is a single-axis analog peripheral used mainly for driving games.
The handle of the Arcade Racer is equipped with X, Y, Z, START, A, B, and C buttons and a
butterfly shifter unit. Digital data bits (right, left, down, up) are output by the following
actions:
• Left and right by turning the handle left and right, respectively.
• Up by pressing the left side of the butterfly shifter.
• Down by pressing the right side of the butterfly shifter.
Important Note: The Arcade Racer is not equipped with L and R buttons.
SATURN Peripheral ID
SATURN Peripheral Type: 1H (analog device)
Data Size: 3H (3 bytes)
Center
OOH FFH
-80% +80%
• Right is "0"(ON) when AX is greater than 97H (+15°), and is "1" (OFF) when less than
8FH (+10°).
• Left is "0" (ON) when AX is less than 67H(-15°), and is "1" (OFF) when greater than 6FH
(-10°).
• Down is "0" (ON) when the right side of the butterfly shifter is pulled toward the
player, and "1" (OFF) when released.
• Up is "0" (ON) when the left side of the butterfly shifter is pulled toward the player, and
"1" (OFF) when released.
SEGA SATURN TECHNICAL BULLETIN #39
When the SCU-DMA transfer byte count is set to 0, the transfer count is set to the
maximum value for each setting.
Note: DMA transfer for the DSP is done in word units (4 bytes).
Example:
References:
• CPU-DMA Direct Mode:
Page 42, Transfer Byte Number, SCU User's Manual ,Third Version (ST-97-R5-072694).
• DSP-DMA.
Page 87, DMA Command Execution, SCU User's Manual, Third Version (ST-97-R5-072694).
SEGA SATURN TECHNICAL BULLETIN #40
New peripheral ID character codes for Saturn compatible peripherals have been
added. These character codes are are located in the System Area of the CD-ROM.
The new peripheral ID character codes are listed in boldface below.
1. Overview
The Stunner is a shooting game-specific gun peripheral that is connected to the
control port of the SEGA SATURN. The Stunner has a Trigger and a Start Button.
• Basic Specifications
• Recommended screen size: 14 inches or larger.
• Shooting distance: Approximately 5 meters (16.4 feet) from the screen.
• Shooting angle: 30° vertically and horizontally from the center of the screen.
Note: The above applies for a 14 inch monitor in a normally lit room. The specifications may
vary for different screen sizes and brightness of the room.
• Liquid crystal displays and projectors do not use conventional picture tubes
and are therefore incompatible.
• High Definition TeleVisions (HDTV) are incompatible since the screen
display method is different than a conventional television.
• Double scanning televisions (EDTV2, Clear Vision) cannot be used because
the scan line speed is incompatible.
• Incompatible Display Modes
• Special display modes such as dual screen and picture-in-picture cannot be
used. These modes save the video image data to a frame buffer before it is
displayed and therefore causes the timing to be off.
Solution: Set the television to normal display mode.
• Some wide-aspect ratio televisions cannot support the Stunner when in 4:3
display mode.
Solution: Set to wide display mode.
• Other
• When the television screen is dirty or the screen brightness is too low.
Solution: Clean the screen or adjust the brightness.
• The scan line is difficult to detect when the screen size is too small.
Solution: Use a 14 inch or larger screen or add a collision detection adjustment mode. For
further details, see Collision Detection Adjustment Mode discussed below.
3. Peripheral Specifications
• SMPC Mode
It is necessary to switch the SMPC to SH2 Direct mode since the Stunner uses the
HV counter to detect the position on the screen.
• Initialization (SMPC Control Mode to SH2 Direct Mode)
1) Set the external latch enable bit (EXTLEN: bit 9) of the VDP2 external signal
enable register (EXTEN: 180002H offset) to 1.
2) Set SMPC to SH2 direct mode.
Set the IOSEL bit of the parallel I/O register (2010007DH) to 1.
Control Port 1: IOSEL1 (bit 0)
Control Port 2: IOSEL2 (bit 1)
Note: Both ports are byte accessed from the SH2.
Refer to: Page 7, Parallel I/O Registers in the SMPC User's Manual (ST-169-R1-072694)
Page 19, External Signal Enable Register in the VDP2 User's Manual (ST-58-R2-
060194)
• Reading Coordinates
1) The external latch flag (EXLTFG: bit 9) of the VDP2 screen status register
(TVSTAT: 180004H offset) is read. If the bit is 1, the HV counter is read. The
targeted position and the HV counter position will be off in reality.
Therefore, adjust for the difference with the application. Refer to Calibration
Mode described later.
2) The screen status register (TVSTAT) is cleared to 0 when the read is done.
Therefore, it can be read only once during a V-blank.
Note: When the HV counter is read, the screen cannot be read if it is too dark (EXLTFG will
not go to 1). Therefore, the screen must be white (bright) for 1/60th of a second after the
Stunner trigger is pulled and the value read at that time is used to determine the
position.
Example 1:
Color sample RGB format / sprite pixel color data white =FFFFH (32768 colors)
/ scroll pixel color data =7FFFH (32768 colors)
/ =00FFFFFFH(16,770,000 colors)
Refer to: Page 218, 10.2 RGB Format Pixels in the VDP2 User's Manual (ST-58-R2-060194)
Refer to: Page 23, H-Counter Register in the VDP2 User's Manual (ST-58-R2-060194)
• External latch, bit 6: Used as the VDP2 external latch input when the EXLE bit is 1.
• Start Button, bit 5: The signal differs from that of the control pad start button.
• Trigger, bit 4: Stunner trigger switch
• Reading the Stunner ID in SMPC Control Mode
The Stunner returns an "UNKNOWN" Genesis peripheral device ID [A0H]
instead of a SATURN peripheral ID to the port status 6Player ID as an
"UNKNOWN" device. This is because the Stunner uses the SMPC direct mode.
The upper 4 bits of the port status byte are the 6Player ID [AH], the lower 4 bits are
the number of connectors 0. Therefore, the port status is [A0H].
Refer to: Pages 61, 62, INTBACK Command Result Parameter During Peripheral Data
Acquisition in the SMPC User's Manual (ST-169-R1-072694)
• 2 Player Mode
When two players use the Stunner simultaneously, the main processing is done
in 2 frames (1/30 sec). Odd and even frames are read separately.
Overview
The purpose of this document is to shed a little light on how directories and
subdirectories work on the Saturn CD and how to properly initialize the GFS system.
Directory Structure:
The Saturn CD contains an ISO9660 track that consists of a root directory, subdirectories
and the files that belong to them. The files conform to the DOS file naming convention of an
eight letter prefix and a three letter extension. The files are placed on the disc in the order that
they are specified in the script file, but the directories are sorted alphabetically. This means that a
sequential search of a directory will not necessarily follow the order that the files are laid out on
the disc.
While you can use the mechanism of finding files by name, this requires the extra
overhead of a search by name through the directory table (It actually uses a strncmp() on each
entry until it finds a match!). If you have a lot of files in a directory this can add up. It also
requires 12 extra bytes per directory entry in the table. We suggest that you do your initial
development by file name and convert your application to access by file ids later. The file id (fid)
is simply the index into the directory table.
The initial program loader (ip.bin) will load the first file it finds in the directory. This
means that you must name the file so that it is the first file alphabetically. We strongly suggest
naming your kernel program 0. The first actual file in a directory will have a fid of 2. File ids of
0 and 1 are used for the directory tree system; Fid 0 contains info about the directory itself (self)
and fid 1 contains info about the parent directory, if the current directory is a subdirectory. Refer
to page nine of the Program Library - User Guide 1, CD-Library (ST-136-R1) for a diagram of
the directory structure. Info about subdirectories are stored in the parent directory in the same
manner as if they were a file entry.
In order to correctly initialize the file system it is important to make sure you know in
advance the maximum number of entries that will be in each directory. The function GFS_Init
will, upon initializing, fill in a directory table with the contents of the root directory on the disc.
It will only fill it up to the number that you pass it so you need to do some calculations.
In calculating how many files are in a directory add in the following:
With the appropriate file count in hand we can now initialize the GFS.
Uint32 Main(void)
{
char fname[13];
GfsHn gfs;
Sint32 fid;
Sint32 ret;
Sint32 fsize,sctsize,nsct,lastsize;
/* and read it into buff (sure hope buff is big enough !)*/
GFS_Fread(gfs, nsct, buff, fsize);
return 0;
}
Accessing Subdirectories
If you have an application that uses subdirectories you can share a common directory
table among them. that will be loaded by the GFS_LoadDir command. After loading it you can
make it the current directory by calling GFS_SetDir and passing it the address of the table. Note:
only one directory can be current at one time. If you wish to have open files from several
directories you must first set the current directory to the one you want, open the file, set the other
directory to be current and open the file, etc.
#define OPEN_MAX 5
#define MAX_DIR1 54 /* 2 overhead, 50 files, 1 sub-dir, 1 dummy *
#define MAX_DIR2 303 /* 2 overhead, 300 files, 1 dummy */
#define SECT_SIZE 2048; /* size of one sector */
char buff[2048];
Uint32 main()
{
char fname[13];
Uint32 ret,i;
GfsHn gfs;
Sint32 fid;
/*
assume there are 300 files in the subdirectory named
B1.BIN thru B300.BIN and each file is 2048 bytes in length
*/
for (i = 0; i < 300; i++) {
sprintf(fname,"A%d.BIN",i+1);
/* get the file id for fname */
fid = GFS_NameToId(fname);
/* open it */
gfs = GFS_Open(fid);
if (gfs == NULL) {
return 2; /* error out */
}
else {
/* read in the data */
GFS_Fread(gfs, 1, buff, 2048);
GFS_Close(gfs);
}
return 0;
}
Here is the sample script for the subdirectory code example above:
Disc sample.dsk
Session CDROM
LeadIn MODE1
EndLeadIn
SystemArea ip.bin
Track MODE1
Volume ISO9660 "sample.pvd"
PrimaryVolume 00:02:16
SystemIdentifier "SEGA SEGASATURN"
VolumeIdentifier "SAMPLE_GAME_TITLE"
VolumeSetIdentifier "SAMPLE_GAME_TITLE"
PublisherIdentifier "SEGA ENTERPRISES,LTD."
DataPreparerIdentifier "SEGA ENTERPRISES,LTD."
VolumeCreationDate 11/11/1994 00:00:00:00:36
EndPrimaryVolume
EndVolume
File A1.BIN
FileSource "a1.dat"
EndFileSource
EndFile
; .
; . A2 thru A49 go here
; .
File A50.BIN
FileSource "a50.dat"
EndFileSource
EndFile
EndTrack
LeadOut MODE1
Empty 500
EndLeadOut
EndSession
EndDisc
SEGA SATURN TECHNICAL BULLETIN #SOA-2
There are two ways to cause a sprite to cast a shadow onto a VDP2 background, each with its own
set of advantages and disadvantages. The VDP2 manual refers to these two methods as the
“normal shadow” and the “MSB shadow,” and, for the sake of consistency, this note will adopt
that terminology.
Both kinds of shadow are created by instructing the VDP1 to write special pixel values to its frame
buffer. These special pixel values are then interpreted by the VDP2 as it reads the frame buffer,
subject to the states of several of the VDP2’s innumerable mode flags, which will be described
below.
In order to use either kind of shadow, you must enable shadow processing for the background(s)
onto which shadows are to be cast by setting the appropriate bit(s) of the VDP2 shadow control
register (0x25f800e2; refer to page 259 of the VDP2 manual).
MSB shadows are created by setting the MSBON bit in the draw-mode word of the VDP1
command table, which, in turn, sets the most-significant bit of the appropriate pixels in the VDP1
frame buffer. Since the most-significant bit of a pixel in the frame buffer can perform three
different functions, depending on how the VDP2 is configured, you need to be sure that the VDP2
is in the correct mode. To do this, you must clear bits 4 and 5 of the sprite control register
(0x25f800e0; refer to pages 188 and 207 of the VDP2 manual). Clearing bit 5 disables RGB
sprites, so that the VDP2 will not use the most-significant bit to distinguish between paletted pixels
and RGB pixels. Note that this means that you cannot create an MSB shadow sprite unless you
completely give up the right to display RGB sprites. Clearing bit 4 informs the VDP2 that you
want the most-significant bit to be used for enabling the MSB shadow instead of the VDP2’s sprite
window feature.
Use of the MSB shadow feature is further restricted by the fact that it only works for sprite types 2
through 7 (refer to page 201 of the VDP2 manual). Since these sprite types all use 16-bit pixels, it
follows that the MSB shadow feature may not be used when the VDP1 is in one of its high-
resolution modes.
Once you’ve got the VDP2 in the correct mode and using an appropriate sprite type, you can
contemplate actually drawing an MSB shadow sprite. To do this, set the most-significant bit (the
MSBON bit) of the draw-mode word (the third word) in the sprite’s command table. When this bit
is set, the VDP1 does not actually draw the sprite into the frame buffer. Instead, it sets the most-
significant bit of every pixel in the buffer where the sprite would otherwise have been drawn,
leaving the remaining bits untouched. This means that the MSB shadow feature can be used to cast
shadows onto other sprites, as well as onto backgrounds (but see below).
When the VDP2 encounters a VDP1 pixel with its most-significant bit set (assuming the VDP2 is
in the appropriate mode), it responds in one of two ways. If all other bits are zero, i.e. the value of
the pixel is 0x8000, then the pixel is taken to be transparent, and the background pixel that is
immediately beneath the sprite pixel is displayed at a reduced luminance. If more than one
background is being displayed, then the question of which backgrounds get dimmed hinges on the
priority of the sprite pixel, and the priority of transparent shadow pixels is always taken from sprite
priority register zero. Note that this means that all transparent MSB shadow pixels displayed at
any given time will have the same priority. Note also that all of this happens only if you set bit 8
of the VDP2 shadow control register (0x25f800e2), which enables transparent shadow pixels. If
this bit is clear (which is the default), then transparent shadow pixels are not displayed, which
means that an MSB shadow sprite would still cast a shadow onto other sprites, but not onto any of
the backgrounds.
If the unsigned value of a sprite pixel is greater than 0x8000 (i.e. the most-significant bit is set, and
the remaining bits are not all zero), then the VDP2 interprets the pixel as being opaque, and the
pixel is displayed according to the color bank, priority, and other information found in the
remaining 15 bits, but with its luminance reduced.
Normal shadows are created by drawing a reserved paletted pixel value to the VDP1 frame buffer.
What the value actually is depends on the sprite type, but, in general, the value is derived by setting
all of the dot color bits except the least-significant bit to 1. Depending on the sprite type, this value
may be 0x3e, 0x7e, 0xfe, 0x1fe, 0x3fe, or 0x7fe (see page 201 of the VDP2 manual). The values
of the remaining bits in the pixel are not significant. When the VDP2 encounters such a pixel, the
effect is the same as when it encounters a transparent MSB shadow pixel: the background pixel
immediately underneath the sprite pixel is displayed at a reduced luminance.
Normal shadows are displayed regardless of the setting of the transparent shadow enable bit (bit 8)
in the shadow control register (0x25f800e2).
Normal shadows have several advantages over MSB shadows. They can be used in high-
resolution modes; they can be mixed freely with RGB sprites, and, since the priority bits are still
available, they need not all have the same priority. The major disadvantage of the normal shadow
is that the pixels of any sprite that happens to be underneath the normal shadow sprite will be
obliterated when the normal shadow sprite is drawn, which means that it is not possible to cast a
normal shadow onto a sprite.
Be advised that the paletted pixel value reserved for normal shadow pixels is reserved whether
shadow processing is enabled or not. If shadow processing is not enabled, then normal shadow
pixels are simply not displayed. This means that, depending on the sprite type being used, one or
more entries in color RAM cannot be used by any sprite. For more details, see SEGA Saturn
Technical Bulletin #25.
Both kinds of shadow can be used simultaneously. If a single pixel satisfies the qualifications for
both kinds of shadow, it is interpreted as a normal shadow pixel.
The following table summarizes the differences between the MSB shadow and the normal shadow.
MSB Normal
Shadow Shadow
Can cast shadows on other sprites? Yes No
Can be mixed with RGB sprites? No Yes
Can different shadows have different priorities? No Yes
Valid sprite types 2-7 All
SEGA SATURN TECHNICAL BULLETIN #SOA-3
In order for your program to conform to the Sega Saturn Software Development
Standards document (ST-151-R3-SB) which states "If the Sega Saturn's CD Door OPEN
button is pressed during a game and the door opens, then the boot ROM's Audio CD
Control Screen must be displayed in the same manner as a reset is implemented in the
Title Loop sequence."
The purpose of this document is to show how to check for and respond to the CD door-
open condition.
If you are using the SBL - (Sega Basic Library; older SOJ Libraries) place this code in
your vertical blank routine:
/* Detect CD Disk Change and if so, jump to the Saturn Audio CD Control
Screen (gui) */
if( CDC_GetHirqReq() & CDC_HIRQ_DCHG )
SYS_EXECDMP();
If you are using the SGL - (Sega 3D Game Library) make the following call in your
initialization code:
In addition, if you are using the GFS, STM or the Cinepak (CPK) system you should use
the appropriate routine below as well:
Note: These procedures are the same for both the SBL, and the SGL.
GFS_SetErrFunc();
STM_SetErrFunc();
CPK_SetErrFunc();
The above routines will allow you to specify a function that will be called when a file-
based error occurs (such as opening the disk drive while being accessed). The error
function should check the error type and respond accordingly. If the error is
ERR_CDOPEN then you should call the SYS_EXECDMP routine. Please see the appropriate
library documentation for the correct usage of the error routines.
Caution for 3rd party developers using a development system that requires a Saturn
system disk.
The following notice needs to be followed in the case of a production unit Saturn being
used for development. The black 3rd party system disk is different from the Sega brand
developer system disk, hence the IP.BIN file must be modified before preprocessing
using VCDPRE.EXE. The change is as follows:
Failure to follow will result in an "unsuitable disk" error from the Saturn.
Developers can find this information in the "Disk Format Standards Format Manual (ST-
040-R3-011895)" or the "Boot ROM System User's Manual (ST-220-120994)". Also, be
aware that there is an older version of the manual ST-040-R2-062294 which is incorrect,
but has been changed in the new revision.
SEGA SATURN TECHNICAL BULLETIN #SOA-5
Default settings:
1. IRQ=10(02)
2. DMA=DREQ5(00)
3. I/O=340H(00)
*The numbers in parentheses are used by the environment variable set in the autoexec.bat
file.
The following environment variable must be place in the autoexec in order for VCD to
operate correctly.
The value of the environment variable varies when a value other than the default is set as
the jumper setting. Refer to the next page for the proper values.
SEGA SATURN TECHNICAL BULLETIN #SOA-6
Disclaimer
The information in this document is based on our interpretation of the VDP2 User’s
Manual and on experimental evidence. It is not possible for us to test every conceivable
permutation of values that the cycle pattern registers might hold. Your mileage may
vary.
The cycle pattern registers control the manner in which the VDP2 accesses VRAM while
the display is being drawn. Depending on how the display is configured, the VDP2 may
need to access VRAM quite a few times in order to draw a single pixel. It may need to
read pattern name data (i.e. character codes) and character pattern data (i.e. the characters
themselves) for several different backgrounds. It may also need to read vertical cell
scroll data. In addition, you may wish to access VRAM from the CPU during the
display. The VDP2 is not smart enough to direct all of this VRAM traffic automatically;
you must do it yourself. The cycle pattern registers allow you to do this by specifying
which parts of the VDP2 are allowed to access which parts of VRAM how often and at
what time(s). The cycle pattern registers also control how much access the CPU has to
VDP2 VRAM while the screen is being displayed (the CPU may access VRAM freely
during the vertical blanking interval).
The figure below illustrates how VDP2 VRAM is accessed for each pixel. There are
eight memory cycles per pixel (four in hi-res mode), and VDP2 VRAM can be divided
into up to four banks, all of which can be accessed during each cycle, which means that
the VDP2 can perform up to 32 VRAM accesses per pixel. In the figure below, the
cycles (or “timings,” as they are sometimes called in the VDP2 User’s Manual) are
labeled T0 through T7, and the VRAM banks are labeled A0, A1, B0, and B1. You must
specify who gets to have access to each bank of VRAM during each of the eight cycles,
and you must do it so as to ensure that the VDP2 will be able to load all of the data that it
needs to load in order to display the number and type of backgrounds that you told it to
(except where otherwise noted, this document will assume that VRAM is partitioned into
four banks).
T0 T1 T2 T3 T4 T5 T6 T7
A
0
A
1
B
0
B
1
The cycle pattern registers are a set of eight 16-bit registers: two for each of the four
banks of VDP2 VRAM. Each pair of registers contains one four-bit field for each of the
eight cycles that elapses during the display of a single pixel, for a total of 32 bits.
Between them, these registers allow (or, if you prefer, require) you to specify who gets to
access which bank of VRAM during which cycles. If VDP2 VRAM is configured as two
larger banks instead of four smaller ones, then the cycle pattern registers for banks A1
and B1 are ignored.
Each of the 32 four-bit fields can assume one of the following values, corresponding to
the different types of VRAM access that the cycle pattern registers control.
The cycle pattern registers are laid out so that if you display their values in a debugger
(which you can’t do, since they’re write-only registers, but you could display shadows of
them), the access codes will read naturally from left to right, with T0 at the left and T7 at
the right. For a diagram of the cycle pattern registers, see p. 39 of the VDP2 User’s
Manual.
How Many Accesses Are Required for What?
Here is a table which gives the number of VRAM accesses that must be allocated for
each of the various types of VDP2 data.
If you are using the VDP2 zooming hardware to reduce your screen (this is only
supported for NBG0 and NBG1; see pp. 126-130 of the VDP2 User’s Manual), then the
VDP2 has to perform additional accesses, since each pixel on the screen can correspond
to multiple pixels in VRAM. If you’re reducing the screen by a factor of more than one
but not more than two, then the number of pattern name data and character pattern data
accesses must both be doubled. If you’re reducing the screen by as much as a factor of
four (the maximum reduction possible), then they must be quadrupled. This naturally
creates restrictions on the color depth of the screens that are going to be reduced.
There are a number of restrictions on which types of VRAM access can be performed
during which cycles and in what combinations, and here they are.
There can be a maximum of two pattern name data accesses during any given cycle, and
one of them must access either bank A0 or bank B0, while the other must access either
bank A1 or bank B1. If bank A is partitioned, but bank B is not, then bank A1 may be
accessed simultaneously with bank B, but bank A0 may not be. Similarly, if bank B is
partitioned, but bank A is not, then bank B1 may be accessed simultaneously with bank
A, but bank B0 may not be. If neither bank A nor bank B is partitioned, then only one
pattern name data access per cycle may be performed.
The cycles during which character pattern data may be read depend on the cycle(s) during
which the corresponding pattern name data was read. Here are the restrictions.
If the Pattern Name Data ...Then the Character Pattern Data Can ... Or, If You’re In Hi-res
Is Read During This Cycle... Only Be Read During These Cycle... Mode, During These Cycles
T0 T0, T1, T2, T4, T5, T6, T7 T0, T1, T2
T1 T0, T1, T2, T3, T5, T6, T7 T1, T2, T3
T2 T0, T1, T2, T3, T6, T7 T0, T2, T3
T3 T0, T1, T2, T3, T7 T0, T1, T3
T4 T0, T1, T2, T3 --
T5 T1, T2, T3 --
T6 T2, T3 --
T7 T3 --
Vertical cell scroll table data may only be accessed during T0 and T1 for NBG0, and
during T0, T1, and T2 for NBG1. If vertical cell scroll table data is being accessed for
both NBG0 and NBG1, then the access for NBG0 must come first.
CPU access for bank A0 should match the CPU access for bank A1, and CPU access for
bank B0 should match the access for bank B1. Cycles which are available for CPU
access in, say, bank A0 but not in bank A1 should be programmed with access code 0xf
(no access). If all of bank A (both bank A0 and bank A1) or all of bank B is unused, set
its cycle pattern registers to 0xfeeeeeee, i.e., no access in T0 and CPU access during all
other cycles. Note that if the CPU tries to read VRAM during a cycle which does not
allow CPU access, the CPU will be held until VRAM becomes available. The CPU can
write up to two long words to VRAM without having to wait.
The rotating backgrounds do not use the cycle pattern registers. Data that will be used by
a rotating background may not share a VRAM bank with data that will be used by a
normal background.
Examples
A0: 0x04eeeeee
A1: 0x5feeeeee
B0: 0xf26eeeee
B1: 0x377eeeee
If, for whatever reason, we wanted to reshuffle the various display components like so,
Bank Containing Bank Containing
Screen Color Depth Display Mode Pattern Name Data Character Pattern or Bit Map Data
NBG0 16 Character A1 A0
NBG1 16 Bit Map -- A1
NBG2 16 Character B1 B0
NBG3 256 Character B1 B0
A0: 0x4feeeeee
A1: 0x05eeeeee
B0: 0x677eeeee
B1: 0xf23eeeee
Now let’s say we wanted to put everything that used to be in bank A1 into bank A0, and
everything that used to be in bank B1 into bank B0, giving us this:
Bank Containing Bank Containing
Screen Color Depth Display Mode Pattern Name Data Character Pattern or Bit Map Data
NBG0 16 Character A0 A0
NBG1 16 Bit Map -- A0
NBG2 16 Character B0 B0
NBG3 256 Character B0 B0
A0: 0x504eeeee
A1: 0xfffeeeee
B0: 0x2637ee7e
B1: 0xffffeefe
If, in addition, we wanted to be able to reduce NBG0 by up to one half, we could alter the
settings for banks A0 and A1 as follows:
A0: 0x5040eee4
A1: 0xffffeeef
SEGA SATURN TECHNICAL BULLETIN #SOA-7
It is possible to instruct the VDP2 to display selected sprites so that they are partially
transparent with respect to the VDP2’s backgrounds, i.e., the RGB values of the sprite’s
pixels and those of the background’s pixels are combined in a weighted average. This can
be done with either paletted sprites or RGB sprites, but it’s more useful with paletted
sprites, since each paletted sprite gets to decide individually whether it will be partially
transparent or not, whereas, with RGB sprites, either all of them are partially transparent, or
none of them are, as we shall see. Note also that, while any sprite may be made partially
transparent with respect to the backgrounds, the only way in which sprites may be made
partially transparent with respect to each other is to use the VDP1’s half-transparency
effect, which only works if all sprites involved are RGB sprites.
There are several things that you must do in order to make a sprite partially transparent
with respect to backgrounds.
First, you must tell the VDP2 to enable color calculations (that’s Sega-speak for partial
transparency and other effects in which the RGB values of individual pixels are
manipulated) for the sprites by setting bit 6 of the color calculation control register (see p.
240 of the VDP2 User’s Manual).
Next, decide how transparent you want the sprite to be by specifying one or more “color
calculation ratios,” or degrees of transparency, between the sprite and whatever
backgrounds are behind it. Each color calculation ratio is represented by a number from 0
to 31, where 0 means “opaque,” and 31 means “completely transparent.” Up to eight of
these ratios may be stored in the sprite color calculation ratio registers (see p. 210 of the
VDP2 User’s Manual). Paletted sprites select one of these ratios using the color
calculation bits in the sprite’s pixel data as defined by the sprite type being used (see pp.
201-202 of the VDP2 User’s Manual). Note that not all sprite types allow access to all
eight of the available color calculation ratios, and most of the hi-res sprite types (the 8-bit
types) do not support color calculation at all. RGB sprites always use color calculation
ratio zero (i.e., the ratio stored in bits 0 through 4 of the first sprite color calculation ratio
register).
Since you will probably not want all of your sprites to be partially transparent, there needs
to be some way to determine which sprites will be subjected to color calculations and
which ones will not. The question of whether or not the VDP2 will perform color
calculations on a given pixel in the VDP1 frame buffer is resolved by subjecting the pixel
to one of four tests:
1. Perform color calculations if the pixel’s priority is less than or equal to a specified
value.
2. Perform color calculations if the pixel’s priority is equal to a specified value.
3. Perform color calculations if the pixel’s priority is greater than or equal to a specified
value.
4. Perform color calculations if the most-significant bit of the pixel’s color is set.
You determine which test is used by writing to bits 12 and 13 of the sprite control register
(see p. 207 of the VDP2 User’s Manual). The same test will be used for every pixel in the
VDP1 frame buffer. The “specified value” alluded to in the first three tests is set by
writing to bits 8, 9, and 10 of the sprite control register. The priority of an RGB pixel is
always taken from sprite priority register zero (see p. 209 of the VDP2 User’s Manual).
This means that all RGB pixels have the same priority, which means that, when using one
of the first three tests, either all of the RGB sprites are subjected to color calculations, or
none of them are.
If you choose the fourth test, then all RGB sprites will be subjected to color calculations. If
you use the fourth test with paletted sprites, then only pixels whose palette entries have
their most-significant bits set will be subjected to color calculations. This feature makes it
possible to turn potentially large areas of the screen partially transparent simply by
rewriting a palette entry or two. In both of these cases, the color calculation ratio is taken
from bits 0 through 4 of the first sprite color calculation ratio register (see p. 210 of the
VDP2 User’s Manual).
For more on color calculations in general, see chapter 12 of the VDP2 User’s Manual.
SEGA SATURN TECHNICAL BULLETIN #SOA-8
1. Overview
1.1 Introduction
This document provides a programmer’s introduction to and overview of the DSP which
is part of the Saturn System Control Unit, including the architecture of the DSP and the
various programming considerations that architecture implies.
The DSP gains an additional advantage when performing fixed-point calculations, since,
when it stores its results to its data RAM, it can store either the lower or the upper 32 bits
of its 48-bit accumulator, whereas the SH2 must take time to explicitly reformat the
results of fixed-point calculations by using the “xtrct” instruction.
The DSP runs at half the clock speed of the SH2, so, while the DSP can multiply in a
single cycle, that cycle is twice as long as one of the SH2’s cycles.
The DSP’s doesn’t have much memory, and the memory it does have is not mapped onto
the system bus, which means that the DSP must continually take time to copy its data
between its own data RAM and the SH2’s work RAM.
The DSP is difficult to program. A routine that could be coded in SH2 assembly
language in half an hour might take half a day to write, debug, and fully optimize on the
DSP.
1.4 Organization of the DSP’s Memory
The DSP’s RAM is organized in 32-bit words, and it is not addressable in smaller units.
Program memory and data memory are separate; there are 256 words of program RAM
and 256 words of data RAM, the latter being organized in 4 banks of 64 words each.
Each bank of data RAM has its own address and data ports, so that multiple banks can be
accessed in parallel during a single machine cycle.
The DSP’s CPU contains an ALU and a multiplier which function in parallel. There is
no divider. There are also several buses which connect the DSP’s data RAM to its
various registers, and these buses can also operate in parallel. This parallelism allows the
DSP to load a pair of inputs for the multiplier, retrieve the results of a previous
multiplication, add the results of a still earlier multiplication to a running total, and store
that total to data RAM, all during a single cycle.
2. Registers
Each of the DSP’s registers is intended for a specific purpose. There are no general
purpose registers, and there is no stack pointer. The width of each register, as well as the
presence or absence of data paths leading to or from it, depend on the purpose for which
it was intended.
The accumulator is a 48-bit register that holds the results of ALU operations. In
particular, it is used to add up the 48-bit products generated by the multiplier. The ALU
also takes one of its inputs from the accumulator. Most DSP data is 32 bits wide or less,
so sign extension is performed when loading a less-than-48-bit number into the
accumulator. When storing the contents of the accumulator to the DSP’s data RAM,
either the lower or the upper 32 bits may be written.
The P register is the only DSP register besides the accumulator that is 48 bits wide. It has
two functions: it receives the 48-bit products that the multiplier puts out, and it holds the
second ALU input for operations that require a second input.
2.3 RX and RY
The RX and RY registers hold the inputs to the DSP’s multiplier. They are 32 bits wide.
The multiplier multiplies the contents of RX and the contents of RY every cycle, and the
results can be accessed on the following cycle by using the MOV MUL,P instruction.
The registers CT0 through CT3 are 6-bit registers that each address one of the DSP’s four
64-word banks of data RAM. These are the data RAM address ports or index registers,
and all data that is read from or written to the DSP’s data RAM is routed by these
registers.
2.5 The Program Counter
The PC (program counter) register is 8 bits wide and holds the address in program RAM
of the next instruction to be executed.
The LOP and TOP registers are used to control looping and subroutine logic. LOP is a
dedicated loop counter and is 12 bits wide. TOP is 8 bits wide and is used to hold the
address in program RAM of the top of a loop or the return address of a subroutine. The
BTM (loop bottom) instruction examines the contents of LOP, falling through if LOP is
zero, and decrementing LOP and branching back to TOP otherwise. See section 7.1 for a
discussion of how LOP and TOP can be used to create a crude subroutine-calling
mechanism.
The RA0 and WA0 are used to control DMA transfers. RA0 holds the address (divided
by four) in external RAM from which data will be read into the DSP’s program or data
RAM. WA0 holds the address (divided by four) in external RAM to which data will be
written from the DSP’s data RAM. It is not possible to transfer the DSP’s program RAM
to external RAM.
S R 22 Sign bit. This bit is set to 1 when the result of an ALU operation is
negative. In other words, the S bit is set to the value of the most-
significant bit of the ALU result. For most ALU instructions, the most-
significant bit is bit 31, but for the 48-bit addition instruction AD2, the
most-significant bit is bit 47.
Z R 21 Zero bit. This bit is set to 1 when the result of an ALU operation is
zero.
E R 18 Program End Interrupt flag. When this bit is set, the DSP program has
halted and requested an interrupt. Reading the DSP control port resets
this flag.
ES W 17 Execute Step bit. Writing a 1 to this bit while the program is halted
(EX = 0) triggers the execution of the next single step in the program.
LE W 15 Program Counter Load Enable bit. If this bit is 1 when writing to the
DSP control port, then bits 0-7 of the 32-bit value being written will be
loaded into the DSP’s program counter. Otherwise, these bits are
ignored. The DSP’s program counter may only be loaded when the
DSP is halted (EX = 0).
4. Buses
4.1 The D0 Bus
The D0 bus connects the DSP to the outside world and is used during DMA transfers.
Since this bus is used only for DMA, the DSP can continue to execute instructions and
access memory while DMA is occurring, as long as it doesn’t touch the bank of data
RAM that is involved in the DMA transfer. The D0 bus operates at the full clock rate of
the SH2 (28 MHz), unlike the other buses, which operate at half that rate.
The D1 bus is used for most data movement operations. It connects the DSP’s data RAM
to most of the registers and is also used for loading 8-bit immediate data into the DSP’s
registers. See section 5.4 or the “Saturn SCU DSP Programmer’s Reference” sheet for
details of which data movement operations are performed on the D1 bus.
The X bus connects the DSP’s data RAM to the RX and P registers. The X bus allows
the RX register or the P register to be loaded at the same time that other data movement
operations are occurring on the D1 bus and the Y bus.
The Y bus connects the DSP’s data RAM to the RY and A registers. The Y bus allows
the RY register or the accumulator to be loaded at the same time that other data
movement operations are occurring on the D1 bus and the X bus.
For additional information about the architecture of the DSP’s buses, refer to the DSP
block diagram in section 4.1 of the SCU User’s Manual.
5. Instruction Set
5.1 ALU Instructions
These instructions take their input from the accumulator and the P register. The output is
available on the same cycle. In order for the ALU output to be stored in the accumulator,
the MOV ALU,A instruction must be used in parallel with the ALU instruction.
However, even if you don’t use MOV ALU,A, you can still store the ALU result in
memory, and the condition codes will still be set. You can also say CLR A in parallel
with an ALU instruction. The accumulator will be cleared, but the condition codes will
still be set according to the ALU result, and the ALU result can still be stored to memory.
Note that the ALU result must be stored in the accumulator or in data RAM on the same
cycle in which it is computed, or it will be lost. ALU instructions may be used in parallel
with X-bus, Y-bus, and D1-bus instructions
Mnemonic Description S Z CV E x
AD2 Add ALH and ALL to PH and PL S Z CV - -
ADD Add ALL and PL S Z CV - -
AND And ALL with PL SZ0 - - -
NOP Do nothing - - - - - -
OR Or ALL with PL SZ0 - - -
RL Rotate ALL left once; d31 moves to d0 and to C S ZC - - -
RL8 Rotate ALL left 8 times; d24 moves to d0 and to C S ZC - - -
RR Rotate ALL right once; d0 moves to d31 and to C S ZC - - -
SL Shift ALL left once; d31 moves to C S ZC - - -
SR Shift ALL right once arithmetically; d0 moves to C S ZC - - -
SUB Subtract PL from ALL S Z CV - -
XOR Exclusive-or ALL with PL SZ0 - - -
These instructions allow the RX and P registers to be loaded from data RAM, and they
also allow multiplier’s output to be loaded into the P register. The instructions that load
the RX register may be used in parallel with the MOV MUL,P instruction. X-bus
instructions may be used in parallel with ALU, Y-bus, and D1-bus instructions. None of
these instructions affect the processor status flags.
Mnemonic Description
MOV Mn,X Move the word pointed at by the CTn register (n = 0-3) into
RX
MOV MCn,X Move the word pointed at by CTn into RX and increment CTn
MOV MUL,P Move 48-bit multiplier result into PH and PL
MOV Mn,P Move the word pointed at by CTn (n = 0-3) into PL; sign
extend into PH
MOV MCn,P Move the word pointed at by CTn into PL, sign extend, and
increment CTn
5.3 Y-Bus Instructions
These instructions allow the RY register and the accumulator to be loaded from data
RAM, and they also allow ALU output to be loaded into the accumulator. The
instructions that load the RY register may be used in parallel with the MOV ALU,A
instruction or the CLR A instruction. Y-bus instructions may be used in parallel with
ALU, X-bus, and D1-bus instructions. None of these instructions affect the processor
status flags.
Mnemonic Description
MOV Mn,Y Move the word pointed at by the CTn register (n = 0-3) into
RY
MOV MCn,Y Move the word pointed at by CTn (n = 0-3) into RY and
increment CTn
CLR A Set accumulator to 0
MOV ALU,A Gate results of ALU operation into accumulator
MOV Mn,A Move word pointed at by CTn (n = 0-3) into ALL; sign extend
into ALH
MOV MCn,A Move word pointed at by CTn into ALL, sign extend, and
increment CTn
These instructions perform the bulk of the data movement chores. D1-bus instructions
may be used in parallel with ALU, X-bus, and Y-bus instructions. None of these
instructions affect the processor status flags.
Mnemonic Description
MOV imm8,MCn Move 8-bit immediate data to location pointed at by CTn;
increment CTn
MOV imm8,reg Move 8-bit immediate data to RX, PL, RA0, WA0, LOP, TOP,
or CT0-3
MOV ALH,MCn Move upper 32 bits of 48-bit accumulator to data RAM;
increment CTn
MOV ALH,reg Move upper 32 bits of accum. to RX, PL, RA0, WA0, LOP,
TOP, or CT0-3
MOV ALL,MCn Move lower 32 bits of 48-bit accumulator to data RAM;
increment CTn
MOV ALL,reg Move lower 32 bits of accum. to RX, PL, RA0, WA0, LOP,
TOP, or CT0-3
MOV Mn,MCm Move word pointed at by CTn to word pointed at by CTm;
increment CTm
MOV MCn,MCm Move word pointed at by CTn to word at CTm; increment CTn
and CTm.
These instructions are used to load immediate values that are too large for the D1-bus
instructions, or to load an immediate value into the program counter, which the D1-bus
instructions won’t do. MVI instructions may not be used in parallel with other
instructions. None of these instructions affect the processor status flags.
Mnemonic Description
MVI imm25,MCn Move 25-bit immediate data to location pointed at by Ctn;
increment CTn
MVI imm25,reg Move 25-bit immediate data to RX, PL, RA0, WA0, LOP,
or PC
MVI imm19,MCn,cond Move 19-bit immediate data to data RAM conditionally;
increment CTn
MVI imm19,reg,cond Move 19-bit imm. data to RX, PL, RA0, WA0, LOP, or PC
conditionally
For the cond parameter, substitute one of the following: Z, NZ, S, NS, C, NC, T0, NT0,
ZS, or NZS. For example, the instruction MVI 1,RX,Z moves a 1 into the RX register if
and only if the Z flag is set. MVI 1,RX,NZ performs the move if and only if the Z flag
is clear. MVI 1,RX,ZS performs the move if either Z or S is set, and MVI 1,RX,NZS
performs the move if both Z and S are clear. By conditionally moving a value into the
program counter, you can create a conditional subroutine call (see section 7.1 for more
about how to create subroutine calls on the DSP).
These instructions initiate DMA transfers between the DSP’s memory and external
memory. Before the transfer is started, the source or destination address in external
RAM must be stored in register RA0 (when reading data from external memory into the
DSP’s memory) or WA0 (when writing data to external memory from the DSP’s
memory). The addresses stored in RA0 and WA0 are multiplied by four before being
used to address external RAM, so the actual source or destination addresses must be
divided by four before being stored to RA0 or WA0.
The DSP can continue processing while the DMA transfer takes place. If a program
depends on data from a DMA transfer being available, it must poll the T0 flag to make
sure that the DMA transfer has been completed. DMA instructions may not be used in
parallel with other instructions. Apart from the T0 flag, DMA does not affect the
processor status flags.
Mnemonic Description
DMA D0,Mn,imm8 Transfer imm8 32-bit words from work RAM to data RAM
indexed by CTn
DMA D0,PRG,imm8 Transfer imm8 32-bit words from work RAM to program RAM
location 0
DMA Mn,D0,imm8 Transfer imm8 32-bit words from data RAM indexed by CTn
to work RAM
DMA D0,Mn,count Transfer from work RAM to data RAM indexed by CTn
DMA D0,PRG,count Transfer from work RAM to program RAM location 0
DMA Mn,D0,count Transfer from data RAM indexed by CTn to work RAM
DMAH D0,Mn,imm8 Transfer imm8 32-bit words from work RAM to data RAM
indexed by CTn
DMAH D0,PRG,imm8 Transfer imm8 32-bit words from work RAM to program RAM
location 0
DMAH Mn,D0,imm8 Transfer imm8 32-bit words from data RAM indexed by CTn
to work RAM
DMAH D0,Mn,count Transfer from work RAM to data RAM indexed by CTn
DMAH D0,PRG,count Transfer from work RAM to program RAM location 0
DMAH Mn,D0,count Transfer from data RAM indexed by CTn to work RAM
For the count parameter, substitute either Mn or MCn (n = 0-3). The number of words
to be transferred is read from the specified location in data RAM n. If MCn is specified,
then register CTn is incremented after the transfer count is read.
The difference between the DMA instructions and the DMAH instructions is that the
DMAH instructions reset the RA0 or WA0 registers to their starting values after the
transfer is complete, allowing the same transfer to be performed repeatedly without the
need to reinitialize the registers. The DMA instructions leave RA0 and WA0 pointing to
the long-word immediately following the last long-word read or written.
These instructions jump to a given location in program RAM. Note that, since the DSP
prefetches one instruction ahead, the instruction immediately following a jump
instruction will be executed whether the jump is taken or not. Jump instructions may not
be used in parallel with other instructions. None of these instructions affect the
processor status flags.
Mnemonic Description
JMP imm8 Unconditional jump
JMP cond,imm8 Conditional jump
For the cond parameter, substitute one of the following: Z, NZ, S, NS, C, NC, T0, NT0,
ZS, or NZS. For example, the instruction JMP FOO,Z jumps to the label FOO if and
only if the Z flag is set. JMP FOO,NZ jumps if and only if the Z flag is clear. JMP
FOO,ZS jumps if either Z or S is set, and JMP FOO,NZS jumps if both Z and S are
clear.
Mnemonic Description
BTM If LOP=0, do nothing, else decrement LOP and set the PC to
TOP
LPS Repeat the next instruction LOP+1 times
5.9 Halt Instructions
These instructions halt the DSP with or without an interrupt. They may not be used in
parallel with other instructions.
Mnemonic Description S Z CV E x
END Halt without interrupt - - - - -0
ENDI Halt with interrupt - - - - 10
6. Parallelism
The DSP’s two main functional units (the ALU and the multiplier) can operate in
parallel, as can its four buses and its four banks of data RAM. As a result, the DSP can
execute up to six instructions in a single cycle, including any or all of the following: one
ALU instruction, an instruction to load the RX or P register, the MOV MUL, P
instruction, an instruction to load the RY register or the accumulator, either the MOV
ALU, A instruction or the CLR A instruction, and a D1-bus instruction. These are the
only instructions that can be used in parallel with each other; other instructions require a
cycle of their very own.
7. Programming Techniques
7.1 Subroutines
When the MVI (move immediate) instruction is used to alter the contents of the program
counter, the previous value of the program counter (which points at the instruction
immediately following the MVI) is saved in the TOP register, yielding a crude jump-to-
subroutine mechanism. To jump to a subroutine, issue an instruction of the form MVI
SUB,PC. Assuming that the LOP register has been initialized to something other than
zero, the BTM instruction can then be used to return from the subroutine.
Because each of the DSP’s four index registers is dedicated to a single bank of the DSP’s
data RAM, data structures that need to be accessed simultaneously should reside in
different data RAM banks. If, for example, you want to multiply a matrix by a series of
vectors, then the matrix should be in one bank, the input vectors in a second bank, and the
output vectors in a third. Otherwise, time will be wasted in unnecessarily loading and
reloading index registers.
The DSP is much more efficient when it can read and write data sequentially, so it pays
to structure your data accordingly. It may even pay to have the DSP reformat some of its
data before it starts crunching on it, although the DSP is not terribly efficient at general-
purpose data processing. For an example of this, see the matrix multiplication program in
section 8.2.
The DSP’s advantage over the SH2 lies almost entirely in its ability to perform multiple
operations in parallel, and optimizing this parallelism is crucial to using the DSP
effectively. Strive to keep the multiplier fed. Don’t use an MVI instruction, which
monopolizes an entire cycle, when you can use a MOV instruction, which can be
executed in parallel with other instructions. You can only load one index register per
cycle, so make sure that at least most of your data is stored in the order in which your
program will need it. Remember that the accumulator can be cleared (using CLR A) for
a new sum of products in the same cycle that the previous sum of products is computed
and stored.
8. Examples
The formatting conventions used in these examples are consistent with those supported
by the DSP assembler. It may be helpful to step through these examples using the DSP
simulator. Further examples may be found in the DSP Assembler manual. See also the
Saturn SCU DSP demonstration program.
This example computes the dot product of two 3-element vectors. Recall that the dot
product of the vectors (x1, y1, z1) and (x2, y2, z2) is defined as x1*x2 + y1*y2 + z1*z2.
We assume that the two vectors are already loaded into the DSP’s data RAM: the first at
locations 0 through 2 of data RAM 0, and the second at the same locations in data RAM
1. The elements of the vectors are presumed to be 16.16 fixed point numbers. The result
is stored in location 0 of data RAM 2.
This example multiplies two 3x3 matrices together. The entries in the matrices are
presumed to be 16.16 fixed-point numbers. The matrices are initially in work RAM, so
the DSP must transfer them into its data RAM before multiplying them together. When
the product has been computed, it will be transferred to work RAM.
org 0
;
; Load the second matrix first, because we’re going to transpose it
; while the first matrix is loading. Note that the work RAM address
; of the matrix is divided by four before being loaded into RA0.
;
mov M2Tmp,ct3 ; Load second matrix into data RAM 3.
mvi Mat2Addr>>2,ra0
dma d0,m3,9 ; Transfer the 9 words of the second matrix.
DMAWtM2: jmp t0,DMAWtM2 ; Wait for DMA to be done.
mov Mat1,ct0 ; Prefetched: happens each time jump does.
;
; Now load the first matrix into data RAM 0.
;
mvi Mat1Addr>>2,ra0
dma d0,m0,9 ; Transfer the 9 words of the first matrix.
;
; While the first matrix is loading, copy the second matrix from data
; RAM 3 to data RAM 1, transposing it as we go. We want the second
; matrix to be transposed in order to index the elements of the matrix
; more efficiently during the actual matrix multiplication.
;
mov M2Tmp,ct3
mov Mat2,ct1 ; Copy the first row of the original matrix
mov mc3,mc1 ; to the first column of the transposed
mov Mat2+3,ct1 ; matrix.
mov mc3,mc1
mov Mat2+6,ct1
mov mc3,mc1
The following page contains a quick reference table for SCU DSP
programming.
Saturn SCU DSP Programmer’s Reference
Instruction Description T SZ CVE x ALU Instructions
AD2 Add ACH and ACL to PH and PL - SZ CV - - ALU results will not be stored in the
ADD Add ACL and PL - SZ CV - - accumulator unless MOV ALU, A is used.
AND And ACL with PL - SZ 0 - - - ALU results may be stored in memory,
A NOP Do nothing - - - - - - - and condition codes will be set correctly,
OR Or ACL with PL - SZ 0 - - - even if MOV ALU, A is not used.
L RL Rotate ACL left once; d31 moves to d0 and to C - SZ C - - - If CLR A is used, condition codes are still
RL8 Rotate ACL left 8 times; d24 moves to d0 and to C - SZ C - - - set based on the ALU result, and the ALU
U RR Rotate ACL right once; d0 moves to d31 and to C - SZ C - - - result may still be stored to memory.
SL Shift ACL left once; d31 moves to C - SZ C - - - The ALU result must be retrieved or
SR Shift ACL right once arithmetically; d0 moves to C - SZ C - - - stored in the same cycle in which it is
SUB Subtract PL from ACL - SZ CV - - computed, or it will be lost.
XOR Exclusive-or ACL with PL - SZ 0 - - - Multiplication
MOV dram+,X Move data RAM to RX - - - - - - - The product of the RX and RY registers
X MOV MUL,P Move 48-bit multipler result into PH and PL - - - - - - - can be read by using MOV MUL, P one
MOV dram+,P Move data RAM to PL and sign extend into PH - - - - - - - cycle after the values of RX and/or RY
MOV dram+,Y Move data RAM to RY - - - - - - - are set. The product remains available
Y CLR A Set accumulator to 0 - - - - - - - until RX or RY is altered.
MOV ALU,A Gate results of ALU operation into accumulator - - - - - - - Immediate Data
MOV dram+,A Move data RAM to ACL and sign extend into ACH - - - - - - -
Immediate data is signed; sign extension is
MOV imm8,dest1 Move short immediate data to data RAM or register - - - - - - - performed when moving immediate data
D MOV ALH,dest1 Move upper 32 bits of 48-bit accumulator - - - - - - - into a register or into memory.
1 MOV ALL,dest1 Move lower 32 bits of 48-bit accumulator - - - - - - -
DMA
MOV dram+,dest1 Move data RAM to data RAM or register - - - - - - -
MVI imm25,dest2 Move immediate data to data RAM or register - - - - - - - Addresses stored in RA0 or WA0 are
multiplied by four before being used to
MVI imm19,dest2,cond Move immediate data conditionally - - - - - - -
address external memory.
DMA D0,dpram,imm8 Transfer from external RAM to data/program RAM 1 - - - - - - When DMAH is used, RA0 or WA0 is
DMA dram,D0,imm8 Transfer from data RAM to external RAM 1- - - - - - reset to its starting value after the transfer
DMA D0,dpram,ctr Transfer from external RAM to data/program RAM 1 - - - - - - is complete, allowing the same transfer to
DMA dram,D0,ctr Transfer from data RAM to external RAM 1- - - - - - be performed repeatedly without
DMAH D0,dpram,imm8 Transfer from external RAM to data/program RAM 1 - - - - - - reinitializing RA0 or WA0.
DMAH dram,D0,imm8 Transfer from data RAM to external RAM 1- - - - - -
DMAH D0,dpram,ctr Transfer from external RAM to data/program RAM 1 - - - - - - Jump Instructions
DMAH dram,D0,ctr Transfer from data RAM to external RAM 1- - - - - - JMP Z,imm8 jumps if the Z flag is set
JMP imm8 Unconditional jump - - - - - - - JMP NZ,imm8 jumps if Z is clear.
JMP cond,imm8 Conditional jump - - - - - - - JMP ZS,imm8 jumps if either Z or S is set.
JMP NZS,imm8 jumps if Z and S are both
BTM If LOP=0, do nothing, else decrement LOP; PC=TOP - - - - - - -
clear.
LPS Repeat the next instruction LOP+1 times - - - - - - - The instruction after a JMP or BTM
END Halt without interrupt - - - - - - 0 instruction is always executed, whether
ENDI Halt with interrupt - - - - - 1 0 the jump is taken or not.
cond = Z, NZ, S, NS, C, NC, T0, NT0, ZS, NZS dram = M0-M3 Subroutines
ctr = M0-M3, MC0-MC3 dram+ = M0-M3 or MC0-MC3 Subroutines can be created by taking
dest1 = MC0-MC3, RX, PL, RA0, WA0, LOP, TOP, CT0-CT3 imm8 = 8-bit immediate data advantage of the fact that when loading
dest2 = MC0-MC3, RX, PL, RA0, WA0, LOP, PC imm19 = 19-bit immediate data an immediate value into the PC using the
dpram = M0-M3 or PRG imm25 = 25-bit immediate data MVI instruction, the previous value of the
Data Movement Table PC is copied to the TOP register. The
The following table shows which source/destination combinations are supported by the DSP’s various value that gets copied to the TOP register
move instructions and whether the data movement is performed by the X bus, the Y bus, the D1 bus, or is the address in program RAM of the
by MVI. instruction immediately following the MVI
instruction. If the LOP register is
Destinations initialized to 1, then the BTM instruction
Sources A P RX RY RA0 WA0 LOP TOP PC CTn mem can be used to return from the subroutine,
ALH - D1 D1 - D1 D1 D1 D1 - D1 D1 as follows:
ALL - D1 D1 - D1 D1 D1 D1 - D1 D1 mov 1,lop ; D1 bus.
mem Y X X Y D1 D1 D1 D1 - D1 D1 mvi Sub,pc ; Go to subroutine.
imm8 - D1 D1 - D1 D1 D1 D1 - D1 D1 nop ; Gets prefetched.
.
imm25 - MVI MVI - MVI MVI MVI - MVI - - .
DSP Registers Processor Status Flags Sub: mov ... ; Whatever.
Name Size Description Name Definition .
.
A (ALH/ALL) 48 Receives results of ALU operations PR Pause reset btm ; Return to nop.
P (PH/PL) 48 Receives results from multiplier EP Execute pause
RX 32 Multiplier input register T0 Transfer 0 (DMA flag) Note that the NOP gets executed twice:
RY 32 Multiplier input register S Sign once when the subroutine call is made,
CT0-CT3 6 Data RAM index registers Z Zero and once after the subroutine returns.
LOP 12 Loop counter C Carry
SCU Registers Relating to the DSP
TOP 8 Holds loop-start or subroutine return address V Overflow/underflow
PC 8 Program counter E End interrupt 0x25fe0080 Program control port
RA0 32 DMA address for reading from external RAM ES Execute single step 0x25fe0084 Program RAM data port
WA0 32 DMA address for writing to external RAM EX Execution control 0x25fe0088 Data RAM address port
LE PC load enable 0x25fe008c Data RAM data port
SEGA SATURN TECHNICAL BULLETIN #SOA-10
Introduction
The Saturn SCU DSP Demonstration program provides sample code which runs on the
DSP, along with a shell program written in Gnu C which loads the program into the DSP
and executes it. The shell program uses the DSP support functions found in the DSP
module of the Sega Standard Saturn Library for loading, starting, and halting the DSP.
The demonstration program itself is available on Sega’s BBS in the Saturn conference as
the file DSP_DEMO.ZIP.
List of Files
The source and executable files are all in the directory “code”. Here’s a brief description
of each file.
The DSP sample program performs 3D point transformation, i.e. it multiplies a 4x3
homogeneous matrix by an arbitrary list of 3-element vectors (the fourth element of each
vector is presumed to be 1). The program attempts to take full advantage of the
parallelism built into the DSP, and the transformation matrix, the input points, and the
output points are transferred using the SCU’s DMA capability. The sample code
performs point transformations roughly a third faster than the equivalent code written in
SH2 assembly language, even allowing for the time spent transferring data into and out of
the DSP’s memory. It is hoped that this program is general and useful enough to be used
in an actual development environment.
The program accepts parameters in the form of a parameter block having the following
format:
If you specify more points than the DSP can hold in its memory at one time, the program
will load and transform the points in batches that will fit into the DSP’s data RAM.
The addresses are divided by four because the contents of the DSP’s DMA read and write
registers get multiplied by four before they are used, and the SH2 is better suited to
performing clerical work such as adjusting parameter formats than the DSP is.
The program was built using Gnu C version 95q1 and version 2.00 of the SCU DSP
assembler. The makefile provided will rebuild the executable file if you make any
changes. The makefile is configured to produce an executable file in S-record format.
See the next section for instructions on how to alter the makefile so that it produces
output in COFF format. Once the program has been downloaded, execute it starting at
address 0x6004000. You won’t see anything on the screen; the shell program just loads
and runs the DSP program and then drops into an infinite loop. In order to check the
results of the DSP program, you must break out of the shell program and examine the
array OutputPts.
You can get an executable file in COFF format by modifying the makefile as follows:
first, for formality’s sake, change all of the “.sre” file extensions to “.cof”. Then find the
OUPUT_FORMAT instruction in the portion of the makefile that builds the linker script,
and change “srec” to “coff-sh”. That’s it.
SEGA SATURN TECHNICAL BULLETIN #SOA-11
Introduction
The Saturn’s rotating background hardware allows you to rotate a character or bit
mapped image in several different ways. Scaling and translation are also supported. This
document provides an overview of the capabilities and limitations of this hardware. It is
not intended to fully document every feature of the hardware, but to clarify the concepts
underlying its operation. We presume that you have an understanding of basic 3D
graphics concepts such as rotation matrices.
Before a background is rotated, it exists in the XY plane, with its upper-left-hand corner
at the origin. When the VDP2 rotates and otherwise transforms such a background, it
performs a number of operations in a fixed sequence (note that this description, while
conceptually accurate, does not necessarily reflect the manner in which these operations
are implemented in the hardware):
Step 2. The translated background is rotated twice around a center of rotation that you
specify. First, the background is rotated around an axis that passes through the center
point and is parallel to the Z axis, i.e. the background rotates in the XY plane. Then the
background is rotated around an axis that passes through the center point and is parallel
to either the horizontal axis (the X axis) or the vertical axis (the Y axis). Rotation around
a horizontal axis and rotation around a vertical axis are mutually exclusive. In practice,
these two rotations are accomplished using a single rotation matrix in the rotation
parameter table, but it may be helpful to think of them as being separate.
Step 3. The twice-rotated background is now projected onto the screen by scaling each
line or column of the display to simulate perspective: lines or columns that are far away
are scaled down; lines or columns that are close are scaled up. If you rotated around a
horizontal axis in step 3, then the transformed background is scaled line-by-line. If you
rotated around a vertical axis, then it is scaled column-by-column.
Step 4. The transformed and projected background is rotated one last time around the Z
axis. This is equivalent to what you would expect to see while banking in a flight
simulator. Note that this last rotation can be applied to the VDP1 frame buffer as well,
allowing the sprites and the background to rotate together. To do this, set the TVM field
of the VDP1’s TV mode register to either 2 (Rotation 16 mode) or 3 (Rotation 8 mode).
For further details, see pp. 15 and 36-37 of the VDP1 User’s Manual.
Figure 2 (next page) illustrates this sequence of events. Of course, not all of these
transformations need be performed, and any or all of them can be disabled by specifying
a rotation or translation of zero.
The various rotation, translation, and scaling operations are controlled by the rotation
parameter table (pp. 153-156 of the VDP2 User’s Manual) and the coefficient table (ibid.,
pp. 163-165). In general, the rotation parameter table controls 3D transformation, while
the coefficient table controls 2D perspective projection, though the coefficient table can
be used to perform scaling as well. Here’s how each step of the above sequence of
transformations is controlled.
Step 1. The initial translation in X and Y is controlled by the 24-bit signed fixed-point
values Mx and My, found at offsets 0x44 and 0x48 in the rotation parameter table.
Positive values cause the background to move up and to the left on the screen.
Step 2. These rotations are controlled by a rotation matrix stored in the rotation
parameter table. Each entry in the matrix is a 14-bit signed fixed point value. The
hardware performs these two initial rotations according to the following formula:
| A B C |
(X Y Z) * | D E F | = (XT Y T ZT)
| G H I |
| 0 -1 0 |
| 1 0 0 |
| 0 0 1 |
Z Z
X X
Y Y
Figure 2a Figure 2b
Initial orientation of the background. Translation in the XY plane.
Z Z
X X
Y Y
Figure 2c Figure 2d
Rotation around an arbitrary Rotation around an arbitrary
perpendicular axis. horizontal axis.
Figure 2f Figure 2g
2D projection. Rotation about the Z axis.
The matrix stored in the rotation parameter table will, in general, be the product of a Z-
rotation matrix and either an X-rotation matrix or a Y-rotation matrix. The Z-rotation is
normally performed first.
The coordinates of the point around which these rotations are performed are specified in
the rotation parameter table as three 14-bit signed integers at offsets 0x3c, 0x3e, and
0x40. If the coordinates of the center of rotation are (CX CY CZ), then a more complete
expression of the formula used for rotating points during these steps of the transformation
process would be
| A B C |
(X-C X Y-C Y Z-CZ) * | D E F | + (C X CY CZ) = (XT Y T ZT)
| G H I |
The rotation parameter table stores the matrix entries as 14-bit signed fixed point
numbers at offsets 0x1c through 0x30. Only the first two rows of the matrix are stored.
The class of rotations supported by the hardware is sufficiently restricted that the third
row can be done without.
Step 3. It is at this stage that the coefficient table comes into play. A coefficient must be
calculated for each row or column of the display, depending on whether rotation was
performed about a horizontal axis or a vertical axis. Each coefficient specifies the
amount of perspective distortion to apply to each line or column of the screen. Smaller
coefficients cause a greater degree of magnification. The coefficients are fixed-point
numbers, and a couple of formats are available (see p. 165 of the VDP2 User’s Manual).
The coefficient tables may also be used to scale the projected image: multiplying all of
the coefficients by a constant causes the image on the screen to zoom in or out. Scaling
the image can also be accomplished with the matrix in the rotation parameter table.
Refer to the file scl_ro00.C in the Saturn Basic Library to see how the coefficients are
actually calculated. The calculations are performed in the functions SCL_RotateX and
SCL_RotateY. Look for assignments to SclK_TableBuff[TbNum][i].
The range of Z coordinates that get projected onto the screen, as well as the degree of
perspective compression, is determined by the point of view. The coordinates of the
point of view (P X P Y P Z) are 14-bit signed integers found at offsets 0x34, 0x36, and 0x38
in the rotation parameter table. The Z coordinate of the point of view corresponds to the
distance from the point of view to the background before any transformations are
performed. The X and Y coordinates are normally set to the center of the screen, e.g. 160
and 112 for a 320x224 screen.
Step 4. The final rotation of the projected image about the Z axis is a 2D rotation, and it
is performed by scanning the projected image “diagonally.” The rotation parameter table
specifies the horizontal and vertical offsets from the unrotated upper-left-hand corner of
the screen to the rotated upper-left-hand corner of the screen using a pair of 23-bit signed
fixed-point values (Xst and Yst) at offsets 0 and 4. In addition, delta-x and delta-y values
giving the angles of the rotated X and Y axes are specified in the rotation parameter table
as 13-bit signed fixed-point numbers at offsets 0xc and 0x10 (for the rotated Y axis) and
0x14 and 0x18 (for the rotated X axis).
If X or Y rotation is being performed, then the coefficient table must also be scanned
differently in order to perform this final Z rotation. Both the rate and the direction in
which the coefficient table is scanned for each row and for each column of pixels varies
with the angle of rotation. This is controlled by the values KAst, ∆KAst and ∆KAx at
offsets 0x54, 0x58, and 0x5c in the rotation parameter table. KAst determines where
scanning of the coefficient table begins; ∆KAst determines the increment which will be
used to step through the coefficient table line-by-line, and ∆KAx determines the
increment which will be used to step through the table column-by-column. Note that
these values are fixed-point values, and fractional increments are possible. Refer to the
file scl_ro00.C in the Saturn Basic Library to see how to set these values. The values are
set in the functions SCL_RotateX() and SCL_RotateY(). Look for assignments to
SclRotregBuff[TbNum].k_tab, SclRotregBuff[TbNum].k_delta.x, and
SclRotregBuff[TbNum].k_delta.y.
SEGA SATURN TECHNICAL BULLETIN #SOA-12
In the IP.BIN file, at address 40H, all games must have the appropriate area symbols for
the regions in which the game is to be released, along with the corresponding area code at
address E00H. For example:
040H UT
...
Please make sure that the area symbols and area codes match in order, and also pad out any
unnecessary area codes with spaces making sure not to change other parts of the code. The
final IP.BIN must be 4096 bytes.
SEGA SATURN TECHNICAL BULLETIN # 4 2
(PRELIMINARY)
• Table 1.2 Relationship between Amount of Movement (D7~D0) and Sign and
Over Bits
Amount of -257 -256 -255 ... -2 -1 +0 +1 +2 ... +254 +255 +256
Actual or or
Movement less more
D7~D0 xxH 00H 01H ... FEH FFH 00H 01H 02H ... FEH FFH xxH
Value
Y/X Sign 1 1 1 ... 1 1 0 0 0 ... 0 0 0
Y/X Over 1 0 0 ... 0 0 0 0 0 ... 0 0 1
Notes *1 D7 through D0 is not signed. Pay attention to changes in the Y and Y Over bits and X and Y Sign
bits when calculating the amount of movement.
*2 When the Y and X Over bits are set, the amount of movement (D7~D0) becomes undefined, so
always check these bits.
• Direction of mouse movement
• The signs in the figure indicate whether the Sign flag is on or off.
• The arrows indicate the direction of mouse movement.
-DY
-00H
(Up)
(Left)
-00H -FFH -FFH
-DX +00H +00H +FFH +DX
(Right)
(Down)
+FFH
+DY
SEGA SATURN TECHNICAL BULLETIN # 4 5
(PRELIMINARY)
KEY1 ON OFF
KEY2 ON OFF
KEY3 ON OFF
Keycode
Transmitted
KEY1 KEY2 KEY3 KEY1 KEY2 KEY3
Make Make Make Break Break Break
KEY1 ON OFF
KEY2 ON
KEY3 ON OFF ON
Keycode
Transmitted
KEY1 KEY2 KEY3 KEY1 KEY3
Make Make Make Break Break
Wraparound Wraparound
occurs cleared
KEY1 ON OFF
KEY2 ON
TS TR TR TR TS TR
Keycode
Transmitted
KEY1 KEY1 KEY1 KEY1 KEY1 KEY2 KEY1 KEY2
Make MAKE Make Make Make Make Break Make
1 Overview
1) Data cartridges
This data cartridge is a ROM cartridge for data that uses the A path
that supplements memory when the main memory is insufficient.
Its address appears in the A-Bus CS0 (22000000H) area.
2) Restrictions on Use
Data cartridges must contain only data; placing program code in
them is prohibited, regardless of whether the code is executed
directly or executed after transfer.
Placing program code in cartridges can be made into a security hole
by creating a ROM with this portion rewritten. In future versions of
Saturn, it will no longer be possible to access the contents of the
cartridge, so be sure to follow this rule.
3) Corresponding peripheral
The peripheral that corresponds to the SYSTEM ID of the CD-ROM
has an "R" added.
Example: Using a Sega Saturn standard pad with a data cartridge
"JR∆∆∆∆∆∆∆∆∆∆∆∆∆∆" "∆" = space (20H)
Reference: Programmer's Guide, Vol. 1, Disk Format Standards Specification, section 4, "Boot System," p. 28.
4 Cautions on Notation
Rules
Usable characters
All characters usable in system IDs are ASCII code en-sized
alphanumeric characters. In some items, commas (,), slashes (/),
hyphens (-), and colons (:) may be used.
Entry
• All entry is flush left unless otherwise indicated. Do not start
entries with spaces.
• All open areas are ASCII code 20H unless otherwise indicated.
Definition of expressions
The ∆ sign and the word "space" used in the explanation indicate
ASCII code 20H. Also, em-size characters are used in this manual for
greater legibility.
Other definitions
Always fill in RESERVED areas with 00H.
*1 Fill in this area with spaces (20H).
1 Outline
This extended RAM cartridge is used by connecting it to an A-Bus slot
in SEGASaturn's main unit. It is mounted with the 8 Mbit portion
(configuration : 4 Mbit x 2) of DRAM. It can be expanded to the
maximum of 32 Mbit.
3 Memory Map
Since 22400000h - 227FFFFFnh on SEGASATURN's memory map is
allocated to this cartridge, the usable area is divided into DRAM0 and
DRAM1 as shown below:
22600000h
2267FFFFh DRAM1 DRAM1
227FFFFFh
1153
4 Initialization
Write "1" to the address: 257EFFFEh (W/O) in word size.
Note: Be sure to set up with "1". If you use any other data, it would not
work well.the results are undefined.
5 AboutCartridge ID
The external cartridge's ID address 24FFFFFFh (R/O) is the same as the
" Power Memory"'s. You should consider the future expendability of ID
and make it work with a 32Mbit cartridge as well by verifying it with
both "8MBit=5Ah" and "32Mbit=5Ch."Consideration should given to
future expandability by verifying both 8Mbit (ID 5Ah) and 32Mbit (ID
5Ch).
• If only 8Mbit is verified, SEGASaturn may not work with a 32Mbit
cartridge.
Table 2 . Cartridge ID
Address=24FFFFFFh (R/O)
Cartridge Capacity Extended RAM Cartridge ID
8Mbit 5Ah
32Mbit 5Ch (Reserved)
7 Usable Mode
Read-out from Extended RAM Cartridge
• From normal access, you can use BYTEREAD, WORDREAD,
LONGWORD ACCESS, and BURSTREAD. If BYTE, WORD, or
LONGWORD is used, CPU will do 32-bit READ.
• As for DMA, you can use either SH2 DMA or SCU DMA.
2153
Access Speed
It will take approximately four times the amount of time required for
WORKRAM.
Reference: Binder [" Hardware Manual Vol. 1]) SCU Users Manual/A-
Bus set register/per'[illegible]123 CD-
ROM/SEGA/a/a04/non/p0[illegible] 13.htm.
9 Access Procedure
Please follow the following steps from the initialization of the
extended RAM cartridge to memory access:
1. Verify the cartridge ID. (in the case of 8Mbit, this is "5Ah") - also
remember to do the same for a 32Mbit(ID=5Ch) cartridge as well. If
verification is done only with 8Mbit (ID=5An), in future, when the
32Mbit extended RAM cartridge becomes available on the market,
you will find that it will not work with this application. Refer to the
previous cartridge ID section.
3153
2. If the cartridge ID cannot be verified, please display a message
prompting its connection.
4153
Example Cartridge ID Error Message
"The extended RAM cartridge is not inserted correctly. Turn off power
and reinsert the extended RAM
cartridge."
0 10 20 30 40
0 i
The extended RAM
cartridge is not
10
inserted properly.
Please turn off
20
power and reinsert
the extended RAM
cartridge.
---For the layout of the error message, see the attached material.
[Should the error example follow this section, rather than fall on the
last page??]
3. Write "1" in word size on the initialization address 257EFFFEh
(W/O).
• - Be sure to set "1" in word size. (this must be rigidly adhered
to)
4. Set the A-Bus set register and A-Bus refresh register. See above.
(Register's set value)
10 Others
5153
Switching of System Clock
When you changed a system clock using the SYS_CHGSYSCK()
function, "the contents in the "extended RAM cartridge" cannot
guaranteed. In such a case, initialize the cartridge and retransfer the
data.
6153
When Using Programming BOXBox
, Bear in Mind the Following: When SIMM is packaged with the
programming box, its address is duplicated in the "expanded RAM
cartridge. Thecartridge." Detach SIMM using the following method: A
Method of detaching SIMM: Write 0 in address 257FFFCh in
LONGWORD.The SIMM may be disabled with a LONGWORD write
“0” to address 257FFFCh.
7153
8153
SEGA SATURN TECHNICAL BULLETIN # 4 8
(PRELIMINARY)
1. A type which puts in force both royalties and the legal obligation to
make an express mention of the licensing agreement in existence.
• TrueMotion
• Cinepak
• Qsound
• Ysound
1
2. A type which puts in force only the legal obligation to make an
express mention of the licensing agreement in existence.
• Cyber Sound
Official Tools
A type of tool which SEGA literally recognizes as its official tools. SEGA
serves as a worldwide source for technical support of these tools. It
provides user support by closely working with dealers and vendors.
These tools are strongly recommended at SEGA-sponsored meetings
designed to explain SEGA technologies.
• SNASM
• CartDev
• PRG-BOX
• VCD-System
• CDE-100
• Mirage
• SOFTIMAGE
Equivalent Tools
A type of tool which, according to Sega’s judgment, would not present
any problems as a development tool from the standpoint of both
technology and support service. In connection with the use of library or
data format offered by SEGA, SEGA's consent is required for the sale of
those items to licensees. The responsibility for technical support for
equivalent tools lies with dealers and vendors. SEGA's support does
not go beyond the library and data format which it offers.
• N-World SATURN Express (Nichimen Graphics Co.)
• Power Animator SATURN Export (Alias/wavefront Co.)
• Blade Render SS Converter (Polygon Research Co.)
• Audio Stack (CRC Research Institute)
• GAMUT-SG 3D-STUDIO (Animetix)
Other
FontWorks... Character fonts which make it possible to use in
SATURN title through purchase. Terms for licensing is rigidly defined
in an agreement signed between a SEGA licensee and FontWorks.
2
SEGA SATURN TECHNICAL BULLETIN # 5 1
(PRELIMINARY)
Re: Restrictions for the MC68EC000 Sound CPU and the SCSP
Restriction 1.
Instructions that cannot be used with the MC68EC000 Sound CPU
RESET instruction
TAS instruction
Details
¥ The above instructions are not supported in the Sega Saturn.
Consequently, an incompatibility error may occur if the instructions
are used. If the Sound CPU and the SCSP must be reset, always have
the SMPC issue the reset command from the main system.
¥ Reference
Hardware Manual Volume 1, SMPC User's Manual, Chapter 2,
"SMPC Commands"
¥ Supplement
Incompatibility errors do not occur if the application uses the sound
driver provided by Sega. However, this restriction must be strictly
observed for applications that use other sound drivers for the 68000.
1
Restriction 2.
Prohibition of extended stop time for the MC68EC000 Sound CPU
Details
¥ Conditions under which the Sound CPU can be stopped:
The Sound CPU can be stopped only while a program (such as the
sound driver) for the Sound CPU is being loaded to the sound
RAM. Stopping the Sound CPU is prohibited at all other times.
¥ Stopping procedure:
To stop the Sound CPU, use the Sound OFF command, which is
one of the SMPC commands. To start the Sound CPU, issue the
Sound ON command, which is also one of the SMPC commands.
<Note>
Using any other method to stop or start the Sound CPU is strictly
prohibited.
¥ Supplement 1
When loading the sound driver, start the Sound CPU immediately
after loading is completed. Sound driver startup must not be
delayed due to other processes.
¥ Supplement 2
Do not stop the Sound CPU even if the main system (SH2) is using
the sound driver or if the Sound CPU has nothing to process.
In these cases, have the Sound CPU execute a program that loops
endlessly. (For detailed instructions, refer to the SMPSYS.C sample
program in IP.BIN.)
¥ Supplement 3
The following functions are found in the SEGA_SND.LIB,
SEGA_SND.A, and LIBSGL.A libraries presented by Sega:
SND_Init()
SlInitSound()
Users who use these functions to initialize and start the Sound CPU
and the SCSP can disregard this restriction because the initialization
2
and startup processes are executed in the library function. However,
users who use other functions to initialize and start the Sound CPU
and the SCSP must strictly observe this restriction.
3
TM
l
n tia
de
nfi
Co
GA
Program Library
User's Guide 3
SE
Doc. # ST-135-R4-092295
DMA Library...................................................................................................... 32
1.0 Guide ...............................................................................................................................................32
1.1 Objective ................................................................................................................................ 32
1.3 Precautions ............................................................................................................................ 32
1.4 Calling Sequence ................................................................................................................... 33
2.0 Reference ........................................................................................................................................34
2.1 Data List ................................................................................................................................. 34
2.2 Data Specifications ................................................................................................................ 35
2.3 List of Functions ..................................................................................................................... 41
2.4 Function Specifications .......................................................................................................... 42
Cache Library.................................................................................................... 50
1.0 Guide ...............................................................................................................................................50
1.1 Objective ................................................................................................................................ 50
1.2 Overview ................................................................................................................................ 50
2.0 Reference ........................................................................................................................................51
2.1 List of Functions ..................................................................................................................... 51
2.2 Function Specifications .......................................................................................................... 51
2.3 List of Function Format Macros ............................................................................................. 52
2.4 Function Format Macro Specification .................................................................................... 52
4
Memory Management Library
............................................................................. 66
1.0 Guide ...............................................................................................................................................66
1.1 Objective ................................................................................................................................66
1.2 Overview ................................................................................................................................66
1.3 Calling Sequence ...................................................................................................................66
2.0 Reference ........................................................................................................................................67
2.1 List of Functions .....................................................................................................................67
2.2 Function Specifications ..........................................................................................................67
Timer Library..................................................................................................... 69
1.0 Guide ...............................................................................................................................................69
1.1 Objective ................................................................................................................................69
1.2 Overview ................................................................................................................................69
1.3 Detailed Information ...............................................................................................................70
2.0 Reference ........................................................................................................................................72
2.1 List of Function Format Macros .............................................................................................72
2.2 Function Specifications ..........................................................................................................73
1.1 Objective
The Sound Interface Library interfaces the sound sub-system and the main hardware
system (including the CD system), and enables control over sound playback and related
processes.
1.2 Overview
The sound sub-system controls the playback of song sequences, PCM audio and CD
audio. The sound system must be activated before the sound playback can be con-
trolled. Sound data must then be transferred to the sound memory as a performance
setup for song sequences and PCM audio. The resulting sound control is monitored by
status information provided by the library. This chapter explains the details of the
Sound Interface Library in the order shown in the following list. For more information,
see also the sound driver system interface in the Sound Development Manual (ST-081-R5-
062894).
• Sound system startup
• Performance setup
• Sound control
• Status acquisition
void sndStart ()
{
SndIniDt sys_ini; /* data area for system startup
6
1.4 Performance Setup
Sequence
Sequence data (song data, sound effect data), executed by sound control functions, must
be transferred to the sound memory. Transfers must be performed according to the
current sound area map. (For more information about the sound area map, see the
Sound Development Manual.) The calling sequence is shown in the Sound Control section
below.
PCM
Refer to the information on the sound driver system interface in the Sound Development
Manual for setting up PCM performances.
Calling Sequence
The following calling sequence is used until the start of a song sequence.
void sndCnt()
{
sndStart; /* sound system startup (see item above) */
SND_ChgMap (2) ; /* change sound area map */
SND_MoveData((Uint16 *)0x22005000, 0xffff, SND_KD_SEQ, 2);
/* sound data transfer (sequence) */
SND_MoveData((Uint16 *)0x22005500, 0xffff, SND_KD_TONE, 2);
/* transfer sound data (tone) */
SND_SetT1V1(15) ; /* Set master volume */
SND_StartSeq(0, 2, 5, 0) ; /* start sequence */
. . .
}
Calling Sequence
The following calling sequence starts another sequence under sound control number 0 if
a sound control number 0 sequence has stopped.
void sndHantei()
{
SndSeqStat status; /* define sequence status area
. . .
SND_GetSeqStat (&status, 0);
if(SND_SEQ_STAT_MODE(status) == SND_MD_STOP){
/* is sequence under sound control number 0 stopped? */
SND_StartSeq (0, 2, 6, 0) ; /* start sequence
}
}
8
2.0 Reference
• Common
Title Data Data Name No.
Data Specifications System start data type SndIniDt 1
This data type indicates the transfer source of data required by the sound system.
The transfer destination is the sound memory (fixed). Set each of the following:
• Address
Refer to the link map file and set the address.
• Size
Set the size of the 68K program object file and the sound area map object file.
Access Macro
SndIniDt sys_ini
Description of V
alues
Value Description
0 ~ 255 Arbitrary
10
Title Data Data Name No.
Data Specifications Total volume data type SndTlVl 3
Description of Values
Value Description
0 ~15 0 is OFF, 15 is the maximum
Description of Values
Value Description
0 ~15 Arbitrary
Description of Values
Value Description
0 ~15 Arbitrary
Description of Values
Value Description
0 ~127 Arbitrary
Description of Values
Value Description
0 ~15 Arbitrary
Description of Values
Value Description
0~7 Arbitrary
This data type shows pan. To pan the sound from left to right, increment up from - 15.
Description of Values
↑, ↓ : Adjust the volume in the direction of the arrow.
Value Description
Left Right
- 15 Maximum OFF
-14 to -1 Maximum ↓
0 Maximum Maximum
0 to 14 ↑ Maximum
15 OFF Maximum
12
Title Data Data Name No.
Data Specifications Command execution status data type SndRet 10
Constant Description
SND_RET_SET Command normal end (command was set)
SND_RET_NSET Command abnormal end (command was not set)
Constant Description
SND_DRAM4 DRAM 4 Mbit read/write
SND_DRAM8 DRAM 8 Mbit read/write
SND_SCSP_MIDI SCSP MIDI
SND_SOUND_SRC_LR Sound generator output (L/R)
SND_SOUND_SRC_L Sound generator output (L)
SND_SOUND_SRC_R Sound generator output (R)
Constant Description
SND_HARD_OK Normal
SND_HARD_ERR Abnormal
Description of Values
Value Description
0 ~7 Arbitrary
Description of Values
Value Description
0 ~15 Arbitrary
Description of Values
Value Description
0 ~255 Arbitrary
Description of Values
Value Description
0 ~7 0 is the highest priority level and 7 is the minimum
14
Title Data Data Name No.
Data Specifications Sequence volume data type SndSeqVI 17
Description of Values
Value Description
0 ~127 0 is off, 127 is the maximum (source sound level)
Description of Values
Value Description
0 Fade rate is disabled
1 ~255 Longest at 1, shortest at 255
Description of Values
Value Description
Relative value in terms of the present value
+32767 ~ -32768 + is Up and - is Down
Up 2X at +4096, Down 2X at -4096
SndSeqStat Status
Access Macro Type Description
SND_SEQ_STAT_MODE(status) Uint16 Song mode
SND_SEQ_STAT_STAT(status) Uint16 Song status
SND_SEQ_STAT_MODE(status)
Constant Description
SND_MD_STOP Stop
SND_MD_PLAY Play
SND_MD_FADE Fade
SND_MD_PLAY_PS Play pause
SND_MD_FADE_PS Fade pause
SND_SEQ_STAT_STAT(status)
Value (Hexadecimal) Description
00 Normal
01 ~ 7F Error code
80 ~ FF Timing flag
This data type denotes the sound control number play position.
Description of Values
Value (Hexadecimal) Description
0 ~FFFF 0 ~FFFF
16
• PCM
SndPcmStPrm prm
Access Macro Type Description
SND_PRM_MODE(prm) Uint8 Stereo and mono + sampling rate
SND_PRM_SADR(prm) Uint16 PCM stream buffer start address
SND_PRM_SIZE(prm) Uint16 PCM stream buffer size
SND_PRM_OFSET(prm) Uint8 PCM stream play start offset
SND_PRM_MODE(prm)
Specify the following constants by logical OR.
Bit Position Constant Description
Mono/stereo select bit SND_MD_MONO Mono
SND_MD_STEREO Stereo
Sampling rate selection bit SND_MD_16 16-bit PCM
SND_MD_8 8-bit PCM
SND_PRM_SADR(prm)
Value (Hexadecimal) Description
0000 ~ FFFF PCM stream buffer start address
(upper 16 bits of 20 bit data)
SND_PRM_SIZE(prm)
Value (Hexadecimal) Description
0000 ~ FFFF PCM stream buffer size
(number of samples for 1 channel)
SND_PRM_OFSET(prm)
Value (Hexadecimal) Description
0~F
(1000 [4k sample] units) PCM stream play start offset (0000 ~ F000)
SndPcmChgPrm prm
Access Macro Type Description
SND_PRM_NUM(prm) SndPcmNum PCM stream play number
SND_PRM_LEV(prm) SndLev Direct sound level
SND_PRM_PAN(prm) SndPan Direct sound pan
SND_PRM_PICH(prm) Uint8 PICH word
SND_R_EFCT_IN(prm) SndEfctIn Effect in select Right output (mono)
SND_R_EFCT_LEV(prm) SndLev Effect send level
SND_L_EFCT_IN(prm) SndEfctIn Effect in select Left output
SND_L_EFCT_LEV(prm) SndLev Effect send level (invalid for mono)
The following constants and values can be used by each access macro.
SND_PRM_NUM(prm)
Value Description
0 ~7 PCM stream play number
SND_PRM_PICH(prm)
Refer to the PICH register section in the Saturn SCSP User’s Manual
(ST-077-R2-052594).
SndPcmPlayAdr(prm)
Access Macro Type Description
SND_PCM_RADR(prm) Uint8 Right output (mono)
SND_PCM_LADR(prm) Uint8 Left output
18
Title Data Data Name No.
Data Specifications PCM address update interrupt status SndPcmIntStat 25
data type
This data type indicates the PCM address update interrupt status. The following
bit position constants can be specified by OR.
• CD
Description of Values
Value Description
0 ~32767 0 is OFF, 32767 is maximum
This data type denotes the discrete frequency band stereo volume analysis data.
In the case of monaural, the same values are entered in left and right outputs.
SndCdHzSrVl hz_vl
Access Macro Type Description
SND_CD_LHIGH (hz_vl) SndCdVlAnl Treble analysis volume
SND_CD_LMID (hz_vl) SndCdVlAnl Midrange analysis volume Left output
SND_CD_LLOW (hz_vl) SndCdVlAnl Bass analysis volume
SND_CD_RHIGH (hz_vl) SndCdVlAnl Treble analysis volume
SND_CD_RMID (hz_vl) SndCdVlAnl Midrange analysis volume Right output
SND_CD_RLOW (hz_vl) SndCdVlAnl Bass analysis volume
20
2.4 Function Specifications
• Interrupt
Constant
Output: None
Function Value: None
Function: Enables interrupts. This setting enables or disables the interrupt signal from the
sound system. This setting does not mask SCU interrupts.
Constant
Constant
22
• Performance Setup
Constant
Output: None
Function Value: None
Function: Transfers sound data to the sound memory according to the map information that
corresponds to the specified data type and number.
Remarks: SCU DMA transfer is used in transferring data.
Common
24
Title Function Function Name No.
Function Specifications Change mixer parameters SND_ChgMixPrm 11
26
Title Function Function Name No.
Function Specifications Set sequence volume SND_SetSeqVl 17
28
CD
Sequence
PCM
30
CD
1.1 Objective
Direct Memory Access (DMA) functions decrease the overhead on the Main CPU’s
processing time by enabling it to perform work other than the transfer of data. This
library provides basic DMA data transfer functions.
1.2 Overview
The DMA Library supports both the SH2 (CPU) and SCU-based DMA transfers. High-
level and low-level library functions are provided for each device.
Descriptions of the high-level and low-level functions are as follows.
• High-level functions
Provides basic functionality for byte, word, and longword transfers through easy-to-use functions.
• Low-level functions
Provides functions that enable the detailed setup of device modes, interrupts, and status communica-
tion.
The main differences between the SH2 (CPU) and SCU DMA functions are explained
next. For more detailed information, refer back to the hardware manual for each device.
• CPU
Capable of transfers between the same bus (e.g., between work RAM areas). This is not possible with
the SCU.
• SCU
Because parallel operations by the CPU can be performed during data transfers, the SCU is effective in
transfers that do not involve the CPU bus. The SCU is capable of high-speed transfers compared with
the CPU.
1.3 Precautions
• Select the suitable function after examining the source and destination access units used for the
transfer. See the appropriate hardware manual for information about access units.
• High-level DMA transfers purge the destination area after a transfer under the following condition.
32
1.4 Calling Sequence
The following example shows the DMA transfer calling sequence.
. . .
void copyToData()
{
DMA_ScuCopyMem(SCLA_CFRAME, scl_k_data, K-NUM);
/* data transfer to VDP2 VRAM fromWork RAM */
. . .
if(DMA_ScuResult() == DMA_SCU_BUSY){ /* DMA_ScuCopyMem() completion check */
. . .
}
}
34
2.2 Data Specifications
struct {
Uint32 dxr; /* Read address */
Uint32 dxw; /* Write address */
Uint32 dxc; /* Number of transfer bytes */
Uint32 dxad_r; /* Read address add value */
Uint32 dxad_w; /* Write address add value */
Uint32 dxmod; /* Mode bit */
Uint32 dxrup; /* Read address update bit */
Uint32 dxwup; /* Write address update bit */
Uint32 dxft; /* Start source selection bit */
Uint32 msk; /* Mask bit */
} DmaScuPrm;
The following tables show constants that can be used by each member.
dxad_r
Name of Constant Description
DMA_SCU_R0 Don’t add
DMA_SCU_R4 Add 4 bytes
36
mask
(This is a write mask bit for the members above. Bits specified by the following
constants are not written. Multiple specifications are possible by using logical OR)
struct {
Uint32 pr; /* priority mode */
Uint32 dme; /* DMA master enable */
Uint32 msk; /* mask bit */
}DmaCpuComPrm;
The following tables show constants that can be used by each of these members.
pr /* priority mode */
msk
This is a write mask bit for the members. Bits specified by the follow-
ing constants are not written. Multiple specifications are possible by
using logical OR.
Name of Constant Description
DMA_CPU_M_PR Priority mode
DMA_CPU_M_AE Address error flag
DMA_CPU_M_NMIF NMI flag
DMA_CPU_M_DME DMA master enable
38
Title Data Data Name No.
Data Specifications Transfer parameters DmaCpuPrm 5
struct {
Uint32 sar; /* DMA source address */
Uint32 dar; /* DMA destination address */
Uint32 tcr; /* DMA transfer count */
Uint32 dm; /* destination address mode */
Uint32 sm; /* source address mode bit */
Uint32 ts; /* transfer size */
Uint32 ar; /* auto request mode */
Uint32 ie; /* interrupt enable */
Uint32 drcr; /* DMA request/response select control */
Uint32 msk; /* mask bit */
} DmaCpuPrm;
The following tables show constants that can be used by each member.
ts /* transfer size */
Name of Constant Description
DMA_CPU_1 Byte unit
DMA_CPU_2 Word (2 byte) unit
DMA_CPU_4 Long word (4 byte) unit
DMA_CPU_16 16 byte unit
ie /* interrupt enable */
Name of Constant Description
DMA_CPU_INT_ENA Enable interrupt request
DMA_CPU_INT_DIS Disable interrupt request
msk */
This is a member write mask bit. Bits specified by the following con-
stants are not written. Multiple settings are possible by using logical
OR.
40
2.3 List of Functions
42
Title Function Function Name No.
Function Specifications DMA data transfer result check Dma_ScuResult 2
Remarks: When the CPU_Bus is specified as the transfer source or destination with
DMA_ScuMemCopy(), the CPU cannot run while the DMA is executing.
Accordingly, the execution results in that case cannot be “busy" (DMA_SCU_BUSY).
44
Title Function Function Name No.
Function Specifications DMA long word Data Transfer DMA_CpuMemCopy4 5
46
• Low-level SCU Transfers
48
Title Function Function Name No.
Function Specifications Stop DMA transfer DMA_CpuStop 15
1.1 Objective
The Cache Library provides functions that are required after the execution of a DMA as
well as function-format macros for cache register operations.
1.2 Overview
The main purpose of this library is to provide functions that purge the cache after DMA
transfers.
When the CPU accesses RAM memory space via a cache address, a conflict occurs
between the RAM and cache memory contents if the RAM is used as a destination for
DMA transfers.
For more details on SH2 cache operations, refer to the SH2 hardware manual.
50
2.0 Reference
Output: None
Function Value: None
Function: Initializes the cache. Clears valid bits of all cache lines, enables instruction fill and
data fill, and enables the cache.
52
Title Function Function Name No.
Function Specifications Set cache register CSH_SetCcr 2
Output: None
Function Value: None
Function: Controls operation of the cache by the specified cache enable switch.
Output: none
Function Value: none
Function: Controls the cache fill operation during instruction fetches.
Output: None
Function Value: None
Function: Controls the cache fill operation when reading data.
Output: None
Function Value: None
Function: Selects 2-way or 4-way mode.
54
Interrupt Management Library
1.0 Guide
1.1 Objective
The Interrupt Management Library controls interrupts.
1.2 Overview
The library manages access to interrupt registers and interrupt processing routines.
void vblkIn(void)
{
. . .
}
56
File B
void systemInit(void)
{
INT_SetFunc(INT_SCU_VBLK_IN, vblkIn);
/* vblkIn interrupt function is set to the */
/* V-Blank-IN interrupt vector table. */
INT_SetScuFunc(INT_SCU_VBLK_OUT, vblkOut);
/* vblkOut function is set to the SCU interrupt */
/* function of the V-Blank-OUT interrupt vector. */
. . .
}
void vblkOut(void)
{
. . .
}
2.0 Reference
The following table shows constants that can be set as the interrupt mask bit value. The
value of each constant is 1 for the 1 bit that the constant represents, and everything else
is set as 0. Multiple numbers can be set once by using logical OR.
Constant Description
INT_MSK_NULL No specification
INT_MSK_ALL Set all (specifies all bits described below)
INT_MSK_ABUS A-Bus
INT_MSK_SPR Sprite draw complete
INT_MSK_DMAI Illegal DMA
INT_MSK_DMA0 Level 0 DMA
INT_MSK_DMA1 Level 1 DMA
INT_MSK_DMA2 Level 2 DMA
INT_MSK_PAD PAD
INT_MSK_SYS System manager
INT_MSK_SND Sound request
INT_MSK_DSP DSP end
INT_MSK_TIM1 Timer 1
INT_MSK_TIM0 Timer 0
INT_MSK_HBLK_IN H-Blank-IN
INT_MSK_VBLK_OUT V-Blank-OUT
INT_MSK_VBLK_IN V-Blank-IN
58
Title Data Data Name No.
Data Specifications Interrupt Status Bit Value Constant None 2
The following table shows the constants that can be set as the interrupt status bit value.
The value of each constant is 1 for the 1 bit that the constant represents, and everything
else is set as 0. Multiple numbers can be set once by using logical OR.
Constant Description
INT_ST_NULL No specification
INT_ST_ALL Specify all (specifies all bits described below)
INT_ST_ABUS A-Bus (specifies A-Bus 01 ~ 16 bits)
INT_ST_ABUS 01 ~ ABUS 16 A-Bus 01 ~ 16
INT_ST_SPR Sprite draw complete
INT_ST_DMAI Illegal DMA
INT_ST_DMA0 Level 0 DMA
INT_ST_DMA1 Level 1 DMA
INT_ST_DMA2 Level 2 DMA
INT_ST_PAD PAD
INT_ST_SYS System manager
INT_ST_SND Sound request
INT_ST_DSP DSP end
INT_ST_TIM1 Timer 1
INT_ST_TIM0 Timer 0
INT_ST_HBLK_IN H-Blank-IN
INT_ST_VBLK_OUT V-Blank-OUT
INT_ST_VBLK_IN V-Blank-IN
The following table shows the constants that can be set as the vector number.
The SCU constant name can be set only by the master SH2. The CPU constant name
can be set by the master and slave SH2.
60
2.3 List of Functions
62
Title Function Function Name No.
Function Specifications Get interrupt status register INT_GetStat 4
Output: None
Function Value: None
Function: Sets the specified acknowledge value to the A-Bus interrupt acknowledge register.
Acknowledge a
Vlue Constant Names
Name of Constant Description
INT_ACK_ENA Enabled
INT_ACK_DIS Disabled
Function: Gets the acknowledge value of the A-Bus interrupt acknowledge register.
64
Title Function Function Name No.
Function Specifications Set SCU function INT_SetScuFunc 9
1.0 Guide
1.1 Objective
Use the Memory Management Library for simplifying memory management tasks.
1.2 Overview
Various functions that allocate and free memory are provided. Functions that free up
memory check adjacent memory space for additional free memory. When free memory
is detected, it is linked with the memory being freed. These functions reduce the bur-
den of memory management on the user. Memory Management Library functions have
function interfaces similar to standard C library functions related to memory manage-
ment.
void sysInit()
{
. . .
MEM_Init(0x6050000, 0x10000);
to memory management area */
. . .
}
. . .
void userFunc()
{
Uint32 *mem_area1;
Uint8 *mem_area2;
. . .
mem_area1 = (Uint32 *)MEM_Malloc(4);/* allocates a 4 byte area
if(mem_area1 == NULL) {
return(ERR);
}
mem_area2 = (Uint8 *)MEM_Malloc(1); /* allocates a 1 byte area
if(mem_area2 == NULL) {
return(ERR);
}
. . .
. . .
MEM_Free(mem_areal);
. . .
}
66
2.0 Reference
68
Timer Library
l
tia
1.0 Guide
1.1 Objective
The Timer Library provides function format macros that access the programmable wait
and processing timer values.
n
1.2 Overview
The timer uses the free running timer (FRT) in the SH2 and the timer interrupt in the
de
SCU. Function format macro are provided for each device in consideration of the fol-
lowing applications.
SCU
• Timing that is in sync with V-Blanks and H-Blanks can be obtained. This timing
information can be used for performing graphics processing tasks.
CPU
•
nfi
The correct wait time can be set as required when programming. Relatively accurate
waits within a C language program can be executed.
• Elapsed time can be determined. This can be used to profile code execution times.
Co
GA
SE
Calling Sequence
The following calling sequence example shows timer 1 being used to generate a timer
1 interrupt at the 10th bit of every line that is drawn. If the line is odd, it is flipped.
Uint32 time_flg;
. . .
void vblankOut ()
{
Uint32 intr_count = 0;
. . .
TIM_T1_DISABLE ():
• CPU
Basic Items
• Counter Value
Counter values are used when the FRT is used as a timer. The counter value is
explained below.
The count up cycle of the counter value varies depending on the period specifica
tion and graphics mode. Use the following formula to calculate the count-up
cycle.
Count Up Cycle (sec) = (cycle period) x 1 / clock frequency (Hz)
70
Conversion from the counter to microseconds and visa versa can be done conve-
niently if the following function format macro is used.
Function Function Format Macro No.
Convert counter value to microseconds TIM_FRT_CNT_TO_MCR 15
Convert microseconds to counter value TIM_FRT_MCR_TO_CNT 16
Usage Method
• Initialization
Execute the following function format macro before using the wait time (WAIT)
function or fetching elapsed time.
Function Function Format Macro No.
Initialize FRT TIM_FRT_INIT 8
• Fetching Elapsed T
ime
Use the following functions to obtain the elapsed time.
void sysInit()
{
TIM_FRT_INIT(8);
. . .
}
void writeFrameBuff()
{
Uint16 count:
float micro_sec;
TIM_FRT_SET_16(0);
WriteAllVram();
count = TIM_FRT_GET_16()
/* count shows the WriteAllVram() execution time
micro_sec = TIM_FRT_CNT_TO_MRC(count); /*
to microseconds */
printDisplay(micro_sec);/ *display elapsed time on the screen */
}
72
2.2 Function Specifications
• SCU
74
• CPU
Constant Description
TIM-CKS-8 8
TIM-CKS-32 32
TIM-CKS-128 128
Output: None
Function Value: None
Function: Sets the selected period and initializes the FRT.
76
Title Function Function Name No.
Function Specifications Set timer control/status register TIM_FRT_SET_TCSR 15
78
Title Function Function Name No.
Function Specifications Get free running counter TIM_FRT_GET_FRC 23
80
Debug Support Library
1.0 Guide
1.1 Objective
Incorporating the Debug Support Library in the application during code development
enables various debug functions such as the display of character strings to the screen,
data input using a software “keyboard”, and read/writes to memory.
1.2 Description
• This library uses the VDP2 graphics library and constructs a simple debug environ-
ment using the normal scroll screen NBG0. The Debug Support Library cannot be
used if the VDP2 library is not used.
• This library only supports the standard SATURN control pad. This library cannot be
used if the peripheral library is not used.
#include “sega_scl.h”
#include “sega_dbg.h”
main()
{
SCL_Vdp2Init();
DBG_Initial(&PadData,RGB16_COLOR(31, 31, 31),0);
. . . . . . . . . . /* program */
if (. . . . . . )
err(“error occurred in main() ~ function”) ;
. . . . . . . . . . /* program */
82
Title Function Function Name No.
Function Specifications Turn on debug screen display DBG_DisplayOn 2
84
Title Function Function Name No.
Function Specifications Simple debug process DBG_Monitor 8
• Display Memory
D fromAddr [toAddr/@size] [;B/W/L] <RTN>
fromAddr : Dump start address
toAddr : Dump end address
@size : Dump size (HEX)
B : Byte (8 bit) display
W : Word (16 bit) display
L : Long (32 bit) display
After inputting the D command, the memory dump may be continued by
entering <RTN>.
• Change Memory Contents
D toAddr [data] [;B/W/L] <RTN>
toAddr : Memory address
data : Edit data (HEX)
B : Byte (8 bits) data
W : Word (16 bits) data
L : Long (32 bits) data
If data is omitted, input sequential data from the specified address when the
data entry prompt is displayed. If “^” is input at this time, the edit address is
decremented; if <RTN> is input, the address is incremented. The memory edit
ends when “.” is input.
• Display Register Contents
R<RTN>
Valid only when calling from the exception process routine of the program.
• Quit Simple Debug Process
Q<RTN>
Returns to the calling point of this routine. Invalid when called from the
exception processing routine of the program.
• Display Command Help
H<RTN>
Term Description
Compression rate Equal to (Size after compression / Size before compression)
X 100 [%]
Symbol (character) 1 processing unit of input data for the compression process.
BYTE, WORD, DWORD can be specified in this library.
Code Smallest unit of compression process output data. Defined
per method.
Run Length Encoding Technique for compressing data based on replacing input
(RLE) data with a run length value and a corresponding value for
that run length.
Run length Number of occurrences of the same input value.
Non-pattern phrase A set of data with a short “run” that results in the creation of
more data under the conventional RLE method.
86
1.0 Guide
1.1 Application
The Compression-Decompression Library is used to decode run length encoded (com-
pressed) data. Run length encoding is done via a utility called CMPRUN.EXE (provided
separately).
start
A A A A B C C C C D D D D
end
start
A A A A B C D E F G G G G
end
start
A A A A B C C D D E E E E
end
start
A A A A B C C D D E F F F F
end
Processing Unit
As shown in the following table, there are three processing unit types. One character
(symbol) is input from the start and broken up into the processing unit size.
BYTE
(1 byte)
11 11 11 11 22 22 33 44 55 66 66 66 66
WORD
(2 bytes)
11 11 11 11 22 22 33 44 55 66 66 66 66
DWORD
11 11 11 11 22 22 33 44 55 66 66 66 66
(4 bytes)
88
Expression of Run Length
A normal run length (pattern phrase length) is expressed as a positive number, and the
non-pattern phrase length is expressed as a negative number. Because a run length is
always 2 or greater, it is expressed as a value that is value -2. The byte number used for
expressing run length is the same as the processing unit byte number. The actual
amount of data for the run length is decoded by the processing units. That is, a process-
ing unit in words with a run length of 5 is equivalent to the encoding process for 10
bytes of data. The following table shows the range of run length values that can be
expressed.
Coded units
Input data A A A B B B C D D D E F G G G G
X
Compressed data 3 A 3 B -1 C 3 D -2 E F 4 G
Code units
Any of WORD,
Processing units. BYTE, BYTE, WORD, DWORD.
or DWORD
Two types of codes exist, and are differentiated by whether the run length is a positive or
a negative value.
Code
(When run Run length n-2 Pattern phrase length
length ≥ 0) <pattern phrase length>
Add 2 and interpret (M BYTE) (M BYTE)
as pattern phrase
length
n: number of units
Code Run length -n Non-pattern phrase Non-pattern phrase
(When run <non-pattern phrase value 0 <uncompressed value n-1 <uncompressed
length < 0) length> (M BYTE) data> (M BYTE) data> (M BYTE)
Flip negative sign
and interpret as
pattern phrase
length
90
Table 1.3 Run length compression file header
MSB LSB
Bit 15 12 11 8 7 4 3 0
Meaning Position
Compression Algorithm 15 . . 12
Run length 00 00
Reserved 00 01
Processing Units 11 . . 10
1 byte 00
2 bytes 01
4 bytes 11
Reserved 9. . 4 00 00 00
Source size width 3
2 bytes 0
4 bytes 1
Reserved 2. . 0 000
Overview
The Decompression Library expands data compressed by the compression tool. Com-
pressed data may be handled as discrete files on the CD-ROM itself or stored by other
means. However, when the data is decompressed using the Decompression Library, an
input and output data buffer must be set up in a main CPU accessible memory area.
Both of these buffers must be reserved for the Decompression Library, and their ad-
dresses specified in the library functions.
For example, when input data is read off the CD to be decompressed, the Decompres-
sion Library functions must be executed after all of the input data used for a single
decompression pass is read into memory.
The output data buffer must also be specified in the Decompression Library functions.
When the function exceeds this buffer size, it will halt processing and stop the output of
data. It is possible to use this feature as a means to perform partial decompression
processing. However, note that there is no feature to resume the interrupted decom-
pression process.
Figure 1.4 gives an overview of the decompression process.
Main CPU
(Decompression Memory
Library Function)
in
out
92
Module Configuration
The Decompression Library function has a hierarchical module configuration in terms
of the features of each function. The high-level functions are easier to use since they
interpret the compressed data’s algorithm and parameter attributes and perform de-
compression processing. The downside is that additional object code must be linked.
The low-level functions may be used when it is desirable to link only the minimum
amount of object code that is necessary. If this approach is taken, it is necessary to make
sure that there are no functional discrepancies between the output of the compression
tool and the processing of the library function.
Figure 1.5 shows the configuration of the Decompression Library modules.
CMP_DecRunlen ()
Run length decompression
CMP_DecRunlenByte ()
Run length decompression/BYTE units
CMP_DecRunlenWord ()
Run length decompression/WORD units
CMP_DecRunlenDword ()
Run length decompression/DWORD units
Example 1
Figure 1.6 shows an example in which compressed data is included in the source file as
a C language data array.
#include "cmplib.h"
/* RLE compressed data converted from binary to text data
char cmpdata [ ] = {
0x10, 0x01, 0x04, . . . . .
}
;
/* decompressed data buffer
char outputbuf[4096] ;
main()
{
/* decompressed data pointer
char *bufp;
/* set to start of decompressed data buffer
bufp = outputbuf;
/* run length dictionary decompression
CMP_DecRunlen (cmpdata, &bufp, sizeof(outputbuf));
/* use of expanded data
94
Example 2
Figure 1.7 shows an example in which compressed data is read from the CD-ROM and
decompressed.
#include "sega_gfs.h"
#include "cmplib.h"
main()
{
GfsFid fid; /* file identifier
Sint32 fsize; /* file size
char *bufp; */
fid = 5; /* Set compressed data file identifier
fsize=GFS_Load(fid, 0, readbuf, READBUF_SIZE) file batch read
The following table shows the constant macros defined in this library.
96
2.2 List of Functions
The following table lists the functions of the Decompression Library.
Note: The input buffer and the output buffer must be reserved. The start
address of each buffer must be specified in terms of a 4-byte boundary.
The output buffer must be large enough to store decompressed data
and be an integer multiple of the processing unit number.
Remarks:
in (input)
Input buffer
bufsize (input)
Output buffer
: Compressed data
: Decompressed data
98
Title Function Function Name No.
Function Specifications Run length decompression / BYTE CMP_DecRunlenByte 1.1
units
Note: The input buffer and the output buffer must be reserved. The start
address of each buffer must be specified in terms of a 4-byte boundary.
The output buffer must be large enough to to store decompressed data
and be an integer multiple of the processing unit number.
Note: The input buffer and the output buffer must be reserved. The start
address of each buffer must be specified in terms of a 4-byte boundary.
The output buffer must be large enough to store decompressed data
and be an integer multiple of the processing unit number.
100
Title Function Function Name No.
Function Specifications Run length decompression / CMP_DecRunlenDword 1.3
DWORD units
Note: The input buffer and the output buffer must be reserved. The start
address of each buffer must be specified in terms of a 4-byte boundary.
The output buffer must be large enough to store decompressed data
and be an integer multiple of the processing unit number.
1.1 Objective
The PCM-ADPCM Playback Library enables simplified playback of PCM audio on the
SEGA SATURN.
1.2 Features
Easy PCM Playback
The user simply makes calls to the PCM task function periodically in order to perform
audio playback. The library reads from the CD, controls the ring buffer, manages tim-
ing, supplies data to the PCM buffer, and issues commands to the sound driver.
ADPCM Support
This library is capable of decompressing ADPCM compressed data on-the-fly while
playback occurs. ADPCM is a CD-ROM XA audio data format standard that provides
superior sound quality at a compression ratio of approximately 4:1.
Pause Function
Although the hardware has no function to pause PCM playback, this library makes
pausing simple.
102
1.3 System Image
Figures 1.1 and 1.2 show the configuration of the PCM-ADPCM Playback Library.
Application
Function Call
Data Flow
CD Block
Application
PCM,
ADPCM Sound Memory
PCM, ADPCM
Playback
Play Library
Library ADPCM (Applicationprogram
(Application program
ADPCM
Decom-
Expansion does
is notnot recognize
required to
pression
Library ADPCM.)
handle ADPCM.)
Library
The following two tables list the specifications of the PCM-ADPCM Playback Library.
File Playback Mode (reads and plays from CDs) Uses the File System
Stream Playback Mode (reads and plays from Uses the Stream System
CDs)
Functions Branching playback, continuous playback
Multiple stream playback (can play up to 4 Only 1 ADPCM stream
streams at the same time) can be played.
Pause, stop, volume/pan setting
Continuous play time Maximum 1 hour
Libraries used File System, Stream System, DMA Library, These libraries must be
ADPCM Decompression Library linked along with the PCM-
ADPCM Playback Library
(4)
CPU timer (FRT) This library uses the CPU timer (FRT) set to the Values can be obtained by
usage clock count of 128. TIM_FRT_GET_16
Initialization is done only once within the
PCM_Init function.
User FRT initialization and settings are
prohibited.
Sound driver The application performs initialization settings See the Saturn Sound
(68000 reset, sound driver transfer, etc.). This Driver System Interface
library issues commands for PCM playback manual
(PCM start, stop, parameter change). (Doc. # ST-166-R2-091394).
When the application issues a command,
interrupts must be disabled from the point prior Both this library and the
to the clearing of the command block until the Sound Interface Library are
completion of the command settings. structured so that they do
not override each other’s
commands.
104
Table 2.2 Library Specifications (2)
Item Specification Remarks
Buffer requirements Work buffer: Work structure (about 530 bytes) Fixed size
Ring buffer: Sector size * 10 bytes ~ (5)
(6)
PCM buffer: 4096 * 2 ~ 4096 * 4 sample/1 ch
Required only when
Pause processing work: 4096 samples ~ PCM buffer pause is executed.
size
CPU overhead (7) PCM uncompressed 44 kHz stereo 16 bit : 10% These values covers all
(CPU task function PCM uncompressed 44 kHz mono 16 bit : 6% processing times, such
overhead ratio after as data transfers from
ADPCM compressed 44 kHz stereo 16 bit : 33%
play starts) the CD block through
ADPCM compressed 37.8 kHz stereo 16 bit : 29% work memory to sound
ADPCM compressed 22 kHz stereo 16 bit : 17% memory, and in the
ADPCM compressed 11 kHz stereo 16 bit : 8% case of ADPCM,
decompression
ADPCM compressed 11 kHz mono 16 bit : 4%
processing.
PCM_Task (task • Called at a frequency equal to or greater than If called at an
function) specification the V-Blank interrupt frequency (once every 16 appropriate frequency,
ms). longer processing
• Single-session task function maximum processing occurs once per several
time times of processing.
PCM uncompressed stereo 16 bit : 15 ms
PCM uncompressed mono 16 bit : 8 ms
ADPCM compressed stereo 16 bit : 34 ms
ADPCM compressed mono 16 bit : 15 ms
Notes:
(1) The “user-specified ADPCM format” refers to the data file format output by an AIFF to ADPCM file
converter utility called AudioStack by OptImage Interactive Services.
(2) CD-ROM XA Audio has 16-bit data ADPCM compressed to 4 bits and has the following formats:
Mode B (37.8 kHz) stereo/mono
Mode C (18.9 kHz) stereo/mono
Only the Stream Playback Mode can be used when CD-ROM XA Audio is used.
For more information, see the CD-ROM XA Standards.
(4) There are also object files that no not need to be linked depending on the functions used.
The ADPCM Decompression Library does not need to be linked if the ADPCM usage declaration
PCM_DeclareUseAdpcm is not made. In Memory Playback Mode, the File System and Stream
System are not linked. In File Playback Mode, the Stream System is not linked. The File System and
the Stream System are linked if the Stream Playback Mode is used.
When all files are kept in memory for memory playback, the addresses and files sizes for each file
must be specified. These values need not be integer multiples of the sector size.
(6) A PCM buffer size of 4096 * 2 [sample/1 ch] is adequate if there are no special reasons for a larger
buffer.) By allocating enough memory, playback will complete without glitches even when the task
function cannot be called at the required intervals.
(7) The CPU overhead (CPU overhead ratio for the task function after playback begins) is defined as
follows.
106
3.0 Playback Sequence
Playback Sequence
Figure 3.1 shows the sequence for audio playback using the Stream System.
Set of V-Blank
V-Blank In
Interrupt Process INT_Set ScuFunc, PCM_Vblln,
Set terrupt Process SCL_???, SPR_???
PCM_Set Info
Set Playback Information *Playback information settings are required
only for CD_ROM XA Audio format data
No
Completed? PCM_GetPlayStatus
Yes
Destroy Handle STM_DestroyMemHandle
END
108
4.0 Programming Precautions
This section lists the precautions that must be taken when implementing the PCM-
ADPCM Playback Library in your application.
3. Creating a Buffer
• Reserve the following memory areas:
Work buffer: Size of the work structure
Ring buffer: Minimum (sector size) * 10 [byte]. Integer multiple of the sector size.
1 sector = 2324 bytes during CD-ROM XA audio playback.
In all other cases, 1 sector = 2048 bytes.
PCM buffer: 4096*2 ~ 4096*4 [sample/1 ch].
Pause processing work: Minimum 4096 [sample]. Optimal when it is the same size as the PCM buffer.
4. Seamless Branching
• The PCM volume and pan settings are the same as the prior handle when seamless
branching is performed by PCM_EntryNext.
• Up to 60 minutes of continuous playback is possible when seamless branching is per-
formed with PCM_EntryNext. Continuous playback longer than this cannot be done.
• Use file pre-read processing in the application program when seamless branching is
performed.
• The seamless branching function cannot be used when the File System is used.
• The seamless branching function can be performed only during single playback, and
not during multiple system playback.
110
5.0 Data Specifications
• Basic Data
Type Description
Uint8 Unsigned 1 byte integer
Sint8 Signed 1 byte integer
Uint16 Unsigned 2 byte integer
Sint16 Signed 2 byte integer
Uint32 Unsigned 4 byte integer
Sint32 Signed 4 byte integer
Bool Boolean type. The following values are taken:
FALSE
TRUE
112
• Constants
114
Title Data Data Name No.
Data Specifications Data transfer mode select value PCM_TRMODE_~ 2.5
The following represents handle creation information. All types of parameter values are
set to PCM_Create~ as structures.
typedef struct {
PcmWork /* */
/*
Sint32 *ring_addr; /* */
/*
from memory */
Sint32 ring_size; /* */
/*
Sint32 *pcm_addr; /* */
Sint32 pcm_size; /*
memory */
} PcmCreatePara;
• Specify the same area (address, size) when doing smooth continuous playback.
• Specify a different area when doing multiple stream playback.
116
Title Data Data Name No.
Data Specifications Error registration function PcmErrFunc 3.3
typedef struct {
PcmFileType file_type; /* */
PcmDataType data_type; /* */
Sint32 file_size; /* */
* Permits the supply of more data than this to
* to the ring buffer, but does not process it */
Sint32 channel; /* Number of channels */
Sint32 sampling_bit; /* Sampling bit resolution */
Sint32 sampling_rate; /* Sampling rate [Hz] */
Sint32 sample_file; /* Number of samples in the file [sample/1ch] */
Sint32 compression_type; */
} PcmInfo;
Notes
(1) Required
(2) Required when using ADPCM
(3) Required for Memory Playback Mode
(4) Required for File Playback Mode
(5) Required for Stream Playback Mode
(6) One or the other is required
(7) Required when using the pause function
118
Table 6.2 List of Functions (2)
Function Function Name No.
Notes:
(1) Required
(2) Required for Memory Playback Mode
(3) Required when supplying data to the ring buffer in the Memory Playback Mode
(4) Required for Multiple Stream Playback Mode
(5) Required when using the pause function
(6) Required for CD-ROM XA audio playback
Call this function immediately after the initialization function PCM_Init. Calling
this function links the ADPCM Decompression Library module. Calling this func-
tion does not restrict playback functions for data formats other than ADPCM.
If this function is not called, the execution file size becomes somewhat smaller.
120
• Handle Operations
122
• Playback Controls
Only one handle can be registered. It becomes unregistered when the switch occurs
to the registered handle. In addition, the next handle can be registered.
124
• Information Setting Functions
Pan setting 0 1 → 14 15 16 17 → 30 31
Left Output Max >> >> >> Off Max Max Max Max Max
(Volume)
Right Output Max Max Max Max Max Max >> >> >> Off
(Volume)
126
Title Function Function Name No.
Function Specifications Set PCM stream playback number PCM_SetPcmStreamNo 4.6
pause_work_addr = malloc(PAUSE_WORK_SIZE);
PCM_SetPauseWork(pause_work_addr, PAUSE_WORK_SIZE);
PCM_Pause(pcm, PCM_PAUSE_ON_AT_ONCE);
free(pause_work_addr);
128
• Get Information Functions
• Buffer Controls
130
INDEX
C
132
SndMixBnkNum .................................... 11 TIM_T0_Set_Cmp .................................. 74
SndPan .................................................... 12 TIM_T1_Disable ..................................... 73
SndPcmChgPrm ..................................... 18 TIM_T1_Enable ...................................... 73
SndPcmIntStat ........................................ 19 TIM_T1_Set_Data .................................. 74
SndPcmPlayAdr ..................................... 18 TIM_T1_Set_Mode ................................ 74
SndPcmStartPrm .................................... 17
SndRet ..................................................... 13
SndSeqBnkNum ..................................... 14
SndSeqNum ............................................ 14
SndSeqPlayPos ....................................... 16
SndSeqPri ................................................ 14
SndSeqSongNum ................................... 14
SndSeqStat .............................................. 16
SndSeqVl ................................................. 15
SndTempo ............................................... 15
SndTlVl .................................................... 11
SndToneBnkNum .................................. 11
TIM_Frt_Cnt_To_Mcr ............................ 76
TIM_Frt_Delay_16 ................................. 76
TIM_Frt_Get_16 ..................................... 75
TIM_Frt_Get_Frc .................................... 79
TIM_Frt_Get_Icra .................................. 80
TIM_Frt_Get_Ocra ................................. 79
TIM_Frt_Get_Ocrb ................................ 79
TIM_Frt_Get_Tcr .................................... 79
TIM_Frt_Get_Tcsr .................................. 78
TIM_Frt_Get_Tier .................................. 78
TIM_Frt_Get_Tocr .................................. 80
TIM_Frt_Init ........................................... 75
TIM_Frt_Mcr_To_Cnt............................ 76
TIM_Frt_Set_16 ...................................... 75
TIM_Frt_Set_Frc ..................................... 77
TIM_Frt_Set_Ocra .................................. 77
TIM_Frt_Set_Ocrb ................................. 77
TIM_Frt_Set_Tcr ..................................... 78
TIM_Frt_Set_Tcsr ................................... 77
TIM_Frt_Set_Tier ................................... 76
TIM_Frt_Set_Tocr .................................. 78
TIM_T0_Disable ..................................... 73
TIM_T0_Enable ...................................... 73
Program Library
User's Guide 2
Graphics Library
Doc. # ST-157-R1-092994
VDP 1 Library...................................... 1
VDP 2 Library.................................... 45
Number Calculation Library ........... 87
DSP I/F Library .............................. 107
i
Contents
VDP1 Library...................................................................................................................... 1
1.0 VDP1 Basic Processing Guide ........................................................................ 1
1.1 Objective...................................................................................................... 1
1.2 Explanation ................................................................................................. 1
1.3 Example of a Program Description ......................................................... 2
VDP2 Library...................................................................................................................... 45
1.0 Guide ................................................................................................................. 45
1.1 Objective...................................................................................................... 45
1.2 Explanation ................................................................................................. 45
1.3 Basic Library Usage ................................................................................... 48
ii
Mathmatical Calculation Library .................................................................................... 87
1.0 Guide ................................................................................................................. 87
1.1 Objective...................................................................................................... 87
iii
VDP1 Library
1.1 Objective
· Hides hardware-related processing such as VDP1 initialization, register operation,
etc., to reduce the load on the application author.
· Because of differences in processing methods used to speed up applications, the
basic processing library does not write commands to VRAM. The application has
the VRAM addresses, so these can be controlled and written on the application
side.
(Writing to VRAM and VRAM control is supported by the expanded processing
library.)
1.2 Explanation
Initial Processing
· Sets the frame buffer erase area, erase data for each frame change, and the TV
mode.
#include <machine.h>
#include “sega_spr.h”
#include “sega_scl.h”
#include “sega_int.h”
main()
{
Uint8
set_imask(0);
SCL_Vdp2Init();
SCL_SetPriority(SCL_SP0|SCL_SP1|SCL_SP2|SCL_SP3|SCL_SP4|
SCL_SP5|SCL_SP6|SCL_SP7,7);
SCL_SetSpriteMode(SCL_TYPE1,SCL_MIX,SCL_SP_WINDOW);
SPR_Initial(&vram);
SCL_SetFrameInterval(2);
/* 2/60 seconds
for(;;) |
memcpy(vram,command,sizeof(command));
/* Set the Sprite Command in VRAM
————
SCL_DisplayFrame();
/* Display Sprite and Move Scroll
}
}
2
- V-Blank Processing Routine (Separate source file from the main shown on previous
page.) -
#include <machine.h>
#include “sega_spr.h”
#include “sega_scl.h”
#pragma interrupt(VbStart)
#pragma interrupt(VbEnd)
void VbStart(void)
{
SCL_VblankStart(); /* V-Blank Start VDP Interrupt Processing */
————
}
void VbEnd(void)
{
SCL_VblankEnd();
————
}
2.1 Objective
· Supports functions that were not included in the basic processing library such as
VRAM management and writing sprite commands to VRAM.
· Executes a primitive sprite display command that corresponds to the sprite
command.
80000H
Explanation of EachArea
· VRAM Area Reference Switch Command
Sprite jump command that is used to match the VRAM area 0, 1 for frame change.
· System Command Area
This area is used to open the access routine used to erase the frame buffer with
polygon draw when the frame change interval is insufficient. Areas 0 and 1 are
the same size.
· User Command Area
Area where sprite commands organized from the top down through the various
command set routines called from the SPR_2OpenCommand() to the
SPR_2CloseCommand() routine. Areas 0 and 1 are the same size.
4
· Gouraud Shading Table Area
Area that stores the Gouraud shading table with 8 bytes for each entry and controls
numbers starting at 0. Areas 0 and 1 are the same size.
• When Releasing
Releases the designated block area. If there is an empty block next to the block being
released, both blocks are combined to form a large empty block.
The draw priority number indicates the draw block number. Block number 0 is
drawn first. Also, commands within the blocks are drawn in the order they were
recorded.
Priority Number
1 Block 1
Block n
n
6
2.4 Example of a Program Description
An actual example program in C language is shown below.
#include machine.h>
#define _SPR2_
#include “sega_spr.h”
#include “sega_scl.h”
#include “sega_int.h
#define COMMAND_MAX
#define GOUR_TBL_MAX
#define LOOKUP_TBL_MAX
#define CHAR_MAX
#define DRAW_PRTY_MAX 256
SPR_2DefineWork(work2d, COMMAND_MAX, GOUR_TBL_MAX,
LOOKUP_TBL_MAX, CHAR_MAX)
/* Define 2D Work Area
extern void vbStart(void);
extern void vbEnd(void);
main()
{
set_imask(0);
SCL_Vdp2Init();
SCL_SetPriority(SCL_SP0|SCL_SP1|SCL_SP2|SCL_SP3|SCL_SP4|
SCL_SP5|SCL_SP6|SCL_SP7,7);
SCL_SetSpriteMode(SCL_TYPE1,SCL_MIX,SCL_SP_WINDOW);
SPR_2Initial(&work2d);
for(;;) {
SPR_2SetChar(...);
}
for(;;) {
——————
SPR_2OpenCommand(SPR_2DRAW_PRTY_OFF);
/* Open Command Write
SPR_2SysClip(0,&xy);
SPR_2LocalCoord(0,&xy); /* Local Coordinates Command
SPR_2CloseCommand() ; */
SCL_DisplayFrame() ; */
/* Display Sprite and Move Scroll */
}
}
#include machine.h>
#include “sega_spr.h”
#include “sega_scl.h”
void VbStart(void)
{
SCL_VblankStart(); /* VBlank start VDP Intrrpt. Process*/
———— /* Other VBlank Start Processes */
}
void VbEnd(void)
{
SCL_VblankEnd(); /* VBlank End VDP Interrupt Process */
————
}
8
3.0 VDP1 3D Guide
3.1 Objective
The purpose here is to use the VDP1 expansion processing library to display 3D
sprites.
· Handles layers of connected models that consist of groupings of polygons.
· There is no need to understand the matrix calculations that accompany the
movement of models or the objects within a model.
· The user application is made aware of the coordinate value of the point after
world coordinates have been converted through the user call back routine.
· Texture mapping and sprite coloring during display can also be applied to polygons.
· Can be matched with 2D sprites when displayed.
View Point
y 0
World Coordinates
Light Source
View Point
Coordinate System
Model
screen
-z
Object
0
0 1
x
y
z
z 0
x
Body Coordinate System
Object 1
Object 0 Cluster 10
Cluster 00 Cluster 11
Root Cluster
Cluster 20
Cluster 12
Cluster 21
#include <machine.h>
#define _SPR3_
#define SPR_3USE_DOUBLE_BUF
#include “sega_spr.h”
#include “sega_scl.h”
#include “sega_int.h
SprCluster mode10;
SprCluster mode11;
10
extern void vbStart(void);
extern void vbEnd(void);
main()
{
set_imask(0);
SCL_Vdp2Init();
SCL_SetPriority(SCL_SP0|SCL_SP1|SCL_SP2|SCL_SP3|SCL_SP4|
SCL_SP5|SCL_SP6|SCL_SP7,7);
SCL_SetSpriteMode(SCL_TYPE1,SCL_MIX,SCL_SP_WINDOW);
SPR_2Initial(&work2d);
SPR_3Initial(&work3D);
for(;;) {
——————
SPR_3SetLight(...);
SPR_3SetView(...);
SPR_2OpenCommand(SPR_2DRAW_PRTY_ON);
/* Open Sprite Command Write
SPR_2SysClip(SPR_2MOST_FAR,&xy);
/* System Clip Area Command
SPR_2LocalCoord(SPR_2MOST_FAR+1,&xy);
/* Local Coordinates Command
SPR_3moveCluster(mode10,...);/* Move Root Cluster of 3D model 0*/
SPR_3DrawMode1(mode10,...); /* Register 3D Model 0
#include <machine.h>
#include “sega_spr.h”
#include “sega_scl.h
void VbStart(void)
{
SCL_VblankStart(); /* V Blank start VDP Interrupt Process */
———— /* Other VBlank Start Processes */
}
void VbEnd(void)
{
SCL_VblankEnd(); /* VBlank End VDP Interrupt Process */
———— /* Other VBlank End Processes */
}
Polygon Z sort in the view coordinate system of the sprite 3D display library uses the
sprite priority draw function of the VDP1 expansion library (2D library). To execute
Z sort, priority draw in the SPR_2OpenCommand() routine must be set to on
(SPR_2DRWA_PRTY_ON).
12
3.4 Polygon Objects That Connect Between Objects
When Object2 needs to be changed to accomodate the movement of Object1, as
shown in the figure below, define the polygon between Object0 and Object1 (Ob-
ject2) as an inbetween-object polygon and the shape changes are automatically
drawn.
1
2
Object Movement
0 6
Object1 5 3
Object1
0
4
Object2 Object2 1
7
2 4 5
0 1
Object0 Object0
6
4 5
The different tables that contain the cluster, object and inbetween-object polygon
information are connected as shown below.
child
Cluster0 Cluster1
InbetInf0 InbetInf1
Object0 Object1
Object2
InbetInf: Inbetween object polygon information
1) Objects are drawn in order from the parent cluster to the child cluster; if there is
more than one object in a cluster, they are drawn in the order they were connected.
In the previous example, objects would be drawn in order of Object0, Object1,
Object2.
3) If the draw object is an inbetween-object polygon, the normal vector for each
surface is found after conversion to the focal coordinate system, and the object is
drawn according to the draw mode. In the previous example, Object2 is the
inbetween-object polygon object.
14
4.0 VDP1 Basic Processing Reference
16
Title Function Function Name No
Function Specification Get the Current Sprite Control Information SPR_GetStatus 3
18
5.0 VDP1 Expanded Processing Reference
Defined in sega_def.h
20
5.2 List of Functions
Function Function Name Number
VDP1 Expansion Processing Work Area Definition Macro SPR_2DefineWork 1
Initializing Process for the VDP1 Expansion Processing SPR_2Initlial 2
Library
Set the TV Mode SPR_2SetTvMode 3
Set Frame Change V-Blank Interval Count SPR_2FrameChgIntr 4
Set Frame Buffer Erase Data SPR_2FrameEraseData 5
Set the Gouraud Shading Table SPR_2SetGourTbl 6
Set the Lookup Table SPR_2SetLookupTbl 7
Set Characters SPR_2SetChar 8
Clear Character Area SPR_2ClrChar 9
Clear All Character Area SPR_2ClrAllChar 10
Convert Gouraud Shading Table Number to VRAM Address SPR_2GourToVRAM 11
Convert Lookup Table Number to VRAM Address SPR_2LookupTblNoToVRAM 12
Convert Character Number to VRAM Address SPR_2CharNoToVRAM 13
Open Command Write Processing SPR_2OpenCommand 14
Close Command Write Processing SPR_2CloseCommand 15
Set Local Coordinates SPR_2LocalCoord 16
Set the System Clipping Area SPR_2SysClip 17
Set the User Clipping Area SPR_2UserClip 18
Draw Line SPR_2Line 19
Draw Polyline SPR_2PolyLine 20
Draw Polygon SPR_2PolyGon 21
Draw Normal Sprite SPR_2NormSpr 22
Draw Scaled Sprite SPR_2ScaleSpr 23
Draw Distorted Sprite SPR_2DistSpr 24
Set Command SPR_2Cmd 25
Flush the Command Draw Priority Chain SPR_2FlushDrawPrty 26
Allocate VRAM Block area (static) SPR_2AllocBlock 27
Free VRAM Block Area (static) SPR_2FreeBlock 28
22
Title Function Function Name No
Function Specification Set Frame Change V-Blank Interval Count SPR_2FrameChgIntr 4
24
Title Function Function Name No
Function Specification Clear All Character Area SPR_2ClrAllChar 10
26
Title Function Function Name No
Function Specification Set the System Clipping Area SPR_2SysClip 17
28
Title Function Function Name No
Function Specification Draw Normal Sprite SPR_2NormSpr 22
30
Title Function Function Name No
Function Specification Allocate VRAM Block area (static) SPR_2AllocBlock 27
“no” is used by the user callback routine to identify the cluster table, it can
be set as desired.
angleSeq = ROT_SEQ_ZYX : Rotate object in Z→Y→X order.
= ROT_SEQ_ZXY : “ Z→X→Y “
= ROT_SEQ_YZX : “ Y→Z→X “
= ROT_SEQ_YXZ : “ Y→X→Z “
= ROT_SEQ_XYZ : “ X→Y→Z “
= ROT_SEQ_XZY : “ X→Z→Y “
If a 3D object, the next cluster or a child cluster will not connect, each of the
object, the next cluster, and the child are set to 0.
transStart indicates the user call back routine that is called before coordinate
conversion begins. In the routine, items such as cluster movement and
object data changes, take place. This is 0 if there is no call back routine.
32
transEnd indicates the user call back routine that is called after the coordinate
conversion begins. This call back routine is called up for each 3D object
connected to the object. This is 0 if there is no call back routine.
Context indicates the context area that is used for each cluster by the user call
back routine.
34
If the normal vector table, shading index table, or
next object is not connected, each of vertNormal,
shdInxTbl, and next is set to 0.
b11-b0:
If the texture was set using the drawMode, the color bit changes as follows.
color b15,b14 indicate texture reverse mode.
b15,b14 = 00:
01:
10:
11:
36
6.2 List of Functions
Function Function Name Number
3D Sprite Work Area Definition Macro SPR_3DefineWork 1
Initialize 3D Sprite Display SPR_3Initial 2
Set Clipping Mode SPR_3SetClipLevel 3
Set Unit Pixel Count SPR_3SetPixelCount 4
Set Light SPR_3SetLight 5
Set View SPR_3SetView 6
Move Cluster SPR_3MoveCluster 7
Record Model SPR_3DrawModel 8
Draw Model SPR_3Flush 9
Set Texture SPR_3SetTexture 10
Clear Texture Area SPR_3ClrTexture 11
Function call for all clusters SPR_3CallAllCluster 12
Change texture color data SPR_3ChangeTexColor 13
Set Z sort minimum and maximum SPR_3SetZSortMinMax 14
Get current 3D status data SPR_3GetStatus 15
Set object normal surface vector SPR_3SetSurfNormVect 16
VDP1 high speed draw parameter set SPR_3SetDrawSpeed 17
38
Title Function Function Name No
Function Specification Set Light SPR_3SetLight 5
Format void SPR_3SetLight (Uint16 moveKind, MthXyz
*lightAngle)
Input moveKind : Type of move amount
b0: 0= Relative Move
1= Absolute move
b1: 0= Rotate move amount is angle
1= Rotate move amount is unit vector
lightAngle : If the light source rotation amount is an angle,
the designated range of the move is calculated
according to the equation below. Vector
designations are converted to angles.
FIXED(-180.0)≤ Rotate amount≤FIXED(180.0)
Rotate operation is done in X→Y→Z order.
Output None
Function Value None
Function Sets the light angle.
40
Title Function Function Name No
Function Specification Draw Model SPR_3Flush 9
42
Title Function Function Name No
Function Specification Get current 3D status data SPR_3GetStatus 15
44
VDP2 Library
1.0 Guide
1.1 Objective
· Automates hardware-related processing such as VDP1 initialization, register
operation, etc., to reduce the load on the application author.
· Using this library enables one to set the registers without really being aware of
V-BLANK. Automates hardware-related processing related to V-BLANK interrupt
processing to reduce the load on the application author. Also supplies the V-
BLANK interrupt processing routine and frame change settings routine needed to
display VDP1 and VDP2.
1.2 Explanation
VDP2 is only allowed to access a register or color RAM during V-BLANK. In addi-
tion, it cannot read many registers.
The VDP2 library contains a register buffer; normal reading and writing to registers
occur in this buffer and are copied to the register during the next V-BLANK. (See
the reference for more information on the register buffer.) The functions of this
library are divided into larger groups as shown below.
Initializing Function
Must be executed first when starting up the VDP2 library.
Register Buffer W
rite / Read Macro
Supplies the bit access macro for reading the register buffer of priority-related
functions used by this library. There are about 90 varieties, each of read and write
macros.
• Write macro command line
SCL_SET_<BitName>(arg);
• Read macro command line
ret = SCL_GET_,BitName>();
<BitName> : Bit name (Refer to “VDP2 User’s Manual”)
arg, ret : Refer to the “VDP2 User’s Manual”
46
• Undefined Interval Manual Change Mode (Synchronous Mode)
The undefined interval manual change mode starts when 0xffff is set as the V-
BLANK interval count in the SCL_SetFrameInterval().
In the undefined mode, the frame is changed simultaneously with the first V-
BLANK interrupt when the VRAM command write ends and the
SCL_DisplayFrame routine is called. However, before frame change, the VDP1
must have finished writing to the frame buffer or it goes into a loop to wait.
Also, the frame buffer cannot be erased during frame change, so the user must
use the VRAM command lead to clear the frame buffer with a polygon.
Also, by writing the contents of the scroll data to the scroll register during V-
BLANK with the frame change timing in this access routine, scroll motion and
sprite frame change are simultaneous. If this method does not match AP, an
independent interrupt routine must be used.
• V-BLANK End VDP Interrupt Process Routine
If the frame change flag is on, frame change is executed.
VRAM Mapping
2M bit
Effective use of VDP2 depends on how the data is placed in the VRAM.
For example, to display a 16,770,000 color bitmap image, all of the VRAM would be
filled with no room to display other images.
Next, VRAM mapping examples will be explained. The image data used in the
example is bitmap data. This is because the data size is fixed and can be used for
direct mapping. In the cell format, the data size changes depending on how the data
is stored. If there are many common parts, the memory usage is more efficient than
bitmapping.
48
[Example 1] Using Five Screens Displayable by the VDP2
Other than NBG2 and NBG3, all data is bitmap. If rotating screen 1 is
256 colors and the normal 4 screens are 16 colors, it will be as follows.
To move the rotating screen, a rotation parameter table is required. If
X and Y axis rotation is to be done, a rotation parameter coefficient
table must also be prepared.
In this library, the rotation parameter coefficient table is usually
placed at the lead of each bank (VRAM A0, VRAM A1, VRAM B0,
VRAM B1). However, the X and Y axis rotation can only be used in
2kWord (4kByte). This allows the remaining area (124kByte) to be
filled with the rotation parameter table, line scroll table, line color
table, back screen data, etc. (1M bit = 128kByte)
Rotation Parameter
VRAM A1 Coefficienct Table (1word)
Rotation Parameter Table
16 Colors Bit Map Data
NBG 0
(512x256)0.5M bit
VRAM B0 16 Colors Bit Map Data
(512x256)0.5M bit
NBG 1
Character Parameter
Data Pattern Name Data NBG 2
VRAM B1
Character Parameter
Data Pattern Name Data NBG3
Rotation Parameter
VRAM A1 Coefficienct Table (1word)
Rotation Parameter Table
Character Pattern Data
VRAM B0 RBG 1
1Mbit
50
Setting VRAMAssignments and Cycle Patterns
VDP2 displays by reading from VRAM at the same time as the scroll screen data is
being scanned on the TV. VRAM access during display is either 4 times (hi-res
display) or 8 times (normal display) being one access unit (1 cycle) with cycles being
repeated.
There is a cycle pattern register prepared for each VRAM and bank, VRAM
A(VRAM A0, VRAM A1) and VRAM B (VRAM B0, VRAM B1). Access is displayed
as 4 bit for one command. (Refer to “3.4 VRAM Access during display in the VDP2
User’s Manual”).
The number of accesses set in the cycle pattern depends on the data type and use.
These need to be applied to the cycle pattern table.
Table 1 Access count for the required pattern name table data for 1 cycle
Item NBG0 ~ NBG3 RBG0, RBG1
Compression Times 1 Times 1/2 Times 1/4 –
VRAM access needed for 1 cycle 1 2 4 8
Table 2 Data Access for character pattern data (bitmap pattern data)
Item NBG0 ~ NBG3 RBG0, RBG1
TV Display Mode
Normal Hi-res Custom
Character colors
16 256 2048 32768 16770000 – – –
Compression Rate
1 1/2 1/4 1 1/2 1 1 1 – – –
VRAM access needed
1 2 4 2 4 4 4 8 8 4 4
for one cycle
For example, with 16 color bitmap data (uses character pattern data), up to four sets
of 512 x 256 data can placed in just one or in either VRAM A or VRAM B. If this is
applied to the normal scroll screen, the access amount would total 4 times. How-
ever, normal scroll screens NBG0 and NBG1 have compression functions. Using this
function and setting the compression ratio to 1/4 would increase the access count to
10, which exceeds 8, and the screen would not be displayed correctly. In this case, if
VRAM allocation is done, the access count will be distributed and the screen will
display correctly.
Program Examples
Program examples using the C language are shown below.
#include <machine.h>
#include “sega_scl.h”
SclConfig scfg;
main()
{
SCL_Vdp2Init(); */
52
................... /* Store the scroll data in VDP2 VRAM */
SCL_InitConfigTb(&scfg); */
scfg.dispenbl = ON; */
scfg.charsize = SCL_CHAR_SIZE_1X1;
scfg.pnamesize = SCL_PN1WORD;
scfg.platesize = SCL_PL_SIZE_1X1;
scfg.coltype = SCL_COL_TYPE_256;
scfg.flip = SCL_PN_12BIT;
scfg.datatype = SCL_CELL;
scfg.plate_addr[0] = SCL_VDP2_VRAM_A+0x0000;
scfg.plate_addr[1] = SCL_VDP2_VRAM_A+0x2000;
scfg.plate_addr[2] = SCL_VDP2_VRAM_A+0x4000;
scfg.plate_addr[3] = SCL_VDP2_VRAM_A+0x6000;
SCL_SetConfig(SCL_NBG0, &scfg);
SCL_SetCycleTable(n0_cycle); */
INT_SetScuFunc(.....); */
set_imask(0); */
SCL_Open(SCL_NBG0); */
SCL_Move(FIXED(1), FIXED(1), 0);/* Types of scroll move functions */
.
.
.
SCL_Close(SCL_NBG0); */
SCL_DisplayFrame(); */
}
54
2.0 Reference
Note: If any type of rotation data is placed in a VRAM bank, other data
cannot be placed there. However, if ktboffsetA or ktboffsetB is set, other data can
be placed with coefficient data.
56
Title Data Data Name No
Data Specification Structure of the Scroll Configuration Data Sclconfig
58
Title Data Data Name No
Structure of line & and vertical cell scroll
Data Specification parameter data
SclLineParam
SclSysReg
SclDataset
60
Title Data Data Name No
Data Specification VDP2 Register Buffer 3 SclNorscl
SclNorscl
SclRotscl Scl_r_reg;
SclWinscl
Uint16 SclDisplayX;
Uint16 SclDisplayY;
62
2.2 List of Functions
Function Function Name Number
[Initializing Functions]
Initialize Library SCL_Vdp2Init 1
[Table Creation and Data Set Functions]
Set display mode SCL_SetDisplay Mode 2
Initialize VRAM configuration data table SCL_InitVramConfigTb 3
Initialize scroll configuration data table SCL_InitConfigTb 4
Set the VDP2 VRAM usage method SCL_SetVramConfig 5
Set the scroll configuration SCL_SetConfig 6
Set cycle patterns SCL_SetCycleTable 7
[Functions Related to the Display Screen Functions]
Scroll open process SCL_Open 8
Scroll close process SCL_Close 9
Initialize line and vertical cell scroll parameter table SCL_InitLineParamTb 10
Set line and vertical cell scroll parameters SCL_SetLineParam 11
Move scroll (Amount of move : absolute coord.) SCL_MoveTo 12
Move scroll (Amount of move : relative coord.) SCL_Move 13
Enlarge or reduce scroll SCL_Scale 14
Initialize the rotation parameter table SCL_InitRotateTable 15
Set rotation view SCL_SetRotateViewPoint 16
Set the display rotate center coordinates SCL_SetRotateCenterDisp 17
Set rotation center SCL_SetRotateCenter 18
Scroll rotate (angle : absolute coord.) SCL_RotateTo 19
Scroll rotate (angle : relative coord.) SCL_Rotate 20
Set scale coefficient data in therotate coefficient table SCL_SetCoefficientData 21
Set mosaic process SCL_SetMosaic 22
[Line Screen Setting Functions]
Set line color screen data SCL_SetLncl 23
Set back screen data SCL_SetBack 24
[Window Setting Functions]
Set normal rectangle window SCL_SetWindow 25
Set normal line window SCL_SetLineWindow 26
Set sprite window SCL_SetSpriteWindow 27
64
2.3 Function Specifications
Title Function Function Name No
Function Specification Initialize library SCL_Vdp2Init 1
sample()
{
SclVramConfig tp;
SCL_InitVramConfigTb(&tp);
tp.vramModeB = ON
tp.vramB0 = SCL_RBG0_CHAR; /* Places RBG0 character data */
tp.vramB1 = SCL_RBG0_PN; /* Places RBG0 pattern name data */
SCL_SetVramConfig(&tp);
}
66
Title Function Function Name No
Function Specification Set the scroll configuration SCL_SetConfig 6
Uint16 cycle[] = {
0xffff, 0xffff,
0xffff, 0xffff,
0x4444, 0xff55,
0x23ff, 0x67ff,
}
sample()
{
SCLVramConfig tp;
SCL_InitVramConfigTb(&tp);
tb.vramModeA = ON
tp.vramA0 = SCL_RBG0_CHAR;
tp.vramA1 = SCL_RGB0_K;
SCL_SetVramConfig(&tp);
SCL_SetCycleTable(&cycle);
}
68
Title Function Function Name No
Function Specification Scroll open process SCL_Open 8
70
Title Function Function Name No
Function Specification Enlarge or reduce scroll SCL_Scale 14
72
Title Function Function Name No
Function Specification Scroll rotate (angle : absolute coord.) SCL_RotateTo 19
74
Title Function Function Name No
Function Specification Set line color screen data SCL_SetLncl 23
DataTB = 0x0000;
SCL_SetBack(SCL_VDP2_VRAM, 1, &DataTB);
}
76
Title Function Function Name No
Function Specification Set normal line window SCL_SetLineWindow 26
Output None
Function Value None
Function Sets the color RAM mode.
78
Title Function Function Name No
Function Specification Set color RAM color data SCL_SetColRam 31
80
Title Function Function Name No
Function Specification Get priorities SCL_GetPriority 37
82
Title Function Function Name No
Function Specification Increase/decrease the color offset SCL_IncColOffset 42
value
84
Title Function Function Name No
Function Specification Set shadow bit SCL_SetShadowBit 48
Format void SCL_SetShadowBit(Uint32 enable);
Input enable : Indicates which screen will have shadow. Use OR
to indicate multiple screens simultaneously.
SCL_NBG0| SCL_NBG1| SCL_NBG2|SCL_NBG3|
SCL_RBG0| SCL_RBG1|SCL_BACK|SCL_EXBG|SCL_NON
Output None
Function Value None
Function Sets the shows bit.
Comments Shadow sprites must be prepared in advance using VDP1.
86
Mathematical Calculation Library
1.0 Guide
1.1 Objective
The mathematical calculation library is a group of routines designed to simplify 3D
display, 3D object move calculations, 32-bit fixed decimal calculations, etc.
These routines are separated into the following categories.
• Triangle Functions
Sin, cos values are pulled from the table. Tables are recorded once each, and
between each is a straight line complement.
• Other Functions
Calculation function other than that listed above.
88
2.0 Reference
90
2.2 List of Functions
Function Function Name Number
<Triangle Functions>
sin function MTH_Sin 1
cos function MTH_Cos 2
atan function MTH_Atan 3
<Matrix Calculation>
Initialize matrix stack MTH_InitialMatrix 4
Clear current matrix MTH_ClearMatrix 5
Push matrix MTH_PushMatrix 6
Pop matrix MTH_PopMatrix 7
Combine matrix and move horizontally MTH_MoveMatrix 8
Combine matrix and rotate X MTH_RotateMatrixX 9
Combine matrix and rotate Y MTH_RotateMatrixY 10
Combine matrix and rotate Z MTH_RotateMatrixZ 11
Combine matrix and reverse Z MTH_ReverseZ 12
Matrix calculation and multiplication MTH_MulMatrix 13
Matrix calculation and vertex coordinate conversion MTH_CordTrans 14
Matrix calculation, line toggle coordinate conversion MTH_NormalTrans 15
<3D Polygon Data Coordinate Conversionthrough the DSP>
Initialize Coordinate Conversion Process MTH_PolyDataTransInit 16
Execute the Coordinate Conversion Process MTH_PolyDataTansExec 17
Check the Coordinate Conversion Process MTH_PolyDataTransCheck 18
<Perspective Conversion>
3D perspective conversion MTH_Pers2D 19
<Random Number Generator>
Initialize the Random Number Generator MTH_InitialRand 20
Get Random Number MTH_GetRand 21
<Spline Curve Calculation>
Curve calculation, work area definition macro MTH_INIT_CURVE 22
Curve calculation, 2D MTH_Curve2 23
Curve calculation, 2D with tangent MTH_Curve2t 24
Curve calculation, 3D MTH_Curve3 25
Curve calculation, 3D with tangent MTH_Curve3t 26
92
2.3 Function Specifications
<Triangle Functions>
94
Title Function Function Name No
Function Specification Combine matrix and move horizontally MTH_MoveMatrix 8
96
<3D Polygon Data Coordinate Conversion through the DSP>
<Perspective Conversion>
Format void MTH_Pers2D ( Mt hXyz *p3d, Mt hXy *uni t Pi xel, XyI ni t *p2d )
Input p3d : View coordinate system 3D vertex coordinates
unitPixel : Screen XY unit pixels
Output p2d : 2D screen coordinates after perspective conversion
Function Value None
Function Converts from 3D to 2D perspective by setting the screen to -1.0
as the view of the coordinate system base point. The size of 1.0
on the screen corresponds to the XY unit pixels.
98
<Random Number Generator>
Format Ui nt 32 count = MTH_Cur ve2( Mt hCur veWo rk *wo rk, Mt hXy *i n_a ray,
Ui nt 32 i n_n, Ui nt 32 out _n, Mt hXy *out _a ray)
Input work : Work area pointer
in_aray : Input coordinate aray
in_n : Input coordinate count
out_n : Output coordinate count
Output out_aray : Output coordinate aray
Function Value count : More than 2 output coordinates 0: parametererror
Function work indicates the work area reserved by the
MTH_INIT_CURVE macro.
- in_aray indicates the pointer to input coordinates that pass
through the curve.
- in_n indicates the number in in_aray. Please indicate more
than 3.
- out_n indicates the number in out_aray. Please indicate more
than 2.
- out_aray indicates the pointer that receives the calculation
results. It returns the aray of the output coordinates that pass
through the curve.
100
Title Function Function Name No
Function Specification Curve calculation, 2D with connectors MTH_Curve2t 24
Format Uni t 32 count = MTH_Cur ve2( Mt hCur veWo rk *wo rk, Mt hXy *i n_a ray,
Uni t 32 i n_n, Uni t 32 out _n, Mt hXy *out _a ray Mt hXy *t an_a ray)
Input work : Work area pointer
in_aray : Input coordinate aray
in_n : Input coordinate count
out_n : Output coordinate count
Output out_aray : Output coordinate aray
tan_aray : Connector line toggle of each output coordinates
Function Value count : More than 2 output coordinates 0: parametererror
Function work indicates the work area reserved by the
MTH_INIT_CURVE macro.
- in_aray indicates the pointer to input coordinates that pass
through the curve.
- in_n indicates the number in in_aray. Indicate more than 3.
- bout_n indicates the number in out_aray. Indicate more than
2.
- out_aray indicates the pointer that receives the calculation
results. It returns the aray of the output coordinates that pass
through the curve.
- tan_aray returns the tangent vector toggle that shows the
direction of progress for each output coordinate. The size of
the tangent vector is 1.0.
Format Ui nt 32 count = MTH_Cur ve3( Mt hCur veWo rk *wo rk, Mt hXyz *i n_a ray,
Uni t 32 i n_n, Uni t 32 out _n, Mt hXyz *out _a ray)
Input work : Work area pointer
in_aray : Input coordinate aray
in_n : Input coordinate count
out_n : Output coordinate count
Output out_aray : Output coordinate aray
Function Value count : More than 2 output coordinates 0: parametererror
Function work indicates the work area reserved by the
MTH_INIT_CURVE macro.
- in_aray indicates the pointer to input coordinates that pass
through the curve.
- in_n indicates the number in in_aray. Indicate more than 3.
- out_n indicates the number in out_aray. Indicate more than 2.
- out_aray indicates the pointer that receives the calculation
results. It returns the aray of the output coordinates that pass
through the curve.
Format Ui nt 32 count = MTH_Cur ve3t ( Mt hCur veWo rk *wo rk, Mt hXyz *i n_a ray,
Uni t 32 i n_n, Uni t 32 out _n, Mt hXyz *out _a ray, Mt hXyz *t an_a ray)
Input work : Work area pointer
in_aray : Input coordinate aray
in_n : Input coordinate count
out_n : Output coordinate count
Output out_aray : Output coordinate aray
tan_aray : Tangent vector toggle of each output coordinates
Function Value count : More than 2 output coordinates 0: parametererror
Function work indicates the work area reserved by the
MTH_INIT_CURVE macro.
- in_aray indicates the pointer to input coordinates that pass
through the curve.
- in_n indicates the number in in_aray. Indicate more than 3.
- out_n indicates the number in out_aray. Indicate more than 2.
- out_aray indicates the pointer that receives the calculation
results. It returns the aray of the output coordinates that pass
through the curve.
- tan_aray returns the tangent vector toggle that shows the
direction of progress for each output coordinate. The size of
tangent vector is 1.0.
Cautions on Use
These curve calculation functions were developed with process
speed as a top priority, so there is no overflow check. But, if a
large number is encountered during function calculation, an
overflow will occur. The allowable range of input data is as
follows:
· Distance between points: more than 0.1.
· Point coordinate value range: between -1000 and 1000.
Also, because of possible algorithm changes in future versions,
the same output coordinates may not be produced with the
same parameters.
102
<Fixed Point Calculations>
Title Function Function Name No
Function Specification Multiplication Routine MTH_Mul 27
104
<Other Functions>
Title Function Function Name No
Function Specification Square Root MTH_Sqrt 34
Format Fixed32 result = MTH_Sqrt(Fixed32x)
Input x : Correct fixed point real number value
Output None
Function Value result : Calculated square root value
Function Calculates and returns the square root of the input value.
106
DSP I/F Library
1.0 Guide
1.1 Objective
The purpose of this library is to provide an interface for DSP program control.
1.2 Overview
This library has the following interfaces prepared.
· Program load
· Data write
· Data read
· Start program execution
· Stop program execution
· Check for execution end
• Data write
Transfers the DSP program data (parameters) stored in work RAM, etc., to DSP
data RAM.
• Data read
Reads DSP data and RAM data (results, etc.)
void GoDsp ()
{
Uint32 dsp_result[10]; /* DSP result storage variable */
108
2.0 Reference
2.1 List of Functions
Function Function Name Number
Program load DSP_LoadProgram 1
Data write DSP_WriteData 2
Data read DSP_ReadData 3
Start program execution DSP_Start 4
Stop program execution DSP_Stop 5
Check for execution end DSP_CheckEnd 6
110
Title Function Function Name No
Function Specification Check for execution end DSP_CheckEnd 6
Function Checks to see if the DSP program has finished running or not.
D
DSP_CheckEnd ........................... 111 MTH_RotateMatrixY .................. 95
DSP_LoadProgram ..................... 109 MTH_RotateMatrixZ .................. 95
DSP_ReadData ............................ 110 MTH_Sin ...................................... 93
DSP_Start ..................................... 110 MTH_Sqrt .................................... 105
DSP_Stop ...................................... 110 MthMatrix .................................... 89
SDP_WriteData ........................... 109 MthMatrixTbl .............................. 89
MthPolyTransParm..................... 90
M MthViewLight ............................. 90
MTH_Atan ................................... 93 MthXy ........................................... 89
MTH_ClearMatrix ...................... 94 MthXyz ......................................... 89
MTH_ComputeNormVect ......... 105
MTH_CordTrans ......................... 96 S
MTH_Cos ..................................... 93 SCL_AbortAutoVE ..................... 86
MTH_Curve2 ............................... 100 SCL_AllocColRam ...................... 79
MTH_Curve2 ............................... 101 SCL_Close .................................... 69
MTH_Curve3 ............................... 101 SCL_DisableBlur ......................... 84
MTH_Curve3t ............................. 102 SCL_DisableLineCol................... 84
MTH_Div ..................................... 103 SCL_DisplayFrame ..................... 85
MTH_FIXED ................................ 103 SCL_EnableBlur .......................... 84
MTH_FixedToInt......................... 104 SCL_EnableLineCol .................... 84
MTH_FLOAT............................... 103 SCL_FreeColRam ........................ 79
MTH_GetRand ............................ 109 SCL_GetColRamMode ............... 78
MTH_Hypot ................................ 105 SCL_GetColRamOffset .............. 80
MTH_INIT-CURVE .................... 100 SCL_GetPriority .......................... 81
MTH_Initial Matrix .................... 94 SCL_IncColOffset ........................ 83
MTH_InitialRand ........................ 99 SCL_InitConfigTb ....................... 66
MTH_IntToFixed......................... 104 SCL_InitLineParamTb ................ 69
MTH_MoveMatrix...................... 95 SCL_InitLineParmTb .................. 69
MTH_Mul .................................... 103 SCL_InitRotateTable ................... 71
MTH_MulMatrix ........................ 96 SCL_InitVramConfigTb ............. 66
MTH_NormalTrans .................... 96 SCL_Move .................................... 70
MTH_Pers2d................................ 98 SCL_MoveTo ............................... 70
MTH_PolyDataTransCheck ...... 98 SCL_Open .................................... 69
MTH_PolyDateTransExec ......... 97 SCL_Rotate .................................. 73
MTH_PolyDataTransInit ........... 97 SCL_RotateTo .............................. 73
MTH_PopMatrix ......................... 94 SCL_Scale ..................................... 71
MTH_Product.............................. 104 SCL_SetAutoColChg .................. 80
MTH_PushMatrix ....................... 94 SCL_SetAutoColMix .................. 82
MTH_ReverseZ ........................... 96 SCL_SetAutoColOffset ............... 83
MTH_RotateMatrixX .................. 95 SCL_SetBack ................................ 75
112
SCL_SetCoefficientData ............. 74 SPR_2CloseCommand ............... 26
SCL_SetColMixMode ................. 81 SPR_2ClrAllChar ........................ 25
SCL_SetColMixRate ................... 81 SPR_2ClrChar .............................. 24
SCL_SetColOffset ........................ 82 SPR_2Cmd ................................... 30
SCL_SetColRam .......................... 79 SPR_2DEFINE_WORK .............. 22
SCL_SetColRamMode ................ 78 SPR_2DefineWork ....................... 22
SCL_SetConfig ............................ 67 SPR_2DistSpr ............................... 30
SCL_SetCycleTable ..................... 67 SPR_2FlushDrawPrty ................. 30
SCL_SetDisplayMode ................ 65 SPR_2FrameChgIntr ................... 23
SCL_SetFrameInterval ............... 85 SPR_2FrameEraseData ............... 23
SCL_SetLineParam ..................... 70 SPR_2FreeBlock ........................... 31
SCL_SetLineWindow ................. 77 SPR_2GourTblNo ....................... 25
SCL_SetLncl ................................. 75 SPR_2GourTblNooV ram ......... 25
SCL_SetMosaic ............................ 74 SPR_2Initial.................................. 22
SCL_SetPriority ........................... 80 SPR_2Line .................................... 27
SCL_SetRotateCenter ................. 72 SPR_2LocalCoord ....................... 26
SCL_SetRotateCenterDisp ......... 72 SPR_2LookupTblNo ................... 25
SCL_ SetRotateViewPoint.......... 72 SPR_LookupTblNoToVram ....... 25
SCL_SetShadowBit ..................... 85 SPR_2NormSpr ........................... 29
SCL_SetSpriteMode .................... 78 SPR_2OpenCommand ............... 26
SCL_SetSpriteWindow ............... 77 SPR_2PolyGon ............................ 28
SCL_SetVramconfig .................... 66 SPR_2Polygon ............................. 28
SCL_SetWindow ......................... 76 SPR_2PolyLine ............................ 28
SCL_VblankEnd .......................... 86 SPR_2ScaleSpr ............................. 29
SCL_VblankStart ......................... 86 SPR_2SetChar .............................. 24
SCL_Vdp2Init .............................. 65 SPR_2SetGourTbl ........................ 23
Sclconfig ....................................... 57 SPR_2SetLookupTbl ................... 24
SclDataset ..................................... 60 SPR_2SetTvMode ........................ 22
SclDisplayX, SclDisplayY .......... 62 SPR_2Sysclip ............................... 27
ScILineParam............................... 59 SPR_2UserClip ............................ 27
SclLineTb ...................................... 55 SPR_2UsrClip .............................. 27
SclLineWindowTb ...................... 55 SPR_3CallAllCluster .................. 41
SclNorscl ...................................... 61 SPR_3ChangeTexColor .............. 42
SclRgb ........................................... 56 SPR_3ClrTexture ......................... 41
SclRgb ........................................... 56 SPR_3DEFINE_WORK .............. 37
SclRotscl ....................................... 61 SPR_3DefineWork ....................... 37
SclSclconfig .................................. 57 SPR_3DrawModel ...................... 40
SclSysreg ...................................... 60 SPR_3Flush .................................. 41
SclVramConfig ............................ 56 SPR_3GetStatus ........................... 43
SclWinscl ...................................... 62 SPR_3Initial.................................. 38
SclXy ............................................. 55 SPR_3MoveCluster ..................... 40
SclXyz ........................................... 55 SPR_3SetClipLevel ..................... 38
SPR_2AllocBlock ......................... 31 SPR_3SetDrawSpeed .................. 43
SPR_2CharNo .............................. 25 SPR_3SetLight ............................. 39
SPR_2CharNoToVram ................ 25 SPR_3SetPixelCount ................... 38
X
XyInt ............................................. 19
114
TM
System Library
User's Guide
Doc. # ST-162-062094
CONTENTS
System Program User’s Manual .......................... 1
SMPC I/F User’s Manual ..................................... 7
CD Communication Interface User’s Manual ..... 21
In translating/creating this document, certain technical words and/or phrases were interpreted
with the assistance of the technical literature listed below.
ii
Table of Contents
iii
4.0 CD DRIVE ......................................................................... 33
4.1 CD Drive Status Change ....................................... 33
4.2 CD Drive Operation ............................................... 37
4.3 Subcodes .................................................................. 39
iv
Pages 1-20 of this document have been
Guide ver.1.0”.
CD Communication Interface User’s Manual
1.0 OVERVIEW
This document is a collection of CD block functions and CD communication inter-
face external specifications. Functions of CD blocks are classified in Table 1.1 below.
Table 1.1 Classification of CD Block Functions
Classification Description
CD Part Communication format, CD drive related, CD buffer
related
CD block file system related
MPEG Part MPEG Related
Application
H OST
Function Call Return
Communication
Command Response Fetch data Write data
with CD Block
Hardware Interface
C D B L O CK
CD Block Program (Host Communication Interface, BIOS, etc.)
CD Drive
In interfacing with the CD block, the main system is called the host.
Moreover, The CD block is one subsystem.
22
1.3 Functions and Characteristics
Numbers “1” to “3” below are functions of the CD communication interface, and “4”
to “7” are CD block functions.
4. CD Drive Function
Playing music (CD-DA) and sector read (CD-ROM) are handled by a common
command such as CD play. Stop and pause CD play are seek commands.
Resume CD play (cancel pause) is executed by the CD play command.
24
List of Symbols and Codes
Symbols and codes used are defined in Table 2.1 below.
Numeric Notation
B is added to the end of a binary number. (Ex: 5 is 101B.)
H is added to the end of a hexadecimal number. (Ex: 255 is FFH.)
A hexadecimal number in a C language program is noted by C language specifica-
tion (0x).
Handling BCD
BCD should not be used in parameters. Numbers recorded as BCD on a CD track
number, for instance, are all converted to binary values.
C Language Identifier
Use identifiers that begin with CD or Cd in the CD communication interface.
Track Layout
Figure 2.1 shows the relationship of the track configuration with the access key that
indicates the position on the disk.
Information Area
Lead in Lead Out
Q Code Area Program Area Area
Time
Absolute Time
ATime
Header
(minute, second, frame)
Logic Sector
(LSN)
Frame Address
(FAD)
Header
(minute, second, frame
Frame Address
(FAD)
TOC Information Track start FAD Track start FAD Track start FAD
Session Information Session start FAD Session start FAD Session start FAD . . ..Index is 00
26
3.0 COMMUNICATION WITH THE CD BLOCK
DATATRNS R/W
7 6 5 4 3 2 1 0
7 6 5 4 3 2 1 0
CMOK (bit 0) : Issueable command 1 = command can be issued (response set complete)
DRDY (bit 1) : Data transfer ready 1 = data transfer setup is complete.
CSCT (bit 2) : 1 sector stored 1 = 1 CD-ROM sector is stored or discarded in partition
BFUL (bit 3) : CD buffer full 1 = CD buffer is full
PEND (bit 4) : CD play end 1 = CD play has ended (current FAD is outside play range)
DCHG (bit 5) : Disk exchange 1 = Disk has been exchanged (tray has been opened)
ESEL (bit 6) : Selector set end 1 = soft reset, stop execution of selector set
EHST (bit 7) : Host I/O end 1 = stop execution of host input/output
ECPY (bit 8) : Copy end 1 = stop execution of copy and move between buffer
partition
EFLS (bit 9) : File system end 1 = stop execution of CD block file system
SCDQ (bit10) : Subcode Q 1 = subcode Q renewal complete
(CD drive communication timing)
bit 11 ~ bit 13 : MPEG related interrupt factor (see MPEG part for the meaning of each bit)
7 6 5 4 3 2 1 0
28
MPEG Register (MPEGRGB)
This register is for transferring in the RGB format MPEG frame buffer image data
that is in the RGB format to the host.
MPEGRGB R
7 6 5 4 3 2 1 0
bit 0 ~ bit 15 : RGB data (See MPEG part for the meaning of each bit.)
Communication Error
A communication time out error occurs when the CD block does not respond (com-
mand is not returned) within the prescribed time after a command is issued.
<Program Guide>
The polling process by continuously issuing commands is prohibited.
Regular response and the interrupt factor register are used in the polling of condi-
tion changes. Use of timing through the CSCT and SCDQ flags, and VSYNC issues
commands.
(a) The ESEL flag also posts the end of soft reset execution.
(b) The EFLS flag is 1 when opening the tray and when stopping file access.
The command end flag is processed when the following commands are issued.
• Soft reset Clears ESEL flag to 0 (no check)
• Gets actual data size Checks ESEL flag (not cleared to 0)
• Gets frame address find results Checks ESEL flag (not cleared to 0)
• Stop file access Clears EFLS flag to 0 (no check)
30
3.3 Response
Response Contents
Response is composed of a 1 byte status and 7 byte report. The status are common
but the report depends on the command. This most basic of reports is the CD report.
Status
The following information returns to status.
Periodic Response
Periodic response is a response that returns with the communication timing of the
CD block with the CD drive. The host can obtain information (status and CD report)
without issuing a command. It is periodically updated by the communication cycle
with the CD drive. (Same as the SCDQ flag update timing.)
32
4.0 CD DRIVE
(a) When doing a soft reset, CD block initialization does not operate as a drive
command.
(b) Drive commands other than tray open can be done concurrently with the tray
close command.
START
Tray Close Command
Manual Close Hard Reset
No
NODISC Disc
TOC Read
Standby Time Elapsed
STANDBY PAUSE
Automatic
PLAY
Play Command
SCAN SEEK
Scan command Seek Command
(a) <PAUSE> occurs two seconds after TOC read at frame 0 (FAD=150=96H).
(b) The <BUSY> status indicates that a status change is in progress (on arrow line).
(c) The tray close command specifies drive commands other than tray open. The
status corresponding to every command changes after the tray is closed.
Example: Play command in the <OPEN> status changes to the <PLAY> status after the
tray is closed.
34
2) Status Change Illustration of an Error System.
Figure 4.2 illustrates the status change of a CD drive in an error system.
Statuses are explained in Table 4.3.
START
Tray Close Command
Manual Close Hard Reset
No
NODISC Disc
TOC Read
Standby Time Elapsed
STANDBY PAUSE
Each Command
Automatic
Retry
RETRY
Retry Succeeded Retry Failed
PLAY
Read Data Error
ERROR
Each Command Fatal Error
SCAN SEEK FATAL
2) Tray Open/Close.
(a) As a rule, the tray open command is executed immediately in any mode.
(b) The tray open/close command when not using the automatic open/close
format is <BUSY> until executed manually.
(c) Commands in the <OPEN> status (except for tray open) change to each
status after the tray close process.
(d) When the tray is closed, <NODISC> occurs if TOC read cannot be done.
(Even if there is a disc).
3) Status Routings.
(a) Everything goes though the <BUSY> status when done by command.
(b) In some cases the routing is by way of <SEEK> when changing to the
<PLAY> and <SCAN> statuses.
36
4.2 CD Drive Operation
↓ ↓
When play has ended, FAD = play end position + 1. (The read out area is indicated
when the play end position concludes at the end of the disc.)
38
4.3 Subcodes
13.3 ms
Subcode Q Update
↓ ↓ ↓ ↓
SCDQ Flag
The SCDQ flag clears the host to 0. The CD block is only 1. Subcode R~W begins the
decode process when data fetch starts and if 8 packs have been collected.
Getting Subcode Q
The Get command can be executed any time regardless of the CD drive status. But
when in the <OPEN> status, ineffective values may return depending on the CD
drive status.
40
5.0 CD BLOCK CONFIGURATION
The characteristics and logical configuration of the CD block as seen from the host is
shown below.
Data Format
The basic unit of the stream handled by the CD buffer is a fixed size (2352 bytes)
sector no matter what the device is.
Device
The CD and MPEG are considered to be logical devices that produce and absorb
streams. The flow of a stream is controlled by connecting a device to the stream
select circuit.
CD Block
Host
Selector
Stream outflow device Filter Buffer partition Stream inflow device
CD-ROM Host
Copy / Move
Device output connector MPEG buffer
42
5.3 Selector Configuration
The selector process function does not rely on the parts connection destination or
device. It separates and stores the input stream and only outputs by request. Figure
5.3 shows the selector configuration.
Filter Buffer partition
In the initial condition of the selector, the filter and partition with the same number
are connected through the true output connector and partition input connector.
Other connectors are not connected.
5.3.1 Filter
Conditions (FAD range, subheader) of the sector that should pass are set in the filter.
Sectors that match with the conditions are output to the true output connector and
stored in buffer partition of the connection destination. All other sectors are output
to false output connectors.
False output connectors can be connected to other filter input connectors and
achieve in secession similar selection processes. Sectors output from unconnected
output connectors will be deleted.
Yes
No
Yes
No
Clear
N1 -1 2 1 0
→ → 1
Np -1 2 1 0
→ → P
Contents of each partition are not fixed; data can be stored as long as there is space in the
whole CD buffer.
44
5.3.3 Connectors
1) Connection from Buffer Partition to Filter (Sector Data Copy/Move)
The partition output connector is connected to the filter input connector and the
flow of sector data allows sector data to be copied and moved. The connection
and flow I/O process are executed by executing one command.
B A or B
46
5.3.4 Selector Precautions
1) Error in the Stream Process
Except with the CD device, error in the stream process occurs in the following
cases.
• Connection separates during operation.
• CD buffer becomes full while reading or writing to the buffer partition.
2340 bytes
2336 bytes
CD-ROM
Mode 1 Sector User Data
synch Header EDC/ECC, etc.
12 4 8 2324 4 bytes
CD-ROM XA
Mode 2 Sector Sub
synch Header User Data EDC,
Form 2 header
etc.
4 bytes repeat
48
5.5 CD Block Initialization
TOC/Session Information
Initialized when the tray is opened, and information is in a non-input condition.
Reads TOC when tray is closed (unrelated to the reset of software.)
File Information
Initialized if tray is opened or software is reset, and information is in a non-input
condition. The host explicitly commands the reading of file information.
Host Information
Initialized if software is reset (unrelated to opening the tray.)
If the CD block is initialized without resetting the software, information in the TOC/
Session and Host is not initialized.
Directory block
Volume Identifier Pass table (Directory file) File
f2
Pass table code f2
~ ~
~ ~ Sub directory
n
Parent
Directory number
Directory block address
Parent directory number f3
Directory name f3
Sub directory
Sub directory
50
6.2 CD Block File System Functions
The CD block file system (referred to “file system” hereafter) has the following
functions.
0 Root directory
1 Parent=Self
2 File 1
~ ~
Move directory
(Hold file information in directory move destination)
0 Self
1 File Information Table
Parent
2 0 Self .... File information of the current directory self
1 Parent
~ ~
i File i Holds file
information
2 File i ← Held identifier of first file (i)
1+i File i+1 3 File i+1 Held file information number (n)
... ...
~ File j
~ ~ File j
~ ← fid = j
... ...
~
i+n -1 File i+n-1
~ 255
~ File i+n-1
~
~ ~
File identifier (fid)
3) Reading Files
File identifier and offset (sector units) are selected and the file read. The read
destination selector is selected by the filter number.
52
6.2.3 File System Precautions
2) Selector Settings
When accessing to a file, the file system does the following settings for the
selector.
54
7.0 DATA SPECIFICATIONS
This chapter lists the constants, data types, access macros, etc. used by the CD com-
munication interface.
• Format
In the figures, the reserved regions are shown by the “–” mark. A 0 must be
specified in the reserve regions.
2) Logic Constants
Used as
Used as aa logic
logic (Boo
(Bool)
1) value.
value.
3) Additional
56
7.2.2 Constants
Title Data Data Name No
Data Specification Constants 2.0
CDC_SNUM_END
Filter Buffer Partitions
Stream N-1 SP 2 1 0
3) Other
Constant Name Description
CDC_NUL_SEL Special value of selector no. (filter number, buffer
partition number)
CDC_NUL_FID Special value of file identifier
1) TOC Information
2) Session Information
Session Number
<Total Session Information>
4 Bytes byte 0 1 2 3
0 Total Session Information Session External read out start frame
Session 1 Information Total No. address
1
2 Session 2 Information Equal to TOC read out start FAD in single
sessions
~ ~ <Session Location Information>
n Session n Information
0 1 2 3
~ ~ Start TNO
within Session start frame address
98 Session 98 Information
session
99 Session 99 Information TNO (track no.) is a binary value
Non-existing sessions are FFFFFFFFH
(when session number exceeds session total)
58
7.2.4 Status and Report
1) Response Format
Command response is in the format below. Whether CD report returns as a
report depends on the command. Periodic response absolutely returns CD
report.
byte 0 1 2 3 4 5 6 7
Status Report
Rep Ctrl
CD Report Flg TNO X FAD
Cnt Adr
2) Status
A status of FFH indicates REJECT (abnormal command)
The status code is valid when WAIT (bit 7 = 1). Other bits (bit 4 to bit 6) are 0.
bit 7 6 5 4 3 2 1 0
3) CD Report
byte 1 2 3 4 5 6 7
Rep Ctrl
CD Report Flg TNO X FAD
Cnt Adr
bit 7 6 5 4
60
5) When CD report content is an ineffective value
(a) The value immediately before the repeat frequency is saved. If changing to
a different status, returns to the retaind value.
(b) Moves to the start (FAD = 150) of the disk if the status changes from Seek
Home to <PAUSE>.
(c) The value immediately before <ERROR> is retained. If changing to the
<PAUSE> status, returns to the retained value.
(d) Midway during the <BUSY> status, the ineffective value returns in some
cases when changing to a different status.
1) Subcode Q Information
(a) When Adr = 1
byte 1 2 3 4 5 6 7 8 9 10
Ctrl
TNO X P_FAD 00 Q_FAD CRC
Adr
R S T U V W
bit 7 6 5 4 3 2 1 0
Pack 24↑bytes
↓
24↑bytes
Packet (corresponds
Pack
↓ to1 frame = 1 sector)
24↑bytes
96 bytes
Pack
↓
Pack 24↑bytes
↓
unused (padded by 0)
62
7.2.6 Data Type
1) Return Code
CdcRet ret . . . . . . Be sure ret is not the pointer.
2) Error Code
Constant Name Explanation
CDC_ERR_OK Normal (process continuation)
CDC_ERR_CMDBUSY Command end flag is not 1
CDC_ERR_CMDNG CMOK flag is not 1 when command is
issued
CDC_ERR_TMOUT Time out (wait for response, wait for data
transfer ready)
CDC_ERR_PUT Data transfer read wait by sector data
write. Could not reserve empty sectors.
CDC_ERR_REJECT REJECT for command response
CDC_ERR_WAIT WAIT for command response
CDC_ERR_TRNS Abnormal data transfer size
CDC_ERR_PERI Not a periodic response
CDC_ERR_PTYPE Abnormal play, seek position type
3) Status
The retaining status of the CD communication interface is substituted in the
return code status together with all functions. Response status returnswhen
response is acquired by acquiring periodic response or issuing commands.
The holding status returns unchanged when a response cannot be acquired by
not issuing a command or error.
1) CD Status Information
CdcStat *stat
Access Macro Type Explanation
CDC_STAT_STATUS (stat) Uint 8 Status
CDC_STAT_FLGREP (stat) Uint 8 CD report CD flag and repeat no.
CDC_STAT_CTLADR (stat) Uint 8 CD report CONTROL/ADR byte
CDC_STAT_TNO (stat) Uint 8 CD report track no. (binary value)
CDC_STAT_IDX (stat) Uint 8 CD report index no. (binary value)
CDC_STAT_FAD (stat) Sint 32 CD report frame address
bit 7 6 5 4 3 2 1 0
1) Hardware Information
CdcHw *hw
Access Macro Type Explanation
CDC_HW_HFLAG (hw) Uint 8 Hardware flag
CDC_HW_VER (hw) Uint 8 CD block version information
CDC_HW_MPVER (hw) Uint 8 MPEG version information
CDC_HW_DRV (hw) Uint 8 CD drive information
CDC_HW_REV (hw) Uint 8 CD block revision information
2) Hardware Flag
bit 7 6 5 4 3 2 1 0
64
Title Data Data Name No
Data Specification CD Position Parameters (1/2) CdcPos 6.4
Designates the CD range of play (start and end positions) and is used in designating
the seek position.
1) Position Type
Default value, frame address, track/index, and no change can be designated at
position parameters. The constants (position type) below are used to select the
parameter.
Constant Name Explanation
CDC_PTYPE_DFL Designates default values
For CD play : indicates disk start and end.
For seek: indicates home position.
CDC_PTYPE_FAD Designates frame address
CDC_PTYPE_TNO Designates track/index
CDC_PTYPE_NOCHG Designates no change (no change in set values)
Beginning of disc: FAD = 150(96H) position (2 seconds, 0 frame with absolute time)
End of disc: FAD = readout start frame address (TOC information) - 1 position.
2) Position Paramters
CdcPos *pos
Access Macro Type Explanation
CDC_POS_PTYPE (pos) Sint 32 Position type
CDC_POS_FAD (pos) Sint 32 Frame address, FAD sector no.
CDC_POS_TNO (pos) Uint 8 Track number
CDC_POS_IDX (pos) Uint 8 Index number
3) Setting Method
(a) Designating the default value
CdcPos pos;
CDC_POS_PTYPE (&pos) = CDC_PTYPE_DFL;
(b) Designating the frame address
CDC_POS_PTYPE (&pos) = CDC_PTYPE_FAD;
CDC_POS_FAD (&pos) = fad; /* frame address */
The end position is designated by sector number (FAD sector
number) from the starting FAD
(c) Designating the Track/Index
CDC_POS_PTYPE (&pos) = CDC_PTYPE_TNO;
CDC_POS_TNO (&pos) = tno; /* track number */
CDC_POS_IDX (&pos) = x; /* index number */
(d) Designating No Change
CDC_POS_PTYPE (&pos) = CDC_PTYPE_NOCHG;
5) Execptions to Track/Index
The track/index is explained by the conditions below.
Condition Start and Seek End Position
Positions
TNO = 0 (track default TNO = disc start track TNO = disc last track
value)
X = 0 (index default X =1 X = 99(63H)
value)
TNO < disc start track TNO = disc start track TNO = disc start track
X = 1 (same as X = 0) X = 99 (same as X = 0 )
TNO > disc end track TNO = disc end track TNO = disc end track
X = 1 (same as X = 0) X = 99 (same as X = 0 )
X does not exist (from the next track) (until track ends)
66
Title Data Data Name No
Data Specification CD Play Parameters CdcPly 6.5
Used to designate the play range and play mode when playing a CD.
1) Play Mode
When playing a CD, the maximum repeat count of the play segment and the
existence of pickup movement (play position) to the start position are
designated. The designation range of the maximum repeat count is 4 bits.
The default value is 0.
bit 7 6 5 4 3 2 1 0
Value Explanation
00H No repeat (plays only one time)
01H ~ 0EH Repeat designation count (repeat 1 ~ 14
times)
0FH Infinite repetitions
7FH Does not change maximum repeat count
CdcPly *ply
Access Macro Type Explanation
CDC_PLY_START (ply) CdcPos Play start position parameters
CDC_PLY_STYPE (ply) Sint 32 Start position type
CDC_PLY_SFAD (ply) Sint 32 Start position frame address
CDC_PLY_STNO (ply) Uint 8 Start position track number
CDC_PLY_SIDX (ply) Uint 8 Start position index number
CDC_PLY_END (ply) CdcPos Play end position parameters
CDC_PLY_ETYPE (ply) Sint 32 End position type
CDC_PLY_EFAS (ply) Sint 32 End position frame address sector
number
CDC_PLY_ETNO (ply) Uint 8 End position track number
CDC_PLY_EIDX (ply) Uint 8 End position index number
CDC_PLY_PMODE(ply) Uint 8 Play mode (repeat designation,
pickup movement)
68
3) Method for setting play parameters
Play parameters designate the play range and play mode. Play range is
designated by a combination of the position parameters of the start and end
positions.
(a) Track designation and frame address designation cannot be combined in the
play range. In such cases, REJECT is returned. All other play range combi-
nations are possible.
(b) All play range and play mode combinations are possible.
(c) The play range and maximum repeat count is held within the CD block and
are effective until reset.
(d) Default value: start of disc to end of disc, no repeat, moves pickup.
dcSubh *subh
Access Macro Type Explanation
CDC_SUBH_FN (subh) Uint 8 File Number
CDC_SUBH_CN (subh) Uint 8 Channel Number
CDC_SUBH_SMMSK (subh) Uint 8 Sub mode mask pattern
CDC_SUBH_SMVAL (subh) Uint 8 Sub mode comparison value
CDC_SUBH_CIMSK (subh) Uint 8 Coding information mask pattern
CDC_SUBH_CIVAL (subh) Uint 8 Coding information comparison value
Whether the submode and coding information is equal to the comparison value is
decided after the logical product of their repective mask patterns are taken.
70
2) Sub Mode
bit 7 6 5 4 3 2 1 0
(Same as CD-ROM XA sub mode byte)
1) Sector Information
CdcSct *sct
Access Macro Type Explanation
CDC_SCT_FAD (sct) Sint 32 Frame address
CDC_SCT_FN (sct) Uint 8 File Number
CDC_SCT_CN (sct) Uint 8 Channel Number
CDC_SCT_SM (sct) Uint 8 Sub mode
CDC_SCT_CI (sct) Uint 8 Coding information
1) File Information
CdcFile *file
Access Macro Type Explanation
CDC_FILE_FAD (file) Sint 32 File start frame address
CDC_FILE_SIZE (file) Sint 32 File size (byte number)
CDC_FILE_UNIT (file) Uint 8 File unit size
CDC_FILE_GAP (file) Uint 8 Gapsize
CDC_FILE_FN (file) Uint 8 File number *
CDC_FILE_ATR (file) Uint 8 File attributes
*
When there is no directory record system information, the file
number becomes 0.
2) File Attributes
bit 7 6 5 4 3 2 1 0
Note 1: bit 1 is a directory bit of the file flag within the directory record and valid when there
is no system information (discriminant gives bit 7 priority)
Note 2: bits 3 to 7 is attribute information conforming to CD-ROM XA standards, and bits 3 to
7 are 0 when there is no system information.
72
8.0 Function Specifications
1) Format
Reserved areas with the figure are indicated by a “–” mark. Reserved areas
must be designated with a 0.
Nothing changes when there is an error (When the error code is not CDC_ERR_OK).
74
Table 8.1 List of CD Communication Interface Functions (2)
Function Name Number
Buffer Information 6.0
Get CD buffer size CDC_GetBufSiz 6.1
Get buffer partition sector number CDC_GetSctNum 6.2
Calculate actual data size CDC_CalActSiz 6.3
Get actual data size CDC_GetActSiz 6.4
Get sector information CDC_GetSctInfo 6.5
Execute frame address search CDC_ExeFadSearch 6.6
Get frame address search results CDC_GetFadSearch 6.7
Buffer Input/Output 7.0
Set sector length CDC_SetSctLen 7.1
Get sector data CDC_GetSctData 7.2
Delete sector data CDC_DelSctData 7.3
Get and delete sector data CDC_GetdelSctData 7.4
Write sector data CDC_PutSctData 7.5
Copy sector data CDC_CopySctData 7.6
Move sector data CDC_MoveSctData 7.7
Get sector data copy/move error CDC_GetCopyErr 7.8
CD Block File System 8.0
Change directory CDC_ChgDir 8.1
Hold file information CDC_ReadDir 8.2
Get holding file information range CDC_GetFileScope 8.3
Get holding file information CDC_TgetFileInfo 8.4
Read file CDC_ReadFile 8.5
Stop file access CDC_AbortFile 8.6
Register Access 9.0
Get data transfer register pointer CDC_GetDataPtr 9.1
Get interrupt factor register value CDC_GetHirqReq 9.2
Clear interrupt factor register CDC_ClrHirqReq 9.3
Get interrupt mask register value CDC_GetHirqMsk 9.4
Set interrupt mask register CDC_SetHirqMsk 9.5
Get MPEG register pointer CDC_GetMpegPtr 9.6
76
Title Function Function Name [S- ] No.
Function Get hardware information CDC_GetHwInfo 1.4
Specifications
1) Initializing flag
Designates each type of setting flag (8 bits) to the CD block.
When software is reset, all other initialized parameters are ignored and this
becomes the initial value.
bit 7 6 5 4 3 2 1 0
Initial value : 00H
1 : Reset CD block software 0 : not the same
1 : Decode of RW subcode 0 : not the same
1 : Doesn't confirm Mode 2 subheader 0 : the same
1 : Retry Form 2 read 0 : not the same
1 : CD-ROM data read standard speed 0 : 2X standard speed
1 : No change 0 : Change
(a) Interrupt factor register ESEL flag becomes 1 when reset of software ends.
(b) Recognition of the Mode 2 subheader is used only in the correcting process
during CD-ROM decode. The selector always recognizes the subheader.
(decides conditions of the filter, selector length, etc.)
(c) Data is output even if there is an error when Form 2 read is not retried.
(d) CD-ROM data read speed switches when changing to the <PAUSE> status.
When the CD-DA area is played, it automatically plays at standard speed.
The prior speed returns if the CD-ROM area is entered.
2) Standby Time
Designates the transition time from <PAUSE> to <STANDBY>.
Changes to <STANDBY> when the standby time of <PAUSE> expires.
78
Title Function Function Name [SR] No.
Function Initialize CD block (2/2) CDC_CdInit 1.7
Specifications
3) ECC Frequency
Designates the number of repetitions of the ECC process (PQ once each) during
CD-ROM decode.
Set Value Description
00H ECC is processed a maximum of only 1 time in real time .....
initial value.
01H ~ 05H When an error exists after the ECC process, maximum number
of repetitions (total of 2 to 6 times).
80H No ECC process
FFH No change in settings
4) Retry Frequency
Designates the number of retries of the same sector if an error occurs during
CD-ROM decode.
Set Value Description
00H Without retrying, stops data output (becomes <ERROR>) .....
initial value.
01H ~ 0FH ( ) Retries designated number of times, data output stops if there
is an error (becomes <ERROR>).
40H Data is output without retrying
41H ~ 4FH ( ) Retries designated number of times, data is output even if
there is an error.
80H Infinite number of retries
FFH No change in settings
bit 7 6 5 4 3 2 1 0
Frequency indicated by insignificant 4 bits.
Frequency (0 ~ 15 times)
1 : Data output even if error occurs 0 : Stops output
1 : Infinite number of retrys 0 : Definte number
5) Tray Open/Close
Closes the Tray when in the <OPEN> status.
• When automatic format (front loading) : CD block automatically closes tray.
• When manual format (top loading) : <BUSY> status until closed by manual.
Tray open when in the <NODISC> status. (See Tray Open)
Tray open and close operates the same for CD play, seek play position, and scan.
Remarks: All command issues are prohibited while the software is being reset.
80
Title Function Function Name [S-] No.
Function Data transfer end CDC_DataEnd 1.10
Specifications
Transfer Conditions Host Transfer Word Number CD Block Transfer Word Number (cdwnum)
(Host Word Number) When gettng (CD → host) When writing (host → CD)
Transfer interrupt host word no. < normal word no. cdwnum > host word number cdwnum = host word number
Transfer all host word no. = normal word no. cdwnum = normal word number = host word number
Excess transfer host word no. > normal word no. cdwnum = normal word number < host word number
Example:
82
Title Function Function Name [SR] No.
Function Seek play position CDC_CdSeek 2.2
Specifications
2. Track/Index Designation
CDC_POS_PTYPE (&pos) = CDC_PTYPE_TNO;
CDC_POS_TNO (&pos) = tno; /* track number */
CDC_POS_IDX (&pos); = x; /* index number */
1) Scan Direction
Constant Name Description
CDC_SCAN_FWD Fast forward scan (forward direction)
CDC_SCAN_RVS Fast reverse scan (reverse direction)
2) Sound Output
If scanning from the <PLAY> status, -12 dB sounds are output in the CD-
DA region. Sound is muted if scanning in the CD-ROM area or in the <PAUSE>
status. If the scan direction in near the play range boundary is reversed, the
sound may not be output.
Remarks: When the CD-ROM area is scanned, sector data will not be read.
84
8.2.3 Subcode
Title Function Function Name [S-] No.
Function Get subcode Q CDC_TgetScdQch 3.1
Specifications
bit 7 6 5 4 3 2 1 0
Remarks: Pack data can not exceed retrieval of 16 packs in one time frame
(13.3 ms). Returns to WAIT if the pack buffer is empty and there is
no pack data.
86
8.2.5 Selector
See selector reset for the initial value of the selector set parameters.
1) Filter mode
bit 7 6 5 4 3 2 1 0
88
Title Function Function Name [S-] No.
Function Get filter mode CDC_GetFiltMode 5.6
Specifications
Filter mode
bit 7 6 5 4 3 2 1 0
Format: CdcRet CDC_SetFiltCon (Sint32 filtno, Sint32 cflag, Sint32 bufno, Sint32 flnout)
Input: filtno : filter number
cflag : filter connection flag (insignificant 8 bits are effective)
bufno : buffer partition no.of true output connector connection
destination (CDC_NUL_SEL : disconnected)
flnout : filter number of false output connector connection
destination (CDC_NUL_SEL : disconnected)
Output: none
Function value: Returns the return code.
Function: Sets the connection destination below for the filter. Connections are
disconnected if CDC_NUL_SEL is specified.
• true output connector and buffer partition input connector
• false output connector and other filter input connectors
bit 7 6 5 4 3 2 1 0
90
Title Function Function Name [SR] No.
Function Specs Resert selector (filter, partition) CDC_ResetSelector 5.9
1) Reset Flag
bit 7 6 5 4 3 2 1 0
2) Initial Values
The following initial values are set for all selectors by initialization.
• Buffer partition data : All cleared (all data within the CD buffer is
cleared)
• Partition output connector : Status: All unconnected
• Filter conditions : Similar to initialization by “set filter mode”
• Filter input connector : Status: All unconnected
• True output connector : buffer partition and same number companion
filters are connected
• False output connector : Status: All unconnected
92
Title Function Function Name [SR] No.
Function Calculation of actual data size CDC_CalActSiz 6.3
Specifications
1) Direction of retrieval
Retrieves in the direction of the buffer partition (from the
smaller to larger sector position.)
2) Retrieval result
Contents to be held as retrieval results include the buffer
partition number, retrieved sector position, and the frame
address of that sector.
3) Retrieval conditions
When a FAD that coincides does not exist, the nearest
sector not exceeding the designated FAD is used. Therefore,
retrieval resultant FAD is the greatest FAD that satisfies FAD≤
designated FAD. When there is no sector that satisfies this condi-
tion or when retrieval can not be done because of an error, the
sector position of the retrieval results is CDC_SOPS_END.
94
8.2.7 Buffer Input/Output
Each buffer input/output function (get sector data, delete, write, copy, move) in-
cludes the connector connection process. In other words, by issuing 1 command, the
device and selector connections and flow in and out complex processes are done.
Connectors connected to the partition output connector are disconnected.
Sector Length
Constant Name Description
CDC_SLEN_2048 2048 bytes (user data) ....... initial value
when fetched, 2324 bytes if mode 2 form 2
CDC_SLEN_2336 2336 bytes (up to subheader)
CDC_SLEN_2340 2340 bytes (up to header)
CDC_SLEN_2352 2352 bytes (entire sector)
CDC_SLEN_NOCHG No change
Remarks: The set “sector length when fetching” is also reflected in “Calculation
of actual data size.”
96
Title Function Function Name [S- ] No.
Function Specs Write sector data CDC_PutSctData 7.5
Format: CdcRet CDC_CopySctData (Sint32 srcbn, Sint32 spos, Sint32 snum, Sint32 dstfln)
Input: srcbn : copy source buffer partition number
spos : sector postion (CDC_SPOS_END : shows the
partition’s last sector)
snum : sector number (CDC_SNUM_END : shows the
sector number from spos to the last partition)
dstfln : copy destination filter number
Output: none
Function value: Returns the return code.
Function: Copies sector data from designated sector range of the buffer
partition. (Copies in between selectors.)
Format: CdcRet CDC_MoveSctData (Sint32 srcbn, Sint32 spos, Sint32 snum, Sint32 dstfln)
Input: srcbn : move source buffer partition number
spos : sector postion (CDC_SPOS_END : shows the
partition’s last sector)
snum : sector number (CDC_SNUM_END : shows the
sector number from spos to the last partition)
dstfln : copy destination filter number
Output: none
Function value: Returns the return code.
Function: Moves sector data from designated sector range of the buffer
partition. (Moves in between selectors.)
98
8.2.8 CD Block File System
Title Function Function Name [SR] No.
Function Change directory CDC_ChgDir 8.1
Specifications
SATURN
System Library
User's Guide
ver. 1.0
Doc. # ST-162-R1-092994
In translating/creating this document, certain technical words and/or phrases were interpreted
with the assistance of the technical literature listed below.
2.0 Reference........................................................................................ 41
2.1 Data List ................................................................................ 41
2.2 Function List .......................................................................... 42
2.3 Data Flow .............................................................................. 43
2.4 Function Specification ........................................................... 43
System Program User’s Manual
1.0 Guide
1.1 Explanation
Interrupt Process Routine Registration and Reference Operations
After booting up from the boot ROM, the master SH2 interrupt vector table is at the
beginning of the work RAM, and the VBR (vector base register) indicates this ad-
dress.
The slave SH2 interrupt vector table is the work RAM lead + 400H, and the slave
SH2 VBR indicates that address. The interrupt vector (programmable) of every
built-in SH2 module is assigned by the initial settings in the table below. Dummy
routines that do nothing are set in the vector table. (With the exception of invalid
commands and address errors, these are infinite loops.)
The FRT input capture interrupt is assigned for use in master and slave communica-
tions, and its initial priority is 15 (highest priority). In the table below, the priority of
all interrupts, except for the FRT input capture interrupt, is set at 0 and interrupt is
unauthorized.
In changing the priority of the built-in module interrupts, the content of the inter-
rupt control register must change in response to the needs of the application.
Master SH2 Vector Initial Settings Slave SH2 Vector Initial Settings
40H ~ SCU interrupt vector 41H H-Blank In * *
5FH (set by hardware) 43H V-Blank In
60H SCI receive error 60H SCI receive error
61H SCI receive buffer full 61H SCI receive buffer full
62H SCI send buffer empty 62H SCI send buffer empty
63H SCI send quit 63H SCI send quit
* 64H FRT input capture * 64H FRT input capture
65H FRT compare match 65H FRT compare match
66H FRT overflow 66H FRT overflow
67H Free 67H free
68H WDT interval 68H WDT interval
69H BSC compare match 69H BSC compare match
6AH Free 6AH Free
6BH Free 6BH Free
6CH DMACH1 (SH2 built-in) 6CH DMACH1 (SH2 built-in)
6DH DMACH0 (SH2 built-in) 6DH DMA CH0 (SH2 built-in)
6EH DIVU (division) 6EH DIVU (division)
6FH Free 6FH Free
* for slave > master passing * for master > slave passing
* * IRL2, IRL6 level interrupts
2
System Clock Switching
System clock switching cannot be performed by issuing independent commands to
the SMPC. Use of this system program is required. System clock switching entails a
partial hardware reset.
* Note Because master SH is in the standby mode during clock switching, of the built-in SH modules,
the FRT and the SCI within the SH must be reset. WDT is used during this process.
NMI goes to its existed status after the process; for example, the DMAC control goes to inter-
rupt status by NMI. See the SH manual. If necessary, perform the reopen process.
The clock change process time is about 110 ms, which includes the reset time of the
device.
Note: This is a risky service. The system may hang up if priority relationship inconsistencies
exist in the table contents.
With this, the interrupt process (items using SYS_SETUINT) can be optimized in the
application.
To use this, prepare the same structural data for the application as the table, and call
SYS_CHGUIPR.
Tables are of 32 long words. 1 long word has the following contents.
SH2 SR insignificant word value SCU interrupt mask insignificant word value
The value set to SR at the beginning ORed with the current mask set value
of the interrupt process and written to the SCU interrupt mask
register at the beginning of the interrupt
process.
This long word position inside the table corresponds to the SCU 30 interrupt factor.
(V-Blank In is the start and V-Blank Out is the 2nd,…but 2 long word spaces that
correspond to vectors 4EH and 4FH are included.)
Tables must be created very carefully so that there is no inconsistency between the
SR, SCU interrupt mask, and interrupt factor.
For example, the Boot ROM uses the following table for its initial set values:
Uint32 PRITab[32] = {
0x00F0FFFF, /* VBI SR=15 All prohibited (highest priority) */
0x00E0FFFE, /* VBO SR=14 Only VBI is allowed */
0x00D0FFFF, /* HBI SR=13 VBI and VBO are allowed */
.
.
0x0070FE00, /* External 15
all masked when 7 or less. */
/* A bus interrupt unique priority that assumes 7, 4,and
1 by cause factor, but because
of the common use and 1 bit
mask, it is set to 7.
} ;
4
The creation example shown is one in which the SR value is always set to 0, and
priorities are described only using SCU mask values (priority relationship). Here,
SH always receives an interrupt and only the SCU mask controls authorization and
prohibition.
Uint32 PRITab[32] = {
0x0000FFF9, /* during VBI process HBI and VBO authorization */
0x0000FFFB, /* during VBO process only HBI authorization */
0x00D0FFFC, /* during HBI process all prohibited (highest priority) */
.
.
0x00000000,
} ;
The inverse of the example above is prohibiting mask interrupt at SR value levels without
changing the SCU mask value. (0 or 15 only are possible.)
In the example above, the interrupt authorize and prohibit register of each built-in
module must also be operated for SH internal module interrupt authorization and
prohibition.
Note: When the SCU factor interrupt is allowed and interrupt occurs, it is okay if the SH SR mask is
higher than the interrupt unique level (value decided by SCU hardware) and if interrupt can
never be refused by SH. (However, one exception is that all of SR mask 15 can be prohibited.)
6
2.0 Reference
8
Title Function Function Name No.
Function Gets registration contents of interrupt vector SYS_GETSINT 1.3
Specifications
10
Title Function Function Name No.
Function Gets semaphore SYS_TASSEM 3.1
Specifications
Note: The table contents are not checked. If inconsistencies relating to priority exist in the table, the
system may hang up.
Remarks: Table settings are valid until the next rewrite. During this interval,
there is no need for the application to save the table specified in the
parameters. Further, reset returns to the initial set value of the Boot
ROM. The results cannot be guaranteed when this routine is called
via slave SH2.
12
Title Function Function Name No.
Function Operates Power On Clear Memory SYS_PCLRMEM 7.1
Specifications
14
SMPC I/F User’s Manual
1.0 Guide
This library uses functions of the SMPC (System Management and Peripheral Con-
trol).
2.0 Features
• IntBack
Intback is the process of returning results through interrupts (SMPC interrupts)
after commands are passed to the SMPC. SMPC interrupt processing and regis-
tration are performed in the library. Also, other interrupt processes are prohib-
ited during the SMPC interrupt process. Timing of issuing command issuance
differs according to the function.
• Non-IntBack
Non-IntBack is a process that only passes commands to the SMPC. The library
function waits for the SMPC process to end. (See the SMPC User’s Manual for
details of each SMPC process time.) The functions (reset, etc.) that can be used
by this process are functions which do not have to receive results after a com-
mand has been passed.
Shown below are the processing systems that can be used by each function.
16
4.0 Details
4.1 Functions
18
• Chart Descriptions
Main Process
IntBack initialization (1) : Specifies system data acquisition
IntBack initialization (2) : Specifies peripheral data acquisition
IntBack initialization (3) : Specifies peripheral data acquisition and time data
acquisition
SMPC Process
(1) : System data collection process
(2) : Peripheral data collection process
(3) : Time data collection process
(1) Pattern 1
* *
20
• IntBack Command Issue Function
4.3.1 Policy
The peripheral acquisition process is created according to the following policies for
flexible response to the user.
• Able to accommodate peripherals to be sold in the future.
• Methods that do not provide multitap awareness.
• Perform corrective measures against problems.
4.3.2 Method
(1) Overview
• Each peripheral IDs and peripheral data is obtained by specifying as inputs the
required number of peripherals, peripheral IDs and preferred size.
• Even when the peripheral acquisition ID and connected peripheral ID are different,
data is obtained if peripherals are connected. For example, analog device data is
obtained as mouse data.
(Example)
Input
Required number of peripherals = 3
Peripheral ID = digital device
Peripheral size = digital device size
Connection Status
Main connector 1 = multi-tap 6P
Multi-tap connector 1 = digital device
Multi-tap connector 3 = analog device
Main connector 2 = keyboard device
(Other devices are not connected to peripherals)
Output
Peripheral ID Peripheral Data
No. 1 Digital Digital Format
No. 2 Unconnected Invalid
No. 3 Analog Digital Format
22
5.0 Calling Sequence
24
6.2 Data Specifications
26
Shown below are the constants and values that can be used by each access macro.
PER_GS_CC (data)
bit 7 bit 0
0 0 0 0 0 0 CTR1 CTR0
PER_GS_AC (data)
bit 7 bit 0
ACODE ACODE ACODE ACODE
0 0 0 0
3 2 1 0
PER_GS_SS (data)
Bit Position Constant Acquisition Value
PER_SS_DOTSEL DOTSEL signal status
PER_SS_SYSRES SYSRES signal status
PER_SS_MSHNMI MSHNMI signal status
PER_SS_SNDRES SNDRES signal status
PER_SS_CDRES CDRES signal status
PER_GS_SM (data)
Areas which are used in common by applications and Boot ROM.
Bit Position Constant Acquisition Value
PER_MSK_LANGU Language (see below)
PER_MSK_SE SE (0: ON, 1: OFF)
PER_MSK_STEREO STEREO or MONO (0: STEREO, 1: MONO)
PER_MSK_HELP HELP (0: ON, 1: OFF)
Language Constant
Constant Description
PER_JAPAN Japanese
PER_ENGLISH English
PER_FRANCAIS French
PER_DEUTSCH German
PER_ITALIANO Italian
PER_ESPNOL Spanish
28
Title Data Data Name No.
Data Pointing device information data type PerPntInfo 9
Specifications
This data type shows pointing device information.
30
Title Data Data Name No.
Data Pointing device data type PerPntData 15
Specifications
Shown below are constants and values that can be used by each member.
Data
Bit Position Constant Acquired value
PER_PNT_R RIGHT
PER_PNT_L LEFT
PER_PNT_MID MIDDLE
PER_PNT_CNT CENTER
PER_PNT_X0 X axis overflow (0: overflows, 1: does not overflow)
PER_PNT_Y0 Y axis overflow (0: overflows, 1: does not overflow)
Shown below are constants and values that can be used by each member.
skey
Bit Position Constant Acquired value
PER_KBD_CL Caps Lock
PER_KBD_NL Num Lock
PER_KBD_SL Scroll Lock
PER_KBD_MK Make (0: key pressed, 1: key not pressed)
PER_KBD_BR Break (0: key released, 1: key not released)
32
7.0 Function Specifications
7.1 List of Functions
Function Function Name No.
Non-IntBack Command Issue Master SH2 ON PER_SMPC_MSH_ON 1
Slave SH2 ON PER_SMPC_SSH_ON 2
Slave SH2 OFF PER_SMPC_SSH_OFF 3
Sound ON PER_SMPC_SND_ON 4
Sound OFF PER_SMPC_SND_OFF 5
CD ON PER_SMPC_CD_ON 6
CD OFF PER_SMPC_CD_OFF 7
Reset entire system PER_SMPC_SYS_RES 8
NMI request PER_SMPC_NMI_REQ 9
Hot reset enable PER_SMPC_RES_ENA 10
Hot reset disable PER_SMPC_RES_DIS 11
SMPC memory set PER_SMPC_SET_SM 12
Time set PER_SMPC_SET_TIM 13
IntBack Command Issue IntBack Initialization PER_Init 14
Peripheral data acquisition PER_GetPer 15
Other Time acquisition PER_GET_TIM 16
System data acquisition PER_GET_SYS 17
Other Hot reset acquisition PER_GET_HOT_RES 18
Input Format
Output: None
Function Value: None
Function: Sets the time.
34
IntBack
Title Function Function Name No.
Function Initializes IntBack PER_Init 14
Specifications
Output: none
Function Value: execution condition
Constant Description
PER_INT_ERR Could not issue the IntBack command
PER_INT_OK Could issue the IntBack command
Function: Initializes IntBack and issues the IntBack command. Execution rules
must be obvserved. Set Null or 0 to unneeded parameters. Execute at
least 1 time before executing PER_GetPer (), PER_GetTim(),
PER_GetSys().
Remarks: Generally, this should be executed immediately after the V-Blank
process. Other interrupts are prohibited during SMPC interrupts.
Note: DO NOT perform this function within the interrupt process. Be sure
to perform via the main process.
Constant Description
PER_INT_ERR Could not issue the IntBack command.
PER_INT_OK Could not issue the IntBack command.
Function Value: Issues the IntBack command and gets peripheral data. Execution
rules must be observed. Before this function is executed, specify “pe-
ripheral data get” to PER_Init() and execute at least once. Null is
output to the peripheral data address when peripheral data get is not
specified.
Remarks: Generally, this should be executed immediately after the V-Blank
process. Other interrupts are prohibited during SMPC interrupt.
36
Other
Title Function Function Name No.
Function Gets hot reset PER_GET_HOT_RES 18
Specifications
Function: Gets the hot reset condition. This function can be executed at any
time. Update is performed by PER_GetPer().
38
Backup Library User’s Manual
1.0 Guide
1.1 Purpose
In addition to the builit-in memory in this game machine, several types of storage
devices are being planned for storing information during a game.
This library provides functions for reading, writing and searching these backup
storage devices.
1.2 Explanation
1.2.1 Introduction
Always use this library when accessing storage devices for backup.
1.2.5 Precautions
This library will destroy data if writing is interrupted. Before executing BUP_Init(),
BUP_Format(), BUP_Write() and BUP_Delete, disable the reset button by using
PER_SMPC_RES_DIS() in the system library.
#include “sega_per.h”
#define BUP_START_ADDR 0x60????0 */
#include “sega_bup.h”
Unit32 BackUpRamWork[2048];
main()
[
BupConfig conf[3]
BupStat sttb;
BupDir writetb;
BupDate datatb;
Unit8 *time;
PER_SMPC_RES_DIS(); */
BUP_Init(BUP_START_ADDR, BackUpRamWork, conf);
if(BUP_Stat(0, &sttb)==BUP_UNFORMAT) {
BUP_Format(0);
}
PER_SMPC_RES_ENA(); */
BUP_Stat(0, &sttb);
if(sttb.freeblock > 0) {
strcpy((char *)writetb.filename, “FILE_NAME01”);
STRCPY((char *)writetb.comment, “test”);
writetb.language = BUP_JAPANESE;
time = PER_GET_TIM(); */
datetb.year = (Uint8 )( (Uint16 )(time[6]>>4) * 1000
+ (Uint16 )(time[6] & 0x0F) * 100
+ (Uint16 )(time[5]>>4) * 10
+ (Uint16 )(time[5] & 0x0F) - 1980);
datetb.month = time[4] & 0x0F;
datetb.day
datetb.time = (time[2]>>4)*10 + (time[2] & 0x0F);
datetb.min = (time[1]>>4)*10 + (time[1] & 0x0F);
writetb.date
writetb.datasize = 10;
PER_SMPC_RES_DIS(); */
BUP_Write(0, &writetb, “Dummy Data”);
PER_SMPC_RES_ENA(); */
40
2.0 Reference
The value for the size specified by BUP_Stat() for datasize is stored in datanum.
42
2.3 Data Flow
Write
Storage device
HOST
for backup
Read
voidsample()
{
BupConfig conf[3]
44
Title Function Function Name No.
Function specification Gets status BUP_Stat 4
46
Title Function Function Name No.
Function specification Gets directory information BUP_Dir 8
48
TM
Backup System
Production Standard
Doc. # ST-203-100494
The notations that appear in game screens and instruction manuals are standardized
to the standard terms listed below. Prohibited terms must not be used because they
tend to confuse the user.
Hardware Names
1) Backup RAM
Previously) Backup/RAM/RAM cartridge
(General name referring to both base RAM and cartridge RAM)
2) Base RAM
Previously) Internal backup RAM/internal RAM
3) Cartridge RAM
Previously) Cartridge/backup RAM cartridge/RAM cartridge
2) Load/read
Previously) Load/read
3) Save
Previously) Save/write/new write
4) Copy
Previously) Copy
5) Erase
Previously) Erase/delete
7) Erase the record and copy/update the record
Previously) Overwrite
8) Update record name
Previously) Rename
9) Backup switching
Previously) Switching/RAM switching/RAM change
Warning Messages
1) was ... correctly
Previously) was ... correctly/was ... normally
2) could not be ... (correctly)
Previously) could not be ... (correctly)/failed/...error
3) cannot be used
Previously) cannot be used/is abnormal/is destroyed/was destroyed
New Terms
1) Comment
Detailed information (represented with up to 10 half-size alphanumeric and/
or kana characters) that adds record content information to the record name.
2) Time information
Record time information indicated by a time stamp.
2
2.0 System Specifications
Figure 2-1 shows the flow of the basic backup system. The processes, functions, and
messages shown in the flow must be incorporated into the backup system.
Initialization
processing
1) Initialization check NG
OK
2) Existing NG
data check
OK
2) Capacity NG
2) Capacity NG check
check
OK
Save disabled
3) Load processing
Start game
During game
4) Save
5) Comment support
6) Time stamp support
7) Base RAM/cartridge
RAM selection
The application must always check initialization of the base RAM and the car-
tridge RAM before starting the main game. If either RAM is not initialized, the
application reports the condition to the user and either initializes the RAM di-
rectly or instructs the user to initialize the RAM from the Save Data Control
screen in the Saturn unit boot ROM. The application must not start the game if
either RAM is not initialized. When accessing the backup RAM, always use the
BACKUPRAM BIOS. When formatting the base RAM, cartridge RAM, or ex-
tended memory, always use the SEGASATURN_BACKUP_FORMAT method.
Before starting the main game, the application checks for data that it can use and
checks the available space for each backup. If the check indicates no data for the
application or insufficient space available, the application displays a warning
message according to the status (see item 8) Warning message.
3) Load
• Check for data corruption/load errors.
When loading data, the application must always check for data corruption. If the
data cannot be used, the application must report the condition to the user and
somehow differentiate the data to show that it cannot be used.
4) Save
• Check for save errors.
• Check available space
• Define record name.
• Define record size.
When saving data, the application checks the available space. If the capacity is
insufficient, the application reports the condition to the player. The application
checks whether the data was written normally. The record names used in save
processing are controlled by Sega. (This is to avoid using the same record names
in a different game.)
Location 1: PS_SCENE_00
Location 2: PS_SCENE_01
Location 3: PS_SCENE_02
Only last 3 characters are variable.
First 8 characters are common.
4
Do not use a general name like GM_DATA_000. The characters that can be used
in record names are limited to numbers, uppercase alphabetic letters, and under-
score. The first character must not be a number. File names must be 11 charac-
ters in length. If a file name is less than 11 characters, pad the name with under-
score (_) characters. Do not use spaces. When executing several saves in a game,
fix the first 8 characters of the filename, and use underscore and numbers in the
last three variable characters.
The size of one record must not exceed 256 kilobytes. Records over 256 kilobytes
cannot be copied because the copy function of the Save Data Control screen in
the boot ROM does not support sizes over 256 kilobytes. If the record size ex-
ceeds 256 kilobytes, the application itself must be able to copy the records.
The time stamp cannot be deleted or changed by the user. The files are displayed
in reverse chronological order based on the time stamp (file with the latest save
date is displayed first).
Note: The position of the selection within the processing sequence is not defined.
The application must be able to read backup data directly for both the base RAM
and the cartridge RAM. The creation standard does not specify where this pro-
cess should take place in the processing sequence.
8) Warning messages
The following warnings must be incorporated into the application to support the
specifications described in items 1) to 5).
• Initialization check warning (during startup).
• New save disabled warning after game is started (during startup).
• Save disabled warning (during startup).
• New save disabled warning during game (during save/copy execution).
• Load/save/copy/erase/initialization failure warnings (after execution of each process).
• File corruption warning (during load execution).
• Display of backup space used by application (When new save is disabled after a game is
started or during a game).
• Warning instructing the user not to turn off the power during save execution.
6
3.0 Sequence and Warning Message Examples
This section gives sequence and warning message examples for each process. Refer
to these examples and, if possible, implement them to create a user-friendly system.
1) Initialization check and existing data/capacity check
Initialization check
Initialization
processing
Is backup Display warning Initialization
initialized? No processing? Yes
message (1)
Yes No
Go to Save Data
Was game backup Control screen
No
data already saved?
Yes
Yes
Go to Save Data
Save disabled Control screen
processing
Start
game
*1 Always place the word “initialize” in parentheses. Using the word by itself is prohibited.
“Not enough free space to store new record. If game is started, new record cannot
be saved unless previous record is erased.”
“*** of empty space required to save new record.”
“From Sega Saturn’s Save Data Control screen, erase other game records or copy
other records to cartridge RAM, then restart the game. To display Sega Saturn’s
Save Data Control screen, hold down the L or R button and press Power or Reset.”
“If the game is started in this condition, the record cannot be saved. Start the game?
Yes No”
“*** of empty space required to save a game record.”
“From Sega Saturn’s Save Data Control screen, erase other game records or copy
other records to cartridge RAM, then restart the game.”
“To switch to Sega Saturn’s Save Data Control screen, hold down the L or R button
and press Power or Reset.”
8
2) Load, save
Data load
Backup selection
by user
Data selection
by user Display warning
message (4)
Data load
Normal
Start game
Backup selection
by user
Save location
selection by user Display warning
message (5)
Available
space check NG
OK
Display warning
message (6)
Data save
Was data
written normally? No
Yes
Continue or
end game
10
<Warning message (5)>
An error has occurred during save processing. This type of warning message is
issued if the capacity is full and data cannot be saved or if write fails (probability is
small). If the capacity is full, the warning message must display information on the
capacity used by the game.
Translator’s Notes
1. For some of the terms listed on page 2, two Japanese terms have
the same English translation. In such cases the English word was
listed only once.
Example
(Japanese)
3) Save/save
Previously) Save/save/write/new write
(Translation)
3) Save
Previously) Save/write/new write
SATURN
Software Library
Release 3.01
Supplemental Disk
Doc. # ST-208-110194
1. Supplemental Explanation
This disk (Rel. 3.1) contains libraries and tools which have been upgraded from Software
Library Rel. 3 and debugged. Since this disk is configured the same as the Rel. 3 directory
structure, it updates and adds libraries and tools when it is installed after Rel. 3 has been
installed (unwound).
Note: In this instance the sound driver has been placed in the SATURN\SEGADRV directory.
Changes from V
er 1.02 to Ver 1.03
· DMA parameter mask item contents described in the manual were wrong.
· Correction of DMA_ScuResult function defect.
· Re-registration of vectors saved during DMA end interrupt processing for each channel
has been added.
· Correction of DMA parameter mask constant value defect
(Low level SCU DMA functions and low level CPU DMA functions).
· Deletion of DMA_ScuAIIStop function.
· Deletion of DMA_ScuStop function.
· Change in specifications allowing DMA end interrupt mask registers which correspond
to the channels used when low level SCU DMA is used.
2
2.7 Peripheral Libraries (SEGA_PER.LIB) Ver 1.02
Changes from V
er 1.01 to Ver 1.02
· Correction of defect in X and Y mouse movement amount data obtained.
· Correction of mouse digital device information defect.
[Addendum]
Please be sure to refer to all documentation in <SATURN\SEGALIB\MAN> for details
about version upgrades.
Changes from V
er 1.12 to Ver 1.13
· Irregularities in PCM Play Address upgrading during PCM stream play have been
corrected.
· Correction of defect whereby operation continues even though there are no bank
changes in sequence data. (In this and subsequent versions, no sound is generated if
bank changes are not correctly included in sequence data.)
Changes from V
er 1.13 to Ver 1.14
· The fault whereby the PCM Play Address was not properly upgraded during multiple
channel simultaneous play has been improved.
4. CD Tool Upgrade
4.1 CD Development T
ools
Be sure to use the CD tools provided in this and later versions. For details about these, refer
to the Virtual CD System User’s Manual Ver1.00. (Release 3.)
4
Corrections from er
V 3.02 to Ver 3.03
· A defect in the directory path table was improved.
Corrections from er
V 3.03 to Ver 3.04
· A fault whereby file positions became incorrect when directories were defined after track
designation was handled.
[Cautionary Item]
In Ver 1.xx and Ver 3.xx (including Ver 2.XX) script file entry methods were changed. Persons who
have been using Ver 1.xx up to now should change their script files. Please see the examples of script
entry in 4 - 8.
6
The following shows an example of this:
#define RD_UNIT 10
GfsHn gfs;
Sint32 fid, stat, nbyte;
Uint32 buf[RD_UNIT*2048/4];
gfs = GFS_Open(fid);
GFS_NwCdRead (gfs, 100);
for (I = 0; I < 100/RD_UNIT; ++I) {
GFS_NwFread (gfs, RD_UNIT, buf, RD_UNIT*2048);
while (GFS_NwExecOne (gfs) != GFS_SVR_COMPLETED {
GFS_NwGetStat (gfs, &stat, &nbyte);
/* Check whether the number of bytes designated by GFS_NwFread
has been read */
if (nbyte >= RD_UNIT*2048) {
break;
}
user ();
}
}
File Control
The only control which the file system exercises over the CD-DA files is that of play and
play range. The play mode is a default value (no repeat, move pickup).
How to Play
The following are methods of playing CD-DA files:
(1) GFS_Load
(2) GFS_Fread
(3) GFS_NwFread
(4) GFS_NwCdRead
In Methods (1) and (2) there is no return until play is ended. In methods (3) and (4) a server
function must be called. When CD-DA play ends, the server function returns
GFS_SVR_COMPLETED.
GFS_Seek is used to play from mid-disk. CD-DA files and CD ROM files cannot be simulta-
neously accessed.
GFS_ATR_CDDA was added to provide an additional CD-DA file processing function. Its
bit when it is a CD-DA file is 1. The names and meanings of other constants remain un-
changed.
GFS_ERR_BFUL
This error code occurs when the CD buffer becomes full during resident mode
(GFS_GMODE_RESIDENT) file reads. Access order and the like should be adjusted so that
a buffer full condition does not occur during resident mode file access.
GFS_ERR_FATAL
This error code is a notification that the CD drive is in a FATAL condition. If the file system
detects this condition, it stops CD play (seeks home position) and tries to effect recovery
from the error condition. If this error code is detected, retry processing.
3.6 Recognition of T
ray Open Condition
When the CD block interrupt factor register (HIRQREQ) DCHG bit (bit 5) is 1, this is also
handled as an open tray condition. During development, confirm that the CD status is not
open and perform processing to clear the DCHG bit. Since in the BOOT ROM clears the
DCHG flag in the product version, the application must not clear it.
8
3.8 Debug File Related
GFMC_base
The variable GFMC_base, which sets the top address of SIMM files, is defined in both
sega_gfs.lib and segadgfs.lib. The GFMC_base in sega_gfs.lib exists solely for the sake of
compatibility with segadgfs.lib. It has no effect on file system operation.
File Identifiers
The function which automatically added “.” and “..” (current directory and parent directory)
when CD files were not being used has been deleted. Accordingly, file identifiers are the
same as when booted.
////////////////////////////////////////////////////////////
Cautionary Items when moving to a changed version
////////////////////////////////////////////////////////////
! ! IMPORTANT ! !
Be sure to recompile user programs which include header files, as the
header files will have changed.
////////////////////////////////////////////////////////////
History of Changes
////////////////////////////////////////////////////////////
• 09-23-1994 Ver 1.02
• 10-12-1994 Ver 1.03
////////////////////////////////////////////////////////////
Details of Changes
////////////////////////////////////////////////////////////
Corrective Action
Corrective action for defects in 3rdSTEP has been taken as follows. The following defects
were all “SCU” DMA.
1. Correction of defect whereby debug programs were mixed in and debug information
was added to the sega_dma.lib.
<Nature of Defect>
A debug program was mistakenly mixed into the sega_dma.lib. This debug program was
writing in the neighborhood of address 6060000. Additionally, since /deb was designated
to compile options, debug information was added, and the sega_dma.lib became larger
than necessary.
<Corrective Action>
(1) Compiling was redone
(2) dma.bat dma.mk was properly corrected
2. Correction of defect whereby an interrupt status register which cannot be used by the
hardware is used.
10
<Nature of Defect>
An interrupt status register which could not be used by the hardware was being used inside
the library. (Because of the timing of the writes to the interrupt status register, there were times
when interrupt signals could not be received. This is forbidden from a hardware standpoint.)
<Corrective Action>
Measures were taken so that the interrupt status register would not be used in the library, and
the use of interrupt processing was substituted in its place. Because of this, the following
specification changes have taken place in the DMA library. Since DMA end interrupt process-
ing is used in the DMA SCU library, when DMA SCU is executed in V-BLANK IN interrupt
processing and the like and in interrupt processing with a higher order of priority than DMA,
it waits for the end of DMA until the end of interrupt processing with the high order of prior-
ity. The following are two ways of preventing this wait:
(1) Do SCU DMA in the main process
(2) Change the order of interrupt priority
The recommended method of interrupt priority order per (2) above is discussed separately.
<Specification Changes>
(1) SCU DMA high level
The following function specifications have been added:
+—————————————————————————————————+
| Function Specification | SCU DMA initialization | DMA_ScuInit |
+—————————————————————————————————+
Syntax void DMA_ScuInit(void)
Input none
Output none
Function value none
Action Initializes SCU DMA. Must be performed before execution of
DMA_ScuCopyMem () and DMA_ScuResult ()
!! Caution!!
DMA mode 0 transfer end interrupt processing is used by SCU DMA. Therefore, do
not change the interrupt mask register of the DMA mode 0 transfer end interrupt.
!! Caution!!
There was a similar function in 2ndSTEP. However, it differs with this version as shown on
the next page.
The constants which can be used by each of these members are shown below.
////////////////////////////////////////////////////////////
Corrective Action
Corrective measures have been taken for Ver 1.02 (09-30-1994) as shown below.
• Common
1. A DMA parameter mask item description in the manual was wrong.
<Defect>
The manual wrongly stated, “Bits which designate a DMA mask constant do not make
settings to registers.”
<Corrective Action>
The text should be corrected to read, “Bits which do not designate a DMA mask constant do
not make settings to registers.”
12
• Low Level SCU DMA
1. The DMA end interrupt vectors are not returned to the origin.
<Defect>
When DMA starts, DMA end interrupt vectors are saved. However, after DMA ends, the
saved vectors are not re-registered.
<Corrective Action>
Vectors saved during end interrupt processing for each channel are re-registered.
2. DMA Parameter Masks cannot be correctly designated.
<Defect>
Settings to DXR (read address register) were made unconditionally without relation to the
settings of DMA parameter mask constants.
<Corrective Action>
Mask constants have been properly changed.
3. DMA_ScuAIIStop existed in the library even though it could not be used by the hardware.
<Defect>
The DMA forced end register used by DMA_ScuAllStop existed in the library even though its
use is prohibited because of hardware limitations.
<Corrective Action>
This function was deleted.
4. DMA_ScuStop existed in the library even though it could not be used by the hardware.
<Defect>
DMA_ScuStop existed even though it had no hardware functions.
<Corrective Action>
This function was deleted.
<Corrective Action>
Mask constants were properly changed.
Additions to Manual
Low Level SCU DMA
DMA end interrupt mask registers which correspond to the channels in use when low level
SCU DMA is used must be permitted.
Corrective Action
The following measures were taken to correct defects in 3rdStep.
1. Corrective action for defect in SND_Init () memory zero clear part.
The part which was mistakenly using memcpy was changed to memset.
2. Corrective action for SND_SetCdDaLev () parameter processing defect.
There was a defect whereby in the manual parameter (0 - 7) settings CD-DA sound
was not output. This was corrected by designating manual parameters so that sound
can be output.
3. Corrective action for PCM PAN setting defect
There was a defect whereby the PAN setting in SND_StartPcm () could not swing to
the right. This is a sound driver defect. Sound driver Ver 1.12 should be used. (The
08-22-94 sound driver is Ver 1.11)
Specification Changes
The following specification changes have been made starting with 3rdSTEP.
1. Deletion of SND_StartPcm () PCM start offset setting.
The PCM start offset setting function has been deleted.
14
Other
A CD-DA and PCM stream simultaneous play sample program has been added. This is
SMPSND5. SMPSND4 has been restructured.
////////////////////////////////////////////////////////////
Details of Changes Ver 1.03
////////////////////////////////////////////////////////////
Specification Changes
(Ver 1.10 [08-22-1994 -> Ver1.02[09-30-1994]) The internal specifications of the sound l/F
library have been changed. The external specifications have also been partially changed.
Details of these changes are shown below.
In the above example, there is the possibility of a permanent loop. The reason for this is
that, because the host frequently accesses the status memory, the sound driver cannot write
a STOP sequence to the status memory even though the sequence has ended.
SMPSND4.C
Interrupt priority has been changed, and SND_MoveData () was changed so that it can be
used in sound request interrupt processing.
• Interrupt priority was changed, and SND_MoveData () was changed so that it can be
used in sound request interrupt processing.
16
*********************************************************************************************
• File symbol name : manstm.doc
• Relevant library symbol name : stm
• Relevant library name : Stream System Library
• Version : 1.13
• Creator : N. T.
• Creation date : 10-07-1994
• Other messages : none
*********************************************************************************************
Cautionary Items for Stream System Libraries Ver 1.10 and Later
1. Function Specification Changes
Functions in versions preceding Ver 1.01 should be replaced as follows:
(a) STM_Init ()
Uint8 work[STM_WORK_SIZE(12, 24);
·
·
stm_Init (12, 24, work);
3. Prior to Ver 1.01, when transfer area setting → transfer function registration → transfer
function cancellation was done, the next transfer destination was the initially registered
transfer area, but in Ver 1.10 transfer areas must be reset. Moreover, the maximum
number of transfer sectors and the transfer mode revert to the default status.
4. In order to use the stream system, the file system and CD communication interface must
be linked.
5. All files in CD-ROM, virtual CD, SIMM, SCSI can be handled by sega_stm.lib. However,
linked file system libraries must be properly used.
6. There is a change in sega_stm.h. Source files which include sega_stm.h should all be
recompiled.
7. Cautionary items
(a) If the stream is closed immediately after the close fetch function of the stream which
registers the fetch function has returned (-1), it is continuously called until the fetch
function returns a value of 0 or greater. When the fetch has ended, a value of 0 or
above should be returned.
8. Bug corrections in Ver 1.10 and later
The following corrections are being made in the file system and settings. File system
Version 1.11 should be used.
(Ver 1.11)
· Correction of the defect where fetch functions sometimes return (-1) or (0).
· Correction of the phenomenon whereby a back stream is opened immediately before the
end position of the play range, and drive play mode FAD no longer changes
(Ver 1.12)
· Correction of the phenomenon whereby if the buffer becomes full in mid-play range, the
system moves to a loop stream.
(Ver 1.13)
· Correction of the phenomenon whereby file access denial because of a runaway/infinite
loop/file system occurs if STM_SetExecGrp(NULL) is executed.
*********************************** end of file ******************************************
18
**********************************************************************************************
• File symbol name : MANSCL.DOC
• Relevant library symbol name : stl
• Relevant library name : VDP2 Library
• Version : 1.03
• Creator : K. M.
• Creation date : 10-25-1994
• Other messages : none
**********************************************************************************************
Differences from 2ndStep Libraries (Ver 0.90)
Basically, it is compatible at the source code level. By recompiling them, applications written
in 2ndStep can be operated as they are. However, caution is required in the following cases:
· Table initialization functions are not used.
[Corrective action] Initialize regarding the newly added table item.
· When memcopy() is used:
[Corrective action] Change the function name to SCL_Memcpyw (). If the register, color
RAM and the like are not in an area in which a transfer cannot be made, it can be replaced
with the C language function memcpy ().
• Five Newly Added Functions
· SCL_SetRotateCenterDis ()
Sets center point when making revolving scroll surfaces revolve on the screen.
· SCL_SetCoefficientData ()
Sets enlargement and reduction data to the revolve parameter coefficient table.
· SCL_DisableBlur ()
Disables shading operations.
· SCL_DisableLineCol ()
Disables line color screen.
· SCL_AboreAutoVe ()
Forces end of automatic VE.
• Revolving Screen ZAxis Direction Movement Specification Change
When the angle of revolution was 0, Z coefficient designation was effective.
(When values are changed at a zero angle of revolution, they do not differ from the
apparent enlargement and reduction.)
• Revolve Parameter Coefficient able
T Can Be Set to Color RAM
One item has been added to the VRAM configuration data structure. (Total of three items
added.)
• The Revolve Parameter Coefficientable
T Set Position Can Be Designated in 0x400 Units.
Two items have been added to the VRAM configuration data structure. (Total of three items
added.)
• Correction of Fault in One-W
ord Pattern Name Data Specifications in Scrolls
In the 2ndStep version, there was a fault whereby character pattern data in the last part of
VRAM could not be positioned. One item has been added to the scroll configuration data
structure.
• The Sin(90) and Cos(0) Trigonometric Functions which were used Internally have
been Corrected to 1.0.
Library Restructuring
In 3rdStep, the VDP2 library register buffer to facilitate customizing of library function
strength, speed and the like is described in the manual. A simple explanation of how to add
functions is given.
[Screen ON)
void disp_on ()
{
Scl_s_reg.tvmode |= 0x8000;
SclProcess = 1;
SCL_DisplayFrame () : /* when frame change is not auto */
}
[Screen OFF]
void disp_off ()
{
Scl_s_reg.tvmode &= 0x7fff;
SclProcess = 1;
SCL_DisplayFrame () : /* when frame change is not auto */
}
• When change of only the X coordinates of a normal scroll screen (0) without using other
functions is desired.
[can be used anywhere]
Scl_n_reg_.n ()_move_x = ???; (Scroll coordinate designation)
[In V-Blank In interrupt]
(*(Uint16 *) (0x25f80070)) = Scl_n_reg.n0_move_x;
20
***********************************************************************************************
• Document Classification : All Library Development Explanation Files
• File symbol name : manspr.doc
• Relevant library symbol name : spr
• Relevant library name : Sprite
• Version : 1.02
• Creator : H. E.
• Creation date : 10-4-1994
• Other messages : none
***********************************************************************************************
1. Additional Explanations
• Be sure to note that in 3rdSTEP the SPR_3SetView () parameters are being changed.
“pivotViewPoint” is gone and in its place ViewCoordPoint is being added. Changes should
be made as follows:
2nd) SPR_3SetView (0, &viewPoint, &viewPoint, &viewAngle, ROT_SEQ_ZYX);
3rd) SPR_3SetView (0, &viewPoint, &viewAngle, ROT_SEQ_ZYX, 0);
• Restrictions
DSP is not to be used, as writeback from DSP to work RAM does not operate normally.
Therefore, even if SPR_3USE_DOUBLE_BUF is designated by a 3D SPRITE work area
definition macro, execution speed does not increase. In order to use DSP, refer to
MANMTH.DOC and correct the MTH library.
None
********************************** end of file ********************************************
22
************************************************************************************************
• Document Classification : 3rdSTEP (08-22-94) -> 3rdSTEP (10-12-1994) Changes
• Relevant library symbol name : PER
• Relevant library name : System/Peripheral
• Version : 1.02
• Creator : N. T.
• Creation date : 09-30-1994
• Other messages : none
************************************************************************************************
/////////////////////////////////////////////////////////////
♦ History of Changes
/////////////////////////////////////////////////////////////
• 09-23-1994 Ver 1.02
/////////////////////////////////////////////////////////////
♦ Details of Changes Ver 1.02
/////////////////////////////////////////////////////////////
Corrective Action
Corrective action for defects in 3rdSTEP have been taken as follows.
1. Correction of defect whereby X and Y mouse movement amount data obtained was
wrong.
<Nature of Defect>
Mouse X and Y movement amount data minus values which had been obtained were
wrongly being converted to positive values.
<Corrective Action>
Matched to manual specifications. (Adjusted so that data from -128 to 127 can be obtained.)
<Corrective Action>
Same as (1.) above.
2.4 Restrictions
The current version does not support file interleave in direct DOS file access.
24
3.2 Changes from Ver 2.16 to Ver 3.02
· This is to become a DOS extender (DOS/4G), and operation has been confirmed up to a
limit of about 10,000 files. (in machines loaded with 8 MB of memory).
· An error in directory record position was corrected.
· A fault whereby the CDDA track audio data TOC position was slipping was handled.
[Supplementary]
SoundSimulator Ver 1.24 is SEGA-supplied sound tool version upgrade (Macintosh edition),
and the M6CNV 2 BIN OUT tool is included.
3 .2 Changes from V
er 1.12 to Ver 1.13
Trouble in PCM Play Address upgrade during PCM stream play has been corrected.
26
3.3 Changes from Ver 1.13 to Ver 1.14
A fault whereby the PCM Play Address was not properly upgraded during multiple channel
simultaneous play has been improved.
4. Cautionary Items
Bank changes must be set in the sequence data. While it was clearly explained in the
manual that original bank changes should be set, in Ver 1.12 and earlier versions sound was
produced even though there were no bank changes. From Ver 1.13 on, however, checks
reveal that if bank changes are not set, no sound is produced.
Parameter Editor
User's Manual
Doc. # ST-227-R1-030595
Introduction .................................................................... 3
pEdit Functions .............................................................. 4
Menu Structure ............................................................... 5
File Menu ................................................................. 5
Edit Menu ................................................................. 5
Window Menu .......................................................... 5
Using pEdit.................................................................... 6
Editable Data ........................................................... 6
Procedure ................................................................ 6
Parameter Edit Window ..................................................7
Find Function.................................................................. 8
2
Parameter Editor User’s Manual
Introduction
This manual describes how to use the SCSP/DSP parameter editor called pEdit.
pEdit provides functions for editing coefficient data and address constant data
included in DSP programs that are downloaded to the SCSP/DSP hardware.
The SCSP/DSP assembler dAsms can specify several notational modes, such as
integers and fractions, in the coefficient/address constant definition section of the
dAsms source code. However, pEdit can display and input coefficient/address
constant data with the same notational modes used in the dAsms source code be-
cause it reads the specified notational mode information from the executable format
file.
4
Menu Structure
File Menu
Open...
Selects an assembled (executable format) DSP program from the standard file dialog
and downloads the program to the SCSP. pEdit can handle only DSP program
executable-format files (extension .EXC) that have been created by the SCSP/DSP
assembler dAsms.
Save
Saves the DSP program that was modified by pEdit in executable format without
changing the file name.
Save As...
Saves the DSP program that was modified by pEdit in executable format under a
new file name that was specified from the standard file dialog.
Revert To Saved
Returns the parameters being edited to the condition before the parameters were
edited (when the parameters were last saved).
Close
Terminates editing of the currently open DSP program. If the program has not been
saved after parameter modification, this function confirms whether the modifica-
tions should be saved. At Close execution, the internal data in pEdit is erased, but
the data for the program in the DSP hardware is not cleared.
Quit
Terminates pEdit.
Edit Menu
Find
Searches for symbol names of coefficients and addresses defined in the DSP pro-
gram. The Find function is described later in this manual.
Window Menu
Address
Opens the Address (address constant editing) window, which the DSP uses to access
external memory.
Coef
Opens the Coefficient (coefficient editing) window, which the DSP uses for opera-
tions.
Executable Data
pEdit can be used to edit the contents of the coefficient (COEF) RAM and address
constant (ADRS) RAM in the SCSP/DSP hardware.
Procedure
1. Loading executable-format DSP programs
Execute Open from the File Menu to select the executable-format file to be edited.
When a file is selected, the DSP program is downloaded to the SCSP/DSP. In
addition, two parameter editing windows, the Coefficient window for editing
coefficients and the Address window for editing address constants, are opened
on the screen. (The parameter editing windows are described later in this
manual.)
2. Editing parameters
Parameters can be edited in the parameter editing windows (described later) in
two ways:
a) Enter a value directly in the text box in which the parameter value is
displayed.
b) Operate the scroll bar with the mouse.
6
Parameter Edit Window
pEdit provides two parameter editing windows: the Coefficient window for editing
coefficient data and the Address window for editing address constant data. This
section explains the Coefficient window according to the example shown in the
figure below.
When the Find command is executed, the window shown above appears. To ex-
ecute the search, enter the symbol name to be retrieved in the text box, select the
Address or Coefficient button, then click the Find button.
8
TM
dAsms
User's Manual
Doc. # ST-228-R1-030596
4
dAsms User’s Manual
This manual describes how to use the dAsmsSCSP/DSP assembler and its assembly
language.
The following is a sample work session for programming the SCSP/DSP using dAsms.
It is assumed that all the necessary settings to run dAsmshave already been made.
1. Start dAsms.
2. Write DSP source code using the built-in text editor or load code prepared using
another editor.
3. Run the assembler to compile the code.
4. Download the compiled code into Sega Saturn’s memory.
6
Menus
File Menu
New
Opens a new source file window.
Open
Opens a DSP microprogram source code file selected from a standard Macintosh file
dialog box.
Save
Saves the edited file under the same filename.
Save As…
Saves the edited file under a different filename. Specify a new filename when prompted.
Revert To Saved
Returns the source file being edited to the state it was in prior to editing.
Close
Closes the currently open file. A warning will be displayed if there are any changes that
have not been saved.
Quit
Quits dAsms.
Note: The file extension .USC must be attached to source code files. The Assemble...command (de-
scribed later) will not work on source code files without this extension.
Edit Menu
Assemble...
Assembles the DSP source code contained in the active window. You have the option of
entering a different filename for the assembled output file. Otherwise, the extension
.EXC is added to the filename of the source code file as default .
Download...
Downloads an assembled DSP object file to the SCSP via SCSI. Select the download file
from the file dialog box and execute. If the current edit file is already in a executable
format (i.e. the file is assembled), its filename is used as the default download filename.
Option Menu
SCSI ID
dAsmsautomatically detects the SCSI ID of the development target when it firsts per-
forms a download operation. That SCSI ID is subsequently used for data communica-
tions between the host and target. This SCSI ID option does not normally need to be
used unless your hardware setup changes.
CAUTION: The SCSI ID of the development target must be different from the ID of any other SCSI
device connected in the chain. Incorrectly set SCSI IDs may cause loss of data or hardware
problems on the SCSI device.
8
DSP Program Data Structure (Data Format)
#COEF This label denotes the start of the coefficient symbol definition.
#ADRS This label denotes the start of the address symbol definition
Program Description
Comments
· Comments can be inserted in the source code by using the apostrophe character (‘)
to start them. This causes dAsmsto ignore everything after the apostrophe character
to the end of the line (line feed).
Definition Format
symbol name: Variable name used for coefficient/address data in the DSP code. 1 byte alpha-
numeric character string of 15 characters or less.
initial value: Initial value given for a variable denoted by the symbol name above. The value is
expressed by one of various notation methods described in this document.
Note: One symbol can be defined in one line of the definition expression. An initial value must be
given to each symbol.
• Coefficient symbols 63
• Address symbols 32
Reserved Symbols
The coefficient symbol ZERO is pre-defined; the user may not define a symbol with the
same name. The initial value given to this symbol is 0 and placed at the beginning of
the coefficient data section of the executable DSP program. User-defined coefficient
symbols are placed in the order that they are defined, starting from the second coeffi-
cient data in the coefficient data section.
Although the reserved symbol ZERO can be used in the user program section without its
pre-definition in the coefficient definition section, the value must not be modified by
any means (e.g., within an DSP program or in the DSP hardware).
10
Notation Mode in Coefficient/Address Definition Part of Source Code
Conversion Methodshown above denotes the method used to perform conversion from a
value in each notation mode to actual data. The formulas for conversion methods *1, *2
and *3 are as follows.
*1 (Coefficient) = 4095 * (NotationValue)/100
*2 (Coefficient) = 4096 * (NotationValue)
*3 (AddressDefinition) = 44100 * (NotationValue)/1000
Note: Floating point calculation is performed for *1, *2 and *3. The result is rounded off to the nearest
zero.
The format (in an EXC file) of the converted actual data is shown below.
Note: Note the difference between the constants of formulas *1 and *2 (i.e., 4095 and 4096).
12
Example: The following expressions are possible in the coefficient/address definition section of the
source code.
#COEF
CoefA = &H0FFF
CoefB = 123
CoefC = %50
CoefD = 0.25
#ADRS
AdrsA = &H8000
AdrsB = 123
AdrsC = ms300.0
Command List
Command Function
@ Start a multiplication or addition description
* Multiply
+ Add
- Subtract
> Store (end of multiplication or addition description)
( Left parenthesis
) Right parenthesis
LDI Memory access and load to MEMS
LDY Load from INPUTS to Y register
LDA Load from INPUTS to A register
14
Parameters
Internal Registers
Symbol Description
REG Denotes previous multiplication or addition results.
YREGH Denotes section of (see explanation of multiply and add syntax) of YREG.
YREGL Denotes section of (see explanation of multiply and add syntax) of YREG.
FREG (Refer to explanation of store syntax).
ADREG Address modify component(refer to explanation of store syntax).
Internal RAM
Symbol Description
MEMS00~1F External memory load data area.
MIXS00~0F Sound generator data area.
TEMP00~7F Temporary storage area for multiply and add results.
EFREG00~0F Processed data area.
EXTS00~01 External expansion input data area.
Note: The following memory access elements are noted within the brackets according to the rules
described elsewhere in this document.
All mnemonics and parameters must be separated by one or more units of a delimiter.
A blank space, comma (,), tab and line feed are acceptable delimiters.
• No delimiters can be included in the description of the MR[…] parameter for reading external memory.
• AddressElement(s) denotes the address element (described elsewhere) linked by the symbol “+”.
• There must always be one address constant symbol (user-defined address symbol name) included in
the address description of AddressElement(s).
LDY INPUTS
LDA INPUTS
16
Multiply, Add
@ pM*pC±(pM*pC±(…(pM*pC±(pM*pC+pA))…))
pM: Multiplicand
pC: Multiplication coefficient
pA: Augend
Note: The same number of open parenthesis [(] and close parenthesis [)] must be present in all math-
ematical equations. The right most open parenthesis [(] must always be to the left side of the left
most close parenthesis [)].
Note: When {TEMP00-TEMP7F} is specified with pM and also TEMP with pA, only the TEMP symbols
with the identical identifiers can be used. Therefore, specify T for pA.
• When the value of YREG is used as the multiplication coefficient parameter, one of
either {YREGH, YREGL} is used. The difference in notation between these two
registers shown in the table below.
CAUTION: When specifying ADREG for Destination(s), S3 must not be specified for opt.
• The bit shift, overflow protection, and store mode settings for data is specified with
opt. The possible combinations are shown below.
Parameter #1 Setting Shift Overflow Protection Store Mode
Omit x1 Protection Enabled A
S1 x2 Protection Enabled A
S2 x2 Protection Disabled A
S3 x1 Protection Disabled B
The data stored in ADREG and FREG differ depending on the specification of store
mode A or B as shown below .
Note: The upper 4 bits (ssss in the table above) of ADREG in store mode A are filled (sign expanded)
with a value (sign bit) equal to bit 23 of INPUTS.
18
Reference 1: dAsms Executable File Format
Executable programs created by dAsmsare text files based on the file format shown
below. The file extension for these executables is EXC.
COEF
Coefficient Data
ADRS
Address Data
PROG
Program
Note: The [notation mode/initial value] has the same format as the right side of the coeffi-
cient/address constant definition section of the source code.
[ProgramRAM Address]:[data]
Note: The 64-bit data is divided up into four blocks every 16 bits in the [data] section. Each block
represents four hexadecimal characters. Also, one blank space is inserted between each block.
Refer to the executable file example shown on the next page.
COEF
00:0000:ZERO (coefficient data from reserved coefficient symbol ZERO)
01:007B:CoefB:123
02:0800:CoefC:%50
03:0400:CoefD:0.25
04:1F85:CoefE:-123 (negative value)
05:1800:CoefF:%-50 (negative value)
06:1C00:CoefG:-0.25 (negative value)
ADRS
00:8000:AdrsA
01:007B:AdrsB:123
02:33AE:AdrsC:ms300.0
PROG
00:xxxx xxxx xxxx xxxx
01:xxxx xxxx xxxx xxxx
(omitted)
7F:xxxx xxxx xxxx xxxx
Note: An “x” represents one hexadecimal digit (4 bits) according to the PROG section format.
20
Reference 2: dAsms Programming Guide
Source code can be written by taking an appropriate functional component from the
signal flowchart and fitting it in the context of the processing unit. The DSP code is
written by repeating this process in the signal flow processing order.
The DSP programming method used in dAsmsis explained next based on a simple
example.
This example uses the external expansion inputs EXTS00 and EXTS01, through which
audio data streams from the CD-ROM can be input as the left and right channels. The
results of the independent right and left channel delay processing (echo) are output to
EFREG00 and EFREG01.
DrctLevelL
Lch (MEMS00)
EXTS00 + waL raL raL+1 (raL) + EFREG00
EffSendLevelL MEMS00 MEMS01 EffRtnLevelL
FbL
TEMP00 +
D C0L
TEMP01
C2L C1L
DrctLevelR
Rch (MEMS02)
EXTS01 + waR raR raR+1 (raR) + EFREG01
EffSendLevelR MEMS02 MEMS03 EffRtnLevelR
FbR
TEMP02 +
D C0R
TEMP03
C2R C1R
22
Creating DSP Programs
1. Coefficient Symbol Definition (#COEF)
EffSendLevelL=%100
EffSendLevelR=%100
DrctLevelL=%50
DrctLevelR=%50
EffRtnLevelL=%75
EffRtnLevelR=%75
FbL=%50
FbR=%50
The following coefficients are used with the 1st stage IIR filter, which
becomes the feedback signal path for the delay signal shown in the signal
flow diagram.
· C0L/R
· C1L/R
· C2L/R
C0L=0.40893
C0R=0.40893
C1L=0.40893
C1R=0.40893
C2L=0.18164
C2R=0.18164
2.1 Defining Write and Read Addresses for the Delay Ring Buffer
The rectangles in the middle of the left and right channel in the signal flow
diagram represent delay. Delay is produced by the delay buffer, and the
delay time is proportional to the difference between the write address and
the read address. One address is equivalent to the delay of one sample. The
following are defined as addresses:
• waL/R
• raL/R
waL=ms0.0
raL=ms149.9
waR=ms150.0
raR=ms249.9
24
3. Program Description (#PROG)
Memory access (reads from the ring buffer) is required in order to obtain
the data necessary for calculation. The addresses in the ring buffer that
need to be read are
• raL
• raL+1
However, since these addresses are only relative positions in the ring
buffer, the address element DEC is inserted in the [...] part of the external
memory read parameter MR[...]. DEC represents a counter that is
decremented by 1 per each sample. Ring buffer operations are made
possible by adding DEC to the address element notation. Assuming that the
data read from raL and raL+1 positions in the ring buffer are loaded to the
following,
• MEMS00
• MEMS01
LDI MEMS00,MR[raL+DEC]
LDI MEMS01,MR[raL+DEC+1]
It is important here that TEMP be set up as the ring buffer. The xx in TEMPxx
represent the relative address of the ring buffer. The data stored in TEMP00
appear in TEMP01 for the next sample. This is used in steps 3 and 4 above
to generate a one sample delay.
As can be seen from the signal flow diagram, only the sum of the
following need to be written to the ring buffer:
The write address in the ring buffer is waL. As with MR[...] in section 3.1,
the address element DEC is used. The above is expressed in dAsmscode as
follows.
Once again, the signal flow diagram shows that only the sum of the
following 2 data need to be stored in EFREG00.
a. The product of the data read from address raL in the ring buffer and the coefficient
EffRtnLevelL.
b. The product of EXTS00, which is the input value, and the coefficient DrctLevelL.
The data (read from the ring buffer) required for calculation in step a is
already loaded in MEMS00 by the process described in section 3.1. This
process is expressed in dAsmscode as follows.
26
3.5 Coding for the Right Channel
This example is an independent left and right stereo delay DSP program.
The processing for the right channel is identical to that of the left channel,
as seen from the signal flow diagram. However, the coefficient/address
constant symbol names, register names, etc. are different. Code for the
right channel can be written by copying and pasting the code for the left
channel described above and modifying the relevant parts that need to be
changed.
3.6 Finished!
Coding for this programming example is now complete. The entire source
code that conforms with the DSP Program Data Structure (Data Format)
section in this manual is presented below.
#COEF
‘Levels
EffSendLevelL=%100
EffSendLevelR=%100
DrctLevelL=%50
DrctLevelR=%50
EffRtnLevelL=%75
EffRtnLevelR=%75
FbL=%50
FbR=%50
‘FilterCoefs
C0L=0.40893
C0R=0.40893
C1L=0.40893
C1R=0.40893
C2L=0.18164
C2R=0.18164
#ADRS
waL=ms0.0
raL=ms149.9
waR=ms150.0
raR=ms249.9
‘Lch
LDI MEMS00,MR[raL+DEC]
LDI MEMS01,MR[raL+DEC+1]
@ TEMP01 * C2L + (MEMS01 * C1L + (MEMS00 * C0L +))>TEMP00
@ TEMP00 * FbL + (EXTS00 * EffSendLevelL +)>MW[waL + DEC]
@ EXTS00 * DrctLevelL + (MEMS00 * EffRtnLevelL +)>EFREG00
‘Rch
LDI MEMS02,MR[raR+DEC]
LDI MEMS03,MR[raR+DEC+1]
@ TEMP03 * C2R + (MEMS03 * C1R + (MEMS02 * C0R +))>TEMP02
@ TEMP02 * FbR + (EXTS01 * EffSendLevelR +)>MW[waR + DEC]
@ EXTS01 * DrctLevelR + (MEMS02 * EffRtnLevelR +)>EFREG01
=END
28
Reference 3: Error and W
arning Messages
If an error occurs, code assembly is not possible. If a warning occurs, then assembly is
executed, but a problem may exist in the program.
30
Error : Invalid elements […] detected.
There is an error in the address element expression of the external memory access
parameter.
32
SCSI ID ................................................................................................... 8
Source file ............................................................................................... 7
Store ........................................................................................................ 18
Store mode ............................................................................................. 18
Symbol name ......................................................................................... 10
Write address ......................................................................................... 24
ZERO ...................................................................................................... 10
l
n tia
de
nfi
Co
SATURN
Demo-Demo
GA
File Loader
Specifications
SE
Doc. # ST-250-R1-031296
• Change in exit function initialization processing. Disabled interrupts. Eliminated halts of the
slave CPU by the SMPC.
• Added exit function name SYS_Exit.
• Added Function Code 2processing to the exit function (execute IP check and run uncondition-
ally).
• Changed reference area address for DemoDemo data from 60020CCH to 6000CCCH.
Associated libraries were also modified for concurrence (GFS Ver. 2.10, SYS Ver. 2.10).
• Added copy to SYSTEM ID save area processing in the Interface module. Changed memory map
for Interface and Kernel modules.
• Eliminated root directory file count limitation (previously limited to 254 files).
• Eliminated the exit function and standardized on the SYS library function SYS_Exit.
• Added the FLD_INIT_DDS function macro to the interface module.
4
Table of Contents
1. Outline ........................................................................................................................... 6
1.1 System Configuration .............................................................................................. 6
1.2 Functions and Features .......................................................................................... 7
2. File Loader Specifications ............................................................................................. 8
2.1 Interface .................................................................................................................. 8
2.2 Kernel ...................................................................................................................... 10
3. Exit Function Specifications ........................................................................................... 11
4. Demo-Demo Software Disk Configuration ..................................................................... 11
5. FLD File Overview ......................................................................................................... 12
6. Function Specifications .................................................................................................. 13
6.1 File Loader (Interface) ............................................................................................. 13
6.2 File Loader (Kernel) ................................................................................................ 14
6.3 System Exit Function .............................................................................................. 14
This manual describes external specifications for the Demo-Demo File Loader.
File
Loader
Kernel
Main Menu
File Loader
Interface Game A Game B
Multiplayer
The Demo-Demo File Loader comprises a file loader that loads a game selected in the
Demo-Demo Software (DDS) menu into work RAM, and an exit function (SYS_Exit)
that is called when exiting the game.
The File Loader is divided into a menu interface and a kernel that loads the first read
file of the game.
6
1.2 Functions and Features
The use of the File Loader in the following way enables Multi-GFS and the exit function
to be linked to game programs, so games can be developed without regard for whether
they are product versions or Demo-Demo versions.
1. Game Startup
Demo-Demo games are started up by the File Loader interface and kernel.
Since the game IP is executed as is, initialization is the same as in the startup
of a normal game. Therefore, the reliability of operation is improved.
2. Multi-GFS Support
The files and directory structure used by each game are set up in a separate
subdirectory for each game. It is therefore not necessary to consider filename
conflicts between games, and the filenames used can be the same as those in
the actual games.
Multi-GFS allows files in game subdirectories to be accessed without any modifica-
tion to the product version program.
3. Game Exit
Executing the exit function during Demo-Demo operation brings up the menu;
execution during the operation of the game starts up the Multiplayer.
2.1 Interface
1. Process
(a) Load IP of game selected in menu to address 6002000H.
(b) Copy the entire SYSTEM ID (100H bytes from 6002000H) to the SYSTEM ID save
area (60000C00H).
(c) Copy part of SYSTEM ID (20H bytes from 60020E0H) to the SYSTEM ID parameter
area (60002A0H).
(d) Load the Demo-Demo data into the SYSTEM ID save area (4 bytes from
6000CCCH). Specifically, rewrite the part of the SYSTEM ID save area shown in
Figure 2.1. The Demo-Demo data is accessed by the Multi GFS, the SYS_Exit
function and the FLD kernel.
(e) Load the File Loader kernel (FLD_KNL.BIN) at 200000H.
(f) Rewrite the first read function hook table (6002270H) value to the 200000H
address.
(g) Jump to the IP security code (6002100H) and start up the game.
C D E F
C0H Game name DDS TNO FID
01H01H
(indicates Demo-Demo
(indicates is running)
whether Demo-Demo is running)
Starting track
Starting number
track number ofofthe
theCD-DA
CD-DA track used
track used
GameGamesubdirectory filefile
subdirectory identifier
identifier
8
2. Memory Map
WORKRAM-H
6000000H
60002A0H
System ID parameter area 20H bytes
60002C0H
6000C00H
System ID save area 100H bytes
6000CCCH
Demo-Demo data (4H bytes)
6000CD0H
6000D00H
6002000H
System ID (IP Start Address) 100H bytes
60020E0H
System ID parameters (20H bytes)
6002100H
Security code start
6002270H
1st read function hook table value 4H bytes
6002274H
6100000H
3. Notes
Execution of the IP sys_init.obj from both the menu and game can cause the
system to crash when the Multiplayer is started up from a game or the reset button
is pressed.
1. Process
(a) Re-register VBLANK-IN interrupt routine in the interrupt vector table (vector
number 40). (Patch processing performed on sys_sec.obj)
(b) Move to game subdirectory. This subdirectory stores the selected game.
(c) Load the first read file (file where fid is 2) and transfer to first read address.
2. Memory Map
WORKRAM- L
200000H
Hook table 4H bytes
200004H
Reserved area FCH bytes
200100H
Area reserved for kernel program 1F00H bytes
202000H
Free space
300000H
The pointer to the first read file load function is stored in the hook table.
The first read file load function exists within the kernel program.
10
3. Exit Function Specifications
The exit function uses parameter values to perform one of the following exit processes:
IP check and execution, Multiplayer user interface screen startup, infinite loop execution.
1. IP Check & Execution
The Demo-Demo IP is loaded and executed using a boot ROM service routine. The
following initialization process is performed at that time (when operated as a stand-
alone product, the Multiplayer is started up).
(a) Disable interrupts (CPU status register, SCU interrupt mask register)
(b) Change system clock to 26 MHz (halts the slave CPU) *
(c) CD subsystem soft reset
(d) Set stack pointer to the default value (6002000H)
* An SMPC exit wait is not required (infinite loop may occur because of timing)
Using the SMPC slave CPU halt command is not allowed.
2. Multiplayer Startup
Start up the Multiplayer using the SYS_EXECDMP function macro.
3. Infinite loop Execution
Used for debugging.
12
TM
SEGA SATURN
Address Checker
Reference Manual
Doc. # ST-254-B-110395
SI Electronics
2-28-16 Shimomaruko, Ota-ku, Tokyo 146
TEL: 03-3756-4111
TEL: 03-3756-4114 (Tech Development)
FAX: 03-3756-5377
Other program, system, and CPU names are trademarks registered trademarks of their
respective manufacturers.
SI Electronics
2-28-16 Shimomaruko, Ota-ku, Tokyo 146
TEL: 03-3756-4111
TEL: 03-3756-4114 (Tech Development)
FAX: 03-3756-5377
4
Introduction
This manual provides a description of commands used with the SEGA SATURN
Address Checker, and technical specifications.
See the separate SEGA SATURN Address Checker Operation Manual (Doc. # ST-254-A-
110395) for a description of Address Checker setup, program installation, and operation.
6
Table of Contents
8
1. Address Checker Specifications
The Address Checker is used to perform address checks and debugging of programs
such as games that run on the SEGA system (custom SATURN board 17106833E). For
this purpose, the SEGA system and Address Checker board employ C-BUS connections.
(Top view)
The SEGA System and Address Checker board are connected through the UCN1 and
UCN2 connectors shown in the drawing.
I Command Specifications
Principal commands that can be used with the Address Checker are given below.
See section §2 “Detailed Description of Commands” for details of commands.
(1) GO command: start execution of user program (always reset before starting)
(2) SET command: specifies bus master, specifies break at TRG detection
(3) TRC command: specifies history acquisition conditions
(4) TDMP command: displays history acquisition contents
(5) BB command: specifies bus break conditions
(6) ABORT command: aborts user program
10
2. Detailed Descriptions of Commands
The commands are described in detail in this section. The format states the command
syntax. The following symbols are used in the format.
{x|y|z} Specify one of the items x, y and z that are within the brackets.
[x] The item within the square brackets can be omitted.
x … Parameters can be entered one after the other.
<> This is used to make the parameters easier to spot and has no special
meaning.
12
2.2 : Edit and Execute Commands in the History Buffer
14
Example
A>SET IENV=40 ; Sets an environment variable area of 640 bytes
Starting from Ver. 3.3., specify 160 or more in byte units.
Example
A>SET IENV=640 ; Sets an environment variable area of 640 bytes
The IENV functionis not valid in MS-DOS ver. 2 or earlier. When
COMMAND.COM is not on the MS-DOS path, MS-DOS commands
cannot be executed.
Example When a log is obtained from the log file, it can be executed with either the
AUTO command or the < command.
>LOG ALOG (Starts getting log)
>TRC ALL
>GO
>_LOG (Finishes getting log)
........................
>< ALOG.LOG (Runs the command input recording file of the log file
as a command file)
16
2.5 ALIAS Define an Alias
Example Display the character strings defined under CLEAR and RUN:
>?ALIAS CLEAR RUN <CR>
18
2.7 _ALIAS Delete an Alias
Note:
• When the alias is omitted, aliases defined (in BMINIT.DAT) during startup are also
deleted. To delete all aliases the user has defined, use the _ALIASU command.
Example Delete the already defined alias commands CLEAR and RUN:
>_ALIAS CLEAR RUN <CR>
Format _ALIASU
Note:
This command is defined by the ALIAS command.
20
2.9 AUTO Execute Auto Retest
<filename> specifies the name of the log file specified by the LOG com-
mand. See the example. This command opens a file that adds the exten-
sion “.LOG” to the name of the specified log file. It reads the contents of
the file and automatically executes it as an Address Checker command. It
can also automatically compare the results of execution to the contents of
the log file (the log file name plus the extension “.OUT”). The following
can be specified as options.
I: Execute only the command without verifying results. The results of
execution are displayed (default value)
V: Display the results of execution while verifying. Also displays the
locations of verification errors.
E: Display only the locations of verification errors.
Notes:
• The following commands cannot be executed in an AUTO command.
<
AUTO
_ALIASU
_CMDU
Commands for macros
(IF {, } ELSE {, WHILE{,}, BREAK)
22
2.10 BELL Bell Sound
Format BELL
24
2.12 ?BB Display Path Break Point
26
2.14 CAT Display File Contents
Example
>CLS
28
2.16 ECHO Display Character String
Format _ECHO
30
2.18 FK Define Function Keys
Spaces can be used if surrounded by quotations marks (“). Use the charac-
ters ¥r to get a carriage return. The character string can be up to 15 charac-
ters.
Note: The FK command of BMINIT.DAT defines the initial settings of the function
keys. The contents of this file can be changed with an editor to set the function
keys as the user desires.
32
2.20 _FK Delete Function Key Definition
Format GO
Example Execute:
>GO
34
2.22 HELP Display Command Syntax
Example Record an executed command in the log file and automatically re-run the
test:
>LOG LOGSAV (Gets log. No extension added to file name.)
........................ (Executes various commands.)
>_LOG (Finishes getting log)
........................
>CAT LOGSAV (Displays the previous execution results.)
........................
>AUTO LOGSAV (Automatically executes a re-test.)
36
2.24 ?LOG Display Log File Name
Format ?LOG
Example
>LOG LOGSAV (Gets log.)
........................ (Executes various commands.)
>?LOG (Displays the log file name.)
LOG LOGSAV
Format _LOG
38
2.26 MAN Manual Display
When KEY is specified, an explanation of the control keys and the like for
key input is displayed. When EXPR is specified, an explanation of the
expression is displayed. To specify a command for a macro in <command
name>, specify IF, WHILE or BREAK.
Searches for the specified command start with system commands and
then goes to user commands if the command is not found. The command
list is recorded in BM.HLP as text, so it may be freely added to or changed.
Note: When the command “<“ is specified in command file execution, enclose it in
quotation marks (i.e., MAN “<“).
The index file is needed by the RIDX command. (The RIDX command is
required by the MAN, HELP and ERR commands.)
Example
>MIDX MAN
40
2.28 MORE MORE Format Display <Filter Command>
Format MORE
Format QUIT
Example
>QUIT
A>
42
2.30 REM Comment Line
Example
>REM EXECUTE GO
>GO
>REM THIS IS COMMENT!
44
2.32 SET Set Address Checker Operating Environment
Format ?SET
46
2.34 STOP Stop
Format STOP
Format TDMP
[<first frame number>[<last frame number>]]
Frame numbers are given in bus cycle units. The last bus cycle becomes
frame 1 and the oldest frame has the largest number. The command dis-
plays the contents of trace memory from the <first frame number> to the
<last frame number>. When <first frame number> and <last frame
number> are both omitted, the entire contents of the trace memory are
displayed.
+— Frame number
| +— “+” displayed when trigger detected
| | +— Address/bus width
| | | +— Data
| | | | +— Access space
| | | | | +— Bus master
| | | | | | +— BS signal
| | | | | | | +— CPU status
| | | | | | | | +— DMA ack signal
| | | | | | | | | +— SDRAM command cycle
f-no addr data cs bm bs st dack sdram
00012+ 000010EB/16 0124 CS0 SH2M WR
• Access space
CS0 CS0 area
CS1 CS1 area
CS2 CS2 area
CS3 CS3 area
• Bus master
SH2M SH2 (master)
SH2S SH2 (slave)
SCU SCU
48
• CPU status
Displays SH operating status
RD Data read
WR Data write
• DMA ack signal
DACK0 DACK0
DACK1 DACK1
Trace conditions can be temporarily saved to a file and then read later from
the file to reset the same conditions. See the example.
Note: When this command is used, the current measured values of the 2 (hardware)
bus counters are cleared to 0 (even when an error occurs during setting).
50
Example Always get the trace. Break the program when the trace buffer becomes
full.
>TRC ALL FUL/STP END/BRK
Always get the trace. Cycle the trace information gets when the buffer
becomes full and continue the program.
>TRC ALL FUL/CNT
Temporarily save trace conditions to a file, then read the conditions from
the file and set them again:
>?TRC >TRACEX.SAV (Saves the current trace conditions to a file.)
....................... (Execute various emulation commands.)
><TRACEX.SAV (Reads the trace conditions from the file and
sets them again.)
Format ?TRC
Example Temporarily save trace conditions to a file, then read the conditions from
the file and set them again:
>?TRC >TRACEX.SAV (Saves the current trace conditions to a file.)
....................... (Execute various emulation commands.)
><TRACEX.SAV (Reads the trace conditions from the file and
sets them again.)
52
2.38 _TRC Delete Trace Conditions
Format _TRC
Format TSET
Description Sets trigger detection condition according to the TRGMAP.DAT file con-
tents.
This is used to reset the trigger detection condition after updating the
TRGMAP.DAT file.
Example Update the TRGMAP.DAT file and reset the trigger detection condition.
54
2.40 VRAM Store Display Contents to a File
Example Saves the contents of the current display to a file called HCOPY:
>VRAM HCOPY
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Address Checker Trigger Definition File
; Condition F: Free
; Condition A: Access prohibited
; Condition R: Read Only
; Condition W: Write Only
; Condition L: See List
;
; The condition settings are in 4K-bytes. For detailed settings,
; specify L, then refer to the List.
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; Address Condition Bus Width
00000000 F 16
00080000 A
00100000 L
L2
; Set unused bits to 1. (When all bits are unused, write is prohibited.)
; R denotes Read Only; W denotes Write Only
;
; 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
;
; SMPC Register
000 FF 00W FF 00W FF 00W FF 00W FF 00W FF 00W FF 00W FF FF
010 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 00W
020 FF 00R FF 00R FF 00R FF 00R FF 00R FF 00R FF 00R FF 00R
030 FF 00R FF 00R FF 00R FF 00R FF 00R FF 00R FF 00R FF 00R
040 FF 00R FF 00R FF 00R FF 00R FF 00R FF 00R FF 00R FF 00R
050 FF 00R FF 00R FF 00R FF 00R FF 00R FF 00R FF 00R FF 00R
060 FF 00R FF FE FF FF FF FF FF FF FF FF FF FF FF FF
070 FF FF FF FF FF 80 FF 80 FF 80W FF 80W FF FEW FF FEW
END
00100080 A
00101000 A
00180000 F
•
• The following addresses are defined through 7FFFFFF.
•
56
Description “;” denotes comments.
“address” denotes the starting address.
“Condition” denotes the trigger detection condition; “F” denotes Free
Access; “A” denotes Access prohibited; “R” denotes Read Only; “W”
denotes Write Only; “L” denotes See List. In the List, conditions can be
specified in single bytes (this is normally in 4 bytes.)
“Bus Width” denotes the effective bus width. When abbreviated, the
previous setting will be enabled. The List allows the selection of unused
bits, Read Only, and Write Only. All unused bit addresses prohibit Write.
The List starts with the L row or the L2 row and ends with the END row.
When the List starts with the L2 row, for addresses where unused bits and
used bits coexist, the unused bit “1” Write is prohibited.
There are Lists for 8 bits, 16 bits, and 32 bits.
58
SEGA SATURN Address Checker Reference Manual 59
60
Addendum: Register Names
SMPC (System Management & Peripheral Control)
Saturn system reset management; Control Pad and other peripheral devices interface
management. Each has a backup battery and real-time clock.
SCSP (Saturn Custom Sound Processor)
Sound source LSI for game, which integrates PCM sound source and DSP for sound.
VDPI (Video Display Processor 1)
LSI for drawing sprites and polygons. The VRAM and frame buffer are connected and
data is thus transferred. Also, data is sent to VDP2 when requested.
VDP2 (Video Display Processor 2)
Manages scroll planes and includes priority functions.
SCU (System Control Unit)
Includes CPU I/F, A-Bus I/F, and B-Bus I/F Controllers.
Includes DMA controller, interrupt controller, and DSP.