1
0
Fork 0

Add support for blitting to the Infinity LCD

This commit is contained in:
Fred Sundvik 2017-04-01 16:36:34 +03:00
parent 2b24d35846
commit a8f5897b97
3 changed files with 33 additions and 6 deletions

View file

@ -254,6 +254,32 @@ LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay *g) {
}
#endif
LLDSPEC void gdisp_lld_blit_area(GDisplay *g) {
uint8_t* buffer = (uint8_t*)g->p.ptr;
int linelength = g->p.cx;
for (int i = 0; i < g->p.cy; i++) {
unsigned dstx = g->p.x;
unsigned dsty = g->p.y + i;
unsigned srcx = g->p.x1;
unsigned srcy = g->p.y1 + i;
unsigned srcbit = srcy * g->p.x2 + srcx;
for(int j=0; j < linelength; j++) {
uint8_t src = buffer[srcbit / 8];
uint8_t bit = 7-(srcbit % 8);
uint8_t bitset = (src >> bit) & 1;
uint8_t* dst = &(RAM(g)[xyaddr(dstx, dsty)]);
if (bitset) {
*dst |= xybit(dsty);
}
else {
*dst &= ~xybit(dsty);
}
dstx++;
srcbit++;
}
}
}
#if GDISP_NEED_CONTROL && GDISP_HARDWARE_CONTROL
LLDSPEC void gdisp_lld_control(GDisplay *g) {
switch(g->p.x) {

View file

@ -14,12 +14,13 @@
/* Driver hardware support. */
/*===========================================================================*/
#define GDISP_HARDWARE_FLUSH TRUE // This controller requires flushing
#define GDISP_HARDWARE_DRAWPIXEL TRUE
#define GDISP_HARDWARE_PIXELREAD TRUE
#define GDISP_HARDWARE_CONTROL TRUE
#define GDISP_HARDWARE_FLUSH TRUE // This controller requires flushing
#define GDISP_HARDWARE_DRAWPIXEL TRUE
#define GDISP_HARDWARE_PIXELREAD TRUE
#define GDISP_HARDWARE_CONTROL TRUE
#define GDISP_HARDWARE_BITFILLS TRUE
#define GDISP_LLD_PIXELFORMAT GDISP_PIXELFORMAT_MONO
#define GDISP_LLD_PIXELFORMAT GDISP_PIXELFORMAT_MONO
#endif /* GFX_USE_GDISP */

View file

@ -143,7 +143,7 @@
#define GDISP_HARDWARE_DRAWPIXEL TRUE
#define GDISP_HARDWARE_CLEARS FALSE
#define GDISP_HARDWARE_FILLS FALSE
#define GDISP_HARDWARE_BITFILLS FALSE
//#define GDISP_HARDWARE_BITFILLS FALSE
#define GDISP_HARDWARE_SCROLL FALSE
#define GDISP_HARDWARE_PIXELREAD TRUE
#define GDISP_HARDWARE_CONTROL TRUE