X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fcrt.c;h=9d6606a15bcb148486987ee0353aa35ab59d0ca5;hb=27d58d10ac6a8cab73476a3a6f03cb716fb9a723;hp=36011a986ba710cd936159e404f3987b9dc101d8;hpb=8ba373fecb91b8f276c754f63a5a7f1490f76dcc;p=sympathy.git diff --git a/src/crt.c b/src/crt.c index 36011a9..9d6606a 100644 --- a/src/crt.c +++ b/src/crt.c @@ -10,6 +10,39 @@ static char rcsid[] = "$Id$"; /* * $Log$ + * Revision 1.14 2008/02/27 00:27:21 james + * *** empty log message *** + * + * Revision 1.13 2008/02/26 23:56:12 james + * *** empty log message *** + * + * Revision 1.12 2008/02/26 23:23:17 james + * *** empty log message *** + * + * Revision 1.11 2008/02/23 11:48:37 james + * *** empty log message *** + * + * Revision 1.10 2008/02/22 17:07:00 james + * *** empty log message *** + * + * Revision 1.9 2008/02/07 13:22:51 james + * *** empty log message *** + * + * Revision 1.8 2008/02/07 13:19:48 james + * *** empty log message *** + * + * Revision 1.7 2008/02/07 12:41:06 james + * *** empty log message *** + * + * Revision 1.6 2008/02/07 12:16:04 james + * *** empty log message *** + * + * Revision 1.5 2008/02/06 11:30:37 james + * *** empty log message *** + * + * Revision 1.4 2008/02/05 01:11:46 james + * *** empty log message *** + * * Revision 1.3 2008/02/04 20:23:55 james * *** empty log message *** * @@ -24,7 +57,7 @@ static char rcsid[] = "$Id$"; #include "project.h" void -crt_erase (CRT * c, CRT_Pos s, CRT_Pos e,int ea) +crt_erase (CRT * c, CRT_Pos s, CRT_Pos e, int ea, int color) { CRT_CA *ps = &c->screen[CRT_ADDR_POS (&s)]; CRT_CA *pe = &c->screen[CRT_ADDR_POS (&e)]; @@ -33,7 +66,10 @@ crt_erase (CRT * c, CRT_Pos s, CRT_Pos e,int ea) { ps->chr = ' '; if (ea) - ps->attr = CRT_ATTR_NORMAL; + { + ps->attr = CRT_ATTR_NORMAL; + ps->color = color; + } ps++; } @@ -46,26 +82,27 @@ crt_cls (CRT * c) CRT_Pos e = { CRT_COLS - 1, CRT_ROWS - 1 }; int i; - crt_erase (c, s, e,1); - + crt_erase (c, s, e, 1, CRT_COLOR_NORMAL); #if 0 - for (i = 0; i < CRT_ROWS; ++i) - { - c->screen[CRT_ADDR (i, i)].chr = '@' + i; - c->screen[CRT_ADDR (i, i)].attr = CRT_ATTR_NORMAL; - } + c->sh.dir = 0; #endif - } void -crt_scroll_up (CRT * c, CRT_Pos s, CRT_Pos e,int ea) +crt_scroll_up (CRT * c, CRT_Pos s, CRT_Pos e, int ea, int color) { int l, n; int p; - s.x=0; - e.x=CRT_COLS-1; + + s.x = 0; + e.x = CRT_COLS - 1; + +#if 0 + c->sh.s = s; + c->sh.e = e; + c->sh.dir = -1; +#endif l = e.x - s.x; l++; @@ -73,6 +110,7 @@ crt_scroll_up (CRT * c, CRT_Pos s, CRT_Pos e,int ea) n = e.y - s.y; + p = CRT_ADDR_POS (&s); while (n--) @@ -82,35 +120,42 @@ crt_scroll_up (CRT * c, CRT_Pos s, CRT_Pos e,int ea) } s.y = e.y; - crt_erase (c, s, e,ea); + crt_erase (c, s, e, ea, color); } void -crt_scroll_down (CRT * c, CRT_Pos s, CRT_Pos e,int ea) +crt_scroll_down (CRT * c, CRT_Pos s, CRT_Pos e, int ea, int color) { int l, n; int p; - s.x=0; - e.x=CRT_COLS-1; + s.x = 0; + e.x = CRT_COLS - 1; + +#if 0 + c->sh.s = s; + c->sh.e = e; + c->sh.dir = 1; +#endif l = e.x - s.x; l++; l *= sizeof (CRT_CA); n = e.y - s.y; + //n++; p = CRT_ADDR_POS (&e); while (n--) { - memcpy (&c->screen[p], &c->screen[p + CRT_COLS], l); p -= CRT_COLS; + memcpy (&c->screen[p], &c->screen[p - CRT_COLS], l); } e.y = s.y; - crt_erase (c, s, e,ea); + crt_erase (c, s, e, ea, color); } @@ -122,6 +167,10 @@ crt_reset (CRT * c) c->pos.x = 0; c->pos.y = 0; c->hide_cursor = 1; + c->width = CRT_COLS; +#if 0 + c->sh.dir = 0; +#endif } void @@ -138,6 +187,7 @@ crt_insert (CRT * c, CRT_CA ca) c->screen[CRT_ADDR (c->pos.y, c->pos.x)] = ca; - - +#if 0 + c->sh.dir = 0; +#endif }