Exemplo n.º 1
0
/** Draw the character at the specified position.
 *
 * @param field Character field.
 * @param col   Horizontal screen position.
 * @param row   Vertical screen position.
 *
 */
static void draw_char(charfield_t *field, sysarg_t col, sysarg_t row)
{
	uint8_t glyph;
	
	if (ascii_check(field->ch))
		glyph = field->ch;
	else
		glyph = '?';
	
	uint8_t attr = attrs_attr(field->attrs);
	
	ega.addr[FB_POS(col, row)] = glyph;
	ega.addr[FB_POS(col, row) + 1] = attr;
}
Exemplo n.º 2
0
/** Draw the character at the specified position in viewport.
 *
 * @param vp     Viewport.
 * @param col    Screen position relative to viewport.
 * @param row    Screen position relative to viewport.
 *
 */
static void draw_vp_char(fbvp_t *vp, sysarg_t col, sysarg_t row)
{
	sysarg_t x = vp->x + col;
	sysarg_t y = vp->y + row;
	
	charfield_t *field = screenbuffer_field_at(vp->backbuf, col, row);
	
	uint8_t glyph;
	
	if (ascii_check(field->ch))
		glyph = field->ch;
	else
		glyph = '?';
	
	uint8_t attr = attrs_attr(field->attrs);
	
	ega.addr[FB_POS(x, y)] = glyph;
	ega.addr[FB_POS(x, y) + 1] = attr;
}