chiark / gitweb /
*** empty log message ***
[sympathy.git] / src / crt.c
1 /*
2  * crt.c:
3  *
4  * Copyright (c) 2008 James McKenzie <james@fishsoup.dhs.org>,
5  * All rights reserved.
6  *
7  */
8
9 static char rcsid[] = "$Id$";
10
11 /*
12  * $Log$
13  * Revision 1.1  2008/02/03 23:31:25  james
14  * *** empty log message ***
15  *
16  */
17
18 #include "project.h"
19
20 void crt_cls(CRT *c)
21 {
22 int i;
23
24 for (i=0;i<CRT_CELS;++i) {
25         c->screen[i].chr=' ';
26         c->screen[i].chr=CRT_ATTR_NORMAL;
27 }
28 }
29
30 void crt_reset(CRT *c)
31 {
32 crt_cls(c);
33
34 crt->pos.x=0;
35 crt->pos.y=0;
36 crt->hide_cursor=1;
37 }
38
39 void crt_insert(CRT *c,CRT_CA ca)
40 {
41 if (c->pos.x<0) c->pos.x=0;
42 if (c->pos.x>=CRT_COLS) c->pos.x=CRT_COLS-1;
43 if (c->pos.y<0) c->pos.y=0;
44 if (c->pos.y>=CRT_ROWS) c->pos.y=CRT_ROWS-1;
45
46 crt->screen[CRT_ADDR(c->pos.y,c->pos.x)]=ca;
47
48
49
50 }
51