openblt

a hobby OS from the late 90s
git clone http://frotz.net/git/openblt.git
Log | Files | Refs | LICENSE

vt100.h (929B)


      1 /* $Id: //depot/blt/srv/console2/vt100.h#4 $ */
      2 /* VT100 Engine Copyright 1997 Daniel Marks <dmarks@uiuc.edu> */  
      3 
      4 #ifndef _VT_100_H
      5 #define _VT_100_H
      6 
      7 #include <blt/qsem.h>
      8 
      9 typedef unsigned short ushort;
     10 
     11 #define loc_in_virtscreen(cur,y,x) (((cur)->data)+(((y)*((cur)->columns))+(x)))
     12 #define MAX_ANSI_ELEMENTS 16
     13 #define char_to_virtscreen(cur,ch) (((cur)->next_char_send)((cur),(ch)))
     14 
     15 struct virtscreen
     16 {
     17   int rows;
     18   int columns; 
     19   int num_bytes;
     20   ushort *data;
     21   ushort *back;
     22   ushort *data_off_scr;
     23 
     24   int xpos;
     25   int ypos;
     26   int top_scroll;
     27   int bottom_scroll;
     28   int attrib;
     29   int old_attrib;
     30   int old_xpos;
     31   int old_ypos;
     32 
     33   int cur_ansi_number;
     34   int ansi_elements;
     35   int ansi_reading_number;
     36   int ansi_element[MAX_ANSI_ELEMENTS];
     37 
     38   void (*next_char_send)(struct virtscreen *cur, unsigned char ch);
     39 
     40   int lock;
     41 };
     42 
     43 
     44 int init_virtscreen(struct virtscreen *cur, int rows, int columns);
     45 #endif /* _VT_100_h */