X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=fceu.git;a=blobdiff_plain;f=drivers%2Fgp2x%2Fgp2x-video.c;h=312c83ab3197bbea36d4f502ddde7ca9e6714347;hp=198222d32d6adc72e22fa0dfdffe5564269af05a;hb=c8c88d89f9bb0df71360b3b68327300f686a1c20;hpb=0bb3fe122854be9af6c3024fef9f503d27bc63a1 diff --git a/drivers/gp2x/gp2x-video.c b/drivers/gp2x/gp2x-video.c index 198222d..312c83a 100644 --- a/drivers/gp2x/gp2x-video.c +++ b/drivers/gp2x/gp2x-video.c @@ -21,11 +21,11 @@ #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-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; + } }