FAQProgram in general
BackForward
FAQ / Program in general

VDP



I want to put a sprite between BGs.

Q)
I would like to sandwich a sprite (16/256 colors) between four 256-color BGs. How can I freely sandwich one part of the sprites between the BGs instead of all of them?

It seems that there are 8 priority registers (25f800f0 to fc), but I don't know how to do it because there is no priority or type setting in the sprite command table.

A)
With palette-style sprites, you can use up to eight priorities at the same time.

To specify the priority register to be referenced for each sprite, use the priority bit in the color control word of the VDP1 command table.

Note that which bit in the color control word corresponds to the priority bit depends on the sprite type used.

For more information, see the Sprite Data section of the VDP2 manual.


The aspect looks the same for 320x224 and 320x240.

Q)
In the screen mode, the resolution 352x240 pixel mode cannot be displayed because the resolution is insufficient on a normal TV monitor, but when comparing the resolution 320x240 and the resolution 320x224 on a normal TV monitor, the resolution is just shifted. Does not seem to have changed, what does that mean?

A)
Basically, when the vertical resolution is 224 and 240, the aspect ratio of the screen does not change.
(Pixel aspect does not depend on vertical resolution.)


About screen mode aspect ratio.

Q)
In the experiment, the aspect ratio was the same between 320x224 and 320x240. Is there a mode that achieves a dot ratio of 1: 1 in Sega Saturn?

A)
The aspect ratio of each graphic mode is as follows. (Note that the aspect ratio depends only on the horizontal resolution and not on the vertical resolution.)

Screen display mode Aspect ratio (vertical: horizontal)
NTSC PAL
Normal graphic mode A (horizontal resolution 320 dots) 1: 0.90 1: 1.10
Normal graphic mode B (horizontal resolution 352 dots) 1: 0.86 1: 0.96
High resolution graphic mode A (horizontal resolution 640 dots) 1: 0.45 1: 0.55
High resolution graphic mode B (horizontal resolution 704 dots) 1: 0.43 1: 0.48
Monitor graphic mode (horizontal resolution 640 dots) 1: 0.90
High-definition graphic mode (horizontal resolution 704 dots) 1: 1.10
There is no screen mode with a 1: 1 aspect ratio.
If you want to accurately display an image written in a 1: 1 aspect, you can make it look like it by using, for example, a forcible but magnifying function.
(It's not the ultimate solution, though.)


Is it possible to output RGB code and palette code at the same time?

Q)
When drawing a sprite with VDP1, when transparent pixels are enabled in color mode 5 (RGB mode) and no color calculation (replace), pixels other than the transparent color code become transparent.

For example, if you draw a sprite that uses the VDP2 palette for a part of the texture with 8x8 dots as shown below (MSB = 1), the part using the palette will be treated as transparent (the sprite drawn under it). Can be seen).

FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF
FFFF 0001 0001 0001 0001 0001 0001 FFFF
FFFF 0001 0001 0001 0001 0001 0001 FFFF
FFFF 0001 0001 0001 0001 0001 0001 FFFF
FFFF 0001 0001 0001 0001 0001 0001 FFFF
FFFF 0001 0001 0001 0001 0001 0001 FFFF
FFFF 0001 0001 0001 0001 0001 0001 FFFF
FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF

Disabling transparent pixels will cause them to appear as intended, but of course transparency will not be available.
Is it not possible to draw data that uses the VDP2 palette in this mode?

A)
Palette code cannot be used in color mode 5 (RGB mode).
Color codes 0001 to 7FFE are prohibited.

reference
"Hardware Manual / VDP1 User's Manual" " 6.3 CMDP MOD → Color Mode "

In color mode 1 (color look-up table mode), RGB code and palette code can be mixed.


What is the difference between color look-up table (CLUT) mode and 16-color palette mode?

Q)
What is the difference between color look-up table (CLUT) mode and 16-color palette mode?

A)
Color mode 1 of VDP1 is the color look-up table (CLUT) mode.
The features of this color mode are as follows.

Whereas normal palette mode refers to the RGB code stored in VDP2's color RAM, this mode is characterized by storing a kind of palette table called a color lookup table in VDP1's VRAM.

