30.1 Introduction

This chapter gives a detailed description of the video interface assembly. The video interface for the N64 platform provides numerous hardware functions. The purpose of this chapter is to give you a good understanding of these various functions so that you can use them appropriately as needed.

UP


30.1.1 What is a Video Interface (VI)?

The video interface performs the following functions.

Note: The video DAC creates analog data from digital data and outputs said data as a television video image.

UP


30.1.2 What is the VI Manager?

Usually, video output must be sent as a signal that is based on television standards. In addition, noise can appear on the television screen when the display timing suddenly changes or when the frame buffer changes during the display period. Synchronization with V-blanking (the vertical retrace interval) and adding changes usually prevents this noise. The VI Manager controls this.

The VI Manager also manages the timer processing and uses messages to notify the application of the V-blanking timing as events.

Separate frame buffers usually are provided for display and for rendering (drawing) to eliminate noise on the screen caused by rendering during display.

An outline of this procedure is shown below.

  1. The application renders in the frame buffer not currently being displayed.
  2. After the RDP completes rendering, the application sends the address of that frame buffer over to the VI Manager.
  3. The VI Manager refreshes the display frame buffer in synch with the next V-blank.
  4. The application uses flags, etc. to replace the display and rendering frame buffers.
  5. The procedure is repeated starting from 1.

Sample Initialization Procedure (other initializations are actually necessary)

Initialization Procedure

Note: See Section 4.2.9 "VI Manager" for details about the VI Manager.

UP


30.1.3 What is the Display Mode?

The display mode consists of various combinations of 5 flags: NTSC/PAL (FPAL)/MPAL format, high/low-resolution, anti-aliasing/point sampling, interlaced/non-interlaced mode, and 16/32-bit color pixel.

Table 30-1 Display Mode Flags
Flag 1NTSC format
PAL format
MPAL format
FPAL (Full-screen PAL) format
Flag 2H = High-resolution
L = Low-resolution
Flag 3A = Anti-aliasing
P = Point sampling
Flag 4
Low-resolutionN = Non-interlaced
F = Interlaced
High-resolutionN = Normal interlacing
F = Deflickered interlacing
Flag 51 = 16-bit pixel size
2 = 32-bit pixel size

See osViSetMode in the Function Reference for details on how to use these flags.

UP


30.1.3.1 Supported Television System Formats

The N64 libraries are compatible with NTSC, PAL, and MPAL television system formats.

The television system format in Japan and North America, etc. is called the NTSC (National Television System Commission) format, which has 525 scan lines and a scanning frequency of 60Hz.

The PAL (Phase Alternation by Line) format is the television system format used in Europe (except for parts of France, etc.), Australia, and parts of Southeast Asia, and has 625 scan lines and a scanning frequency of 50Hz.

The MPAL (Phase Alternation by Line-M) format is the television system format for Brazil, and is the PAL format with 525 scan lines and a scanning frequency of 60Hz.

Refer to Programming Cautions, Section 5 "Video Mode".

Note: FPAL is an acronym for Full-screen PAL that is used in connection with the N64, and is not the name of a television system format.

UP


30.1.3.2 High-resolution/Low-resolution

With the exception of FPAL, low resolution displays at 320x240 dots (FPAL displays at 320x288 dots in low-resolution). High-resolution displays at 640x480 dots. Usually when creating games, low-resolution is used. The reasons for this are to speed up rendering (minimize the screen area that is drawn), and to reduce the amount of memory required.

The advantages of high resolution are that jagged edges (step-like noise) are less apparent due to the finer dot array, and that extremely intricate text and video images can be displayed. Deciding which to use should be determined after considering the characteristics of the game.

UP


30.1.3.3 Anti-aliasing/Point Sampling

Point sampling was used in previous display formats. However, when polygons are displayed at low-resolution, jagged edges are obvious in the outline. Anti-aliasing can be performed with the N64 to minimize this. This function is accomplished by pre-processing on the RDP and post-processing with the video interface.

If anti-aliasing is not performed with the video interface, the processing done with the RDP will have no effect. In addition, even if anti-aliasing is performed with the video interface, it will have no effect if it is not also done with the RDP.

UP


30.1.3.4 Non-interlaced/Interlaced

When the normal television system format is NTSC, a frame is expressed in approximately 1/30-second. In this situation, one frame is divided into odd-numbered fields and even-numbered fields, which are not displayed at the same time, but are displayed respectively in alternating 1/60-second intervals. This is referred to as interlaced display. There is a great deal of flicker when interlaced display is used. Since there are many cases in which low-resolution is used with the N64, non-interlaced display is used in which only the even-numbered fields are displayed. (However, it is possible to set the system to use interlaced display even at low-resolution.)

Since high-resolution doubles the number of lines displayed in low-resolution, only interlaced display can be used. If deflickered interlaced mode is used, the lines are averaged and displayed, making it possible to display video with minimal flicker. However, since the data for both (odd-numbered and even-numbered) fields are needed to display one field in this situation, multiple-buffer processing is required.

