From dd068f2faaa044fbcef7a430650a221f210cba40 Mon Sep 17 00:00:00 2001 From: james <> Date: Wed, 27 Feb 2008 00:27:22 +0000 Subject: *** empty log message *** --- src/vt102.c | 67 +++++++++++++++++++++++++++++++++++-------------------------- 1 file changed, 38 insertions(+), 29 deletions(-) (limited to 'src/vt102.c') diff --git a/src/vt102.c b/src/vt102.c index a22fe69..8821087 100644 --- a/src/vt102.c +++ b/src/vt102.c @@ -10,6 +10,9 @@ static char rcsid[] = "$Id$"; /* * $Log$ + * Revision 1.43 2008/02/27 00:27:22 james + * *** empty log message *** + * * Revision 1.42 2008/02/26 23:56:12 james * *** empty log message *** * @@ -297,9 +300,9 @@ ESC+B #include "project.h" #include "syslog.h" -//static char terminal_reply[]={033,0133,077,066,0143}; - #define TABLE_LENGTH 128 +#undef DEBUG + static char terminal_id[] = "vt102"; @@ -678,9 +681,9 @@ vt102_insert_into_line (VT102 * v, CRT_Pos p) &v->crt.screen[CRT_ADDR_POS (&p)], sizeof (CRT_CA) * n); } - v->crt.screen[CRT_ADDR (p.y, v->bottom_margin.x)].chr = ' '; - v->crt.screen[CRT_ADDR (p.y, v->bottom_margin.x)].attr = CRT_ATTR_NORMAL; - v->crt.screen[CRT_ADDR (p.y, v->bottom_margin.x)].color = CRT_COLOR_NORMAL; + v->crt.screen[CRT_ADDR_POS (&p)].chr = ' '; + v->crt.screen[CRT_ADDR_POS (&p)].attr = CRT_ATTR_NORMAL; + v->crt.screen[CRT_ADDR_POS (&p)].color = CRT_COLOR_NORMAL; } @@ -1262,23 +1265,26 @@ vt102_parse_csi (Context * c, char *buf, int len) vt102_parse_attr_string (v, &buf[1], len - 1); break; case 'n': //Device status report - switch (buf[1]) { - case '5': - vt102_send_id (c, "\033[0n"); - break; - case '6': - if (c->t) { - char buf[16]; - int i; - i=sprintf(buf,"\033[%d;%dR",v->pos.y+1,v->pos.x+1); - c->t->xmit (c->t, buf, i); - } - break; - default: - //?15n printer status - log_f (c->l, "<%s:%d unhandled DSR: \\033%s>", __FILE__, __LINE__, - buf); - } + switch (buf[1]) + { + case '5': + vt102_send_id (c, "\033[0n"); + break; + case '6': + if (c->t) + { + char buf[16]; + int i; + i = + sprintf (buf, "\033[%d;%dR", v->pos.y + 1, v->pos.x + 1); + c->t->xmit (c->t, buf, i); + } + break; + default: + //?15n printer status + log_f (c->l, "<%s:%d unhandled DSR: \\033%s>", __FILE__, + __LINE__, buf); + } break; case 'q': //Load LED on off break; @@ -1314,8 +1320,8 @@ vt102_parse_csi (Context * c, char *buf, int len) break; case 'y': //Invoke confidence test break; - case 'z': //request terminal parameters - break; + case 'z': //request terminal parameters + break; default: log_f (c->l, "<%s:%d unhandled CSI: \\033%s>", __FILE__, __LINE__, @@ -1340,10 +1346,11 @@ vt102_parse_esc (Context * c) VT102 *v = c->v; VT102_parser *p = &v->parser; -#if 1 +#ifdef DEBUG p->cmd_buf[p->cmd_ptr] = 0; - log_f (c->l, "%s >", v->pos.x, v->pos.y, - v->pending_wrap, !v->private_modes[VT102_PRIVATE_MODE_VT52],p->cmd_buf); + log_f (c->l, "%s >", v->pos.x, + v->pos.y, v->pending_wrap, + !v->private_modes[VT102_PRIVATE_MODE_VT52], p->cmd_buf); #endif if (!v->private_modes[VT102_PRIVATE_MODE_VT52]) @@ -1514,8 +1521,10 @@ vt102_parse_esc (Context * c) } p->cmd_buf[p->cmd_ptr] = 0; +#ifdef DEBUG log_f (c->l, "", v->pos.x, v->pos.y, v->pending_wrap); +#endif } void @@ -1700,7 +1709,7 @@ vt102_parse_char (Context * c, int ch) } else { -#if 1 +#ifdef DEBUG if (ch != 27) log_f (c->l, "l, "", v->pos.x, v->pos.y, v->pending_wrap); -- cgit v1.2.3