- text_xprintf(menu->bitmap, ypos++, 0, STYLEF_BOLD | TEXT_FILL, title);
+ {
+ text_xyprintf(bm, 0, ypos, STYLEF_UNDERLINE | STYLEF_BOLD | TEXT_CENTER | TEXT_FILL, title);
+ ypos += bm->font->height;
+ }
+
+#if CONFIG_MENU_SMOOTH
+ static coord_t yoffset = 0;
+ static int old_first_item = 0;
+ static mtime_t old_time = 0; //UNUSED
+ static int speed;
+ coord_t old_ymin = bm->cr.ymin;
+
+ gfx_setClipRect(bm,
+ bm->cr.xmin, bm->cr.ymin + ypos,
+ bm->cr.xmax, bm->cr.ymax);
+
+ if (old_first_item != first_item)
+ {
+ speed = ABS(old_first_item - first_item) * 3;
+
+ if (old_first_item > first_item)
+ {
+ yoffset += speed;
+ if (yoffset > bm->font->height)
+ {
+ yoffset = 0;
+ --old_first_item;
+ }
+ }
+ else
+ {
+ yoffset -= speed;
+ if (yoffset < -bm->font->height)
+ {
+ yoffset = 0;
+ ++old_first_item;
+ }
+ }
+ first_item = old_first_item;
+ }
+ ypos += yoffset;
+#endif