supporting caanoo, line doublers, refactoring
[libpicofe.git] / pandora / plat.c
index 5992f73..9951973 100644 (file)
@@ -39,7 +39,6 @@ static unsigned char __attribute__((aligned(4))) fb_copy[g_screen_width * g_scre
 unsigned char *PicoDraw2FB = temp_frame;\r
 const char *renderer_names[] = { NULL };\r
 const char *renderer_names32x[] = { NULL };\r
-char cpu_clk_name[] = "Max CPU clock";\r
 \r
 static int get_cpu_clock(void)\r
 {\r
@@ -115,12 +114,10 @@ static int emuscan(unsigned int num)
 \r
 void pemu_finalize_frame(const char *fps, const char *notice)\r
 {\r
-       if (notice || (currentConfig.EmuOpt & EOPT_SHOW_FPS)) {\r
-               if (notice)\r
-                       osd_text(2, g_osd_y, notice);\r
-               if (currentConfig.EmuOpt & EOPT_SHOW_FPS)\r
-                       osd_text(g_osd_fps_x, g_osd_y, fps);\r
-       }\r
+       if (notice && notice[0])\r
+               osd_text(2, g_osd_y, notice);\r
+       if (fps && fps[0] && (currentConfig.EmuOpt & EOPT_SHOW_FPS))\r
+               osd_text(g_osd_fps_x, g_osd_y, fps);\r
        if ((PicoAHW & PAHW_MCD) && (currentConfig.EmuOpt & EOPT_EN_CD_LEDS))\r
                draw_cd_leds();\r
 }\r
@@ -155,7 +152,7 @@ void plat_video_wait_vsync(void)
 \r
 void plat_status_msg_clear(void)\r
 {\r
-       vout_fbdev_clear_lines(layer_fb, g_screen_height - 8, 8);\r
+       vout_fbdev_clear_lines(layer_fb, g_osd_y, 8);\r
 }\r
 \r
 void plat_status_msg_busy_next(const char *msg)\r
@@ -339,7 +336,7 @@ int pnd_setup_layer(int enabled, int x, int y, int w, int h)
 \r
 void pnd_restore_layer_data(void)\r
 {\r
-       short *t = ((short *)fb_copy)[320*240 / 2 + 160];\r
+       short *t = (short *)fb_copy + 320*240 / 2 + 160;\r
 \r
        // right now this is used by menu, which wants to preview something\r
        // so try to get something on the layer.\r
@@ -373,9 +370,8 @@ void emu_video_mode_change(int start_line, int line_count, int is_32cols)
 {\r
        int fb_w = 320, fb_h = 240, fb_left = 0, fb_right = 0, fb_top = 0, fb_bottom = 0;\r
 \r
-       PicoScanBegin = emuscan;\r
-       PicoScanEnd = NULL;\r
        PicoDrawSetOutFormat(PDF_RGB555, 1);\r
+       PicoDrawSetCallbacks(emuscan, NULL);\r
 \r
        if (is_32cols) {\r
                fb_w = 256;\r
@@ -426,6 +422,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);\r
        vout_fbdev_resize(layer_fb, fb_w, fb_h, fb_left, fb_right, fb_top, fb_bottom, 0);\r
        vout_fbdev_clear(layer_fb);\r
+       plat_video_flip();\r
 }\r
 \r
 static void make_bg(void)\r