notaz.gp2x.de
/
picodrive.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add a couple of fixes to allow double buffering to work
[picodrive.git]
/
platform
/
common
/
plat_sdl.c
diff --git
a/platform/common/plat_sdl.c
b/platform/common/plat_sdl.c
index
8ea266f
..
fc7b200
100644
(file)
--- a/
platform/common/plat_sdl.c
+++ b/
platform/common/plat_sdl.c
@@
-17,10
+17,6
@@
#include "input_pico.h"
#include "version.h"
#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[] = {
static void *shadow_fb;
static const struct in_default_bind in_sdl_defbinds[] = {
@@
-129,9
+125,11
@@
void plat_video_flip(void)
gl_flip(shadow_fb, g_screen_width, g_screen_height);
}
else {
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;
SDL_Flip(plat_sdl_screen);
g_screen_ptr = plat_sdl_screen->pixels;
+ PicoDrawSetOutBuf(g_screen_ptr, g_screen_width * 2);
}
}
}
}
@@
-142,6
+140,7
@@
void plat_video_wait_vsync(void)
void plat_video_menu_enter(int is_rom_loaded)
{
plat_sdl_change_video_mode(g_menuscreen_w, g_menuscreen_h, 0);
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)
}
void plat_video_menu_begin(void)
@@
-150,7
+149,8
@@
void plat_video_menu_begin(void)
g_menuscreen_ptr = shadow_fb;
}
else {
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;
}
}
g_menuscreen_ptr = plat_sdl_screen->pixels;
}
}
@@
-172,7
+172,8
@@
void plat_video_menu_end(void)
gl_flip(g_menuscreen_ptr, g_menuscreen_w, g_menuscreen_h);
}
else {
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;
SDL_Flip(plat_sdl_screen);
}
g_menuscreen_ptr = NULL;
@@
-191,9
+192,11
@@
void plat_video_loop_prepare(void)
g_screen_ptr = shadow_fb;
}
else {
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;
}
g_screen_ptr = plat_sdl_screen->pixels;
}
+ PicoDrawSetOutBuf(g_screen_ptr, g_screen_width * 2);
}
void plat_early_init(void)
}
void plat_early_init(void)