#define BG_PRIORITE_0 0x0000
#define BG_PRIORITE_1 0x0001
#define BG_PRIORITE_2 0x0002
#define BG_PRIORITE_3 0x0003
#define BG_CHARBLOCK_0 0x0000
#define BG_CHARBLOCK_1 0x0004
#define BG_CHARBLOCK_2 0x0008
#define BG_CHARBLOCK_3 0x000C
#define BG_EFFET_MOSAIQUE 0x0040
#define BG_1_PALETTE 0x0080
#define BG_16_PALETTES 0x0000
#define BG_WRAP 0x2000
#define BG_TEXTE_256x256 0x0000
#define BG_TEXTE_512x256 0x4000
#define BG_TEXTE_256x512 0x8000
#define BG_TEXTE_512x512 0xC000
#define BG_ROTATION_128x128 0x0000
#define BG_ROTATION_256x256 0x4000
#define BG_ROTATION_512x512 0x8000
#define BG_ROTATION_1024x1024 0xC000

#define CharBaseBlock(n) (((n)*0x4000)+0x6000000)
#define ScreenBaseBlock(n) (((n)*0x0800)+0x6000000)
#define VIDEO_BG0_ENABLED 0x100
#define VIDEO_BG1_ENABLED 0x200
#define VIDEO_BG2_ENABLED 0x400
#define VIDEO_BG3_ENABLED 0x800
#define VIDEO_MODE0 0x0
#define VIDEO_MODE1 0x1
#define VIDEO_MODE2 0x2
#define VIDEO_MODE3 0x3
#define VIDEO_MODE4 0x4
#define VIDEO_MODE5 0x5

#define REG_DMA3SAD *(volatile unsigned int*)0x40000D4
#define REG_DMA3DAD *(volatile unsigned int*)0x40000D8
#define REG_DMA3CNT *(volatile unsigned int*)0x40000DC
#define DMA_ENABLE 0x80000000
#define DMA_TIMING_IMMEDIAT 0x00000000
#define DMA_16 0x00000000
#define DMA_32 0x04000000

#define DMA_16im (DMA_ENABLE | DMA_TIMING_IMMEDIAT | DMA_16)
#define DMA_32im (DMA_ENABLE | DMA_TIMING_IMMEDIAT | DMA_32)


#define REG_KEYS *(volatile unsigned long*) 0x4000130
#define REG_TOUCHES (~(REG_KEYS) & 0x3FF)
#define TOUCHE_A 0x0001
#define TOUCHE_B 0x0002
#define TOUCHE_SELECT 0x0004
#define TOUCHE_START 0x0008
#define TOUCHE_DROITE 0x0010
#define TOUCHE_GAUCHE 0x0020
#define TOUCHE_HAUT 0x0040
#define TOUCHE_BAS 0x0080
#define TOUCHE_R 0x0100
#define TOUCHE_L 0x0200



