home *** CD-ROM | disk | FTP | other *** search
/ Creative Computers / CreativeComputers.iso / shareware / text / dvi_3.62 / source / dvisrc.lha / dvincr.c < prev    next >
Text File  |  1993-10-26  |  3KB  |  83 lines

  1. /*
  2. ** Datei: DVINCR.C
  3. ** Autor: Gerhard Wilhelms
  4. */
  5.  
  6. /*
  7.  * ncr_2plane kopiert die Grafikdarstellung in einer Bitplane in
  8.  * data in die fuer NCR-CGA-Karten im Modus 9 noetige Darstellung
  9.  * mit 2 Bitplanes
  10.  */
  11.  
  12. static unsigned int table[] =
  13. {
  14.     0x0000, 0x0300, 0x0c00, 0x0f00, 0x3000, 0x3300, 0x3c00, 0x3f00,
  15.     0xc000, 0xc300, 0xcc00, 0xcf00, 0xf000, 0xf300, 0xfc00, 0xff00,
  16.     0x0003, 0x0303, 0x0c03, 0x0f03, 0x3003, 0x3303, 0x3c03, 0x3f03,
  17.     0xc003, 0xc303, 0xcc03, 0xcf03, 0xf003, 0xf303, 0xfc03, 0xff03,
  18.     0x000c, 0x030c, 0x0c0c, 0x0f0c, 0x300c, 0x330c, 0x3c0c, 0x3f0c,
  19.     0xc00c, 0xc30c, 0xcc0c, 0xcf0c, 0xf00c, 0xf30c, 0xfc0c, 0xff0c,
  20.     0x000f, 0x030f, 0x0c0f, 0x0f0f, 0x300f, 0x330f, 0x3c0f, 0x3f0f,
  21.     0xc00f, 0xc30f, 0xcc0f, 0xcf0f, 0xf00f, 0xf30f, 0xfc0f, 0xff0f,
  22.     0x0030, 0x0330, 0x0c30, 0x0f30, 0x3030, 0x3330, 0x3c30, 0x3f30,
  23.     0xc030, 0xc330, 0xcc30, 0xcf30, 0xf030, 0xf330, 0xfc30, 0xff30,
  24.     0x0033, 0x0333, 0x0c33, 0x0f33, 0x3033, 0x3333, 0x3c33, 0x3f33,
  25.     0xc033, 0xc333, 0xcc33, 0xcf33, 0xf033, 0xf333, 0xfc33, 0xff33,
  26.     0x003c, 0x033c, 0x0c3c, 0x0f3c, 0x303c, 0x333c, 0x3c3c, 0x3f3c,
  27.     0xc03c, 0xc33c, 0xcc3c, 0xcf3c, 0xf03c, 0xf33c, 0xfc3c, 0xff3c,
  28.     0x003f, 0x033f, 0x0c3f, 0x0f3f, 0x303f, 0x333f, 0x3c3f, 0x3f3f,
  29.     0xc03f, 0xc33f, 0xcc3f, 0xcf3f, 0xf03f, 0xf33f, 0xfc3f, 0xff3f,
  30.     0x00c0, 0x02c0, 0x0cc0, 0x0fc0, 0x30c0, 0x33c0, 0x3cc0, 0x3fc0,
  31.     0xc0c0, 0xc3c0, 0xccc0, 0xcfc0, 0xf0c0, 0xf3c0, 0xfcc0, 0xffc0,
  32.     0x00c3, 0x03c3, 0x0cc3, 0x0fc3, 0x30c3, 0x33c3, 0x3cc3, 0x3fc3,
  33.     0xc0c3, 0xc3c3, 0xccc3, 0xcfc3, 0xf0c3, 0xf3c3, 0xfcc3, 0xffc3,
  34.     0x00cc, 0x03cc, 0x0ccc, 0x0fcc, 0x30cc, 0x33cc, 0x3ccc, 0x3fcc,
  35.     0xc0cc, 0xc3cc, 0xcfcc, 0xcfcc, 0xf0cc, 0xf3cc, 0xfccc, 0xffcc,
  36.     0x00cf, 0x03cf, 0x0ccf, 0x0fcf, 0x30cf, 0x33cf, 0x3ccf, 0x3fcf,
  37.     0xc0cf, 0xc3cf, 0xcccf, 0xcfcf, 0xf0cf, 0xf3cf, 0xfccf, 0xffcf,
  38.     0x00f0, 0x03f0, 0x0cf0, 0x0ff0, 0x30f0, 0x33f0, 0x3cf0, 0x3ff0,
  39.     0xc0f0, 0xc3f0, 0xccf0, 0xcff0, 0xf0f0, 0xf3f0, 0xfcf0, 0xfff0,
  40.     0x00f3, 0x03f3, 0x0cf3, 0x0ff3, 0x30f3, 0x33f3, 0x3cf3, 0x3ff3,
  41.     0xc0f3, 0xc3f3, 0xccf3, 0xcff3, 0xf0f3, 0xf3f3, 0xfcf3, 0xfff3,
  42.     0x00fc, 0x03fc, 0x0cfc, 0x0ffc, 0x30fc, 0x33fc, 0x3cfc, 0x3ffc,
  43.     0xc0fc, 0xc3fc, 0xccfc, 0xcffc, 0xf0fc, 0xf3fc, 0xfcfc, 0xfffc,
  44.     0x00ff, 0x03ff, 0x0cff, 0x0fff, 0x30ff, 0x33ff, 0x3cff, 0x3fff,
  45.     0xc0ff, 0xc3ff, 0xccff, 0xcfff, 0xf0ff, 0xf3ff, 0xfcff, 0xffff
  46. };
  47.  
  48. void ncr_2plane( unsigned int far *temp, int count, unsigned char far *data )
  49. {
  50.     register int i;
  51.  
  52.     for ( i = 0; i < count; i++ )
  53.     temp[i] = table[data[i]];
  54. }
  55.  
  56. /* old version
  57. void ncr_2plane( unsigned char far *temp, int count, unsigned char far *data )
  58. {
  59.     register int i;
  60.  
  61.     for ( i = 0; i < count; i++ )
  62.     {
  63.     temp[2*i] = temp[2*i+1] = 0;
  64.     if ( data[i] & 128 )
  65.         temp[2*i] |= 192;
  66.     if ( data[i] & 64 )
  67.         temp[2*i] |= 48;
  68.     if ( data[i] & 32 )
  69.         temp[2*i] |= 12;
  70.     if ( data[i] & 16 )
  71.         temp[2*i] |= 3;
  72.     if ( data[i] & 8 )
  73.         temp[2*i+1] |= 192;
  74.     if ( data[i] & 4 )
  75.         temp[2*i+1] |= 48;
  76.     if ( data[i] & 2 )
  77.         temp[2*i+1] |= 12;
  78.     if ( data[i] & 1 )
  79.         temp[2*i+1] |= 3;
  80.     }
  81. }
  82. */
  83.