/*
* $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 ***
*
#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";
&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;
}
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;
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__,
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])
}
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
}
else
{
-#if 1
+#ifdef DEBUG
if (ch != 27)
log_f (c->l,
"<chr in x=%3d y=%2d aw=%d \\%03o %3d %c",
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);