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.2  2008/02/04 02:05:06  james
14  * *** empty log message ***
15  *
16  * Revision 1.1  2008/02/03 23:31:25  james
17  * *** empty log message ***
18  *
19  */
20
21 #include "project.h"
22
23 void
24 crt_cls (CRT * c)
25 {
26   int i;
27
28   for (i = 0; i < CRT_CELS; ++i)
29     {
30       c->screen[i].chr = ' ';
31       c->screen[i].chr = CRT_ATTR_NORMAL;
32     }
33 }
34
35 void
36 crt_reset (CRT * c)
37 {
38   crt_cls (c);
39
40   c->pos.x = 0;
41   c->pos.y = 0;
42   c->hide_cursor = 1;
43 }
44
45 void
46 crt_insert (CRT * c, CRT_CA ca)
47 {
48   if (c->pos.x < 0)
49     c->pos.x = 0;
50   if (c->pos.x >= CRT_COLS)
51     c->pos.x = CRT_COLS - 1;
52   if (c->pos.y < 0)
53     c->pos.y = 0;
54   if (c->pos.y >= CRT_ROWS)
55     c->pos.y = CRT_ROWS - 1;
56
57   c->screen[CRT_ADDR (c->pos.y, c->pos.x)] = ca;
58
59
60
61 }