pandora: use quad buffering so that ff doesn't tear

also fix frame counter overflowing fb
This commit is contained in:
notaz 2013-08-12 01:50:03 +03:00
parent 001f73a0d6
commit b011c2af39
2 changed files with 9 additions and 7 deletions

View file

@ -1370,10 +1370,8 @@ void emu_loop(void)
sprintf(fpsbuff, "%02i/%02i/%02i", frames_shown, bench_fps_s, (bf[0]+bf[1]+bf[2]+bf[3])>>2); sprintf(fpsbuff, "%02i/%02i/%02i", frames_shown, bench_fps_s, (bf[0]+bf[1]+bf[2]+bf[3])>>2);
printf("%s\n", fpsbuff); printf("%s\n", fpsbuff);
#else #else
if (currentConfig.EmuOpt & EOPT_SHOW_FPS) { if (currentConfig.EmuOpt & EOPT_SHOW_FPS)
sprintf(fpsbuff, "%02i/%02i", frames_shown, frames_done); sprintf(fpsbuff, "%02i/%02i ", frames_shown, frames_done);
if (fpsbuff[5] == 0) { fpsbuff[5] = fpsbuff[6] = ' '; fpsbuff[7] = 0; }
}
#endif #endif
frames_shown = frames_done = 0; frames_shown = frames_done = 0;
timestamp_fps += ms_to_ticks(1000); timestamp_fps += ms_to_ticks(1000);

View file

@ -73,6 +73,7 @@ static struct in_default_bind in_evdev_defbinds[] =
{ KEY_S, IN_BINDTYPE_PLAYER12, GBTN_B }, { KEY_S, IN_BINDTYPE_PLAYER12, GBTN_B },
{ KEY_D, IN_BINDTYPE_PLAYER12, GBTN_C }, { KEY_D, IN_BINDTYPE_PLAYER12, GBTN_C },
{ KEY_ENTER, IN_BINDTYPE_PLAYER12, GBTN_START }, { KEY_ENTER, IN_BINDTYPE_PLAYER12, GBTN_START },
{ KEY_F, IN_BINDTYPE_EMU, PEVB_FF },
{ KEY_BACKSLASH, IN_BINDTYPE_EMU, PEVB_MENU }, { KEY_BACKSLASH, IN_BINDTYPE_EMU, PEVB_MENU },
{ KEY_SPACE, IN_BINDTYPE_EMU, PEVB_MENU }, { KEY_SPACE, IN_BINDTYPE_EMU, PEVB_MENU },
/* Pandora */ /* Pandora */
@ -104,10 +105,13 @@ static void osd_text(int x, int y, const char *text)
int i, h; int i, h;
len++; len++;
if (x + len > g_screen_width)
len = g_screen_width - x;
for (h = 0; h < 8; h++) { for (h = 0; h < 8; h++) {
unsigned short *p; unsigned short *p;
p = (unsigned short *)g_screen_ptr + x + g_screen_width*(y + h); p = (unsigned short *)g_screen_ptr + x + g_screen_width*(y + h);
for (i = len; i; i--, p++) for (i = len; i > 0; i--, p++)
*p = (*p>>2) & 0x39e7; *p = (*p>>2) & 0x39e7;
} }
emu_text_out16(x, y, text); emu_text_out16(x, y, text);
@ -348,7 +352,7 @@ void emu_video_mode_change(int start_line, int line_count, int is_32cols)
pnd_setup_layer(1, g_layer_x, g_layer_y, g_layer_w, g_layer_h); pnd_setup_layer(1, g_layer_x, g_layer_y, g_layer_w, g_layer_h);
vout_fbdev_clear(layer_fb); vout_fbdev_clear(layer_fb);
vout_fbdev_resize(layer_fb, fb_w, fb_h, 16, fb_left, fb_right, fb_top, fb_bottom, 3); vout_fbdev_resize(layer_fb, fb_w, fb_h, 16, fb_left, fb_right, fb_top, fb_bottom, 4);
plat_video_flip(); plat_video_flip();
PicoDrawSetOutFormat(PDF_RGB555, 0); PicoDrawSetOutFormat(PDF_RGB555, 0);
@ -447,7 +451,7 @@ void plat_init(void)
g_menuscreen_ptr = vout_fbdev_flip(main_fb); g_menuscreen_ptr = vout_fbdev_flip(main_fb);
w = 320; h = 240; w = 320; h = 240;
layer_fb = vout_fbdev_init(layer_fb_name, &w, &h, 16, 3); layer_fb = vout_fbdev_init(layer_fb_name, &w, &h, 16, 4);
if (layer_fb == NULL) { if (layer_fb == NULL) {
fprintf(stderr, "couldn't init fb: %s\n", layer_fb_name); fprintf(stderr, "couldn't init fb: %s\n", layer_fb_name);
goto fail0; goto fail0;