libnds
Loading...
Searching...
No Matches
Macros | Functions | Variables
exceptions.h File Reference

Functions to handle hardware exceptions. More...

#include <nds/cpu.h>
#include <nds/ndstypes.h>

Macros

#define EXCEPTION_STACK_TOP   ((uint32_t *)0x2FFFD9C)
 NDS9 BIOS debug exception stack top (mirror)
 
#define EXCEPTION_VECTOR   (*(VoidFn *)(0x2FFFD9C))
 NDS9 BIOS debug exception vector, or 0 for no handler (mirror)
 

Functions

void defaultExceptionHandler (void)
 Sets the default debug hardware exception handler.
 
void enterException (void)
 Default exception handler of libnds.
 
void releaseExceptionHandler (void)
 Sets the release hardware exception handler.
 
void setExceptionHandler (VoidFn handler)
 Sets a custom hardware exception handler.
 

Variables

VoidFn exceptionC
 Pointer to the user exception handler, called from the exception handler of libnds.
 
s32 exceptionRegisters []
 Array with a copy of all the registers of when the exception occured.
 
u32 exceptionStack
 Stack reserved for the user exception handler, allocated by the exception handler of libnds.
 

Detailed Description

Functions to handle hardware exceptions.

Check https://www.problemkaputt.de/gbatek.htm#biosramusage for more information.

Function Documentation

◆ defaultExceptionHandler()

void defaultExceptionHandler ( void  )

Sets the default debug hardware exception handler.

This handler prints a lot of information, like the state of the CPU registers when the CPU crashed.

◆ releaseExceptionHandler()

void releaseExceptionHandler ( void  )

Sets the release hardware exception handler.

This is similar to defaultExceptionHandler(), but it only prints a minimal error message, and it uses a lot less code to do it.

◆ setExceptionHandler()

void setExceptionHandler ( VoidFn  handler)

Sets a custom hardware exception handler.

Parameters
handlerException handler routine.