nds/system.h File Reference

NDS hardware definitions. More...


Data Structures

struct  tPERSONAL_DATA
 User's DS settings. More...
struct  __argv
 argv structure More...

Defines

#define REG_DISPSTAT   (*(vu16*)0x04000004)
 LCD status register.
#define DISP_IN_VBLANK   BIT(0)
 The display currently in a vertical blank.
#define DISP_IN_HBLANK   BIT(1)
 The display currently in a horizontal blank.
#define DISP_YTRIGGERED   BIT(2)
 Current scanline and DISP_Y match.
#define DISP_VBLANK_IRQ   BIT(3)
 Interrupt on vertical blank.
#define DISP_HBLANK_IRQ   BIT(4)
 Interrupt on horizontal blank.
#define DISP_YTRIGGER_IRQ   BIT(5)
 Interrupt when current scanline and DISP_Y match.
#define REG_VCOUNT   (*(vu16*)0x4000006)
 Current display scanline.
#define HALT_CR   (*(vuint16*)0x04000300)
 Halt control register.
#define REG_POWERCNT   *(vu16*)0x4000304
 Power control register.
#define POWER_SOUND   BIT(0)
#define POWER_UNKNOWN   BIT(1)
#define REG_KEYINPUT   (*(vuint16*)0x04000130)
 Key input register.
#define REG_KEYCNT   (*(vuint16*)0x04000132)
 Key input control register.
#define PersonalData   ((PERSONAL_DATA*)0x27FFC80)
 Default location for the user's personal data (see PERSONAL_DATA).
#define libnds_argv   ((struct __argv *)0x027FFF70)
 Default location for the libnds argv structure.
#define argvMagic   0x5f617267

Typedefs

typedef struct tPERSONAL_DATA PERSONAL_DATA

Functions

static void SetYtrigger (int Yvalue)
static void powerON (int on)
 Turns on specified hardware.
static void powerSET (int on)
 Turns on only the specified hardware.
static void powerOFF (int off)
 Turns off the specified hardware.
void readUserSettings ()


Detailed Description

NDS hardware definitions.

These definitions are usually only touched during the initialization of the program.


Define Documentation

#define argvMagic   0x5f617267

#define DISP_HBLANK_IRQ   BIT(4)

Interrupt on horizontal blank.

#define DISP_IN_HBLANK   BIT(1)

The display currently in a horizontal blank.

#define DISP_IN_VBLANK   BIT(0)

The display currently in a vertical blank.

#define DISP_VBLANK_IRQ   BIT(3)

Interrupt on vertical blank.

#define DISP_YTRIGGER_IRQ   BIT(5)

Interrupt when current scanline and DISP_Y match.

#define DISP_YTRIGGERED   BIT(2)

Current scanline and DISP_Y match.

#define HALT_CR   (*(vuint16*)0x04000300)

Halt control register.

Writing 0x40 to HALT_CR activates GBA mode. HALT_CR can only be accessed via the BIOS.

#define libnds_argv   ((struct __argv *)0x027FFF70)

Default location for the libnds argv structure.

#define PersonalData   ((PERSONAL_DATA*)0x27FFC80)

Default location for the user's personal data (see PERSONAL_DATA).

#define POWER_SOUND   BIT(0)

#define POWER_UNKNOWN   BIT(1)

#define REG_DISPSTAT   (*(vu16*)0x04000004)

LCD status register.

#define REG_KEYCNT   (*(vuint16*)0x04000132)

Key input control register.

#define REG_KEYINPUT   (*(vuint16*)0x04000130)

Key input register.

On the ARM9, the hinge "button," the touch status, and the X and Y buttons cannot be accessed directly.

#define REG_POWERCNT   *(vu16*)0x4000304

Power control register.

This register controls what hardware should be turned on or off.

#define REG_VCOUNT   (*(vu16*)0x4000006)

Current display scanline.


Typedef Documentation

typedef struct tPERSONAL_DATA PERSONAL_DATA


Function Documentation

static void powerOFF ( int  off  )  [inline, static]

Turns off the specified hardware.

Parameters:
off What to power off.
00102 { REG_POWERCNT &= ~off;}

static void powerON ( int  on  )  [inline, static]

Turns on specified hardware.

This function should only be called after powerSET.

Parameters:
on What to power on.
00089 { REG_POWERCNT |= on;}

static void powerSET ( int  on  )  [inline, static]

Turns on only the specified hardware.

Use this function to power on basic hardware types you wish to use throughout your program.

Parameters:
on What to power on.
00097 { REG_POWERCNT = on;}

void readUserSettings (  ) 

static void SetYtrigger ( int  Yvalue  )  [inline, static]

00063                              {
00064         REG_DISPSTAT = (REG_DISPSTAT & 0x007F ) | (Yvalue << 8) | (( Yvalue & 0x100 ) >> 2) ;
00065 }


Generated on Tue Jan 22 15:40:34 2008 for libnds(ARM7) by  doxygen 1.5.4