VFX1.H 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314
  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. #ifndef _VFX1_H
  40. #define _VFX1_H
  41. /*######################################################################
  42. Type Declaration Section
  43. ########################################################################*/
  44. /* VIP I/O Bus Register offsets */
  45. #define VIP_AIR 0x0
  46. #define VIP_CSR 0x1
  47. #define VIP_DFIN 0x2
  48. #define VIP_DFOUT 0x4
  49. /* VIP Internal registers */
  50. #define VIP_SCR 0
  51. #define VIP_SSR 1
  52. #define VIP_ICR 2
  53. #define VIP_ISR 3
  54. #define VIP_PSR 4
  55. #define VIP_VRR 5
  56. #define VIP_PCR 6
  57. #define VIP_PPMR 7
  58. #define VIP_PRAR 8
  59. #define VIP_PWAR 9
  60. #define VIP_PCRR 10
  61. // T.S.R. related type defs.
  62. #define SENSE_VECTOR 0x33
  63. #define RESET_DEVICE 0x00
  64. #define GET_DATA_SIZES 0x01
  65. #define SET_DATA_SIZE 0x02
  66. #define GET_CONFIGURATION 0x03
  67. #define SET_CONFIGURATION 0x04
  68. #define REPORT 0x05
  69. #define CONTINUE 0x06
  70. #define RESET_ZERO 0x07
  71. #define SET_ZERO 0x08
  72. #define TEST_DEVICES 0x09
  73. #define GET_DEVICE_DATA 0x70;
  74. #define SET_DEVICE_DATA 0x71;
  75. #define SENSE_DRIVER_STATUS 0x7F
  76. #define SET_VIDEO_PAGE 0x80
  77. #define MIN_SENSE_FUNCTION 0x60
  78. #define MAX_SENSE_FUNCTION 0x70
  79. #define DCHMS 2
  80. #define DCHTD 3
  81. #define DCHPD 4
  82. #define DCALL 0xFF
  83. #define PRDM "Forte Technologies, Inc.\0"
  84. #define PRDN "VFX1 CyberPuck\0"
  85. //Address index values for registers.
  86. enum air_enum { SCR, SSR, ICR, ISR, PSR, VRR, PCR, PPRR, PRAR, PWAR, PCRA,
  87. NOREG };
  88. typedef enum air_enum AIRVAL;
  89. //Software Command Register codes.
  90. #define CPND 128 //Determines command pending bit mask.
  91. #define CCHK 64 //Determines command check bit mask.
  92. enum cmdcode_enum { NOP, CSTRT, CCONT, RSTRT, RTERM, GSTAT, RSTAT, NOCMD };
  93. typedef enum cmdcode_enum CMDCODE;
  94. //Software Status Register codes.
  95. enum statcode_enum { SDOK, SDCNC, SDCFL, SDDNR, SDDNE, SDDFL, SDNOR, SDCNV,
  96. SDSERR };
  97. typedef enum statcode_enum STATCODE;
  98. //Data fifo selection values (IN = data into the VIP, OUT = data out from VIP)
  99. enum fifodir_enum {IN, OUT, NODIR};
  100. typedef enum fifodir_enum FIFODIR;
  101. //Packet type values.
  102. enum packtyp_enum {NULLP, SYSI, VNDI, SYSC, HMS, SVM, HTD, HPD};
  103. typedef enum packtyp_enum PACKTYP;
  104. //Null packet type.
  105. struct cfpack0_struct
  106. {
  107. unsigned char psiz;
  108. unsigned char ptyp;
  109. };
  110. typedef struct cfpack0_struct NULL_CPKT;
  111. //System info configuration packet type.
  112. struct cfpack1_struct
  113. {
  114. unsigned char psiz;
  115. unsigned char ptyp;
  116. unsigned char dcls;
  117. unsigned char dnum;
  118. unsigned char sstat;
  119. unsigned char vmin;
  120. unsigned char vmaj;
  121. char vipid[4];
  122. unsigned short dfsz;
  123. unsigned short dummy;
  124. };
  125. typedef struct cfpack1_struct SYSTEM_CPKT;
  126. // Vendor sizes
  127. #define MN_SIZE 32
  128. #define SNRL_SIZE 16
  129. //Vendor info configuration packet type.
  130. struct cfpack2_struct
  131. {
  132. unsigned char psiz;
  133. unsigned char ptyp;
  134. unsigned char prdm[ MN_SIZE ];
  135. unsigned char prdn[ MN_SIZE ];
  136. unsigned char prdsn[ SNRL_SIZE ];
  137. unsigned char prdrl[ SNRL_SIZE ];
  138. };
  139. typedef struct cfpack2_struct VENDOR_CPKT;
  140. //Head Mounted System Capabilities structure.
  141. struct hmsc_struct
  142. {
  143. unsigned char aoc : 1; //Audio out capable if set.
  144. unsigned char aic : 1; //Audio in capable if set.
  145. unsigned char sac : 1; //Stereo audio capable if set.
  146. unsigned char cic : 1; //Color image capable if set.
  147. unsigned char sic : 1; //Stereo image capable if set.
  148. unsigned char hti : 1; //Head Tracker installed.
  149. unsigned char dum : 2; //Not used.
  150. };
  151. typedef struct hmsc_struct HMSC;
  152. //Head Mounted System flags structure.
  153. struct hmsf_struct
  154. {
  155. unsigned char dps : 1; //Disable palette snooping.
  156. unsigned char aic : 1; //Delayed flip.
  157. unsigned char dum : 5; //Not used
  158. unsigned char ddsbl: 1; //Disable device.
  159. };
  160. typedef struct hmsf_struct HMSF;
  161. //Head Mounted System configuration packet type.
  162. #define VMODSIZE 10
  163. struct cfpack3_struct
  164. {
  165. unsigned char psiz; //Number of bytes in packet.
  166. unsigned char ptyp; //Packet type.
  167. unsigned char dcls; // Device class
  168. unsigned char dnum; // Device number
  169. HMSF hmsf; //Head mounted system flags.
  170. unsigned char hmss; //Head mounted system status.
  171. unsigned char vmin; //Minor version for device.
  172. unsigned char vmaj; //Major version for device.
  173. HMSC hmsc; //Head mounted system capabilities.
  174. unsigned char dtyp; //Display type.
  175. unsigned short vmag; //Visual magnification in units of 0.001.
  176. unsigned short hfov; //Horizontal full FOV in units of 0.25 deg.
  177. unsigned short vfov; //Vertical full FOV in units of 0.25 deg.
  178. unsigned char ipd; //Interpupillary distance in units of 0.5 mm.
  179. signed char hoao; //Horizontal optical axis offset in units of .1 mm.
  180. signed char voao; //Vertical optical axis offset in units of .1 mm.
  181. signed char oar; //Optical axis rotation in units of 0.25 deg.
  182. unsigned char mrr; //Max refresh rate in Hz.
  183. unsigned char cvm; //Current video mode.
  184. unsigned char reserved;
  185. unsigned char vmsp; //Number of Vesa modes supported.
  186. unsigned short vmod[VMODSIZE]; //Supported VESA modes. Field currently
  187. //allows up to 10 supported modes. Packet in fifo
  188. //may have any number of supported modes present.
  189. };
  190. typedef struct cfpack3_struct HMS_CPKT;
  191. //Rotational Coordinate Flags structure.
  192. struct rtcf_struct
  193. {
  194. unsigned char rtc : 1; //Return to center device (1=yes).
  195. unsigned char wrp : 1; //Coordiante values wrap (1=yes).
  196. unsigned char zpsr : 1; //Zero position resetable (1=yes).
  197. unsigned char rdg : 1; //Rotational data generated (1=yes).
  198. unsigned char dum : 3; //Not used.
  199. unsigned char den : 1; //Data reporting enabled (1=yes).
  200. };
  201. typedef struct rtcf_struct RTCF;
  202. //Rotation Coordinate Descriptor structure.
  203. struct rtcd_struct
  204. {
  205. signed short maxv;
  206. signed short minv;
  207. unsigned short steps;
  208. RTCF rcf;
  209. unsigned char dum;
  210. };
  211. typedef struct rtcd_struct RTCD;
  212. //Head tracker flags structure.
  213. struct htf_struct
  214. {
  215. unsigned char dum : 7; //Not used.
  216. unsigned char ddsbl: 1; //Data reporting enabled (1=yes).
  217. };
  218. typedef struct htf_struct HTF;
  219. //Head Tracker Device configuration packet.
  220. struct cfpack4_struct
  221. {
  222. unsigned char psiz;
  223. unsigned char ptyp;
  224. unsigned char dcls;
  225. unsigned char dnum;
  226. HTF htf; //Head tracker flag (disable device if set).
  227. unsigned char hts; //Head tracker status.
  228. unsigned char vmin; //Minor version for tracker.
  229. unsigned char vmaj; //Major version for tracker.
  230. RTCD ywcd;
  231. RTCD ptcd;
  232. RTCD rlcd;
  233. };
  234. typedef struct cfpack4_struct HTD_CPKT;
  235. //Button Descriptor structure.
  236. struct btds_struct
  237. {
  238. unsigned char nbtn; //Number of buttons/switches on device.
  239. unsigned char cnck : 1; //Counts clicks (1=yes).
  240. unsigned char dum : 6; //Not used.
  241. unsigned char den : 1; //Data reporting enabled (1=yes).
  242. };
  243. typedef struct btds_struct BTDS;
  244. //Hand held device Flags structure.
  245. struct hhpf_struct
  246. {
  247. unsigned char hhpp : 2; //Hand held pointer prority (0=highest).
  248. unsigned char dum : 4; //Not used.
  249. unsigned char ddsbl: 1; //Data reporting enabled (1=yes).
  250. };
  251. typedef struct hhpf_struct HHPF;
  252. //Hand-held Pointing Device configuration packet.
  253. struct cfpack5_struct
  254. {
  255. unsigned char psiz;
  256. unsigned char ptyp;
  257. unsigned char dcls;
  258. unsigned char dnum;
  259. HHPF hhpf; //Hand held flag (disable device if set).
  260. unsigned char hhps; //Head tracker status.
  261. unsigned char vmin; //Minor version for tracker.
  262. unsigned char vmaj; //Major version for tracker.
  263. RTCD ywcd;
  264. RTCD ptcd;
  265. RTCD rlcd;
  266. BTDS btcd;
  267. };
  268. typedef struct cfpack5_struct HPD_CPKT;
  269. struct cfpack6_struct
  270. {
  271. unsigned char psiz; //Number of bytes in packet.
  272. unsigned char ptyp; //Packet type.
  273. unsigned char dcls; // Device class
  274. unsigned char dnum; // Device number
  275. HMSF hmsf; //Head mounted system flags.
  276. unsigned char vmod; //Head mounted video mode.
  277. };
  278. typedef struct cfpack6_struct SVM_CPKT;
  279. #endif
  280.