coco3: add primordial graphics ioctl to devtty
authorBrett Gordon <beretta42@gmail.com>
Fri, 2 Oct 2015 05:13:54 +0000 (01:13 -0400)
committerBrett Gordon <beretta42@gmail.com>
Fri, 2 Oct 2015 05:13:54 +0000 (01:13 -0400)
Kernel/platform-coco3/devtty.c

index 0c21bbe..b766c1b 100644 (file)
@@ -8,6 +8,7 @@
 #include <tty.h>
 #include <devdw.h>
 #include <ttydw.h>
+#include <graphics.h>
 
 #undef  DEBUG                  /* UNdefine to delete debug code sequences */
 
@@ -433,6 +434,29 @@ unsigned char vt_map(unsigned char c)
        return c;
 }
 
+static struct display display = {
+  256, 192,
+  256, 192,
+  0xFF, 0xFF,          /* For now */
+  FMT_MONO_BW,
+  HW_UNACCEL,
+  GFX_ENABLE,
+  0,
+  GFX_SETPIXEL,
+  0
+};
+
+
+int gfx_ioctl(uint8_t minor, uarg_t arg, char *ptr)
+{
+       if (arg >> 8 != 0x03)
+               return vt_ioctl(minor, arg, ptr);
+       if (arg == GFXIOC_GETINFO)
+               return uput(&display, ptr, sizeof(display));
+       udata.u_error = ENOTTY;
+       return -1;
+}
+
 
 /* Initial Setup stuff down here. */