pandora: use quad buffering so that ff doesn't tear
authornotaz <notasas@gmail.com>
Sun, 11 Aug 2013 22:50:03 +0000 (01:50 +0300)
committernotaz <notasas@gmail.com>
Wed, 14 Aug 2013 00:37:45 +0000 (03:37 +0300)
also fix frame counter overflowing fb

platform/common/emu.c
platform/pandora/plat.c

index 4098bd2..1573d12 100644 (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);\r
                        printf("%s\n", fpsbuff);\r
 #else\r
-                       if (currentConfig.EmuOpt & EOPT_SHOW_FPS) {\r
-                               sprintf(fpsbuff, "%02i/%02i", frames_shown, frames_done);\r
-                               if (fpsbuff[5] == 0) { fpsbuff[5] = fpsbuff[6] = ' '; fpsbuff[7] = 0; }\r
-                       }\r
+                       if (currentConfig.EmuOpt & EOPT_SHOW_FPS)\r
+                               sprintf(fpsbuff, "%02i/%02i  ", frames_shown, frames_done);\r
 #endif\r
                        frames_shown = frames_done = 0;\r
                        timestamp_fps += ms_to_ticks(1000);\r
index a9fa992..306f2c3 100644 (file)
@@ -73,6 +73,7 @@ static struct in_default_bind in_evdev_defbinds[] =
        { KEY_S,        IN_BINDTYPE_PLAYER12, GBTN_B },\r
        { KEY_D,        IN_BINDTYPE_PLAYER12, GBTN_C },\r
        { KEY_ENTER,    IN_BINDTYPE_PLAYER12, GBTN_START },\r
+       { KEY_F,        IN_BINDTYPE_EMU, PEVB_FF },\r
        { KEY_BACKSLASH, IN_BINDTYPE_EMU, PEVB_MENU },\r
        { KEY_SPACE,    IN_BINDTYPE_EMU, PEVB_MENU },\r
        /* Pandora */\r
@@ -104,10 +105,13 @@ static void osd_text(int x, int y, const char *text)
        int i, h;\r
 \r
        len++;\r
+       if (x + len > g_screen_width)\r
+               len = g_screen_width - x;\r
+\r
        for (h = 0; h < 8; h++) {\r
                unsigned short *p;\r
                p = (unsigned short *)g_screen_ptr + x + g_screen_width*(y + h);\r
-               for (i = len; i; i--, p++)\r
+               for (i = len; i > 0; i--, p++)\r
                        *p = (*p>>2) & 0x39e7;\r
        }\r
        emu_text_out16(x, y, text);\r
@@ -348,7 +352,7 @@ void emu_video_mode_change(int start_line, int line_count, int is_32cols)
 \r
        pnd_setup_layer(1, g_layer_x, g_layer_y, g_layer_w, g_layer_h);\r
        vout_fbdev_clear(layer_fb);\r
-       vout_fbdev_resize(layer_fb, fb_w, fb_h, 16, fb_left, fb_right, fb_top, fb_bottom, 3);\r
+       vout_fbdev_resize(layer_fb, fb_w, fb_h, 16, fb_left, fb_right, fb_top, fb_bottom, 4);\r
        plat_video_flip();\r
 \r
        PicoDrawSetOutFormat(PDF_RGB555, 0);\r
@@ -447,7 +451,7 @@ void plat_init(void)
        g_menuscreen_ptr = vout_fbdev_flip(main_fb);\r
 \r
        w = 320; h = 240;\r
-       layer_fb = vout_fbdev_init(layer_fb_name, &w, &h, 16, 3);\r
+       layer_fb = vout_fbdev_init(layer_fb_name, &w, &h, 16, 4);\r
        if (layer_fb == NULL) {\r
                fprintf(stderr, "couldn't init fb: %s\n", layer_fb_name);\r
                goto fail0;\r