linux+psp, improve sw upscaling
authorkub <derkub@gmail.com>
Fri, 26 Nov 2021 20:32:29 +0000 (21:32 +0100)
committerkub <derkub@gmail.com>
Fri, 26 Nov 2021 20:32:58 +0000 (21:32 +0100)
platform/linux/emu.c
platform/psp/emu.c

index 8dd8c54..053a206 100644 (file)
@@ -175,14 +175,18 @@ void pemu_finalize_frame(const char *fps, const char *notice)
                u16 *ps = ghost_buf;\r
                int y, h = currentConfig.vscaling == EOPT_SCALE_SW ? 240:out_h;\r
                int w = currentConfig.scaling == EOPT_SCALE_SW ? 320:out_w;\r
-               for (y = 0; y < h; y++) {\r
-                       if (currentConfig.ghosting == 1)\r
+               if (currentConfig.ghosting == 1)\r
+                       for (y = 0; y < h; y++) {\r
                                v_blend((u32 *)pd, (u32 *)ps, w/2, p_075_round);\r
-                       else\r
+                               pd += g_screen_ppitch;\r
+                               ps += w;\r
+                       }\r
+               else\r
+                       for (y = 0; y < h; y++) {\r
                                v_blend((u32 *)pd, (u32 *)ps, w/2, p_05_round);\r
-                       pd += g_screen_ppitch;\r
-                       ps += w;\r
-               }\r
+                               pd += g_screen_ppitch;\r
+                               ps += w;\r
+                       }\r
        }\r
 \r
        if (notice)\r
@@ -388,7 +392,7 @@ void emu_video_mode_change(int start_line, int line_count, int start_col, int co
                        PicoDrawSetCallbacks(cb_vscaling_begin,cb_vscaling_nop);\r
                break;\r
        case EOPT_SCALE_SW:\r
-               screen_y = (screen_h - 240)/2 + (out_h > 144);\r
+               screen_y = (screen_h - 240)/2 + (out_h < 240 && out_h > 144);\r
                // NTSC always has 224 visible lines, anything smaller has bars\r
                if (out_h < 224 && out_h > 144)\r
                        screen_y += (224 - out_h)/2;\r
index 4b98db0..b6d1a34 100644 (file)
@@ -104,7 +104,7 @@ static void change_renderer(int diff)
 
 static void apply_renderer(void)
 {
-       PicoIn.opt &= ~POPT_ALT_RENDERER;
+       PicoIn.opt &= ~(POPT_ALT_RENDERER|POPT_EN_SOFTSCALE);
 
        switch (get_renderer()) {
        case RT_16BIT: