2005-03-02 23:49:38 +00:00
|
|
|
|
|
|
|
|
2005-07-03 14:05:12 +00:00
|
|
|
#ifndef __LCD_GB_H__
|
|
|
|
#define __LCD_GB_H__
|
2005-03-02 23:49:38 +00:00
|
|
|
|
|
|
|
#include "defs.h"
|
|
|
|
|
|
|
|
struct vissprite
|
|
|
|
{
|
|
|
|
byte *buf;
|
|
|
|
int x;
|
|
|
|
byte pal, pri, pad[6];
|
|
|
|
};
|
|
|
|
|
|
|
|
struct scan
|
|
|
|
{
|
|
|
|
int bg[64];
|
|
|
|
int wnd[64];
|
2005-11-16 22:59:28 +00:00
|
|
|
#if LCD_DEPTH == 1
|
|
|
|
byte buf[8][256];
|
|
|
|
#elif LCD_DEPTH == 2
|
|
|
|
byte buf[4][256];
|
|
|
|
#elif LCD_DEPTH > 4
|
2006-01-10 21:55:56 +00:00
|
|
|
byte buf[256];
|
2005-03-04 11:01:33 +00:00
|
|
|
#endif
|
2005-03-02 23:49:38 +00:00
|
|
|
byte pal1[128];
|
|
|
|
un16 pal2[64];
|
|
|
|
un32 pal4[64];
|
|
|
|
byte pri[256];
|
|
|
|
struct vissprite vs[16];
|
|
|
|
int ns, l, x, y, s, t, u, v, wx, wy, wt, wv;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct obj
|
|
|
|
{
|
|
|
|
byte y;
|
|
|
|
byte x;
|
|
|
|
byte pat;
|
|
|
|
byte flags;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct lcd
|
|
|
|
{
|
|
|
|
byte vbank[2][8192];
|
|
|
|
union
|
|
|
|
{
|
|
|
|
byte mem[256];
|
|
|
|
struct obj obj[40];
|
|
|
|
} oam;
|
|
|
|
byte pal[128];
|
|
|
|
};
|
|
|
|
|
|
|
|
extern struct lcd lcd;
|
|
|
|
extern struct scan scan;
|
|
|
|
|
|
|
|
|
2005-03-03 13:50:09 +00:00
|
|
|
void updatepatpix(void) ICODE_ATTR;
|
2006-01-20 13:05:52 +00:00
|
|
|
void tilebuf(void) ICODE_ATTR;
|
|
|
|
void bg_scan(void) ICODE_ATTR;
|
|
|
|
void wnd_scan(void) ICODE_ATTR;
|
|
|
|
void bg_scan_pri(void) ICODE_ATTR;
|
|
|
|
void wnd_scan_pri(void) ICODE_ATTR;
|
2005-03-02 23:49:38 +00:00
|
|
|
void spr_count(void);
|
2006-01-20 13:05:52 +00:00
|
|
|
void spr_enum(void) ICODE_ATTR;
|
|
|
|
void spr_scan(void) ICODE_ATTR;
|
|
|
|
void lcd_begin(void) ICODE_ATTR;
|
|
|
|
void lcd_refreshline(void) ICODE_ATTR;
|
2005-03-02 23:49:38 +00:00
|
|
|
void pal_write(int i, byte b);
|
2006-01-20 13:05:52 +00:00
|
|
|
void pal_write_dmg(int i, int mapnum, byte d) ICODE_ATTR;
|
|
|
|
void vram_write(int a, byte b) ICODE_ATTR;
|
|
|
|
void vram_dirty(void) ICODE_ATTR;
|
|
|
|
void pal_dirty(void) ICODE_ATTR;
|
2005-03-02 23:49:38 +00:00
|
|
|
void lcd_reset(void);
|
2005-07-03 14:05:12 +00:00
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|