Japanese
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 a rotation scroll screen, be sure to store the rotation parameters that control it in VRAM as a table. The rotary scroll screen reads the rotation parameter table stored in VRAM line by line and displays the screen according to the values. Rotation parameters

Table 6.2 Rotation parameters
Rotation parameters Definition
Screen screen start coordinates Xst X coordinate of the upper left corner (or left edge*) of the screen
Yst Y coordinate of the upper left corner (or left edge*) of the screen
Zst Z coordinate of screen screen
Screen screen vertical coordinate increment △Xst X coordinate increment per line of screen screen coordinates
△Yst Y-coordinate increment per line of screen screen coordinates
Screen horizontal coordinate increment △X X coordinate increment per dot in screen screen coordinates
△Y Y-coordinate increment per dot in screen screen coordinates
rotation matrix parameters A 3x3 rotation matrix
ABC
DEF
GHI
Six matrix parameters A to F of
B
C
D
E
F
viewpoint coordinates Px Viewpoint X coordinate
Py View Y coordinate
Pz Z coordinate of viewpoint
center coordinates Cx X coordinate of center point
Cy Y coordinate of center point
Cz Z coordinate of center point
Parallel movement amount Mx Amount of parallel movement in the X direction of the screen screen, viewpoint, and center point
My Amount of parallel movement in the Y direction of the screen screen, viewpoint, and center point
scaling factor kx Scaling factor of the display screen in the X direction
ky Scaling factor in the Y direction of the display screen
Coefficient table start address KAst Starting the table when using coefficient tables
address
Coefficient table vertical direction
address increment
△KAst Address per line when using coefficient table
incremental
Coefficient table horizontal direction
address increment
△KAx Per-dot address when using coefficient table
incremental
[Note] * indicates when reading line by line.

Of the rotation parameters, only Xst, Yst, and KAst are usually read only on the first line of the display screen. When DXst, DYst, DX, DY, DKAst, and DKAx do not change within one screen, the values of Xst, Yst, and KAst are expressed by the following formulas.


(Screen screen X coordinate)
          = 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)

Also, by setting the rotation parameter read control register, Xst, Yst, and KAst can be read at lines other than the first line. When DXst, DYst, DX, DY, DKAst, and DKAx do not change within one screen, the values of Xst, Yst, and KAst from the second line onward are expressed by the following formula.


(Screen screen X coordinate)
          = Xst 
          + △Xst × {(V counter value) - (V counter value when reading Xst)}
          + △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". RBG1 screen display is performed by rotation parameter B. RBG0 allows you to specify which of the two parameter tables to use, and to switch between them on the display screen. This allows RBG0 to simultaneously display two different rotating scroll screens on one screen.
Also, the rotation parameter table works by simply storing only the rotation parameter table used by RBG0 and RBG1, rather than having to store two sets of rotation parameter tables at all times.

●Data structure of rotation parameter table

The bit configuration of each rotation parameter is shown below. Specify negative numbers as two's complement numbers. Bits in blank spaces are ignored.

Figure 6.2 Data structure of rotation parameters
●Screen screen start coordinates (Xst, Yst, Zst)
+0
 15
 14
 13
 12
 11
 10
 9
 8
 7
 6
 5
 4
 3
 2
 1
 0
sign Integer part 12 bits

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


●Screen screen vertical direction coordinate increment (ΔXst, ΔYst)
+0
 15
 14
 13
 12
 11
 10
 9
 8
 7
 6
 5
 4
 3
 2
 1
 0
sign integer part

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

●Screen horizontal coordinate increment (ΔX, ΔY)
+0
 15
 14
 13
 12
 11
 10
 9
 8
 7
 6
 5
 4
 3
 2
 1
 0
sign integer part

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

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

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

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

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

●Parallel movement amount (Mx, My)
+0
 15
 14
 13
 12
 11
 10
 9
 8
 7
 6
 5
 4
 3
 2
 1
 0
sign Integer part 13 bits

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

●Scaling coefficient (kx,ky)
+0
 15
 14
 13
 12
 11
 10
 9
 8
 7
 6
 5
 4
 3
 2
 1
 0
sign Integer part 7 bits

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

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

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

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

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

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

●Rotation parameter table

The rotation parameter table is stored in VRAM as one set of 60H tables. Figure 6.3 shows the structure of a set of tables.

Figure 6.3 Rotation parameter table
+00H
+02H
 Screen screen start coordinate Xst (integer part)
(Decimal part)
+04H
+06H
 Screen screen start coordinate Yst (integer part)
(Decimal part)
+08H
+0AH
 Screen screen start coordinate Zst (integer part)
(Decimal part)
+0CH
+0EH
 Screen vertical increment     ΔXst (integer part)
(Decimal part)
+10H
+12H
 Screen vertical increment     ΔYst (integer part)
(Decimal part)
+14H
+16H
 Screen horizontal increment   ΔX   (integer part)
(Decimal part)
+18H
+1AH
 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 coordinate  Cx              (integer part)
+3EH
 Center coordinate  Cy              (integer part)
+40H
 Center coordinate  Cz              (integer part)
+42H
 This data will be ignored
+44H
+46H
 Parallel movement amount  Mx       (integer part)
(Decimal part)
+48H
+4AH
 Parallel movement amount  My       (integer part)
(Decimal part)
+4CH
+4EH
 Scaling factor       kx            (integer part)
(Decimal part)
+50H
+52H
 Scaling coefficient  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 tables of rotation parameter A and rotation parameter B, store the table of rotation parameter A from the first address of the rotation parameter table, then insert 20H worth of invalid data and store the table of rotation parameter B. Store the table. Instead of always having to store two sets of rotation parameter tables, you can just store the tables you need. Figure 6.4 shows how to store two sets of tables: rotation parameter A and rotation parameter B.

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

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