# 2.1.5 Events

The exception handler built into the N64 operating system decodes interrupts and other exceptions and maps them to system events. If the system event is one that may be handled by the game itself, a message is sent to an associated event mailbox and the game application is notified. In this way, the game designer can provide an interrupt handler to deal with the exception as required by the game requirements.

Once the cause of an interrupt (or other exception) has been determined, the N64 operating system maps it to one of the following 17 events defined for the N64 system:

- SW1 - System software interrupt 1 asserted
- SW2 - System software interrupt 2 asserted
- CART - Peripherial has generated an interrupt
- COUNTER - Internal counter reached terminal count
- SP - RCP (reality co-processor) SP (signal processor) interrupt; Task Done/Task Yield
- SI - RCP SI (serial interface) interrupt; controller input available
- AI - RCP AI (audio interface) interrupt; audio buffer swap
- VI - RCP VI (video interface) interrupt; vertical retrace
- PI - RCP PI (parallel interface) interrupt; ROM to RAM DMA done
- DP - RCP DP (display processor) interrupt; RDP processing done
- PRE-NMI - An NMI (nonmaskable interrupt) has been requested and will occur in 0.5 seconds
- CPU_BREAK - R4300i CPU has hit a breakpoint
- SP_BREAK - RCP SP (signal processor) interrupt; RCP has hit a breakpoint
- FAULT - R4300i CPU has faulted
- THREAD_STATUS - Thread was created or destroyed
- PROF_REQ
- PROF_ACK

Threads, messages, and events work together to form the core of the N64 operating system. N64 applications run under a small, multi-threaded operating system. Often a thread needs to wait for an exception such as an interrupt. Exceptions are trapped by the operating system and turned into events. Threads may register to receive notification of system events by requesting that the operating system send them a message whenever a system event occurs.

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