// // Memory map defines. All of them // //! \file tonc_memdef.h //! \author J Vijn //! \date 20060508 - 20080521 // /* === NOTES === * 20080521 : comms items taken from libgba */ #ifndef TONC_MEMDEF #define TONC_MEMDEF /*! \defgroup grpMemBits Memory map bit(fields) \ingroup grpMemmap \brief List of all bit(field) definitions of memory mapped items. */ // --- Prefixes --- // REG_DISPCNT : DCNT // REG_DISPSTAT : DSTAT // REG_BGxCNT : BG // REG_WIN_x : WIN // REG_MOSAIC : MOS // REG_BLDCNT : BLD // REG_SND1SWEEP : SSW // REG_SNDxCNT, : SSQR // REG_SNDxFREQ, : SFREQ // REG_SNDDMGCNT : SDMG // REG_SNDDSCNT : SDS // REG_SNDSTAT : SSTAT // REG_DMAxCNT : DMA // REG_TMxCNT : TM // REG_SIOCNT : SIO(N/M/U) // REG_RCNT : R / GPIO // REG_KEYINPUT : KEY // REG_KEYCNT : KCNT // REG_IE, REG_IF : IRQ // REG_WSCNT : WS // Regular SE : SE // OAM attr 0 : ATTR0 // OAM attr 1 : ATTR1 // OAM attr 2 : ATTR2 // --- REG_DISPCNT ----------------------------------------------------- /*! \defgroup grpVideoDCNT Display Control Flags \ingroup grpMemBits \brief Bits for REG_DISPCNT */ /*! \{ */ #define DCNT_MODE0 0 //!< Mode 0; bg 0-4: reg #define DCNT_MODE1 0x0001 //!< Mode 1; bg 0-1: reg; bg 2: affine #define DCNT_MODE2 0x0002 //!< Mode 2; bg 2-3: affine #define DCNT_MODE3 0x0003 //!< Mode 3; bg2: 240x160\@16 bitmap #define DCNT_MODE4 0x0004 //!< Mode 4; bg2: 240x160\@8 bitmap #define DCNT_MODE5 0x0005 //!< Mode 5; bg2: 160x128\@16 bitmap #define DCNT_GB 0x0008 //!< (R) GBC indicator #define DCNT_PAGE 0x0010 //!< Page indicator #define DCNT_OAM_HBL 0x0020 //!< Allow OAM updates in HBlank #define DCNT_OBJ_2D 0 //!< OBJ-VRAM as matrix #define DCNT_OBJ_1D 0x0040 //!< OBJ-VRAM as array #define DCNT_BLANK 0x0080 //!< Force screen blank #define DCNT_BG0 0x0100 //!< Enable bg 0 #define DCNT_BG1 0x0200 //!< Enable bg 1 #define DCNT_BG2 0x0400 //!< Enable bg 2 #define DCNT_BG3 0x0800 //!< Enable bg 3 #define DCNT_OBJ 0x1000 //!< Enable objects #define DCNT_WIN0 0x2000 //!< Enable window 0 #define DCNT_WIN1 0x4000 //!< Enable window 1 #define DCNT_WINOBJ 0x8000 //!< Enable object window #define DCNT_MODE_MASK 0x0007 #define DCNT_MODE_SHIFT 0 #define DCNT_MODE(n) ((n)<