fix bgr2rgb16 and reduce mode change glitching
[pcsx_rearmed.git] / frontend / plugin_lib.c
index 7d5e15f..35a23c1 100644 (file)
@@ -28,14 +28,18 @@ int pl_fbdev_init(void)
 
 int pl_fbdev_set_mode(int w, int h, int bpp)
 {
-       int ret;
+       void *ret;
 
        pl_fbdev_w = w;
-       printf("set mode %dx%d@%d\n", w, h, bpp);
+
+       vout_fbdev_clear(layer_fb);
        ret = vout_fbdev_resize(layer_fb, w, h, bpp, 0, 0, 0, 0, 3);
-       if (ret)
+       if (ret == NULL)
                fprintf(stderr, "failed to set mode\n");
-       return ret;
+       else
+               pl_fbdev_buf = ret;
+
+       return (ret != NULL) ? 0 : -1;
 }
 
 void *pl_fbdev_flip(void)
@@ -47,7 +51,7 @@ void *pl_fbdev_flip(void)
        in_update(actions);
        if (actions[IN_BINDTYPE_EMU] & PEV_MENU)
                stop = 1;
-       keystate = ~actions[IN_BINDTYPE_PLAYER12];
+       keystate = actions[IN_BINDTYPE_PLAYER12];
 
        // let's flip now
        pl_fbdev_buf = vout_fbdev_flip(layer_fb);