changeset 24275:a12f357e8bd0

Implement Flash/Steady (swapping foreground/background colors) and Conceal (filling following chars with spaces) control characters.
author voroshil
date Wed, 29 Aug 2007 17:28:41 +0000
parents 2381f759cbcf
children e8b635a55781
files stream/tvi_vbi.c
diffstat 1 files changed, 19 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/stream/tvi_vbi.c	Wed Aug 29 15:20:30 2007 +0000
+++ b/stream/tvi_vbi.c	Wed Aug 29 17:28:41 2007 +0000
@@ -572,6 +572,7 @@
     int bg_color=0;
     int row,col;
     int separated=0;
+    int conceal;
 
     for(row=0;row<VBI_ROWS;row++)   {
         lat=(lang==0);
@@ -579,6 +580,7 @@
         fg_color=7;
         bg_color=0;
         separated=0;
+        conceal=0;
         for(col=0;col<VBI_COLUMNS;col++){
             i=row*VBI_COLUMNS+col;
             c=raw[i];
@@ -592,13 +594,24 @@
             p[i].ctl=(c&0x60)==0?1:0;
             p[i].fg=fg_color;
             p[i].bg=bg_color;
-
+            
             if ((c&0x60)==0){ //control chars
-                if(c>=0x08 && c<=0x0f){
+                if(c>=0x08 && c<=0x09){//Flash/Steady
+                    int tmp;
+                    tmp=bg_color;
+                    bg_color=fg_color;
+                    fg_color=tmp;
+                    if(c==0x09){
+                        p[i].fg=fg_color;
+                        p[i].bg=bg_color;
+                    }
+                }else if(c>=0x0a && c<=0x0f){
                 }else if (c<=0x17){ //colors
                     fg_color=c&0x0f;
                     gfx=c>>4;
+                    conceal=0;
                 }else if (c<=0x18){
+                    conceal=1;
                 }else if (c<=0x1a){ //Contiguous/Separated gfx
                     separated=!(c&1);
                 }else if (c<=0x1b){
@@ -612,7 +625,10 @@
                 continue;
             }
 
-            if(gfx){
+            if(conceal){
+                p[i].gfx=0;
+                p[i].unicode=' ';
+            }else if(gfx){
                 p[i].unicode=c-0x20;
                 if (p[i].unicode>0x3f) p[i].unicode-=0x20;
             }else