Japanese
HARDWARE ManualVDP2 User's ManualChapter 5 Normal scroll screen
BackForward
VDP2 User's Manual/Chapter 5 Normal scroll screen

■5.2 Scaling function

NBG0, NBG1 can scale the entire screen horizontally and vertically. Scaling is controlled by specifying in registers the horizontal and vertical coordinate increments required to calculate display coordinates.
When scaling down horizontally, you must set the scaling enable register, and some screens may not be able to be displayed depending on this setting.
Display coordinates are calculated using the following formula: At this time, the decimal part of the calculation result is truncated.

(Display coordinate value X) = (Coordinate increment X) × (H counter value) + (Screen scroll value X)

(Display coordinate value Y) = (Coordinate increment Y) × (V counter value) + (Screen scroll value Y)

Screen scaling is controlled by setting horizontal and vertical coordinate increments in the coordinate increment registers. Specify the horizontal coordinate increment using the horizontal coordinate increment integer bit and horizontal coordinate increment fraction bit, and specify the horizontal coordinate increment using the vertical coordinate increment integer bit and horizontal coordinate increment fraction bit.
Fractional bits are added immediately below the integer bits. Figure 5.2 shows the bit configuration.

Figure 5.2 Configuration of coordinate increment register
●Horizontal and vertical coordinate increment registers 
Bit 
31                        18  16 15          8 7             0
┌─┬─┬─┬─┬─┰─┬─┬─┬─┬─┬─┬─┬─┰─┬─┬─┰─┬─┬─┬─┬─┬─┬─┰─┬─┬─┬─┬─┬─┬─┬─┐
│−│−│−│−│−┃−│−│−│−│−│−│−│−┃ │ │ ┃ │ │ │ │ │ │ ┃−│−│−│−│−│−│−│−│
└─┴─┴─┴─┴─┸─┴─┴─┴─┴─┴─┴─┴─┸─┴─┴─┸─┴─┴─┴─┴─┴─┴─┸─┴─┴─┴─┴─┴─┴─┴─┘
                           └───┘ └───────────┘                 
                    Integer part  Decimal part 


●Coordinate increment register

The coordinate increment register specifies the coordinate increment when calculating scroll screen coordinates. These are write-only 32-bit registers located at addresses 180078H to 18007EH and 180088H to 18008EH. The value is cleared to 0 after power-on or reset, so be sure to set it.

ZMXIN0 180078H
   15   
   14   
   13   
   12   
   11   
   10   
   09   
   08   
 -
 -
 -
 -
 -
 -
 -
 -

   07   
   06   
   05   
   04   
   03   
   02   
   01   
   00   
 -
 -
 -
 -
 -
 N0ZMXI2
 N0ZMXI1
 N0ZMXI0 

ZMXDN0 18007AH
   15   
   14   
   13   
   12   
   11   
   10   
   09   
   08   
 N0ZMXD1
 N0ZMXD2
 N0ZMXD3
 N0ZMXD4
 N0ZMXD5
 N0ZMXD6
 N0ZMXD7
 N0ZMXD8

   07   
   06   
   05   
   04   
   03   
   02   
   01   
   00   
 -
 -
 -
 -
 -
 -
 -
 - 

ZMYIN0 18007CH
   15   
   14   
   13   
   12   
   11   
   10   
   09   
   08   
 -
 -
 -
 -
 -
 -
 -
 -

   07   
   06   
   05   
   04   
   03   
   02   
   01   
   00   
 -
 -
 -
 -
 -
 N0ZMYI2
 N0ZMYI1
 N0ZMYI0 

ZMYDN0 18007EH
   15   
   14   
   13   
   12   
   11   
   10   
   09   
   08   
 N0ZMYD1
 N0ZMYD2
 N0ZMYD3
 N0ZMYD4
 N0ZMYD5
 N0ZMYD6
 N0ZMYD7
 N0ZMYD8

   07   
   06   
   05   
   04   
   03   
   02   
   01   
   00   
 -
 -
 -
 -
 -
 -
 -
 - 

ZMXIN1 180088H
   15   
   14   
   13   
   12   
   11   
   10   
   09   
   08   
 -
 -
 -
 -
 -
 -
 -
 -

   07   
   06   
   05   
   04   
   03   
   02   
   01   
   00   
 -
 -
 -
 -
 -
 N1ZMXI2
 N1ZMXI1
 N1ZMXI0 

ZMXDN1 18008AH
   15   
   14   
   13   
   12   
   11   
   10   
   09   
   08   
 N1ZMXD1
 N1ZMXD2
 N1ZMXD3
 N1ZMXD4
 N1ZMXD5
 N1ZMXD6
 N1ZMXD7
 N1ZMXD8

   07   
   06   
   05   
   04   
   03   
   02   
   01   
   00   
 -
 -
 -
 -
 -
 -
 -
 - 

ZMYIN1 18008CH
   15   
   14   
   13   
   12   
   11   
   10   
   09   
   08   
 -
 -
 -
 -
 -
 -
 -
 -

   07   
   06   
   05   
   04   
   03   
   02   
   01   
   00   
 -
 -
 -
 -
 -
 N1ZMYI2
 N1ZMYI1
 N1ZMYI0 

