X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=fceu.git;a=blobdiff_plain;f=drivers%2Fgp2x%2Fgp2x-video.c;h=b1bf165b80b45148171ed101934813b349ecde16;hp=d74023a7fa9d3af9c5db89b7c5c110a5884a021c;hb=989672f4f2b4b4b2b373271374e6546546091c10;hpb=b2b95d2e0d1fd5e52d03c2152605b09b024c1d0e diff --git a/drivers/gp2x/gp2x-video.c b/drivers/gp2x/gp2x-video.c index d74023a..b1bf165 100644 --- a/drivers/gp2x/gp2x-video.c +++ b/drivers/gp2x/gp2x-video.c @@ -25,15 +25,14 @@ #include "gp2x.h" #include "minimal.h" #include "fonts.h" - -extern int showfps; +#include "asmutils.h" static char fps_str[32]; static int framesEmulated, framesRendered; int gp2x_palette[256]; +unsigned short gp2x_palette16[256]; -int scaled_display=0; int paletterefresh; #define FPS_COLOR 1 @@ -103,9 +102,11 @@ void ToggleFS(void) } +// 16: rrrr rggg gggb bbbb void FCEUD_SetPalette(uint8 index, uint8 r, uint8 g, uint8 b) { gp2x_palette[index] = (r << 16) | (g << 8) | b; + gp2x_palette16[index] = ((r & 0xf8) << 8) | ((g & 0xfc) << 3) | (b >> 3); gp2x_video_setpalette(gp2x_palette, index + 1); paletterefresh = 1; @@ -135,7 +136,7 @@ static INLINE void printFps(uint8 *screen) prevsec = tv_now.tv_sec; } - if (!scaled_display) + if (Settings.scaling == 0) { if (needfpsflip) { @@ -149,7 +150,7 @@ static INLINE void printFps(uint8 *screen) //*destt++ = 0x3F3F3F3F; *destt++ = 0x3F3F3F3F; *destt++ = 0x3F3F3F3F; *destt++ = 0x3F3F3F3F; //*destt++ = 0x3F3F3F3F; *destt++ = 0x3F3F3F3F; *destt++ = 0x3F3F3F3F; *destt++ = 0x3F3F3F3F; } - if (showfps) + if (Settings.showfps) { int sep; for (sep=1; sep < 5; sep++) @@ -163,9 +164,9 @@ static INLINE void printFps(uint8 *screen) } else { - if (showfps) + if (Settings.showfps) { - gp2x_text(screen+32, 0, 0, fps_str, FPS_COLOR, 0); + gp2x_text(screen+32, 0, 0, fps_str, FPS_COLOR, 0); // TODO: firstline } } } @@ -180,6 +181,10 @@ void BlitScreen(uint8 *buf) framesRendered++; printFps(gp2x_screen); + + if (Settings.scaling == 3) + soft_scale((char *)gp2x_screen + 32, gp2x_palette16, 0, 240); + gp2x_video_flip(); XBuf = gp2x_screen; }