6. Reset (NMI)

6-1 Determining Hot-start and Cold-start (Required)

6-2 Y Scale Reset (Required)

6-3 Suspension of Graphics and Audio Tasks (Required)

6-4 Calling the osAfterPreNMI function (Required)


6-1 Determining Hot-start and Cold-start (Required)

Description

To determine whether a hot-start or cold-start of the Control Deck has occurred, use the global variable, osResetType.

Reason

A hot-start or cold-start cannot be reliably determined solely based upon the contents of memory. Using osResetType will prevent a game from locking up due to assumption of hot-start conditions.

Reference


Remarks


6-2 Y Scale Reset (Required)

Description

Ensure that a preemption by another thread, which changes the Y scale, has not occurred after resetting the Y scale to 1.0 in the PRENMI routine (executes osViSetYScale(1.0)). Don't perform an operation that prevents vertical retrace.

Reason

If an NMI occurs when the Y scale value is something other than 1.0, images are not displayed properly.

Reference

For more information, please refer to "Nintendo 64 Developer News 1.5" Reset Processing

Remarks

If the video mode registers have been altered in any non-standard way, these registers must also be set back to their original values in the PRENMI routine. Failure to reset these values may cause lockups on NMI.


6-3 Suspension of Graphics and Audio Tasks (Required)

Description

When a PRENMI event occurs, graphic and audio tasks must be stopped before NMI occurs.

Reason

If an NMI occurs while graphic and audio tasks are executing, the RSP may not function properly.

Reference

For more information, please refer to "Nintendo 64 Developer News 1.5" Reset Processing

Remarks

When the reset button is pressed, a PRENMI signal is generated which should be processed by the game. This PRENMI signal is guaranteed to come at least 0.5 seconds before the NMI which resets the N64 hardware. In this 0.5 seconds, a number of operations must be performed in order to prepare the machine for the NMI. If these operations are not performed, the RSP may not function properly after system reset.


6-4 Calling the osAfterPreNMI function (Required)

Description

Once the application receives pre-NMI, and has all the RSP tasks stopped, make sure to call the osAfterPreNMI function before NMI starts to occur.

This function fails to execute its process and returns an error if executed while RSP is running. In this situation case, wait until the running RSP task completes the process, and then call this function again. For more information, please see the function reference on osAfterPreNMI.

Reason

If NMI occurs without getting the program counter (PC) of RSP initialized, the application may stop.

Reference

It has been confirmed occurring only with MPAL, however, make sure to call it with NTSC and PAL.