coco3: dont keep vt color state, kernel does it now.
authorBrett Gordon <beretta42@gmail.com>
Thu, 24 May 2018 14:49:14 +0000 (10:49 -0400)
committerBrett Gordon <beretta42@gmail.com>
Thu, 24 May 2018 14:49:14 +0000 (10:49 -0400)
Kernel/platform-coco3/devtty.c
Kernel/platform-coco3/devtty.h
Kernel/platform-coco3/video.c

index d4c5854..82fd6e9 100644 (file)
@@ -26,7 +26,7 @@ extern uint8_t hz;
 
 
 uint8_t vtattr_cap;
-
+uint8_t curattr;
 
 #define tbuf1 (uint8_t *)(0x2000+TTYSIZ*0)
 #define tbuf2 (uint8_t *)(0x2000+TTYSIZ*1)
@@ -476,7 +476,7 @@ void platform_interrupt(void)
 
 void vtattr_notify(void)
 {
-       curpty->attr = ((vtink&7)<<3) + (vtpaper&7);
+       curattr = ((vtink&7)<<3) + (vtpaper&7);
 }
 
 int gfx_ioctl(uint8_t minor, uarg_t arg, char *ptr)
index 34a2c86..43c3d50 100644 (file)
@@ -23,10 +23,10 @@ struct pty {
        unsigned char right;    /* right most coord */
        unsigned char bottom;   /* bottom most coord */
        struct display *fdisp;  /* ptr to struct for ioctl */
-       uint8_t attr;           /* attribute byte to apply */
 };
 
 extern struct pty *curpty;
+extern uint8_t curattr;
 
 int my_tty_close( uint8_t minor ); /* wrapper call to close DW ports */
 int gfx_ioctl(uint8_t minor, uarg_t arg, char *ptr);
index da391a6..c1b7e1d 100644 (file)
@@ -1,4 +1,5 @@
 #include <kernel.h>
+#include <vt.h>
 #include <devtty.h>
 #include <video.h>
 
@@ -60,7 +61,7 @@ void plot_char(int8_t y, int8_t x, uint16_t c)
        unsigned char *p=char_addr(y,x);
        map_for_video();
        *p++ = VT_MAP_CHAR(c);
-       *p = curpty->attr;
+       *p = curattr;
        map_for_kernel();
 }
 
@@ -69,7 +70,7 @@ void clear_lines(int8_t y, int8_t ct)
        uint16_t wc= ct * VT_WIDTH;
        map_for_video();
        uint16_t *s = (uint16_t *)char_addr(y, 0);
-       uint16_t w = ' ' * 0x100 + curpty->attr;
+       uint16_t w = ' ' * 0x100 + curattr;
        while(  wc-- )
                *s++=w;
        map_for_kernel();
@@ -79,7 +80,7 @@ void clear_across(int8_t y, int8_t x, int16_t l)
 {
        map_for_video();
        uint16_t *s = (uint16_t *)char_addr(y, x);
-       uint16_t w=' ' * 0x100 + curpty->attr;
+       uint16_t w=' ' * 0x100 + curattr;
        while( l-- )
                *s++=w;
        map_for_kernel();