HARDWARE ManualVDP2 User's ManualChapter 6 Rotating scroll screen
BackForward
VDP2 User's Manual / Chapter 6 Rotating Scroll Screen

■ 6.3 Rotation parameter control

When displaying the rotation scroll screen, be sure to store the rotation parameters that control it in VRAM as a table. The rotation scroll screen reads the rotation parameter table stored in VRAM for each line and displays the screen according to the value. Rotation parameters

Table 6.2 Rotation parameters
Rotation parameters Justice
Screen screen start coordinates Xst X coordinate of the upper left corner (or left edge *) of the screen screen
Yst Y coordinate of the upper left corner (or left edge *) of the screen screen
Zst Screen screen Z coordinate
Screen screen vertical coordinate increment △ Xst X coordinate increment per line of screen screen coordinates
△ Yst Y coordinate increment for each line of screen screen coordinates
Screen screen horizontal coordinate increment △ X X coordinate increment for each dot in screen screen coordinates
△ Y Y coordinate increment for each dot in screen screen coordinates
Rotation matrix parameters A 3x3 rotation matrix ABC
DEF
GHI
6 matrix parameters from A to F
B
C
D
E
F
Viewpoint coordinates Px X coordinate of viewpoint
Py Y coordinate of viewpoint
Pz Z coordinate of viewpoint
Center coordinates Cx X coordinate of center point
Cy Y coordinate of center point
Cz Z coordinate of the center point
Translation amount Mx Screen The amount of translation of the screen, viewpoint, and center point in the X direction
My Screen The amount of translation of the screen, viewpoint, and center point in the Y direction
Scale factor kx Enlargement / reduction coefficient in the X direction of the display screen
ky Enlargement / reduction coefficient in the Y direction of the display screen
Coefficient table start address KAst Table start address when using a coefficient table
Coefficient table vertical address increment △ KAst Address increment per line when using coefficient table
Coefficient table horizontal address increment △ KAx Address increment per dot when using coefficient table
[Note] * indicates that each line is read.

Of the rotation parameters, only Xst, Yst, and KAst are usually loaded only on the first line of the display screen. The values of Xst, Yst, and KAst when DXst, DYst, DX, DY, DKAst, and DKAx do not change in one screen are expressed by the following formula.


(Screen screen X coordinates)
          = Xst + △ Xst × (V counter value) + △ X × (H counter value)

(Screen screen Y coordinate)
          = Yst + △ Yst × (V counter value) + △ Y × (H counter value)

(Coefficient table address)
          = KAst + △ KAst × (V counter value) + △ KAx × (H counter value)

You can also read Xst, Yst, and KAst on lines other than the first line by setting the rotation parameter read control register. When DXst, DYst, DX, DY, DKAst, and DKAx do not change in one screen, the values of the second and subsequent lines of Xst, Yst, and KAst are expressed by the following formula.


(Screen screen X coordinates)
          = Xst 
          + △ Xst × {(V counter value)-(V counter value when Xst is read)}
          + △ X × (H counter value)

(Screen screen Y coordinate)
       = Yst
+ △ Yst × {(V counter value)-(V counter value when Yst is read)}
          + △ Y × (H counter value)

(Coefficient table address)
          = KAst
          + △ KAst × {(V counter value) − (V counter value when KAst is read)}
          + △ KAx × (H counter value)

The rotation scroll screen has two sets of parameter tables called "rotation parameter A" and "rotation parameter B". The screen display of RBG1 is done by rotation parameter B. RBG0 can specify which of the two sets of parameter tables to use, and can be switched in the display screen. This also allows RBG0 to display two different rotating scroll screens simultaneously on one screen.
Also, the rotation parameter table does not always have to store two sets of rotation parameter tables, it only works by storing only the rotation parameter tables used by RBG0 and RBG1.

● Data structure of rotation parameter table

The bit configuration of each rotation parameter is shown below. Negative numbers are specified in 2's complement. Bits in the blank are ignored.

