aboutsummaryrefslogtreecommitdiffstats
path: root/src/crt.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/crt.c')
-rw-r--r--src/crt.c51
1 files changed, 51 insertions, 0 deletions
diff --git a/src/crt.c b/src/crt.c
new file mode 100644
index 0000000..24c0f02
--- /dev/null
+++ b/src/crt.c
@@ -0,0 +1,51 @@
+/*
+ * crt.c:
+ *
+ * Copyright (c) 2008 James McKenzie <james@fishsoup.dhs.org>,
+ * All rights reserved.
+ *
+ */
+
+static char rcsid[] = "$Id$";
+
+/*
+ * $Log$
+ * Revision 1.1 2008/02/03 23:31:25 james
+ * *** empty log message ***
+ *
+ */
+
+#include "project.h"
+
+void crt_cls(CRT *c)
+{
+int i;
+
+for (i=0;i<CRT_CELS;++i) {
+ c->screen[i].chr=' ';
+ c->screen[i].chr=CRT_ATTR_NORMAL;
+}
+}
+
+void crt_reset(CRT *c)
+{
+crt_cls(c);
+
+crt->pos.x=0;
+crt->pos.y=0;
+crt->hide_cursor=1;
+}
+
+void crt_insert(CRT *c,CRT_CA ca)
+{
+if (c->pos.x<0) c->pos.x=0;
+if (c->pos.x>=CRT_COLS) c->pos.x=CRT_COLS-1;
+if (c->pos.y<0) c->pos.y=0;
+if (c->pos.y>=CRT_ROWS) c->pos.y=CRT_ROWS-1;
+
+crt->screen[CRT_ADDR(c->pos.y,c->pos.x)]=ca;
+
+
+
+}
+