説明なし

gba_sprites.h 1.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. //
  2. // Sprites
  3. //
  4. #ifndef GBA_SPRITES_H
  5. #define GBA_SPRITES_H
  6. #include "gba_types.h"
  7. // Attribute 0
  8. #define ROTATION_FLAG 0x0100
  9. #define SIZE_DOUBLE 0x0200
  10. #define MODE_NORMAL 0x0000
  11. #define MODE_TRANSPARENT 0x0400
  12. #define MODE_TRANSPARENT_HALF 0x0500
  13. #define MODE_TRANSPARENT_BOTH 0x0600
  14. #define MODE_WINDOWED 0x0800
  15. #define MOSAIC 0x1000
  16. #define COLOR_16 0x0000
  17. #define COLOR_256 0x2000
  18. #define SQUARE 0x0000
  19. #define WIDE 0x4000
  20. #define TALL 0x8000
  21. // Attribute 1
  22. #define ROTDATA(n) (n << 9)
  23. #define HORIZONTAL_FLIP 0x1000
  24. #define VERTICAL_FLIP 0x2000
  25. #define SIZE_8 0x0000
  26. #define SIZE_16 0x4000
  27. #define SIZE_32 0x8000
  28. #define SIZE_64 0xC000
  29. // Attribute 2
  30. #define PRIORITY(n) ((n)<<10)
  31. #define PALETTE(n) ((n)<<12)
  32. //sprite structure definitions
  33. typedef struct tagOAMEntry
  34. {
  35. u16 attribute0;
  36. u16 attribute1;
  37. u16 attribute2;
  38. u16 attribute3;
  39. }OAMEntry, *pOAMEntry;
  40. //sprite rotation information (don't worry about this for now)
  41. typedef struct tagRotData
  42. {
  43. u16 filler1[3];
  44. u16 pa;
  45. u16 filler2[3];
  46. u16 pb;
  47. u16 filler3[3];
  48. u16 pc;
  49. u16 filler4[3];
  50. u16 pd;
  51. }RotData, *pRotData;
  52. #endif