all repos — mgba @ 2f39a575672e95c5e073518fa0b91e8ac60cbd11

mGBA Game Boy Advance Emulator

Get RPi EGL port building again
Jeffrey Pfau jeffrey@endrift.com
Fri, 31 Jan 2014 21:52:07 -0800
commit

2f39a575672e95c5e073518fa0b91e8ac60cbd11

parent

8f241e2cfb4fb10c8d7a33976d07db926db6d2ac

2 files changed, 24 insertions(+), 17 deletions(-)

jump to
M src/platform/egl-main.csrc/platform/sdl/egl-main.c

@@ -5,7 +5,7 @@ #include "renderers/video-software.h"

#include "sdl-audio.h" #include "sdl-events.h" -#include <SDL.h> +#include <SDL/SDL.h> #include <GLES2/gl2.h> #include <EGL/egl.h>

@@ -76,7 +76,6 @@ if (fd < 0) {

return 1; } - struct GBAThread context; struct GBAVideoEGLRenderer renderer; if (!_GBAEGLInit(&renderer)) {

@@ -84,16 +83,19 @@ return 1;

} 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);
M src/platform/sdl/CMakeLists.txtsrc/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)