}
static inline void put_normal_char(RoteTerm *rt, char c) {
+ if (rt->ccol >= rt->cols) {
+ rt->ccol = 0;
+ cursor_line_down(rt);
+ }
+
rt->cells[rt->crow][rt->ccol].ch = c;
rt->cells[rt->crow][rt->ccol].attr = rt->curattr;
rt->ccol++;
rt->line_dirty[rt->crow] = true;
rt->curpos_dirty = true;
-
- if (rt->ccol >= rt->cols) {
- rt->ccol = 0;
- cursor_line_down(rt);
- }
}
static inline void put_graphmode_char(RoteTerm *rt, char c) {
}
for (i = 0; i < pcount; i++) {
+
+// From http://vt100.net/docs/vt510-rm/SGR table 5-16
+// 0 All attributes off
+// 1 Bold
+// 4 Underline
+// 5 Blinking
+// 7 Negative image
+// 8 Invisible image
+// 10 The ASCII character set is the current 7-bit
+// display character set (default) - SCO Console only.
+// 11 Map Hex 00-7F of the PC character set codes
+// to the current 7-bit display character set
+// - SCO Console only.
+// 12 Map Hex 80-FF of the current character set to
+// the current 7-bit display character set - SCO
+// Console only.
+// 22 Bold off
+// 24 Underline off
+// 25 Blinking off
+// 27 Negative image off
+// 28 Invisible image off
+
if (param[i] == 0) rt->curattr = 0x70;
else if (param[i] == 1 || param[i] == 2 || param[i] == 4) /* set bold */
- rt->curattr |= 0x80;
- else if (param[i] == 5) rt->curattr |= 0x08; /* set blink */
+ ROTE_ATTR_MOD_BOLD(rt->curattr,1);
+ else if (param[i] == 5) /* set blink */
+ ROTE_ATTR_MOD_BLINK(rt->curattr,1);
else if (param[i] == 7) rt->curattr = 0x07; /* reverse video */
+ else if (param[i] == 8) rt->curattr = 0x0; /* invisible */
+ else if (param[i] == 22 || param[i] == 24) /* bold off */
+ ROTE_ATTR_MOD_BOLD(rt->curattr,0);
+ else if (param[i] == 25) /* blink off */
+ ROTE_ATTR_MOD_BLINK(rt->curattr,0);
+ else if (param[i] == 27) /* negative off */
+ rt->curattr = 0x70;
+ else if (param[i] == 28) /* invisible off */
+ rt->curattr = 0x70;
else if (param[i] >= 30 && param[i] <= 37) /* set fg */
ROTE_ATTR_MOD_FG(rt->curattr, param[i] - 30);
else if (param[i] >= 40 && param[i] <= 47) /* set bg */
#define ROTE_ATTR_MOD_BOLD(attr, boldbit) \
attr &= 0x7F, attr |= (boldbit)?0x80:0x00
#define ROTE_ATTR_MOD_BLINK(attr, blinkbit) \
- attr &= 0xF7, attr |= (boldbit)?0x08:0x00
+ attr &= 0xF7, attr |= (blinkbit)?0x08:0x00
/* these return non-zero for 'yes', zero for 'no'. Don't rely on them being
* any more specific than that (e.g. being exactly 1 for 'yes' or whatever). */