When the RGB code is stored in the color lookup table, the color calculation function of VDP1 can be used in the same way as drawing in RGB mode.
(Translucent, Gulon, etc.)


Please tell me how to use the color lookup mode.

Q)
Please tell me how to use the color lookup mode.

A)
As you can see in the example of the question above, in color lookup mode, we will refer to the lookup table in VDP1 once, so we have to prepare this lookup table first.

You can put RGB code or color bank code in the look-up table. (It is possible that both are mixed.)

reference
"Hardware Manual / VDP1 User's Manual" " 5.2 Color Lookup Table ")

VDP1 writes the pixel value of the sprite to the framebuffer as it is in color bank mode or RGB mode, but writes the contents of this table as pixel value to the framebuffer in color lookup mode.

reference
"Hardware Manual / VDP1 User's Manual" " 6.4 CMD COLR (Color Control Word) "

If the color code of the lookup table is a color bank, the actual color specified by that bank is written in the color RAM of VDP2. The offset is at the beginning of the color RAM by default, and the boundary is in one color. (2 bytes for 1Word / Color, 4 bytes for 2Word / Color.)
If another color bank is specified, a bit for color calculation ratio, a bit for priority, and a bit for shadow can be added according to the sprite type.

reference
"Hardware Manual / VDP2 User's Manual" " 9.1 Sprite Data "


Can VDP1 be Lowreso and VDP2 be Hireso?

Q)
In Developper's Infomation STN-22
VDP1 is normal (320 dot)
VDP2 is hireso (640 dot)
Is written that it is possible, but is it correct to interpret that the frame buffer on the VDP1 side can be hireso only on the VDP2 side while keeping 16bit / pixel?
Also, in that case, I would like to know if there are any restrictions in the order of register settings.

A)
That's right.

To make this setting, the setting method in SBL is to execute the mode set function for each of VDP1 and VDP2. for example,

SPR_2SetTvMode (SPR_TV_NORMAL, SPR_TV_320x224, OFF);
SCL_SetDisplayMode (SCL_NON_INTER, SCL_224LINE, SCL_HIRESO_A);

And so on.
In SGL

slSetScrTVMode (TV_320x224);

* After making this setting, it is necessary to reset the cycle pattern.

slSetSprTVMode (TV_640x224);

And so on.
There are no particular restrictions on the setting order.


Is it possible to have a horizontal resolution of 256?

Q)
Is it possible to set a vertical resolution of 256 pixels?
If it is possible in terms of hardware, please tell me how to set it.

A)
It is possible in PAL mode. For the setting method, use the second argument of slInitSystem for SGL, and the SCL_SetDisplayMode and SPR_2SetTvMode functions for SBL to set the TV mode.


How can I display 32000 colors in 640x480 TV mode?

Q)
According to the Sega Saturn hardware overview, the scroll surface can display 16, 256, 2048, 32768, and 16.77 million colors, and multiple resolutions can be set, but with a display resolution of 640x480. Is it possible to display 32000 colors?
Isn't 512KB of VRAM out of memory?

A)
As you pointed out, you will run out of memory, but the bottom line is that you can do it using the cell format. There are 32000 color modes in the cell format.
If you use this to share cells, you can fit it in 512KB of VRAM.

If the image is compressed using vertical cell scrolling and line scrolling (Developpers Information STN-14,), the part that overflows VRAM is displayed repeatedly from the beginning of VRAM. (There are no hardware restrictions.)


When using ColorRAM in 2048 color mode, the color code of the 2047th color cannot be used.

Q)
When color RAM is used in 2048 color mode, the color code of the 2047th color from the beginning cannot be used.

A)
The 2047th color of color RAM is used by the normal shadow function of VDP2, so it cannot be used by sprites.
Please use another pallet number.
(This is a Sega Saturn specification.)


When I use a mesh, the screen bleeds.

Q)
I'm using a mesh for sprites now, and the mesh part turns rainbow-colored. Is there any way to avoid this?

A)
Maybe it's because the number of dots next to the screen mode is 320 dots.
I think that the rainbow occurs because the horizontal frequency of NTSC and the period of the dots are different, causing interference fringes.
To avoid this, try using the mode with a horizontal resolution of 352 dots.


