update glk driver: include contents of glk_init_num() into glk_num()
This commit is contained in:
+11
-20
@@ -514,26 +514,6 @@ glk_init_hbar(Driver *drvthis)
|
|||||||
debug(RPT_DEBUG, "glk_init_hbar()");
|
debug(RPT_DEBUG, "glk_init_hbar()");
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////
|
|
||||||
// Tells the driver to get ready for big numbers, if possible.
|
|
||||||
//
|
|
||||||
static void
|
|
||||||
glk_init_num(Driver *drvthis)
|
|
||||||
{
|
|
||||||
PrivateData *p = drvthis->private_data;
|
|
||||||
|
|
||||||
debug(RPT_DEBUG, "glk_init_num()");
|
|
||||||
if (p->fontselected != 3) {
|
|
||||||
/* Select Big Numbers font */
|
|
||||||
glkputl(p->PortFD, GLKCommand, 0x31, 3, EOF);
|
|
||||||
p->fontselected = 3;
|
|
||||||
/* Set font metrics */
|
|
||||||
glkputl(p->PortFD, GLKCommand, 0x32, 1, 0, 1, 1, 32, EOF);
|
|
||||||
/* Clear the screen */
|
|
||||||
glk_clear_forced(drvthis);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
// Draws a big (4-row) number.
|
// Draws a big (4-row) number.
|
||||||
//
|
//
|
||||||
@@ -547,6 +527,17 @@ glk_num(Driver *drvthis, int x, int num)
|
|||||||
if ((num < 0) || (num > 10))
|
if ((num < 0) || (num > 10))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (p->fontselected != 3) {
|
||||||
|
debug(RPT_DEBUG, "Switching to font 3");
|
||||||
|
/* Select Big Numbers font */
|
||||||
|
glkputl(p->PortFD, GLKCommand, 0x31, 3, EOF);
|
||||||
|
p->fontselected = 3;
|
||||||
|
/* Set font metrics */
|
||||||
|
glkputl(p->PortFD, GLKCommand, 0x32, 1, 0, 1, 1, 32, EOF);
|
||||||
|
/* Clear the screen */
|
||||||
|
glk_clear_forced(drvthis);
|
||||||
|
}
|
||||||
|
|
||||||
if ((x > 0) && (x <= p->width))
|
if ((x > 0) && (x <= p->width))
|
||||||
p->framebuf[x-1] = (num >= 10) ? ':' : (num + '0');
|
p->framebuf[x-1] = (num >= 10) ? ':' : (num + '0');
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user