diff options
Diffstat (limited to 'src/vt102.c')
-rw-r--r-- | src/vt102.c | 38 |
1 files changed, 26 insertions, 12 deletions
diff --git a/src/vt102.c b/src/vt102.c index 7c211c5..a879999 100644 --- a/src/vt102.c +++ b/src/vt102.c @@ -10,6 +10,9 @@ static char rcsid[] = "$Id$"; /* * $Log$ + * Revision 1.45 2008/02/27 01:31:14 james + * *** empty log message *** + * * Revision 1.44 2008/02/27 00:54:16 james * *** empty log message *** * @@ -387,7 +390,7 @@ vt102_log_line (Context * c, int line) { CRT_Pos e = { c->v->current_width - 1, line }; CRT_Pos p = { 0, line }; - char logbuf[4*(VT102_MAX_COLS + 1)],*logptr=logbuf; + char logbuf[4 * (VT102_MAX_COLS + 1)], *logptr = logbuf; if (!c->l) return; @@ -404,9 +407,9 @@ vt102_log_line (Context * c, int line) int ch = c->v->crt.screen[CRT_ADDR_POS (&p)].chr; if (ch < 32) ch = ' '; - logptr+=utf8_encode(logptr,ch); + logptr += utf8_encode (logptr, ch); } - *logptr=0; + *logptr = 0; c->l->log (c->l, logbuf); } @@ -996,12 +999,15 @@ vt102_regular_char (Context * c, VT102 * v, uint32_t ch) if (ch < VT102_CHARSET_SIZE) { - int cs; - if ((cs=vt102_charset_c0[ch])) { - ch=cs; - } else if ((cs=charset_from_csid[v->g[v->cs]][ch])) { - ch=cs; - } + int cs; + if ((cs = vt102_charset_c0[ch])) + { + ch = cs; + } + else if ((cs = charset_from_csid[v->g[v->cs]][ch])) + { + ch = cs; + } } v->crt.screen[CRT_ADDR_POS (&v->pos)].chr = ch; v->crt.screen[CRT_ADDR_POS (&v->pos)].attr = v->attr; @@ -1738,10 +1744,10 @@ vt102_parse_char (Context * c, int ch) break; #if 0 /*ACK*/ case 6: - break; + break; #endif /*BEL*/ case 7: - //FIXME beep + //FIXME beep break; /*BS*/ case 8: vt102_cursor_retreat (c->v); @@ -2016,7 +2022,7 @@ vt102_reset (VT102 * v) } VT102 * -vt102_new (void) +vt102_new (int width) { VT102 *v; @@ -2026,6 +2032,14 @@ vt102_new (void) vt102_reset (v); + if (width) { + v->current_width =width; + v->crt.width = v->current_width; + v->screen_end.x = v->current_width - 1; + v->top_margin = v->screen_start; + v->bottom_margin = v->screen_end; + vt102_cursor_home (v); + } return v; } |