diff options
Diffstat (limited to 'uisimulator/sdl/lcd-x11.c')
-rw-r--r-- | uisimulator/sdl/lcd-x11.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/uisimulator/sdl/lcd-x11.c b/uisimulator/sdl/lcd-x11.c index 3ab5bc0e16..4dcd325545 100644 --- a/uisimulator/sdl/lcd-x11.c +++ b/uisimulator/sdl/lcd-x11.c | |||
@@ -31,6 +31,7 @@ | |||
31 | #include <time.h> | 31 | #include <time.h> |
32 | 32 | ||
33 | #include "screenhack.h" | 33 | #include "screenhack.h" |
34 | #include "system.h" | ||
34 | #include "config.h" | 35 | #include "config.h" |
35 | 36 | ||
36 | /* | 37 | /* |
@@ -99,9 +100,10 @@ void lcd_update_rect(int x_start, int y_start, | |||
99 | colors[p] = SDL_MapRGB(surface->format, 255-gray, 255-gray, 255-gray); | 100 | colors[p] = SDL_MapRGB(surface->format, 255-gray, 255-gray, 255-gray); |
100 | #elif LCD_DEPTH == 16 | 101 | #elif LCD_DEPTH == 16 |
101 | #if LCD_PIXELFORMAT == RGB565SWAPPED | 102 | #if LCD_PIXELFORMAT == RGB565SWAPPED |
102 | unsigned b = ((lcd_framebuffer[y][x] >> 11) & 0x1f) << 3; | 103 | unsigned short pixel = swap16(lcd_framebuffer[y][x]); |
103 | unsigned g = ((lcd_framebuffer[y][x] >> 5) & 0x3f) << 2; | 104 | unsigned r = ((pixel >> 11) & 0x1f) << 3; |
104 | unsigned r = ((lcd_framebuffer[y][x]) & 0x1f) << 3; | 105 | unsigned g = ((pixel >> 5) & 0x3f) << 2; |
106 | unsigned b = (pixel & 0x1f) << 3; | ||
105 | points[p].x = x + MARGIN_X; | 107 | points[p].x = x + MARGIN_X; |
106 | points[p].y = y + MARGIN_Y; | 108 | points[p].y = y + MARGIN_Y; |
107 | colors[p] = SDL_MapRGB(surface->format, r, g, b); | 109 | colors[p] = SDL_MapRGB(surface->format, r, g, b); |