If you change the horizontal resolution, noise will run on the screen.

Q)
When I change the resolution from 320 to 352 or from 352 to 320, the screen makes noise for a moment. Please tell me if there is a countermeasure.

A)
A29) No. The reason is that if you change the mode as described above, the operating clock of the system will change, and the TV sync signal will be out of order for a moment.

However, changing from 320 to 640 and from 352 to 704 is okay as long as the VRAM cycle pattern is set correctly.


When I change the horizontal resolution from 320 to 352, the display shifts to the left ...

Q)
When I change the resolution from 320 to 352, the display shifts to the left ...

A)
This is because the 352 mode has a larger horizontal display area than the 320 mode.

49.1682 μs 47.6295 μs = 1.5287 μs is the difference time.
If you convert this to 320 mode conversion

1.5278 μs / (1/6.7185MHz) = 10 dots

In other words, 352 dot mode is equivalent to 320 dot mode, which is 10 dots larger than the display area. The display image in this case is

352MODE = 5 + 320 + 5 MODE

As a result, it will be shifted to the left by 5 dots.
(Refer to the display image below for details)

(Display image)
   | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~ | ____ | H-Sync
   | ======= 63.5556us (NTSC) =============== |

 ● 320 Mode
   | _______ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ___________ |
     H-blank display 1280 CLK (47.6295us) H-blank
            0.1.2.3.4.5.6.7.8 ................. 319 dot
            012345678 ......................... 639 dot

 ● 352 Mode
   | _____ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ________ |
   H-blank display 1408 CLK (49.1682us) H-blank
         0.1.2.3.4.5.6 ..................... 351 dot
         012345678 ............................... 703 dot

What does it mean to be able to use NBG1 as an extended screen?

Q)
I heard that NBG1 of VDP2 can be used as an extended screen. What does that mean?

A)
Currently, the one used as an extended screen is a movie card.
This extended screen is provided to set another screen that is not on the Sega Saturn main unit instead of the scroll surface (NBG1).
Naturally, the movie card (MPEG screen) and NBG1 cannot be used at the same time.


How to display RBG in high resolution?

Q)
I am trying to display RBG0 in high resolution, but what was displayed in low resolution is not displayed in high resolution.

A)
If it happens only by changing the resolution register (25F80000H) from high resolution to low resolution, there may be screens other than RBG0 that are trying to be displayed at the same time.

When changing from low resolution to high resolution, the most important thing to pay attention to is
The effective range of the cycle pattern register changes as follows.

Low resolution: T0 to T7 → High resolution: T0 to T3

This is not directly related to RBG0, but it has a significant effect on normal scrolling.
In other words, if T4 to T7 are set to read the normal scroll data, the normal scroll will not be displayed correctly when switching to high resolution.


Can you do Gulon with high resolution?

Q)
Is the Gouraud shading table inaccessible on the hardware side when using high resolution?

A)
Basically, high resolution + gourd is NG. However, if you make such a specification hardware, the hardware will work.

When the hardware is specified by Gouraud, it writes only the lower 8 bits to the frame buffer while interpolating for each RGB with 16 bits.
So there are only 256 colors in the framebuffer, but you can also googlow there using techniques.

The lower 8 Bit of 16Bit RBG = R 5Bit + G 3 Bit. The data interpolated by the hardware appears in this bit, so if you write the data for Gouraud in the VDP2 color palette (256 entries), the Gouraud within 256 colors will be displayed on the screen.

* However, this method is not recommended because it is difficult to manage the color RAM.


Is it possible to rotate only two axes when using RBG0 and RBG1?

Q)
If RBG0 and RBG1 are used at the same time, can RBG0 only rotate in two axes because the bank for the coefficient table cannot be secured?

A)
When displaying RBG0,1 at the same time, if RBG0 is a bitmap, the coefficient table can be stored in the remaining VRAM bank and the coefficient can be used dot by dot.

Even if RBG0 is in cell format, the coefficient table can be used dot by dot on the color RAM side.


BackForward
FAQProgram in general
Copyright SEGA ENTERPRISES, LTD ,. 1997