summaryrefslogtreecommitdiffstats
path: root/uisimulator/sdl/lcd-sdl.c
diff options
context:
space:
mode:
Diffstat (limited to 'uisimulator/sdl/lcd-sdl.c')
-rw-r--r--uisimulator/sdl/lcd-sdl.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/uisimulator/sdl/lcd-sdl.c b/uisimulator/sdl/lcd-sdl.c
index a90efbd204..80a3c96a87 100644
--- a/uisimulator/sdl/lcd-sdl.c
+++ b/uisimulator/sdl/lcd-sdl.c
@@ -73,7 +73,11 @@ void lcd_update_rect(int x_start, int y_start, int width, int height)
#if LCD_DEPTH == 1
*p = ((lcd_framebuffer[y/8][x] >> (y & 7)) & 1);
#elif LCD_DEPTH == 2
+#if LCD_PIXELFORMAT == HORIZONTAL_PACKING
+ *p = ((lcd_framebuffer[y][x/4] >> (2 * (x & 3))) & 3);
+#else
*p = ((lcd_framebuffer[y/4][x] >> (2 * (y & 3))) & 3);
+#endif
#elif LCD_DEPTH == 16
#if LCD_PIXELFORMAT == RGB565SWAPPED
unsigned bits = lcd_framebuffer[y][x];