home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c005 / 4.ddi / C / GRPTREAD.C < prev    next >
Encoding:
C/C++ Source or Header  |  1987-04-13  |  1019 b   |  44 lines

  1. /**
  2. *
  3. * Name        grptread -- Read the color of a point
  4. *
  5. * Synopsis    color = grptread(ppos);
  6. *
  7. *        int color      The color of the point at *ppos.
  8. *                  The color is in the range 0 to 3,
  9. *                  corresponding to the selected
  10. *                  palette.
  11. *        PT  *ppos      Pointer to the coordinates of the point
  12. *                  whose color is returned.
  13. *
  14. * Description    GRPTREAD returns the palette color associated with the
  15. *        point on the current display page whose position is
  16. *        given by *ppos.
  17. *
  18. * Returns    color          The color of the point at *ppos.
  19. *
  20. * Version    3.0 (C)Copyright Blaise Computing Inc.    1983, 1984, 1986
  21. *
  22. * Version    3.02 March 20, 1987
  23. *        Corrected the BIOS function number.
  24. *
  25. **/
  26.  
  27. #include <bgraph.h>
  28. #include <bscreen.h>
  29.  
  30. int grptread(ppos)
  31. PT *ppos;
  32. {
  33.     int ax,bx,cx,dx,flags;
  34.  
  35.     ax = 0x0d00;
  36.     bx = utbyword(b_curpage,0);
  37.     cx = ppos->x % max_x;          /* Wrap values on the screen.   */
  38.     dx = ppos->y % max_y;
  39.  
  40.     bios(16,&ax,&bx,&cx,&dx,&flags);
  41.  
  42.     return(utlobyte(ax));
  43. }
  44.