initial hasty attempt at porting over my VBE code
[bootcensus] / src / test / vbetest.c
diff --git a/src/test/vbetest.c b/src/test/vbetest.c
new file mode 100644 (file)
index 0000000..1525bd8
--- /dev/null
@@ -0,0 +1,22 @@
+#include <string.h>
+#include "video.h"
+#include "asmops.h"
+#include "keyb.h"
+
+static uint16_t *framebuf;
+
+int vbetest(void)
+{
+       if(!(framebuf = set_video_mode(640, 480, 16))) {
+               return -1;
+       }
+
+       memset(framebuf, 0xff, 640 * 240 * 2);
+
+       while(kb_getkey() == -1) {
+               halt_cpu();
+       }
+
+       set_vga_mode(3);
+       return 0;
+}