+ " Eke, Nemesis, Tasco Deluxe";
+
+static void menu_main_draw_status(void)
+{
+ static time_t last_bat_read = 0;
+ static int last_bat_val = -1;
+ unsigned short *bp = g_screen_ptr;
+ int bat_h = me_mfont_h * 2 / 3;
+ int i, u, w, wfill, batt_val;
+ struct tm *tmp;
+ time_t ltime;
+ char time_s[16];
+
+ if (!(currentConfig.EmuOpt & EOPT_SHOW_RTC))
+ return;
+
+ ltime = time(NULL);
+ tmp = gmtime(<ime);
+ strftime(time_s, sizeof(time_s), "%H:%M", tmp);
+
+ text_out16(g_screen_width - me_mfont_w * 6, me_mfont_h + 2, time_s);
+
+ if (ltime - last_bat_read > 10) {
+ last_bat_read = ltime;
+ last_bat_val = batt_val = plat_target_bat_capacity_get();
+ }
+ else
+ batt_val = last_bat_val;
+
+ if (batt_val < 0 || batt_val > 100)
+ return;
+
+ /* battery info */
+ bp += (me_mfont_h * 2 + 2) * g_screen_width + g_screen_width - me_mfont_w * 3 - 3;
+ for (i = 0; i < me_mfont_w * 2; i++)
+ bp[i] = menu_text_color;
+ for (i = 0; i < me_mfont_w * 2; i++)
+ bp[i + g_screen_width * bat_h] = menu_text_color;
+ for (i = 0; i <= bat_h; i++)
+ bp[i * g_screen_width] =
+ bp[i * g_screen_width + me_mfont_w * 2] = menu_text_color;
+ for (i = 2; i < bat_h - 1; i++)
+ bp[i * g_screen_width - 1] =
+ bp[i * g_screen_width - 2] = menu_text_color;
+
+ w = me_mfont_w * 2 - 1;
+ wfill = batt_val * w / 100;
+ for (u = 1; u < bat_h; u++)
+ for (i = 0; i < wfill; i++)
+ bp[(w - i) + g_screen_width * u] = menu_text_color;
+}