mmuhack.o path fix, new sound vol level
[fceu.git] / drivers / gp2x / gp2x-video.c
index 198222d..49850f6 100644 (file)
@@ -156,11 +156,11 @@ static INLINE void printFps(uint8 *screen)
 }
 
 
-void BlitScreen(uint8 *buf)
+void BlitPrepare(int skip)
 {
        framesEmulated++;
 
-       if (!buf) {
+       if (skip) {
                printFps(0);
                return;
        }
@@ -176,6 +176,20 @@ void BlitScreen(uint8 *buf)
                }
        }
 
+       if (Settings.accurate_mode && Settings.scaling < 2)
+       {
+               int i, *p = (int *)gp2x_screen + 32/4;
+               if (srendline > 0)
+                       for (i = srendline; i > 0; i--, p += 320/4)
+                               memset32(p, 0, 256/4);
+               if (erendline < 239)
+               {
+                       int *p = (int *)gp2x_screen + erendline*320/4 + 32/4;
+                       for (i = 239-srendline; i > 0; i--, p += 320/4)
+                               memset32(p, 0, 256/4);
+               }
+       }
+
        printFps(gp2x_screen);
 
        if (Settings.scaling == 3)
@@ -185,8 +199,18 @@ void BlitScreen(uint8 *buf)
                        memset32((int *)((char *)gp2x_screen + 32), 0, srendline*320*2/4);
        }
 
-       gp2x_video_flip();
-       XBuf = gp2x_screen;
+       /* at this point we should be done with the frame */
+       gp2x_video_flush_cache();
+}
+
+
+void BlitScreen(int skip)
+{
+       if (!skip)
+       {
+               gp2x_video_flip();
+               XBuf = gp2x_screen;
+       }
 }