projects
/
gbajam22
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
destroy enemies, increment counters, detect victory
[gbajam22]
/
src
/
util.h
diff --git
a/src/util.h
b/src/util.h
index
f719b17
..
264367b
100644
(file)
--- a/
src/util.h
+++ b/
src/util.h
@@
-5,6
+5,11
@@
#include <stdint.h>
#include "gba.h"
#include <stdint.h>
#include "gba.h"
+#define RGB555(r, g, b) \
+ ((((uint16_t)(r) >> 3) & 0x1f) | \
+ (((uint16_t)(g) << 2) & 0x3e0) | \
+ (((uint16_t)(b) << 7) & 0x7c00))
+
#ifdef BUILD_GBA
#define wait_vblank() \
#ifdef BUILD_GBA
#define wait_vblank() \
@@
-15,13
+20,17
@@
#define present(x) \
do { \
#define present(x) \
do { \
- REG_DISPCNT = DISPCNT_BG2 | DISPCNT_OBJ | 4 | ((x) << 4); \
+ REG_DISPCNT = (REG_DISPCNT & 0xffef) | ((x) << 4); \
} while(0)
} while(0)
+#define ARM_IWRAM __attribute__((noinline, target("arm"), section(".iwram")))
+
#else /* non-GBA build */
#define wait_vblank()
void present(int buf); /* defined in src/pc/main.c */
#else /* non-GBA build */
#define wait_vblank()
void present(int buf); /* defined in src/pc/main.c */
+
+#define ARM_IWRAM
#endif
#define set_bg_color(idx, r, g, b) \
#endif
#define set_bg_color(idx, r, g, b) \