Use 5_6_5 with SDL

This commit is contained in:
Jeffrey Pfau 2013-10-12 02:11:57 -07:00
parent 25cc40f3e1
commit cf298474bc
2 changed files with 6 additions and 1 deletions

View File

@ -32,6 +32,7 @@ if(BUILD_RASPI AND BUILD_EGL)
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)

View File

@ -405,7 +405,11 @@ static void GBAVideoSoftwareRendererDrawScanline(struct GBAVideoRenderer* render
#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));