diff --git a/src/target/common/emu/fltk.cpp b/src/target/common/emu/fltk.cpp index 974049e5b3..75bd48a593 100755 --- a/src/target/common/emu/fltk.cpp +++ b/src/target/common/emu/fltk.cpp @@ -665,8 +665,42 @@ void PWR_Sleep() { void LCD_ForceUpdate() { if (changed) { changed = false; +#ifdef BUILDTYPE_DEV + for (int x = 0; x < LCD_WIDTH; x++) + for (int y = 0; y < LCD_HEIGHT; y++) { + switch(gui.pixel_tracking[x][y]) { + case 0: + case 1: + break; + + case 2: + // draw as blue + gui.image[3*(LCD_WIDTH*y+x)] >>= 3; + gui.image[3*(LCD_WIDTH*y+x)+1] >>= 3; + gui.image[3*(LCD_WIDTH*y+x)+2] |= 0xC0; + + break; + + case 3: + // draw as green + gui.image[3*(LCD_WIDTH*y+x)] >>= 3; + gui.image[3*(LCD_WIDTH*y+x)+1] |= 0xC0; + gui.image[3*(LCD_WIDTH*y+x)+2] >>= 3; + break; + + default: + // draw as red + gui.image[3*(LCD_WIDTH*y+x)] |= 0xC0; + gui.image[3*(LCD_WIDTH*y+x)+1] >>= 3; + gui.image[3*(LCD_WIDTH*y+x)+2] >>= 3; + break; + } + } +#endif image->redraw(); Fl::check(); } + + memset(gui.pixel_tracking, 0, sizeof(gui.pixel_tracking)); } } //extern "C" diff --git a/src/target/common/emu/fltk.h b/src/target/common/emu/fltk.h index a42b5c7e8b..906441be25 100755 --- a/src/target/common/emu/fltk.h +++ b/src/target/common/emu/fltk.h @@ -60,6 +60,7 @@ struct Gui { Fl_Output *final[12]; u32 last_redraw; u8 image[IMAGE_X*IMAGE_Y*3]; + u8 pixel_tracking[IMAGE_X][IMAGE_Y]; #if SCREEN_RESIZE u8 scaled_img[SCREEN_X*SCREEN_Y*3]; #endif diff --git a/src/target/emu_devo8/lcd.c b/src/target/emu_devo8/lcd.c index 81b3fd240d..e5e0523596 100644 --- a/src/target/emu_devo8/lcd.c +++ b/src/target/emu_devo8/lcd.c @@ -26,6 +26,8 @@ void LCD_DrawPixel(unsigned int color) gui.image[3*(LCD_WIDTH*gui.y+gui.x)] = r; gui.image[3*(LCD_WIDTH*gui.y+gui.x)+1] = g; gui.image[3*(LCD_WIDTH*gui.y+gui.x)+2] = b; + + gui.pixel_tracking[gui.x][gui.y]++; } // this must be executed to continue drawing in the next row gui.x++;