home *** CD-ROM | disk | FTP | other *** search
/ GRIPS 2: Government Rast…rocessing Software & Data / GRIPS_2.cdr / dos / imcomp / targah.h < prev    next >
C/C++ Source or Header  |  1990-12-29  |  3KB  |  99 lines

  1. #undef NINE8
  2. #undef TARGA16
  3.  
  4. #define ATT6300PC                        /* bg 9/25/87 */
  5. #undef  ZENITHPC                        /* bg 9/25/87 */
  6.  
  7. #if defined(ATT6300PC)
  8. #  define TARGA_BASE_ADDR        0xA0000000
  9. #  undef ZENITHPC
  10. #endif
  11.  
  12. #if defined(ZENITHPC)
  13. #  define TARGA_BASE_ADDR        0xD0000000
  14. #  undef ATT6300PC
  15. #endif
  16.  
  17. #if defined(TARGA32)
  18. #  define TARGAS
  19. #  define TARG1632
  20. #  define COLSIZE unsigned long
  21. #  define TNUMB 2  /* 2**TNUMB bytes/pixel */
  22. #  define SEGSHIFT 4 /* 4 (div/16) for TARGA32 */
  23. #  define TARMSK 0x1fff
  24. #endif
  25.  
  26. #if defined(TARGAM8)
  27. #  define TARGAS
  28. #  define COLSIZE unsigned char
  29. #  define TNUMB 0  /* 2**TNUMB bytes/pixel */
  30. #  define SEGSHIFT 6 /* 4 (div/64) for TARGAM8 */
  31. #  define TARMSK 0x7fff
  32. #endif
  33.  
  34. #if defined(TARGA16)
  35. #  define TARGAS
  36. #  define TARG1632
  37. #  define COLSIZE unsigned short
  38. #  define TNUMB 1  /* 2**TNUMB bytes/pixel */
  39. #  define SEGSHIFT 5  /* 5 (div/32) for TARGA16 */
  40. #  define TARMSK 0x3fff
  41. #endif
  42.  
  43. #if defined(NINE8)
  44. #  define COLSIZE unsigned char
  45. #  define TNUMB 0  /* 2**TNUMB bytes/pixel */
  46. #    define NNVBIT        (0x20)
  47. #    define NNSTATS        ((unsigned char *)(0xC0000000))
  48. #    define NNSEGL        ((unsigned char *)(0xC0000705))
  49. #    define NNSEGH        ((unsigned char *)(0xC0000706))
  50. #    define NNDAT        ((unsigned char *)(0xA0000000))
  51. #    define NNRED        ((unsigned char *)(0xC0000100))
  52. #    define NNGRN        ((unsigned char *)(0xC0000200))
  53. #    define NNBLU        ((unsigned char *)(0xC0000300))
  54. #    define NNZOOM        ((unsigned char *)(0xC0000700))
  55. #endif
  56.  
  57. #define YMAX 484
  58. #define XMAX 512
  59.    /* the two below are in tardev.h
  60.    #define IOBASE   0x220
  61.    #define DESTREG   (IOBASE+0x802)
  62.    */
  63.   /*
  64.    * define a macro to check bounds
  65.    * of a single point
  66.    */
  67. #define clipp(x,y) \
  68.    (y < winminy || y > winmaxy || \
  69.     x < winminx || x > winmaxx)
  70. /*
  71.  * set register for correct y 
  72.  * and evaluate to address of point 
  73.  */
  74.  
  75. #ifdef NINE8
  76. #  define FLIP -1
  77.    /* set register for correct y stripe
  78.     * and evaluate to address of point 
  79.     */
  80. #  define POINT(x,y) ( \
  81.       *NNSEGL = (y) & 0x80,  \
  82.       *NNSEGH = ((y) >> 1) & 0x80, \
  83.       NNDAT + (((y) & 0x7f) <<9 ) + (x) )
  84. #else
  85.    /* for TARGAs */
  86. #  define FLIP 1
  87. #  define POINT(x,y) \
  88.        (outp(DESTREG, y >> SEGSHIFT), \
  89.        ((COLSIZE *)TARGA_BASE_ADDR + ((x | y << 9) & TARMSK)))
  90.  
  91.    extern struct TARStruct *targa;
  92. #  define   POKE(a,b,c,d)        memcpy(a,b,  c, d )
  93. #  define   PEEK(a,b,c,d)        memcpy(c,   a,b, d)
  94. #  define TCHAR        ((unsigned char *)(TARGA_BASE_ADDR))
  95. #  define TLONG        ((COLSIZE *)(TARGA_BASE_ADDR))
  96. #endif
  97.  
  98. extern int tmode,xormode;
  99.