Skip to content
Permalink
Browse files

Fix setting pixels

Limit color depth to b/w only
  • Loading branch information...
matgoebl committed Oct 6, 2019
1 parent 22ec331 commit 2bb6adb578611e448bad2c7fabd8428aefc7bff6
Showing with 3 additions and 1 deletion.
  1. +3 −1 ESPVGAX.h
@@ -270,18 +270,20 @@ class ESPVGAX {
#define WRITE_PIXEL_BASE \
uint8_t *p=(uint8_t*)&fbb[y*ESPVGAX_BWIDTH + (x>>3)]; \
uint8_t shift=7-(x & 7); \
c&=1;
c=c>0?1:0;
WRITE_PIXEL_BASE;
*p&=~(1<<shift);
*p|= (c<<shift);
}
static inline void orpixel(int x, int y, uint8_t c) {
WRITE_PIXEL_BASE;
c=c>0?1:0;
*p|=(c<<shift);
}
static inline void xorpixel(int x, int y, uint8_t c) {
WRITE_PIXEL_BASE;
#undef WRITE_PIXEL_BASE
c=c>0?1:0;
*p^=(c<<shift);
#undef WRITE_PIXEL_BASE
}

0 comments on commit 2bb6adb

Please sign in to comment.
You can’t perform that action at this time.