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 programs, 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.

Simple Sample Programs

blockmonkey
This is an application that measures a simple 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.

fogworld
This sample program shows how to use the fog process and volume culling process. This program enables you to output information such the RCP or CPU clock speed, and total available DRAM capacity.

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.

playseq
This sample program uses the sequence player. In the header file "playseq.h," the following two types of MAX_VOICES are defined (inserted with #ifdef VOICES_16 - #else - #endif):

                    #define MAX_VOICES 16;

                    #define MAX_VOICES 32;

simple
This program demonstrates the compatibility of the audio and graphics processes. In this sample, the audio process will stop the graphics process when the graphics process cannot be completed on time.

soundmonkey
A sample program using both the sequence player and the sound player. Only four virtual voices have been prepared for the sequence player in this sample. Thus, when MIDI data is played, virtual voice allocation fails, and the audio is not performed correctly. If the libgultra_d. a library is linked during make (i.e., if the ERROR=YES argument is attached to execute "make ERROR=YES"), then numerous errors are output to the console.

Since PARTNER-N64 does not support the routine used for outputting these errors, a program created with the ERROR=YES argument attached will not operate on PARTNER-N64. If you are using PARTNER-N64, please do not execute make with the ERROR=YES argument. Please note that the sample was purposely created like this. This is NOT a bug.

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.

MAX_VOICES indicates the number of physical voices of the synthesizer and the number of virtual voices of the sequence player. The greater the number of voices, the greater the number of sounds that can be played simultaneously. However, this also increases the amount of processing by the CPU and the RSP.

Please test both definitions to check the effect of the number of voices. If compiled without any changes, the number of virtual voices becomes 32.

spin
This sample program enables you to experiment with RDP functions. Please refer to the README for this sample program for details.

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.

turbomonkey
This is the same as blockmonkey except that is 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.

High-Level Sample Programs

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). When "DEBUG_EEPROM=YES" is specified when executing make, read/writes to 16k areas are performed even for 4k EEPROM.

fault
This sample program processes CPU exceptions without using rmon debugthread.

ginv
This program outputs information such as the version of the emulator board equipped on the Indy, RCP and RSP 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. To execute make, please run the batch file makenos.bat.

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. With this program you can experiment with checking, creating, and deleting game notes.

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.

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.

Please see the last section of this manual, "Sample Program Descriptions," for additional information.

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.

Copyright © 1999 Nintendo of America Inc. All Rights Reserved Nintendo and N64 are registered trademarks of Nintendo Last Updated January, 1999