From: kub Date: Mon, 14 Dec 2020 20:15:32 +0000 (+0100) Subject: SDL, better handling of 2x overlay mode X-Git-Tag: v2.00~631 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9742bda77fe82423b0510d6568ca9e7a5b1726c3;p=picodrive.git SDL, better handling of 2x overlay mode --- diff --git a/platform/common/plat_sdl.c b/platform/common/plat_sdl.c index b98b16e5..e1024f79 100644 --- a/platform/common/plat_sdl.c +++ b/platform/common/plat_sdl.c @@ -135,12 +135,12 @@ void bgr_to_uyvy_init(void) } } -void rgb565_to_uyvy(void *d, const void *s, int pixels) +void rgb565_to_uyvy(void *d, const void *s, int pixels, int x2) { uint32_t *dst = d; const uint16_t *src = s; - if (plat_sdl_overlay->w > 2*plat_sdl_overlay->h) + if (x2) for (; pixels > 0; src += 4, dst += 4, pixels -= 4) { struct uyvy *uyvy0 = yuv_uyvy + src[0], *uyvy1 = yuv_uyvy + src[1]; @@ -169,7 +169,8 @@ void plat_video_flip(void) SDL_LockYUVOverlay(plat_sdl_overlay); rgb565_to_uyvy(plat_sdl_overlay->pixels[0], shadow_fb, - g_screen_ppitch * g_screen_height); + g_screen_ppitch * g_screen_height, + plat_sdl_overlay->w > 2*plat_sdl_overlay->h); SDL_UnlockYUVOverlay(plat_sdl_overlay); SDL_DisplayYUVOverlay(plat_sdl_overlay, &dstrect); } @@ -246,7 +247,7 @@ void plat_video_menu_end(void) SDL_LockYUVOverlay(plat_sdl_overlay); rgb565_to_uyvy(plat_sdl_overlay->pixels[0], shadow_fb, - g_menuscreen_pp * g_menuscreen_h); + g_menuscreen_pp * g_menuscreen_h, 0); SDL_UnlockYUVOverlay(plat_sdl_overlay); SDL_DisplayYUVOverlay(plat_sdl_overlay, &dstrect);