ZMYDN1 18008EH
   15   
   14   
   13   
   12   
   11   
   10   
   09   
   08   
 N1ZMYD1
 N1ZMYD2
 N1ZMYD3
 N1ZMYD4
 N1ZMYD5
 N1ZMYD6
 N1ZMYD7
 N1ZMYD8

   07   
   06   
   05   
   04   
   03   
   02   
   01   
   00   
 -
 -
 -
 -
 -
 -
 -
 -

    

Coordinate increment bit : Zoom bit
(N0ZMXI2~N0ZMXI0, N0ZMXD1~N0ZMXD8, N0ZMYI2~N0ZMYI0, N0ZMYD1~N0ZMYD8, N1ZMXI2~N1ZMXI0, N1ZMXD1~N1ZMXD8, N1ZMYI2~N1ZMYI0, N1ZMYD1~N1ZMYD8) When scaling each normal scroll screen calculate the display coordinates in Specify the horizontal and vertical coordinate increments for.

N0ZMXI2〜N0ZMXI0 180078H bits 2-0 NBG0 for horizontal direction (integer part)
N0ZMXD1~N0ZMXD8 18007AH bits 15-8 NBG0 for horizontal direction (decimal part)
N0ZMYI2〜N0ZMYI0 18007CH bits 2-0 NBG0 for vertical direction (integer part)
N0ZMYD1~N0ZMYD8 18007EH bits 15-8 NBG0 for vertical direction (decimal part)
N1ZMXI2~N1ZMXI0 180088H bits 2-0 NBG1 for horizontal direction (integer part)
N1ZMXD1~N1ZMXD8 18008AH bits 15-8 NBG1 for horizontal direction (decimal part)
N1ZMYI2〜N1ZMYI0 18008CH bits 2-0 NBG1 for vertical direction (integer part)
N1ZMYD1〜N1ZMYD8 18008EH bits 15-8 NBG1 for vertical direction (decimal part)

To enlarge the display, set the coordinate increment to a value less than 1. To display the reduced display, set the coordinate increment to a value greater than 1. When the coordinate increment is 1, the display is normal. All specifications must be positive values. The coordinate increment of NBG2 and NBG3 is fixed to 1.
You can also change the coordinate increment value from the middle of the screen by changing the value during the horizontal retrace period.
If you want to reduce the display in the horizontal direction, you need to set the reduction enable register. Do not set the horizontal coordinate increment to a value outside the range determined by the setting of the shrink enable bit. The horizontal coordinate increment and reduction settings are shown in Table 5.1.

Table 5.1 Horizontal coordinate increment and reduction settings
Horizontal zoom setting Horizontal coordinate increment setting range
Not possible 0≦(horizontal coordinate increment)≦1
Possible up to 1/2 0≦(horizontal coordinate increment)≦2
Possible up to 1/4 0≦(horizontal coordinate increment)≦4

●Reduction enable register

The zoom-out enable register controls horizontal zoom-out. This is a 16-bit write-only register located at address 180098H. The value is cleared to 0 after power-on or reset, so be sure to set it.

ZMCTL 180098H
   15   
   14   
   13   
   12   
   11   
   10   
   09   
   08   
 -
 -
 -
 -
 -
 -
 N1ZMQT
 N1ZMHF

   07   
   06   
   05   
   04   
   03   
   02   
   01   
   00   
 -
 -
 -
 -
 -
 -
 N0ZMQT
 N0ZMHF

    
Reduction enable bit : Zoom quarter/half bit (N1ZMQT, N1ZMHF, N0ZMQT, N0ZMHF)
Specify the maximum horizontal reducible range of each normal scroll screen.

N0ZMHF 180098H bit 0 For NBG0
N0ZMQT 180098H bit 1 For NBG0
N1ZMHF 180098H bit 8 For NBG1
N1ZMQT 180098H bit 9 For NBG1

NxZMQT NxZMHF Horizontal zoom out Limitations
 0
 0
Not possible none
 0
 1
Possible up to 1/2 Can only be set when the number of character colors is 16 or 256 colors
 1
 0
Possible up to 1/4 Can only be set when the number of character colors is 16.
 1
 1
Possible up to 1/4 Can only be set when the number of character colors is 16.
[Note] 0 or 1 is entered for x in the bit name.

To reduce to 1/2, set the number of character colors (number of bitmap pattern colors) of the corresponding screen to 16 colors or 256 colors. For reduction to 1/4, set to 16 colors.
Make sure that the horizontal coordinate increment does not exceed the setting range of these bits.

Some screens may not be able to be displayed depending on the reduction settings. The limitations are shown in Table 5.2.

Table 5.2 Display screen limitations by setting the reduction enable bit
screen Number of character colors (bits)
number of map pattern colors)
Reduce enable setting Screen that cannot be displayed
NBG0 16 colors Possible up to 1/2 none
Possible up to 1/4 NBG2
256 colors Possible up to 1/2 NBG2
NBG1 16 colors Possible up to 1/2 none
Possible up to 1/4 NBG3
256 colors Possible up to 1/2 NBG3


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