diff options
Diffstat (limited to 'src/vt102.c')
-rw-r--r-- | src/vt102.c | 40 |
1 files changed, 28 insertions, 12 deletions
diff --git a/src/vt102.c b/src/vt102.c index 8821087..7c211c5 100644 --- a/src/vt102.c +++ b/src/vt102.c @@ -10,6 +10,9 @@ static char rcsid[] = "$Id$"; /* * $Log$ + * Revision 1.44 2008/02/27 00:54:16 james + * *** empty log message *** + * * Revision 1.43 2008/02/27 00:27:22 james * *** empty log message *** * @@ -384,7 +387,7 @@ vt102_log_line (Context * c, int line) { CRT_Pos e = { c->v->current_width - 1, line }; CRT_Pos p = { 0, line }; - char logbuf[VT102_MAX_COLS + 1]; + char logbuf[4*(VT102_MAX_COLS + 1)],*logptr=logbuf; if (!c->l) return; @@ -401,11 +404,9 @@ vt102_log_line (Context * c, int line) int ch = c->v->crt.screen[CRT_ADDR_POS (&p)].chr; if (ch < 32) ch = ' '; - if (ch > 126) - ch = ' '; - logbuf[p.x] = ch; + logptr+=utf8_encode(logptr,ch); } - logbuf[p.x] = 0; + *logptr=0; c->l->log (c->l, logbuf); } @@ -983,25 +984,30 @@ void vt102_regular_char (Context * c, VT102 * v, uint32_t ch) { + vt102_do_pending_wrap (c); + if (v->modes[VT102_MODE_INSERT]) vt102_insert_into_line (v, v->pos); + v->last_reg_char = ch; + + if (ch < VT102_CHARSET_SIZE) { - int cs = charset_from_csid[v->g[v->cs]][ch]; - v->crt.screen[CRT_ADDR_POS (&v->pos)].chr = cs ? cs : ch; - } - else - { - v->crt.screen[CRT_ADDR_POS (&v->pos)].chr = ch; + 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; v->crt.screen[CRT_ADDR_POS (&v->pos)].color = v->color; vt102_cursor_advance (c); - v->last_reg_char = ch; } vt102_send_id (Context * c, char *buf) @@ -1719,17 +1725,23 @@ vt102_parse_char (Context * c, int ch) switch (ch) { +#if 0 /*NUL*/ case 0: /*SOH*/ case 1: /*STX*/ case 2: /*ETX*/ case 3: /*EOT*/ case 4: break; +#endif /*ENQ*/ case 5: vt102_send_id (c, terminal_id); break; +#if 0 /*ACK*/ case 6: + break; +#endif /*BEL*/ case 7: + //FIXME beep break; /*BS*/ case 8: vt102_cursor_retreat (c->v); @@ -1754,6 +1766,7 @@ vt102_parse_char (Context * c, int ch) /*select G0 */ v->cs = 0; break; +#if 0 /*DLE*/ case 16: /*DC1 */ case 17: /*DC2 */ case 18: @@ -1766,15 +1779,18 @@ vt102_parse_char (Context * c, int ch) /*EM*/ case 25: /*SUB*/ case 26: break; +#endif /*ESC*/ case 27: p->in_escape++; return; +#if 0 /*FS*/ case 28: /*GS*/ case 29: /*RS*/ case 30: /*US*/ case 31: /*DEL*/ case 127: break; +#endif /*regular character */ default: vt102_regular_char (c, v, ch); } |