home *** CD-ROM | disk | FTP | other *** search
/ Chestnut's Multimedia Mania / MM_MANIA.ISO / graphics / povsrc20 / tiga.h < prev    next >
Text File  |  1992-03-25  |  24KB  |  483 lines

  1. /*-----------------------------------------------------------------------*/
  2. /*                                   TIGA                                */
  3. /*         Copyright (C) 1989-1990  Texas Instruments Incorporated.      */
  4. /*                           All Rights Reserved                         */
  5. /*-----------------------------------------------------------------------*/
  6. /*  TIGA - Header file                                                   */
  7. /*-----------------------------------------------------------------------*/
  8. /*                                                                       */
  9. /*  file            tiga.h                                               */
  10. /*                                                                       */
  11. /*  description     This is the main include file defining TIGA core     */
  12. /*                  primitives and should be included in every           */
  13. /*                  Microsoft-C application that interfaces to TIGA.     */
  14. /*                                                                       */
  15. /*-----------------------------------------------------------------------*/
  16. /*  03/10/89    Reordered command numbers                     G.Short    */
  17. /*  04/23/90    Added _DOUBLE packet type defs                AB         */
  18. /*-----------------------------------------------------------------------*/
  19.  
  20. /*----------------------------------------------------------------------*/
  21. /*  Reference Host-side entry points                                    */
  22. /*----------------------------------------------------------------------*/
  23. extern          long  far _cdecl tiga_set(short);
  24. extern          long  far _cdecl cp_alt(short,short,...);
  25. extern          long  far _cdecl cp_alt_a(short,short,...);
  26. extern          void  far _cdecl cp_cmd(short,short,...);
  27. extern          void  far _cdecl cp_cmd_a(short,short,...);
  28. extern          long  far _cdecl cp_ret(short,short,...);
  29. extern          long  far _cdecl cp_ret_a(short,short,...);
  30. extern          short far _cdecl create_alm(char far *,char far *);
  31. extern          short far _cdecl create_esym(void);
  32. extern          void  far _cdecl dm_cmd(short,short,...);
  33. extern          long  far _cdecl dm_palt(short,short,void far *);
  34. extern          void  far _cdecl dm_pcmd(short,short,...);
  35. extern          void  far _cdecl dm_ipoly(short,short,...);
  36. extern          long  far _cdecl dm_pget(short,short,void far *);
  37. extern          void  far _cdecl dm_poly(short,short,short,void far *);
  38. extern          long  far _cdecl dm_pret(short,short,...);
  39. extern          void  far _cdecl dm_psnd(short,short,void far *);
  40. extern          void  far _cdecl dm_pstr(short,void far *);
  41. extern          long  far _cdecl dm_ptrx(short,short,void far *,short,void far *);
  42. extern          long  far _cdecl dm_ret(short,short,...);
  43. extern unsigned long  far _cdecl field_extract(unsigned long,unsigned short);
  44. extern          void  far _cdecl field_insert(unsigned long,unsigned short,unsigned long);
  45. extern          short far _cdecl flush_esym(void);
  46. extern          void  far _cdecl get_memseg(unsigned long far *,unsigned long far *);
  47. extern unsigned short far _cdecl get_modeinfo(short,void far *);
  48. extern unsigned short far _cdecl get_msg(void);
  49. extern unsigned long  far _cdecl get_vector(short);
  50. extern unsigned short far _cdecl get_videomode(void);
  51. extern unsigned short far _cdecl get_xstate(void);
  52. extern          short far _cdecl gm_is_alive(void);
  53. extern          void  far _cdecl gsp_execute(unsigned long);
  54. extern          void  far _cdecl gsp2host(long,void far *,short,short);
  55. extern          void  far _cdecl gsp2hostxy(long,long,void far *,long,short,short,short,short,short,short,short,short);
  56. extern          short far _cdecl handshake(void);
  57. extern          void  far _cdecl host2gsp(void far *,long,short,short);
  58. extern          void  far _cdecl host2gspxy(void far *,long,long,long,short,short,short,short,short,short,short,short);
  59. extern          short far _cdecl install_alm(char far *);
  60. extern          short far _cdecl install_primitives(void);
  61. extern          short far _cdecl install_rlm(char far *);
  62. extern          void  far _cdecl install_usererror(void (far *)());
  63. extern unsigned long  far _cdecl loadcoff(char far *);
  64. extern          void  far _cdecl makename(char far *,char far *,unsigned short,char far *);
  65. extern unsigned long  far _cdecl oem_init(unsigned long);
  66. extern unsigned short far _cdecl read_hstadrh(void);
  67. extern unsigned short far _cdecl read_hstadrl(void);
  68. extern unsigned long  far _cdecl read_hstaddr(void);
  69. extern unsigned short far _cdecl read_hstctl(void);
  70. extern unsigned short far _cdecl read_hstdata(void);
  71. extern unsigned short far _cdecl rstr_commstate(void);
  72. extern unsigned short far _cdecl save_commstate(void);
  73. extern          short far _cdecl set_config(short,short);
  74. extern          void  far _cdecl set_curs_shape(unsigned long);
  75. extern          void  far _cdecl set_curs_xy(short,short);
  76. extern          void  far _cdecl set_memseg(unsigned long,unsigned long);
  77. extern          void  far _cdecl set_msg(unsigned short);
  78. extern          void  far _cdecl set_timeout(short);
  79. extern unsigned long  far _cdecl set_vector(short,unsigned long);
  80. extern          short far _cdecl set_videomode(unsigned short,unsigned short);
  81. extern          void  far _cdecl set_xstate(unsigned short);
  82. extern          void  far _cdecl synchronize(void);
  83. extern          void  far _cdecl write_hstadrh(unsigned short);
  84. extern          void  far _cdecl write_hstadrl(unsigned short);
  85. extern          void  far _cdecl write_hstaddr(unsigned long);
  86. extern          void  far _cdecl write_hstctl(unsigned short);
  87. extern          void  far _cdecl write_hstdata(unsigned short);
  88. extern          void  far * far _cdecl aux_command(unsigned short, void far *);
  89. extern          void  far _cdecl setup_hostcmd( void far * );
  90. extern          void  far _cdecl hook_init_pal(short,short,...);
  91. extern unsigned long  far _cdecl hook_get_near(short,short,...);
  92. extern          void  far _cdecl hook_get_pal(short,short,...);
  93. extern          void  far _cdecl hook_set_pal(short,short,...);
  94. extern          short far _cdecl hook_get_pal_e(short,short,...);
  95. extern          short far _cdecl hook_set_pal_e(short,short,...);
  96.  
  97. /*----------------------------------------------------------------------*/
  98. /*  Define "C" packet data types                                        */
  99. /*----------------------------------------------------------------------*/
  100. #define _WORD(a)                0,sizeof(short),(short)(a)
  101. #define _SWORD(a)               2,sizeof(short),(short)(a)
  102. #define _DWORD(a)               0,sizeof(long),(long)(a)
  103. #define _DOUBLE(a)              4,sizeof(double),(double)(a)
  104.  
  105. #define _BYTE_PTR(a,b)          1,(short)((a) * sizeof(char)),(char far *)(b)
  106. #define _WORD_PTR(a,b)          1,(short)((a) * sizeof(short)),(short far *)(b)
  107. #define _DWORD_PTR(a,b)         1,(short)((a) * sizeof(long)),(long far *)(b)
  108. #define _DOUBLE_PTR(a,b)        4+1,(short)((a) * sizeof(double)),(double far *)(b)
  109. #define _STRING(a)              64+1,0,(char far *)(a)
  110.  
  111. #define _ALTBYTE_PTR(a,b)       128+1,(short)((a) * sizeof(char)),(char far *)(b)
  112. #define _ALTWORD_PTR(a,b)       128+1,(short)((a) * sizeof(short)),(short far *)(b)
  113. #define _ALTDWORD_PTR(a,b)      128+1,(short)((a) * sizeof(long)),(long far *)(b)
  114. #define _ALTDOUBLE_PTR(a,b)     128+4+1,(short)((a) * sizeof (double)),(double far *)(b)
  115.  
  116. /*----------------------------------------------------------------------*/
  117. /*  Define command number modifiers                                     */
  118. /*----------------------------------------------------------------------*/
  119. #define CORE_CP(a)              (a) | 0x7E00
  120. #define CORE_DM(a)              (a) | 0x3E00
  121. #define EXT_CP(a)               (a) | 0x7C00
  122. #define EXT_DM(a)               (a) | 0x3C00
  123. #define USER_CP(a)              (a) | 0x4000
  124. #define USER_DM(a)              (a) | 0x0000
  125.  
  126. /*----------------------------------------------------------------------*/
  127. /*  Core functions                                                      */
  128. /*----------------------------------------------------------------------*/
  129. #define ADD_INTERRUPT         CORE_CP( 0) 
  130. #define DEL_INTERRUPT         CORE_CP( 1) 
  131. #define FUNCTION_IMPLEMENTED  CORE_CP( 2) 
  132. #define GET_COLORS            CORE_CP( 3) 
  133. #define GET_CONFIG            CORE_CP( 4) 
  134. #define SET_MODULE_STATE      CORE_CP( 5)
  135. #define GSP_MAXHEAP           CORE_CP( 6) 
  136. #define GET_OFFSCREEN_MEMORY  CORE_CP( 7) 
  137. #define GET_PALET_ENTRY       CORE_CP( 8) 
  138. #define GET_PMASK             CORE_CP( 9) 
  139. #define GET_PPOP              CORE_CP(10) 
  140. #define GET_TRANSP            CORE_CP(11) 
  141. #define GET_WINDOWING         CORE_CP(12) 
  142. #define GSP_CALLOC            CORE_CP(13) 
  143. #define GSP_FREE              CORE_CP(14) 
  144. #define GSP_MALLOC            CORE_CP(15) 
  145. #define GSP_MINIT             CORE_CP(16) 
  146. #define GSP_REALLOC           CORE_CP(17) 
  147. #define INIT_CURSOR           CORE_CP(18) 
  148. #define SET_CONFIG            CORE_CP(20) 
  149. #define PAGE_FLIP             CORE_CP(21) 
  150. #define SET_PALET             CORE_CP(22) 
  151. #define TRANSP_OFF            CORE_CP(23) 
  152. #define TRANSP_ON             CORE_CP(24) 
  153. #define VIDEO_ENABLE          CORE_CP(25) 
  154. #define GET_STATE             CORE_CP(26) 
  155. #define CLEAR_SCREEN          CORE_DM(27) 
  156. #define GET_NEAREST_COLOR     CORE_DM(28) 
  157. #define GET_PALET             CORE_CP(29) 
  158. #define GSP2GSP               CORE_DM(30) 
  159. #define INIT_PALET            CORE_DM(31) 
  160. #define LMO                   CORE_DM(32) 
  161. #define PALLOC                CORE_DM(33) 
  162. #define PEEK_BREG             CORE_DM(34) 
  163. #define POKE_BREG             CORE_DM(35) 
  164. #define RMO                   CORE_DM(36) 
  165. #define SET_BCOLOR            CORE_DM(37) 
  166. #define SET_COLORS            CORE_DM(38) 
  167. #define SET_FCOLOR            CORE_DM(39) 
  168. #define SET_INTERRUPT         CORE_CP(40) 
  169. #define SET_PALET_ENTRY       CORE_DM(41) 
  170. #define SET_PMASK             CORE_DM(42) 
  171. #define SET_PPOP              CORE_DM(43) 
  172. #define SET_WINDOWING         CORE_DM(44) 
  173. #define SET_CLIP_RECT         CORE_DM(45) 
  174. #define WAIT_SCAN             CORE_CP(46) 
  175. #define SET_WKSP              CORE_DM(47) 
  176. #define ADD_MODULE            CORE_CP(48) 
  177. #define DEL_MODULE            CORE_CP(49) 
  178. #define DEL_ALL_MODULES       CORE_CP(50) 
  179. #define GET_ISR_PRIORITIES    CORE_CP(51) 
  180. #define INIT_INTERRUPTS       CORE_CP(52) 
  181. #define SET_CURS_SHAPE        CORE_DM(53) 
  182. #define SET_CURS_STATE        CORE_DM(54) 
  183. #define GET_CURS_STATE        CORE_CP(55) 
  184. #define GET_CURS_XY           CORE_CP(56) 
  185. #define FLUSH_EXTENDED        CORE_CP(57) 
  186. #define PAGE_BUSY             CORE_CP(58) 
  187. #define CLEAR_FRAME_BUFFER    CORE_DM(59) 
  188. #define CLEAR_PAGE            CORE_DM(60) 
  189. #define GET_WKSP              CORE_CP(61) 
  190. #define CPW                   CORE_DM(62) 
  191. #define INIT_TEXT             CORE_CP(63) 
  192. #define TEXT_OUT              CORE_CP(64) 
  193. #define GET_FONTINFO          CORE_CP(65) 
  194. #define GET_MODULE            CORE_CP(66)
  195. #define CVXYL                 CORE_DM(67)
  196. #define SET_CURSATTR          CORE_DM(68)
  197. #define COP2GSP               CORE_CP(69)
  198. #define GSP2COP               CORE_CP(70)
  199. #define SET_TRANSP            CORE_DM(71)
  200. #define GET_TEXT_XY           CORE_CP(72)
  201. #define SET_TEXT_XY           CORE_DM(73)
  202. #define TEXT_OUTP             CORE_DM(74)
  203. #define HBM_DEREF             CORE_CP(76)
  204. #define HBM_SETMEMTYPE        CORE_CP(77)
  205. #define HBM_ALLOC             CORE_CP(78)
  206. #define HBM_FALLOC            CORE_CP(79)
  207. #define HBM_FREE              CORE_CP(80)
  208. #define HBM_TOTALFREE         CORE_CP(81)
  209. #define HBM_MAXHEAP           CORE_CP(82)
  210. #define HBM_COMPACT           CORE_CP(83)
  211. #define HBM_REALLOC           CORE_CP(84)
  212. #define HBM_FINDMEM           CORE_CP(85)
  213. #define HBM_INIT              CORE_CP(86)
  214. #define HBM_FINDHANDLE        CORE_CP(87)
  215. #define SYM_OPEN              CORE_CP(90)
  216. #define SYM_CLOSE             CORE_CP(91)
  217. #define SYM_PUT               CORE_CP(92)
  218. #define SYM_GET               CORE_CP(93)
  219. #define SYM_FLUSH             CORE_CP(94)
  220. #define SYM_INIT              CORE_CP(96)
  221. #define HBM_CALLOC            CORE_CP(97)  
  222. #define HBM_FCALLOC           CORE_CP(98)
  223. #define FLUSH_MODULE          CORE_CP(99)
  224.  
  225. /*----------------------------------------------------------------------*/
  226. /*  Reference Core C-Packet function definitions                        */
  227. /*----------------------------------------------------------------------*/
  228. #define add_interrupt(a,b)          \
  229.         (short)cp_ret(ADD_INTERRUPT,2,_WORD(a),_DWORD(b))
  230. #define del_interrupt(a)            \
  231.         cp_cmd(DEL_INTERRUPT,1,_WORD(a))
  232. #define set_interrupt(a,b,c,d)      \
  233.         (short)cp_ret(SET_INTERRUPT,4,_WORD(a),_WORD(b),_WORD(c),_SWORD(d))
  234. #define function_implemented(a)     \
  235.         (short)cp_ret(FUNCTION_IMPLEMENTED,1,_WORD(a))
  236. #define get_colors(a,b)             \
  237.         (void)cp_alt(GET_COLORS,2,_ALTDWORD_PTR(1,a),_ALTDWORD_PTR(1,b))
  238. #define get_config(a)               \
  239.         (void)cp_alt(GET_CONFIG,1,_ALTBYTE_PTR(sizeof(CONFIG),a))
  240. #define gsp_maxheap()               \
  241.         cp_ret(GSP_MAXHEAP,0)
  242. #define get_offscreen_memory(a,b)   \
  243.         (void)cp_alt(GET_OFFSCREEN_MEMORY,2,_WORD(a),_ALTBYTE_PTR((a)*sizeof(OFFSCREEN_AREA),b))
  244. #define get_palet_entry(a,b,c,d,e)  \
  245.         hook_get_pal_e(GET_PALET_ENTRY,5,_DWORD(a),_ALTBYTE_PTR(1,b), \
  246.                         _ALTBYTE_PTR(1,c), _ALTBYTE_PTR(1,d),_ALTBYTE_PTR(1,e))
  247. #define get_palet(a,b)              \
  248.         hook_get_pal(GET_PALET,2,_WORD(a),_ALTBYTE_PTR((a)*4,(b)))
  249. #define get_pmask()                 \
  250.         cp_ret(GET_PMASK,0)
  251. #define get_ppop()                  \
  252.         (unsigned short)cp_ret(GET_PPOP,0)
  253. #define get_transp()                 \
  254.         (short)cp_ret(GET_TRANSP,0)
  255. #define get_windowing()             \
  256.         (short)cp_ret(GET_WINDOWING,0)
  257. #define gsp_calloc(a,b)             \
  258.         cp_ret(GSP_CALLOC,2,_DWORD(a),_DWORD(b))
  259. #define gsp_free(a)                 \
  260.         (short)cp_ret(GSP_FREE,1,_DWORD(a))
  261. #define gsp_malloc(a)               \
  262.         cp_ret(GSP_MALLOC,1,_DWORD(a))
  263. #define gsp_minit(a)                \
  264.         cp_cmd(GSP_MINIT,1,_DWORD(a))
  265. #define gsp_realloc(a,b)            \
  266.         cp_ret(GSP_REALLOC,2,_DWORD(a),_DWORD(b))
  267. #define init_cursor()               \
  268.         cp_ret(INIT_CURSOR,0)
  269. #define page_flip(a,b)              \
  270.         cp_cmd(PAGE_FLIP,2,_WORD(a),_WORD(b))
  271. #define set_palet(a,b,c)            \
  272.         hook_set_pal(SET_PALET,3,_DWORD(a),_DWORD(b),_BYTE_PTR(4*(a),c))
  273. #define transp_off()                \
  274.         cp_cmd(TRANSP_OFF,0)
  275. #define transp_on()                 \
  276.         cp_cmd(TRANSP_ON,0)
  277. #define add_module(a,b)             \
  278.         cp_ret(ADD_MODULE,2,_SWORD(a),_BYTE_PTR(sizeof(MODULE),b))
  279. #define get_state()                 \
  280.         cp_ret(GET_STATE,0)
  281. #define del_module(a)               \
  282.         cp_ret(DEL_MODULE,1,_WORD(a))
  283. #define del_all_modules()           \
  284.         cp_cmd(DEL_ALL_MODULES,0)
  285. #define wait_scan(a)                \
  286.         (void)cp_ret(WAIT_SCAN,1,_WORD(a))
  287. #define get_isr_priorities(a,b)     \
  288.         (void)cp_alt(GET_ISR_PRIORITIES,2,_WORD(a),_ALTWORD_PTR(a,b))
  289. #define get_curs_state()            \
  290.         (short)cp_ret(GET_CURS_STATE,0)
  291. #define get_curs_xy(a,b)            \
  292.         (void)cp_alt(GET_CURS_XY,2,_ALTWORD_PTR(1,a),_ALTWORD_PTR(1,b))
  293. #define flush_extended()            \
  294.         cp_cmd(FLUSH_EXTENDED,0)
  295. #define page_busy()                 \
  296.         (short)cp_ret(PAGE_BUSY,0)
  297. #define get_wksp(a,b)               \
  298.         (short)cp_alt(GET_WKSP,2,_ALTDWORD_PTR(1,a),_ALTDWORD_PTR(1,b))
  299. #define init_text()                 \
  300.         cp_cmd(INIT_TEXT,0)
  301. #define text_out(a,b,c)             \
  302.         (short)cp_ret(TEXT_OUT,3,_SWORD(a),_SWORD(b),_STRING(c))
  303. #define get_fontinfo(a,b)         \
  304.         (short)cp_alt(GET_FONTINFO,2,_SWORD(a),_ALTBYTE_PTR(sizeof(FONTINFO),b))
  305. #define get_module(a,b)             \
  306.         cp_alt(GET_MODULE,2,_WORD(a),_ALTBYTE_PTR(sizeof(MODULE),b))
  307. #define get_text_xy(a,b)            \
  308.         (void)cp_alt(GET_TEXT_XY,2,_ALTWORD_PTR(1,a),_ALTWORD_PTR(1,b))
  309. #define gsph_deref(a)                 \
  310.         cp_ret(HBM_DEREF,1,_WORD(a))
  311. #define gsph_memtype(a,b)          \
  312.         cp_cmd(HBM_SETMEMTYPE,2,_WORD(a),_WORD(b))
  313. #define gsph_alloc(a)                 \
  314.         (unsigned short)cp_ret(HBM_ALLOC,1,_DWORD(a))
  315. #define gsph_calloc(a,b)              \
  316.         (unsigned short)cp_ret(HBM_CALLOC,2,_DWORD(a),_DWORD(b))
  317. #define gsph_falloc(a,b,c)            \
  318.         (unsigned short)cp_ret(HBM_FALLOC,3,_DWORD(a),_DWORD(b),_WORD(c))
  319. #define gsph_fcalloc(a,b,c,d)         \
  320.         (unsigned short)cp_ret(HBM_FCALLOC,4,_DWORD(a),_DWORD(b),_DWORD(c),_WORD(d))
  321. #define gsph_free(a)                  \
  322.         cp_cmd(HBM_FREE,1,_WORD(a))
  323. #define gsph_maxheap()                \
  324.         cp_ret(HBM_MAXHEAP,0)
  325. #define gsph_compact(a)               \
  326.         cp_cmd(HBM_COMPACT,1,_WORD(a))
  327. #define gsph_realloc(a,b)             \
  328.         cp_ret(HBM_REALLOC,2,_WORD(a),_DWORD(b))
  329. #define gsph_findmem(a,b,c)               \
  330.         (short)cp_alt(HBM_FINDMEM,3,_DWORD(a),_ALTWORD_PTR(1,b),_ALTBYTE_PTR(1,c))
  331. #define gsph_init()                   \
  332.         cp_cmd(HBM_INIT,0)
  333. #define gsph_findhandle(a)            \
  334.         (unsigned short)cp_ret(HBM_FINDHANDLE,1,_DWORD(a))
  335. #define gsph_totalfree()              \
  336.         cp_ret(HBM_TOTALFREE,0)
  337. #define set_module_state(a,b)         \
  338.         (short)cp_ret(SET_MODULE_STATE,2,_WORD(a),_WORD(b))
  339. #define sym_init()                  \
  340.         cp_cmd(SYM_INIT, 0)
  341. #define sym_open(a)                 \
  342.         cp_ret(SYM_OPEN, 1, _SWORD(a))
  343. #define sym_close()                 \
  344.         cp_cmd(SYM_CLOSE, 0)
  345. #define sym_put(a,b)                \
  346.         cp_ret(SYM_PUT, 2, _STRING(a), _DWORD(b))
  347. #define sym_get(a)                  \
  348.         cp_ret(SYM_GET, 1, _STRING(a))
  349. #define sym_flush(a)                \
  350.         (short)cp_ret(SYM_FLUSH, 1, _SWORD(a))
  351. #define cop2gsp(a,b,c,d)    \
  352.         cp_cmd(COP2GSP,4,_WORD(a),_DWORD(b),_DWORD(c),_DWORD(d))
  353. #define gsp2cop(a,b,c,d)    \
  354.         cp_cmd(GSP2COP,4,_WORD(a),_DWORD(b),_DWORD(c),_DWORD(d))
  355. #define flush_module(a)     \
  356.         (short)cp_ret(FLUSH_MODULE,1,_WORD(a))
  357.  
  358. /*----------------------------------------------------------------------*/
  359. /*  Reference Core Direct-Mode function definitions                     */
  360. /*----------------------------------------------------------------------*/
  361. #define clear_screen(a)             \
  362.         dm_cmd(CLEAR_SCREEN,2,(long)(a))
  363. #define get_nearest_color(a,b,c,d)  \
  364.         hook_get_near(GET_NEAREST_COLOR,4,(short)(a),(short)(b),(short)(c),(short)(d))
  365. #define init_palet()                \
  366.         hook_init_pal(INIT_PALET,0)
  367. #define lmo(a)                      \
  368.         (short)dm_ret(LMO,2,(long)(a))
  369. #define peek_breg(a)                \
  370.         dm_ret(PEEK_BREG,1,(short)(a))
  371. #define poke_breg(a,b)              \
  372.         dm_cmd(POKE_BREG,3,(short)(a),(long)(b))
  373. #define rmo(a)                      \
  374.         (short)dm_ret(RMO,2,(long)(a))
  375. #define set_bcolor(a)               \
  376.         dm_cmd(SET_BCOLOR,2,(long)(a))
  377. #define set_colors(a,b)             \
  378.         dm_cmd(SET_COLORS,4,(long)(a),(long)(b))
  379. #define set_fcolor(a)               \
  380.         dm_cmd(SET_FCOLOR,2,(long)(a))
  381. #define set_palet_entry(a,b,c,d,e)  \
  382.         hook_set_pal_e(SET_PALET_ENTRY,6,(long)(a),(short)(b),(short)(c),\
  383.                              (short)(d),(short)(e))
  384. #define set_pmask(a)                \
  385.         dm_cmd(SET_PMASK,2,(long)(a))
  386. #define set_ppop(a)                 \
  387.         dm_cmd(SET_PPOP,1,(short)(a))
  388. #define set_windowing(a)            \
  389.         dm_cmd(SET_WINDOWING,1,(short)(a))
  390. #define set_clip_rect(a,b,c,d)      \
  391.         dm_cmd(SET_CLIP_RECT,4,(short)(a),(short)(b),(short)(c),(short)(d))
  392. #define set_wksp(a,b)               \
  393.         dm_cmd(SET_WKSP,4,(unsigned long)(a),(unsigned long)(b))
  394. #define gsp2gsp(a,b,c)              \
  395.         dm_cmd(GSP2GSP,6,(unsigned long)(a),(unsigned long)(b),(unsigned long)(c))
  396. #define set_curs_state(a)           \
  397.         dm_cmd(SET_CURS_STATE,1,(short)(a))
  398. #define clear_frame_buffer(a)       \
  399.         dm_cmd(CLEAR_FRAME_BUFFER,2,(long)(a))
  400. #define clear_page(a)               \
  401.         dm_cmd(CLEAR_PAGE,2,(long)(a))
  402. #define cpw(a,b)                    \
  403.         (short)dm_ret(CPW,2,(short)(a),(short)(b))
  404. #define cvxyl(a,b)                  \
  405.         dm_ret(CVXYL,2,(short)(a),(short)(b))
  406. #define set_cursattr(a,b,c,d)       \
  407.         dm_cmd(SET_CURSATTR,6,(unsigned long)(a),(unsigned long)(b),(unsigned short)(c),(unsigned short)(d))
  408. #define set_transp(a)               \
  409.         dm_cmd(SET_TRANSP,1,(short)(a))
  410. #define set_text_xy(a,b)            \
  411.         dm_cmd(SET_TEXT_XY,2,(short)(a),(short)(b))
  412. #define text_outp(a)                \
  413.         dm_pstr(TEXT_OUTP,(char far *)(a))
  414.  
  415. /*----------------------------------------------------------------------*/
  416. /*  Arguments for tiga_set()                                           */
  417. /*----------------------------------------------------------------------*/
  418. #define CD_CLOSE         0
  419. #define CD_OPEN          1
  420. #define CD_STATUS        2
  421. #define CD_NOT_INSTALLED -4
  422.  
  423. /*----------------------------------------------------------------------*/
  424. /*  Arguments for set_videomode()                                      */
  425. /*----------------------------------------------------------------------*/
  426. /* Legal video modes */
  427. #define TIGA            -1      
  428. #define PREVIOUS        0        /* restore screen to original mode */
  429. #define MDA             1
  430. #define HERCULES        2
  431. #define CGA             3
  432. #define EGA             4
  433. #define VGA             5
  434. #define AI_8514         6
  435. #define OFF_MODE        7           
  436. /* Legal styles */
  437. #define NO_INIT         0        /* generate entry to TSR only */
  438. #define INIT_GLOBALS    1        /* initialize global variables, retain heap */
  439. #define INIT            3        /* initialize globals and free all heap...  */
  440.                                  /* including downloaded functions           */
  441. #define INIT_GM         7        /* Re-initialize GM                         */
  442. #define NO_ENABLE       0x4000   /* Do not enable the 340 display.           */
  443. #define CLR_SCREEN      0x8000   /* clear the screen on entry to the mode    */
  444.  
  445. /*----------------------------------*/
  446. /* Colors of the default TIGA palet */
  447. /*----------------------------------*/
  448. #define  BLACK          0
  449. #define  BLUE           1
  450. #define  GREEN          2
  451. #define  CYAN           3
  452. #define  RED            4
  453. #define  MAGENTA        5
  454. #define  BROWN          6
  455. #define  LIGHT_GRAY     7
  456. #define  DARK_GRAY      8
  457. #define  LIGHT_BLUE     9
  458. #define  LIGHT_GREEN    10
  459. #define  LIGHT_CYAN     11
  460. #define  LIGHT_RED      12
  461. #define  LIGHT_MAGENTA  13
  462. #define  YELLOW         14
  463. #define  WHITE          15
  464.  
  465. /*----------------------------------*/
  466. /* Memory System Equates            */
  467. /*----------------------------------*/
  468. #define TRUE    1
  469. #define FALSE   0
  470. #define BLK_DELETABLE   0x01    /* Block can be deleted */
  471. #define BLK_LOCKED      0x02    /* Block is locked */
  472. #define BLK_FUNCMOVE    0x04    /* Call block function on move */
  473. #define BLK_FUNCDELETE  0x08    /* Call block function on purge */
  474. #define BLK_SECURED     0x10    /* Block is secured memory */
  475. #define BLK_INUSE       0x20    /* Block is allocated */
  476.  
  477. /*----------------------------------*/
  478. /* Extended primitives module id    */
  479. /* - parameter to sym_flush         */
  480. /*----------------------------------*/
  481. #define GRAPHICS_LIB_ID 0x3C00
  482.  
  483.