From: Brett Gordon <beretta42@gmail.com>
authorAlan Cox <alan@linux.intel.com>
Fri, 21 Aug 2015 18:44:43 +0000 (19:44 +0100)
committerAlan Cox <alan@linux.intel.com>
Fri, 21 Aug 2015 18:45:16 +0000 (19:45 +0100)
coco3: Allow each vt screen to have its own mode

Kernel/platform-coco3/Makefile
Kernel/platform-coco3/config.h
Kernel/platform-coco3/devtty.c
Kernel/platform-coco3/devtty.h

index a356f36..7242383 100644 (file)
@@ -1,5 +1,5 @@
 
-CSRCS = devtty.c ttydw.c mbr.c
+CSRCS = ttydw.c mbr.c
 CSRCS += devices.c main.c libc.c devsdc.c
 
 DSRCS = ../dev/devdw.c ../dev/blkdev.c ../dev/devide.c
@@ -33,7 +33,8 @@ clean:
        rm -f $(OBJS) $(JUNK)  core *~
 
 image:
-       $(CROSS_CC) $(CROSS_CCOPTS) -O0 -c -o ../bank16k.o ../bank16k.c
+       $(CROSS_CC) $(CROSS_CCOPTS) -O0 -c -o ../bank16k.o ../bank16k.c 
+       $(CROSS_CC) $(CROSS_CCOPTS) -O0 -c -o devtty.o devtty.c
        $(CROSS_LD) -o ../fuzix.bin --map=../fuzix.map --script=fuzix.link \
        crt0.o commonmem.o \
        coco3.o ../start.o ../version.o ../lowlevel-6809.o \
index c103c7a..2cf176b 100644 (file)
 // #define CONFIG_VT_SIMPLE
 /* Vt definitions */
 #define VT_BASE      (uint8_t *)0xb400
-#define VT_WIDTH       80
-#define VT_HEIGHT      21
-#define VT_RIGHT       79
-#define VT_BOTTOM      20
+#define VT_WIDTH       curpty->width
+#define VT_HEIGHT      curpty->height
+#define VT_RIGHT       curpty->right
+#define VT_BOTTOM      curpty->bottom
 #define VT_INITIAL_LINE 0
 
 extern unsigned char vt_map( unsigned char c );
index dcc249e..7b760cb 100644 (file)
@@ -47,17 +47,44 @@ struct s_queue ttyinq[NUM_DEV_TTY + 1] = {
 
 
 
-static struct pty {
-       unsigned char *base;    /* base of buffer in cpu space */
-       unsigned char *cpos;    /* current location of cursor */
-       unsigned char csave;    /* charactor that is under the cursor */
-       struct vt_switch vt;    /* the vt.o module's state */
-       unsigned int scrloc;    /* location to put into gimme */
-};
+//static struct pty {
+//     unsigned char *base;    /* base of buffer in cpu space */
+//     unsigned char *cpos;    /* current location of cursor */
+//     unsigned char csave;    /* charactor that is under the cursor */
+//     struct vt_switch vt;    /* the vt.o module's state */
+//     unsigned int scrloc;    /* location to put into gimme */
+//     unsigned char gime;     /* video register settings of this tty */   
+//     unsigned char width;    /* text width of screen */
+//     unsigned char height;   /* text height */
+//     unsigned char right;    /* right most coord */
+//     unsigned char bottom;   /* bottom most coord */
+//};
 
 static struct pty ptytab[] = {
-       {(unsigned char *) 0xb400, NULL, 0, {0, 0, 0, 0}, 0xb400 / 8},
-       {(unsigned char *) 0xac80, NULL, 0, {0, 0, 0, 0}, 0xac80 / 8}
+       {
+               (unsigned char *) 0xb400, 
+               NULL, 
+               0, 
+               {0, 0, 0, 0}, 
+               0xb400 / 8,
+               0x14,              /* 80 column */
+               80,
+               21,
+               79,
+               20
+       },
+       {
+               (unsigned char *) 0xac80, 
+               NULL, 
+               0, 
+               {0, 0, 0, 0}, 
+               0xac80 / 8,
+               0x0c,              /* 40 column */
+               40,
+               21,
+               39,
+               20
+       }
 };
 
 
@@ -288,6 +315,7 @@ static void keydecode(void)
                        vt_save(&curpty->vt);
                        curpty = &ptytab[0];
                        *(unsigned int *) 0xff9d = curpty->scrloc;
+                       *(unsigned char *) 0xff99 = curpty->gime;
                        vt_load(&curpty->vt);
                        curminor = 1;
                        return;
@@ -297,6 +325,7 @@ static void keydecode(void)
                        vt_save(&curpty->vt);
                        curpty = &ptytab[1];
                        *(unsigned int *) 0xff9d = curpty->scrloc;
+                       *(unsigned char *) 0xff99 = curpty->gime;
                        vt_load(&curpty->vt);
                        curminor = 2;
                        return;
index 2ebd66d..339ae49 100644 (file)
@@ -1,6 +1,22 @@
 #ifndef __DEVTTY_DOT_H__
 #define __DEVTTY_DOT_H__
 
+#include <../include/vt.h>
+
+static struct pty {
+       unsigned char *base;    /* base of buffer in cpu space */
+       unsigned char *cpos;    /* current location of cursor */
+       unsigned char csave;    /* charactor that is under the cursor */
+       struct vt_switch vt;    /* the vt.o module's state */
+       unsigned int scrloc;    /* location to put into gimme */
+       unsigned char gime;      /* video register settings of this tty */   
+       unsigned char width;    /* text width of screen */
+       unsigned char height;   /* text height */
+       unsigned char right;    /* right most coord */
+       unsigned char bottom;   /* bottom most coord */
+};
+
+extern struct pty *curpty;
 
 int my_tty_close( uint8_t minor ); /* wrapper call to close DW ports */