gp2x, small optimization
authorkub <derkub@gmail.com>
Wed, 28 Sep 2022 18:52:26 +0000 (18:52 +0000)
committerkub <derkub@gmail.com>
Wed, 28 Sep 2022 18:52:26 +0000 (18:52 +0000)
platform/gp2x/emu.c

index c6a708f..9546bcd 100644 (file)
@@ -392,6 +392,7 @@ static int firstcol, colcount;
 void pemu_finalize_frame(const char *fps, const char *notice)\r
 {\r
        int emu_opt = currentConfig.EmuOpt;\r
+       int direct_rendered = 1;\r
 \r
        if (is_16bit_mode())\r
                localPalSize = 0; // nothing to do\r
@@ -403,15 +404,10 @@ 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 (firstline >= 8) {\r
-                       unsigned char *p = Pico.est.Draw2FB + firstline*328;\r
-                       memset32((int *)(p-        8*328), 0xe0e0e0e0, 328*8/4);\r
-                       memset32((int *)(p+linecount*328), 0xe0e0e0e0, 328*8/4);\r
-               }\r
                // do actual copy\r
                vidcpy8bit(g_screen_ptr, Pico.est.Draw2FB,\r
                        (firstcol << 16) | firstline, (colcount << 16) | linecount);\r
+               direct_rendered = 0;\r
        }\r
        else if (get_renderer() == RT_8BIT_ACC)\r
        {\r
@@ -420,7 +416,8 @@ void pemu_finalize_frame(const char *fps, const char *notice)
                        localPalSize = make_local_pal(0);\r
        }\r
 \r
-       if (is_1stblanked)\r
+       // blank 1st column, only needed in modes directly rendering to screen\r
+       if (is_1stblanked && direct_rendered)\r
                clear_1st_column(firstcol, firstline, linecount);\r
 \r
        if (notice)\r