HARDWARE ManualVDP2 User's ManualChapter 15 How to use VDP2
BackForward
VDP2 User's Manual / Chapter 15 How to use VDP2

■ 15.2 How to use RAM

When using VDP2, define and set data in VRAM, color RAM, and registers.

● VRAM

The data defined in VRAM differs depending on the scroll screen used, screen format, screen size, and image processing function used. Define each data in VRAM according to the register settings, and set the defined addresses in the address register. Table 15.1 shows the main registers associated with the data defined in VRAM.

Table 15.1 Registers associated with the data defined in VRAM
 data
 What to define
 Related registers
 Data to set
 Pattern name table
 Start address of character pattern
 Pattern name control register
(Body / Reference)
・ Pattern name data size ・ Character number auxiliary mode ・ Pattern name auxiliary data
 Plain size register
(Body / Reference)
 -Plain size when displaying in cell format
 Normal scroll screen map register
(Body / Reference)
 -Start address of the pattern name table to be placed on each plane
 Rotation scroll screen map register
(Body / Reference)
 -Start address of the pattern name table to be placed on each plane
 Map offset register
(Body / Reference)
 -A 3-bit map offset value attached to the upper level of the map register
 Character pattern
 Cell dot data
Character control register
(Body / Reference)
・ Number of character colors and character size
 Bitmap pattern
 Bitmap pattern data
 Character control register
(Body / Reference)
 -Number of character colors (number of bitmap colors)
-Bitmap size-Bitmap enabled
 Map offset register
(Body / Reference)
 -Boundary address of bitmap pattern
 Line scroll table
 Horizontal and vertical screen scroll values,
Horizontal coordinate increment
 Line scroll table address register
(Body / Reference)
 -Start address of line scroll table
 Line & Vertical Cell Scroll Control Register
(Body / Reference)
 -Scroll function control data
 Vertical cell scroll table
 Vertical screen scroll value
 Vertical cell scroll table address register
(Body / Reference)
 -Start address of vertical cell scroll table
 Line & Vertical Cell Scroll Control Register
(Body / Reference)
 -Scroll function control data
 Rotation parameter table
 Rotation parameters,
Related registers in the coefficient table
RAM control register
(Body / Reference)
 -Purpose of using VRAM on the rotary scroll screen
 Rotation parameter table address register
(Body / Reference)
 -Starting address of parameter table
 Rotation parameter mode register
(Body / Reference)
 -Specify rotation parameter mode
 Coefficient table
 Coefficient table data (magnification / reduction coefficients kx, ky,
Start point coordinates after rotation conversion Xp)
 RAM control register
(Body / Reference)
 -Purpose of using VRAM on the rotary scroll screen
 Coefficient table control register
(Body / Reference)
・ Coefficient data mode ・ Data size of coefficient data ・ Coefficient table enabled
 Coefficient table address offset register
(Body / Reference)
 -Start address offset value of coefficient table
 Line color screen table
 Color RAM address
Line color screen table address register
(Body / Reference)
 -Color mode of line color screen-Start address of line color screen table
 Back screen table
 RGB color data
 Back screen table address register
(Body / Reference)
 -Back screen color mode-Back screen table start address
 Line window table
 Horizontal start point coordinates,
Horizontal end point coordinates
 Line window table address register
(Body / Reference)
 -Line window enable-Start address of line window table

● Definition of color RAM

Defines color data for palette-style sprites and scroll screens. The color data stored in the color RAM is in RGB format and has three modes. The mode selection is specified by the color RAM mode (CRMD1, CRMD0, bits 13, 12) of the RAM control register (18000EH).

The most significant bit of the color data stored in the color RAM is the enable bit when the special color calculation mode is mode 3. When the special color calculation mode is mode 3, the color format is palette format, and the color calculation enable bit is 1, color calculation is performed in dot units for dots using color data with the most significant bit of 1. increase.

● Reference to color RAM

Color RAM is referenced from character patterns, bitmap patterns, and line color screen table data. The color RAM address is represented by 11 bits. If the number of character colors or bitmap colors is 16, the upper 7-bit palette number is added to make it 11 bits, and if it is 256 colors, the upper 3 bit palette number is added to make it 11 bits. increase. The palette number of the character pattern is in the pattern name data and the auxiliary data of the pattern name control register, and the palette number of the bitmap pattern is in the bitmap palette number register.

● Register

Registers are, in principle, write-only 16-bit registers that specify VDP2 functionality. In some cases, one function spans several registers, and in other cases, several functions are grouped in one register.
Set the register corresponding to the function to be used as necessary.


BackForward
HARDWARE ManualVDP2 User's ManualChapter 15 How to use VDP2
Copyright SEGA ENTERPRISES, LTD., 1997