4 * Copyright (c) 2008 James McKenzie <james@fishsoup.dhs.org>,
9 static char rcsid[] = "$Id$";
13 * Revision 1.8 2008/02/07 13:19:48 james
14 * *** empty log message ***
16 * Revision 1.7 2008/02/07 12:41:06 james
17 * *** empty log message ***
19 * Revision 1.6 2008/02/07 12:16:04 james
20 * *** empty log message ***
22 * Revision 1.5 2008/02/06 11:30:37 james
23 * *** empty log message ***
25 * Revision 1.4 2008/02/05 01:11:46 james
26 * *** empty log message ***
28 * Revision 1.3 2008/02/04 20:23:55 james
29 * *** empty log message ***
31 * Revision 1.2 2008/02/04 02:05:06 james
32 * *** empty log message ***
34 * Revision 1.1 2008/02/03 23:31:25 james
35 * *** empty log message ***
42 crt_erase (CRT * c, CRT_Pos s, CRT_Pos e, int ea)
44 CRT_CA *ps = &c->screen[CRT_ADDR_POS (&s)];
45 CRT_CA *pe = &c->screen[CRT_ADDR_POS (&e)];
51 ps->attr = CRT_ATTR_NORMAL;
52 ps->color = CRT_COLOR_NORMAL;
63 CRT_Pos e = { CRT_COLS - 1, CRT_ROWS - 1 };
66 crt_erase (c, s, e, 1);
71 crt_scroll_up (CRT * c, CRT_Pos s, CRT_Pos e, int ea)
91 p = CRT_ADDR_POS (&s);
95 memcpy (&c->screen[p], &c->screen[p + CRT_COLS], l);
100 crt_erase (c, s, e, ea);
105 crt_scroll_down (CRT * c, CRT_Pos s, CRT_Pos e, int ea)
119 l *= sizeof (CRT_CA);
124 p = CRT_ADDR_POS (&e);
128 memcpy (&c->screen[p], &c->screen[p - CRT_COLS], l);
133 crt_erase (c, s, e, ea);
149 crt_insert (CRT * c, CRT_CA ca)
153 if (c->pos.x >= CRT_COLS)
154 c->pos.x = CRT_COLS - 1;
157 if (c->pos.y >= CRT_ROWS)
158 c->pos.y = CRT_ROWS - 1;
160 c->screen[CRT_ADDR (c->pos.y, c->pos.x)] = ca;