Sin descripción

gba_video.h 1.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. //
  2. // Video memory setup
  3. //
  4. #ifndef GBA_VIDEO_H
  5. #define GBA_VIDEO_H
  6. #include "gba_types.h"
  7. #include "gba_regs.h"
  8. //define the screen width and height values to be used
  9. #define SCREEN_WIDTH 240
  10. #define SCREEN_HEIGHT 160
  11. #define MODE_0 0x0 //screen mode 0
  12. #define MODE_1 0x1 //screen mode 1
  13. #define MODE_2 0x2 //screen mode 2
  14. #define MODE_3 0x3 //screen mode 3
  15. #define MODE_4 0x4 //screen mode 4
  16. #define MODE_5 0x5 //screen mode 5
  17. #define backbuffer 0x10 //define the buffer which is used to set the
  18. //active buffer(using double buffering)
  19. #define H_BLANK_OAM 0x20 //This bit, when set allows OAM
  20. //(Object Attribute memory) to be updated during a //horizontal blank
  21. #define OBJ_MAP_2D 0x00 //Sprite data is stored in a 2D array(dont use this!!)
  22. #define OBJ_MAP_1D 0x40 //Sprite data is stored in a 1D array
  23. #define BG0_ENABLE 0x100 //Enables background 0
  24. #define BG1_ENABLE 0x200 //Enables background 1
  25. #define BG2_ENABLE 0x400 //Enables background 2
  26. #define BG3_ENABLE 0x800 //Enables background 3
  27. #define OBJ_ENABLE 0x1000 //Enables sprites
  28. #define SetMode(mode) REG_DISPCNT = (mode)
  29. //Set the mode that you want to use, logical OR them together as below:
  30. //e.g. SetMode(MODE_2 | OBJ_ENABLE | OBJ_MAP_1D);
  31. #endif