X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fgp2x%2Fgp2x-video.c;h=d8524b6df410fd3aa55f954f7fccec8e0abda4ab;hb=892b1f6c68346fa00dc3029ab8bd31178e730509;hp=9b73e468a9a0252fb504e0744bdf1224d99643bd;hpb=c0623dcfadb00843e43c0f8cdcb8898bfc1f08f5;p=fceu.git diff --git a/drivers/gp2x/gp2x-video.c b/drivers/gp2x/gp2x-video.c index 9b73e46..d8524b6 100644 --- a/drivers/gp2x/gp2x-video.c +++ b/drivers/gp2x/gp2x-video.c @@ -99,7 +99,7 @@ int InitVideo(void) } -// 16: rrrr rggg gggb bbbb +// 16: rrrr rggg gg0b bbbb void FCEUD_SetPalette(uint8 index, uint8 r, uint8 g, uint8 b) { /* note: menu depends on bit5 being 0 */ @@ -156,19 +156,17 @@ static INLINE void printFps(uint8 *screen) } -void BlitScreen(uint8 *buf) +void BlitPrepare(int skip) { framesEmulated++; - if (!buf) { + if (skip) { printFps(0); return; } framesRendered++; - printFps(gp2x_screen); - if (eoptions & EO_CLIPSIDES) { int i, *p = (int *) ((char *)gp2x_screen + 32); @@ -178,6 +176,8 @@ void BlitScreen(uint8 *buf) } } + printFps(gp2x_screen); + if (Settings.scaling == 3) { soft_scale((char *)gp2x_screen + 32, gp2x_palette16, srendline, erendline-srendline); @@ -185,8 +185,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; + } }