all repos — mgba @ ba41f68149e04d110a2f3107efe2e2111e9224d9

mGBA Game Boy Advance Emulator

SDL: Fix Pandora build
Jeffrey Pfau jeffrey@endrift.com
Sun, 11 Oct 2015 20:31:01 -0700
commit

ba41f68149e04d110a2f3107efe2e2111e9224d9

parent

d9a60540f7af478cdc996ccf8b8346f36eca4ae3

1 files changed, 13 insertions(+), 3 deletions(-)

jump to
M src/platform/sdl/pandora-sdl.csrc/platform/sdl/pandora-sdl.c

@@ -12,7 +12,17 @@ #include <linux/fb.h>

#include <sys/ioctl.h> #include <sys/mman.h> -bool GBASDLInit(struct SDLSoftwareRenderer* renderer) { +static bool GBASDLGLInit(struct SDLSoftwareRenderer* renderer); +static void GBASDLGLRunloop(struct GBAThread* context, struct SDLSoftwareRenderer* renderer); +static void GBASDLGLDeinit(struct SDLSoftwareRenderer* renderer); + +void GBASDLGLCreate(struct SDLSoftwareRenderer* renderer) { + renderer->init = GBASDLGLInit; + renderer->deinit = GBASDLGLDeinit; + renderer->runloop = GBASDLGLRunloop; +} + +bool GBASDLGLInit(struct SDLSoftwareRenderer* renderer) { SDL_SetVideoMode(800, 480, 16, SDL_FULLSCREEN); renderer->odd = 0;

@@ -63,7 +73,7 @@ renderer->d.outputBufferStride = VIDEO_HORIZONTAL_PIXELS;

return true; } -void GBASDLRunloop(struct GBAThread* context, struct SDLSoftwareRenderer* renderer) { +void GBASDLGLRunloop(struct GBAThread* context, struct SDLSoftwareRenderer* renderer) { SDL_Event event; while (context->state < THREAD_EXITING) {

@@ -87,7 +97,7 @@ GBASyncWaitFrameEnd(&context->sync);

} } -void GBASDLDeinit(struct SDLSoftwareRenderer* renderer) { +void GBASDLGLDeinit(struct SDLSoftwareRenderer* renderer) { munmap(renderer->base[0], VIDEO_HORIZONTAL_PIXELS * VIDEO_VERTICAL_PIXELS * 4); struct omapfb_plane_info plane;