libctr9
Nintendo 3DS ARM9 library
ctr_system.h File Reference
#include <stdbool.h>

Go to the source code of this file.

Enumerations

enum  ctr_system_type { SYSTEM_O3DS, SYSTEM_N3DS }
 Enumeration describing the running system.
 

Functions

bool ctr_detect_a9lh_entry (void)
 Returns whether the arm9 entry was a9lh or not. More...
 
void ctr_twl_keyslot_setup (void)
 Sets up the TWL keyslot. More...
 
void ctr_system_poweroff (void)
 Powers off the 3DS. More...
 
void ctr_system_reset (void)
 Resets the 3DS. More...
 
ctr_system_type ctr_get_system_type (void)
 Returns the enumeration corresponding to the running system. More...
 
void ctr_flush_cache (void)
 Flushes all of the ARM9 CPU caches, and drains the write buffer. More...
 

Function Documentation

bool ctr_detect_a9lh_entry ( void  )

Returns whether the arm9 entry was a9lh or not.

Returns
True if the arm9 entrypoint was a9lh, false otherwise.
void ctr_flush_cache ( void  )

Flushes all of the ARM9 CPU caches, and drains the write buffer.

Postcondition
All CPU caches (instruction and data) have been flushed, and the write buffer has been drained.
ctr_system_type ctr_get_system_type ( void  )

Returns the enumeration corresponding to the running system.

Returns
The type of system this is called in.
void ctr_system_poweroff ( void  )

Powers off the 3DS.

This function does not return. It powers off the 3DS via an i2c call to the MPU.

Postcondition
3DS has powered off.
void ctr_system_reset ( void  )

Resets the 3DS.

This function does not return. It resets the 3DS via an i2c call to the MPU.

Postcondition
3DS has restarted.
void ctr_twl_keyslot_setup ( void  )

Sets up the TWL keyslot.

This only really matters if arm9 execution is obtained via a9lh, or prior to a FIRM load. Nothing happens if FIRM had been launched previously.

Postcondition
The TWL keyslot is setup properly.