frontend: handle double res rendering, enable on x86_64
[pcsx_rearmed.git] / frontend / plugin_lib.c
index ab4d415..588f133 100644 (file)
@@ -308,6 +308,7 @@ static void pl_vout_flip(const void *vram, int stride, int bgr24, int w, int h)
        unsigned char *dest = pl_vout_buf;
        const unsigned short *src = vram;
        int dstride = pl_vout_w, h1 = h;
+       int h_full = pl_vout_h - pl_vout_yoffset;
        int doffs;
 
        pcnt_start(PCNT_BLIT);
@@ -318,7 +319,7 @@ static void pl_vout_flip(const void *vram, int stride, int bgr24, int w, int h)
                        pl_plat_clear();
                else
                        memset(pl_vout_buf, 0,
-                               dstride * pl_vout_h * pl_vout_bpp / 8);
+                               dstride * h_full * pl_vout_bpp / 8);
                goto out_hud;
        }
 
@@ -334,7 +335,7 @@ static void pl_vout_flip(const void *vram, int stride, int bgr24, int w, int h)
                        pl_plat_clear();
                else
                        memset(pl_vout_buf, 0,
-                               dstride * pl_vout_h * pl_vout_bpp / 8);
+                               dstride * h_full * pl_vout_bpp / 8);
                clear_counter--;
        }
 
@@ -396,6 +397,8 @@ static void pl_vout_flip(const void *vram, int stride, int bgr24, int w, int h)
 #endif
        else
        {
+               src = (void *)((uintptr_t)src & ~3); // align for the blitter
+
                for (; h1-- > 0; dest += dstride * 2, src += stride)
                {
                        bgr555_to_rgb565(dest, src, w * 2);
@@ -466,7 +469,7 @@ static int dispmode_default(void)
        return 1;
 }
 
-#ifdef __ARM_NEON__
+#ifdef BUILTIN_GPU_NEON
 static int dispmode_doubleres(void)
 {
        if (!(pl_rearmed_cbs.gpu_caps & GPU_CAP_SUPPORTS_2X)
@@ -478,7 +481,9 @@ static int dispmode_doubleres(void)
        snprintf(hud_msg, sizeof(hud_msg), "double resolution");
        return 1;
 }
+#endif
 
+#ifdef __ARM_NEON__
 static int dispmode_scale2x(void)
 {
        if (!resolution_ok(psx_w * 2, psx_h * 2) || psx_bpp != 16)
@@ -504,8 +509,10 @@ static int dispmode_eagle2x(void)
 
 static int (*dispmode_switchers[])(void) = {
        dispmode_default,
-#ifdef __ARM_NEON__
+#ifdef BUILTIN_GPU_NEON
        dispmode_doubleres,
+#endif
+#ifdef __ARM_NEON__
        dispmode_scale2x,
        dispmode_eagle2x,
 #endif
@@ -670,6 +677,7 @@ void pl_frame_limit(void)
                                hud_msg[0] = 0;
                }
                tv_old = now;
+               //new_dynarec_print_stats();
        }
 #ifdef PCNT
        static int ya_vsync_count;