Lua drawBitmap on X7

This commit is contained in:
Bertrand Songis
2017-08-04 12:08:10 +02:00
committed by Kilrah
parent c82c7ee5db
commit 541aa459cf
7 changed files with 193 additions and 13 deletions
+21 -1
View File
@@ -1487,6 +1487,25 @@ void lcdDrawChar(coord_t x, uint8_t y, const unsigned char c, LcdFlags flags)
}
#endif
#if defined(CPUARM)
void lcdDraw1bitBitmap(coord_t x, coord_t y, const uint8_t * img, uint8_t idx, LcdFlags att)
{
const uint8_t * q = img;
uint8_t w = *q++;
uint8_t hb = ((*q++) + 7) / 8;
bool inv = (att & INVERS) ? true : (att & BLINK ? BLINK_ON_PHASE : false);
q += idx*w*hb;
for (uint8_t yb = 0; yb < hb; yb++) {
uint8_t *p = &displayBuf[(y / 8 + yb) * LCD_W + x];
for (coord_t i=0; i<w; i++){
uint8_t b = *q++;
if (p < DISPLAY_END) {
*p++ = inv ? ~b : b;
}
}
}
}
#else
#define LCD_IMG_FUNCTION(NAME, TYPE, READ_BYTE) \
void NAME(coord_t x, coord_t y, TYPE img, uint8_t idx, LcdFlags att) \
{ \
@@ -1496,7 +1515,7 @@ void NAME(coord_t x, coord_t y, TYPE img, uint8_t idx, LcdFlags att) \
bool inv = (att & INVERS) ? true : (att & BLINK ? BLINK_ON_PHASE : false); \
q += idx*w*hb; \
for (uint8_t yb = 0; yb < hb; yb++) { \
uint8_t *p = &displayBuf[ (y / 8 + yb) * LCD_W + x ]; \
uint8_t *p = &displayBuf[(y / 8 + yb) * LCD_W + x]; \
for (coord_t i=0; i<w; i++){ \
uint8_t b = READ_BYTE(q); \
q++; \
@@ -1511,6 +1530,7 @@ LCD_IMG_FUNCTION(lcd_imgfar, uint_farptr_t, pgm_read_byte_far)
#endif
LCD_IMG_FUNCTION(lcdDraw1bitBitmap, const pm_uchar *, pgm_read_byte)
#endif
#endif