diff --git a/src/platform/sdl/CMakeLists.txt b/src/platform/sdl/CMakeLists.txt index e95bef330..c54cfaf2b 100644 --- a/src/platform/sdl/CMakeLists.txt +++ b/src/platform/sdl/CMakeLists.txt @@ -18,12 +18,17 @@ file(GLOB PLATFORM_SRC ${CMAKE_SOURCE_DIR}/src/platform/sdl/sdl-*.c) set(PLATFORM_LIBRARY "${SDL_LIBRARY};${SDLMAIN_LIBRARY}") include_directories(${CMAKE_SOURCE_DIR}/src/platform/sdl) -if(BUILD_RASPI AND BUILD_EGL) - set(MAIN_SRC ${CMAKE_SOURCE_DIR}/src/platform/sdl/egl-main.c) - set(OPENGL_LIBRARY "-lEGL -lGLESv2 -lbcm_host") - set(OPENGL_INCLUDE_DIR "") +if(BUILD_RASPI) add_definitions(-DBUILD_RASPI) -elseif(BUILD_BBB OR BUILD_RASPI) + set(EGL_MAIN_SRC ${CMAKE_SOURCE_DIR}/src/platform/sdl/egl-main.c) + set(EGL_LIBRARY "-lEGL -lGLESv2 -lbcm_host") + add_executable(${BINARY_NAME}-rpi ${PLATFORM_SRC} ${EGL_MAIN_SRC}) + target_link_libraries(${BINARY_NAME}-rpi ${BINARY_NAME} ${PLATFORM_LIBRARY} ${EGL_LIBRARY}) +endif() + +if(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() set(MAIN_SRC ${CMAKE_SOURCE_DIR}/src/platform/sdl/gl-main.c) diff --git a/src/platform/egl-main.c b/src/platform/sdl/egl-main.c similarity index 95% rename from src/platform/egl-main.c rename to src/platform/sdl/egl-main.c index ef8196b90..52d403765 100644 --- a/src/platform/egl-main.c +++ b/src/platform/sdl/egl-main.c @@ -5,7 +5,7 @@ #include "sdl-audio.h" #include "sdl-events.h" -#include +#include #include #include @@ -76,7 +76,6 @@ int main(int argc, char** argv) { return 1; } - struct GBAThread context; struct GBAVideoEGLRenderer renderer; if (!_GBAEGLInit(&renderer)) { @@ -84,16 +83,19 @@ int main(int argc, char** argv) { } GBAVideoSoftwareRendererCreate(&renderer.d); - context.fd = fd; - context.fname = fname; - context.useDebugger = 0; - context.renderer = &renderer.d.d; - context.frameskip = 0; - context.sync.videoFrameWait = 0; - context.sync.audioWait = 1; - context.startCallback = _GBASDLStart; - context.cleanCallback = _GBASDLClean; - context.userData = &renderer; + struct GBAThread context = { + .fd = fd, + .fname = fname, + .biosFd = -1, + .useDebugger = 0, + .renderer = &renderer.d.d, + .frameskip = 0, + .sync.videoFrameWait = 0, + .sync.audioWait = 0, + .startCallback = _GBASDLStart, + .cleanCallback = _GBASDLClean, + .userData = &renderer + }; GBAThreadStart(&context); _GBAEGLRunloop(&context, &renderer);