+ unsigned short *dst = d;
+ const unsigned int *src = s;
+ int v;
+
+ // no colors, for now
+ for (; pixels > 0; src++, dst += 2, pixels -= 2) {
+ v = (*src >> 8) & 0xff;
+ v = (v - 16) * 255 / 219 / 8;
+ dst[0] = (v << 11) | (v << 6) | v;
+
+ v = (*src >> 24) & 0xff;
+ v = (v - 16) * 255 / 219 / 8;
+ dst[1] = (v << 11) | (v << 6) | v;
+ }
+}
+
+static void overlay_blit(int doffs, const void *src_, int w, int h,
+ int sstride, int bgr24)
+{
+ const unsigned short *src = src_;
+ unsigned short *dst;
+ int dstride = plat_sdl_overlay->w;
+
+ SDL_LockYUVOverlay(plat_sdl_overlay);
+ dst = (void *)plat_sdl_overlay->pixels[0];
+
+ dst += doffs;
+ if (bgr24) {
+ for (; h > 0; dst += dstride, src += sstride, h--)
+ bgr888_to_uyvy(dst, src, w);
+ }
+ else {
+ for (; h > 0; dst += dstride, src += sstride, h--)
+ bgr555_to_uyvy(dst, src, w);
+ }
+
+ SDL_UnlockYUVOverlay(plat_sdl_overlay);
+}
+
+static void overlay_hud_print(int x, int y, const char *str, int bpp)
+{
+ 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);