Note: Due to restrictions on the memory bandwidth when deflickered interlaced mode is used, there are cases in which noise will appear on the screen when there is frequent memory access to the same memory bank (1MB units) as that of the frame buffer during display. The various frame buffers and the Z-buffer need to be situated in separate memory banks. Also make sure not to situate the buffers used for DMA transfer (audio heap, etc.) in the same memory bank as the frame buffers.

Figure 30-1 Interlaced scanning and non-interlaced scanning
[Figure 30-1]

UP


30.1.3.5 16/32 Pixel Size

The expressive capacity of each pixel that displays a video image is stated as the number of bits of color in terms of pixels. 16-bit pixels use 5 bits each for the three RGB colors, while 32-bit pixels use 8 bits each. When this is expressed as gradations of white (excluding black), 16-bit pixels are capable of displaying up to 32 gradations, and 32-bit pixels are capable of displaying up to 255 gradations.

There is a great deal of difference between the two. Mach bands (stripe noise) will appear in areas in which there are subtle color changes when 16-bit pixels are used. Mach bands are almost completely unnoticeable with 32-bit pixels, but twice the amount of memory is used as with 16-bit pixels.

A dither filter is available with the N64 to make Mach bands less apparent with 16-bit pixels.

UP


30.1.4 Special Video Interface Functions

The N64 video interface has special features that are set with osViSetSpecialFeatures. Since these features are the final filters on the video image generated with the RDP, and have an effect on the entire screen, it is crucial that you accurately understand them.

Table 30-2 Flags for Special VI Features
Flag Description Default
OS_VI_GAMMA_ON
OS_VI_GAMMA_OFF
Gamma correction ON/OFF ON
OS_VI_GAMMA_DITHER_ON
OS_VI_GAMMA_DITHER_OFF
Gamma dither ON/OFF ON
OS_VI_DIVOT_ON
OS_VI_DIVOT_OFF
Divot ON/OFF ON
OS_VI_DITHER_FILTER_ON
OS_VI_DITHER_FILTER_OFF
Dither filter ON/OFF 16-bit: ON
32-bit: OFF

It is possible to use these constants as bit sums.

Note: If osViSetMode is called, these flags are reset to their default values. When the screen mode has been changed with osViSetMode, use osViSetSpecialFeatures to reset these flags.

UP


30.1.4.1 Gamma Correction (GAMMA)

Gamma correction performs corrections so that the luminance curve of the Braun tube is in a proportionate relationship with the luminance curve of the original video image. On the N64 as a default it is ON. Generally, since gamma correction is automatically added to the original video image output from CG Tools, etc., there are cases when the default is used and the image becomes entirely white due to the double correcting action. In this case, it is necessary either to not perform gamma correction on the original video image, or to turn the gamma correction OFF with osViSetSpecialFeatures.

UP


30.1.4.2 Gamma Dither (GAMMA DITHER)

Gamma dither is the function that performs gamma correction using a dither pattern. This feature is enabled when gamma correction is ON.

UP


30.1.4.3 Divot (DIVOT)

Divot is a filter for eliminating "divots" (single-pixel holes created when multiple boundary edges overlap in one pixel) in anti-aliased pixels. Since there are cases in which one-pixel holes will appear where polygons are connected together, etc. when this is turned OFF, as a rule, it should be ON when anti-aliasing is being performed. However, this correction is not a cure-all. There are cases in which "divots" cannot be eliminated.

UP


30.1.4.4 Dither Filter (DITHER FILTER)

Mach bands can be made less apparent on the N64 with a method of creating pseudo-intermediate gradations with the RDP (dithering). However, when this is done, a dither pattern "roughness" becomes apparent. To counter this a dither filter is used. Since the number of times that memory is accessed from the video interface increases when this filter is specified, there are cases in which the overall system performance will drop by as much as 1%.

Note: Dither filter combinations

Depending on the combination of the dither filter specified with gDPSetColorDither and the dither filter specified with osViSetSpecialFeatures, there are cases when there is an effect and some cases where there is very little.

When G_SHADING_SMOOTH has been specified with gSPSetGeometryMode, dithering will be effective, but there are instances in which it is better not to perform dithering when this mode has not been specified. In addition, the dithering effect will be different when the surface area of the polygon is large and when it is small. Specifically, the effects of dithering may not be noticeable when a lot of polygons with small surface area are used.

UP


30.1.4.5 Serrate (serrate)

Serrate are bits to absorb shifting between the even-numbered frames and odd-numbered frames when interlacing is performed. This is generally always ON when interlacing is used, and OFF when non-interlacing is specified. Since this setting is automatically made when the mode is selected with osViSetMode, there is no need for the user to do it.

UP


30.1.5 List of Video Interface Functions

UP