all repos — mgba @ cf298474bcaf57a6c10cfcbe050eb61e630c269f

mGBA Game Boy Advance Emulator

Use 5_6_5 with SDL
Jeffrey Pfau jeffrey@endrift.com
Sat, 12 Oct 2013 02:11:57 -0700
commit

cf298474bcaf57a6c10cfcbe050eb61e630c269f

parent

25cc40f3e16871faf2950bd9e524e5a2d4923501

2 files changed, 6 insertions(+), 1 deletions(-)

jump to
M CMakeLists.txtCMakeLists.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.csrc/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));