gba-trycatch
diff src/sdlsys/gbasys.h @ 5:850be43b3135
sdl version
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Mon, 16 Jun 2014 22:01:45 +0300 |
parents | |
children | 73b5f2e5d18a |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/src/sdlsys/gbasys.h Mon Jun 16 22:01:45 2014 +0300 1.3 @@ -0,0 +1,50 @@ 1.4 +/* fake gbasys.h for building on PCs with SDL */ 1.5 +#ifndef FAKE_GBASYS_H_ 1.6 +#define FAKE_GBASYS_H_ 1.7 + 1.8 +/* ---- fake gbasys/gfx.h ---- */ 1.9 +struct pixel_buffer { 1.10 + int x, y, bpp; 1.11 + void *pixels; 1.12 +}; 1.13 + 1.14 +extern struct pixel_buffer *back_buffer; 1.15 + 1.16 +#define RGB(r, g, b)\ 1.17 + ((((b) >> 3) & 0x1f) << 10) |\ 1.18 + ((((g) >> 3) & 0x1f) << 5) |\ 1.19 + (((r) >> 3) & 0x1f) 1.20 + 1.21 +#define GET_R(c) ((((c) >> 10) & 0x1f) << 3) 1.22 +#define GET_G(c) ((((c) >> 5) & 0x1f) << 3) 1.23 +#define GET_B(c) (((c) & 0x1f) << 3) 1.24 + 1.25 +/* defined in main_sdl.c */ 1.26 +void flip(void); 1.27 +void clear_buffer(struct pixel_buffer *pbuf, unsigned short color); 1.28 + 1.29 +/* ---- fake gbasys/input.h ---- */ 1.30 +enum { 1.31 + KEY_A = 1, 1.32 + KEY_B = 2, 1.33 + KEY_SELECT = 4, 1.34 + KEY_START = 8, 1.35 + KEY_RIGHT = 16, 1.36 + KEY_LEFT = 32, 1.37 + KEY_UP = 64, 1.38 + KEY_DOWN = 128, 1.39 + KEY_R = 256, 1.40 + KEY_L = 512, 1.41 + KEY_ALL = 1023 1.42 +}; 1.43 + 1.44 +#define KEY_COUNT 14 1.45 + 1.46 +int get_key_state(int key); 1.47 + 1.48 +/* ---- fake gbasys/timer.h ---- */ 1.49 +unsigned long get_millisec(void); 1.50 + 1.51 +#include "font.h" 1.52 + 1.53 +#endif /* FAKE_GBASYS_H_ */