#include "input_pico.h"
#include "version.h"
-// FIXME: these 2 shouldn't be here
-static unsigned char PicoDraw2FB_[(8+320) * (8+240+8)];
-unsigned char *PicoDraw2FB = PicoDraw2FB_;
-
static void *shadow_fb;
static const struct in_default_bind in_sdl_defbinds[] = {
gl_flip(shadow_fb, g_screen_width, g_screen_height);
}
else {
- // XXX: no locking, but should be fine with SDL_SWSURFACE?
+ if (SDL_MUSTLOCK(plat_sdl_screen))
+ SDL_UnlockSurface(plat_sdl_screen);
SDL_Flip(plat_sdl_screen);
g_screen_ptr = plat_sdl_screen->pixels;
+ PicoDrawSetOutBuf(g_screen_ptr, g_screen_width * 2);
}
}
void plat_video_menu_enter(int is_rom_loaded)
{
plat_sdl_change_video_mode(g_menuscreen_w, g_menuscreen_h, 0);
+ g_screen_ptr = shadow_fb;
}
void plat_video_menu_begin(void)
g_menuscreen_ptr = shadow_fb;
}
else {
- SDL_LockSurface(plat_sdl_screen);
+ if (SDL_MUSTLOCK(plat_sdl_screen))
+ SDL_LockSurface(plat_sdl_screen);
g_menuscreen_ptr = plat_sdl_screen->pixels;
}
}
gl_flip(g_menuscreen_ptr, g_menuscreen_w, g_menuscreen_h);
}
else {
- SDL_UnlockSurface(plat_sdl_screen);
+ if (SDL_MUSTLOCK(plat_sdl_screen))
+ SDL_UnlockSurface(plat_sdl_screen);
SDL_Flip(plat_sdl_screen);
}
g_menuscreen_ptr = NULL;
g_screen_ptr = shadow_fb;
}
else {
- SDL_LockSurface(plat_sdl_screen);
+ if (SDL_MUSTLOCK(plat_sdl_screen))
+ SDL_LockSurface(plat_sdl_screen);
g_screen_ptr = plat_sdl_screen->pixels;
}
+ PicoDrawSetOutBuf(g_screen_ptr, g_screen_width * 2);
}
void plat_early_init(void)
plat_sdl_quit_cb = plat_sdl_quit;
- SDL_WM_SetCaption("PicoDrive" VERSION, NULL);
+ SDL_WM_SetCaption("PicoDrive " VERSION, NULL);
g_menuscreen_w = plat_sdl_screen->w;
g_menuscreen_h = plat_sdl_screen->h;