- if (!in_menu && overlay != NULL) {
- SDL_Rect dstrect = { 0, 0, screen->w, screen->h };
- SDL_LockYUVOverlay(overlay);
- test_convert(overlay->pixels[0], screen->pixels, overlay->w * overlay->h);
- SDL_UnlockYUVOverlay(overlay);
- SDL_DisplayYUVOverlay(overlay, &dstrect);
+ SDL_LockYUVOverlay(plat_sdl_overlay);
+ basic_text_out_uyvy_nf(plat_sdl_overlay->pixels[0], plat_sdl_overlay->w, x, y, str);
+ SDL_UnlockYUVOverlay(plat_sdl_overlay);
+}
+
+static void centered_clear(void)
+{
+ int dstride = plat_sdl_screen->pitch / 2;
+ int w = plat_sdl_screen->w;
+ int h = plat_sdl_screen->h;
+ unsigned short *dst;
+
+ SDL_LockSurface(plat_sdl_screen);
+ dst = plat_sdl_screen->pixels;
+
+ for (; h > 0; dst += dstride, h--)
+ memset(dst, 0, w * 2);
+
+ SDL_UnlockSurface(plat_sdl_screen);
+}
+
+static void centered_blit(int doffs, const void *src_, int w, int h,
+ int sstride, int bgr24)
+{
+ const unsigned short *src = src_;
+ unsigned short *dst;
+ int dstride;
+
+ SDL_LockSurface(plat_sdl_screen);
+ dst = plat_sdl_screen->pixels;
+ dstride = plat_sdl_screen->pitch / 2;
+
+ dst += doffs + (plat_sdl_screen->w - w) / 2;
+ dst += dstride * (plat_sdl_screen->h - h) / 2;
+ if (bgr24) {
+ for (; h > 0; dst += dstride, src += sstride, h--)
+ bgr888_to_rgb565(dst, src, w * 3);
+ }
+ else {
+ for (; h > 0; dst += dstride, src += sstride, h--)
+ bgr555_to_rgb565(dst, src, w * 2);