1.3 Using the Sample Programs

The sample programs can be run after installation of the emulator board and software. Directories for the sample programs such as simple or onetri are located under /usr/src/PR/demos. To run the sample programs, run "make" with each directory and enter "gload". Some of the functions and features of the sample programs are explained below. For a complete description of the features of each sample program, please review its accompanying README.

Analyzing and understanding the source code for the sample programs will help you acquire a better understanding of N64 software development.

UP


1.3.1 Simple Sample Programs

The following 10 sample programs are of great importance during N64 Software development. We recommend that you analyze them first.

simple:
This program demonstrates the compatibility of the audio and graphics processes. In this sample, the audio process will stop the graphics process when it cannot be completed in time.
blockmonkey:
This is a simple application that measures performance. A user can change the size of a display list or parameters, and confirm the effect when rendering. Operation instructions for the controller are displayed on the host screen when the application is executed. The graph of performance measurement on the lower screen shows the time needed to render a polygon. The CPU processing time needed to create a display list is not calculated. This was done to avoid slowing down the animation even when it cannot catch up with the next frame.
turbomonkey:
This is the same as blockmonkey except that this uses the turbo3D microcode. This sample program verifies the difference between turbo3D microcode and Fast3D microcode on the screen. A trade-off between image quality and processing speed can be compared using this program and blockmonkey.
onetri:
This is a simple sample program for rendering 1 polygon without the Z buffer. By using "gload -a -t", a simple texture mapping is possible.
topgun:
The fighter in this sample program is the .flt format data for which modeling was processed by MultiGen. A display list is created using the geometry converter flt2c which is included with this sample.
fogworld:
This sample program shows how to use the fog process and volume culling process.
spbench:
This program demonstrates the process for displaying a sprite using the sprite library. The number of sprites and color modes can be determined using the Controller. This sample can be used to assist you in learning how to program for high-speed processing.
playseq:
This sample program uses the sequence player.
soundmonkey:
A sample program using both the sequence player and the sound player.
spin:
This sample program enables you to experiment with RDP functions. Please refer to the README for this sample program for details.

UP


1.3.2 High-Level Sample Programs

The following sample programs are provided for users to get familiar with the demos and tools that include higher level functions.

autofill:
This is a simple sample program that measures the performance of painting out the screen. This program paints out the screen using a polygon with different aspect ratio size, and measures the speed automatically. Use gnuplot to view the measurement data. For details, please refer to README included with this sample program.
bumpmap:
This is a sample program of bump mapping. For details, please refer to the README included with this sample program.
chrome:
This sample program demonstrates the reflection mapping function.
ci8fb:
This sample program is similar to autofill. Rendering is processed using an 8 bit color index. For details, please refer to the README included with this sample program.
cptest:
This sample program uses C++. Please refer to the README included with this sample for additional information.
detail:
This sample program explains how to use the multi-tiling texture. It includes a demonstration of both the detail texture and MIPmap texture.
eeptest:
A simple program to test EEPROM (4k or 16k).
fault:
This sample program processes CPU exceptions without using rmon debug thread.
ginv:
This program outputs information such as the version of the emulator board equipped on the Indy, RCP and CPU clock speed, and the total amount of available DRAM.
greset:
This program simulates the operation of pressing the reset button on the hardware.
ground:
This sample program performs the clipping of a large ground plane accurately.
gs2dex:
This sample program explains how to use the sprite microcode S2DEX.
gtdemo:
In this sample program characters run or punch someone. This program demonstrates the multiple graphics task. Turbo3D microcode is used a great deal. Animation is realized using a complex matrix calculation by the host.
hostio:
This sample program exchanges data between the Indy (host) and the game application using the Host-U64 API (Application programmer's interface).
lights:
This program expresses a specular highlight effect which uses RSP texture and false shadows (shades). The Controller issued to determine the location and size of the effect. The background is processed with MIP map.
mipmap:
This program demonstrates MIP mapping. Verification is possible by comparing with other texture processing or changing MIP map parameters.
morphcube:
The CPU calculates each vertex for morphing. The CPU and the graphics pipeline execute 2 frames consecutively in parallel. Tiling of a large MIP map texture is processed with a capacity that is stored in texture memory.
morphfaces:
This program demonstrates morphing of two dimensional images. The CPU processes the morphing of vertex. Blending is performed using 2 cycle mode. For details, please refer to the NOTES file included with this sample program.
motortest:
This is a sample program for the Rumble Pak.
nnsample1:
This is a sample program for the NTSC scheduler.
nnsample2:
This is a sample program for the graphics microcode F3DEX Version 1.21
nosPak:
This is a sample program for the Controller Pak menu using the N64 font data.
overlay:
This sample program performs the overlay of onetri.code. Two different segments containing codes and data, share the same memory.
pfs:
This is a sample program for the Controller Pak.
polyline:
This sample program performs rendering by switching microcodes of polygon and line.
print:
This is a test program to measure the difference in performance of the osSyncPrintf() function when osInitRdb() is used and when osInitRdb() is not used.
spgame:
This sample program renders objects in the foreground and the background using a sprite function.
spritemonkey:
This program demonstrates the use of the sprite microcode Sprite2D.
sramtest:
This program tests for the operation of 256K SRAM. The execution result is displayed with osSyncPrintf(). A 256K SRAM board is required to execute this sample program.
terrain:
Use this sample program to create geographical features. This program renders the geometry using N64 hardware. The interface is operated using the Controller. Use this tool to create data and save it to the INDY. The tool demonstrates various functions including I/O with the Host. For details, see the README included with this sample.
texlight:
This program expresses a diffuse lighting process, a specular highlight process, and objects which are texture mapped, at the same time.
tile_rect2d:
This program demonstrates how to divide a large texture into small texture tiles so it can be stored in a texture memory. This program creates two dimensional texture rectangle primitives.
tile_rect3d:
This sample program explains how to divide a large texture into tiles so it can be stored in a texture memory. As filtering is processed properly, there will be no joints, and a triangle will be created.
tron:
A wall is a transparent object which is not sort processed. This sample program demonstrates how to use the BOWTIE_VAL parameter, which avoids RDP hanging.

UP


1.3.3 About the N64 Online Function Reference Manual

The "N64 Online Function Reference Manual" provides complete descriptions of each N64 function and its usage. Please refer to this manual for additional information.

UP