static void ega_char_update(outdev_t *dev, sysarg_t col, sysarg_t row) { charfield_t *field = chargrid_charfield_at(dev->backbuf, col, row); draw_char(field, col, row); }
/** Clear one buffer row. * * @param scrbuf Chargrid. * @param row Row to clear. * */ void chargrid_clear_row(chargrid_t *scrbuf, sysarg_t row) { for (sysarg_t col = 0; col < scrbuf->cols; col++) { charfield_t *field = chargrid_charfield_at(scrbuf, col, row); field->ch = 0; field->attrs = scrbuf->attrs; field->flags |= CHAR_FLAG_DIRTY; } }
/** Store one character to chargrid. * * Its position is determined by scrbuf->col * and scrbuf->row. * * @param scrbuf Chargrid. * @param ch Character to store. * @param update Update coordinates. * * @return Number of rows which have been affected. In usual * situations this is 1. If the current position was * updated to a new row, this value is 2. * */ sysarg_t chargrid_putchar(chargrid_t *scrbuf, wchar_t ch, bool update) { assert(scrbuf->col < scrbuf->cols); assert(scrbuf->row < scrbuf->rows); charfield_t *field = chargrid_charfield_at(scrbuf, scrbuf->col, scrbuf->row); field->ch = ch; field->attrs = scrbuf->attrs; field->flags |= CHAR_FLAG_DIRTY; if (update) { scrbuf->col++; return chargrid_update_cols(scrbuf); } return 1; }