home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_07_06 / v7n6050a.txt < prev    next >
Text File  |  1989-07-25  |  1KB  |  43 lines

  1.  
  2.  
  3.  
  4.                             Listing 1 
  5.  
  6.  
  7. /*
  8.    plot() = plots a point on the screen at designated    
  9.             system coordinates using selected color.     
  10.                                                          
  11. */
  12.  
  13.  
  14.  
  15. void plot(int x, int y, int color)      
  16. {
  17.  
  18.     #define seq_out(index,val)  {outp(0x3C4,index);\
  19.                      outp(0x3C5,val);}
  20.     #define graph_out(index,val)  {outp(0x3CE,index);\
  21.                      outp(0x3CF,val);}
  22.  
  23.     unsigned int offset;
  24.     int dummy,mask,page;
  25.     char far * mem_address;
  26.  
  27.     offset = (long)y * 80L + ((long)x / 8L);
  28.     mem_address = (char far *) 0xA0000000L + offset;
  29.     mask = 0x80 >> (x % 8);
  30.     graph_out(8,mask);
  31.     seq_out(2,0x0F);
  32.     dummy = *mem_address;
  33.     *mem_address = 0;
  34.     seq_out(2,color);
  35.     *mem_address = 0xFF;
  36.     seq_out(2,0x0F);
  37.     graph_out(3,0);
  38.     graph_out(8,0xFF);
  39.  
  40. }
  41.  
  42.  
  43.