diff cos/kernel/video.c @ 23:5dd47d6eebac

Added ubersimple malloc algorithm
author windel
date Thu, 01 Dec 2011 21:42:59 +0100
parents 6129643f5c34
children d8627924d40d
line wrap: on
line diff
--- a/cos/kernel/video.c	Wed Nov 30 22:41:51 2011 +0100
+++ b/cos/kernel/video.c	Thu Dec 01 21:42:59 2011 +0100
@@ -6,9 +6,8 @@
 #define NUM_ROWS 25
 #define SCREEN_SIZE (NUM_COLS * NUM_ROWS)
 
-#define SCREEN_ATTR 0x0F
-
 static int row, col;
+uint8_t video_color = 0x1F;
 
 void move_cursor()
 {
@@ -27,7 +26,7 @@
 
 	for (loop = 0; loop < SCREEN_SIZE; loop++) {
 		*vidmem++ = 0x20;
-		*vidmem++ = SCREEN_ATTR;
+		*vidmem++ = video_color;
 	}
 }
 
@@ -53,7 +52,7 @@
 	}
 
 	for (v = (unsigned short*) VIDMEM + n, i = 0; i < NUM_COLS; i++) {
-		*v++ = SCREEN_ATTR & (0x20 << 8);
+		*v++ = (video_color << 8) & 0x20;
 	}
 }
 
@@ -76,7 +75,7 @@
 
 	for (loop = col; loop < NUM_COLS; loop++) {
 		*v++ = ' ';
-		*v++ = SCREEN_ATTR;
+		*v++ = video_color;
 	}
 }
 
@@ -92,7 +91,7 @@
 		break;
 	default:
 		*v++ = (unsigned char) c;
-		*v   = SCREEN_ATTR;
+		*v   = video_color;
 		
 		if (col < NUM_COLS - 1)
 			++col;