X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;ds=sidebyside;f=src%2Futil.h;h=3bbafbd75771e9001be00f240a2a79eabef4dfaa;hb=b0f9c6ecc15c2d4b5df77a7a963b742a6352ee1a;hp=18c513e2eb8fa869057a8e33da1def1a8d6990b0;hpb=41765ea063cbab26ae05e7259ffc8a7c85db2f5d;p=gbajam22 diff --git a/src/util.h b/src/util.h index 18c513e..3bbafbd 100644 --- a/src/util.h +++ b/src/util.h @@ -3,6 +3,9 @@ #include #include +#include "gba.h" + +#ifdef BUILD_GBA #define wait_vblank() \ do { \ @@ -15,11 +18,14 @@ REG_DISPCNT = DISPCNT_BG2 | DISPCNT_OBJ | 4 | ((x) << 4); \ } while(0) +#else /* non-GBA build */ +#define wait_vblank() + +void present(int buf); /* defined in src/pc/main.c */ +#endif #define set_bg_color(idx, r, g, b) \ - do { \ - ((uint16_t*)CRAM_BG_ADDR)[idx] = (uint16_t)(r) | ((uint16_t)(g) << 5) | ((uint16_t)(b) << 10); \ - } while(0) + gba_bgpal[idx] = (uint16_t)(r) | ((uint16_t)(g) << 5) | ((uint16_t)(b) << 10) extern int16_t sinlut[];