gp2x, fix for 8bit fast renderer regression
authorkub <derkub@gmail.com>
Thu, 21 Jan 2021 22:30:42 +0000 (23:30 +0100)
committerkub <derkub@gmail.com>
Fri, 22 Jan 2021 09:08:20 +0000 (10:08 +0100)
platform/gp2x/emu.c

index 523505f..d60177e 100644 (file)
@@ -361,6 +361,11 @@ void pemu_finalize_frame(const char *fps, const char *notice)
                // a hack for VR\r
                if (PicoIn.AHW & PAHW_SVP)\r
                        memset32((int *)(Pico.est.Draw2FB+328*8+328*223), 0xe0e0e0e0, 328/4);\r
+               // clear top and bottom of overlap trash\r
+               if (!(Pico.est.rendstatus & PDRAW_30_ROWS)) {\r
+                       memset32((int *)(Pico.est.Draw2FB+8*(224+8)), 0xe0e0e0e0, 328*8/4);\r
+                       memset32((int *)(Pico.est.Draw2FB), 0xe0e0e0e0, 328*8/4);\r
+               }\r
                // do actual copy\r
                vidcpyM2(g_screen_ptr, Pico.est.Draw2FB+328*8,\r
                        !(Pico.video.reg[12] & 1), !(PicoIn.opt & POPT_DIS_32C_BORDER));\r
@@ -394,7 +399,10 @@ void plat_video_flip(void)
 \r
        if (is_16bit_mode())\r
                stride *= 2;\r
-       PicoDrawSetOutBuf(g_screen_ptr, stride);\r
+       // the fast renderer has overlap areas and can't directly render to\r
+       // screen buffers. Its output is copied to screen in finalize_frame\r
+       if (currentConfig.renderer != RT_8BIT_FAST || (PicoIn.AHW & PAHW_32X))\r
+               PicoDrawSetOutBuf(g_screen_ptr, stride);\r
 }\r
 \r
 /* XXX */\r
@@ -447,7 +455,7 @@ void plat_status_msg_clear(void)
                } else {\r
                        if (is_8bit) {\r
                                char *d = (char *)gp2x_screens[i] + 320 * (240-8);\r
-                               memset32((int *)d, 0xe0, 320 * 8 / 4);\r
+                               memset32((int *)d, 0xe0e0e0e0, 320 * 8 / 4);\r
                        } else {\r
                                char *d = (char *)gp2x_screens[i] + 320*2 * (240-8);\r
                                memset32((int *)d, 0, 2*320 * 8 / 4);\r