Figure 6.2 Rotation parameter data structure
● Screen screen start coordinates (Xst, Yst, Zst)
+0
 15
 14
 13
 12
 11
 Ten
 9
 8
 7
 6
 5
 4
 3
 2
 1
 0
Code Integer part 12 bits

+2
 15
 14
 13
 12
 11
 Ten
 9
 8
 7
 6
 5
 4
 3
 2
 1
 0
Decimal part 10 bits


● Screen screen Vertical coordinate increment (ΔXst, ΔYst)
+0
 15
 14
 13
 12
 11
 Ten
 9
 8
 7
 6
 5
 4
 3
 2
 1
 0
Code Integer part

+2
 15
 14
 13
 12
 11
 Ten
 9
 8
 7
 6
 5
 4
 3
 2
 1
 0
Decimal part 10 bits

● Screen screen Horizontal coordinate increment (ΔX, ΔY)
+0
 15
 14
 13
 12
 11
 Ten
 9
 8
 7
 6
 5
 4
 3
 2
 1
 0
Code Integer part

+2
 15
 14
 13
 12
 11
 Ten
 9
 8
 7
 6
 5
 4
 3
 2
 1
 0
Decimal part 10 bits

● Rotation matrix parameters (A, B, C, D, E, F)
+0
 15
 14
 13
 12
 11
 Ten
 9
 8
 7
 6
 5
 4
 3
 2
 1
 0
Code Integer part

+2
 15
 14
 13
 12
 11
 Ten
 9
 8
 7
 6
 5
 4
 3
 2
 1
 0
Decimal part 10 bits

● Viewpoint coordinates (Px, Py, Pz)
+0
 15
 14
 13
 12
 11
 Ten
 9
 8
 7
 6
 5
 4
 3
 2
 1
 0
Code Integer part 13 bits

● Center coordinates (Cx, Cy, Cz)
+0
 15
 14
 13
 12
 11
 Ten
 9
 8
 7
 6
 5
 4
 3
 2
 1
 0
Code Integer part 13 bits

● Translation amount (Mx, My)
+0
 15
 14
 13
 12
 11
 Ten
 9
 8
 7
 6
 5
 4
 3
 2
 1
 0
Code Integer part 13 bits

+2
 15
 14
 13
 12
 11
 Ten
 9
 8
 7
 6
 5
 4
 3
 2
 1
 0
Decimal part 10 bits

● Scale factor (kx, ky)
+0
 15
 14
 13
 12
 11
 Ten
 9
 8
 7
 6
 5
 4
 3
 2
 1
 0
Code Integer part 7 bits

+2
 15
 14
 13
 12
 11
 Ten
 9
 8
 7
 6
 5
 4
 3
 2
 1
 0
Decimal part 16 bits

● Coefficient table start address (kAst)
+0
 15
 14
 13
 12
 11
 Ten
 9
 8
 7
 6
 5
 4
 3
 2
 1
 0
Integer part 16 bits

+2
 15
 14
 13
 12
 11
 Ten
 9
 8
 7
 6
 5
 4
 3
 2
 1
 0
Decimal part 10 bits

● Coefficient table Vertical address increment (ΔKAst)
+0
 15
 14
 13
 12
 11
 Ten
 9
 8
 7
 6
 5
 4
 3
 2
 1
 0
Code Integer part 9 bits

+2
 15
 14
 13
 12
 11
 Ten
 9
 8
 7
 6
 5
 4
 3
 2
 1
 0
Decimal part 10 bits

● Coefficient table Horizontal address increment (ΔKAx)
+0
 15
 14
 13
 12
 11
 Ten
 9
 8
 7
 6
 5
 4
 3
 2
 1
 0
Code Integer part 9 bits
+2
 15
 14
 13
 12
 11
 Ten
 9
 8
 7
 6
 5
 4
 3
 2
 1
 0
Decimal part 10 bits

