diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/crt.c | 7 | ||||
-rw-r--r-- | src/symsocket.c | 5 | ||||
-rw-r--r-- | src/vt102.c | 67 | ||||
-rw-r--r-- | src/vt102_charset.c | 27 |
4 files changed, 62 insertions, 44 deletions
@@ -10,6 +10,9 @@ static char rcsid[] = "$Id$"; /* * $Log$ + * Revision 1.14 2008/02/27 00:27:21 james + * *** empty log message *** + * * Revision 1.13 2008/02/26 23:56:12 james * *** empty log message *** * @@ -141,14 +144,14 @@ crt_scroll_down (CRT * c, CRT_Pos s, CRT_Pos e, int ea, int color) l *= sizeof (CRT_CA); n = e.y - s.y; - n++; + //n++; p = CRT_ADDR_POS (&e); while (n--) { - memcpy (&c->screen[p], &c->screen[p - CRT_COLS], l); p -= CRT_COLS; + memcpy (&c->screen[p], &c->screen[p - CRT_COLS], l); } e.y = s.y; diff --git a/src/symsocket.c b/src/symsocket.c index ee5869a..22f0bf6 100644 --- a/src/symsocket.c +++ b/src/symsocket.c @@ -11,6 +11,9 @@ static char rcsid[] = /* * $Log$ + * Revision 1.6 2008/02/27 00:27:22 james + * *** empty log message *** + * * Revision 1.5 2008/02/20 22:54:22 staffcvs * *** empty log message *** * @@ -32,7 +35,7 @@ static char rcsid[] = #include <sys/socket.h> #include <sys/un.h> -#define BUF_SIZE 16384 +#define BUF_SIZE 65536 #define MAX_TXN 4096 int 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, "<cmd in x=%3d y=%2d aw=%d vt=%d <ESC>%s >", v->pos.x, v->pos.y, - v->pending_wrap, !v->private_modes[VT102_PRIVATE_MODE_VT52],p->cmd_buf); + log_f (c->l, "<cmd in x=%3d y=%2d aw=%d vt=%d <ESC>%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, "<cmd out x=%3d y=%2d aw=%d>", 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, "<chr in x=%3d y=%2d aw=%d \\%03o %3d %c", @@ -1770,7 +1779,7 @@ vt102_parse_char (Context * c, int ch) vt102_regular_char (c, v, ch); } -#if 1 +#ifdef DEBUG if (ch != 27) log_f (c->l, "<chr out x=%3d y=%2d aw=%d>", v->pos.x, v->pos.y, v->pending_wrap); diff --git a/src/vt102_charset.c b/src/vt102_charset.c index 1835455..49abe8f 100644 --- a/src/vt102_charset.c +++ b/src/vt102_charset.c @@ -11,6 +11,9 @@ static char rcsid[] = /* * $Log$ + * Revision 1.3 2008/02/27 00:27:22 james + * *** empty log message *** + * * Revision 1.2 2008/02/26 23:56:12 james * *** empty log message *** * @@ -67,24 +70,24 @@ uint32_t vt102_charset_vt52[VT102_CHARSET_SIZE] = { [0x5f] = 0x25ae, [0x60] = 0x25ae, [0x61] = 0x25ae, - [0x62] = 0x215f, - [0x63] = '3', // 3/ - [0x64] = '5', // 5/ - [0x65] = '7', // 7/ + [0x62] = 0x215f, + [0x63] = '3', // 3/ + [0x64] = '5', // 5/ + [0x65] = '7', // 7/ [0x66] = 0x00b0, [0x67] = 0x00b1, [0x68] = 0x2192, [0x69] = 0x2026, [0x6a] = 0x00f7, [0x6b] = 0x2193, - [0x6c] = 0x25ba, //bar scan 0 - [0x6d] = 0x23ba, - [0x6e] = 0x25ba, //bar scan 2 - [0x6f] = 0x23bb, - [0x70] = 0x23bb, //bar scan 4 - [0x71] = 0x2500, - [0x72] = 0x23bc, //bar scan 6 - [0x73] = 0x23bc, + [0x6c] = 0x25ba, //bar scan 0 + [0x6d] = 0x23ba, + [0x6e] = 0x25ba, //bar scan 2 + [0x6f] = 0x23bb, + [0x70] = 0x23bb, //bar scan 4 + [0x71] = 0x2500, + [0x72] = 0x23bc, //bar scan 6 + [0x73] = 0x23bc, [0x74] = 0x2080, [0x75] = 0x2081, [0x76] = 0x2082, |