#include "ndstypes.h"
Data Structures | |
| struct | __argv |
| argv structure More... | |
| struct | tPERSONAL_DATA |
| User's DS settings. More... | |
Defines | |
| #define | __system_argv ((struct __argv *)0x02FFFE70) |
| Default location for the libnds argv structure. | |
| #define | HALT_CR (*(vu16*)0x04000300) |
| Halt control register. | |
| #define | PersonalData ((PERSONAL_DATA*)0x2FFFC80) |
| Default location for the user's personal data (see PERSONAL_DATA). | |
| #define | REG_DISPSTAT (*(vu16*)0x04000004) |
| LCD status register. | |
| #define | REG_POWERCNT *(vu16*)0x4000304 |
| Power control register. | |
| #define | REG_VCOUNT (*(vu16*)0x4000006) |
| Current display scanline. | |
Enumerations | |
| enum | ARM7_power { POWER_SOUND = (1 << ( 0 )), PM_CONTROL_REG = 0, PM_BATTERY_REG = 1, PM_AMPLIFIER_REG = 2, PM_READ_REGISTER = (1<<7), PM_AMP_OFFSET = 2, PM_GAIN_OFFSET = 3, PM_GAIN_20 = 0, PM_GAIN_40 = 1, PM_GAIN_80 = 2, PM_GAIN_160 = 3, PM_AMP_ON = 1, PM_AMP_OFF = 0 } |
| Power-controlled hardware devices accessable to the ARM7. More... | |
| enum | DISP_BITS { , DISP_IN_HBLANK = (1 << ( 1 )), DISP_YTRIGGERED = (1 << ( 2 )), DISP_VBLANK_IRQ = (1 << ( 3 )), DISP_HBLANK_IRQ = (1 << ( 4 )), DISP_YTRIGGER_IRQ = (1 << ( 5 )) } |
| LCD Status register bitdefines. More... | |
| enum | PM_Bits { PM_SOUND_AMP = (1 << ( 0 )), PM_SOUND_MUTE = (1 << ( 1 )), PM_BACKLIGHT_BOTTOM = (1 << ( 2 )), PM_BACKLIGHT_TOP = (1 << ( 3 )), PM_SYSTEM_PWR = (1 << ( 6 )), POWER_LCD = (1 << ( 16 )) | (1 << ( 0 )), POWER_2D_A = (1 << ( 16 )) | (1 << ( 1 )), POWER_MATRIX = (1 << ( 16 )) | (1 << ( 2 )), POWER_3D_CORE = (1 << ( 16 )) | (1 << ( 3 )), POWER_2D_B = (1 << ( 16 )) | (1 << ( 9 )), POWER_SWAP_LCDS = (1 << ( 16 )) | (1 << ( 15 )), POWER_ALL_2D = (1 << ( 16 )) | POWER_LCD | POWER_2D_A | POWER_2D_B, POWER_ALL = (1 << ( 16 )) | POWER_ALL_2D | POWER_3D_CORE | POWER_MATRIX } |
| Power Management control bits. More... | |
Functions | |
| static void | lcdMainOnBottom (void) |
| Forces the main core to display on the bottom. | |
| static void | lcdMainOnTop (void) |
| Forces the main core to display on the top. | |
| static void | lcdSwap (void) |
| Switches the screens. | |
| void | ledBlink (int bm) |
| Set the LED blink mode. | |
| void | powerOff (int bits) |
| Turns off specified hardware. | |
| void | powerOn (int bits) |
| Turns on specified hardware. | |
| void | setVectorBase (int highVector) |
| Set the arm9 vector base. | |
These definitions are usually only touched during the initialization of the program.
| #define HALT_CR (*(vu16*)0x04000300) |
Halt control register.
Writing 0x40 to HALT_CR activates GBA mode. HALT_CR can only be accessed via the BIOS.
| #define REG_POWERCNT *(vu16*)0x4000304 |
Power control register.
This register controls what hardware should be turned on or off.
| enum ARM7_power |
Power-controlled hardware devices accessable to the ARM7.
Note that these should only be used when programming for the ARM7. Trying to boot up these hardware devices via the ARM9 would lead to unexpected results.
| enum DISP_BITS |
LCD Status register bitdefines.
| enum PM_Bits |
Power Management control bits.
| void ledBlink | ( | int | bm | ) |
Set the LED blink mode.
Arm9 only
| bm | What to power on. |
| void powerOff | ( | int | bits | ) |
Turns off specified hardware.
May be called from arm7 or arm9 (arm9 power bits will be ignored by arm7, arm7 power bits will be passed to the arm7 from the arm9).
| bits | What to power on. |
| void powerOn | ( | int | bits | ) |
Turns on specified hardware.
May be called from arm7 or arm9 (arm9 power bits will be ignored by arm7, arm7 power bits will be passed to the arm7 from the arm9).
| bits | What to power on. |
| void setVectorBase | ( | int | highVector | ) |
Set the arm9 vector base.
Arm9 only
| highVector | high vector |
1.5.7.1