home *** CD-ROM | disk | FTP | other *** search
/ Amiga ACS 1998 #6 / amigaacscoverdisc1998-061998.iso / games / descent / source / main / vfx1.h < prev    next >
Text File  |  1998-06-08  |  10KB  |  314 lines

  1. /*
  2. THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
  3. SOFTWARE CORPORATION ("PARALLAX").  PARALLAX, IN DISTRIBUTING THE CODE TO
  4. END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
  5. ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
  6. IN USING, DISPLAYING,  AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
  7. SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
  8. FREE PURPOSES.  IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
  9. CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES.  THE END-USER UNDERSTANDS
  10. AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.  
  11. COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION.  ALL RIGHTS RESERVED.
  12. */
  13. /*
  14.  * $Source: f:/miner/source/main/rcs/vfx1.h $
  15.  * $Revision: 2.0 $
  16.  * $Author: john $
  17.  * $Date: 1995/02/27 11:28:52 $
  18.  * 
  19.  * .
  20.  * 
  21.  * $Log: vfx1.h $
  22.  * Revision 2.0  1995/02/27  11:28:52  john
  23.  * New version 2.0, which has no anonymous unions, builds with
  24.  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
  25.  * 
  26.  * Revision 1.3  1994/09/15  16:11:26  john
  27.  * Added support for VFX1 head tracking. Fixed bug with memory over-
  28.  * write when using stereo mode.
  29.  * 
  30.  * Revision 1.2  1994/06/24  17:03:54  john
  31.  * Added VFX support. Also took all game sequencing stuff like
  32.  * EndGame out and put it into gameseq.c
  33.  * 
  34.  * Revision 1.1  1994/06/23  17:59:56  john
  35.  * Initial revision
  36.  * 
  37.  * 
  38.  */
  39.  
  40.  
  41.  
  42. #ifndef _VFX1_H
  43. #define _VFX1_H
  44.  
  45. /*######################################################################
  46.             Type Declaration Section
  47. ########################################################################*/
  48.  
  49. /* VIP I/O Bus Register offsets */
  50. #define    VIP_AIR        0x0
  51. #define    VIP_CSR        0x1
  52. #define    VIP_DFIN    0x2
  53. #define    VIP_DFOUT    0x4
  54.  
  55. /* VIP Internal registers */
  56. #define    VIP_SCR         0
  57. #define    VIP_SSR         1
  58. #define    VIP_ICR         2
  59. #define    VIP_ISR         3
  60. #define    VIP_PSR         4
  61. #define    VIP_VRR         5
  62. #define    VIP_PCR         6
  63. #define    VIP_PPMR     7
  64. #define    VIP_PRAR     8
  65. #define    VIP_PWAR     9
  66. #define    VIP_PCRR    10
  67.  
  68. // T.S.R. related type defs.
  69. #define SENSE_VECTOR        0x33
  70.  
  71. #define RESET_DEVICE        0x00
  72. #define GET_DATA_SIZES      0x01
  73. #define SET_DATA_SIZE       0x02
  74. #define GET_CONFIGURATION   0x03
  75. #define SET_CONFIGURATION   0x04
  76. #define REPORT              0x05
  77. #define CONTINUE            0x06
  78. #define RESET_ZERO          0x07
  79. #define SET_ZERO            0x08
  80. #define TEST_DEVICES        0x09
  81. #define GET_DEVICE_DATA     0x70;
  82. #define SET_DEVICE_DATA     0x71;
  83. #define SENSE_DRIVER_STATUS 0x7F
  84. #define SET_VIDEO_PAGE      0x80
  85.  
  86. #define MIN_SENSE_FUNCTION  0x60
  87. #define MAX_SENSE_FUNCTION  0x70
  88.  
  89. #define DCHMS   2
  90. #define DCHTD   3
  91. #define DCHPD   4
  92. #define DCALL   0xFF
  93.  
  94. #define PRDM    "Forte Technologies, Inc.\0"
  95. #define PRDN    "VFX1 CyberPuck\0"
  96.  
  97. //Address index values for registers.
  98. enum air_enum { SCR, SSR, ICR, ISR, PSR, VRR, PCR, PPRR, PRAR, PWAR, PCRA,
  99.         NOREG };
  100. typedef enum air_enum  AIRVAL;
  101.  
  102. //Software Command Register codes.
  103. #define CPND  128      //Determines command pending bit mask.
  104. #define CCHK   64      //Determines command check bit mask.
  105. enum cmdcode_enum { NOP, CSTRT, CCONT, RSTRT, RTERM, GSTAT, RSTAT, NOCMD };
  106. typedef enum cmdcode_enum  CMDCODE;
  107.  
  108. //Software Status Register codes.
  109. enum statcode_enum { SDOK, SDCNC, SDCFL, SDDNR, SDDNE, SDDFL, SDNOR, SDCNV,
  110.         SDSERR };
  111. typedef enum statcode_enum  STATCODE;
  112.  
  113. //Data fifo selection values (IN = data into the VIP, OUT = data out from VIP)
  114. enum fifodir_enum {IN, OUT, NODIR};
  115. typedef enum fifodir_enum  FIFODIR;
  116.  
  117. //Packet type values.
  118. enum packtyp_enum {NULLP, SYSI, VNDI, SYSC, HMS, SVM, HTD, HPD};
  119. typedef enum packtyp_enum  PACKTYP;
  120.  
  121. //Null packet type.
  122. struct cfpack0_struct
  123. {
  124. unsigned char     psiz;
  125. unsigned char     ptyp;
  126. };
  127. typedef struct cfpack0_struct NULL_CPKT;
  128.  
  129. //System info configuration packet type.
  130. struct cfpack1_struct
  131. {
  132. unsigned char     psiz;
  133. unsigned char     ptyp;
  134. unsigned char     dcls;
  135. unsigned char     dnum;
  136. unsigned char     sstat;
  137. unsigned char     vmin;
  138. unsigned char     vmaj;
  139. char         vipid[4];
  140. unsigned short     dfsz;
  141. unsigned short     dummy;
  142. };
  143. typedef struct cfpack1_struct SYSTEM_CPKT;
  144.  
  145. // Vendor sizes
  146. #define MN_SIZE     32
  147. #define SNRL_SIZE   16
  148. //Vendor info configuration packet type.
  149. struct cfpack2_struct
  150. {
  151. unsigned char     psiz;
  152. unsigned char     ptyp;
  153. unsigned char     prdm[ MN_SIZE ];
  154. unsigned char     prdn[ MN_SIZE ];
  155. unsigned char     prdsn[ SNRL_SIZE ];
  156. unsigned char     prdrl[ SNRL_SIZE ];
  157. };
  158. typedef struct cfpack2_struct VENDOR_CPKT;
  159.  
  160. //Head Mounted System Capabilities structure.
  161. struct hmsc_struct
  162. {
  163. unsigned char aoc : 1;    //Audio out capable if set.
  164. unsigned char aic : 1;    //Audio in capable if set.
  165. unsigned char sac : 1;    //Stereo audio capable if set.
  166. unsigned char cic : 1;    //Color image capable if set.
  167. unsigned char sic : 1;    //Stereo image capable if set.
  168. unsigned char hti : 1;    //Head Tracker installed.
  169. unsigned char dum : 2;    //Not used.
  170. };
  171. typedef struct hmsc_struct HMSC;
  172.  
  173. //Head Mounted System flags structure.
  174. struct hmsf_struct
  175. {
  176. unsigned char dps : 1;    //Disable palette snooping.
  177. unsigned char aic : 1;    //Delayed flip.
  178. unsigned char dum : 5;    //Not used
  179. unsigned char ddsbl: 1;    //Disable device.
  180. };
  181. typedef struct hmsf_struct HMSF;
  182.  
  183. //Head Mounted System configuration packet type.
  184. #define VMODSIZE  10
  185. struct cfpack3_struct
  186. {
  187. unsigned char     psiz; //Number of bytes in packet.
  188. unsigned char     ptyp; //Packet type. 
  189. unsigned char     dcls; // Device class
  190. unsigned char     dnum; // Device number
  191. HMSF             hmsf; //Head mounted system flags.
  192. unsigned char    hmss; //Head mounted system status.
  193. unsigned char     vmin; //Minor version for device.
  194. unsigned char     vmaj; //Major version for device.
  195. HMSC             hmsc; //Head mounted system capabilities.
  196. unsigned char     dtyp; //Display type.
  197. unsigned short     vmag; //Visual magnification in units of 0.001.
  198. unsigned short     hfov; //Horizontal full FOV in units of 0.25 deg.
  199. unsigned short     vfov; //Vertical full FOV in units of 0.25 deg.
  200. unsigned char     ipd;  //Interpupillary distance in units of 0.5 mm.
  201. signed char         hoao; //Horizontal optical axis offset in units of .1 mm.
  202. signed char         voao; //Vertical optical axis offset in units of .1 mm.
  203. signed char         oar;  //Optical axis rotation in units of 0.25 deg.
  204. unsigned char     mrr;  //Max refresh rate in Hz.
  205. unsigned char     cvm;  //Current video mode.
  206. unsigned char     reserved;      
  207. unsigned char     vmsp; //Number of Vesa modes supported.
  208. unsigned short     vmod[VMODSIZE]; //Supported VESA modes.  Field currently
  209.                //allows up to 10 supported modes.  Packet in fifo
  210.                //may have any number of supported modes present.
  211. };
  212. typedef struct cfpack3_struct HMS_CPKT;
  213.  
  214. //Rotational Coordinate Flags structure.
  215. struct rtcf_struct
  216. {
  217. unsigned char rtc  : 1;  //Return to center device (1=yes).
  218. unsigned char wrp  : 1;  //Coordiante values wrap (1=yes).
  219. unsigned char zpsr : 1;  //Zero position resetable (1=yes).
  220. unsigned char rdg  : 1;  //Rotational data generated (1=yes).
  221. unsigned char dum  : 3;  //Not used.
  222. unsigned char den  : 1;  //Data reporting enabled (1=yes).
  223. };
  224. typedef struct rtcf_struct RTCF;
  225.  
  226. //Rotation Coordinate Descriptor structure.
  227. struct rtcd_struct
  228. {
  229. signed short    maxv;
  230. signed short    minv;
  231. unsigned short    steps;
  232. RTCF        rcf;
  233. unsigned char    dum;
  234. };
  235. typedef struct rtcd_struct RTCD;
  236.  
  237. //Head tracker flags structure.
  238. struct htf_struct
  239. {
  240. unsigned char dum  : 7;  //Not used.
  241. unsigned char ddsbl: 1;  //Data reporting enabled (1=yes).
  242. };
  243. typedef struct htf_struct HTF;
  244.  
  245. //Head Tracker Device configuration packet.
  246. struct cfpack4_struct
  247. {
  248. unsigned char     psiz;
  249. unsigned char     ptyp;
  250. unsigned char     dcls;
  251. unsigned char     dnum;
  252. HTF              htf; //Head tracker flag (disable device if set).
  253. unsigned char    hts; //Head tracker status.
  254. unsigned char     vmin; //Minor version for tracker.
  255. unsigned char     vmaj; //Major version for tracker.
  256. RTCD         ywcd;
  257. RTCD         ptcd;
  258. RTCD         rlcd;
  259. };
  260. typedef struct cfpack4_struct HTD_CPKT;
  261.  
  262. //Button Descriptor structure.
  263. struct btds_struct
  264. {
  265. unsigned char nbtn;     //Number of buttons/switches on device.
  266. unsigned char cnck : 1;  //Counts clicks (1=yes).
  267. unsigned char dum  : 6;  //Not used.
  268. unsigned char den  : 1;  //Data reporting enabled (1=yes).
  269. };
  270. typedef struct btds_struct BTDS;
  271.  
  272. //Hand held device Flags structure.
  273. struct hhpf_struct
  274. {
  275. unsigned char hhpp : 2;  //Hand held pointer prority (0=highest).
  276. unsigned char dum  : 4;  //Not used.
  277. unsigned char ddsbl: 1;  //Data reporting enabled (1=yes).
  278. };
  279. typedef struct hhpf_struct HHPF;
  280.  
  281. //Hand-held Pointing Device configuration packet.
  282. struct cfpack5_struct
  283. {
  284. unsigned char     psiz;
  285. unsigned char     ptyp;
  286. unsigned char     dcls;
  287. unsigned char     dnum;
  288. HHPF             hhpf; //Hand held flag (disable device if set).
  289. unsigned char    hhps; //Head tracker status.
  290. unsigned char     vmin; //Minor version for tracker.
  291. unsigned char     vmaj; //Major version for tracker.
  292. RTCD         ywcd;
  293. RTCD         ptcd;
  294. RTCD         rlcd;
  295. BTDS         btcd;
  296. };
  297. typedef struct cfpack5_struct HPD_CPKT;
  298.  
  299. struct cfpack6_struct
  300. {
  301. unsigned char     psiz; //Number of bytes in packet.
  302. unsigned char     ptyp; //Packet type. 
  303. unsigned char     dcls; // Device class
  304. unsigned char     dnum; // Device number
  305. HMSF             hmsf; //Head mounted system flags.
  306. unsigned char    vmod; //Head mounted video mode.
  307. };
  308. typedef struct cfpack6_struct SVM_CPKT;
  309.  
  310.  
  311.  
  312. #endif
  313. 
  314.