a1842c04f9
With LCD driver all calculation will be performed on RGB888 and the hardware/OS can display from our 24bit framebuffer. It is not yet as performance optimized as the existing drivers but should be good enough.The vast number of small changes is due to the fact that fb_data can be a struct type now, while most of the code expected a scalar type. lcd-as-memframe ASM code does not work with 24bit currently so the with 24bit it enforces the generic C code. All plugins are ported over. Except for rockpaint. It uses so much memory that it wouldnt fit into the 512k plugin buffer anymore (patches welcome). Change-Id: Ibb1964545028ce0d8ff9833ccc3ab66be3ee0754
64 lines
1,020 B
C
64 lines
1,020 B
C
|
|
|
|
#ifndef __LCD_GB_H__
|
|
#define __LCD_GB_H__
|
|
|
|
#include "lcd.h"
|
|
#include "defs.h"
|
|
|
|
struct vissprite
|
|
{
|
|
byte *buf;
|
|
int x;
|
|
byte pal, pri;
|
|
};
|
|
|
|
struct scan
|
|
{
|
|
int bg[64];
|
|
int wnd[64];
|
|
#if LCD_DEPTH == 1
|
|
byte buf[8][256];
|
|
#elif LCD_DEPTH == 2
|
|
byte buf[4][256];
|
|
#elif LCD_DEPTH > 4
|
|
byte buf[256];
|
|
#endif
|
|
fb_data pal[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;
|
|
|
|
void lcd_begin(void) ICODE_ATTR;
|
|
void lcd_refreshline(void) ICODE_ATTR;
|
|
void pal_write(int i, byte b) ICODE_ATTR;
|
|
void pal_write_dmg(int i, int mapnum, byte d) ICODE_ATTR;
|
|
void vram_write(addr a, byte b) ICODE_ATTR;
|
|
void vram_dirty(void) ICODE_ATTR;
|
|
void pal_dirty(void) ICODE_ATTR;
|
|
void lcd_reset(void);
|
|
|
|
#endif
|