Use 5_6_5 with SDL
Jeffrey Pfau jeffrey@endrift.com
Sat, 12 Oct 2013 02:11:57 -0700
2 files changed,
6 insertions(+),
1 deletions(-)
M
CMakeLists.txt
→
CMakeLists.txt
@@ -32,6 +32,7 @@ set(OPENGL_LIBRARY "-lEGL -lGLESv2 -lbcm_host")
set(OPENGL_INCLUDE_DIR "") add_definitions(-DBUILD_RASPI) elseif(BUILD_BBB OR BUILD_RASPI) + add_definitions(-DCOLOR_16_BIT -DCOLOR_5_6_5) set(MAIN_SRC ${CMAKE_SOURCE_DIR}/src/sdl-main.c) else() set(MAIN_SRC ${CMAKE_SOURCE_DIR}/src/gl-main.c)
M
src/gba/renderers/video-software.c
→
src/gba/renderers/video-software.c
@@ -405,7 +405,11 @@ }
#ifdef COLOR_16_BIT for (x = 0; x < VIDEO_HORIZONTAL_PIXELS; ++x) { - row[x] = softwareRenderer->row[x]; + uint32_t c = softwareRenderer->row[x]; +#ifdef COLOR_5_6_5 + c = ((c & 0x001F) << 11) | ((c & 0x03E0) << 1) | ((c & 0x7C00) >> 10); +#endif + row[x] = c; } #else memcpy(row, softwareRenderer->row, VIDEO_HORIZONTAL_PIXELS * sizeof(*row));