Fast 32-to-16-bit memory conversion routine on ARM

This commit is contained in:
Jeffrey Pfau 2013-11-07 23:53:16 -08:00
parent 95b6cc9b00
commit 53dd260b3e
2 changed files with 6 additions and 1 deletions

View File

@ -7,7 +7,7 @@ set(USE_DEBUGGER ON CACHE BOOL "Whether or not to enable the ARM debugger")
set(EXTRA_LIB "")
file(GLOB ARM_SRC ${CMAKE_SOURCE_DIR}/src/arm/*.c)
file(GLOB GBA_SRC ${CMAKE_SOURCE_DIR}/src/gba/*.c)
file(GLOB UTIL_SRC ${CMAKE_SOURCE_DIR}/src/util/*.c)
file(GLOB UTIL_SRC ${CMAKE_SOURCE_DIR}/src/util/*.[cS])
file(GLOB RENDERER_SRC ${CMAKE_SOURCE_DIR}/src/gba/renderers/video-software.c)
include_directories(${CMAKE_SOURCE_DIR}/src/arm)
include_directories(${CMAKE_SOURCE_DIR}/src/gba)
@ -33,6 +33,7 @@ if(BUILD_RASPI AND BUILD_EGL)
set(OPENGL_INCLUDE_DIR "")
add_definitions(-DBUILD_RASPI)
elseif(BUILD_BBB OR BUILD_RASPI)
enable_language(ASM)
add_definitions(-DCOLOR_16_BIT -DCOLOR_5_6_5)
set(MAIN_SRC ${CMAKE_SOURCE_DIR}/src/platform/sdl/sw-main.c)
else()

View File

@ -407,9 +407,13 @@ static void GBAVideoSoftwareRendererDrawScanline(struct GBAVideoRenderer* render
}
#ifdef COLOR_16_BIT
#ifdef __arm__
_to16Bit(row, softwareRenderer->row, VIDEO_HORIZONTAL_PIXELS);
#else
for (x = 0; x < VIDEO_HORIZONTAL_PIXELS; ++x) {
row[x] = softwareRenderer->row[x];
}
#endif
#else
memcpy(row, softwareRenderer->row, VIDEO_HORIZONTAL_PIXELS * sizeof(*row));
#endif