summaryrefslogtreecommitdiffstats
path: root/screen-write.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@openbsd.org>2009-06-03 23:30:40 +0000
committerNicholas Marriott <nicm@openbsd.org>2009-06-03 23:30:40 +0000
commit52ec9b9ec418dbb80e0ebaf8a418eab22e2dd21f (patch)
tree272d4423355ab2387775d1b794546dbde38f41ee /screen-write.c
parentebe07c27260c295256e7c66480057a3fcfdc9e7f (diff)
Implement the DEC alignment test. With the last change this is enough for the
first cursor test in vttest (in ports) to pass; it still shops a few more problems though.
Diffstat (limited to 'screen-write.c')
-rw-r--r--screen-write.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/screen-write.c b/screen-write.c
index 033a1a52..700e150c 100644
--- a/screen-write.c
+++ b/screen-write.c
@@ -291,6 +291,31 @@ screen_write_cursorleft(struct screen_write_ctx *ctx, u_int nx)
s->cx -= nx;
}
+/* VT100 alignment test. */
+void
+screen_write_alignmenttest(struct screen_write_ctx *ctx)
+{
+ struct screen *s = ctx->s;
+ struct grid_cell gc;
+ u_int xx, yy;
+
+ memcpy(&gc, &grid_default_cell, sizeof gc);
+ gc.data = 'E';
+
+ for (yy = 0; yy < screen_size_y(s); yy++) {
+ for (xx = 0; xx < screen_size_x(s); xx++)
+ grid_view_set_cell(s->grid, xx, yy, &gc);
+ }
+
+ s->cx = 0;
+ s->cy = 0;
+
+ s->rupper = 0;
+ s->rlower = screen_size_y(s) - 1;
+
+ tty_write_cmd(ctx->wp, TTY_ALIGNMENTTEST);
+}
+
/* Insert nx characters. */
void
screen_write_insertcharacter(struct screen_write_ctx *ctx, u_int nx)