GS Users Manual
GS Users Manual
The GS User’s Manual is supplied pursuant to and subject to the terms of the Sony Computer Entertainment
PlayStation® license agreements.
The GS User’s Manual is intended for distribution to and use by only Sony Computer Entertainment licensed
Developers and Publishers in accordance with the PlayStation® license agreements.
Unauthorized reproduction, distribution, lending, rental or disclosure to any third party, in whole or in part, of
this book is expressly prohibited by law and by the terms of the Sony Computer Entertainment PlayStation®
license agreements.
Ownership of the physical property of the book is retained by and reserved by Sony Computer Entertainment.
Alteration to or deletion, in whole or in part, of the book, its presentation, or its contents is prohibited.
The information in the GS User’s Manual is subject to change without notice. The content of this book is
Confidential Information of Sony Computer Entertainment.
© SCEI
-2-
SCE CONFIDENTIAL GS User's Manual Version 6.0
Ch. 1: Overview
• A correction has been made to “Local Memory” in the GS functional block description on page 17.
• A correction has been made to the “Shading” column of the Processing Performance in Sprite table on
page 18.
• A correction has been made to the “Shading” column of the Processing Performance in Point table on
page 18.
© SCEI
-3-
SCE CONFIDENTIAL GS User's Manual Version 6.0
Ch. 5: CRTC
• Corrections have been made to the “NTSC” and “PAL” rows in the Corresponding Video Signal table
on page 84.
Ch. 6: Signal
• Corrections have been made and information has been added to section 6.2.1. SIGNAL Register, on
page 95.
• Corrections have been made and information has been added to section 6.2.2. FINSH Register, on page
95.
Ch. 7: Registers
• A reference note (*3) has been added to the BITBLTBUF register FIELD table on page 101.
• A correction has been made to the “Contents” column in the FBA_1/FBA_2 register FIELD table on
page 106.
• Information has been added to the notes for the RGBAQ register FIELD table on page 119.
• Information has been added to the “S” and “T” rows in the ST register FIELD table on page 123.
• A correction has been made to the “ZTE” row in the TEST_1/TEST_2 register FIELD table on page
124.
• Information has been added to the description of the BUSDIR (w) register on page 144.
• A correction has been made to the note for the CSR (r/w) register FIELD table on page 146.
© SCEI
-4-
SCE CONFIDENTIAL GS User's Manual Version 6.0
Glossary
Term Definition
EE Emotion Engine. CPU of the PlayStation 2.
EE Core Generalized computation and control unit of EE. Core of the CPU.
COP0 EE Core system control coprocessor.
COP1 EE Core floating-point operation coprocessor. Also referred to as FPU.
COP2 Vector operation unit coupled as a coprocessor of EE Core. VPU0.
GS Graphics Synthesizer.
Graphics processor connected to EE.
GIF EE Interface unit to GS.
IOP Processor connected to EE for controlling input/output devices.
SBUS Bus connecting EE to IOP.
VPU (VPU0/VPU1) Vector operation unit.
EE contains 2 VPUs: VPU0 and VPU1.
VU (VU0/VU1) VPU core operation unit.
VIF (VIF0/VIF1) VPU data decompression unit.
VIFcode Instruction code for VIF.
SPR Quick-access data memory built into EE Core (Scratchpad memory).
IPU EE Image processor unit.
word Unit of data length: 32 bits
qword Unit of data length: 128 bits
Slice Physical unit of DMA transfer: 8 qwords or less
Packet Data to be handled as a logical unit for transfer processing.
Transfer list A group of packets transferred in serial DMA transfer processing.
Tag Additional data indicating data size and other attributes of packets.
DMAtag Tag positioned first in DMA packet to indicate address/size of data and address
of the following packet.
GS primitive Data to indicate image elements such as point and triangle.
Context A set of drawing information (e.g. texture, distant fog color, and dither matrix)
applied to two or more primitives uniformly. Also referred to as the drawing
environment.
GIFtag Additional data to indicate attributes of GS primitives.
Display list A group of GS primitives to indicate batches of images.
© SCEI
-5-
SCE CONFIDENTIAL GS User's Manual Version 6.0
© SCEI
-6-
SCE CONFIDENTIAL GS User's Manual Version 6.0
Contents
1. Overview................................................................................................................................................................................. 13
1.1. GS Features .................................................................................................................................................................... 14
1.1.1. Drawing Process..................................................................................................................................................... 14
1.1.2. Local Memory......................................................................................................................................................... 15
1.1.3. Video I/O ............................................................................................................................................................... 15
1.2. Block Configuration ...................................................................................................................................................... 16
1.2.1. Whole Block Diagram ........................................................................................................................................... 16
1.3. Maximum Performance................................................................................................................................................. 18
2. Local Memory ........................................................................................................................................................................ 19
2.1. Data Stored in Local Memory...................................................................................................................................... 20
2.2. Addressing ...................................................................................................................................................................... 21
2.2.1. Address Value ......................................................................................................................................................... 21
2.2.2. Starting Address of Buffer .................................................................................................................................... 21
2.2.3. Address in Buffer ................................................................................................................................................... 21
2.3. Data Formats.................................................................................................................................................................. 22
2.3.1. Color Data Format (Pixel/Texel Format)........................................................................................................... 22
2.3.2. Z Value Format ...................................................................................................................................................... 22
2.4. Frame Buffer .................................................................................................................................................................. 23
2.4.1. Size of Frame Buffer.............................................................................................................................................. 23
2.4.2. Starting Address of Frame Buffer ........................................................................................................................ 23
2.4.3. Coordinate Systems................................................................................................................................................ 23
2.4.4. Pixel Correspondence ............................................................................................................................................ 24
2.4.5. Pixel Storage Format.............................................................................................................................................. 25
2.5. Z Buffer........................................................................................................................................................................... 26
2.5.1. Starting Address of Z Buffer ................................................................................................................................ 26
2.5.2. Coordinate System of Z Buffer ............................................................................................................................ 26
2.5.3. Z Value Storage Format ........................................................................................................................................ 26
2.5.4. Combinations of Frame Buffer and Z Buffer Formats .................................................................................... 26
2.6. Texture Buffer ................................................................................................................................................................ 27
2.6.1. Starting Address of Texture Buffer...................................................................................................................... 27
2.6.2. Coordinate System of Texture Buffer ................................................................................................................. 27
2.6.3. Texel Storage Format............................................................................................................................................. 29
2.7. CLUT Buffer .................................................................................................................................................................. 30
2.7.1. CLUT Configuration ............................................................................................................................................. 30
2.7.2. Starting Address...................................................................................................................................................... 30
2.7.3. CLUT Storage Mode.............................................................................................................................................. 30
2.7.4. CLUT Storage Format........................................................................................................................................... 31
3. Drawing Function ................................................................................................................................................................. 33
3.1. Outline of Drawing Function....................................................................................................................................... 34
3.2. GS Primitive ................................................................................................................................................................... 36
© SCEI
-7-
SCE CONFIDENTIAL GS User's Manual Version 6.0
© SCEI
-8-
SCE CONFIDENTIAL GS User's Manual Version 6.0
© SCEI
-9-
SCE CONFIDENTIAL GS User's Manual Version 6.0
© SCEI
-10-
SCE CONFIDENTIAL GS User's Manual Version 6.0
© SCEI
-11-
SCE CONFIDENTIAL GS User's Manual Version 6.0
© SCEI
-12-
SCE CONFIDENTIAL GS User's Manual Version 6.0
1. Overview
© SCEI
-13-
SCE CONFIDENTIAL GS User's Manual Version 6.0
1.1. GS Features
The GS is a high-performance graphics processor. The following sections summarize the features of the
drawing process, local memory and video input/output.
1.1.1. Drawing Process
The GS draws primitives, such as Polygon or Line, to the frame buffer in local memory, based on drawing
requests from the host processor. The main features are:
Shading
Flat shading and Gouraud shading
Texture mapping
Perspective correction
Bilinear and trilinear texture mapping
MIPMAP
Tiled textures specified by wrap mode
Texture mode
16/24/32 bits (without CLUT), 4/8 bits (with CLUT)
Z buffer
High-speed Z buffer processing without speed decrease
Z value format of 3 types: 16 bits, 24 bits and 32 bits
Alpha blending
High-speed blending without speed decrease
Edge antialiasing
Removing the edge aliasing of Lines and Triangles
Fogging
Fog effects in pixel units enabled for all primitives
High-efficiency scissoring
High-efficiency scissoring to negate the need for scissoring in geometry calculation
© SCEI
-14-
SCE CONFIDENTIAL GS User's Manual Version 6.0
Unified configuration
Contains the frame buffer, Z buffer, textures and CLUTs in the same memory space.
2 port configuration
In this configuration, the frame + Z buffer port is independent of the texture port. They each have a page
buffer of 8KB, and are concurrently accessible.
Wide bandwidth
Bandwidth of frame buffer: 38.4 GBytes/sec (1024 bits x 150 MHz x 2)
Texture bandwidth: 9.6 GBytes/sec (512 bits x 150 MHz)
Transmission from DRAM to page buffer: 8192 bits @ 1cycle at maximum
© SCEI
-15-
SCE CONFIDENTIAL GS User's Manual Version 6.0
Host Bus
Local/Host
Host Interface
Host/Local
Drawing Function Vertex Info/Drawing Environment
Block
Setup/Rasterizing
XYZ/RGBA/STQ etc.
#0 #1 #2 #3 #4 #14 #15
Texel x 16
RGBA/Z
Memory Interface
PCRTC
Frame Page Buffer Texture Page Buffer
Local Memory
(4 MB)
Video Out
© SCEI
-16-
SCE CONFIDENTIAL GS User's Manual Version 6.0
Host Interface
This interface transfers data with the host (CPU). Drawing data and buffer transfer data from the host pass
through this interface.
Setup/Rasterizing (preprocessing)
This block develops the graphics to draw to the pixels based on vertex information received from the host,
and calculates information such as RGBA value, Z value, texture value, and fog value for each pixel.
Pixel Pipeline
This block performs processes such as texture mapping, Fogging, and Alpha-blending, and determines the
final drawing color based on pixel information calculated in the Rasterizing block. It can process a
maximum of 16 pixels concurrently.
Memory Interface
This block reads data from and writes data to the GS local memory. It writes to memory the drawing pixel
values (RGBA, Z) at the end of a pixel operation, reads from memory the pixel values of the frame buffer
(used for the pixel test or Alpha-blending), and reads from memory the RGBA values for the display image.
Local Memory
The GS has a 32-Mbit built-in local memory, containing the frame buffer, Z buffer, texture and CLUT. This
memory has a 1024-bit read port and a 1024-bit write port for drawing and accessing the frame buffer and Z
buffer and a 512-bit port for texture reading.
PCRTC
PCRTC displays the contents of the frame memory in the specified output format.
© SCEI
-17-
SCE CONFIDENTIAL GS User's Manual Version 6.0
When a difference in Z coordinates between the vertices composing one drawing primitive exceeds 216, a penalty
occurs and the cycle count required increases.
© SCEI
-18-
SCE CONFIDENTIAL GS User's Manual Version 6.0
2. Local Memory
© SCEI
-19-
SCE CONFIDENTIAL GS User's Manual Version 6.0
Frame buffer
Area for drawing. Stores pixels (RGBA) of the drawing result.
Z buffer
Area for drawing. Stores Z value of the drawing result.
Texture buffer
Stores texture image data.
CLUT buffer
Stores the Color Look up Table (CLUT) used when the texture is an index color.
© SCEI
-20-
SCE CONFIDENTIAL GS User's Manual Version 6.0
2.2. Addressing
2.2.1. Address Value
Local memory addressing uses linear addresses in 32-bit word units.
32 bits
(0x00000)
Frame
FBP: Frame Buffer Starting Address
Address
CLUT
(0xfffff)
© SCEI
-21-
SCE CONFIDENTIAL GS User's Manual Version 6.0
RGBA32
31 24 23 16 15 8 7 0
A (8 bits) B (8 bits) G (8 bits) R (8 bits)
RGB24
23 16 15 8 7 0
B (8 bits) G (8 bits) R (8 bits)
RGBA16
15 14 10 9 5 4 0
A B (5 bits) G (5 bits) R (5 bits)
IDTEX8
7 0
index (8 bits)
IDTEX4
3 0
index
(4 bits)
Color formats IDTEX8 and IDTEX4 can be used only in the texture buffer. They become index values for
the Color Look up Table (CLUT). For details of the interpretation of the index value, see "2.7. CLUT
Buffer".
2.3.2. Z Value Format
Data in the following three formats can be stored in the Z buffer.
Z32
31 0
Z (32 bits)
Z24
23 0
Z (24 bits)
Z16
15 0
Z (16 bits)
© SCEI
-22-
SCE CONFIDENTIAL GS User's Manual Version 6.0
© SCEI
-23-
SCE CONFIDENTIAL GS User's Manual Version 6.0
(0,0) 4095.9375
x
(0,0) x
Wx,Wy
Origin Point
in Window
Coordinate System
4095.9375
y
y
Wx
1.0 2.0 3.0
Wy Frame
Buffer
1.0
Center of Pixel
2.0
3.0
© SCEI
-24-
SCE CONFIDENTIAL GS User's Manual Version 6.0
PSMCT32
31 0
RGBA32
PSMCT24
31 24 23 0
Not used RGB24
PSMCT16, PSMCT16S
31 16 15 0
RGBA16 (Upper) RGBA16 (Lower)
PSMZ32
31 0
Z32
PSMZ24
31 24 23 0
Not used Z24
PSMZ16, PSMZ16S
31 16 15 0
Z16 Z16
The pixel storage format used is specified in the PSM field (Pixel Storage Mode) of the FRAME register.
© SCEI
-25-
SCE CONFIDENTIAL GS User's Manual Version 6.0
2.5. Z Buffer
The Z buffer is an area where the Z values of the pixels are stored as a result of drawing. The size (width and
height) of the Z buffer is the same as that of the frame buffer.
2.5.1. Starting Address of Z Buffer
The starting address of the Z buffer in local memory is specified in the ZBP field of the ZBUF register. The
alignment of the Z buffer is 2048 words, so the ZBP field is set to the address divided by 2048.
2.5.2. Coordinate System of Z Buffer
The coordinate system of the Z buffer is the same as that of the frame buffer.
PSMZ32
31 0
Z32
PSMZ24
31 24 23 0
Not used Z24
PSMZ16, PSMZ16S
31 16 15 0
Z16 Z16
Group 1 Group 2
PSMCT32
PSMCT24
PSMCT16S PSMCT16
PSMZ32
PSMZ24
PSMZ16S PSMZ16
© SCEI
-26-
SCE CONFIDENTIAL GS User's Manual Version 6.0
Texture coordinates
The GS registers use texture coordinates specified in a two-dimensional homogeneous coordinate system (S,
T, Q) to achieve perspective correction.
The coordinate values stored in the texture buffer are indicated by the normalized texture coordinates (s, t)
showing the upper left point as (0.0, 0.0) and the lower right point as (1.0, 1.0) in a single-precision floating-
point representation.
0.0 1.0 s
A
0.0
1.0
1.0 1.0
t
Figure 2-4 Normalized Texture Coordinates
The texture coordinates (S, T, Q) use the results of the conversion of (s, t). For the calculation, see "3.4.10.
Perspective Correction".
© SCEI
-27-
SCE CONFIDENTIAL GS User's Manual Version 6.0
Texel coordinates
Texel coordinates are two-dimensional coordinate values indicated by (U, V). The UV value is a fixed 16-bit
decimal value, where 1 texel is 1.0. The upper 12 bits are the unsigned integer part, and the lower 4 bits are
the fractional part.
0.0 16.0 U
A
0.0
16.0
16.0 16.0
V
Figure 2-5 Texture Coordinates (in case Texture Size is 16x16)
Texels are centered on the position where the fractional parts of the texel coordinate values are 0.5 (the
center of the square in the grid in the figure).
2.0
Center of Texel
3.0
© SCEI
-28-
SCE CONFIDENTIAL GS User's Manual Version 6.0
PSMCT32
31 0
RGBA32
PSMCT24
31 24 23 0
Not used RGB24
PSMCT16
31 16 15 0
RGBA16 RGBA16
PSMT8
31 24 23 16 15 8 7 0
IDTEX8 IDTEX8 IDTEX8 IDTEX8
PSMT8H
31 24 23 0
IDTEX8 Not used
PSMT4
31 24 23 16 15 8 7 0
IDTEX4 IDTEX4 IDTEX4 IDTEX4 IDTEX4 IDTEX4 IDTEX4 IDTEX4
PSMT4HH
31 28 27 0
IDTEX4 Not used
PSMT4HL
31 28 27 24 23 0
Not used IDTEX4 Not used
Since there is no influence on the "not used" bits, it is possible to combine textures of two different modes (e.g.
PSMCT24 and PSMT8H) in the same area.
The PSM field of the TEX0 register specifies which texel storage format is used.
© SCEI
-29-
SCE CONFIDENTIAL GS User's Manual Version 6.0
CSM1
Data can be more efficiently read from local memory in CSM1 than in CSM2.
The CLUT entries are arranged in order in 16x16 rectangles in IDTEX8 (8 bits) and 8x2 in IDTEX4 (4 bits)
as shown below. The numbers in the figures show the corresponding index values (in hexadecimal).
8 9 a b c d e f
08 09 0a 0b 0c 0d 0e 0f 18 19 1a 1b 1c 1d 1e 1f
20 21 22 23 24 25 26 27 30 31 32 33 34 35 36 37
28 29 2a 2b 2c 2d 2e 2f 38 39 3a 3b 3c 3d 3e 3f
e0 e1 e2 e3 e4 e5 e6 e7 f0 f1 f2 f3 f4 f5 f6 f7
e8 e9 ea eb ec ed ee ef f8 f9 fa fb fc fd fe ff
In CSM1, arrangement should be made from the start of the buffer (the position where X and Y are each 0).
© SCEI
-30-
SCE CONFIDENTIAL GS User's Manual Version 6.0
CSM2
In CSM2, two or more CLUT sets can be arranged at free positions in one big CLUT buffer. However, the
CLUT entries must be in PSMCT16, and the efficiency of transmission to the temporary buffer decreases.
The position in the buffer is specified in the TEXCLUT register.
The CLUT entries are arranged in order as shown below. The CLUT entries are arranged in a width of 256
or 16 and a height of 1. The numbers in the figures show the corresponding index values (in hexadecimal).
© SCEI
-31-
SCE CONFIDENTIAL GS User's Manual Version 6.0
© SCEI
-32-
SCE CONFIDENTIAL GS User's Manual Version 6.0
3. Drawing Function
© SCEI
-33-
SCE CONFIDENTIAL GS User's Manual Version 6.0
Host Interface
Drawing Environment Vertex Information
Rasterizing (DDA)
Scissoring
Fogging Antialiasing
RGB A
Pixel Test
Alpha Test
A, Z Destination Alpha Test
Depth Test
RGB
Alpha Blending
Formatting
XY Z RGB A
Memory Interface
© SCEI
-34-
SCE CONFIDENTIAL GS User's Manual Version 6.0
Setup (Preprocessing)
The gradient (e.g. shading coefficient) and the initial value of DDA necessary for drawing primitives are
calculated based on the vertex information received from the host.
If the primitive is a Triangle, the gradient of the RGBA value, Z value, texture value, and Fog value on the
three sides and on the scan line are calculated.
Rasterizing (DDA)
The pixels of a primitive are generated by DDA (Digital Differential Algorithm). 8 or 16 pixels are generated
concurrently. The RGBA value, Z value, texture value and Fog value for each pixel are calculated from the
gradient obtained in the preprocessing stage, and are given to each of the parallel pixel pipelines.
Texture Mapping
Textures are mapped to pixels. The pixel color is determined by applying the texture function to the Texture
CLUT RGBA value read from the memory block and the RGBA value calculated by DDA.
Antialiasing
The alpha value is replaced with the pixel coverage calculated by DDA (proportion of the pixel occupied by
the theoretical edge of the primitive.) The edges of the primitive are smoothed when Alpha-blending is
implemented with this alpha value.
Fogging
The RGB value and Fog color value output from the texture mapping block are blended according to the
Fog value of the pixel calculated by DDA.
Pixel Test
Whether to draw a pixel is based on its XYZ and RGBA values. Three kinds of tests—alpha test,
destination alpha test, and depth test—are performed one by one.
Alpha-blending
Blending the RGB value of a pixel and the RGB value in the frame memory is implemented according to the
alpha value of the pixel or the alpha value in the frame memory.
Formatting
The pixel value for drawing is converted into the data format of the frame buffer. Dithering and color
clamping are applied if necessary.
Memory Interface
Read/write is performed to local memory in the chip. The operations are: writing drawing pixel values
(RGBA, Z) to the memory after a pixel operation, reading pixel values into the frame buffer from the
memory (used for pixel test and alpha-blending), and reading RGBA values for display from memory.
Environment Registers
These registers store various parameters necessary for drawing. These values are referred to in each process
of drawing.
© SCEI
-35-
SCE CONFIDENTIAL GS User's Manual Version 6.0
3.2. GS Primitive
3.2.1. Types of GS Primitives
The GS uses the following seven primitive types:
Point
A Point is an independent point that is drawn with 1 piece of vertex information.
1 3
2
Line
A Line is an independent line that is drawn with 2 pieces of vertex information.
1
3
2
4
LineStrip
A LineStrip is a series of continuous lines that share endpoints. The first line is drawn with 2 pieces of
vertex information. The succeeding lines are drawn with 1 piece of vertex information.
3
1
5
2
4
Triangle
A Triangle is an independent triangle that is drawn with 3 pieces of vertex information.
1 4
3 6
2 5
© SCEI
-36-
SCE CONFIDENTIAL GS User's Manual Version 6.0
TriangleStrip
A TriangleStrip is a series of triangles that share sides. The first triangle is drawn with 3 pieces of vertex
information, and the succeeding ones are drawn whenever 1 piece of vertex information is added.
3 7
1 5
2
4 6
TriangleFan
A TriangleFan is a series of triangles sharing one vertex. The first triangle is drawn with 3 pieces of vertex
information, and the succeeding triangles are drawn whenever 1 piece of vertex information is added.
4
5
3
6
1 7
Sprite
A Sprite is an independent rectangle, drawn with 2 pieces of vertex information showing the endpoints of a
diagonal line.
4
1
3
© SCEI
-37-
SCE CONFIDENTIAL GS User's Manual Version 6.0
3) Vertex Kick
If the vertex information setting registers that have a Vertex Kick function are written to, the vertex
information set up to that point is placed in the vertex queue, and the queue goes one step forward. This
operation is called the Vertex Kick. The following figure shows the image of operation.
© SCEI
-38-
SCE CONFIDENTIAL GS User's Manual Version 6.0
Copy
Vertex Queue
1st Vertex
XYZ, RGBA, STQ/UV, F
Move
2nd Vertex
XYZ, RGBA, STQ/UV, F Differs depending
on the primitive
Move type.
3rd Vertex
XYZ, RGBA, STQ/UV, F
© SCEI
-39-
SCE CONFIDENTIAL GS User's Manual Version 6.0
© SCEI
-40-
SCE CONFIDENTIAL GS User's Manual Version 6.0
© SCEI
-41-
SCE CONFIDENTIAL GS User's Manual Version 6.0
© SCEI
-42-
SCE CONFIDENTIAL GS User's Manual Version 6.0
© SCEI
-43-
SCE CONFIDENTIAL GS User's Manual Version 6.0
Point
The pixel closest to the specified XY coordinates is drawn.
Closest Pixel
×
Specified XY coordinates
Line, LineStrip
By defining the area for each pixel as shown with small gray squares in Figure 3-5, the pixels located in the
areas where a line goes through are drawn. However, a pixel located at the endpoint of a line is not drawn.
Any line can be drawn without being broken. Even when continued lines that share endpoints are drawn,
they cannot be drawn doubly unless crossed.
End point
is not drawn.
Start point
is drawn.
Pixel Drawn
Drawn
only once
Pixel Drawn
© SCEI
-44-
SCE CONFIDENTIAL GS User's Manual Version 6.0
Drawn on
the Left Side.
Not Drawn on
the Right Side.
Drawn on
the Top Side.
Not Drawn on
the Bottom Side.
© SCEI
-45-
SCE CONFIDENTIAL GS User's Manual Version 6.0
Drawn
only once.
Sprite
Draws pixels in a rectangular area with two vertices specified as diagonal points. When a side passes the
center of a pixel, drawing is performed if it is the top or left side and not performed if it is the bottom or
right side.
1st Diagonal Point
Drawn on
the Left Side. Not Drawn on the Right Side.
© SCEI
-46-
SCE CONFIDENTIAL GS User's Manual Version 6.0
© SCEI
-47-
SCE CONFIDENTIAL GS User's Manual Version 6.0
RGBAQ
XYZF2
PRIM Triangle, CTXT=1
ST
RGBAQ
XYZF2
ST
Drawing Triangle with
RGBAQ Context 2 (Bilinear Sampling)
XYZF2
ST
RGBAQ
XYZF2
© SCEI
-48-
SCE CONFIDENTIAL GS User's Manual Version 6.0
PRMODECONT AC=0
PRIM TriangleStrip
PRMODE CTXT=0
ST
RGBAQ
XYZF2 Drawing 1st Triangle with Context 1
ST (Point Sampling)
RGBAQ
XYZF2
ST
RGBAQ
XYZF2
ST
XYZF2
PRMODE CTXT=0
ST
Drawing 3rd Triangle with Context 1
RGBAQ (Point Sampling)
XYZF2
© SCEI
-49-
SCE CONFIDENTIAL GS User's Manual Version 6.0
DDA
RGBA U,V S,T Q
Normalization Texel
Coordinate Calculation LOD
s=S/Q Calculation
t=T/Q
STQ/UV Selection
Wrap Mode
Memory Address Calculation
Address
Texture Texture
Bit Expansion Page Buffer Buffer
Texel Value
Filtering
Address (Fractional Part)
Point Sampling
Bilinear
Fragment Color Texel Color
Pixel Color
© SCEI
-50-
SCE CONFIDENTIAL GS User's Manual Version 6.0
The address in the texture buffer is calculated by using the texture coordinate (STQ or UV) values of the pixel
output from the DDA, and then the texel is read from the texture buffer. Bit expansion of RGB values and
Alpha value, and reference to the CLUT, are made according to the texture information, and bilinear filter etc.
are applied according to the filter mode. The texel color from this result and the fragment color output from the
DDA are calculated according to the texture function mode, and become the pixel color.
When the texel storage format is IDTEX8 or IDTEX4, settings related to the CLUT buffer should be made in
addition to the above settings. See "3.4.7. CLUT Buffer Control".
© SCEI
-51-
SCE CONFIDENTIAL GS User's Manual Version 6.0
The relationship between texture coordinates (S, T, Q) and texel coordinates (U, V) is as follows:
u = USIZE x S/Q
v = VSIZE x T/Q
u and v values that the GS can process are in the range of -2047 to +2047. Values exceeding this range are
clamped. This may cause irregularities in texture drawing when s and t values become large.
The GS performs processing by rounding down the lower 8 bits of the mantissa of 32-bit floating-point values
specified to S, T, and Q. This may cause irregularities to the texture on the screen when expanded.
3.4.5. Texture Wrap Modes
When trying to refer to the outside of the valid range of the texture, a processing method (wrap mode) can be
selected. This method enables tiling, the repetition of a small texture. Using antialiasing and bilinear filter in
inappropriately set wrap mode may cause a defect when drawing the boundary lines of the texture, since they
refer to the texels outside the primitive edges.
Assuming the texture width and height are USIZE and VSIZE, when the texel coordinate values (u, v) of a texel
to be processed are outside the range of (0, 0) - (USIZE, VSIZE), the texel coordinate values (u', v') are
calculated by a method specific to each wrap mode.
There are four wrap modes (REPEAT, CLAMP, REGION_CLAMP, and REGION_REPEAT), and they can
be set independently for the horizontal and vertical directions. Settings are made in the WMS and WMT fields
of the CLAMP register.
REPEAT Mode
The original image is mapped repeatedly.
(Formulas)
u' = u % USIZE
v' = v % VSIZE
© SCEI
-52-
SCE CONFIDENTIAL GS User's Manual Version 6.0
CLAMP Mode
The outermost color of the texel is enlarged.
(Formulas)
u < 0.0: u' = 0.0
v < 0.0: v' = 0.0
u > USIZE: u' = USIZE
v > VSIZE: v' = VSIZE
REGION_CLAMP Mode
The data of the rectangular area specified in the MINU, MINV, MAXU and MAXV areas in the CLAMP
register becomes effective, and the outermost texel color is enlarged outside the area in the same way as the
CLAMP mode.
(Formulas)
u < MINU: u' = MINU
v < MINV: v' = MINV
u > MAXU: u' = MAXU
v > MAXV: v' = MAXV
When MIPMAP is performed, on the levels other than MIPMAP0, clamping is performed within the range
MINU >>n, MINV >>n, MAXU >>n, and MAXV >>n in the texel coordinate system, assuming the level
value to be n.
REGION_REPEAT Mode
The following operations are applied to the integer parts (uint, vint) of the texel coordinates, and the texel
coordinate values are calculated.
(Formulas)
u' = (uint & UMSK) | UFIX
v' = (vint & VMSK) | VFIX
When using the REGION_REPEAT mode, the pattern, by which a part of the texture area is repeated, can
be used, and a mosaic effect can be achieved.
© SCEI
-53-
SCE CONFIDENTIAL GS User's Manual Version 6.0
UMSK, VMSK, UFIX, and VFIX are specified in the CLAMP_1 or CLAMP_2 register. They are the same
bits as the MINU, MINV, MAXU, and MAXV fields respectively, but are processed differently, according to
the wrap mode.
However, the following conditions exist to perform drawing correctly when the bilinear filter is used as a
filter for reading texels.
In the mask pattern of UMSK and VMSK, the bit position where the value is 1 should take 0 as the
corresponding bit values of UFIX and VFIX. This is shown in the formulas below.
CLUT Conversion
When the texel storage formats are IDTEX8 and IDTEX4, the actual color value is obtained via the Color
Look-up Table (CLUT) based on the texel value.
CLUT
Color Value 0
Color Value 1
Texel Value Color Value 2 Format
:
(IDTEX4)
: Conversion
:
Color Value 15
Figure 3-13 Conversion from Texel Value (IDTEX4) to Color Value via CLUT
The CLUT is a color value table of 256 entries with IDTEX8 and 16 entries with IDTEX4. This table is
read temporarily from the local buffer to a temporary buffer and used. (This temporary buffer is different
from the texture page buffer, so the contents of the texture page buffer are not destroyed by using the
CLUT.)
Data load control from the CLUT to a temporary buffer is described in detail in "3.4.7.
CLUT Buffer Control".
Input Luminance
Value (5bits) E D C B A
Output
Luminance
Value (8bits) E D C B A 0 0 0
© SCEI
-54-
SCE CONFIDENTIAL GS User's Manual Version 6.0
RGBA16
A=0 A=1
AEM = 0 TA0 TA1
AEM = 1 R = G = B = 0 -> 0 TA1
R | G | B is not equal to 0 -> TA0
RGB24
AEM = 0 TA0
AEM = 1 R = G = B = 0 -> 0
R | G | B is not equal to 0 -> TA0
Temporary Buffer
Local Memory .
.
CLUT Buffer CSA .
Color Value 0 .
Color Value 1 Color Value 0
Color Value 2 Color Value 1
. Color Value 2 Format
. .
. Load Conversion
.
Color Value 15 .
.
Color Value 15
.
.
.
.
CLUT2
CLUT3
.
.
.
.
© SCEI
-55-
SCE CONFIDENTIAL GS User's Manual Version 6.0
16 bits
0
:
CSA=0 :
15
16
:
CSA=1 :
31
32
:
:
:
CSA=31
511
32 bits
256 0
: :
CSA=0 : :
271 15
272 16
: :
CSA=1 : :
303 31
304 32
: :
: :
: :
CSA=15
511 255
© SCEI
-56-
SCE CONFIDENTIAL GS User's Manual Version 6.0
Load Operation
CLUT data is loaded from the CLUT buffer to the temporary buffer when the TEX0 or TEX2 register is
accessed. Only one set of CLUT data is loaded, and values in other areas of the temporary buffer are saved.
Loading Condition
The condition of loading to the temporary buffer is specified with CLD.
© SCEI
-57-
SCE CONFIDENTIAL GS User's Manual Version 6.0
Point Sampling
Texel coordinates (iu, iv) are calculated from the normalization texel coordinates (s, t) according to the
following formulas, and the color value of the texel is assumed to be the texture value.
Operations such as repetition and clamping are performed to iu and iv depending on the wrap mode.
U 1.0 2.0 3.0
V
1.0
2.0
3.0
Bilinear Sampling
The texture value is calculated by applying linear interpolation to four texel colors as below. First, texel
coordinates (iu0, iv0), (iu1, iv0), (iu0, iv1), and (iu1, iv1) are calculated from the normalization texel
coordinates (s, t) by the following formulas.
The texture value is calculated by linear interpolation from the following formulas, assuming that the color
values of these four texels are (Ra, Ga, Ba, Aa), (Rb, Gb, Bb, Ab), (Rc, Gc, Bc, Ac), and (Rd, Gd, Bd, Ad)
respectively and that the decimal parts of (s x USIZE - 0.5) and (t x VSIZE - 0.5) are Alpha and Beta
respectively.
Operations such as repetition and clamping are performed to iu0, iv0, iu1, and iv1 depending on the
wrapping mode.
© SCEI
-58-
SCE CONFIDENTIAL GS User's Manual Version 6.0
a b
2.0
c d
3.0
However, the operator * means A*B = (A x B) >> 7, and the calculation result is clamped between 0 and 0xff.
(When the value of the fragment color is 0x80, the brightness of the texture corresponds to the brightness of the
output color.)
© SCEI
-59-
SCE CONFIDENTIAL GS User's Manual Version 6.0
Z Z
X X
Y Y
S = sv / W T = tv / W Q=1/W
Proper perspective correction can be achieved by giving these S, T, and Q to the GS. (After linear-interpolating
S, T, and Q, the GS calculates the normalization texel coordinate values from s = S/Q and t = T/Q.)
Moreover, perspective distortion is not generated for Sprites, where each fragment always takes the same Z
value. In such a case, texel coordinates for the vertex of each primitive can be specified directly. (Note that they
are not the normalization texel coordinates.)
Whether the homogeneous texture coordinates (S, T, Q) or texel coordinates (U, V) are used to specify the
texture coordinates is determined by the FST flag of the PRIM register or PRMODE register. Regarding the
primitive vertex, S and T values are set in the ST register and Q value is set in the Q area of the RGBAQ
register. Moreover, U and V values are set in the UV register.
© SCEI
-60-
SCE CONFIDENTIAL GS User's Manual Version 6.0
3.4.11. MIPMAP
MIPMAP textures can be set in seven stages from level 0 to level 6. The texture height and width should each
be a power of 2. When MIPMAP level 0 texture is 2m x 2n in sizing, levels 1 and 2 are set to 2m-1 x 2n-1 and 2m-2
x 2n-2 respectively in texture sizing. Sizing is set in succession by reducing the height and width by half, until
either the width or height reaches 1 for point sampling or 8 for bilinear sampling.
When MIPMAP is not performed, level 0 is used.
The minimum value at base pointer intervals by which the textures of different MIPMAP levels are stored
changes depending on the texture format, texture size and ratio of height and width.
• PSMCT32/PSMCT24/PSMT8H/PSMT4HL/PSMT4HH
Width = Height = {32, 64, 128, 256, 512}
• PSMCT16/PSMT8/PSMT4
Width = Height = {32, 64, 128, 256, 512, 1024}
With automatic calculation, textures up to level 3 are stored in a continuous memory area, as in the examples
above. When the texture is loaded, it is necessary to store the texture at the position of the base pointer
calculated automatically.
The automatic calculation is executed when the TEX0 register is set after the MTBA field of the TEX1
register is set to 1.
For the texture of MIPMAP levels 1 to 3, the base pointer is specified in the fields TBP1 to TBP3 of the
MIPTBP1 register and the buffer width is specified in the field TBW1 to TBW3. As for the texture of
MIPMAP levels 4 to 6, the base pointer is specified in the fields TBP4 to TBP6 of the MIPTBP2 register and
the buffer width is specified in the field TBW4 to TBW6. Moreover, the maximum MIPMAP level used is
set to the MXL flag in the TEX1 register.
© SCEI
-61-
SCE CONFIDENTIAL GS User's Manual Version 6.0
When the calculated LOD value is 0.0 or less, the level 0 texture is used, and the filter specified in the MMAG
field of the TEX1 register is used.
When the LOD value is more than 0.0, the level 0 to 6 textures are used depending on the LOD value, and the
filter specified by the MMIN flag of the TEX1 register is used.
The following table shows the relation between the MMIN flag and the filter used.
MMIN Flag Level m Filer Level m+1 Filter Processing between Levels
0 Disabled Disabled Level 0 point sampling
1 Disabled Disabled Level 0 bilinear
2 Point sampling Point sampling Selection of m or m+1 by LOD
(round-off)
3 Point sampling Point sampling Linear interpolation by LOD
4 Bilinear Bilinear Selection of m or m+1 by LOD
(round-off)
5 Bilinear Bilinear Linear interpolation by LOD
(trilinear)
*m is the integer part of the LOD value.
The bilinear filter in each MIPMAP imposes almost no speed penalty, but the linear interpolation filter between
levels affects the drawing time.
Moreover, when the number of pixels for the height or width of the texture is four or less, correct images
cannot be obtained with bilinear and trilinear filters.
Specifications of L and K
The weight of the MIPMAP filter is specified by L, and the position of MIPMAP level 0 is set by K.
Assuming the fragment position, where the ratio of the texel to the frame buffer pixel is 1 to 1, to be Z0 in
texture mapping, K is set by the following formula.
K = - ( log2(Z0 / h ) << L )
However, h is assumed to be the distance between the viewpoint and screen, and Q of each vertex of the
primitive is assumed to be h/Z. The relation between Z and LOD is shown in the figure below.
© SCEI
-62-
SCE CONFIDENTIAL GS User's Manual Version 6.0
Z2
Z1
Z0
Z
Viewpoint
LOD
0 1 2
When mapping the texture to the primitive parallel to the screen, it is appropriate to set L = 0, in which the
reduction on the display corresponds to the increase of LOD. However, when the primitive is inclined to the
screen, a value more than 0 is set to L.
Because the effect of MIPMAP changes with the texture pattern, appropriate L and K values should be set
according to the texture used. To control the MIPMAP levels individually in primitives units, the value of Q can
be directly controlled.
© SCEI
-63-
SCE CONFIDENTIAL GS User's Manual Version 6.0
R = F * Rv + ( 0xff – F )* Rfc
G = F * Gv + ( 0xff – F )* Gfc
B = F * Bv + ( 0xff – F )* Bfc
A = Av
The Fog coefficient is stored in the F field of the XYZF or XYZF2 register. The Fog color is stored in the
FOGCOL register. Whether or not Fogging is performed is specified with the FGE flag of the PRIM register.
© SCEI
-64-
SCE CONFIDENTIAL GS User's Manual Version 6.0
3.6. Antialiasing
In the GS, Antialiasing can be performed for Line, LineStrip, Triangle, TriangleStrip, and TriangleFan. This
process is performed for each line or triangle.
3.6.1. Principle of Antialiasing
Antialiasing is achieved by calculating the coverage Cov (ratio of the area that covers the pixel) to each pixel at
the edge of the GS primitive, assuming this to be the Alpha value, and performing Alpha-blending to the
destination color (color distant from the primitive) and the primitive color.
The effect of Antialiasing is different depending on the combination of the AA1 flag to set Antialiasing, ABE
flag to set Alpha-blending, and the Alpha value calculated for the pixel. This is shown in the table below. Cov
shows the value of the coverage of the pixel. When the coverage is 100%, Cov = 0 x 80 (128 in decimal) is
obtained.
Drawing Order
To perform Antialiasing appropriately, the part distant from the primitive should be drawn before drawing
the primitive. It is necessary to sort all the drawing primitives in positional order (far to close) to achieve
ideal Antialiasing.
Write to Z Buffer
Since Antialiasing is performed to each line or triangle, how to deal with the parts shared by lines and
triangles becomes a problem. In the GS, to guarantee the connection of the image in the boundary part,
writing to the Z buffer is not performed for pixels with coverage Cov less than 0x80.
As for the line, Cov is always less than 0x80. Therefore, the Z buffer is not written when the AA1 flag is 1.
Antialiasing is controlled by the AA1 flag of the PRIM or PRMODE register. Moreover, it is necessary to
set the flags of the ALPHA register for blending, as shown below.
A = Cs (Source Color)
B = Cd (Destination Color)
C = As (Source Alpha)
D = Cd (Destination Color)
© SCEI
-65-
SCE CONFIDENTIAL GS User's Manual Version 6.0
From the point of view of GS internal processing, the scissoring test is carried out in the Rasterizing (DDA)
stage and not in the pixel test stage. For the convenience of the user, however, it is described in this section.
Processes succeeding the pixel test such as Alpha-blending are performed even to a pixel that failed the alpha
test, destination alpha test, or depth test, and the pixel is finally controlled in drawing when the pixel value is
written in the frame buffer and the Z buffer. It may appear as if the pixel test were performed after Alpha-
blending.
3.7.1. Scissoring Test
This test checks whether the coordinate values of the pixel to be drawn are in the rectangular (scissoring) area
specified in the window coordinate system. Pixels judged to be outside the scissoring area are not processed
further.
Set Register
SCISSOR_1, SCISSOR_2
Test Contents
The pixel is judged by the following formulas, assuming the pixel coordinates are (x, y). A pixel located on
the boundary of the scissoring area passes.
scissor_test(int x, y)
{
if (x < SCISSOR.SCAX0 || x > SCISSOR.SCAX1) return(FAIL);
if (y < SCISSOR.SCAY0 || y > SCISSOR.SCAY1) return(FAIL);
return(PASS);
}
© SCEI
-66-
SCE CONFIDENTIAL GS User's Manual Version 6.0
Set Register
TEST_1, TEST_2 (ATE, ATST, AREF, and AFAIL fields)
Test Contents
ATE ATST Test Contents
0 - No testing. (All pixels pass.)
1 NEVER All pixels fail.
ALWAYS All pixels pass.
LESS Pixels less than AREF pass.
LEQUAL Pixels less than or equal to AREF pass.
EQUAL Pixels equal to AREF pass.
GEQUAL Pixels greater than or equal to AREF pass.
GREATER Pixels greater than AREF pass.
NOTEQUAL Pixels not equal to AREF pass.
A pixel that failed the alpha test is not controlled completely in drawing, but can be specified in the AFAIL
field in the TEST register so that the RGB, A, and Z values are controlled individually. Details are as
follows.
Controlled values do not become effective even if they pass in other pixel tests after this.
© SCEI
-67-
SCE CONFIDENTIAL GS User's Manual Version 6.0
Set Register
TEST_1, TEST_2 (DATE and DATM fields)
Test Contents
The contents of the Destination Alpha Test depend on the pixel storage mode of the frame buffer.
Set Register
TEST_1, TEST_2 (ZTE and ZTST fields)
Test Contents
ZTE ZTST Test Contents
0 - (Disabled)
1 NEVER All pixels fail.
ALWAYS All pixels pass.
GEQUAL Pixels greater than or equal to Z buffer value pass.
GREATER Pixels greater than Z buffer value pass.
Setting ZTE to 0 is prohibited since it may cause a malfunction. To omit the depth test, set ZTE to 1 and
ZTST to ALWAYS, and the ZMSK field of the ZBUF register to 1 respectively. Due to these settings, the Z
buffer is neither accessed nor updated for any pixels. As a result, the operation becomes the same as the one
without the depth test.
© SCEI
-68-
SCE CONFIDENTIAL GS User's Manual Version 6.0
Output Color = (A - B) * C + D
However, X * Y = (X x Y) >> 7
When the Alpha value is 0x80, the multiplier to the source color becomes 1.0. An example of flag setting
applied to normal blending is shown as follows. When Antialiasing AA1 is performed, the same setting is made.
A B C D Equivalent Formula
Cs Cd As Cd Cs*As + Cd*(0x80 - As)
Additionally, various settings such as subtraction and brightness addition/decrease are possible.
A B C D Equivalent Formula
Cd Cs 0x80 0 Cd - Cs
Cd 0 As Cd Cd*(0x80 + As)
0 Cd As Cd Cd*(0x80 - As)
In the RGBA16 mode, where Destination Alpha value is 1 bit only, Alpha is treated as 0 when A is 0 and as
0x80 when A is 1. In the RGB24 mode, Alpha is treated as 0x80.
The result of Alpha-blending is passed to the following Dithering processing as is, without being clamped.
3.8.2. PABE Flag
When the PABE flag is 1, the value of MSB of the Source Alpha determines whether to perform Alpha-blending
per pixel. Alpha-blending is ON when MSB is 1 and OFF when MSB is 0.
© SCEI
-69-
SCE CONFIDENTIAL GS User's Manual Version 6.0
RGB A Z
A Value
Dithering
Correction
Clamping
Format Conversion
3.9.1. Dithering
If the frame buffer color format is RGBA16, the RGB luminance values are each converted from 8 bits to 5 bits.
At this time, it is possible to decrease the Mach band by dithering.
Dithering is set ON/OFF by the DTHE register.
Dithering is performed by adding the offset value selected according to the coordinates of the pixel from the
dither matrix of 4 x 4 set in the DIMX register to each luminance value of the RGB of the pixel. It is shown in
the following formulas.
-4 2 -3 3
0 -2 1 -1
-3 3 -4 2
1 -1 0 -2
When the color format of the frame buffer is RGBA32 or RGB24, the result of dithering is not guaranteed.
© SCEI
-70-
SCE CONFIDENTIAL GS User's Manual Version 6.0
RGBA32
FBA
bit 7 OR
bit 6
bit 0
RGBA16
FBA
A B G R
31 24 23 16 15 8 7 0
Not Used
B G R
23 16 15 8 7 0
© SCEI
-71-
SCE CONFIDENTIAL GS User's Manual Version 6.0
A B G R
R
15 14 10 9 5 4 0
3.9.5. Masking
The mask can be set so that only the prescribed bits are written when writing data to the frame buffer.
The value of the mask is specified in the FBMSK field of the FRAME_1 or FRAME_2 register. Since the bit
position of the FBMSK corresponds to the pixel value before format conversion, special care is needed when
the pixel format of the frame buffer is RGBA16. The relation between FBMSK and the frame buffer in the case
of RGBA16 is shown as follows.
31 24 23 19 15 11 7 3 0
FBMSK
Frame Buffer A B G R
15 14 10 9 5 4 0
Regarding the Z buffer, it is possible to control only whether or not to write all the bits.
This is specified with the ZMSK of ZBUF_1 or ZBUF_2 register.
© SCEI
-72-
SCE CONFIDENTIAL GS User's Manual Version 6.0
The GS supports three modes of image data transmission, according to the direction of transmission:
The local buffer is the local memory in the GS, and the host is the external device connected to the GS.
When transmitting data, the arrangement of the pixels in local memory, or the pixel storage format, is converted
according to the specification. At this time, however, no processes involving changes to the pixel value (e.g.
color reduction, Alpha value operation, and masking) are performed. When transferring between local buffers,
transmission is supported only between buffers that have the same number of bits per pixel.
© SCEI
-73-
SCE CONFIDENTIAL GS User's Manual Version 6.0
Start Start
Start Start
© SCEI
-74-
SCE CONFIDENTIAL GS User's Manual Version 6.0
The figure below shows the relation between transmission area parameters when the pixel transmission direction
is left to right and top to bottom.
Buffer Width
(SBW/DBW)
Address
(SBP/DBP) (SSAY/DSAY)
(SSAX/
DSAX)
RRH
RRW
© SCEI
-75-
SCE CONFIDENTIAL GS User's Manual Version 6.0
© SCEI
-76-
SCE CONFIDENTIAL GS User's Manual Version 6.0
The host interface has a built-in FIFO for access to the general-purpose port register, and is usually put in the
direction from the host to the inside of the GS. It is necessary to use this FIFO in the reverse direction only in
the image transmission from the local buffer to the host. The general-purpose port register cannot be accessed
while the FIFO is in the reverse direction. However, the privileged port register can be accessed.
The Host FIFO requires the total data size of Local-Host transmission to be multiples of 128 bytes during DMA
transmission and multiples of 16 bytes during IO transmission.
© SCEI
-77-
SCE CONFIDENTIAL GS User's Manual Version 6.0
© SCEI
-78-
SCE CONFIDENTIAL GS User's Manual Version 6.0
RGBA32/TEX32/Z32
63 55 47 39 31 23 15 7 0
Texel 1 Texel 0
A1 B1 G1 R1 A0 B0 G0 R0
Texel 3 Texel 2
A3 B3 G3 R3 A2 B2 G2 R2
RGB32/TEX24/Z24
63 55 47 39 31 23 15 7 0
Texel 2 Texel 1 Texel 0
G2 R2 B1 G1 R1 B0 G0 R0
Texel 4 Texel 3
R5 B4 G4 R4 B3 G3 R3 B2
RGBA16/TEX16/Z16
63 47 31 15 0
Texel 3 Texel 2 Texel 1 Texel 0
A B3 G3 R3 A B2 G2 R2 A B1 G1 R1 A B0 G0 R0
Texel 7 Texel 6 Texel 5 Texel 4
A B7 G7 R7 A B6 G6 R6 A B5 G5 R5 A B4 G4 R4
IDTEX8
63 55 47 39 31 23 15 7 0
IDTEX4
63 59 55 51 ..... 15 11 7 3
T15 T14 T13 T12 ..... T3 T2 T1 T0
© SCEI
-79-
SCE CONFIDENTIAL GS User's Manual Version 6.0
© SCEI
-80-
SCE CONFIDENTIAL GS User's Manual Version 6.0
5. CRTC
© SCEI
-81-
SCE CONFIDENTIAL GS User's Manual Version 6.0
• Image signals can be output with video clocks conforming to VESA standard (135MHz at maximum),
NTSC, and PAL by setting the standard video clock and the CRT mode.
• There are two independent rectangular area read output circuits. Input area, input pixel format, output
resolution, output size, output screen position, etc. can be set independently. Also, two output images can
be alpha-blended with BGColor and output using the built-in merge circuit (see Figure 5-2).
• There is a rectangular area write input circuit allowing a rectangular area in the output feedback image to be
written to an area in the frame or texture buffer. Also, RGB -> YCbCr conversion can be performed at
that time.
Clock NTSC/PAL
Register
Output Circuit
CRT 1
(Analog)
out1
Merge Circuit
Input Circuit
M
Rectangular Area Write Input
Circuit
U
X
© SCEI
-82-
SCE CONFIDENTIAL GS User's Manual Version 6.0
Sync Gen.
out1 CRT1
1 Output
0 1
Rectangular Area Read Output
Circuit 2
out2
1 1
© SCEI
-83-
SCE CONFIDENTIAL GS User's Manual Version 6.0
© SCEI
-84-
SCE CONFIDENTIAL GS User's Manual Version 6.0
Local Memory
Display
FBP Frame Memory DX
Coordinates
DBX
DY DW+1
DBY
X MAGH
DH+1
X MAGV
FBW
© SCEI
-85-
SCE CONFIDENTIAL GS User's Manual Version 6.0
MAGH/MAGV
MAGH and MAGV decide the magnification of width and height respectively. MAGV actually decides the
magnification to the scanning line, and MAGH decides the magnification in units of sub-pixels (VCK).
The values of MAGH to obtain typical resolutions in NTSC/PAL mode are shown below.
MAGH
VCK
DY
DX
MAGV
DH
DW
Read Format
The format of data read from the frame buffer by the rectangular area read output circuit can be selected
from the following four kinds, depending on the PSM field of the DISPFB register.
© SCEI
-86-
SCE CONFIDENTIAL GS User's Manual Version 6.0
PSMCT16/16S
15 10 8 0
31 26 21 16
A B G R
PSMCT24
24 16 8 0
B G R
PSMCT32
24 16 8 0
A B G R
PS-GPU24
24 16 8 0
R1 B0 G0 R0
G2 R2 B1 G1
B3 G3 R3 B2
*Rectangular area read output circuit 2 does not support the PS-GPU24 format.
*Rectangular area setting of the PS-GPU24 should be the same as that of the PSMCT16.
Interlace Read
In interlace mode, the reading method in the vertical direction differs depending on the value of the FFMD
field in the SMODE 2 register as follows.
0: FIELD Mode Read every other line from the start (+0,+2,+4…/+1,+3,+5...)
1: FRAME Mode Read every line from the start (+0,+1,+2,+3,+4,+5….)
M α
Merge Circuit U
Rectangular X CRT 1
out1 D (Analog)
Area xα
Output + A
NO.1 C
x (1 -α)
© SCEI
-87-
SCE CONFIDENTIAL GS User's Manual Version 6.0
OUT 2 Output
The output image of rectangular area read circuit 2 is output to OUT2. The BGColor register value is output
outside the rectangular area or when rectangular area read circuit 2 is in the enable-off state.
The alpha value from rectangular area read circuit 2 is output within the rectangular area and 0x00 is output
outside the area.
OUT 1 Output
An alpha-blended image of the output image of rectangular area read circuit 1 and OUT2 or BGColor is
output to OUT1. OUT2 and BGColor is selected by the value of the SLBG field of the PMODE register.
SLBG=0: OUT2
SLBG=1: BGColor
The alpha used for blending is selected according to the value of the MMOD field of the PMODE register,
as follows.
The alpha output to OUT1 is selected according to the value of the AMOD field of the PMODE register, as
follows.
Assuming that the output of rectangular area read circuit 1 is Rs, Gs, and Bs, the output of rectangular area
read circuit 2/BGColor is Rd, Gd, and Bd, and the alpha value is A, the output (Ro,Go,Bo) of OUT1 is
calculated as follows:
Ro = Rs x A + Rd x (0xff – A)
Go = Rs x A + Gd x (0xff – A)
Bo = Rs x A + Bd x (0xff – A)
The above results are multiplied by 256(0x100) / 255(0xff).
© SCEI
-88-
SCE CONFIDENTIAL GS User's Manual Version 6.0
Output Luminance
Value (8bits) E D C B A 0 0 0
bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0
© SCEI
-89-
SCE CONFIDENTIAL GS User's Manual Version 6.0
Local Memory
WDY WW+1
(WH+1)
*SMPV
WH+1 1 / SMPH
1 / SMPV
EXBW
Captured/SMPH
SX
SY
Captured/SMPV
The rectangular area write input circuit can set the parameters shown in the figure above by means of the
EXTBUF register (EXBP, EXBW, WDX, WDY, FBIN, WFFMD, EMODA, EMODC) and the EXTDATA
register (SX, SY, WH, WW, SMPH, SMPV).
The unit of horizontal coefficients SX and SMPH, which relate to the input image, is VCK (sub-pixel).
© SCEI
-90-
SCE CONFIDENTIAL GS User's Manual Version 6.0
Y = (DBh) x Ey + (0x10)
Cr = (E0h) x Ecb + (0x80)
Cb = (E0h) x Ecr + (0x80)
WFFMD =0:
FIELD: Write to every other line from the start (+0,+2,+4.. / +1,+3,+5..)
WFFMD =1:
FRAME: Write to every line from the start (+0,+1,+2,+3,+4,+5….)
Write Command
The register EXTWRITE to execute write commands is provided in addition to the registers to set addresses
and coordinates. Write processing of the feedback image is begun by writing 1 to this register and ended by
writing 0.
If write processing of the specified rectangular area ends, an interrupt (EXTWINT field in the CSR register)
occurs.
When the system is reset and FLUSH is caused during write processing, write processing is suspended.
© SCEI
-91-
SCE CONFIDENTIAL GS User's Manual Version 6.0
© SCEI
-92-
SCE CONFIDENTIAL GS User's Manual Version 6.0
6. Signal
© SCEI
-93-
SCE CONFIDENTIAL GS User's Manual Version 6.0
The GS has three kinds of signal registers. Although it asserts interrupt signals to the host when signals are
generated, it can control them individually with the Interrupt Mask Register, IMR.
© SCEI
-94-
SCE CONFIDENTIAL GS User's Manual Version 6.0
The interrupt state is cleared when the SIGNAL flag of the CSR register is cleared.
When the second write operation is performed to the SIGNAL register without clearing the interrupt state, an
interrupt is not generated to the host. The GS stops the drawing process and will not honor write operations to
the general-purpose registers. The GS will resume the drawing process and will honor write operations to the
general-purpose registers when the SIGNAL flag of the CSR register is cleared. However, the interrupt state
remains not cleared. At this time, the interrupt corresponding to the second write operation to the SIGNAL
register occurs by setting the SIGMSK flag of the IMR register to 1 and then to 0. The interrupt state is cleared
by clearing the SIGNAL flag of the CSR register again.
Unlike the SIGNAL register, the FINISH register does not stop the GS from drawing when it is written
successively.
6.2.3. LABEL Register
If data is written to the LABEL register, the value of the LABELID field of the SIGLBLID register is updated.
An interrupt is not generated.
The drawing process does not stop by writing to the LABEL register.
© SCEI
-95-
SCE CONFIDENTIAL GS User's Manual Version 6.0
© SCEI
-96-
SCE CONFIDENTIAL GS User's Manual Version 6.0
7. Registers
This chapter describes the functions of the registers, which are accessible from the host, and the meanings of the
fields in the registers.
© SCEI
-97-
SCE CONFIDENTIAL GS User's Manual Version 6.0
Among the registers that set the drawing environment, the registers with names in the format "XXX_1,
XXX_2" are designed to have two contexts. They consist of two sets of registers with the same functions.
Registers with two contexts are as shown below:
© SCEI
-98-
SCE CONFIDENTIAL GS User's Manual Version 6.0
Explanatory Notes
BIT ASSIGN
6 2 1 1 0 0 0
3 3 6 5 8 7 0
FIELD
Name Pos. Format Contents
FCR 7:0 int0:8:0 Fog Color (RED)
FCG 15:8 int0:8:0 Fog Color (GREEN)
FCB 23:16 int0:8:0 Fog Color (BLUE)
© SCEI
-99-
SCE CONFIDENTIAL GS User's Manual Version 6.0
BIT ASSIGN
3 3 0 0 0 0 0 0 0 0
9 2 7 6 5 4 3 2 1 0
FIX D C B A
FIELD
Name Pos. Format Contents
A 1:0 int 0:2:0 Specification of Input Color Value A
00 Cs RGB value of the source is used.
01 Cd RGB value in the frame buffer is used.
10 0
11 Reserved
B 3:2 int 0:2:0 Specification of Input Color Value B
00 Cs RGB value of the source is used.
01 Cd RGB value in the frame buffer is used.
10 0
11 Reserved
C 5:4 int 0:2:0 Specification of Input Alpha Value C
00 As Alpha of the source is used.
01 Ad Alpha in the frame buffer is used.
10 FIX FIX-field value is used as Alpha.
11 Reserved
D 7:6 int 0:2:0 Specification of Input Color Value D
00 Cs RGB value of the source is used.
01 Cd RGB value in the frame buffer is used.
10 0
11 Reserved
FIX 39:32 int 0:8:0 Fixed Alpha Value
Referred to when the value of C above is FIX.
(The range is 0 - 255, and at the 128 position, 1.0 is indicated.)
© SCEI
-100-
SCE CONFIDENTIAL GS User's Manual Version 6.0
BIT ASSIGN
6 5 5 4 4 3 2 2 2 1 1 0
1 6 3 8 5 2 9 4 1 6 3 0
FIELD
Name Pos. Format Contents
SBP 13:0 int 0:14:0 Source Buffer Base Pointer (SBP = Word Address/64)
SBW 21:16 int 0:6:0 Source Buffer Width (SBW = Width in Units of Pixels/64) (*1)
SPSM 29:24 int 0:6:0 Source Pixel Storage Format (*2, *3)
000000 PSMCT32
000001 PSMCT24
000010 PSMCT16
001010 PCMCT16S
010011 PSMT8
010100 PSMT4
011011 PSMT8H
100100 PSMT4HL
101100 PSMT4HH
110000 PSMZ32
110001 PSMZ24
110010 PSMZ16
111010 PSMZ16S
DBP 45:32 int 0:14:0 Destination Buffer Base Pointer (DBP = Word Address/64)
DBW 53:48 int 0:6:0 Destination Buffer Width (DBW = Width in Units of Pixels/64) (*1)
DPSM 61:56 int 0:6:0 Destination Pixel Storage Format (*3)
(Same as Source Pixel Storage Format)
*1 Values must be in the range of 1 to 32.
*2 Operation is undefined when values other than those in the table are set.
*3 In local-local transmission, the formats specified in the SPSM and DPSM fields must have the same number
of bits per pixel (pixel depth).
© SCEI
-101-
SCE CONFIDENTIAL GS User's Manual Version 6.0
BIT ASSIGN
4 3 3 2 2 1 1 0 0 0 0 0
3 4 3 4 3 4 3 4 3 2 1 0
W W
MAXV MINV MAXU MINU M M
T S
FIELD
Name Pos. Format Contents
WMS 1:0 int 0:2:0 Wrap Mode in Horizontal (S) Direction
00 REPEAT
01 CLAMP
10 REGION_CLAMP
11 REGION_REPEAT
WMT 3:2 int 0:2:0 Wrap Mode in Vertical (T) Direction
00 REPEAT
01 CLAMP
10 REGION_CLAMP
11 REGION_REPEAT
MINU 13:4 int 0:10:0 Clamp Parameter in U Direction (*1)
(In REGION_CLAMP Mode)
Clamp Value of Lower Limit
(In REGION_REPEAT Mode)
UMSK Value
MAXU 23:14 int 0:10:0 Clamp Parameter in U Direction (*1)
(In REGION_CLAMP Mode)
Clamp Value of Upper Limit
(In REGION_REPEAT Mode)
UFIX Value
MINV 33:24 int 0:10:0 Clamp Parameter in V Direction (*2)
(In REGION_CLAMP Mode)
Clamp Value of Lower Limit
(In REGION_REPEAT Mode)
VMSK Value
MAXV 43:34 int 0:10:0 Clamp Parameter in V Direction (*2)
(In REGION_CLAMP Mode)
Clamp Value of Upper Limit
(In REGION_REPEAT Mode)
VFIX Value
*1 Fields MINU and MAXU are not used when the value of WMS, the wrap mode in horizontal direction, is
REPEAT or CLAMP. (Don't Care.)
*2 Fields MINV and MAXV are not used when the value of WMT, the wrap mode in vertical direction, is
REPEAT or CLAMP. (Don't Care.)
© SCEI
-102-
SCE CONFIDENTIAL GS User's Manual Version 6.0
BIT ASSIGN
0
0
C
L
A
M
P
FIELD
Name Pos. Format Contents
CLAMP 0 int 0:1:0 Color Clamping Method
0 MASK Lower 8 bits are enabled(wraps around.)
1 CLAMP Clamped in [0,255] range.
© SCEI
-103-
SCE CONFIDENTIAL GS User's Manual Version 6.0
BIT ASSIGN
6 6 5 5 5 5 5 4 4 4 4 4 3 3 3 3
2 0 8 6 4 2 0 8 6 4 2 0 8 6 4 2
DM DM DM DM DM DM DM DM
33 32 31 30 23 22 21 20
3 2 2 2 2 2 1 1 1 1 1 0 0 0 0 0
0 8 6 4 2 0 8 6 4 2 0 8 6 4 2 0
DM DM DM DM DM DM DM DM
13 12 11 10 03 02 01 00
FIELD
Name Pos. Format Contents
DM00 2:0 int 1:2:0 Dither Matrix (0,0)
DM01 6:4 int 1:2:0 Dither Matrix (0,1)
DM02 10:8 int 1:2:0 Dither Matrix (0,2)
DM03 14:12 int 1:2:0 Dither Matrix (0,3)
DM10 18:16 int 1:2:0 Dither Matrix (1,0)
DM11 22:20 int 1:2:0 Dither Matrix (1,1)
DM12 26:24 int 1:2:0 Dither Matrix (1,2)
DM13 30:28 int 1:2:0 Dither Matrix (1,3)
DM20 34:32 int 1:2:0 Dither Matrix (2,0)
DM21 38:36 int 1:2:0 Dither Matrix (2,1)
DM22 42:40 int 1:2:0 Dither Matrix (2,2)
DM23 46:44 int 1:2:0 Dither Matrix (2,3)
DM30 50:48 int 1:2:0 Dither Matrix (3,0)
DM31 54:52 int 1:2:0 Dither Matrix (3,1)
DM32 58:56 int 1:2:0 Dither Matrix (3,2)
DM33 62:60 int 1:2:0 Dither Matrix (3,3)
© SCEI
-104-
SCE CONFIDENTIAL GS User's Manual Version 6.0
BIT ASSIGN
0
0
D
T
H
E
FIELD
Name Pos. Format Contents
DTHE 0 int 0:1:0 Dithering Control
0 Dithering is not performed.
1 Dithering is performed.
© SCEI
-105-
SCE CONFIDENTIAL GS User's Manual Version 6.0
The OR of the fixed value set by this register and the most significant bit of the Alpha value of the pixel is
written to the frame buffer.
BIT ASSIGN
0
0
F
B
A
FIELD
Name Pos. Format Contents
FBA 0 int 0:1:0 MSB of Alpha value for drawing to the frame buffer.
RGBA32 Mode: A = As | (FBA<<7)
RGBA16 Mode: A = As | FBA&0x01
© SCEI
-106-
SCE CONFIDENTIAL GS User's Manual Version 6.0
BIT ASSIGN
© SCEI
-107-
SCE CONFIDENTIAL GS User's Manual Version 6.0
BIT ASSIGN
6 5
3 6
FIELD
Name Pos. Format Contents
F 63:56 int0:8:0 Fog Value
© SCEI
-108-
SCE CONFIDENTIAL GS User's Manual Version 6.0
BIT ASSIGN
2 1 1 0 0 0
3 6 5 8 7 0
FIELD
Name Pos. Format Contents
FCR 7:0 int 0:8:0 Fog Color (R)
FCG 15:8 int 0:8:0 Fog Color (G)
FCB 23:16 int 0:8:0 Fog Color (B)
© SCEI
-109-
SCE CONFIDENTIAL GS User's Manual Version 6.0
BIT ASSIGN
6 3 2 2 2 1 0 0
3 2 9 4 1 6 8 0
FIELD
Name Pos. Format Contents
FBP 8:0 int0:9:0 Frame Buffer Base Pointer
FBP = Word Address/2048
FBW 21:16 int0:6:0 Frame Buffer Width
FBW = Width in Units of Pixels/64
The effective range of set value is 1 to 32
PSM 29:24 int0:6:0 Frame Buffer Pixel Storage Format
000000 PSMCT32
000001 PSMCT24
000010 PSMCT16
001010 PSMCT16S
010011 reserved
010100 reserved
011011 reserved
100100 reserved
101100 reserved
110000 PSMZ32
110001 PSMZ24
110010 PSMZ16
111010 PSMZ16S
FBMSK 63:32 int0:32:0 Frame Buffer Drawing Mask (*)
0 The corresponding bit in the frame buffer is updated.
1 The corresponding bit in the frame buffer is not updated.
* See "3.9.5. Masking". When the pixel storage format of the frame buffer is PSMCT16, PSMCT16S or
PSMZ16, note the bit relation between the mask pattern and frame buffer.
© SCEI
-110-
SCE CONFIDENTIAL GS User's Manual Version 6.0
BIT ASSIGN
6 0
3 0
DATA
FIELD
Name Pos. Format Contents
DATA 63:0 int0:64:0 Host -> Local Transmission Data
© SCEI
-111-
SCE CONFIDENTIAL GS User's Manual Version 6.0
BIT ASSIGN
6 3 3 0
3 2 1 0
IDMSK ID
FIELD
Name Pos. Format Contents
ID 31:0 int0:32:0 Value to be written to SIGLBLID register
IDMSK 63:32 int0:32:0 Whether or not corresponding SIGLBLID bit is updated.
0 Masked. (Not updated.)
1 Not masked. (Updated.)
© SCEI
-112-
SCE CONFIDENTIAL GS User's Manual Version 6.0
BIT ASSIGN
5 5 5 4 3 3 3 2 1 1 1 0
9 4 3 0 9 4 3 0 9 4 3 0
FIELD
Name Pos. Format Contents
TBP1 13:0 int0:14:0 MIPMAP Level 1 Texture Base Pointer (*1)
TBW1 19:14 int0:6:0 MIPMAP Level 1 Texture Buffer Width (*2)
TBP2 33:20 int0:14:0 MIPMAP Level 2 Texture Base Pointer (*1)
TBW2 39:34 int0:6:0 MIPMAP Level 2 Texture Buffer Width (*2)
TBP3 53:40 int0:14:0 MIPMAP Level 3 Texture Base Pointer (*1)
TBW3 59:54 int0:6:0 MIPMAP Level 3 Texture Buffer Width (*2)
*1 The texture base pointer is set to the value of the word address divided by 64.
*2 The buffer width is set to the value of the width (in units of texels) divided by 64. It is set to 1 if the width is
less than 64.
© SCEI
-113-
SCE CONFIDENTIAL GS User's Manual Version 6.0
BIT ASSIGN
5 5 5 4 3 3 3 2 1 1 1 0
9 4 3 0 9 4 3 0 9 4 3 0
FIELD
Name Pos. Format Contents
TBP4 13:0 int0:14:0 MIPMAP Level 4 Texture Base Pointer (*1)
TBW4 19:14 int0:6:0 MIPMAP Level 4 Texture Buffer Width (*2)
TBP5 33:20 int0:14:0 MIPMAP Level 5 Texture Base Pointer (*1)
TBW5 39:34 int0:6:0 MIPMAP Level 5 Texture Buffer Width (*2)
TBP6 53:40 int0:14:0 MIPMAP Level 6 Texture Base Pointer (*1)
TBW6 59:54 int0:6:0 MIPMAP Level 6 Texture Buffer Width (*2)
*1 The texture base pointer is set to the value of the word address divided by 64.
*2 The buffer width is set to the value of the width (in units of texels) divided by 64. It is set to 1 if the width is
less than 64.
© SCEI
-114-
SCE CONFIDENTIAL GS User's Manual Version 6.0
BIT ASSIGN
0
0
P
A
B
E
FIELD
Name Pos. Format Contents
PABE 0 int0:1:0 Alpha Blending Control in Units of Pixels
0 Not performed.
1 Performed. (Alpha blending is OFF for the pixel where the A value
is MSB=0 and ON for the pixel where the A value is MSB=1.)
© SCEI
-115-
SCE CONFIDENTIAL GS User's Manual Version 6.0
BIT ASSIGN
1 0 0 0 0 0 0 0 0 0
0 9 8 7 6 5 4 3 2 0
C
F F A A F T I
T
I S A B G M I PRIM
X
X T 1 E E E P
T
FIELD
Name Pos. Format Contents
PRIM 2:0 int0:3:0 Types of Drawing Primitives
000 Point
001 Line
010 Line Strip
011 Triangle
100 Triangle Strip
101 Triangle Fan
110 Sprite
111 Specification Prohibited
IIP 3 int0:1:0 Shading Method
0 Flat Shading
1 Gouraud Shading
TME 4 int0:1:0 Texture Mapping
0 Texture Mapping OFF
1 Texture Mapping ON
FGE 5 int0:1:0 Fogging
0 Fogging OFF
1 Fogging ON
ABE 6 int0:1:0 Alpha Blending
0 Alpha Blending OFF
1 Alpha Blending ON
AA1 7 int0:1:0 1 Pass Antialiasing (*1)
0 1 Pass Antialiasing OFF
1 1 Pass Antialiasing ON
FST 8 int0:1:0 Method of Specifying Texture Coordinates (*2)
0 STQ value is used (ST/RGBAQ Register is referred
to.)
1 UV value is used (UV Register is referred to.)
CTXT 9 int0:1:0 Context
0 Environment of Context 1 is used.
1 Environment of Context 2 is used.
FIX 10 int0:1:0 Fragment Value Control (RGBAFSTQ Change by DDA)
0 Unfixed (Normal)
1 Fixed
*1 When AA1=1 is set, note Alpha Blending process. See "3.6. Antialiasing".
*2 When FST=1 is set, perspective correction is not performed.
© SCEI
-116-
SCE CONFIDENTIAL GS User's Manual Version 6.0
BIT ASSIGN
1 0 0 0 0 0 0 0
0 9 8 7 6 5 4 3
C
F F A A F T I
T
I S A B G M I
X
X T 1 E E E P
T
FIELD
Name Pos. Format Contents
IIP 3 int0:1:0 Shading Method
0 Flat Shading
1 Gouraud Shading
TME 4 int0:1:0 Texture Mapping
0 Texture Mapping OFF
1 Texture Mapping ON
FGE 5 int0:1:0 Fogging
0 Fogging OFF
1 Fogging ON
ABE 6 int0:1:0 Alpha Blending
0 Alpha Blending OFF
1 Alpha Blending ON
AA1 7 int0:1:0 1 Pass Antialiasing (*1)
0 1 Pass Antialiasing OFF
1 1 Pass Antialiasing ON
FST 8 int0:1:0 Method of Specifying Texture Coordinates (*2)
0 STQ value (ST/RGBAQ register is referred to.)
1 UV value (UV register is referred to.)
CTXT 9 int0:1:0 Context
0 Environment of Context 1 is used.
1 Environment of Context 2 is used.
FIX 10 int0:1:0 Fragment Value Control (RGBAFSTQ Change by DDA)
0 Unfixed (Normal)
1 Fixed
*1 When AA1=1 is set, note Alpha Blending process. See "3.6. Antialiasing".
*2 When FST=1 is set, perspective correction is not performed.
© SCEI
-117-
SCE CONFIDENTIAL GS User's Manual Version 6.0
BIT ASSIGN
0
0
A
C
FIELD
Name Pos. Format Contents
AC 0 int0:1:0 Register that specifies primitive attributes
0 PRMODE register
1 PRIM register
© SCEI
-118-
SCE CONFIDENTIAL GS User's Manual Version 6.0
BIT ASSIGN
6 3 3 2 2 1 1 0 0 0
3 2 1 4 3 6 5 8 7 0
Q A B G R
FIELD
Name Pos. Format Contents
R 7:0 int 0:8:0 Luminance value of R element of vertex color
G 15:8 int 0:8:0 Luminance value of G element of vertex color
B 23:16 int 0:8:0 Luminance value of B element of vertex color
A 31:24 int 0:8:0 Alpha value of vertex (0x80 = 1.0)
Q 63:32 float 32 Normalized texture coordinates (Q) (*)
* Negative values are acceptable. However, the vertices of one primitive must be the same. The lower 8 bits of
the mantissa are rounded down.
© SCEI
-119-
SCE CONFIDENTIAL GS User's Manual Version 6.0
BIT ASSIGN
0 0
1 0
M
S
K
FIELD
Name Pos. Format Contents
MSK 1:0 int0:2:0 00 Normal drawing (not masked.)
01 Reserved.
10 Drawing of pixel with even Y coordinate is prohibited.
11 Drawing of pixel with odd Y coordinate is prohibited.
© SCEI
-120-
SCE CONFIDENTIAL GS User's Manual Version 6.0
BIT ASSIGN
5 4 4 3 2 1 1 0
8 8 2 2 6 6 0 0
FIELD
Name Pos. Format Contents
SCAX0 10:0 int 0:11:0 X-coordinate value for upper-left point of enabled drawing area
(Window coordinate system)
SCAX1 26:16 int 0:11:0 X-coordinate value for lower-right point of enabled drawing area
(Window coordinate system)
SCAY0 42:32 int 0:11:0 Y-coordinate value for upper-left point of enabled drawing area
(Window coordinate system)
SCAY1 58:48 int 0:11:0 Y-coordinate value for lower-right point of enabled drawing area
(Window coordinate system)
© SCEI
-121-
SCE CONFIDENTIAL GS User's Manual Version 6.0
BIT ASSIGN
6 3 3 0
3 2 1 0
IDMSK ID
FIELD
Name Pos. Format Contents
ID 31:0 int0:32:0 Value to be written to SIGLBLID register
IDMSK 63:32 int0:32:0 Whether or not corresponding SIGLBLID bit is updated.
0 Masked. (Not updated.)
1 Not masked. (Updated.)
© SCEI
-122-
SCE CONFIDENTIAL GS User's Manual Version 6.0
BIT ASSIGN
6 3 3 0
3 2 1 0
T S
FIELD
Name Pos. Format Contents
S 31:0 float 32 Texture Coordinate Value S (The lower 8 bits of the mantissa are
rounded down.)
T 63:32 float 32 Texture Coordinate Value T (The lower 8 bits of the mantissa are
rounded down.)
© SCEI
-123-
SCE CONFIDENTIAL GS User's Manual Version 6.0
BIT ASSIGN
1 1 1 1 1 1 1 1 0 0 0 0
8 7 6 5 4 3 2 1 4 3 1 0
Z D D A A
Z F A
T A A T
T A AREF T
S T T I S
E E
T M E L T
FIELD
Name Pos. Format Contents
ATE 0 int 0:1:0 Alpha Test
0 Alpha test OFF
1 Alpha test ON
ATST 3:1 int 0:3:0 Alpha Test Method
000 NEVER All pixels fail.
001 ALWAYS All pixels pass.
010 LESS Pixels with A less than AREF pass.
011 LEQUAL Pixels with A less than or equal to
AREF pass.
100 EQUAL Pixels with A equal to AREF pass.
101 GEQUAL Pixels with A greater than or equal to
AREF pass.
110 GREATER Pixels with A greater than AREF pass.
111 NOTEQUAL Pixels with A not equal to AREF pass.
AREF 11:4 int 0:8:0 Alpha Value to be Compared and Referred to
AFAIL 13:12 int 0:2:0 Processing Method when Failed in Alpha Test
00 KEEP Neither frame buffer nor Z buffer is updated.
01 FB_ONLY Only frame buffer is updated.
10 ZB_ONLY Only Z buffer is updated.
11 RGB_ONLY Only frame-buffer RGB is updated.
DATE 14 int 0:1:0 Destination Alpha Test
0 Destination Alpha Test OFF
1 Destination Alpha Test ON
DATM 15 int 0:1:0 Destination Alpha Test Mode
0 Pixels with destination alpha equal to 0 pass.
1 Pixels with destination alpha equal to 1 pass.
ZTE 16 int 0:1:0 Depth Test
0 Depth test OFF (not allowed)
1 Depth test ON
ZTST 18:17 int 0:2:0 Depth Test Method
00 NEVER All pixels fail.
01 ALWAYS All pixels pass.
10 GEQUAL Pixels with Z greater than or equal to
Z buffer value pass.
11 GREATER Pixels with Z greater than Z buffer
value pass.
© SCEI
-124-
SCE CONFIDENTIAL GS User's Manual Version 6.0
BIT ASSIGN
6 6 6 5 5 5 5 5 3 3 3 3 3 3 2 2 2 2 1 1 1 0
3 1 0 6 5 4 1 0 7 6 5 4 3 0 9 6 5 0 9 4 3 0
C
C T T
P
CLD CSA S CBP F C TH TW PSM TBW TBP0
S
M X C
M
FIELD
Name Pos. Format Contents
TBP0 13:0 int0:14:0 Texture Base Pointer
TBP0 = Word Address/64
TBW 19:14 int0:6:0 Texture Buffer Width
TBW0 = Width in Units of Texels/64
PSM 25:20 int0:6:0 Texture Pixel Storage Format
000000 PSMCT32
000001 PSMCT24
000010 PSMCT16
001010 PSMCT16S
010011 PSMT8
010100 PSMT4
011011 PSMT8H
100100 PSMT4HL
101100 PSMT4HH
110000 PSMZ32
110001 PSMZ24
110010 PSMZ16
111010 PSMZ16S
TW 29:26 int0:4:0 Texture Width: Width = 2TW (max 210) (*1)
TH 33:30 int0:4:0 Texture Height: Height = 2TH (max 210) (*1)
TCC 34 int0:1:0 Texture Color Component
0 RGB
1 RGBA (TEXA register value is At in RGB24/RGBA16)
TFX 36:35 int0:2:0 Texture Function
00 MODULATE
01 DECAL
10 HIGHLIGHT
11 HIGHLIGHT2
CBP 50:37 int0:14:0 CLUT Buffer Base Pointer
CBP = Word Address/64
CPSM 54:51 int0:4:0 CLUT Pixel Storage Format
0000 PSMCT32
0010 PSMCT16
1010 PSMCT16S
CSM 55 int0:1:0 CLUT Storage Mode
0 CSM1
1 CSM2
© SCEI
-125-
SCE CONFIDENTIAL GS User's Manual Version 6.0
© SCEI
-126-
SCE CONFIDENTIAL GS User's Manual Version 6.0
BIT ASSIGN
4 3 2 1 0 0 0 0 0 0 0
3 2 0 9 9 8 6 5 4 2 0
M M
L
T M
K L MMIN MXL C
B A
M
A G
FIELD
Name Pos. Format Contents
LCM 0 int0:1:0 LOD Calculation Method
0 Due to the formula (LOD = (log2(1/|Q|)<<L)+K)
1 Fixed value (LOD = K)
MXL 4:2 int0:3:0 Maximum MIP Level (0-6)
MMAG 5 int0:1:0 Filter when Texture is Expanded (LOD < 0)
0 NEAREST
1 LINEAR
MMIN 8:6 int0:3:0 Filter when Texture is Reduced (LOD >= 0)
000 NEAREST
001 LINEAR
010 NEAREST_MIPMAP_NEAREST
011 NEAREST_MIPMAP_LINEAR
100 LINEAR_MIPMAP_NEAREST
101 LINEAR_MIPMAP_LINEAR
MTBA 9 int0:1:0 Base Address Specification of MIPMAP Texture of Level 1 or More
0 Value specified by MIPTBP1 and MIPTBP2 is used.
1 Base address of TBP1 - TBP3 is automatically set.
(See "3.4.11. MIPMAP".)
L 20:19 int0:2:0 LOD Parameter Value L (See the section for LCM.)
K 43:32 int1:7:4 LOD Parameter Value K (See the section for LCM.)
© SCEI
-127-
SCE CONFIDENTIAL GS User's Manual Version 6.0
BIT ASSIGN
6 6 6 5 5 5 5 5 3 2 2
3 1 0 6 5 4 1 0 7 5 0
C
C
P
CLD CSA S CBP PSM
S
M
M
FIELD
Name Pos. FormatContents
PSM 25:20 int0:6:0
Texture Pixel Storage Format
000000 PSMCT32
000001 PSMCT24
000010 PSMCT16
001010 PCMCT16S
010011 PSMT8
010100 PSMT4
011011 PSMT8H
100100 PSMT4HL
101100 PSMT4HH
110000 PSMZ32
110001 PSMZ24
110010 PSMZ16
111010 PSMZ16S
CBP 50:37 int0:14:0 CLUT Buffer Base Pointer
CBP=Word Address/64
CPSM 54:51 int0:4:0 CLUT Entry Storage Format
0000 PSMCT32
0010 PSMCT16
1010 PSMCT16S
CSM 55 int0:1:0 CLUT Storage Mode
0 CSM1
1 CSM2
CSA 60:56 int0:5:0 CLUT Entry Offset
CSA = Offset/16
In CSM2 mode, CSA=0 must be set.
CLD 63:61 int0:3:0 CLUT Buffer Load Control
000 CLUT buffer contents are not changed.
001 Load is performed to CSA position of buffer.
010 Load is performed to CSA position of buffer and
CBP is copied to CBP0. (*)
011 Load is performed to CSA position of buffer and
CBP is copied to CBP1. (*)
100 If CBP0 != CBP, load is performed and
CBP is copied to CBP0. (*)
101 If CBP1 != CBP, load is performed and
CBP is copied to CBP1. (*)
* CBP0 and CBP1 are internal registers of the GS. For details, see "3.4.7. CLUT Buffer Control".
© SCEI
-128-
SCE CONFIDENTIAL GS User's Manual Version 6.0
BIT ASSIGN
3 3 1 0 0
9 2 5 7 0
A
TA1 E TA0
M
FIELD
Name Pos. Format Contents
TA0 7:0 int0:8:0 The "As" value referred to when A field is 0 in RGBA16 format or
when the format is RGB24.
AEM 15 int0:1:0 Method of Expanding Texture Alpha
0 Processed normally even when R=G=B=0.
1 Treated as "Transparent" (A=0) when R=G=B=0.
TA1 39:32 int0:8:0 The "As" value referred to when A field is 1 in RGBA16 format.
© SCEI
-129-
SCE CONFIDENTIAL GS User's Manual Version 6.0
BIT ASSIGN
2 1 1 0 0 0
1 2 1 6 5 0
FIELD
Name Pos. Format Contents
CBW 5:0 int 0:6:0 CLUT Buffer Width (CBW = Width in Units of Pixels /64)
COU 11:6 int 0:6:0 CLUT Offset U (COU = Offset in Units of Pixels/16)
COV 21:12 int 0:10:0 CLUT Offset V (COV = Offset in Units of Pixels)
© SCEI
-130-
SCE CONFIDENTIAL GS User's Manual Version 6.0
BIT ASSIGN
© SCEI
-131-
SCE CONFIDENTIAL GS User's Manual Version 6.0
BIT ASSIGN
0 0
1 0
X
D
I
R
FIELD
Name Pos. Format Contents
XDIR 1:0 int0:2:0 Transmission direction is specified and transmission is started.
00 Host -> Local Transmission
01 Local -> Host Transmission
10 Local -> Local Transmission
11 Transmission is deactivated.
© SCEI
-132-
SCE CONFIDENTIAL GS User's Manual Version 6.0
BIT ASSIGN
6 5 5 4 4 3 2 1 1 0
0 9 8 8 2 2 6 6 0 0
FIELD
Name Pos. Format Contents
SSAX 10:0 int0:11:0 X Coordinate of Upper Left Point of Source Rectangular Area
SSAY 26:16 int0:11:0 Y Coordinate of Upper Left Point of Source Rectangular Area
DSAX 42:32 int0:11:0 X Coordinate of Upper Left Point in Destination Rectangular Area
DSAY 58:48 int0:11:0 Y Coordinate of Upper Left Point in Destination Rectangular Area
DIR 60:59 int0:2:0 Pixel Transmission Order (Enabled only in Local -> Local
Transmission.)
00 Upper Left -> Lower Right
01 Lower Left -> Upper Right
10 Upper Right -> Lower Left
11 Lower Right -> Upper Left
Note that the set rectangular area wraps around when exceeding the buffer width.
© SCEI
-133-
SCE CONFIDENTIAL GS User's Manual Version 6.0
BIT ASSIGN
4 3 1 0
3 2 1 0
RRH RRW
FIELD
Name Pos. Format Contents
RRW 11:0 int0:12:0 Width of Transmission Area
RRH 43:32 int0:12:0 Height of Transmission Area
© SCEI
-134-
SCE CONFIDENTIAL GS User's Manual Version 6.0
BIT ASSIGN
2 1 1 0
9 6 3 0
V U
FIELD
Name Pos. Format Contents
U 13:0 int 0:10:4 Texel Coordinate (U)
V 29:16 int 0:10:4 Texel Coordinate (V)
© SCEI
-135-
SCE CONFIDENTIAL GS User's Manual Version 6.0
BIT ASSIGN
4 3 1 0
7 2 5 0
OFY OFX
FIELD
Name Pos. Format Contents
OFX 15:0 int 0:12:4 Offset (X)
OFY 47:32 int 0:12:4 Offset (Y)
© SCEI
-136-
SCE CONFIDENTIAL GS User's Manual Version 6.0
BIT ASSIGN
6 3 3 1 1 0
3 2 1 6 5 0
Z Y X
FIELD
Name Pos. Format Contents
X 15:0 int 0:12:4 Vertex Coordinate Value X (0 – 4095.9375)
Y 31:16 int 0:12:4 Vertex Coordinate Value Y (0 – 4095.9375)
Z 63:32 int 0:32:0 Vertex Coordinate Value Z
© SCEI
-137-
SCE CONFIDENTIAL GS User's Manual Version 6.0
BIT ASSIGN
6 3 3 1 1 0
3 2 1 6 5 0
Z Y X
FIELD
Name Pos. Format Contents
X 15:0 int 0:12:4 Vertex Coordinate Value X (0 – 4095.9375)
Y 31:16 int 0:12:4 Vertex Coordinate Value Y (0 – 4095.9375)
Z 63:32 int 0:32:0 Vertex Coordinate Value Z
© SCEI
-138-
SCE CONFIDENTIAL GS User's Manual Version 6.0
BIT ASSIGN
6 5 5 3 3 1 1 0
3 6 5 2 1 6 5 0
F Z Y X
FIELD
Name Pos. Format Contents
X 15:0 int0:12:4 Vertex Coordinate Value X (0 – 4095.9375)
Y 31:16 int0:12:4 Vertex Coordinate Value Y (0 – 4095.9375)
Z 55:32 int0:24:0 Vertex Coordinate Value Z
F 63:56 int0:8:0 Fog Coefficient
© SCEI
-139-
SCE CONFIDENTIAL GS User's Manual Version 6.0
BIT ASSIGN
6 5 5 3 3 1 1 0
3 6 5 2 1 6 5 0
F Z Y X
FIELD
Name Pos. Format Contents
X 15:0 int0:12:4 Vertex Coordinate Value X (0 – 4095.9375)
Y 31:16 int0:12:4 Vertex Coordinate Value Y (0 – 4095.9375)
Z 55:32 int0:24:0 Vertex Coordinate Value Z
F 63:56 int0:8:0 Fog Coefficient
© SCEI
-140-
SCE CONFIDENTIAL GS User's Manual Version 6.0
BIT ASSIGN
3 2 2 0 0
2 7 4 8 0
Z
M
PSM ZBP
S
K
FIELD
Name Pos. Format Contents
ZBP 8:0 int0:9:0 Z Buffer Base Pointer (ZBP = Word Address/2048)
PSM 27:24 int0:4:0 Z Value Storage Format
0000 PSMZ32
0001 PSMZ24
0010 PSMZ16
1010 PSMZ16S
ZMSK 32 int0:1:0 Z Value Drawing Mask
0 Z buffer is updated.
1 Z buffer is not updated regardless of the result of the depth
test.
The buffer width of the Z buffer is not set since it is the same size as that of the frame buffer.
© SCEI
-141-
SCE CONFIDENTIAL GS User's Manual Version 6.0
Since the privileged registers and general-purpose registers are mapped to different spaces, their register
addresses may be duplicated. Also, unlike the general-purpose registers, which have write access only, some of
the privileged registers can have read/write access. For clarification, the following information is added to the
register names in this section:
(r/w) Read/Write
(w) Write Only
© SCEI
-142-
SCE CONFIDENTIAL GS User's Manual Version 6.0
BIT ASSIGN
2 1 1 0 0 0
3 6 5 8 7 0
B G R
FIELD
Name Pos. Format Contents
R 7:0 int 0:8:0 Luminance of R element of background color
G 15:8 int 0:8:0 Luminance of G element of background color
B 23:16 int 0:8:0 Luminance of B element of background color
© SCEI
-143-
SCE CONFIDENTIAL GS User's Manual Version 6.0
BIT ASSIGN
0
0
D
I
R
FIELD
Name Pos. Format Contents
DIR 0 int 0:1:0 Transmission Direction of Interface
0 Host -> Local (Normal)
1 Local -> Host
© SCEI
-144-
SCE CONFIDENTIAL GS User's Manual Version 6.0
BIT ASSIGN
3 2 2 1 1 1 1 1 0 0 0 0 0 0 0 0 0
1 4 3 6 5 4 3 2 9 8 6 5 4 3 2 1 0
F F N R F E V H F S
I F E L D S S I I
I I
ID REV E E S U 0 0 W
I I I N
I
G
N
F L E S N N
L N S A
O D D T H T T T H L
FIELD
Name Pos. Format Contents
SIGNAL 0 int 0:1:0 SIGNAL Event Control
(Write)
0 Nothing is done.
1 Old event is cleared and event is enabled.
(Read)
0 SIGNAL event has not been generated.
1 SIGNAL event has been generated.
FINISH 1 int 0:1:0 FINISH Event Control
(Write)
0 Nothing is done.
1 Event is enabled.
(Read)
0 FINISH event has not been generated.
1 FINISH event has been generated.
HSINT 2 int 0:1:0 HSync Interrupt Control
(Write)
0 Nothing is done.
1 HSync interrupt is enabled.
(Read)
0 HSync interrupt has not been generated.
1 HSync interrupt has been generated.
VSINT 3 int 0:1:0 VSync Interrupt Control
(Write)
0 Nothing is done.
1 VSync interrupt is enabled.
(Read)
0 VSync interrupt has not been generated.
1 VSync interrupt has been generated.
EDWINT 4 int 0:1:0 Rectangular Area Write Termination Interrupt Control
(Write)
0 Nothing is done.
1 Rectangular area write interrupt is enabled.
(Read)
0 Rectangular area write interrupt has not been generated.
1 Rectangular area write interrupt has been generated.
FLUSH 8 int 0:1:0 Drawing Suspend and FIFO Clear (enabled during data write)
0 Not flushed.
1 Flushed.
© SCEI
-145-
SCE CONFIDENTIAL GS User's Manual Version 6.0
© SCEI
-146-
SCE CONFIDENTIAL GS User's Manual Version 6.0
BIT ASSIGN
5 4 4 3 1 1 1 0 0 0
3 3 2 2 9 5 4 9 8 0
FIELD
Name Pos. Format Contents
FBP 8:0 int0:9:0 Base Pointer (Address/2048)
FBW 14:9 int0:6:0 Buffer Width (Width/64)
PSM 19:15 int0:5:0 Pixel Storage Format
00000 PSMCT32
00001 PSMCT24
00010 PSMCT16
01010 PSMCT16S
10010 PS-GPU24
DBX 42:32 int0:11:0 X Position in Buffer of Upper Left Point of Rectangular Area
(in units of pixels)
DBY 53:43 int0:11:0 Y Position in Buffer of Upper Left Point of Rectangular Area
(in units of pixels)
© SCEI
-147-
SCE CONFIDENTIAL GS User's Manual Version 6.0
BIT ASSIGN
5 4 4 3 1 1 1 0 0 0
3 3 2 2 9 5 4 9 8 0
FIELD
Name Pos. Format Contents
FBP 8:0 int0:9:0 Base Pointer (Address/2048)
FBW 14:9 int0:6:0 Buffer Width (Width/64)
PSM 19:15 int0:5:0 Pixel Storage Format
00000 PSMCT32
00001 PSMCT24
00010 PSMCT16
01010 PSMCT16S
DBX 42:32 int0:11:0 X Position in Buffer of Upper Left Point of Rectangular Area
(in units of pixels)
DBY 53:43 int0:11:0 Y Position in Buffer of Upper Left Point of Rectangular Area
(in units of pixels)
© SCEI
-148-
SCE CONFIDENTIAL GS User's Manual Version 6.0
BIT ASSIGN
5 4 4 3 2 2 2 2 2 1 1 0
4 4 3 2 8 7 6 3 2 2 1 0
M M
A A
DH DW DY DX
G G
V H
FIELD
Name Pos. Format Contents
DX 11:0 int 0:12:0 X Position in the Display Area (in VCK units)
DY 22:12 int 0:11:0 Y Position in the Display Area (in Raster units)
MAGH 26:23 int 0:4:0 Magnification in H Direction
0000 x 1
0001 x 2
0010 x 3
0011 x 4
:
:
1111 x 16
MAGV 28:27 int 0:2:0 Magnification in V Direction
00 x1
01 x2
10 x3
11 x4
DW 43:32 int 0:12:0 Display Area Width - 1 (in VCK units)
DH 54:44 int 0:11:0 Display Area Height - 1 (in Pixel units)
© SCEI
-149-
SCE CONFIDENTIAL GS User's Manual Version 6.0
BIT ASSIGN
5 4 4 3 2 2 2 2 2 1 1 0
4 4 3 2 8 7 6 3 2 2 1 0
M M
A A
DH DW DY DX
G G
V H
FIELD
Name Pos. Format Contents
DX 11:0 int 0:12:0 X Position in the Display Area (in VCK units)
DY 22:12 int 0:11:0 Y Position in the Display Area (in Raster units)
MAGH 26:23 int 0:4:0 Magnification in H Direction
0000 x 1
0001 x 2
0010 x 3
0011 x 4
:
:
1111 x 16
MAGV 28:27 int 0:2:0 Magnification in V Direction
00 x1
01 x2
10 x3
11 x4
DW 43:32 int 0:12:0 Display Area Width - 1 (in VCK units)
DH 54:44 int 0:11:0 Display Area Height - 1 (in Pixel units)
© SCEI
-150-
SCE CONFIDENTIAL GS User's Manual Version 6.0
BIT ASSIGN
5 4 4 3 2 2 2 2 2 2 2 1 1 1 0
3 3 2 2 6 5 4 3 2 1 0 9 4 3 0
E E W
F
M M F
B
WDY WDX O O F EXBW EXBP
I
D D M
N
C A D
FIELD
Name Pos. Format Contents
EXBP 13:0 int 0:14:0 Base pointer of the buffer where data is written.
EXBP=Word Address/64
EXBW 19:14 int 0:6:0 Width of the buffer where data is written.
EXBW=Width in Pixel units/64
FBIN 21:20 int 0:2:0 Selection of Input Source
00 OUT1
01 OUT2
WFFMD 22 int 0:1:0 Interlace Mode
0 FIELD (Written to every other raster.)
1 FRAME (Written to every raster.)
EMODA 24:23 int 0:2:0 Method of Processing Input Alpha Value
00 Input Alpha value is written as it is.
01 Value converted from Input RGB to Luminance value Y is written.
10 Value converted from Input RGB to Luminance value Y and
reduced by half is written.
11 Always 0
EMODC 26:25 int 0:2:0 Method of Processing Input Color Value
00 Input RGB is written as it is.
01 Value converted from Input RGB to Luminance value Y is written
to RGB respectively.
10 Value converted from Input RGB to YCbCr is written.
11 Input Alpha value is written to RGB respectively.
WDX 42:32 int 0:11:0 X Coordinate in the buffer of upper left point of the rectangular area where
input image data is written.
WDY 53:43 int 0:11:0 Y Coordinate in the buffer of upper left point of the rectangular area where
input image data is written.
© SCEI
-151-
SCE CONFIDENTIAL GS User's Manual Version 6.0
BIT ASSIGN
5 4 4 3 2 2 2 2 2 1 1 0
4 4 3 2 8 7 6 3 2 2 1 0
S
M
WH WW SMPH SY SX
P
V
FIELD
Name Pos. Format Contents
SX 11:0 int0:12:0 X Coordinate of upper left point of the rectangular area where input
image is written (in VCK units).
SY 22:12 int0:11:0 Y Coordinate of upper left point of the rectangular area where input
image is written (in Pixel units).
SMPH 26:23 int0:4:0 Sampling Rate in H Direction (in VCK units)
0000 Every VCK
0001 At intervals of 1 VCK
0010 At intervals of 2 VCKs
0011 At intervals of 3 VCKs
:
:
1111 At intervals of 15 VCKs
SMPV 28:27 int0:2:0 Sampling Rate in V Direction
00 Every H-Sync
01 At intervals of 1 H-Sync
10 At intervals of 2 H-Syncs
11 At intervals of 3 H-Syncs
WW 43:32 int0:12:0 Rectangular Area Width - 1
WH 54:44 int0:11:0 Rectangular Area Height - 1
© SCEI
-152-
SCE CONFIDENTIAL GS User's Manual Version 6.0
BIT ASSIGN
0
0
W
R
I
T
E
FIELD
Name Pos. Format Contents
WRITE 0 int 0:1:0 Activation/Deactivation of Write
0 Write to memory is completed in the current frame.
1 Write to memory is started from the next frame.
© SCEI
-153-
SCE CONFIDENTIAL GS User's Manual Version 6.0
BIT ASSIGN
1 1 1 1 1 0 0
4 3 2 1 0 9 8
F
E V H I S
D S S N I
W I G
* * M M S
M H M
S S S M S
K K K S K
K
FIELD
Name Pos. Format Contents
SIGMSK 8 int 0:1:0 SIGNAL Event Interrupt Mask
0 Not masked.
1 Masked.
FINISHMSK 9 int 0:1:0 FINISH Event Interrupt Mask
0 Not masked.
1 Masked.
HSMSK 10 int 0:1:0 HSync Interrupt Mask
0 Not masked.
1 Masked.
VSMSK 11 int 0:1:0 VSync Interrupt Mask
0 Not masked.
1 Masked.
EDWMSK 12 int 0:1:0 Rectangular Area Write Termination Interrupt Mask
0 Not masked.
1 Masked.
* Undefined bits should be set to 1.
© SCEI
-154-
SCE CONFIDENTIAL GS User's Manual Version 6.0
BIT ASSIGN
1 1 0 0 0 0 0 0 0 0
6 5 8 7 6 5 4 2 1 0
S A M
E E
L M M
* ALP CRTMD N N
B O O
2 1
G D D
FIELD
Name Pos. Format Contents
EN1 0 int 0:1:0 Read Circuit 1 ON/OFF
0 OFF
1 ON
EN2 1 int 0:1:0 Read Circuit 2 ON/OFF
0 OFF
1 ON
CRTMD 4:2 int 0:3:0 CRT Output Switching
Always 001
MMOD 5 int 0:1:0 Alpha Value Selection for Alpha Blending
0 Alpha Value of Read Circuit 1
1 ALP Register Value
AMOD 6 int 0:1:0 OUT1 Alpha Output Selection
0 Alpha Value of Read Circuit 1
1 Alpha Value of Read Circuit 2
SLBG 7 int 0:1:0 Alpha Blending Method Selection
0 Blended with the output of Read Circuit 2.
1 Blended with the background color.
ALP 15:8 int 0:8:0 Fixed Alpha Value (0xff = 1.0)
* Undefined bits should be set to 0.
© SCEI
-155-
SCE CONFIDENTIAL GS User's Manual Version 6.0
LBLID SIGID
FIELD
Name Pos. Format Contents
SIGID 31:0 int 0:32:0 ID Value Set by SIGNAL Register
LBLID 63:32 int 0:32:0 ID Value Set by LABEL Register
© SCEI
-156-
SCE CONFIDENTIAL GS User's Manual Version 6.0
BIT ASSIGN
0 0 0 0
3 2 1 0
D F
I
P F
N
M M
T
S D
FIELD
Name Pos. Format Contents
INT 0 int 0:1:0 Interlace Mode Setting
0 Non-Interlace Mode
1 Interlace Mode
FFMD 1 int 0:1:0 Setting in Interlace Mode
0 FIELD Mode (Read every other line.)
1 FRAME Mode (Read every line.)
DPMS 3:2 int 0:2:0 VESA DPMS Mode Setting
00 On
01 Stand-by
10 Suspend
11 Off
© SCEI
-157-
SCE CONFIDENTIAL GS User's Manual Version 6.0
© SCEI
-158-
SCE CONFIDENTIAL GS User's Manual Version 6.0
Privileged Registers
Address Register Name Description
0x00 PMODE PCRTC mode setting
0x02 SMODE2 Mode setting related to video synchronization
0x07 DISPFB1 Setting for rectangular area read output circuit 1
0x08 DISPLAY1 Setting for rectangular area read output circuit 1
0x09 DISPFB2 Setting for rectangular area read output circuit 2
0x0a DISPLAY2 Setting for rectangular area read output circuit 2
0x0b EXTBUF Feedback write buffer setting
0x0c EXTDATA Feedback write setting
0x0d EXTWRITE Feedback write control
0x0e BGCOLOR Background color setting
0x40 CSR System status
0x41 IMR Interrupt mask control
0x44 BUSDIR Host interface bus switching
0x48 SIGLBLID Signal ID value read
© SCEI
-159-
SCE CONFIDENTIAL GS User's Manual Version 6.0
© SCEI
-160-
SCE CONFIDENTIAL GS User's Manual Version 6.0
The GS uses non-linear address conversion rules when converting from a two-dimensional address to a one-
dimensional physical memory address to improve the efficiency of memory access. This chapter describes the
address conversion rules.
© SCEI
-161-
SCE CONFIDENTIAL GS User's Manual Version 6.0
Page
Size: 8 Kbytes
FBP of FRAME (frame buffer) and ZBP of ZBUF (Z buffer) can point to page boundaries.
This is the same as a DRAM page. An access to a page does not result in a page break.
Block
Size: 256 bytes
TBP0 of TEX0 and TBPn of MIPTBP1/2 (texture buffer), and DBP and SBP of BITBLTBUF (destination
and source buffers during transmission between buffers) point to block boundaries.
Column
Size: 64 bytes (512 bits)
A column in a buffer is accessible in a single cycle.
Data can be read from and written to a column in the frame buffer and Z buffer in a single cycle (2048 bits
in total).
The relationships between page, block, and column are as follows from the point of view of memory
capacity:
Entire local memory = 512 pages = 16,384 blocks = 65,536 columns
1 page = 32 blocks
1 block = 4 columns
Each of page, block, and column corresponds to the pixels arranged in the form of a rectangle, in the two-
dimensional space in the buffer (i.e. when viewed as a drawn image or a texture image). The width and
height of the rectangle vary according to the pixel storage format.
© SCEI
-162-
SCE CONFIDENTIAL GS User's Manual Version 6.0
y
0 1 2 3 4 cc 9
10 11 12 13 14 cc 19
20 21 cc
cc
Figure 8-1 Page Arrangement Order in Buffer
© SCEI
-163-
SCE CONFIDENTIAL GS User's Manual Version 6.0
8.3.1. PSMCT32/PSMCT24/PSMZ32/PSMZ24
Column Configuration in
a Block 8 pixels
COLUMN 0 2 pixels
COLUMN 1
8 pixels
COLUMN 2
2 3 6 7 10 11 14 15
PSMT8H, PSMT4HH, and PSMT4HL have the same data structure as PSMCT32. Effective pixel data is put
in the position of bits 31 to 24, 31 to 27, and 27 to 24 respectively.
© SCEI
-164-
SCE CONFIDENTIAL GS User's Manual Version 6.0
8.3.2. PSMCT16/PSMCT16S
PSMCT16 PSMZ16
64 pixels 64 pixels
0 2 8 10 24 26 16 18
1 3 9 11 25 27 17 19
4 6 12 14 28 30 20 22
5 7 13 15 29 31 21 23
16 18 24 26 8 10 0 2
17 19 25 27 9 11 1 3
20 22 28 30 12 14 4 6
21 23 29 31 13 15 5 7
PSMCT16S PSMZ16S
64 pixels 64 pixels
0 2 16 18 24 26 8 10
1 3 17 19 25 27 9 11
8 10 24 26 16 18 0 2
9 11 25 27 17 19 1 3
4 6 20 22 28 30 12 14
5 7 21 23 29 31 13 15
12 14 28 30 20 22 4 6
13 15 29 31 21 23 5 7
COLUMN 0 2 pixels
COLUMN 1
8 pixels
© SCEI
-165-
SCE CONFIDENTIAL GS User's Manual Version 6.0
Pixel Arrangement Order in a Column (Numbers in the figure show 32-bit word addresses.)
0 1 4 5 8 9 12 13 0 1 4 5 8 9 12 13
2 3 6 7 10 11 14 15 2 3 6 7 10 11 14 15
8.3.3. PSMT8
0 1 4 5 16 17 20 21
2 3 6 7 18 19 22 23
8 9 12 13 24 25 28 29
10 11 14 15 26 27 30 31
COLUMN 0 4 pixels
COLUMN 1
16 pixels
COLUMN 2
COLUMN 3
© SCEI
-166-
SCE CONFIDENTIAL GS User's Manual Version 6.0
Pixel Arrangement Order in a Column (Numbers in the figures show 32-bit word addresses.)
Pixel arrangement order varies according to the column number in PSMT8.
COLUMNS 0 and 2
Bits 0-7 Bits 16-23
0 1 4 5 8 9 12 13 0 1 4 5 8 9 12 13
2 3 6 7 10 11 14 15 2 3 6 7 10 11 14 15
8 9 12 13 0 1 4 5 8 9 12 13 0 1 4 5
10 11 14 15 2 3 6 7 10 11 14 15 2 3 6 7
COLUMNS 1 and 3
Bits 0-7 Bits 16-23
8 9 12 13 0 1 4 5 8 9 12 13 0 1 4 5
10 11 14 15 2 3 6 7 10 11 14 15 2 3 6 7
0 1 4 5 8 9 12 13 0 1 4 5 8 9 12 13
2 3 6 7 10 11 14 15 2 3 6 7 10 11 14 15
© SCEI
-167-
SCE CONFIDENTIAL GS User's Manual Version 6.0
8.3.4. PSMT4
0 2 8 10
1 3 9 11
4 6 12 14
5 7 13 15
16 18 24 26
17 19 25 27
20 22 28 30
21 23 29 31
4 pixels
COLUMN 0
COLUMN 1
16 pixels
COLUMN 2
COLUMN 3
© SCEI
-168-
SCE CONFIDENTIAL GS User's Manual Version 6.0
Pixel Arrangement Order in a Column (Numbers in the figures show 32-bit word addresses.)
Pixel arrangement order varies according to the column number in PSMT4.
COLUMNS 0 and 2
Bits 0-3 Bits 8-11 Bits 16-19 Bits 24-27
0 1 4 5 8 9 12 13 0 1 4 5 8 9 12 13 0 1 4 5 8 9 12 13 0 1 4 5 8 9 12 13
2 3 6 7 10 11 14 15 2 3 6 7 10 11 14 15 2 3 6 7 10 11 14 15 2 3 6 7 10 11 14 15
8 9 12 13 0 1 4 5 8 9 12 13 0 1 4 5 8 9 12 13 0 1 4 5 8 9 12 13 0 1 4 5
10 11 14 15 2 3 6 7 10 11 14 15 2 3 6 7 10 11 14 15 2 3 6 7 10 11 14 15 2 3 6 7
COLUMNS 1 and 3
Bits 0-3 Bits 8-11 Bits 16-19 Bits 24-27
8 9 12 13 0 1 4 5 8 9 12 13 0 1 4 5 8 9 12 13 0 1 4 5 8 9 12 13 0 1 4 5
10 11 14 15 2 3 6 7 10 11 14 15 2 3 6 7 10 11 14 15 2 3 6 7 10 11 14 15 2 3 6 7
0 1 4 5 8 9 12 13 0 1 4 5 8 9 12 13 0 1 4 5 8 9 12 13 0 1 4 5 8 9 12 13
2 3 6 7 10 11 14 15 2 3 6 7 10 11 14 15 2 3 6 7 10 11 14 15 2 3 6 7 10 11 14 15
© SCEI
-169-
SCE CONFIDENTIAL GS User's Manual Version 6.0
2 3 6 7 18 19 22 23 2 3 6 7 18 19 22 23
8 9 12 13 24 25 28 29 8 9 12 13 24 25 28 29
10 11 14 15 26 27 30 31 10 11 14 15 26 27 30 31
2 3 6 7 18 19 22 23 2 3 6 7 18 19 22 23
8 9 12 13 24 25 28 29 8 9 12 13 24 25 28 29
10 11 14 15 26 27 30 31 10 11 14 15 26 27 30 31
© SCEI
-170-
SCE CONFIDENTIAL GS User's Manual Version 6.0
64 pixels
1 2 5 6 17 18 21 22 1 2 5 6 17 18 21 22
3 4 7 8 19 20 23 24 3 4 7 8 19 20 23 24
9 10 13 14 25 26 29 30 9 10 13 14 25 26 29 30
11 12 15 16 27 28 31 0 11 12 15 16 27 28 31 0
64 pixels
9 10 13 14 25 26 29 30 9 10 13 14 25 26 29 30
11 12 15 16 27 28 31 0 11 12 15 16 27 28 31 0
17 18 21 22 1 2 5 6 17 18 21 22 1 2 5 6
19 20 23 24 3 4 7 8 19 20 23 24 3 4 7 8
© SCEI
-171-
SCE CONFIDENTIAL GS User's Manual Version 6.0
1-column PSMT4 Data (Pixel numbers in the figure are arranged in scan line order.)
32 pixels
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127
I J K L M N O P
© SCEI
-172-
SCE CONFIDENTIAL GS User's Manual Version 6.0
A 92 24 84 16 76 88 68 00 A
88 28 80 20 72 12 64 4
B 93 25 85 17 77 99 69 11 B
89 29 81 21 73 13 65 5
C 94 26 86 18 78 10 70 22 C
90 30 82 22 74 14 66 6
D 95 27 87 19 79 11 71 33 D
91 31 83 23 75 15 67 7
E 88 28 80 20 72 12 64 44 E
92 24 84 16 76 8 68 0
F 89 29 81 21 73 13 65 55 F
93 25 85 17 77 9 69 1
G 90 30 82 22 74 14 66 66 G
94 26 86 18 78 10 70 2
H 91 31 83 23 75 15 67 77 H
95 27 87 19 79 11 71 3
I I
124
124 56 116
116 48 108
108 40 100
100 32 120 60 112 52 104 44 96 36
J J
125
125 57 117
117 49 109
109 41 101
101 33 121 61 113 53 105 45 97 37
K 102
102 K
126
126 58 118
118 50 110
110 42 34 122 62 114 54 106 46 98 38
L L
127
127 59 119
119 51 111
111 43 103
103 35 123 63 115 55 107 47 99 39
M M
120
120 60 112
112 52 104
104 44 96 36 124 56 116 48 108 40 100 32
N N
121
121 61 113
113 53 105
105 45 97 37 125 57 117 49 109 41 101 33
O O
122
122 62 114
114 54 106
106 46 98 38 126 58 118 50 110 42 102 34
P P
123
123 63 115
115 55 107
107 47 99 39 127 59 119 51 111 43 103 35
© SCEI
-173-
SCE CONFIDENTIAL GS User's Manual Version 6.0
8.6.2. PSMT8
The following is an example of converting 1-column PSMT8 data (16 x 4) to PSMCT32 (8 x 2).
1-column PSMT8 Data (Pixel numbers in the figure are arranged in scan line order.)
16 pixels
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
A B C D E F G H
I J K L M N O P
A 44 8 36 0 A 40 12 32 4
B 45 9 37 1 B 41 13 33 5
C 46 10 38 2 C 42 14 34 6
D 47 11 39 3 D 43 15 35 7
E 40 12 32 4 E 44 8 36 0
F 41 13 33 5 F 45 9 37 1
G 42 14 34 6 G 46 10 38 2
H H
43 15 35 7 47 11 39 3
I I
60 24 52 16 56 28 48 20
J J
61 25 53 17 57 29 49 21
K K
62 26 54 18 58 30 50 22
L L
63 27 55 19 59 31 51 23
M M
56 28 48 20 60 24 52 16
N N
57 29 49 21 61 25 53 17
O O
58 30 50 22 62 26 54 18
P P
59 31 51 23 63 27 55 19
© SCEI
-174-
SCE CONFIDENTIAL GS User's Manual Version 6.0
8.6.3. PSMT16
The following is an example of converting 1-column PSMT16 data (16 x 2) to PSMCT32 (8 x 2).
1-column PSMT16 Data (Pixel numbers in the figure are arranged in scan line order.)
16 pixels
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
I J K L M N O P
A 8 0
B 9 1
C 10 2
D 11 3
E 12 4
F 13 5
G 14 6
H 15 7
I 24 16
J 25 17
K 26 18
L 27 19
M 28 20
N 29 21
O 30 22
P 31 23
© SCEI
-175-
SCE CONFIDENTIAL GS User's Manual Version 6.0
© SCEI
-176-