summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Chapman <dave@dchapman.com>2006-01-09 11:53:45 +0000
committerDave Chapman <dave@dchapman.com>2006-01-09 11:53:45 +0000
commit84e252827138bd289047050c587bd1f66f3d9307 (patch)
treec4e1102fa2072df34c364489a28d53f94b4916f3
parent0e419987e48b006104748118fa28161484b7dfa1 (diff)
downloadrockbox-84e252827138bd289047050c587bd1f66f3d9307.tar.gz
rockbox-84e252827138bd289047050c587bd1f66f3d9307.tar.bz2
rockbox-84e252827138bd289047050c587bd1f66f3d9307.zip
Fix RGB565SWAPPED lcd output
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8313 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--uisimulator/sdl/lcd-x11.c8
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 @@
#include <time.h>
#include "screenhack.h"
+#include "system.h"
#include "config.h"
/*
@@ -99,9 +100,10 @@ void lcd_update_rect(int x_start, int y_start,
colors[p] = SDL_MapRGB(surface->format, 255-gray, 255-gray, 255-gray);
#elif LCD_DEPTH == 16
#if LCD_PIXELFORMAT == RGB565SWAPPED
- unsigned b = ((lcd_framebuffer[y][x] >> 11) & 0x1f) << 3;
- unsigned g = ((lcd_framebuffer[y][x] >> 5) & 0x3f) << 2;
- unsigned r = ((lcd_framebuffer[y][x]) & 0x1f) << 3;
+ unsigned short pixel = swap16(lcd_framebuffer[y][x]);
+ unsigned r = ((pixel >> 11) & 0x1f) << 3;
+ unsigned g = ((pixel >> 5) & 0x3f) << 2;
+ unsigned b = (pixel & 0x1f) << 3;
points[p].x = x + MARGIN_X;
points[p].y = y + MARGIN_Y;
colors[p] = SDL_MapRGB(surface->format, r, g, b);