● Rotation parameter table

The rotation parameter table is a table with a size of 60H and is stored in VRAM. The configuration of a set of tables is shown in Figure 6.3.

Figure 6.3 Rotation parameter table
+ 00H
+ 02H
Screen screen Start coordinates Xst (integer part)
(Decimal part)
+ 04H
+ 06H
Screen screen Start coordinates Yst (integer part)
(Decimal part)
+ 08H
+ 0AH
Screen screen Start coordinates Zst (integer part)
(Decimal part)
+ 0CH
+ 0EH
Screen screen Vertical increment ΔXst (integer part)
(Decimal part)
+ 10H
+ 12H
Screen screen Vertical increment ΔYst (integer part)
(Decimal part)
+ 14H
+ 16H
Screen screen Horizontal increment ΔX (integer part)
(Decimal part)
+ 18H
+ 1AH
Screen screen Horizontal increment ΔY (integer part)
(Decimal part)
+ 1CH
+ 1EH
Rotation matrix parameter A (integer part)
(Decimal part)
+ 20H
+ 22H
Rotation matrix parameter B (integer part)
(Decimal part)
+ 24H
+ 26H
Rotation matrix parameter C (integer part)
(Decimal part)
+ 28H
+ 2AH
Rotation matrix parameter D (integer part)
(Decimal part)
+ 2CH
+ 2EH
Rotation matrix parameter E (integer part)
(Decimal part)
+ 30H
+ 22H
Rotation matrix parameter F (integer part)
(Decimal part)
+ 34H Viewpoint coordinates Px (integer part)
+ 36H Viewpoint coordinates Py (integer part)
+ 38H Viewpoint coordinates Pz (integer part)
+ 3AH This data will be ignored
+ 3CH Center coordinates Cx (integer part)
+ 3EH Center coordinates Cy (integer part)
+ 40H Center coordinates Cz (integer part)
+ 42H This data will be ignored
+ 44H
+ 46H
Translation amount Mx (integer part)
(Decimal part)
+ 48H
+ 4AH
Translation amount My (integer part)
(Decimal part)
+ 4CH
+ 4EH
Scale factor kx (integer part)
(Decimal part)
+ 50H
+ 52H
Scale factor ky (integer part)
(Decimal part)
+ 54H
+ 56H
Coefficient table Start address KAst (integer part)
(Decimal part)
+ 58H
+ 5AH
Coefficient table Vertical address increment ΔKAst (integer part)
(Decimal part)
+ 5CH
+ 5EH
Coefficient table Horizontal address increment ΔKAx (integer part)
(Decimal part)

When storing two sets of tables of rotation parameter A and rotation parameter B, the table of rotation parameter A is stored from the start address of the rotation parameter table, and then invalid data for 20H is inserted to display rotation parameter B. Store the table. The rotation parameter table does not always have to store two sets, it only needs to store the required table. Figure 6.4 shows how to store two sets of tables, rotation parameter A and rotation parameter B.

Figure 6.4 How to store the rotation parameter table in VRAM
Start address of rotation parameter table 
│ 
└── → + 00H ┏━━━━━━━━━━━━━━━━┓
┃ ┃
┃ ┃
┃ ┃
┃ Rotation parameter A table ┃
┃ ┃
┃ ┃
+ 5EH ┃ ┃
+ 60H ┣━━━━━━━━━━━━━━━━┫
│ The data in this area is the rotation parameter │
Not used as + 7EH││
+ 80H ┣━━━━━━━━━━━━━━━━┫
┃ ┃
┃ ┃
┃ ┃
┃ Rotation parameter B table ┃
┃ ┃
┃ ┃
+ DEH ┃ ┃
+ E0H┣━━━━━━━━━━━━━━━━┫
┃ ┃

BackForward
HARDWARE Manual VDP2 User's ManualChapter 6 Rotating scroll screen
Copyright SEGA ENTERPRISES, LTD., 1997