Return to previous page | Return to menu | Go to next page


Scroll data storage in VRAM

VRAM is a general term for the data area for storing graphic data such as scrolls. In SGL, VRAM is divided into four parts. The areas are called VRAM-A0, A1, B0, and B1, and various data related to scrolling are stored in these four data areas called banks. Since Sega Saturn's VRAM capacity is 4M bits, the VRAM capacity for each bank unit is 1M bits.
Actual drawing is performed by accessing these four data areas and reading the scroll data. The figure below shows the VRAM address.

Figure 8-5 VRAM address map

In SGL, scroll information is actually drawn on the screen by storing the scroll information in these four VRAM banks and calling them as necessary.
In the sample program, this data storage work is performed by two functions (registered in the program) called “Cel2VRAM” and “Map2VRAM”.
This function is not supported as a library function.

[void Cel2VRAM (cel_adr, VRAM_adr, chara_size);]
Stores character pattern data in VRAM.
For the parameter, substitute the start address of the memory that currently stores the character pattern, the start address of the VRAM that stores the character pattern data, and the number of character patterns.
[void Map2VRAM (pat_adr, VRAM_adr, mapY, mapX, pal_off, map_off);]
The pattern name data is stored in VRAM.
The parameters include the start address of the memory that currently stores the pattern name table, the start address of the VRAM that stores the pattern name data, the vertical and horizontal size of the map in cell units, the offset value of the color palette to be used next, and finally Substitute the map data offset value.

Return to previous page | Return to menu | Go to next page