summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornotaz2009-06-08 01:57:08 +0300
committernotaz2009-06-08 01:57:08 +0300
commit5c6e71a06127c052326bf4dbae67d473030b6dc7 (patch)
tree2f4555f3afd21d0a985e7f470f4a5b9edfa539be
parent4c8082789e5c04ad4e2e4799994c27a1ff77e8bd (diff)
downloadpicogpsp-5c6e71a06127c052326bf4dbae67d473030b6dc7.tar.gz
picogpsp-5c6e71a06127c052326bf4dbae67d473030b6dc7.tar.bz2
picogpsp-5c6e71a06127c052326bf4dbae67d473030b6dc7.zip
use quad buffering, as emu sometimes runs ahead
-rw-r--r--gp2x/gp2x.c9
-rw-r--r--video.c5
2 files changed, 6 insertions, 8 deletions
diff --git a/gp2x/gp2x.c b/gp2x/gp2x.c
index 2107e61..eeefcf6 100644
--- a/gp2x/gp2x.c
+++ b/gp2x/gp2x.c
@@ -41,11 +41,11 @@ static volatile u32 *gpsp_gp2x_memregl;
#ifdef WIZ_BUILD
#include <linux/fb.h>
void *gpsp_gp2x_screen;
-static u32 fb_paddr[3];
-static void *fb_vaddr[3];
+#define fb_buf_count 4
+static u32 fb_paddr[fb_buf_count];
+static void *fb_vaddr[fb_buf_count];
static u32 fb_work_buf;
-const int fb_buf_count = 3;
-static int fb_buf_use = 3;
+static int fb_buf_use;
static void fb_video_init()
{
@@ -111,6 +111,7 @@ void fb_use_buffers(int count)
else if (count > fb_buf_count)
count = fb_buf_count;
fb_buf_use = count;
+ memset(fb_vaddr[0], 0, 320*240*2*count);
}
static void fb_video_exit()
diff --git a/video.c b/video.c
index 457a7b5..ada3fea 100644
--- a/video.c
+++ b/video.c
@@ -3702,10 +3702,7 @@ void video_resolution_small()
resolution_width = 240;
resolution_height = 160;
- fb_use_buffers(3);
- clear_screen(0);
- flip_screen();
- clear_screen(0);
+ fb_use_buffers(4);
flip_screen();
clear_screen(0);
}