configure.ac: fix typo
[rofl0r-gnuboy.git] / lcd.h
blob801a1c439e9f637aad5021661fb00644370c6b81
3 #ifndef __LCD_H__
4 #define __LCD_H__
6 #include "defs.h"
8 struct vissprite
10 byte *buf;
11 int x;
12 byte pal, pri, pad[6];
15 struct scan
17 int bg[64];
18 int wnd[64];
19 byte buf[256];
20 byte pal1[128];
21 un16 pal2[64];
22 un32 pal4[64];
23 byte pri[256];
24 struct vissprite vs[16];
25 int ns, l, x, y, s, t, u, v, wx, wy, wt, wv;
28 struct obj
30 byte y;
31 byte x;
32 byte pat;
33 byte flags;
36 struct lcd
38 byte vbank[2][8192];
39 union
41 byte mem[256];
42 struct obj obj[40];
43 } oam;
44 byte pal[128];
47 extern struct lcd lcd;
48 extern struct scan scan;
50 void updatepatpix();
51 void tilebuf();
52 void bg_scan();
53 void wnd_scan();
54 void bg_scan_pri();
55 void wnd_scan_pri();
56 void bg_scan_color();
57 void wnd_scan_color();
58 void spr_count();
59 void spr_enum();
60 void spr_scan();
61 void lcd_begin();
62 void lcd_refreshline();
63 void pal_write(int i, byte b);
64 void pal_write_dmg(int i, int mapnum, byte d);
65 void vram_write(int a, byte b);
66 void vram_dirty();
67 void pal_dirty();
68 void lcd_reset();
70 #define LCDC_BIT_BG_EN (1<<0) /* BG display off or on - CGB: always on */
71 #define LCDC_BIT_OBJ_EN (1<<1) /* OBJs off or on */
72 #define LCDC_BIT_OBJ_SIZE (1<<2) /* OBJ size: 0:8x8 1:8x16 */
73 #define LCDC_BIT_BG_MAP (1<<3) /* BG code area 0:9800-9bff, 1:9c00-9fff */
74 #define LCDC_BIT_TILE_SEL (1<<4) /* BG char data 0:8800-97ff, 1:8000-8fff */
75 #define LCDC_BIT_WIN_EN (1<<5) /* WIN off or on */
76 #define LCDC_BIT_WIN_MAP (1<<6) /* WIN code area 0:9800-9bff, 1:9c00-9fff */
77 #define LCDC_BIT_LCD_EN (1<<7) /* LCD controller off or on */
80 #endif