release r2, update credits
[fceu.git] / drivers / gp2x / gp2x-video.c
index 198222d..8f50791 100644 (file)
 
 #include "../../video.h"
 
-#include "main.h"
-#include "gp2x.h"
+#include "../common/main.h"
+#include "../common/settings.h"
 #include "minimal.h"
-#include "fonts.h"
-#include "asmutils.h"
+#include "../libpicofe/fonts.h"
+#include "../arm/asmutils.h"
 
 static char fps_str[32];
 static int framesEmulated, framesRendered;
@@ -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-erendline; 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;
+       }
 }