move layer control to plugin/plugin_lib
authornotaz <notasas@gmail.com>
Tue, 28 Dec 2010 16:33:34 +0000 (18:33 +0200)
committernotaz <notasas@gmail.com>
Tue, 28 Dec 2010 16:33:34 +0000 (18:33 +0200)
frontend/menu.c
frontend/plugin_lib.c
frontend/plugin_lib.h
plugins/dfxvideo/draw_fb.c

index 04a22fa..e46b50f 100644 (file)
@@ -1032,13 +1032,16 @@ void menu_notify_mode_change(int w, int h, int bpp)
        if (scaling == SCALE_1_1) {
                g_layer_x = 800/2 - w/2;  g_layer_y = 480/2 - h/2;
                g_layer_w = w; g_layer_h = h;
-               omap_enable_layer(1);
        }
 }
 
 static void menu_leave_emu(void)
 {
-       omap_enable_layer(0);
+       if (GPU_close != NULL) {
+               int ret = GPU_close();
+               if (ret)
+                       fprintf(stderr, "Warning: GPU_close returned %d\n", ret);
+       }
 
        memcpy(g_menubg_ptr, g_menubg_src_ptr, g_menuscreen_w * g_menuscreen_h * 2);
        if (ready_to_go && last_psx_bpp == 16) {
@@ -1077,7 +1080,6 @@ void menu_prepare_emu(void)
        case SCALE_CUSTOM:
                break;
        }
-       omap_enable_layer(1);
        apply_filter(filter);
        apply_cpu_clock();
        stop = 0;
@@ -1086,6 +1088,13 @@ void menu_prepare_emu(void)
        // so handle them manually here
        if (Config.Cdda)
                CDR_stop();
+
+       if (GPU_open != NULL) {
+               extern unsigned long gpuDisp;
+               int ret = GPU_open(&gpuDisp, "PCSX", NULL);
+               if (ret)
+                       fprintf(stderr, "Warning: GPU_open returned %d\n", ret);
+       }
 }
 
 void me_update_msg(const char *msg)
index 800a1ae..0ca45ce 100644 (file)
@@ -62,12 +62,6 @@ static void print_cpu_usage(void)
                pl_text_out16(pl_fbdev_w - 28, pl_fbdev_h - 10, "%3d", tick_per_sec);
 }
 
-int pl_fbdev_init(void)
-{
-       pl_fbdev_buf = vout_fbdev_flip(layer_fb);
-       return 0;
-}
-
 int pl_fbdev_set_mode(int w, int h, int bpp)
 {
        void *ret;
@@ -103,8 +97,16 @@ void pl_fbdev_flip(void)
        pl_fbdev_buf = vout_fbdev_flip(layer_fb);
 }
 
-void pl_fbdev_finish(void)
+int pl_fbdev_open(void)
+{
+       pl_fbdev_buf = vout_fbdev_flip(layer_fb);
+       omap_enable_layer(1);
+       return 0;
+}
+
+void pl_fbdev_close(void)
 {
+       omap_enable_layer(0);
 }
 
 static void update_input(void)
index a1400e9..81999a3 100644 (file)
@@ -21,10 +21,10 @@ enum {
 
 extern void *pl_fbdev_buf;
 
-int   pl_fbdev_init(void);
+int   pl_fbdev_open(void);
 int   pl_fbdev_set_mode(int w, int h, int bpp);
 void  pl_fbdev_flip(void);
-void  pl_fbdev_finish(void);
+void  pl_fbdev_close(void);
 
 void  pl_text_out16(int x, int y, const char *texto, ...);
 
index 3e241d7..64657bb 100644 (file)
@@ -137,7 +137,7 @@ unsigned long ulInitDisplay(void)
  iShowFPS=1;
  initialize();
 
- if (pl_fbdev_init() != 0)
+ if (pl_fbdev_open() != 0)
   return 0;
 
  return 1; /* ok */
@@ -146,7 +146,7 @@ unsigned long ulInitDisplay(void)
 void CloseDisplay(void)
 {
  CloseMenu();
- pl_fbdev_finish();
+ pl_fbdev_close();
  //WriteConfig();
 }