If you go through the N64 Kantan Manual or the Programming Manual, you will see the abbreviations RSP and RDP come up all the time. These are processors. Leaving out the architectural details, think of them in the following way:
RSP --- Graphics construction and audio
RDP --- Graphics rendering
The important thing to realize is that the N64 has processors for graphics and audio that exist separately from the main CPU performing general computations.
A variety of functions have been prepared for the N64 that are designed to make efficient use of these processors. The programmer combines these various function calls to compose an N64 program.
However, in N64 programming, you cannot make practical use of the functionality of the hardware by simply calling the library functions. This is where the display list becomes important.
Think of the display list as an instruction booklet for the RSP and the RDP. Instead of "calling the function directly," you "specify what function to call" and the processor executes the work you want done.
Figure 3-1 Conceptualized Display List
In N64 programming language, functions are often called commands, not "functions." Therefore, the display list, with list of commands, is sometimes called the command list.
The command list is processed by a program called the microcode, which is loaded into the RSP for execution. There are various kinds of microcode, such as microcode to playback audio and microcode to display sprites, and a variety of ways to use them. This all may seem confusing to some readers at this point. Microcode will be explained later, but at this point keep these terms in mind.
In C language terminology, the commands in the display list are implemented as macros. In other words, commands are fundamentally different from functions and function pointers. They are ultimately expanded to simple 64-bit constants (type Gfx), so they can be stored as the elements of an array.
Since commands are macros, all command definitions are located in the header file. If you want to know more about this, take at look at the header file
There are two broad kinds of display lists: static and dynamic. This subject will be brought up again in a later section.
Next, we will move to an explanation of what specifically a display list is, using the sample program basic3 for our comparisons. First, take a look at graphic.c. The two arrays rspinit_dl and rdpinit_dl have been defined there.
|List 3-1 See basic3 "graphic.c"|
You can deduce what these arrays are based on their names. The first is the display list for initializing the RSP, and the second is the display list for initializing the RDP. The elements like "gsSPViewport(&viewport)" in the display lists are the commands.
We previously compared the display list to a function call. In a function call, the desired computation is performed at the time the function is called. The situation is different for the display list. If all you do is create the display list (i.e., write the instruction booklet), no computations will be executed. You must also pass the display list for execution. In the N64 vocabulary, the display list is passed to a "task." Tasks will be explained later. First we will go over the basic knowledge needed to construct the display list.