do full frame before menu for proper bg
authornotaz <notasas@gmail.com>
Wed, 5 Aug 2009 19:22:23 +0000 (19:22 +0000)
committernotaz <notasas@gmail.com>
Wed, 5 Aug 2009 19:22:23 +0000 (19:22 +0000)
git-svn-id: file:///home/notaz/opt/svn/PicoDrive/platform@734 be3aeb3a-fb24-0410-a615-afba39da0efa

common/emu.c
gp2x/emu.c

index 7de2aa9..becc0c2 100644 (file)
@@ -1429,9 +1429,6 @@ void emu_loop(void)
 \r
        emu_set_fastforward(0);\r
 \r
-       if (PicoAHW & PAHW_MCD)\r
-               PicoCDBufferFree();\r
-\r
        // save SRAM\r
        if ((currentConfig.EmuOpt & EOPT_EN_SRAM) && SRam.changed) {\r
                plat_status_msg_busy_first("Writing SRAM/BRAM...");\r
@@ -1439,9 +1436,11 @@ void emu_loop(void)
                SRam.changed = 0;\r
        }\r
 \r
-       // do menu background to be sure it's right\r
-       pemu_forced_frame(POPT_EN_SOFTSCALE);\r
-\r
        pemu_loop_end();\r
+\r
+       // pemu_loop_end() might want to do 1 frame for bg image,\r
+       // so free CD buffer here\r
+       if (PicoAHW & PAHW_MCD)\r
+               PicoCDBufferFree();\r
 }\r
 \r
index 82f1c1d..7e60c2b 100644 (file)
@@ -788,6 +788,22 @@ void pemu_loop_prep(void)
 \r
 void pemu_loop_end(void)\r
 {\r
+       int po_old = PicoOpt;\r
+       int eo_old = currentConfig.EmuOpt;\r
+\r
+       /* do one more frame for menu bg */\r
+       PicoOpt &= ~POPT_ALT_RENDERER;\r
+       PicoOpt |= POPT_EN_SOFTSCALE|POPT_ACC_SPRITES;\r
+       currentConfig.EmuOpt |= EOPT_16BPP;\r
+\r
+       PicoScanBegin = EmuScanBegin16;\r
+       PicoScanEnd = NULL;\r
+       PicoDrawSetColorFormat(1);\r
+       Pico.m.dirtyPal = 1;\r
+       PicoFrame();\r
+\r
+       PicoOpt = po_old;\r
+       currentConfig.EmuOpt = eo_old;\r
 }\r
 \r
 const char *plat_get_credits(void)\r