added 64 and 32 column modes.
authorBrett Gordon <beretta42@gmail.com>
Sat, 8 Aug 2015 15:20:19 +0000 (11:20 -0400)
committerBrett Gordon <beretta42@gmail.com>
Fri, 18 Sep 2015 16:38:29 +0000 (12:38 -0400)
added tty init routine.

Kernel/platform-coco3/devtty.c

index 7b760cb..38d558c 100644 (file)
@@ -60,6 +60,22 @@ struct s_queue ttyinq[NUM_DEV_TTY + 1] = {
 //     unsigned char bottom;   /* bottom most coord */
 //};
 
+struct mode_s{
+       uint8_t gime;
+       uint8_t width;
+       uint8_t height;
+       uint8_t right;
+       uint8_t bottom;
+};
+
+static struct mode_s mode[4] = {
+       {   0x14, 80, 21, 79, 20  },
+       {   0x0c, 40, 21, 39, 20  },
+       {   0x10, 64, 21, 63, 20  },
+       {   0x08, 32, 21, 31, 20  },
+};
+
+
 static struct pty ptytab[] = {
        {
                (unsigned char *) 0xb400, 
@@ -413,3 +429,23 @@ unsigned char vt_map(unsigned char c)
                return 0x7F;
        return c;
 }
+
+
+/* Initial Setup stuff down here. */
+
+
+void devtty_init()
+{
+       int i;
+       int vtmode=0;
+       /* scan cmdline for params for vt */
+
+               /* apply default/cmdline mode to terminal structs */
+       for( i=0; i<2; i++){
+               memcpy( &(ptytab[i].gime), &(mode[vtmode]), 5 );
+       }
+       /* apply terminal to registers */
+       *(unsigned int *) 0xff9d = ptytab[0].scrloc;
+       *(unsigned char *) 0xff99 = ptytab[0].gime;
+}
+