X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Futil.h;h=264367be94a4082ad3f544e99e01f025334f8175;hb=fb23aa4804a46173f817eb83b4823b7263ef0ed9;hp=16845243fc6629c101f6708a9b85d43e7b4e4555;hpb=53c0ee3332822465be7dcf923ca3c6445076b555;p=gbajam22 diff --git a/src/util.h b/src/util.h index 1684524..264367b 100644 --- a/src/util.h +++ b/src/util.h @@ -5,6 +5,11 @@ #include #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() \ @@ -15,7 +20,7 @@ #define present(x) \ do { \ - REG_DISPCNT = (REG_DISPCNT & ~DISPCNT_FB1) | ((x) << 4); \ + REG_DISPCNT = (REG_DISPCNT & 0xffef) | ((x) << 4); \ } while(0) #define ARM_IWRAM __attribute__((noinline, target("arm"), section(".iwram")))