Changeset a35b458 in mainline for uspace/srv/hid/output/proto/vt100.c
- Timestamp:
- 2018-03-02T20:10:49Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f1380b7
- Parents:
- 3061bc1
- git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-02-28 17:38:31)
- git-committer:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-03-02 20:10:49)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hid/output/proto/vt100.c
r3061bc1 ra35b458 77 77 { 78 78 char control[MAX_CONTROL]; 79 79 80 80 snprintf(control, MAX_CONTROL, "\033[%um", mode); 81 81 state->control_puts(control); … … 85 85 { 86 86 char control[MAX_CONTROL]; 87 87 88 88 snprintf(control, MAX_CONTROL, "\033[%" PRIun ";%" PRIun "f", 89 89 row + 1, col + 1); … … 123 123 vt100_sgr(state, SGR_BGCOLOR + color_map[attrs.val.index.bgcolor & 7]); 124 124 vt100_sgr(state, SGR_FGCOLOR + color_map[attrs.val.index.fgcolor & 7]); 125 125 126 126 if (attrs.val.index.attr & CATTR_BRIGHT) 127 127 vt100_sgr(state, SGR_BOLD); 128 128 129 129 break; 130 130 case CHAR_ATTR_RGB: 131 131 vt100_sgr(state, SGR_RESET); 132 132 133 133 if (attrs.val.rgb.bgcolor <= attrs.val.rgb.fgcolor) 134 134 vt100_sgr(state, SGR_REVERSE); 135 135 136 136 break; 137 137 } … … 145 145 if (state == NULL) 146 146 return NULL; 147 147 148 148 state->putchar = putchar_fn; 149 149 state->control_puts = control_puts_fn; 150 150 state->flush = flush_fn; 151 151 152 152 state->cols = cols; 153 153 state->rows = rows; 154 154 155 155 state->cur_col = (sysarg_t) -1; 156 156 state->cur_row = (sysarg_t) -1; 157 157 158 158 state->cur_attrs.type = CHAR_ATTR_STYLE; 159 159 state->cur_attrs.val.style = STYLE_NORMAL; 160 160 161 161 /* Initialize graphic rendition attributes */ 162 162 vt100_sgr(state, SGR_RESET); … … 195 195 if ((col >= state->cols) || (row >= state->rows)) 196 196 return; 197 197 198 198 if ((col != state->cur_col) || (row != state->cur_row)) { 199 199 vt100_set_pos(state, col, row); … … 223 223 state->putchar(ch == 0 ? ' ' : ch); 224 224 state->cur_col++; 225 225 226 226 if (state->cur_col >= state->cols) { 227 227 state->cur_row += state->cur_col / state->cols;
Note:
See TracChangeset
for help on using the changeset viewer.