Show the time in menu core.

This commit is contained in:
sorgelig
2017-09-20 06:50:43 +08:00
parent 6f64223852
commit c18958e123
2 changed files with 23 additions and 1 deletions

2
osd.c
View File

@@ -235,7 +235,7 @@ void OsdWriteOffset(unsigned char n, char *s, unsigned char invert, unsigned cha
// send all characters in string to OSD
while (1)
{
if (i == 0)
if (i == 0 && (n < osd_size))
{ // Render sidestripe
unsigned char j;
unsigned char tmp[8];

View File

@@ -1262,6 +1262,28 @@ void user_io_poll()
DISKLED_OFF;
}
*/
if (is_menu_core())
{
if (!rtc_timer || CheckTimer(rtc_timer))
{
rtc_timer = GetTimer(1000);
time_t t = time(NULL);
struct tm tm = *localtime(&t);
char str[64];
sprintf(str, " MiSTer ");
if (tm.tm_year >= 117)
{
strftime(str + strlen(str), sizeof(str) - 1 - strlen(str), "%Y.%m.%d %H:%M:%S", &tm);
}
OsdWrite(16, "", 1, 0);
OsdWrite(17, str, 1, 0);
OsdWrite(18, "", 1, 0);
}
}
}
if (core_type == CORE_TYPE_ARCHIE) archie_poll();