Tutorial

## 2 - NuSystem Overview

NuSystem is a system library designed to make N64OS easier to use. It hides the initialization part of N64OS and connotes event message processes and the minimal necessary threads. It also provides a useful controller manager to handle the Controller and Controller Pak, and a useful audio manager to play back audio.

### 2.1 NuSystem Components (Ver. 1.0)

NuSystem is made up of the following components:

1. Initiator
2. Scheduler
3. Graphics Manager
4. Audio Manager
5. Controller Manager

The audio manager and controller manager can be created as application-independent managers without changing the NuSystem source code.

Below we give a simple explanation of each component. For details, please refer to INSIDE NuSystem.

#### 2.1.1 Initiator

The initiator performs the minimal initializations and settings needed to run the N64 system, including initializing N64OS and NuSystem, and activating the scheduler.

This means the startup section of the game program does not need to contain the tedious and bothersome code for initializing and setting the N64OS system. Of course, parameters can still be reset from the application.

#### 2.1.2 Scheduler

The NuSystem scheduler schedules the retrace event and PRE-NMI event handlers. In NuSystem, a retrace event process normally can be registered as a callback function from the game application, so there is really no need to be aware of the scheduler. However, scheduler functions have been provided so that retrace events can also be processed on the game application side.

#### 2.1.3 Graphics Manager

The graphics manager performs the necessary graphics initializations, registers and executes the retrace event handlers, and executes the graphics tasks.

The flow of a graphics process starts with the game application registering a retrace event function as a callback function in the graphics manager. A display list is then created with the callback function, and passed to the graphics manager. After that, the graphics manager executes an RSP task, the display list is processed, and the screen is drawn. In short, a game application can draw a screen just by creating a display list.

#### 2.1.4 Audio Manager

The audio manager performs the necessary audio initializations and plays back music data and sound effects data. The only thing the game application needs to do is register the music data and sound effect data. In order to playback music or sound effects, if the music data number or sound effect number is specified it will be played.

#### 2.1.5 Controller Manager

The controller manager reads data from the N64 Controller, read/writes data to the Controller Pak, and controls the Rumble Pak. The controller manager automatically reads the Controller data at the time of a retrace. It is also possible to read this data from the game application with arbitrary timing.

The Controller Pak is accessed via the controller manager. At this time, the controller manager performs a device check and takes exclusive control.

### 2.2 Customizing

NuSystem comes supplied with the source code. This can be freely customized to add to inadequate NuSystem functions, and to improve or change libraries to better fit the game application.