1.2 Introduction to NuSystem

The sample program SNAKE TAIL HACK introduced in this chapter is a relatively large program, requiring several libraries in addition to the N64 basic development environment. Some people may not know about the N64 library structure, so before compiling the program a brief explanation about the N64 libraries will be provided.

The series of libraries and headers required for N64 program development are collectively called the "N64 OS", which is installed under c:\ultra by default. If you have installed it to another directory, please read the explanations below making adjustments according to the environment you are using.

When you use exeGCC to compile an N64 program, you need to have the proper environment variables and execution file path set. Since the batch file setup.bat for setting environment variable is located in c:\ultra, it's a good idea to set this batch file to be executed when Windows starts up. The environmental variable ROOT indicating the N64 OS top directory (normally c:\ultra) is defined in setup.bat. Furthermore, you call setupgcc.bat to set the exeGCC switch, and setuplib.bat to set the command's execution file path.

Be sure to make these settings, since they are necessary and indispensable for N64 programming (at least when using exeGCC).

In addition to these essential OS libraries, this tutorial also uses the library called NuSystem to put the program together. In fact, SNAKE TAIL HACK was originally provided as a sample program for NuSystem. You should have received NuSystem included in the NINTENDO64 Developers Kit, so if you have not done so yet, make sure to install NuSystem now before you read any further.

Figure 1-1 Relative positions of N64 OS and NuSystem

The NINTENDO64 Developers Kit installs in c:\nintendo, and not in c:\ultra (as the default setting, so adapt this to match your environment if the settings are different). When the installation is complete, the NuSystem headers, libraries and sample programs should be expanded under c:\nintendo\n64kit\nusys.

SNAKE TAIL HACK is located in the NuSystem sample directory in a subdirectory called nusnake. In the next section, we will try compiling the sample program located in this directory.