libnds
Loading...
Searching...
No Matches
Modules | Data Structures | Macros | Typedefs | Enumerations
"Background Register Access"

Background related register definitions and bit defines. More...

Modules

 "Main Engine"
 Main Engine Background registers.
 
 "Sub Engine"
 Sub engine background registers.
 

Data Structures

struct  bg_attribute
 Register overlay for background attribute registers. More...
 
struct  bg_scroll
 Register overlay for scroll registers. More...
 
struct  bg_transform
 Register overlay for affine matrix registers. More...
 
struct  TileMapEntry16
 Overlay for 16-bit tile map entries. More...
 
struct  TileMapEntry8
 Overlay for 8-bit tile map entries. More...
 

Macros

#define BG_BMP_BASE(base)   ((base) << MAP_BASE_SHIFT)
 Macro to set the graphics base in background control.
 
#define BG_MAP_BASE(base)   ((base) << MAP_BASE_SHIFT)
 Macro to set the map base in background control.
 
#define BG_PRIORITY(n)   (n)
 Macro to set the priority in background control.
 
#define BG_TILE_BASE(base)   ((base) << TILE_BASE_SHIFT)
 Macro to set the tile base in background control.
 
#define MAP_BASE_SHIFT   8
 The shift to apply to map base when storing it in a background control register.
 
#define TILE_BASE_SHIFT   2
 The shift to apply to tile base when storing it in a background control register.
 
#define TILE_FLIP_H   BIT(10)
 The horizontal flip bit for a 16 bit tile index.
 
#define TILE_FLIP_V   BIT(11)
 The vertical flip bit for a 16 bit tile index.
 
#define TILE_PALETTE(n)   ((n) << 12)
 Macro to set the palette entry of a 16 bit tile index.
 

Typedefs

typedef struct bg_attribute bg_attribute
 Register overlay for background attribute registers.
 
typedef struct bg_scroll bg_scroll
 Register overlay for scroll registers.
 
typedef struct bg_transform bg_transform
 Register overlay for affine matrix registers.
 
typedef struct TileMapEntry16 TileMapEntry16
 Overlay for 16-bit tile map entries.
 
typedef struct TileMapEntry8 TileMapEntry8
 Overlay for 8-bit tile map entries.
 

Enumerations

enum  BackgroundControl {
  BG_32x32 = (0 << 14) ,
  BG_64x32 = (1 << 14) ,
  BG_32x64 = (2 << 14) ,
  BG_64x64 = (3 << 14) ,
  BG_RS_16x16 = (0 << 14) ,
  BG_RS_32x32 = (1 << 14) ,
  BG_RS_64x64 = (2 << 14) ,
  BG_RS_128x128 = (3 << 14) ,
  BG_BMP8_128x128 = ((0 << 14) | BIT(7)) ,
  BG_BMP8_256x256 = ((1 << 14) | BIT(7)) ,
  BG_BMP8_512x256 = ((2 << 14) | BIT(7)) ,
  BG_BMP8_512x512 = ((3 << 14) | BIT(7)) ,
  BG_BMP8_1024x512 = BIT(14) ,
  BG_BMP8_512x1024 = 0 ,
  BG_BMP16_128x128 = ((0 << 14) | BIT(7) | BIT(2)) ,
  BG_BMP16_256x256 = ((1 << 14) | BIT(7) | BIT(2)) ,
  BG_BMP16_512x256 = ((2 << 14) | BIT(7) | BIT(2)) ,
  BG_BMP16_512x512 = ((3 << 14) | BIT(7) | BIT(2)) ,
  BG_MOSAIC_ON = (BIT(6)) ,
  BG_MOSAIC_OFF = (0) ,
  BG_PRIORITY_0 = (0) ,
  BG_PRIORITY_1 = (1) ,
  BG_PRIORITY_2 = (2) ,
  BG_PRIORITY_3 = (3) ,
  BG_WRAP_OFF = (0) ,
  BG_WRAP_ON = (1 << 13) ,
  BG_PALETTE_SLOT0 = 0 ,
  BG_PALETTE_SLOT1 = 0 ,
  BG_PALETTE_SLOT2 = BIT(13) ,
  BG_PALETTE_SLOT3 = BIT(13) ,
  BG_COLOR_256 = 0x80 ,
  BG_COLOR_16 = 0x00
}
 Bit defines for the background control registers. More...
 

Detailed Description

Background related register definitions and bit defines.

Enumeration Type Documentation

◆ BackgroundControl

Bit defines for the background control registers.

Enumerator
BG_32x32 

32 x 32 tile text background

BG_64x32 

64 x 32 tile text background

BG_32x64 

32 x 64 tile text background

BG_64x64 

64 x 64 tile text background

BG_RS_16x16 

16 x 16 tile affine (rotation & scale) background

BG_RS_32x32 

32 x 32 tile affine (rotation & scale) background

BG_RS_64x64 

64 x 64 tile affine (rotation & scale) background

BG_RS_128x128 

128 x 128 tile affine (rotation & scale) background

BG_BMP8_128x128 

128x128 pixel 8-bit bitmap

BG_BMP8_256x256 

256x256 pixel 8-bit bitmap

BG_BMP8_512x256 

512x256 pixel 8-bit bitmap

BG_BMP8_512x512 

512 pixel 8-bit bitma

BG_BMP8_1024x512 

1024x512 pixel 8-bit Large bitmap (Mode 6, main engine)

BG_BMP8_512x1024 

512x1024 pixel 8-bit Large bitmap (Mode 6, main engine)

BG_BMP16_128x128 

128x128 pixel 16-bit bitmap

BG_BMP16_256x256 

256x256 pixel 16-bit bitmap

BG_BMP16_512x256 

512x256 pixel 16-bit bitmap

BG_BMP16_512x512 

512x512 pixel 16-bit bitmap

BG_MOSAIC_ON 

Mosaic enable.

BG_MOSAIC_OFF 

Mosaic disable.

BG_PRIORITY_0 

Lower priority will be rendered on top.

BG_PRIORITY_1 

Lower priority will be rendered on top.

BG_PRIORITY_2 

Lower priority will be rendered on top.

BG_PRIORITY_3 

Lower priority will be rendered on top.

BG_WRAP_OFF 

Disable wrapping (text backgrounds always wrap)

BG_WRAP_ON 

Enable wrapping (text backgrounds always wrap)

BG_PALETTE_SLOT0 

Use slot 0 of extended palettes.

BG_PALETTE_SLOT1 

Use slot 1 of extended palettes.

BG_PALETTE_SLOT2 

Use slot 2 of extended palettes.

BG_PALETTE_SLOT3 

Use slot 3 of extended palettes.

BG_COLOR_256 

256 color text background

BG_COLOR_16 

16x16 color text background