From: Alan Cox Date: Fri, 21 Aug 2015 18:44:43 +0000 (+0100) Subject: From: Brett Gordon X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=3df74760eb83c1e5acc674f2d5b2c1b3244984b3;p=FUZIX.git From: Brett Gordon coco3: Allow each vt screen to have its own mode --- diff --git a/Kernel/platform-coco3/Makefile b/Kernel/platform-coco3/Makefile index a356f367..7242383c 100644 --- a/Kernel/platform-coco3/Makefile +++ b/Kernel/platform-coco3/Makefile @@ -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 \ diff --git a/Kernel/platform-coco3/config.h b/Kernel/platform-coco3/config.h index c103c7ab..2cf176b1 100644 --- a/Kernel/platform-coco3/config.h +++ b/Kernel/platform-coco3/config.h @@ -40,10 +40,10 @@ // #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 ); diff --git a/Kernel/platform-coco3/devtty.c b/Kernel/platform-coco3/devtty.c index dcc249e9..7b760cb1 100644 --- a/Kernel/platform-coco3/devtty.c +++ b/Kernel/platform-coco3/devtty.c @@ -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; diff --git a/Kernel/platform-coco3/devtty.h b/Kernel/platform-coco3/devtty.h index 2ebd66d4..339ae494 100644 --- a/Kernel/platform-coco3/devtty.h +++ b/Kernel/platform-coco3/devtty.h @@ -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 */