Main Page | Modules | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

vga_console_i.h

Go to the documentation of this file.
00001 // AUTOMATICALLY GENERATED -- DO NOT EDIT!         -*- c++ -*-
00002 
00003 #ifndef vga_console_i_h
00004 #define vga_console_i_h
00005 
00006 #include <cstring>
00007 #include <cctype>
00008 
00009 #include "io.h"
00010 
00011 //
00012 // IMPLEMENTATION of inline functions follows
00013 //
00014 
00015 
00016 
00017 
00018 inline int Vga_console::seq_6( char const *str, size_t len, unsigned &pos )
00019 {
00020   if( pos+2 >= len ) return 0;
00021   _y = str[pos+1];
00022   _x = str[pos+2];
00023   if( _y >= _height ) _y = _height -1;
00024   if( _x >= _width  ) _x = _width -1;
00025   pos += 2;
00026   return 1;
00027 }
00028 
00029 
00030 
00031 inline int Vga_console::seq_1( char const *, size_t, unsigned & )
00032 {
00033   _x = 0; _y = 0; return 1;
00034 }
00035 
00036 
00037 
00038 inline int Vga_console::seq_5( char const *, size_t , unsigned & )
00039 {
00040   for( unsigned i = 0; i<_width-_x; ++i)
00041     _video_base[_x+(_y*_width)+i] = (VChar){ c: 0x20, a: _attribute };
00042 
00043   return 1;
00044 }
00045 
00046 
00047 
00048 inline void Vga_console::ansi_attrib( int a )
00049 {
00050   char const colors[] = { 0, 4, 2, 6, 1, 5, 3, 7 };
00051 
00052   if(!_use_color && a>=30 && a <=47)
00053     return;
00054 
00055   switch(a) {
00056   case 0:
00057     if(_light_white)
00058       _attribute = 0x0f;
00059     else
00060       _attribute = 0x07;
00061     break;
00062   case 1:
00063     _attribute |= 0x0808;
00064     break;
00065   case 22:
00066     _attribute &= ~0x0808;
00067     break;
00068   case 5:
00069     _attribute |= 0x8080;
00070   default:
00071     if (30 <= a && a <= 37) 
00072       _attribute = (_attribute & 0x0f0) | colors[a-30] | ((_attribute >> 8) & 0x08);
00073     else if (40 <= a && a <= 47)
00074       _attribute = (_attribute & 0x0f) | (colors[a-40] << 4) | ((_attribute >> 8) & 0x80);
00075     break;
00076   };
00077 
00078 }
00079 
00080 #endif // vga_console_i_h

Generated on Mon Sep 26 14:20:12 2005 for Fiasco by  doxygen 1.4.2