home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / games / vmsnet / maxewr2 / part01 < prev    next >
Encoding:
Internet Message Format  |  1993-07-13  |  95.6 KB

  1. Path: uunet!elroy.jpl.nasa.gov!ames!koriel!lll-winken.llnl.gov!fnnews.fnal.gov!fnnews!SNYDER
  2. From: SNYDER@d0sb10.fnal.gov
  3. Newsgroups: vmsnet.sources.games
  4. Subject: Mazewar for VMS (1/5) (repost)
  5. Date: 14 Jul 1993 06:01:59 GMT
  6. Organization: SUNY Stony Brook High Energy Physics
  7. Lines: 2669
  8. Message-ID: <SNYDER.93Jul14000200@d0sb10.fnal.gov>
  9. NNTP-Posting-Host: d0sb10.fnal.gov
  10. Xref: uunet vmsnet.sources.games:751
  11.  
  12.  
  13. Mazewar on VMS
  14.  
  15. This is a port of the X11 mazewar game to VMS/Multinet.
  16. You can compile it with either gcc or VAX C.  Look at descrip.mms,
  17. uncomment the appropriate lines, and run MMS.  If you don't have
  18. MMS, it shouldn't be difficult to do by hand.  See the man pages
  19. for playing instructions.
  20.  
  21. Note that this kit does not include all of the original distribution; i've
  22. left out the sunview and X10 support files.
  23.  
  24. scott snyder
  25. snyder@fnald0.fnal.gov
  26.  
  27. $! ------------------ CUT HERE -----------------------
  28. $ v='f$verify(f$trnlnm("SHARE_UNPACK_VERIFY"))'
  29. $!
  30. $! This archive created by VMS_SHARE Version 8.2
  31. $!   On 10-JUL-1993 02:00:33.81   By user SNYDER
  32. $!
  33. $! The VMS_SHARE software that created this archive
  34. $!    was written by  Andy Harper, Kings College London UK
  35. $!    -- December 1992
  36. $!
  37. $! Credit is due to these people for their original ideas:
  38. $!    James Gray, Michael Bednarek 
  39. $!
  40. $!+ THIS PACKAGE DISTRIBUTED IN 5 PARTS, TO KEEP EACH PART
  41. $!  BELOW 200 BLOCKS
  42. $!
  43. $! TO UNPACK THIS SHARE FILE, CONCATENATE ALL PARTS IN ORDER
  44. $! AND EXECUTE AS A COMMAND PROCEDURE  (  @name  )
  45. $!
  46. $! THE FOLLOWING FILE(S) WILL BE CREATED AFTER UNPACKING:
  47. $!       1. [.MAZEWAR]DESCRIP.MMS;3
  48. $!       2. [.MAZEWAR]DISPLAY.C;1
  49. $!       3. [.MAZEWAR]INIT.C;11
  50. $!       4. [.MAZEWAR]MAZEFIND.6;1
  51. $!       5. [.MAZEWAR]MAZEFIND.C;5
  52. $!       6. [.MAZEWAR]MAZEFIND.DOC;1
  53. $!       7. [.MAZEWAR]MAZEWAR.2;1
  54. $!       8. [.MAZEWAR]MAZEWAR.3;1
  55. $!       9. [.MAZEWAR]MAZEWAR.4;1
  56. $!      10. [.MAZEWAR]MAZEWAR.5;1
  57. $!      11. [.MAZEWAR]MAZEWAR.6;1
  58. $!      12. [.MAZEWAR]MAZEWAR.C;17
  59. $!      13. [.MAZEWAR]MAZEWAR.DOC;1
  60. $!      14. [.MAZEWAR]MAZEWAR.H;1
  61. $!      15. [.MAZEWAR]MAZEWAR.OPT;3
  62. $!      16. [.MAZEWAR]README.;1
  63. $!      17. [.MAZEWAR]VMS-README.;1
  64. $!      18. [.MAZEWAR]WINX11.C;23
  65. $!      19. [.MAZEWAR.BITMAPS]CUP.CUR;1
  66. $!      20. [.MAZEWAR.BITMAPS]DEADRAT.ICON;1
  67. $!      21. [.MAZEWAR.BITMAPS]DRAT.CUR;1
  68. $!      22. [.MAZEWAR.BITMAPS]DRATMASK.CUR;1
  69. $!      23. [.MAZEWAR.BITMAPS]ICON.IC;1
  70. $!      24. [.MAZEWAR.BITMAPS]MAZE.ICON;1
  71. $!      25. [.MAZEWAR.BITMAPS]RAT.CUR;1
  72. $!      26. [.MAZEWAR.BITMAPS]RATMASK.CUR;1
  73. $!
  74. $set="set"
  75. $set symbol/scope=(nolocal,noglobal)
  76. $f=f$parse("SHARE_UNPACK_TEMP","SYS$SCRATCH:."+f$getjpi("","PID"))
  77. $e="write sys$error  ""%UNPACK"", "
  78. $w="write sys$output ""%UNPACK"", "
  79. $ if .not. f$trnlnm("SHARE_UNPACK_LOG") then $ w = "!"
  80. $ ve=f$getsyi("version")
  81. $ if ve-f$extract(0,1,ve) .ges. "4.4" then $ goto start
  82. $ e "-E-OLDVER, Must run at least VMS 4.4"
  83. $ v=f$verify(v)
  84. $ exit 44
  85. $unpack: subroutine ! P1=filename, P2=checksum, P3=attributes
  86. $ if f$parse(P1) .nes. "" then $ goto dirok
  87. $ dn=f$parse(P1,,,"DIRECTORY")
  88. $ w "-I-CREDIR, Creating directory ''dn'"
  89. $ create/dir 'dn'
  90. $ if $status then $ goto dirok
  91. $ e "-E-CREDIRFAIL, Unable to create ''dn' File skipped"
  92. $ delete 'f'*
  93. $ exit
  94. $dirok:
  95. $ x=f$search(P1)
  96. $ if x .eqs. "" then $ goto file_absent
  97. $ e "-W-EXISTS, File ''P1' exists. Skipped"
  98. $ delete 'f'*
  99. $ exit
  100. $file_absent:
  101. $ w "-I-UNPACK, Unpacking file ", P1
  102. $ n=P1
  103. $ if P3 .nes. "" then $ n=f
  104. $ if .not. f$verify() then $ define/user sys$output nl:
  105. $ EDIT/TPU/NOSEC/NODIS/COM=SYS$INPUT 'f'/OUT='n'
  106. PROCEDURE GetHex(s,p)LOCAL x1,x2;x1:=INDEX(t,SUBSTR(s,p,1))-1;x2:=INDEX(t,
  107. SUBSTR(s,p+1,1))-1;RETURN 16*x1+x2;ENDPROCEDURE;
  108. PROCEDURE SkipPartsep LOOP EXITIF MARK(NONE)=END_OF(b);EXITIF INDEX(ERASE_LINE,
  109. "-+-+-+-+-+-+-+-+")=1;ENDLOOP;ENDPROCEDURE;PROCEDURE ProcessLine LOCAL c,s,l,b,
  110. n,p;c := ERASE_CHARACTER(1);s := ERASE_LINE;IF c = "X" THEN SPLIT_LINE; ENDIF;
  111. MOVE_HORIZONTAL(-1);l := LENGTH(s);p := 1;LOOP EXITIF p > l;c := SUBSTR(s,p,1);
  112. p := p+1;CASE c FROM ' ' TO '`' ['`']: COPY_TEXT(ASCII(GetHex(s,p))); p:=p+2;[
  113. ' ']: p:=p+1;[INRANGE,OUTRANGE]: COPY_TEXT(c);ENDCASE;ENDLOOP;ENDPROCEDURE;
  114. PROCEDURE Decode POSITION(BEGINNING_OF(b));LOOP EXITIF MARK(NONE)=END_OF(b);
  115. IF INDEX(CURRENT_LINE,"+-+-+-+-+-+-+-+-")=1 THEN SkipPartSep;ELSE ProcessLine;
  116. MOVE_HORIZONTAL(1);ENDIF;ENDLOOP;ENDPROCEDURE;SET(FACILITY_NAME,"UNPACK");SET(
  117. SUCCESS,OFF);SET(INFORMATIONAL,OFF);t:="0123456789ABCDEF";f:=GET_INFO(
  118. COMMAND_LINE,"file_name");b:=CREATE_BUFFER(f,f);Decode;WRITE_FILE(b,GET_INFO(
  119. COMMAND_LINE,"output_file"));QUIT;
  120. $ if p3 .eqs. "" then $ goto dl
  121. $ open/write fdl &f
  122. $ write fdl "RECORD"
  123. $ write fdl P3
  124. $ close fdl
  125. $ w "-I-CONVRFM, Converting record format to ", P3
  126. $ convert/fdl=&f &f-1 &P1
  127. $dl: delete 'f'*
  128. $ checksum 'P1'
  129. $ if checksum$checksum .nes. P2 then $ -
  130.   e "-E-CHKSMFAIL, Checksum of ''P1' failed."
  131. $ exit
  132. $ endsubroutine
  133. $start:
  134. $!
  135. $ create 'f'
  136. XDEF`20=`20/define=("BROAD_ADDR=INADDR_BROADCAST","BSD_43")
  137. X
  138. X#`20uncomment`20the`20following`204`20lines`20to`20compile`20with`20gcc
  139. XCC`20=`20gcc
  140. XINC`20=`20/include=(multinet_root:`5Bmultinet.include.`5D)
  141. XCFLAGS`20=`20/debug/nocase_hack`20`20$(INC)`20$(DEF)`20$(CFLAGS)
  142. XLIBS`20=`20gnu_cc:`5B000000`5Dgcclib/l,
  143. X
  144. X#`20uncomment`20the`20following`206`20lines`20to`20compile`20with`20VAX`20C.
  145. X#INC`20=`20/include=(multinet_root:`5Bmultinet.include`5D)
  146. X#CFLAGS`20=`20$(INC)`20$(DEF)`20$(CFLAGS)
  147. X#.FIRST
  148. X#`09define`20sys`20multinet_root:`5Bmultinet.include.sys`5D
  149. X#`09define`20netinet`20multinet_root:`5Bmultinet.include.netinet`5D
  150. X#`09define`20vms`20multinet_root:`5Bmultinet.include.vms`5D
  151. X
  152. Xall`20:`20mazewar.exe`20mazefind.exe
  153. X`09!
  154. X
  155. XOBJS`20=`20display.obj`20init.obj`20mazewar.obj`20winx11.obj
  156. X
  157. Xmazewar.exe`20:`20$(OBJS)
  158. X`09link/exe=$*`20$+,`20$(LIBS)`20sys$disk:`5B`5Dmazewar.opt/opt
  159. X
  160. Xmazefind.exe`20:`20mazefind.obj
  161. X`09link/exe=$*`20$+,`20$(LIBS)`20sys$disk:`5B`5Dmazewar.opt/opt
  162. $ call unpack [.MAZEWAR]DESCRIP.MMS;3 -
  163.  358439636 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN"
  164. $!
  165. $ create 'f'
  166. X/*`20$Header:`20display.c,v`201.7`2088/08/25`2009:57:54`20kent`20Exp`20$`20*/
  167. X
  168. X/*`20
  169. X`20*`20display.c`20-`20Display`20management`20routines`20for`20MazeWar
  170. X`20*`20
  171. X`20*`20Author:`09Christopher`20A.`20Kent
  172. X`20*`20`09`09Western`20Research`20Laboratory
  173. X`20*`09`09Digital`20Equipment`20Corporation
  174. X`20*`20Date:`09Wed`20Oct`20`201`201986
  175. X`20*/
  176. X
  177. X/***********************************************************
  178. XCopyright`201986`20by`20Digital`20Equipment`20Corporation,`20Maynard,`20Massac
  179. Vhusetts,
  180. X
  181. X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20All
  182. V`20Rights`20Reserved
  183. X
  184. XPermission`20to`20use,`20copy,`20modify,`20and`20distribute`20this`20software
  185. V`20and`20its`20
  186. Xdocumentation`20for`20any`20purpose`20and`20without`20fee`20is`20hereby`20gran
  187. Vted,`20
  188. Xprovided`20that`20the`20above`20copyright`20notice`20appear`20in`20all`20copie
  189. Vs`20and`20that
  190. Xboth`20that`20copyright`20notice`20and`20this`20permission`20notice`20appear
  191. V`20in`20
  192. Xsupporting`20documentation,`20and`20that`20the`20names`20of`20Digital`20not
  193. V`20be
  194. Xused`20in`20advertising`20or`20publicity`20pertaining`20to`20disstribution`20o
  195. Vf`20the
  196. Xsoftware`20without`20specific,`20written`20prior`20permission.`20`20
  197. X
  198. XDIGITAL`20DISCLAIMS`20ALL`20WARRANTIES`20WITH`20REGARD`20TO`20THIS`20SOFTWARE,
  199. V`20INCLUDING
  200. XALL`20IMPLIED`20WARRANTIES`20OF`20MERCHANTABILITY`20AND`20FITNESS,`20IN`20NO
  201. V`20EVENT`20SHALL
  202. XDIGITAL`20BE`20LIABLE`20FOR`20ANY`20SPECIAL,`20INDIRECT`20OR`20CONSEQUENTIAL
  203. V`20DAMAGES`20OR
  204. XANY`20DAMAGES`20WHATSOEVER`20RESULTING`20FROM`20LOSS`20OF`20USE,`20DATA`20OR
  205. V`20PROFITS,
  206. XWHETHER`20IN`20AN`20ACTION`20OF`20CONTRACT,`20NEGLIGENCE`20OR`20OTHER`20TORTIO
  207. VUS`20ACTION,
  208. XARISING`20OUT`20OF`20OR`20IN`20CONNECTION`20WITH`20THE`20USE`20OR`20PERFORMANC
  209. VE`20OF`20THIS
  210. XSOFTWARE.
  211. X
  212. X******************************************************************/
  213. X
  214. X/*
  215. X`20*`20$Log:`09display.c,v`20$
  216. X`20*`20Revision`201.7`20`2088/08/25`20`2009:57:54`20`20kent
  217. X`20*`20More`20bitmap`20portability`20hacks.
  218. X`20*`20
  219. X`20*`20Revision`201.6`20`2087/03/31`20`2014:41:43`20`20kent
  220. X`20*`20Portability`20considerations,`20especially`20byteswapping`20to/from`20t
  221. Vhe`20net.
  222. X`20*`20
  223. X`20*`20Revision`201.5`20`2086/12/04`20`2017:43:39`20`20kent
  224. X`20*`20A`20little`20efficiency`20in`20DisplayOthersPosition().
  225. X`20*`20
  226. X`20*`20Revision`201.3`20`2086/12/03`20`2013:29:52`20`20kent
  227. X`20*`20Lint`20pass.`20
  228. X`20*`20
  229. X`20*`20Revision`201.2`20`2086/12/01`20`2023:45:36`20`20kent
  230. X`20*`20Housecleaning`20and`20documentation`20pass.
  231. X`20*`20
  232. X`20*`20
  233. X`20*`20Revision`201.1`20`2086/11/26`20`2016:56:12`20`20kent
  234. X`20*`20Initial`20revision
  235. X`20*`20
  236. X`20*/
  237. X
  238. X#ifndef`09lint
  239. Xstatic`20char`20rcs_ident`5B`5D`20=`20"$Header:`20display.c,v`201.7`2088/08/25
  240. V`2009:57:54`20kent`20Exp`20$";
  241. X#endif
  242. X
  243. X#include`20<sys/types.h>
  244. X#include`20<sys/socket.h>
  245. X#include`20<sys/time.h>
  246. X
  247. X#include`20<netinet/in.h>
  248. X
  249. X#include`20<stdio.h>
  250. X
  251. X#include`20"mazewar.h"
  252. X
  253. X/*`20
  254. X`20*`20Manage`20the`20display.`20This`20routine`20handles`20the`20three`20area
  255. Vs`20of`20the
  256. X`20*`20screen:`20the`20perspective`20view,`20the`20maze`20overview,`20and`20th
  257. Ve`20scores.
  258. X`20*`20
  259. X`20*`20The`20coordinate`20system`20of`20the`20display`20is`20a`20x-reflected
  260. V`201st`20quadrant:
  261. X`20*`20(0,0)`20upper`20left,`20x`20increases`20to`20the`20right,`20y`20increas
  262. Ves`20down.`20Just
  263. X`20*`20like`20most`20CRT`20coordinate`20systems.`20North`20is`20to`20the`20rig
  264. Vht,`20for`20no
  265. X`20*`20particular`20reason.`20Cells`20in`20the`20maze`20are`2016x16.
  266. X`20*/
  267. X
  268. Xtypedef`09struct`20`7B
  269. X`09Boolean`09`09playing;
  270. X`09int`09`09x,`20y;
  271. X`09Direction`09dir;
  272. X`7D`20RatState;
  273. X
  274. Xstatic`20RatState`09clearArray`5BMAXRATS`5D;
  275. X
  276. Xstatic
  277. XBitCell`09normalArrows`5BNDIRECTION`5D`20=`20`7B
  278. X`20`20`20`20`20`20`7B`090,`090200,`090300,`090340,`09/*`20right`20*/
  279. X`090360,`090370,`090177774,01777776,
  280. X`090177777,0177776,0177774,0370,
  281. X`090360,`090340,`090300,`090200`09`7D,
  282. X`20`20`20`20`20`20`7B`090400,`0901400,`0903400,`0907400,`09/*`20left`20*/
  283. X`09017400,`09037777,`09077777,`090177777,
  284. X`09077777,`09037777,`09017400,`0907400,
  285. X`0903400,`0901400,`090400,`090`09`7D,
  286. X`20`20`20`20`20`20`7B`0901740,`0901740,`0901740,`0901740,`09/*`20down`20*/
  287. X`0901740,`0901740,`0901740,`0901740,
  288. X`09077777,`09037776,`09017774,`0907770,
  289. X`0903760,`0901740,`090700,`090200`09`7D,
  290. X`20`20`20`20`20`20`7B`200200,`090700,`0901740,`0903760,`09/*`20up`20*/
  291. X`0907770,`09017774,`09037776,`09077777,
  292. X`0901740,`0901740,`0901740,`0901740,
  293. X`0901740,`0901740,`0901740,`0901740`09`7D
  294. X`7D;
  295. X
  296. Xstatic
  297. XBitCell`09invincibleArrows`5BNDIRECTION`5D`20=`20`7B
  298. X`20`20`20`20`20`20`7B`090,`090600,`090300,`090340,`09/*`20right`20*/
  299. X`090160,`090210,`090177464,0177102,
  300. X`090177043,0177022,0177544,0210,
  301. X`090160,`090340,`090300,`090600`09`7D,
  302. X`20`20`20`20`20`20`7B`090700,`0901400,`0903400,`0907000,`09/*`20left`20*/
  303. X`09010400,`09023377,`09044177,`090142177,
  304. X`09041177,`09026377,`09010400,`0907000,
  305. X`0903400,`0901400,`090700,`090`09`7D,
  306. X`20`20`20`20`20`20`7B`0901740,`0901740,`0901740,`0901740,`09/*`20down`20*/
  307. X`0901740,`0901740,`0901740,`09041041,
  308. X`09072327,`09034416,`09012414,`0904110,
  309. X`0902620,`0901040,`090700,`090200`09`7D,
  310. X`20`20`20`20`20`20`7B`090200,`090700,`0901040,`0902320,`09/*`20up`20*/
  311. X`0904410,`09014214,`09034116,`09072627,
  312. X`09041041,`0901740,`0901740,`0901740,
  313. X`0901740,`0901740,`0901740,`0901740`09`7D
  314. X`7D;
  315. X
  316. Xstatic
  317. XBitCell`09otherArrows`5BNDIRECTION`5D`20=`20`7B
  318. X`20`20`20`20`20`20`7B`090,`090200,`090300,`090340,`09/*`20right`20*/
  319. X`090177660,0100030,0100014,0100006,
  320. X`090100003,0100006,0100014,0100030,
  321. X`090177660,0340,`090300,`090200`09`7D,
  322. X`20`20`20`20`20`20`7B`090,`090400,`0901400,`0903400,`09/*`20left`20*/
  323. X`0906777,`09014001,`09030001,`09060001,
  324. X`090140001,060001,`09030001,`09014001,
  325. X`0906777,`0903400,`0901400,`090400`09`7D,
  326. X`20`20`20`20`20`20`7B`0907770,`0904010,`0904010,`0904010,`09/*`20down`20*/
  327. X`0904010,`0904010,`0904010,`0904010,
  328. X`09074017,`09034016,`09014014,`0906030,
  329. X`0903060,`0901540,`090700,`090200`09`7D,
  330. X`20`20`20`20`20`20`7B`090200,`090700,`0901540,`0903060,`09/*`20up`20*/
  331. X`0906030,`09014014,`09030006,`09074017,`09/*`20074014`20in`20original`20*/
  332. X`0904010,`0904010,`0904010,`0904010,
  333. X`0904010,`0904010,`0904010,`0907770`09`7D
  334. X`7D;
  335. X
  336. Xstatic
  337. XBitCell`09numbers`5BMAXRATS`5D`20=`20`7B
  338. X`20`20`20`20`20`20`7B`090,`090,`090,`090,`09/*`200`20*/
  339. X`090,`090,`090300,`090440,
  340. X`090440,`090440,`090300,`090,
  341. X`090,`090,`090,`090`09`7D,
  342. X`20`20`20`20`20`20`7B`090,`090,`090,`090,`09/*`201`20*/
  343. X`090,`090,`090600,`090200,
  344. X`090200,`090200,`090700,`090,
  345. X`090,`090,`090,`090`09`7D,
  346. X`20`20`20`20`20`20`7B`090,`090,`090,`090,`09/*`202`20*/
  347. X`090,`090,`090600,`0901100,
  348. X`090200,`090400,`0901700,`090,
  349. X`090,`090,`090,`090`09`7D,
  350. X`20`20`20`20`20`20`7B`090,`090,`090,`090,`09/*`203`20*/
  351. X`090,`090,`0901600,`090100,
  352. X`090600,`090100,`0901600,`090,
  353. X`090,`090,`090,`090`09`7D,
  354. X`20`20`20`20`20`20`7B`090,`090,`090,`090,`09/*`204`20*/
  355. X`090,`090,`0901100,`0901100,
  356. X`0901740,`090100,`090100,`090,
  357. X`090,`090,`090,`090`09`7D,
  358. X`20`20`20`20`20`20`7B`090,`090,`090,`090,`09/*`205`20*/
  359. X`090,`090,`0901700,`0901000,
  360. X`0901700,`090100,`0901700,`090,
  361. X`090,`090,`090,`090`09`7D,
  362. X`20`20`20`20`20`20`7B`090,`090,`090,`090,`09/*`206`20*/
  363. X`090,`090,`0901700,`0901000,
  364. X`0901700,`0901100,`0901700,`090,
  365. X`090,`090,`090,`090`09`7D,
  366. X`20`20`20`20`20`20`7B`090,`090,`090,`090,`09/*`207`20*/
  367. X`090,`090,`0901700,`090100,
  368. X`090200,`090400,`0901000,`090,
  369. X`090,`090,`090,`090`09`7D
  370. X`7D;
  371. X
  372. Xstatic`20XYpair`09viewTable`5B`5D`20=`20`7B
  373. X`09`7B`7B`2067,`09333`20`7D,`09`7B`2067,`0967`20`7D`7D,`09`7B`7B`2067,`09333
  374. V`20`7D,`09`7B`20333,`09333`20`7D`7D,
  375. X`09`7B`7B`2067,`0967`20`7D,`09`7B`20333,`0967`20`7D`7D,`09`7B`7B`200,`09400
  376. V`20`7D,`09`7B`2067,`09333`20`7D`7D,
  377. X`09`7B`7B`200,`090`20`7D,`09`7B`2067,`0967`20`7D`7D,`09`7B`7B`200,`09333`20
  378. V`7D,`09`7B`2067,`09333`20`7D`7D,
  379. X`09`7B`7B`200,`0967`20`7D,`09`7B`2067,`0967`20`7D`7D,`09`7B`7B`20333,`09333
  380. V`20`7D,`09`7B`20333,`0967`20`7D`7D,
  381. X`09`7B`7B`20333,`09333`20`7D,`09`7B`20400,`09333`20`7D`7D,`09`7B`7B`20333,`096
  382. V7`20`7D,`09`7B`20400,`0967`20`7D`7D,
  383. X`09`7B`7B`20333,`09333`20`7D,`09`7B`20400,`09400`20`7D`7D,`09`7B`7B`20333,`096
  384. V7`20`7D,`09`7B`20400,`090`20`7D`7D,
  385. X`09`7B`7B`20120,`09280`20`7D,`09`7B`20120,`09120`20`7D`7D,`09`7B`7B`20120,`092
  386. V80`20`7D,`09`7B`20280,`09280`20`7D`7D,
  387. X`09`7B`7B`20120,`09120`20`7D,`09`7B`20280,`09120`20`7D`7D,`09`7B`7B`2067,`0933
  388. V3`20`7D,`09`7B`20120,`09280`20`7D`7D,
  389. X`09`7B`7B`2067,`0967`20`7D,`09`7B`20120,`09120`20`7D`7D,`09`7B`7B`2067,`09280
  390. V`20`7D,`09`7B`20120,`09280`20`7D`7D,
  391. X`09`7B`7B`2067,`09120`20`7D,`09`7B`20120,`09120`20`7D`7D,`09`7B`7B`20280,`0928
  392. V0`20`7D,`09`7B`20280,`09120`20`7D`7D,
  393. X`09`7B`7B`20280,`09280`20`7D,`09`7B`20333,`09280`20`7D`7D,`09`7B`7B`20280,`091
  394. V20`20`7D,`09`7B`20333,`09120`20`7D`7D,
  395. X`09`7B`7B`20280,`09280`20`7D,`09`7B`20333,`09333`20`7D`7D,`09`7B`7B`20280,`091
  396. V20`20`7D,`09`7B`20333,`0967`20`7D`7D,
  397. X`09`7B`7B`20143,`09257`20`7D,`09`7B`20143,`09143`20`7D`7D,`09`7B`7B`20143,`092
  398. V57`20`7D,`09`7B`20257,`09257`20`7D`7D,
  399. X`09`7B`7B`20143,`09143`20`7D,`09`7B`20257,`09143`20`7D`7D,`09`7B`7B`20120,`092
  400. V80`20`7D,`09`7B`20143,`09257`20`7D`7D,
  401. X`09`7B`7B`20120,`09120`20`7D,`09`7B`20143,`09143`20`7D`7D,`09`7B`7B`20120,`092
  402. V57`20`7D,`09`7B`20143,`09257`20`7D`7D,
  403. X`09`7B`7B`20120,`09143`20`7D,`09`7B`20143,`09143`20`7D`7D,`09`7B`7B`20257,`092
  404. V57`20`7D,`09`7B`20257,`09143`20`7D`7D,
  405. X`09`7B`7B`20257,`09257`20`7D,`09`7B`20280,`09257`20`7D`7D,`09`7B`7B`20257,`091
  406. V43`20`7D,`09`7B`20280,`09143`20`7D`7D,
  407. X`09`7B`7B`20257,`09257`20`7D,`09`7B`20280,`09280`20`7D`7D,`09`7B`7B`20257,`091
  408. V43`20`7D,`09`7B`20280,`09120`20`7D`7D,
  409. X`09`7B`7B`20156,`09244`20`7D,`09`7B`20156,`09156`20`7D`7D,`09`7B`7B`20156,`092
  410. V44`20`7D,`09`7B`20244,`09244`20`7D`7D,
  411. X`09`7B`7B`20156,`09156`20`7D,`09`7B`20244,`09156`20`7D`7D,`09`7B`7B`20143,`092
  412. V57`20`7D,`09`7B`20156,`09244`20`7D`7D,
  413. X`09`7B`7B`20143,`09143`20`7D,`09`7B`20156,`09156`20`7D`7D,`09`7B`7B`20143,`092
  414. V44`20`7D,`09`7B`20156,`09244`20`7D`7D,
  415. X`09`7B`7B`20143,`09156`20`7D,`09`7B`20156,`09156`20`7D`7D,`09`7B`7B`20244,`092
  416. V44`20`7D,`09`7B`20244,`09156`20`7D`7D,
  417. X`09`7B`7B`20244,`09244`20`7D,`09`7B`20257,`09244`20`7D`7D,`09`7B`7B`20244,`091
  418. V56`20`7D,`09`7B`20257,`09156`20`7D`7D,
  419. X`09`7B`7B`20244,`09244`20`7D,`09`7B`20257,`09257`20`7D`7D,`09`7B`7B`20244,`091
  420. V56`20`7D,`09`7B`20257,`09143`20`7D`7D,
  421. X`09`7B`7B`20164,`09236`20`7D,`09`7B`20164,`09164`20`7D`7D,`09`7B`7B`20164,`092
  422. V36`20`7D,`09`7B`20236,`09236`20`7D`7D,
  423. X`09`7B`7B`20164,`09164`20`7D,`09`7B`20236,`09164`20`7D`7D,`09`7B`7B`20156,`092
  424. V44`20`7D,`09`7B`20164,`09236`20`7D`7D,
  425. X`09`7B`7B`20156,`09156`20`7D,`09`7B`20164,`09164`20`7D`7D,`09`7B`7B`20156,`092
  426. V36`20`7D,`09`7B`20164,`09236`20`7D`7D,
  427. X`09`7B`7B`20156,`09164`20`7D,`09`7B`20164,`09164`20`7D`7D,`09`7B`7B`20236,`092
  428. V36`20`7D,`09`7B`20236,`09164`20`7D`7D,
  429. X`09`7B`7B`20236,`09236`20`7D,`09`7B`20244,`09236`20`7D`7D,`09`7B`7B`20236,`091
  430. V64`20`7D,`09`7B`20244,`09164`20`7D`7D,
  431. X`09`7B`7B`20236,`09236`20`7D,`09`7B`20244,`09244`20`7D`7D,`09`7B`7B`20236,`091
  432. V64`20`7D,`09`7B`20244,`09156`20`7D`7D,
  433. X`09`7B`7B`20170,`09230`20`7D,`09`7B`20170,`09170`20`7D`7D,`09`7B`7B`20170,`092
  434. V30`20`7D,`09`7B`20230,`09230`20`7D`7D,
  435. X`09`7B`7B`20170,`09170`20`7D,`09`7B`20230,`09170`20`7D`7D,`09`7B`7B`20164,`092
  436. V36`20`7D,`09`7B`20170,`09230`20`7D`7D,
  437. X`09`7B`7B`20164,`09164`20`7D,`09`7B`20170,`09170`20`7D`7D,`09`7B`7B`20164,`092
  438. V30`20`7D,`09`7B`20170,`09230`20`7D`7D,
  439. X`09`7B`7B`20164,`09170`20`7D,`09`7B`20170,`09170`20`7D`7D,`09`7B`7B`20230,`092
  440. V30`20`7D,`09`7B`20230,`09170`20`7D`7D,
  441. X`09`7B`7B`20230,`09230`20`7D,`09`7B`20236,`09230`20`7D`7D,`09`7B`7B`20230,`091
  442. V70`20`7D,`09`7B`20236,`09170`20`7D`7D,
  443. X`09`7B`7B`20230,`09230`20`7D,`09`7B`20236,`09236`20`7D`7D,`09`7B`7B`20230,`091
  444. V70`20`7D,`09`7B`20236,`09164`20`7D`7D,
  445. X`09`7B`7B`20174,`09226`20`7D,`09`7B`20174,`09174`20`7D`7D,`09`7B`7B`20174,`092
  446. V26`20`7D,`09`7B`20226,`09226`20`7D`7D,
  447. X`09`7B`7B`20174,`09174`20`7D,`09`7B`20226,`09174`20`7D`7D,`09`7B`7B`20170,`092
  448. V30`20`7D,`09`7B`20174,`09226`20`7D`7D,
  449. X`09`7B`7B`20170,`09170`20`7D,`09`7B`20174,`09174`20`7D`7D,`09`7B`7B`20170,`092
  450. V26`20`7D,`09`7B`20174,`09226`20`7D`7D,
  451. X`09`7B`7B`20170,`09174`20`7D,`09`7B`20174,`09174`20`7D`7D,`09`7B`7B`20226,`092
  452. V26`20`7D,`09`7B`20226,`09174`20`7D`7D,
  453. X`09`7B`7B`20226,`09226`20`7D,`09`7B`20230,`09226`20`7D`7D,`09`7B`7B`20226,`091
  454. V74`20`7D,`09`7B`20230,`09174`20`7D`7D,
  455. X`09`7B`7B`20226,`09226`20`7D,`09`7B`20230,`09230`20`7D`7D,`09`7B`7B`20226,`091
  456. V74`20`7D,`09`7B`20230,`09170`20`7D`7D,
  457. X`09`7B`7B`20177,`09223`20`7D,`09`7B`20177,`09177`20`7D`7D,`09`7B`7B`20177,`092
  458. V23`20`7D,`09`7B`20223,`09223`20`7D`7D,
  459. X`09`7B`7B`20177,`09177`20`7D,`09`7B`20223,`09177`20`7D`7D,`09`7B`7B`20174,`092
  460. V26`20`7D,`09`7B`20177,`09223`20`7D`7D,
  461. X`09`7B`7B`20174,`09174`20`7D,`09`7B`20177,`09177`20`7D`7D,`09`7B`7B`20174,`092
  462. V23`20`7D,`09`7B`20177,`09223`20`7D`7D,
  463. X`09`7B`7B`20174,`09177`20`7D,`09`7B`20177,`09177`20`7D`7D,`09`7B`7B`20223,`092
  464. V23`20`7D,`09`7B`20223,`09177`20`7D`7D,
  465. X`09`7B`7B`20223,`09223`20`7D,`09`7B`20226,`09223`20`7D`7D,`09`7B`7B`20223,`091
  466. V77`20`7D,`09`7B`20226,`09177`20`7D`7D,
  467. X`09`7B`7B`20223,`09223`20`7D,`09`7B`20226,`09226`20`7D`7D,`09`7B`7B`20223,`091
  468. V77`20`7D,`09`7B`20226,`09174`20`7D`7D,
  469. X`09`7B`7B`20179,`09221`20`7D,`09`7B`20179,`09179`20`7D`7D,`09`7B`7B`20179,`092
  470. V21`20`7D,`09`7B`20221,`09221`20`7D`7D,
  471. X`09`7B`7B`20179,`09179`20`7D,`09`7B`20221,`09179`20`7D`7D,`09`7B`7B`20177,`092
  472. V23`20`7D,`09`7B`20179,`09221`20`7D`7D,
  473. X`09`7B`7B`20177,`09177`20`7D,`09`7B`20179,`09179`20`7D`7D,`09`7B`7B`20177,`092
  474. V21`20`7D,`09`7B`20179,`09221`20`7D`7D,
  475. X`09`7B`7B`20177,`09179`20`7D,`09`7B`20179,`09179`20`7D`7D,`09`7B`7B`20221,`092
  476. V21`20`7D,`09`7B`20221,`09179`20`7D`7D,
  477. X`09`7B`7B`20221,`09221`20`7D,`09`7B`20223,`09221`20`7D`7D,`09`7B`7B`20221,`091
  478. V79`20`7D,`09`7B`20223,`09179`20`7D`7D,
  479. X`09`7B`7B`20221,`09221`20`7D,`09`7B`20223,`09223`20`7D`7D,`09`7B`7B`20221,`091
  480. V79`20`7D,`09`7B`20223,`09177`20`7D`7D,
  481. X`09`7B`7B`20181,`09219`20`7D,`09`7B`20181,`09181`20`7D`7D,`09`7B`7B`20181,`092
  482. V19`20`7D,`09`7B`20219,`09219`20`7D`7D,
  483. X`09`7B`7B`20181,`09181`20`7D,`09`7B`20219,`09181`20`7D`7D,`09`7B`7B`20179,`092
  484. V21`20`7D,`09`7B`20181,`09219`20`7D`7D,
  485. X`09`7B`7B`20179,`09179`20`7D,`09`7B`20181,`09181`20`7D`7D,`09`7B`7B`20179,`092
  486. V19`20`7D,`09`7B`20181,`09219`20`7D`7D,
  487. X`09`7B`7B`20179,`09181`20`7D,`09`7B`20181,`09181`20`7D`7D,`09`7B`7B`20219,`092
  488. V19`20`7D,`09`7B`20219,`09181`20`7D`7D,
  489. X`09`7B`7B`20219,`09219`20`7D,`09`7B`20221,`09219`20`7D`7D,`09`7B`7B`20219,`091
  490. V81`20`7D,`09`7B`20221,`09181`20`7D`7D,
  491. X`09`7B`7B`20219,`09219`20`7D,`09`7B`20221,`09221`20`7D`7D,`09`7B`7B`20219,`091
  492. V81`20`7D,`09`7B`20221,`09179`20`7D`7D,
  493. X`09`7B`7B`20183,`09217`20`7D,`09`7B`20183,`09183`20`7D`7D,`09`7B`7B`20183,`092
  494. V17`20`7D,`09`7B`20217,`09217`20`7D`7D,
  495. X`09`7B`7B`20183,`09183`20`7D,`09`7B`20217,`09183`20`7D`7D,`09`7B`7B`20181,`092
  496. V19`20`7D,`09`7B`20183,`09217`20`7D`7D,
  497. X`09`7B`7B`20181,`09181`20`7D,`09`7B`20183,`09183`20`7D`7D,`09`7B`7B`20181,`092
  498. V17`20`7D,`09`7B`20183,`09217`20`7D`7D,
  499. X`09`7B`7B`20181,`09183`20`7D,`09`7B`20183,`09183`20`7D`7D,`09`7B`7B`20217,`092
  500. V17`20`7D,`09`7B`20217,`09183`20`7D`7D,
  501. X`09`7B`7B`20217,`09217`20`7D,`09`7B`20219,`09217`20`7D`7D,`09`7B`7B`20217,`091
  502. V83`20`7D,`09`7B`20219,`09183`20`7D`7D,
  503. X`09`7B`7B`20217,`09217`20`7D,`09`7B`20219,`09219`20`7D`7D,`09`7B`7B`20217,`091
  504. V83`20`7D,`09`7B`20219,`09181`20`7D`7D,
  505. X`09`7B`7B`20184,`09216`20`7D,`09`7B`20184,`09184`20`7D`7D,`09`7B`7B`20184,`092
  506. V16`20`7D,`09`7B`20216,`09216`20`7D`7D,
  507. X`09`7B`7B`20184,`09184`20`7D,`09`7B`20216,`09184`20`7D`7D,`09`7B`7B`20183,`092
  508. V17`20`7D,`09`7B`20184,`09216`20`7D`7D,
  509. X`09`7B`7B`20183,`09183`20`7D,`09`7B`20184,`09184`20`7D`7D,`09`7B`7B`20183,`092
  510. V16`20`7D,`09`7B`20184,`09216`20`7D`7D,
  511. X`09`7B`7B`20183,`09184`20`7D,`09`7B`20184,`09184`20`7D`7D,`09`7B`7B`20216,`092
  512. V16`20`7D,`09`7B`20216,`09184`20`7D`7D,
  513. X`09`7B`7B`20216,`09216`20`7D,`09`7B`20217,`09216`20`7D`7D,`09`7B`7B`20216,`091
  514. V84`20`7D,`09`7B`20217,`09184`20`7D`7D,
  515. X`09`7B`7B`20216,`09216`20`7D,`09`7B`20217,`09217`20`7D`7D,`09`7B`7B`20216,`091
  516. V84`20`7D,`09`7B`20217,`09183`20`7D`7D,
  517. X`09`7B`7B`20186,`09214`20`7D,`09`7B`20186,`09186`20`7D`7D,`09`7B`7B`20186,`092
  518. V14`20`7D,`09`7B`20214,`09214`20`7D`7D,
  519. X`09`7B`7B`20186,`09186`20`7D,`09`7B`20214,`09186`20`7D`7D,`09`7B`7B`20184,`092
  520. V16`20`7D,`09`7B`20186,`09214`20`7D`7D,
  521. X`09`7B`7B`20184,`09184`20`7D,`09`7B`20186,`09186`20`7D`7D,`09`7B`7B`20184,`092
  522. V14`20`7D,`09`7B`20186,`09214`20`7D`7D,
  523. X`09`7B`7B`20184,`09186`20`7D,`09`7B`20186,`09186`20`7D`7D,`09`7B`7B`20214,`092
  524. V14`20`7D,`09`7B`20214,`09186`20`7D`7D,
  525. X`09`7B`7B`20214,`09214`20`7D,`09`7B`20216,`09214`20`7D`7D,`09`7B`7B`20214,`091
  526. V86`20`7D,`09`7B`20216,`09186`20`7D`7D,
  527. X`09`7B`7B`20214,`09214`20`7D,`09`7B`20216,`09216`20`7D`7D,`09`7B`7B`20214,`091
  528. V86`20`7D,`09`7B`20216,`09184`20`7D`7D,
  529. X`09`7B`7B`20187,`09213`20`7D,`09`7B`20187,`09187`20`7D`7D,`09`7B`7B`20187,`092
  530. V13`20`7D,`09`7B`20213,`09213`20`7D`7D,
  531. X`09`7B`7B`20187,`09187`20`7D,`09`7B`20213,`09187`20`7D`7D,`09`7B`7B`20186,`092
  532. V14`20`7D,`09`7B`20187,`09213`20`7D`7D,
  533. X`09`7B`7B`20186,`09186`20`7D,`09`7B`20187,`09187`20`7D`7D,`09`7B`7B`20186,`092
  534. V13`20`7D,`09`7B`20187,`09213`20`7D`7D,
  535. X`09`7B`7B`20186,`09187`20`7D,`09`7B`20187,`09187`20`7D`7D,`09`7B`7B`20213,`092
  536. V13`20`7D,`09`7B`20213,`09187`20`7D`7D,
  537. X`09`7B`7B`20213,`09213`20`7D,`09`7B`20214,`09213`20`7D`7D,`09`7B`7B`20213,`091
  538. V87`20`7D,`09`7B`20214,`09187`20`7D`7D,
  539. X`09`7B`7B`20213,`09213`20`7D,`09`7B`20214,`09214`20`7D`7D,`09`7B`7B`20213,`091
  540. V87`20`7D,`09`7B`20214,`09186`20`7D`7D,
  541. X`09`7B`7B`20188,`09212`20`7D,`09`7B`20188,`09188`20`7D`7D,`09`7B`7B`20188,`092
  542. V12`20`7D,`09`7B`20212,`09212`20`7D`7D,
  543. X`09`7B`7B`20188,`09188`20`7D,`09`7B`20212,`09188`20`7D`7D,`09`7B`7B`20187,`092
  544. V13`20`7D,`09`7B`20188,`09212`20`7D`7D,
  545. X`09`7B`7B`20187,`09187`20`7D,`09`7B`20188,`09188`20`7D`7D,`09`7B`7B`20187,`092
  546. V12`20`7D,`09`7B`20188,`09212`20`7D`7D,
  547. X`09`7B`7B`20187,`09188`20`7D,`09`7B`20188,`09188`20`7D`7D,`09`7B`7B`20212,`092
  548. V12`20`7D,`09`7B`20212,`09188`20`7D`7D,
  549. X`09`7B`7B`20212,`09212`20`7D,`09`7B`20213,`09212`20`7D`7D,`09`7B`7B`20212,`091
  550. V88`20`7D,`09`7B`20213,`09188`20`7D`7D,
  551. X`09`7B`7B`20212,`09212`20`7D,`09`7B`20213,`09213`20`7D`7D,`09`7B`7B`20212,`091
  552. V88`20`7D,`09`7B`20213,`09187`20`7D`7D,
  553. X`09`7B`7B`20188,`09212`20`7D,`09`7B`20188,`09188`20`7D`7D,`09`7B`7B`20188,`092
  554. V12`20`7D,`09`7B`20212,`09212`20`7D`7D,
  555. X`09`7B`7B`20188,`09188`20`7D,`09`7B`20212,`09188`20`7D`7D,`09`7B`7B`20188,`092
  556. V12`20`7D,`09`7B`20188,`09212`20`7D`7D,
  557. X`09`7B`7B`20188,`09188`20`7D,`09`7B`20188,`09188`20`7D`7D,`09`7B`7B`20188,`092
  558. V12`20`7D,`09`7B`20188,`09212`20`7D`7D,
  559. X`09`7B`7B`20188,`09188`20`7D,`09`7B`20188,`09188`20`7D`7D,`09`7B`7B`20212,`092
  560. V12`20`7D,`09`7B`20212,`09188`20`7D`7D,
  561. X`09`7B`7B`20212,`09212`20`7D,`09`7B`20212,`09212`20`7D`7D,`09`7B`7B`20212,`091
  562. V88`20`7D,`09`7B`20212,`09188`20`7D`7D,
  563. X`09`7B`7B`20212,`09212`20`7D,`09`7B`20212,`09212`20`7D`7D,`09`7B`7B`20212,`091
  564. V88`20`7D,`09`7B`20212,`09188`20`7D`7D,
  565. X`09`7B`7B`20189,`09211`20`7D,`09`7B`20189,`09189`20`7D`7D,`09`7B`7B`20189,`092
  566. V11`20`7D,`09`7B`20211,`09211`20`7D`7D,
  567. X`09`7B`7B`20189,`09189`20`7D,`09`7B`20211,`09189`20`7D`7D,`09`7B`7B`20188,`092
  568. V12`20`7D,`09`7B`20189,`09211`20`7D`7D,
  569. X`09`7B`7B`20188,`09188`20`7D,`09`7B`20189,`09189`20`7D`7D,`09`7B`7B`20188,`092
  570. V11`20`7D,`09`7B`20189,`09211`20`7D`7D,
  571. X`09`7B`7B`20188,`09189`20`7D,`09`7B`20189,`09189`20`7D`7D,`09`7B`7B`20211,`092
  572. V11`20`7D,`09`7B`20211,`09189`20`7D`7D,
  573. X`09`7B`7B`20211,`09211`20`7D,`09`7B`20212,`09211`20`7D`7D,`09`7B`7B`20211,`091
  574. V89`20`7D,`09`7B`20212,`09189`20`7D`7D,
  575. X`09`7B`7B`20211,`09211`20`7D,`09`7B`20212,`09212`20`7D`7D,`09`7B`7B`20211,`091
  576. V89`20`7D,`09`7B`20212,`09188`20`7D`7D,
  577. X`09`7B`7B`20190,`09210`20`7D,`09`7B`20190,`09190`20`7D`7D,`09`7B`7B`20190,`092
  578. V10`20`7D,`09`7B`20210,`09210`20`7D`7D,
  579. X`09`7B`7B`20190,`09190`20`7D,`09`7B`20210,`09190`20`7D`7D,`09`7B`7B`20189,`092
  580. V11`20`7D,`09`7B`20190,`09210`20`7D`7D,
  581. X`09`7B`7B`20189,`09189`20`7D,`09`7B`20190,`09190`20`7D`7D,`09`7B`7B`20189,`092
  582. V10`20`7D,`09`7B`20190,`09210`20`7D`7D,
  583. X`09`7B`7B`20189,`09190`20`7D,`09`7B`20190,`09190`20`7D`7D,`09`7B`7B`20210,`092
  584. V10`20`7D,`09`7B`20210,`09190`20`7D`7D,
  585. X`09`7B`7B`20210,`09210`20`7D,`09`7B`20211,`09210`20`7D`7D,`09`7B`7B`20210,`091
  586. V90`20`7D,`09`7B`20211,`09190`20`7D`7D,
  587. X`09`7B`7B`20210,`09210`20`7D,`09`7B`20211,`09211`20`7D`7D,`09`7B`7B`20210,`091
  588. V90`20`7D,`09`7B`20211,`09189`20`7D`7D,
  589. X`09`7B`7B`20190,`09210`20`7D,`09`7B`20190,`09190`20`7D`7D,`09`7B`7B`20190,`092
  590. V10`20`7D,`09`7B`20210,`09210`20`7D`7D,
  591. X`09`7B`7B`20190,`09190`20`7D,`09`7B`20210,`09190`20`7D`7D,`09`7B`7B`20190,`092
  592. V10`20`7D,`09`7B`20190,`09210`20`7D`7D,
  593. X`09`7B`7B`20190,`09190`20`7D,`09`7B`20190,`09190`20`7D`7D,`09`7B`7B`20190,`092
  594. V10`20`7D,`09`7B`20190,`09210`20`7D`7D,
  595. X`09`7B`7B`20190,`09190`20`7D,`09`7B`20190,`09190`20`7D`7D,`09`7B`7B`20210,`092
  596. V10`20`7D,`09`7B`20210,`09190`20`7D`7D,
  597. X`09`7B`7B`20210,`09210`20`7D,`09`7B`20210,`09210`20`7D`7D,`09`7B`7B`20210,`091
  598. V90`20`7D,`09`7B`20210,`09190`20`7D`7D,
  599. X`09`7B`7B`20210,`09210`20`7D,`09`7B`20210,`09210`20`7D`7D,`09`7B`7B`20210,`091
  600. V90`20`7D,`09`7B`20210,`09190`20`7D`7D,
  601. X`09`7B`7B`20191,`09209`20`7D,`09`7B`20191,`09191`20`7D`7D,`09`7B`7B`20191,`092
  602. V09`20`7D,`09`7B`20209,`09209`20`7D`7D,
  603. X`09`7B`7B`20191,`09191`20`7D,`09`7B`20209,`09191`20`7D`7D,`09`7B`7B`20190,`092
  604. V10`20`7D,`09`7B`20191,`09209`20`7D`7D,
  605. X`09`7B`7B`20190,`09190`20`7D,`09`7B`20191,`09191`20`7D`7D,`09`7B`7B`20190,`092
  606. V09`20`7D,`09`7B`20191,`09209`20`7D`7D,
  607. X`09`7B`7B`20190,`09191`20`7D,`09`7B`20191,`09191`20`7D`7D,`09`7B`7B`20209,`092
  608. V09`20`7D,`09`7B`20209,`09191`20`7D`7D,
  609. X`09`7B`7B`20209,`09209`20`7D,`09`7B`20210,`09209`20`7D`7D,`09`7B`7B`20209,`091
  610. V91`20`7D,`09`7B`20210,`09191`20`7D`7D,
  611. X`09`7B`7B`20209,`09209`20`7D,`09`7B`20210,`09210`20`7D`7D,`09`7B`7B`20209,`091
  612. V91`20`7D,`09`7B`20210,`09190`20`7D`7D,
  613. X`09`7B`7B`20191,`09209`20`7D,`09`7B`20191,`09191`20`7D`7D,`09`7B`7B`20191,`092
  614. V09`20`7D,`09`7B`20209,`09209`20`7D`7D,
  615. X`09`7B`7B`20191,`09191`20`7D,`09`7B`20209,`09191`20`7D`7D,`09`7B`7B`20191,`092
  616. V09`20`7D,`09`7B`20191,`09209`20`7D`7D,
  617. X`09`7B`7B`20191,`09191`20`7D,`09`7B`20191,`09191`20`7D`7D,`09`7B`7B`20191,`092
  618. V09`20`7D,`09`7B`20191,`09209`20`7D`7D,
  619. X`09`7B`7B`20191,`09191`20`7D,`09`7B`20191,`09191`20`7D`7D,`09`7B`7B`20209,`092
  620. V09`20`7D,`09`7B`20209,`09191`20`7D`7D,
  621. X`09`7B`7B`20209,`09209`20`7D,`09`7B`20209,`09209`20`7D`7D,`09`7B`7B`20209,`091
  622. V91`20`7D,`09`7B`20209,`09191`20`7D`7D,
  623. X`09`7B`7B`20209,`09209`20`7D,`09`7B`20209,`09209`20`7D`7D,`09`7B`7B`20209,`091
  624. V91`20`7D,`09`7B`20209,`09191`20`7D`7D,
  625. X`09`7B`7B`20192,`09208`20`7D,`09`7B`20192,`09192`20`7D`7D,`09`7B`7B`20192,`092
  626. V08`20`7D,`09`7B`20208,`09208`20`7D`7D,
  627. X`09`7B`7B`20192,`09192`20`7D,`09`7B`20208,`09192`20`7D`7D,`09`7B`7B`20191,`092
  628. V09`20`7D,`09`7B`20192,`09208`20`7D`7D,
  629. X`09`7B`7B`20191,`09191`20`7D,`09`7B`20192,`09192`20`7D`7D,`09`7B`7B`20191,`092
  630. V08`20`7D,`09`7B`20192,`09208`20`7D`7D,
  631. X`09`7B`7B`20191,`09192`20`7D,`09`7B`20192,`09192`20`7D`7D,`09`7B`7B`20208,`092
  632. V08`20`7D,`09`7B`20208,`09192`20`7D`7D,
  633. X`09`7B`7B`20208,`09208`20`7D,`09`7B`20209,`09208`20`7D`7D,`09`7B`7B`20208,`091
  634. V92`20`7D,`09`7B`20209,`09192`20`7D`7D,
  635. X`09`7B`7B`20208,`09208`20`7D,`09`7B`20209,`09209`20`7D`7D,`09`7B`7B`20208,`091
  636. V92`20`7D,`09`7B`20209,`09191`20`7D`7D,
  637. X`09`7B`7B`20192,`09208`20`7D,`09`7B`20192,`09192`20`7D`7D,`09`7B`7B`20192,`092
  638. V08`20`7D,`09`7B`20208,`09208`20`7D`7D,
  639. X`09`7B`7B`20192,`09192`20`7D,`09`7B`20208,`09192`20`7D`7D,`09`7B`7B`20192,`092
  640. V08`20`7D,`09`7B`20192,`09208`20`7D`7D,
  641. X`09`7B`7B`20192,`09192`20`7D,`09`7B`20192,`09192`20`7D`7D,`09`7B`7B`20192,`092
  642. V08`20`7D,`09`7B`20192,`09208`20`7D`7D,
  643. X`09`7B`7B`20192,`09192`20`7D,`09`7B`20192,`09192`20`7D`7D,`09`7B`7B`20208,`092
  644. V08`20`7D,`09`7B`20208,`09192`20`7D`7D,
  645. X`09`7B`7B`20208,`09208`20`7D,`09`7B`20208,`09208`20`7D`7D,`09`7B`7B`20208,`091
  646. V92`20`7D,`09`7B`20208,`09192`20`7D`7D,
  647. X`09`7B`7B`20208,`09208`20`7D,`09`7B`20208,`09208`20`7D`7D,`09`7B`7B`20208,`091
  648. V92`20`7D,`09`7B`20208,`09192`20`7D`7D,
  649. X`09`7B`7B`20192,`09208`20`7D,`09`7B`20192,`09192`20`7D`7D,`09`7B`7B`20192,`092
  650. V08`20`7D,`09`7B`20208,`09208`20`7D`7D,
  651. X`09`7B`7B`20192,`09192`20`7D,`09`7B`20208,`09192`20`7D`7D,`09`7B`7B`20192,`092
  652. V08`20`7D,`09`7B`20192,`09208`20`7D`7D,
  653. X`09`7B`7B`20192,`09192`20`7D,`09`7B`20192,`09192`20`7D`7D,`09`7B`7B`20192,`092
  654. V08`20`7D,`09`7B`20192,`09208`20`7D`7D,
  655. X`09`7B`7B`20192,`09192`20`7D,`09`7B`20192,`09192`20`7D`7D,`09`7B`7B`20208,`092
  656. V08`20`7D,`09`7B`20208,`09192`20`7D`7D,
  657. X`09`7B`7B`20208,`09208`20`7D,`09`7B`20208,`09208`20`7D`7D,`09`7B`7B`20208,`091
  658. V92`20`7D,`09`7B`20208,`09192`20`7D`7D,
  659. X`09`7B`7B`20208,`09208`20`7D,`09`7B`20208,`09208`20`7D`7D,`09`7B`7B`20208,`091
  660. V92`20`7D,`09`7B`20208,`09192`20`7D`7D,
  661. X`09`7B`7B`20193,`09207`20`7D,`09`7B`20193,`09193`20`7D`7D,`09`7B`7B`20193,`092
  662. V07`20`7D,`09`7B`20207,`09207`20`7D`7D,
  663. X`09`7B`7B`20193,`09193`20`7D,`09`7B`20207,`09193`20`7D`7D,`09`7B`7B`20192,`092
  664. V08`20`7D,`09`7B`20193,`09207`20`7D`7D,
  665. X`09`7B`7B`20192,`09192`20`7D,`09`7B`20193,`09193`20`7D`7D,`09`7B`7B`20192,`092
  666. V07`20`7D,`09`7B`20193,`09207`20`7D`7D,
  667. X`09`7B`7B`20192,`09193`20`7D,`09`7B`20193,`09193`20`7D`7D,`09`7B`7B`20207,`092
  668. V07`20`7D,`09`7B`20207,`09193`20`7D`7D,
  669. X`09`7B`7B`20207,`09207`20`7D,`09`7B`20208,`09207`20`7D`7D,`09`7B`7B`20207,`091
  670. V93`20`7D,`09`7B`20208,`09193`20`7D`7D,
  671. X`09`7B`7B`20207,`09207`20`7D,`09`7B`20208,`09208`20`7D`7D,`09`7B`7B`20207,`091
  672. V93`20`7D,`09`7B`20208,`09192`20`7D`7D,
  673. X`09`7B`7B`20193,`09207`20`7D,`09`7B`20193,`09193`20`7D`7D,`09`7B`7B`20193,`092
  674. V07`20`7D,`09`7B`20207,`09207`20`7D`7D,
  675. X`09`7B`7B`20193,`09193`20`7D,`09`7B`20207,`09193`20`7D`7D,`09`7B`7B`20193,`092
  676. V07`20`7D,`09`7B`20193,`09207`20`7D`7D,
  677. X`09`7B`7B`20193,`09193`20`7D,`09`7B`20193,`09193`20`7D`7D,`09`7B`7B`20193,`092
  678. V07`20`7D,`09`7B`20193,`09207`20`7D`7D,
  679. X`09`7B`7B`20193,`09193`20`7D,`09`7B`20193,`09193`20`7D`7D,`09`7B`7B`20207,`092
  680. V07`20`7D,`09`7B`20207,`09193`20`7D`7D,
  681. X`09`7B`7B`20207,`09207`20`7D,`09`7B`20207,`09207`20`7D`7D,`09`7B`7B`20207,`091
  682. V93`20`7D,`09`7B`20207,`09193`20`7D`7D,
  683. X`09`7B`7B`20207,`09207`20`7D,`09`7B`20207,`09207`20`7D`7D,`09`7B`7B`20207,`091
  684. V93`20`7D,`09`7B`20207,`09193`20`7D`7D,
  685. X`09`7B`7B`20193,`09207`20`7D,`09`7B`20193,`09193`20`7D`7D,`09`7B`7B`20193,`092
  686. V07`20`7D,`09`7B`20207,`09207`20`7D`7D,
  687. X`09`7B`7B`20193,`09193`20`7D,`09`7B`20207,`09193`20`7D`7D,`09`7B`7B`20193,`092
  688. V07`20`7D,`09`7B`20193,`09207`20`7D`7D,
  689. X`09`7B`7B`20193,`09193`20`7D,`09`7B`20193,`09193`20`7D`7D,`09`7B`7B`20193,`092
  690. V07`20`7D,`09`7B`20193,`09207`20`7D`7D,
  691. X`09`7B`7B`20193,`09193`20`7D,`09`7B`20193,`09193`20`7D`7D,`09`7B`7B`20207,`092
  692. V07`20`7D,`09`7B`20207,`09193`20`7D`7D,
  693. X`09`7B`7B`20207,`09207`20`7D,`09`7B`20207,`09207`20`7D`7D,`09`7B`7B`20207,`091
  694. V93`20`7D,`09`7B`20207,`09193`20`7D`7D,
  695. X`09`7B`7B`20207,`09207`20`7D,`09`7B`20207,`09207`20`7D`7D,`09`7B`7B`20207,`091
  696. V93`20`7D,`09`7B`20207,`09193`20`7D`7D,
  697. X`09`7B`7B`20193,`09207`20`7D,`09`7B`20193,`09193`20`7D`7D,`09`7B`7B`20193,`092
  698. V07`20`7D,`09`7B`20207,`09207`20`7D`7D,
  699. X`09`7B`7B`20193,`09193`20`7D,`09`7B`20207,`09193`20`7D`7D,`09`7B`7B`20193,`092
  700. V07`20`7D,`09`7B`20193,`09207`20`7D`7D,
  701. X`09`7B`7B`20193,`09193`20`7D,`09`7B`20193,`09193`20`7D`7D,`09`7B`7B`20193,`092
  702. V07`20`7D,`09`7B`20193,`09207`20`7D`7D,
  703. X`09`7B`7B`20193,`09193`20`7D,`09`7B`20193,`09193`20`7D`7D,`09`7B`7B`20207,`092
  704. V07`20`7D,`09`7B`20207,`09193`20`7D`7D,
  705. X`09`7B`7B`20207,`09207`20`7D,`09`7B`20207,`09207`20`7D`7D,`09`7B`7B`20207,`091
  706. V93`20`7D,`09`7B`20207,`09193`20`7D`7D,
  707. X`09`7B`7B`20207,`09207`20`7D,`09`7B`20207,`09207`20`7D`7D,`09`7B`7B`20207,`091
  708. V93`20`7D,`09`7B`20207,`09193`20`7D`7D,
  709. X`09`7B`7B`20194,`09206`20`7D,`09`7B`20194,`09194`20`7D`7D,`09`7B`7B`20194,`092
  710. V06`20`7D,`09`7B`20206,`09206`20`7D`7D,
  711. X`09`7B`7B`20194,`09194`20`7D,`09`7B`20206,`09194`20`7D`7D,`09`7B`7B`20193,`092
  712. V07`20`7D,`09`7B`20194,`09206`20`7D`7D,
  713. X`09`7B`7B`20193,`09193`20`7D,`09`7B`20194,`09194`20`7D`7D,`09`7B`7B`20193,`092
  714. V06`20`7D,`09`7B`20194,`09206`20`7D`7D,
  715. X`09`7B`7B`20193,`09194`20`7D,`09`7B`20194,`09194`20`7D`7D,`09`7B`7B`20206,`092
  716. V06`20`7D,`09`7B`20206,`09194`20`7D`7D,
  717. X`09`7B`7B`20206,`09206`20`7D,`09`7B`20207,`09206`20`7D`7D,`09`7B`7B`20206,`091
  718. V94`20`7D,`09`7B`20207,`09194`20`7D`7D,
  719. X`09`7B`7B`20206,`09206`20`7D,`09`7B`20207,`09207`20`7D`7D,`09`7B`7B`20206,`091
  720. V94`20`7D,`09`7B`20207,`09193`20`7D`7D,
  721. X`09`7B`7B`20194,`09206`20`7D,`09`7B`20194,`09194`20`7D`7D,`09`7B`7B`20194,`092
  722. V06`20`7D,`09`7B`20206,`09206`20`7D`7D,
  723. X`09`7B`7B`20194,`09194`20`7D,`09`7B`20206,`09194`20`7D`7D,`09`7B`7B`20194,`092
  724. V06`20`7D,`09`7B`20194,`09206`20`7D`7D,
  725. X`09`7B`7B`20194,`09194`20`7D,`09`7B`20194,`09194`20`7D`7D,`09`7B`7B`20194,`092
  726. V06`20`7D,`09`7B`20194,`09206`20`7D`7D,
  727. X`09`7B`7B`20194,`09194`20`7D,`09`7B`20194,`09194`20`7D`7D,`09`7B`7B`20206,`092
  728. V06`20`7D,`09`7B`20206,`09194`20`7D`7D,
  729. X`09`7B`7B`20206,`09206`20`7D,`09`7B`20206,`09206`20`7D`7D,`09`7B`7B`20206,`091
  730. V94`20`7D,`09`7B`20206,`09194`20`7D`7D,
  731. X`09`7B`7B`20206,`09206`20`7D,`09`7B`20206,`09206`20`7D`7D,`09`7B`7B`20206,`091
  732. V94`20`7D,`09`7B`20206,`09194`20`7D`7D,
  733. X`7D;
  734. X
  735. X#define`20ratBits_width`20384
  736. X#define`20ratBits_height`2064
  737. Xstatic`20short`09ratBits`5B`5D`20=`20`7B
  738. X`20`20`20`200x0000,`200x0000,`200x0000,`200x0000,`200x0000,`200x0000,`200x0000
  739. V,`200x0000,
  740. X`20`20`20`200x0000,`200x0000,`200x0000,`200x0000,`200x0000,`200x0000,`200x0000
  741. V,`200x0000,
  742. X`20`20`20`200x0000,`200x0000,`200x0000,`200x0000,`200x0000,`200x0000,`200x0000
  743. V,`200x0000,
  744. X
  745. X`20`20`20`200x0000,`200x0000,`200x0000,`200x0000,`200x0000,`200x0000,`200x0000
  746. V,`200x0000,
  747. X`20`20`20`200x0000,`200x0000,`200x0000,`200x0000,`200x0000,`200x0000,`200x0000
  748. V,`200x0000,
  749. X`20`20`20`200x0000,`200x0000,`200x0000,`200x0000,`200x0000,`200x0000,`200x0000
  750. V,`200x0000,
  751. X
  752. X`20`20`20`200x0000,`200x0000,`200x0000,`200x0000,`200x0000,`200x0000,`200x0000
  753. V,`200x0000,
  754. X`20`20`20`200x0000,`200x0000,`200x0000,`200x0000,`200x0000,`200x0000,`200x0000
  755. V,`200x0000,
  756. X`20`20`20`200x0007,`200xe000,`200x0007,`200xe000,`200x003c,`200x0000,`200x3c00
  757. V,`200x0df0,
  758. X
  759. X`20`20`20`200x0000,`200x0000,`200x0000,`200x0000,`200x0000,`200x001f,`200xf800
  760. V,`200x0000,
  761. X`20`20`20`200x0000,`200x0000,`200x0000,`200x0000,`200x0000,`200x0000,`200x0000
  762. V,`200x0000,
  763. X`20`20`20`200x003f,`200xfc00,`200x003f,`200xfc00,`200x008f,`200x0000,`200x9f00
  764. V,`200x13f8,
  765. X
  766. X`20`20`20`200x0000,`200x001f,`200xf800,`200x0000,`200x0000,`200x01ff,`200xff80
  767. V,`200x0000,
  768. X`20`20`20`200x0000,`200x001f,`200xf800,`200x0000,`200x0000,`200x001f,`200xf800
  769. V,`200x0000,
  770. X`20`20`20`200x00f3,`200xff00,`200x00f3,`200xff00,`200x037f,`200xc003,`200x7fc0
  771. V,`200x2ffc,
  772. X
  773. X`20`20`20`200x0000,`200x01ff,`200xff80,`200x0000,`200x0000,`200x0fff,`200xfff0
  774. V,`200x0000,
  775. X`20`20`20`200x0000,`200x01ff,`200xff80,`200x0000,`200x0000,`200x01ff,`200xff80
  776. V,`200x0000,
  777. X`20`20`20`200x01c7,`200xff80,`200x01c7,`200xff80,`200x04ff,`200xe004,`200xffe0
  778. V,`200x2ffc,
  779. X
  780. X`20`20`20`200x0000,`200x0fff,`200xfff0,`200x0000,`200x0000,`200x3fff,`200xfffc
  781. V,`200x0000,
  782. X`20`20`20`200x0000,`200x0fff,`200xfff0,`200x0000,`200x0000,`200x0fff,`200xfff0
  783. V,`200x0000,
  784. X`20`20`20`200x031f,`200xffc0,`200x031f,`200xffc0,`200x0bff,`200xf00b,`200xfff0
  785. V,`200x47fe,
  786. X
  787. X`20`20`20`200x0000,`200x3fff,`200xfffc,`200x0000,`200x0000,`200xffe3,`200xffff
  788. V,`200x0000,
  789. X`20`20`20`200x0000,`200x3fff,`200xfffc,`200x0000,`200x0000,`200x3fff,`200xfffc
  790. V,`200x0000,
  791. X`20`20`20`200x067f,`200xffe0,`200x067f,`200xffe0,`200x0bff,`200xf00f,`200xfff0
  792. V,`200x63fe,
  793. X
  794. X`20`20`20`200x0000,`200xffe3,`200xffff,`200x0000,`200x0001,`200xe79f,`200xffff
  795. V,`200x8000,
  796. X`20`20`20`200x0000,`200xffe3,`200xffff,`200x0000,`200x0000,`200xff8f,`200xffff
  797. V,`200x0000,
  798. X`20`20`20`200x0cff,`200xfff0,`200x0cff,`200xfff0,`200x11ff,`200xf81f,`200xfff8
  799. V,`200x63fe,
  800. X
  801. X`20`20`20`200x0001,`200xe79f,`200xffff,`200x8000,`200x0003,`200xf03f,`200xffff
  802. V,`200xc000,
  803. X`20`20`20`200x0001,`200xe79f,`200xffff,`200x8000,`200x0001,`200xe60f,`200xffff
  804. V,`200x8000,
  805. X`20`20`20`200x0bff,`200xfff0,`200x0bff,`200xfff0,`200x10ff,`200xf81f,`200xfff8
  806. V,`200x47fe,
  807. X
  808. X`20`20`20`200x0003,`200xf03f,`200xffff,`200xc000,`200x0007,`200xc07f,`200xffff
  809. V,`200xe000,
  810. X`20`20`20`200x0003,`200xf03f,`200xffff,`200xc000,`200x0003,`200xf83f,`200xffff
  811. V,`200xc000,
  812. X`20`20`20`200x19ff,`200xfff8,`200x1fff,`200xfff8,`200x307f,`200xfc3f,`200xfffc
  813. V,`200x2ffc,
  814. X
  815. X`20`20`20`200x0007,`200xc07f,`200xffff,`200xe000,`200x000d,`200x01ff,`200xffff
  816. V,`200xf000,
  817. X`20`20`20`200x0007,`200xc07f,`200xffff,`200xe000,`200x0007,`200xc03f,`200xffff
  818. V,`200xe000,
  819. X`20`20`20`200x10ff,`200xfff8,`200x1fff,`200xfff8,`200x383f,`200xfc3f,`200xfffc
  820. V,`200x3ffc,
  821. X
  822. X`20`20`20`200x000d,`200x01ff,`200xffff,`200xf000,`200x0018,`200x0dff,`200xffff
  823. V,`200xf800,
  824. X`20`20`20`200x000d,`200x01ff,`200xffff,`200xf000,`200x000f,`200x01ff,`200xffff
  825. V,`200xf000,
  826. X`20`20`20`200x087f,`200xfff8,`200x1fff,`200xfff8,`200x383f,`200xfc3f,`200xfffc
  827. V,`200x1ff8,
  828. X
  829. X`20`20`20`200x0018,`200x0dff,`200xffff,`200xf800,`200x003c,`200x3eff,`200xffff
  830. V,`200xfc00,
  831. X`20`20`20`200x0018,`200x0dff,`200xffff,`200xf800,`200x001c,`200x0dff,`200xffff
  832. V,`200xf800,
  833. X`20`20`20`200x183f,`200xfffc,`200x3fff,`200xfffc,`200x307f,`200xfc3f,`200xfffc
  834. V,`200x1bdc,
  835. X
  836. X`20`20`20`200x003c,`200x3eff,`200xffff,`200xfc00,`200x0078,`200xfcff,`200xffff
  837. V,`200xfe00,
  838. X`20`20`20`200x003c,`200x3eff,`200xffff,`200xfc00,`200x003c,`200x3eff,`200xffff
  839. V,`200xfc00,
  840. X`20`20`20`200x1c1f,`200xfffc,`200x3fff,`200xfffc,`200x10ff,`200xf81f,`200xfff8
  841. V,`200x2e3a,
  842. X
  843. X`20`20`20`200x0078,`200xfcff,`200xffff,`200xfe00,`200x00f1,`200x7eff,`200xffff
  844. V,`200xff00,
  845. X`20`20`20`200x0078,`200xfcff,`200xffff,`200xfe00,`200x0078,`200xfcff,`200xffff
  846. V,`200xfe00,
  847. X`20`20`20`200x3c0f,`200xfffc,`200x3fff,`200xfffc,`200x11ff,`200xf81f,`200xfff8
  848. V,`200x17f4,
  849. X
  850. X`20`20`20`200x00f1,`200x7eff,`200xffff,`200xff00,`200x00e3,`200x9fff,`200xffff
  851. V,`200xff00,
  852. X`20`20`20`200x00f1,`200x7eff,`200xffff,`200xff00,`200x00f1,`200x7eff,`200xffff
  853. V,`200xff00,
  854. X`20`20`20`200x3c0f,`200xfffc,`200x3fff,`200xfffc,`200x0fff,`200xf00f,`200xfff0
  855. V,`200x0000,
  856. X
  857. X`20`20`20`200x00e3,`200x9fff,`200xffff,`200xff00,`200x01ef,`200xcfff,`200xffff
  858. V,`200xff80,
  859. X`20`20`20`200x00e3,`200x9fff,`200xffff,`200xff00,`200x00e3,`200x9fff,`200xffff
  860. V,`200xff00,
  861. X`20`20`20`200x3c1f,`200xfffc,`200x3fff,`200xfffc,`200x0fff,`200xf00f,`200xfff0
  862. V,`200x03c0,
  863. X
  864. X`20`20`20`200x01ef,`200xcfff,`200xffff,`200xff80,`200x01df,`200xffff,`200xffff
  865. V,`200xfc80,
  866. X`20`20`20`200x01ef,`200xcfff,`200xffff,`200xff80,`200x01e7,`200xcfff,`200xffff
  867. V,`200xff80,
  868. X`20`20`20`200x383f,`200xfffc,`200x3fff,`200xfffc,`200x07ff,`200xe007,`200xffe0
  869. V,`200x0df0,
  870. X
  871. X`20`20`20`200x013f,`200xffff,`200xffff,`200xff80,`200x03ff,`200xffff,`200xffff
  872. V,`200xc0c0,
  873. X`20`20`20`200x01df,`200xffff,`200xffff,`200xff80,`200x01df,`200xffff,`200xffff
  874. V,`200xff80,
  875. X`20`20`20`200x187f,`200xfff8,`200x1fff,`200xfff8,`200x03ff,`200xc003,`200xffc0
  876. V,`200x13f8,
  877. X
  878. X`20`20`20`200x0303,`200xffff,`200xffff,`200xffc0,`200x03ff,`200xffff,`200xfffe
  879. V,`200x0040,
  880. X`20`20`20`200x03ff,`200xffff,`200xffff,`200xffc0,`200x03ff,`200xffe0,`200x07ff
  881. V,`200xffc0,
  882. X`20`20`20`200x10ff,`200xfff8,`200x1fff,`200xfff8,`200x0b7e,`200x680b,`200x7e68
  883. V,`200x2ffc,
  884. X
  885. X`20`20`20`200x0200,`200x7fff,`200xffff,`200xffc0,`200x03ff,`200xffff,`200xfff8
  886. V,`200x0040,
  887. X`20`20`20`200x03ff,`200xffff,`200xffff,`200xffc0,`200x03ff,`200xff00,`200x00ff
  888. V,`200xffc0,
  889. X`20`20`20`200x19ff,`200xfff8,`200x1fff,`200xfff8,`200x15f9,`200xd415,`200xf9d4
  890. V,`200x3ff4,
  891. X
  892. X`20`20`20`200x0200,`200x1fff,`200xffff,`200xffc0,`200x07ff,`200xffff,`200xffe0
  893. V,`200x0060,
  894. X`20`20`20`200x03ff,`200xffff,`200xffff,`200xffc0,`200x03ff,`200xf800,`200x001f
  895. V,`200xffc0,
  896. X`20`20`20`200x0fff,`200xfff0,`200x0fff,`200xfff0,`200x0aae,`200xa80a,`200xaea8
  897. V,`200x7fe2,
  898. X
  899. X`20`20`20`200x0600,`200x07ff,`200xffff,`200xffe0,`200x07ff,`200xffff,`200xffc0
  900. V,`200x00e0,
  901. X`20`20`20`200x07ff,`200xffff,`200xffff,`200xffe0,`200x07ff,`200xc000,`200x0003
  902. V,`200xffe0,
  903. X`20`20`20`200x0fff,`200xfff0,`200x0fff,`200xfff0,`200x0155,`200x4001,`200x5540
  904. V,`200x7fc6,
  905. X
  906. X`20`20`20`200x0700,`200xcfff,`200xffff,`200xffe0,`200x07ff,`200xffff,`200xff0a
  907. V,`200x00e0,
  908. X`20`20`20`200x07ff,`200xffff,`200xffff,`200xffe0,`200x07ff,`200x0007,`200xe000
  909. V,`200xffe0,
  910. X`20`20`20`200x07ff,`200xff60,`200x07ff,`200xff60,`200x0000,`200x0000,`200x0000
  911. V,`200x7fc6,
  912. X
  913. X`20`20`20`200x0700,`200x30ff,`200xffff,`200xffe0,`200x07ff,`200xffff,`200xfe0c
  914. V,`200x00e0,
  915. X`20`20`20`200x07ff,`200xffff,`200xffff,`200xffe0,`200x07fc,`200x000d,`200xb800
  916. V,`200x3fe0,
  917. X`20`20`20`200x03ff,`200xfcc0,`200x03ff,`200xfcc0,`200x0000,`200x0000,`200x0000
  918. V,`200x7fe2,
  919. X
  920. X`20`20`20`200x0700,`200x407f,`200xffff,`200xffe0,`200x0fff,`200xffff,`200xfc38
  921. V,`200x01f0,
  922. X`20`20`20`200x07ff,`200xffff,`200xffff,`200xffe0,`200x07f0,`200x0005,`200xbc00
  923. V,`200x0fe0,
  924. X`20`20`20`200x07ff,`200xff68,`200x07ff,`200xff68,`200x003c,`200x0000,`200x3c00
  925. V,`200x3ff4,
  926. X
  927. X`20`20`20`200x0f81,`200x003f,`200xffff,`200xfff0,`200x0fff,`200xffff,`200xf875
  928. V,`200x81b0,
  929. X`20`20`20`200x0fff,`200xffff,`200xffff,`200xfff0,`200x0fc0,`200x0003,`200x7602
  930. V,`200x03f0,
  931. X`20`20`20`200x15ff,`200xf9d4,`200x15ff,`200xf9d4,`200x009f,`200x0000,`200x9f00
  932. V,`200x3ffc,
  933. X
  934. X`20`20`20`200x0d80,`200x021f,`200xffff,`200xfff0,`200x0fff,`200xffff,`200xf382
  935. V,`200x41f0,
  936. X`20`20`20`200x0fff,`200xffff,`200xffff,`200xfff0,`200x0fc1,`200x0043,`200xce00
  937. V,`200x8df0,
  938. X`20`20`20`200x2adf,`200xe3aa,`200x2adf,`200xe3aa,`200x037f,`200xc003,`200x7fc0
  939. V,`200x1ff8,
  940. X
  941. X`20`20`20`200x0f80,`200x01cf,`200xffff,`200xfff0,`200x0fff,`200xffff,`200xee00
  942. V,`200x0170,
  943. X`20`20`20`200x0fff,`200xffff,`200xffff,`200xfff0,`200x0f2a,`200x00c3,`200xef00
  944. V,`200x70f0,
  945. X`20`20`20`200x157c,`200x3f54,`200x157c,`200x3f54,`200x04ff,`200xe004,`200xffe0
  946. V,`200x1bdc,
  947. X
  948. X`20`20`20`200x0e80,`200x6677,`200xffff,`200xfff0,`200x0fff,`200xffff,`200xfc00
  949. V,`200x0170,
  950. X`20`20`20`200x0fff,`200xffff,`200xffff,`200xfff0,`200x0e6d,`200x0091,`200xf900
  951. V,`200x8070,
  952. X`20`20`20`200x0aaf,`200xfaa8,`200x0aaf,`200xfaa8,`200x0bff,`200xf00b,`200xfff0
  953. V,`200x2e3a,
  954. X
  955. X`20`20`20`200x0e80,`200x183f,`200xffff,`200xfff0,`200x0fff,`200xffff,`200xc000
  956. V,`200x0170,
  957. X`20`20`20`200x0fff,`200xffff,`200xffff,`200xfff0,`200x0c10,`200x00f8,`200xff00
  958. V,`200x03b0,
  959. X`20`20`20`200x0155,`200x5540,`200x0155,`200x5540,`200x0fff,`200xd00f,`200x81f0
  960. V,`200x17f4,
  961. X
  962. X`20`20`20`200x0e80,`200x0003,`200xffff,`200xfff0,`200x0fff,`200xffff,`200xe000
  963. V,`200x01f0,
  964. X`20`20`20`200x0fff,`200xffff,`200xffff,`200xfff0,`200x0c0c,`200x00ff,`200xf700
  965. V,`200x25f0,
  966. X`20`20`20`200x0000,`200x0000,`200x0000,`200x0000,`200x1fff,`200x881e,`200x0078
  967. V,`200x0000,
  968. X
  969. X`20`20`20`200x0f80,`200x0007,`200xffff,`200xfff0,`200x0fff,`200xffff,`200xf000
  970. V,`200x01f0,
  971. X`20`20`20`200x0fff,`200xffff,`200xffff,`200xfff0,`200x0e02,`200x0097,`200xf900
  972. V,`200x1c70,
  973. X`20`20`20`200x0000,`200x0000,`200x0000,`200x0000,`200x1fff,`200x0818,`200x1818
  974. V,`200x03c0,
  975. X
  976. X`20`20`20`200x0f80,`200x000f,`200xffff,`200xfff0,`200x0fff,`200xffff,`200xf800
  977. V,`200x01f0,
  978. X`20`20`20`200x0fff,`200xffff,`200xffff,`200xfff0,`200x0f01,`200x00fb,`200xe700
  979. V,`200x00f0,
  980. X`20`20`20`200x0007,`200xe000,`200x0007,`200xe000,`200x3ffe,`200x0c30,`200x1c0c
  981. V,`200x0df0,
  982. X
  983. X`20`20`20`200x0f80,`200x601f,`200xffff,`200xfff0,`200x0fff,`200xffff,`200xfc00
  984. V,`200x01b0,
  985. X`20`20`20`200x0fff,`200xffff,`200xffff,`200xfff0,`200x0f80,`200x0075,`200xde00
  986. V,`200x51f0,
  987. X`20`20`20`200x003f,`200xfc00,`200x003f,`200xfc00,`200x3ffc,`200x1c20,`200x4e04
  988. V,`200x13f8,
  989. X
  990. X`20`20`20`200x0d80,`200x91ff,`200xffff,`200xfff0,`200x07ff,`200xffff,`200xfe00
  991. V,`200x01e0,
  992. X`20`20`20`200x0fff,`200xffff,`200xffff,`200xfff0,`200x0fc0,`200x006f,`200x1604
  993. V,`200x8bf0,
  994. X`20`20`20`200x00f3,`200xff00,`200x00f3,`200xff00,`200x3ffc,`200x1c20,`200x6e04
  995. V,`200x2ffc,
  996. X
  997. X`20`20`20`200x0780,`200x0f7f,`200xffff,`200xffe0,`200x07ff,`200xffff,`200xff00
  998. V,`200x00e0,
  999. X`20`20`20`200x07ff,`200xffff,`200xffff,`200xffe0,`200x07f0,`200x0039,`200x7c03
  1000. V,`200x07e0,
  1001. X`20`20`20`200x01c7,`200xff80,`200x01c7,`200xff80,`200x3ffe,`200x0c30,`200x7e0c
  1002. V,`200x3ffc,
  1003. X
  1004. X`20`20`20`200x0700,`200x00ff,`200xffff,`200xffe0,`200x07ff,`200xffff,`200xffc0
  1005. V,`200x00e0,
  1006. X`20`20`20`200x07ff,`200xffff,`200xffff,`200xffe0,`200x07fc,`200x001d,`200xb810
  1007. V,`200x1fe0,
  1008. X`20`20`20`200x031f,`200xffc0,`200x031f,`200xffc0,`200x1fff,`200x0818,`200x3c18
  1009. V,`200x7ffe,
  1010. X
  1011. X`20`20`20`200x0710,`200x03ff,`200xffff,`200xffe0,`200x07ff,`200xffff,`200xffe0
  1012. V,`200x00e0,
  1013. X`20`20`20`200x07ff,`200xffff,`200xffff,`200xffe0,`200x07ff,`200x0007,`200xe208
  1014. V,`200x7fe0,
  1015. X`20`20`20`200x067f,`200xffe0,`200x067f,`200xffe0,`200x1fff,`200x881e,`200x1878
  1016. V,`200x7ffe,
  1017. X
  1018. X`20`20`20`200x0708,`200x07ff,`200xffff,`200xffe0,`200x03ff,`200xffff,`200xfff8
  1019. V,`200x00c0,
  1020. X`20`20`20`200x07ff,`200xffff,`200xffff,`200xffe0,`200x07ff,`200xc000,`200x0191
  1021. V,`200xffe0,
  1022. X`20`20`20`200x0cff,`200xfff0,`200x0cff,`200xfff0,`200x0fff,`200xf00f,`200x81f0
  1023. V,`200x7ffe,
  1024. X
  1025. X`20`20`20`200x0228,`200x1fff,`200xffff,`200xffc0,`200x03ff,`200xffff,`200xfffe
  1026. V,`200x01c0,
  1027. X`20`20`20`200x03ff,`200xffff,`200xffff,`200xffc0,`200x03ff,`200xf800,`200x0077
  1028. V,`200xffc0,
  1029. X`20`20`20`200x0bff,`200xfff0,`200x0bff,`200xfff0,`200x0fff,`200xf00f,`200xfff0
  1030. V,`200x7ffe,
  1031. X
  1032. X`20`20`20`200x0214,`200x7fff,`200xffff,`200xffc0,`200x03ff,`200xffff,`200xffff
  1033. V,`200xc1c0,
  1034. X`20`20`20`200x03ff,`200xffff,`200xffff,`200xffc0,`200x03ff,`200xff00,`200x001f
  1035. V,`200xffc0,
  1036. X`20`20`20`200x1fff,`200xff98,`200x1ff0,`200x0ff8,`200x07ff,`200xe007,`200xffe0
  1037. V,`200x3ffc,
  1038. X
  1039. X`20`20`20`200x0203,`200xffff,`200xffff,`200xffc0,`200x01ff,`200xffff,`200xffff
  1040. V,`200xf980,
  1041. X`20`20`20`200x03ff,`200xffff,`200xffff,`200xffc0,`200x03ff,`200xff00,`200x00ff
  1042. V,`200xffc0,
  1043. X`20`20`20`200x1fff,`200xff08,`200x1f80,`200x01f8,`200x03ff,`200xc003,`200xffc0
  1044. V,`200x3ffc,
  1045. X
  1046. X`20`20`20`200x011f,`200xffff,`200xffff,`200xff80,`200x01ff,`200xffff,`200xffff
  1047. V,`200xff80,
  1048. X`20`20`20`200x01ff,`200xffff,`200xffff,`200xff80,`200x01ff,`200xffe0,`200x07ff
  1049. V,`200xff80,
  1050. X`20`20`20`200x1fff,`200xfe18,`200x1e03,`200xc078,`200x0b7e,`200x680b,`200x7e68
  1051. V,`200x1ff8,
  1052. X
  1053. X`20`20`20`200x01ff,`200xffff,`200xffff,`200xff80,`200x00ff,`200xffff,`200xffff
  1054. V,`200xdf00,
  1055. X`20`20`20`200x01ff,`200xffff,`200xffff,`200xff80,`200x01ff,`200xffff,`200xffff
  1056. V,`200xff80,
  1057. X`20`20`20`200x3fff,`200xfc1c,`200x3801,`200xe01c,`200x15f9,`200xd415,`200xf9d4
  1058. V,`200x1bd4,
  1059. X
  1060. X`20`20`20`200x00fb,`200xffff,`200xffff,`200xff00,`200x00ff,`200xffff,`200xffff
  1061. V,`200xff00,
  1062. X`20`20`20`200x00ff,`200xffff,`200xffff,`200xdf00,`200x00ff,`200xffff,`200xffff
  1063. V,`200xdf00,
  1064. X`20`20`20`200x3fff,`200xf83c,`200x3009,`200xf00c,`200x0aae,`200xa80a,`200xaea8
  1065. V,`200x2e2a,
  1066. X
  1067. X`20`20`20`200x00ff,`200xffff,`200xffff,`200xff00,`200x007f,`200xffff,`200xffff
  1068. V,`200xbe00,
  1069. X`20`20`20`200x00ff,`200xffff,`200xffff,`200xff00,`200x00ff,`200xffff,`200xffff
  1070. V,`200xff00,
  1071. X`20`20`20`200x3fff,`200xf03c,`200x200c,`200xf004,`200x0155,`200x4001,`200x5540
  1072. V,`200x17d4,
  1073. X
  1074. X`20`20`20`200x007f,`200xffff,`200xffff,`200xbe00,`200x003f,`200xffff,`200xffff
  1075. V,`200x7c00,
  1076. X`20`20`20`200x007f,`200xffff,`200xffff,`200xbe00,`200x007f,`200xffff,`200xffff
  1077. V,`200xbe00,
  1078. X`20`20`20`200x3fff,`200xf03c,`200x200f,`200xf004,`200x3e1f,`200x0f87,`200xc000
  1079. V,`200x0000,
  1080. X
  1081. X`20`20`20`200x003f,`200xffff,`200xffff,`200x7c00,`200x001f,`200xffff,`200xfff8
  1082. V,`200xf800,
  1083. X`20`20`20`200x003f,`200xffff,`200xffff,`200x7c00,`200x003f,`200xffff,`200xffff
  1084. V,`200x7c00,
  1085. X`20`20`20`200x3fff,`200xf83c,`200x300f,`200xf00c,`200x7f3f,`200x9fcf,`200xe000
  1086. V,`200x03c0,
  1087. X
  1088. X`20`20`20`200x001f,`200xffff,`200xfff8,`200xf800,`200x000f,`200xffff,`200xffe1
  1089. V,`200xf000,
  1090. X`20`20`20`200x001f,`200xffff,`200xfff8,`200xf800,`200x001f,`200xffff,`200xfff8
  1091. V,`200xf800,
  1092. X`20`20`20`200x3fff,`200xfc1c,`200x3807,`200xe01c,`200xffff,`200xfffe,`200xf000
  1093. V,`200x0df0,
  1094. X
  1095. X`20`20`20`200x000f,`200xffff,`200xffe1,`200xf000,`200x0003,`200xffff,`200xff07
  1096. V,`200xa000,
  1097. X`20`20`20`200x000f,`200xffff,`200xffe1,`200xf000,`200x000f,`200xffff,`200xffe1
  1098. V,`200xf000,
  1099. X`20`20`20`200x1fff,`200xfe18,`200x1e03,`200xc078,`200x3fff,`200x3ff8,`200x3000
  1100. V,`200x13f8,
  1101. X
  1102. X`20`20`20`200x0003,`200xffff,`200xff07,`200xa000,`200x0007,`200xffff,`200xf00e
  1103. V,`200x4000,
  1104. X`20`20`20`200x0003,`200xffff,`200xff07,`200xa000,`200x0003,`200xffff,`200xff07
  1105. V,`200xa000,
  1106. X`20`20`20`200x1fff,`200xff08,`200x1f80,`200x01f8,`200x8ffc,`200x7ff1,`200x1ad2
  1107. V,`200x2ffc,
  1108. X
  1109. X`20`20`20`200x0007,`200xffff,`200xf00e,`200x4000,`200x00ab,`200xffff,`200xfc7d
  1110. V,`200xff00,
  1111. X`20`20`20`200x0007,`200xffff,`200xf00e,`200x4000,`200x0007,`200xffff,`200xf00e
  1112. V,`200x4000,
  1113. X`20`20`20`200x1fff,`200xff98,`200x1ff0,`200x0ff8,`200x3fff,`200x3ff8,`200x3000
  1114. V,`200x381c,
  1115. X
  1116. X`20`20`20`200x00ab,`200xffff,`200xfc7d,`200xff00,`200x0155,`200xffff,`200xffe3
  1117. V,`200xd540,
  1118. X`20`20`20`200x00ab,`200xffff,`200xfc7d,`200xff00,`200x00ab,`200xffff,`200xfc7d
  1119. V,`200xff00,
  1120. X`20`20`20`200x0fff,`200xfff0,`200x0fff,`200xfff0,`200xffff,`200xfffe,`200xf000
  1121. V,`200x6186,
  1122. X
  1123. X`20`20`20`200x0155,`200xffff,`200xffe3,`200xd540,`200x02aa,`200xff7f,`200xffcf
  1124. V,`200xaaa0,
  1125. X`20`20`20`200x0155,`200xffff,`200xffe3,`200xd540,`200x0155,`200xffff,`200xffe3
  1126. V,`200xd540,
  1127. X`20`20`20`200x0fff,`200xfff0,`200x0fff,`200xfff0,`200x7f3f,`200x9fcf,`200xe000
  1128. V,`200x42c2,
  1129. X
  1130. X`20`20`20`200x02aa,`200xff7f,`200xffcf,`200xaaa0,`200x0555,`200x5f3f,`200xfc7f
  1131. V,`200x5550,
  1132. X`20`20`20`200x02aa,`200xff7f,`200xffcf,`200xaaa0,`200x02aa,`200xff7f,`200xffcf
  1133. V,`200xaaa0,
  1134. X`20`20`20`200x07ff,`200xff60,`200x07ff,`200xff60,`200x3e1f,`200x0f87,`200xc000
  1135. V,`200x43c2,
  1136. X
  1137. X`20`20`20`200x0555,`200x5f3f,`200xfc7f,`200x5550,`200x0aaa,`200xaff3,`200xcffe
  1138. V,`200xaaa0,
  1139. X`20`20`20`200x0555,`200x5f3f,`200xfc7f,`200x5550,`200x0555,`200x5f3f,`200xfc7f
  1140. V,`200x5550,
  1141. X`20`20`20`200x03ff,`200xfcc0,`200x03ff,`200xfcc0,`200x30c3,`200x0c49,`200x2000
  1142. V,`200x6186,
  1143. X
  1144. X`20`20`20`200x0aaa,`200xaff3,`200xcffe,`200xaaa0,`200x0555,`200x57f8,`200x1ff5
  1145. V,`200x5540,
  1146. X`20`20`20`200x0aaa,`200xaff3,`200xcffe,`200xaaa0,`200x0aaa,`200xaff3,`200xcffe
  1147. V,`200xaaa0,
  1148. X`20`20`20`200x07ff,`200xff68,`200x07ff,`200xff68,`200x79e7,`200x9e33,`200xd000
  1149. V,`200x381c,
  1150. X
  1151. X`20`20`20`200x0555,`200x57f8,`200x1ff5,`200x5540,`200x02aa,`200xaaff,`200xffaa
  1152. V,`200xaa80,
  1153. X`20`20`20`200x0555,`200x57f8,`200x1ff5,`200x5540,`200x0555,`200x57f8,`200x1ff5
  1154. V,`200x5540,
  1155. X`20`20`20`200x15ff,`200xf9d4,`200x15ff,`200xf9d4,`200x3fcf,`200xf349,`200x2000
  1156. V,`200x3ffc,
  1157. X
  1158. X`20`20`20`200x02aa,`200xaaff,`200xffaa,`200xaa80,`200x0055,`200x555f,`200xf555
  1159. V,`200x5500,
  1160. X`20`20`20`200x02aa,`200xaaff,`200xffaa,`200xaa80,`200x02aa,`200xaaff,`200xffaa
  1161. V,`200xaa80,
  1162. X`20`20`20`200x2adf,`200xe3aa,`200x2adf,`200xe3aa,`200x3fcf,`200xf366,`200x6600
  1163. V,`200x1ff8,
  1164. X
  1165. X`20`20`20`200x0055,`200x555f,`200xf555,`200x5500,`200x000a,`200xaaaa,`200xaaaa
  1166. V,`200xa000,
  1167. X`20`20`20`200x0055,`200x555f,`200xf555,`200x5500,`200x0055,`200x555f,`200xf555
  1168. V,`200x5500,
  1169. X`20`20`20`200x157c,`200x3f54,`200x157c,`200x3f54,`200x79e7,`200x9e3c,`200xf900
  1170. V,`200x13d4,
  1171. X
  1172. X`20`20`20`200x000a,`200xaaaa,`200xaaaa,`200xa000,`200x0000,`200x0555,`200x5550
  1173. V,`200x0000,
  1174. X`20`20`20`200x000a,`200xaaaa,`200xaaaa,`200xa000,`200x000a,`200xaaaa,`200xaaaa
  1175. V,`200xa000,
  1176. X`20`20`20`200x0aaf,`200xfaa8,`200x0aaf,`200xfaa8,`200x30c3,`200x0c3c,`200xf900
  1177. V,`200x2a2a,
  1178. X
  1179. X`20`20`20`200x0000,`200x0555,`200x5550,`200x0000,`200x0000,`200x0000,`200x0000
  1180. V,`200x0000,
  1181. X`20`20`20`200x0000,`200x0555,`200x5550,`200x0000,`200x0000,`200x0555,`200x5550
  1182. V,`200x0000,
  1183. X`20`20`20`200x0155,`200x5540,`200x0155,`200x5540,`200x0000,`200x0066,`200x6600
  1184. V,`200x1554
  1185. X`7D;
  1186. X
  1187. Xstatic`20RelativeTokens`09relativeTokens`20=`20`7B
  1188. X`09`7B`20REAR,`09FRONT,`20RIGHT,`20LEFT`20`7D,`09/*`20me`20north,`20him`20`5Bn
  1189. V,`20s,`20e,`20w`5D`20*/
  1190. X`09`7B`20FRONT,`20REAR,`20LEFT,`20RIGHT`20`7D,`09/*`20me`20south,`20him`20`5Bn
  1191. V,`20s,`20e,`20w`5D`20*/
  1192. X`09`7B`20LEFT,`20RIGHT,`20REAR,`20FRONT`20`7D,`09/*`20me`20east`20...`20*/
  1193. X`09`7B`20RIGHT,`20LEFT,`20FRONT,`20REAR`20`7D`09/*`20me`20west`20...`20*/
  1194. X`7D;
  1195. X
  1196. X/*`20
  1197. X`20*`20Initialize`20the`20display`20manager.
  1198. X`20*/
  1199. X
  1200. XInitDisplay(argc,`20argv)
  1201. Xchar`20**argv;
  1202. X`7B
  1203. X`09register`20int`09i;
  1204. X`09register`20RatState`09*rsp;
  1205. X
  1206. X`09for`20(i`20=`200;`20i`20<`20MAXRATS;`20i++)`20`7B
  1207. X`09`09rsp`20=`20`26clearArray`5Bi`5D;
  1208. X`09`09rsp->playing`20=`20FALSE;
  1209. X`09`09rsp->x`20=`201;
  1210. X`09`09rsp->y`20=`201;
  1211. X`09`09rsp->dir`20=`20NORTH;
  1212. X`09`7D
  1213. X
  1214. X`09InitWindow(argc,`20argv);
  1215. X`7D
  1216. X
  1217. X/*
  1218. X`20*`20all`20in`20the`20name`20of`20portability...`20actually`20put`20the`20di
  1219. Vsplay`20on
  1220. X`20*`20the`20screen.`20Some`20window`20systems`20need`20to`20do`20initializati
  1221. Von`20before
  1222. X`20*`20the`20net`20is`20started,`20but`20don't`20want`20to`20display`20until
  1223. V`20after.
  1224. X`20*/
  1225. X
  1226. XStartDisplay()
  1227. X`7B
  1228. X`09StartWindow(ratBits,`20ratBits_width,`20ratBits_height);
  1229. X`7D
  1230. X
  1231. X/*`20
  1232. X`20*`20Manage`20the`20top`20portion`20of`20the`20screen,`20the`20perspective
  1233. V`20view`20of`20the
  1234. X`20*`20maze,`20with`20the`20eyeballs.`20What`20is`20seen`20is`20controlled`20b
  1235. Vy`20the`20position
  1236. X`20*`20in`20the`20maze`20and`20what`20players`20are`20visible.`20This`20latter
  1237. V`20is`20recorded
  1238. X`20*`20in`20the`20R2d2`20array`20(the`20significance`20of`20the`20name`20is
  1239. V`20lost`20to
  1240. X`20*`20history),`20which`20is`20recomputed`20every`20time`20someone`20moves.
  1241. X`20*
  1242. X`20*`20The`20perspective`20view`20is`20calculated`20on`20the`20fly`20from`20th
  1243. Ve`20viewTable`20array.
  1244. X`20*`20viewTable`20contains`20a`20set`20of`2012`20line`20segments`20for`2030
  1245. V`20views.`20The`20longest
  1246. X`20*`20corridor`20is`2030`20spaces,`20and`20for`20each`20cell`20in`20the`20maz
  1247. Ve,`20there`20are`2012
  1248. X`20*`20distinct`20lines`20(wall`20edges)`20that`20could`20be`20visible`20(neve
  1249. Vr`20all`20at`20once).
  1250. X`20*
  1251. X`20*`20Each`20time,`20march`20down`20the`20hall`20in`20the`20direction`20faced
  1252. V`20and`20figure
  1253. X`20*`20out`20which`20lines`20to`20actually`20draw.`20Then`20look`20in`20R2d2
  1254. V`20and`20draw`20in`20opponents.
  1255. X`20*/
  1256. X
  1257. X#define`09NDIR`09NDIRECTION
  1258. Xstatic`20Boolean`09prevEdge3,`20prevEdge7;`09/*`20plotter`20smarts`20*/
  1259. Xstatic`20Boolean`09edge1,`20edge2,`20edge3,`20edge4,`20edge5,`20edge6,`20edge7
  1260. V;
  1261. Xstatic`20XYpair`09edge3Lines`5B2`5D,`20edge7Lines`5B2`5D;
  1262. Xstatic`20XY`09l1Delta`5BNDIR`5D`20=`20`7B`20`7B0,`20-1`7D,`20`7B0,`201`7D,`20
  1263. V`7B1,`200`7D,`20`7B-1,`200`7D`20`7D;
  1264. Xstatic`20XY`09l2Delta`5BNDIR`5D`20=`20`7B`20`7B1,`20-1`7D,`20`7B-1,`201`7D,
  1265. V`20`7B1,`201`7D,`20`7B-1,`20-1`7D`20`7D;
  1266. Xstatic`20XY`09c2Delta`5BNDIR`5D`20=`20`7B`20`7B1,`200`7D,`20`7B-1,`200`7D,`20
  1267. V`7B0,`201`7D,`20`7B0,`20-1`7D`20`7D;
  1268. Xstatic`20XY`09r1Delta`5BNDIR`5D`20=`20`7B`20`7B0,`201`7D,`20`7B0,`20-1`7D,`20
  1269. V`7B-1,`200`7D,`20`7B1,`200`7D`20`7D;
  1270. Xstatic`20XY`09r2Delta`5BNDIR`5D`20=`20`7B`20`7B1,`201`7D,`20`7B-1,`20-1`7D,
  1271. V`20`7B-1,`201`7D,`20`7B1,`20-1`7D`20`7D;
  1272. X#undef`09NDIR
  1273. X
  1274. XShowView(x,`20y,`20dir)
  1275. Xint`09`09x,`20y;
  1276. XDirection`09dir;
  1277. X`7B
  1278. X`09register`20XYpair`09`09*tp`20=`20viewTable;
  1279. X`09register`20int`09`09tx`20=`20x;
  1280. X`09register`20int`09`09ty`20=`20y;
  1281. X`09RatId`09`09`09ratId;
  1282. X`09RatLook`09`09`09ratLook;
  1283. X`09Boolean`09`09`09oldVisible;
  1284. X`09XYpair`09`09`09*hidden(),`20*plotLine();
  1285. X
  1286. X`09ClearView();
  1287. X`09prevEdge3`20=`20prevEdge7`20=`20FALSE;
  1288. X`09while`20(!M.maze`5Btx`5D.y`5Bty`5D)`20`7B
  1289. X`09`09tp`20=`20hidden(tx,`20ty,`20dir,`20tp);`09/*`20draw`20a`20cell`20*/
  1290. X`09`09switch`20(dir)`20`7B
  1291. X`09`09case`20NORTH:`09tx++;`20break;
  1292. X`09`09case`20SOUTH:`09tx--;`20break;
  1293. X`09`09case`20EAST:`09ty++;`20break;
  1294. X`09`09case`20WEST:`09ty--;`20break;
  1295. X`09`09`7D
  1296. X`09`7D
  1297. X`09if`20(prevEdge3)
  1298. X`09`09(void)`20plotLine(edge3Lines,`20TRUE);
  1299. X`09if`20(prevEdge7)
  1300. X`09`09(void)`20plotLine(edge7Lines,`20TRUE);
  1301. X
  1302. X`09/*`20show`20the`20tokens`20*/
  1303. X
  1304. X`09for`20(ratId`20=`200;`20ratId`20<`20MAXRATS;`20ratId++)`20`7B
  1305. X`09`09if`20(ratId`20==`20M.myRatId)
  1306. X`09`09`09continue;
  1307. X`09`09ratLook`20=`20`26R2d2`5BratId`5D;
  1308. X`09`09oldVisible`20=`20ratLook->visible;
  1309. X`09`09TokenVisible(ratId);
  1310. X`09`09if`20(ratLook->visible`20==`20TRUE)
  1311. X`09`09`09XORToken(ratId);
  1312. X`09`09if`20(ratLook->visible`20!=`20oldVisible)
  1313. X`09`09`09UpdateScoreCard(ratId);
  1314. X`09`7D
  1315. X`7D
  1316. X
  1317. XXYpair`09*
  1318. XplotLine(p,`20two)
  1319. XXYpair`09*p;
  1320. XBoolean`09two;
  1321. X`7B
  1322. X`09while`20(1)`20`7B
  1323. X`09`09DrawViewLine(p->p1.x,`20p->p1.y,`20p->p2.x,`20p->p2.y);
  1324. X`09`09p++;
  1325. X`09`09if`20(!two)
  1326. X`09`09`09return`20p;
  1327. X`09`09two`20=`20FALSE;
  1328. X`09`7D
  1329. X`7D
  1330. X
  1331. XXYpair`20*
  1332. Xhidden(x,`20y,`20dir,`20p)
  1333. Xint`09`09x,`20y;
  1334. XDirection`09dir;
  1335. XXYpair`09`09*p;
  1336. X`7B
  1337. X`09int`09l1x,`20l1y,`20l2x,`20l2y;
  1338. X`09int`09r1x,`20r1y,`20r2x,`20r2y;
  1339. X`09int`09c2x,`20c2y;
  1340. X
  1341. X`09/*`20first`20calculate`20the`20coordinates`20of`20the`20neighboring`20cubes
  1342. V`20*/
  1343. X
  1344. X`09l1x`20=`20x`20+`20l1Delta`5Bdir`5D.xcor;`09/*`20find`20left`20cube`20*/
  1345. X`09l1y`20=`20y`20+`20l1Delta`5Bdir`5D.ycor;
  1346. X`09l2x`20=`20x`20+`20l2Delta`5Bdir`5D.xcor;`09/*`20find`20left`20forward`20cub
  1347. Ve`20*/
  1348. X`09l2y`20=`20y`20+`20l2Delta`5Bdir`5D.ycor;
  1349. X`09r1x`20=`20x`20+`20r1Delta`5Bdir`5D.xcor;`09/*`20find`20right`20cube`20*/
  1350. X`09r1y`20=`20y`20+`20r1Delta`5Bdir`5D.ycor;
  1351. X`09r2x`20=`20x`20+`20r2Delta`5Bdir`5D.xcor;`09/*`20find`20right`20forward`20cu
  1352. Vbe`20*/
  1353. X`09r2y`20=`20y`20+`20r2Delta`5Bdir`5D.ycor;
  1354. X`09c2x`20=`20x`20+`20c2Delta`5Bdir`5D.xcor;`09/*`20find`20forward`20cube`20*/
  1355. X`09c2y`20=`20y`20+`20c2Delta`5Bdir`5D.ycor;
  1356. X
  1357. X`09/*`20next`20calculate`20which`20of`20the`207`20possible`20cube`20edges`20ar
  1358. Ve`20visible`20*/
  1359. X
  1360. X`09edge2`20=`20M.maze`5Bc2x`5D.y`5Bc2y`5D;`09/*`20c2`20*/
  1361. X`09edge3`20=`20M.maze`5Bl1x`5D.y`5Bl1y`5D;`09/*`20l1`20*/
  1362. X`09edge4`20=`20!edge3;`09`09`09/*`20!l1`20*/
  1363. X
  1364. X`09edge7`20=`20M.maze`5Br1x`5D.y`5Br1y`5D;`09/*`20r1`20*/
  1365. X`09edge6`20=`20!edge7;`09`09`09/*`20!r1`20*/
  1366. X
  1367. X`09edge1`20=`20edge3`20`26`26`20(edge2`20`7C`7C`20!M.maze`5Bl2x`5D.y`5Bl2y`5D)
  1368. V
  1369. X`09`09`7C`7C`20((!edge2)`20`26`26`20edge4);
  1370. X`09edge5`20=`20edge7`20`26`26`20(edge2`20`7C`7C`20!M.maze`5Br2x`5D.y`5Br2y`5D)
  1371. V
  1372. X`09`09`7C`7C`20((!edge2)`20`26`26`20edge6);
  1373. X
  1374. X`09/*`20
  1375. X`09`20*`20Should`20be`20matching`20the`20following:
  1376. X`09`20*`09x1`20=`20l1`20(c2`20+`20!l2)`20+`20!c2`20!l1
  1377. X`09`20*`09x2`20=`20c2
  1378. X`09`20*`09x3`20=`20l1
  1379. X`09`20*`09x4`20=`20!l1
  1380. X`09`20*`09x5`20=`20r1`20(c2`20+`20!r2)`20+`20!c2`20!r1
  1381. X`09`20*`09x6`20=`20!r1
  1382. X`09`20*`09x7`20=`20r1
  1383. X`09`20*/
  1384. X
  1385. X`09if`20(edge1)
  1386. X`09`09p`20=`20plotLine(p,`20FALSE);
  1387. X`09else
  1388. X`09`09p++;
  1389. X`09if`20(edge2)
  1390. X`09`09p`20=`20plotLine(p,`20TRUE);
  1391. X`09else
  1392. X`09`09p`20+=`202;
  1393. X`09if`20(edge3)`20`7B
  1394. X`09`09if`20(prevEdge3)`20`7B
  1395. X`09`09`09edge3Lines`5B0`5D.p2`20=`20(p++)->p2;
  1396. X`09`09`09edge3Lines`5B1`5D.p2`20=`20p->p2;
  1397. X`09`09`7D`20else`20`7B
  1398. X`09`09`09edge3Lines`5B0`5D`20=`20*p++;
  1399. X`09`09`09edge3Lines`5B1`5D`20=`20*p;
  1400. X`09`09`09prevEdge3`20=`20TRUE;
  1401. X`09`09`7D
  1402. X`09`09p++;
  1403. X`09`7D`20else`20`7B
  1404. X`09`09if`20(prevEdge3)`20`7B
  1405. X`09`09`09(void)`20plotLine(edge3Lines,`20TRUE);
  1406. X`09`09`09prevEdge3`20=`20FALSE;
  1407. X`09`09`7D
  1408. X`09`09p`20+=`202;
  1409. X`09`7D
  1410. X`09if`20(edge4)
  1411. X`09`09p`20=`20plotLine(p,`20TRUE);
  1412. X`09else
  1413. X`09`09p`20+=`202;
  1414. X`09if`20(edge5)
  1415. X`09`09p`20=`20plotLine(p,`20FALSE);
  1416. X`09else
  1417. X`09`09p++;
  1418. X`09if`20(edge6)
  1419. X`09`09p`20=`20plotLine(p,`20TRUE);
  1420. X`09else
  1421. X`09`09p`20+=`202;
  1422. X`09if`20(edge7)`20`7B
  1423. X`09`09if`20(prevEdge7)`20`7B
  1424. X`09`09`09edge7Lines`5B0`5D.p1`20=`20(p++)->p1;
  1425. X`09`09`09edge7Lines`5B1`5D.p1`20=`20p->p1;
  1426. X`09`09`7D`20else`20`7B
  1427. X`09`09`09edge7Lines`5B0`5D`20=`20*p++;
  1428. X`09`09`09edge7Lines`5B1`5D`20=`20*p;
  1429. X`09`09`09prevEdge7`20=`20TRUE;
  1430. X`09`09`7D
  1431. X`09`09p++;
  1432. X`09`7D`20else`20`7B
  1433. X`09`09if`20(prevEdge7)`20`7B
  1434. X`09`09`09(void)`20plotLine(edge7Lines,`20TRUE);
  1435. X`09`09`09prevEdge7`20=`20FALSE;
  1436. X`09`09`7D
  1437. X`09`09p`20+=`202;
  1438. X`09`7D
  1439. X`09return`20p;
  1440. X`7D
  1441. X
  1442. X/*
  1443. X`20*`20sets`20R2d2`5BhisRatId`5D`20variables
  1444. X`20*`20uses`20M.ratcb`5BhisRatId`5D`20as`20input`20for`20his`20position`20and
  1445. V`20direction
  1446. X`20*/
  1447. X
  1448. XTokenVisible(hisRatId)
  1449. XRatId`09hisRatId;
  1450. X`7B
  1451. X`09RatLook`09`09ratLook`20=`20`26R2d2`5BhisRatId`5D;
  1452. X`09RatInfo`09`09ratInfo`20=`20`26M.ratcb.rats`5BhisRatId`5D;
  1453. X`09Loc`09`09tx,`20ty;
  1454. X`09Direction`09td;
  1455. X`09int`09`09ix,`20ix12;
  1456. X
  1457. X`09ratLook->visible`20=`20FALSE;
  1458. X`09if`20(!ratInfo->playing)
  1459. X`09`09return;
  1460. X`09if`20(M.peeking)`20`7B
  1461. X`09`09tx`20=`20M.xPeek;
  1462. X`09`09ty`20=`20M.yPeek;
  1463. X`09`09td`20=`20M.dirPeek;
  1464. X`09`7D`20else`20`7B
  1465. X`09`09tx`20=`20M.xloc;
  1466. X`09`09ty`20=`20M.yloc;
  1467. X`09`09td`20=`20M.dir;
  1468. X`09`7D
  1469. X`09ix`20=`200;
  1470. X`09while`20(!M.maze`5Btx`5D.y`5Bty`5D)`20`7B
  1471. X`09`09switch(td)`20`7B
  1472. X`09`09case`20NORTH:`09tx++;`20break;
  1473. X`09`09case`20SOUTH:`09tx--;`20break;
  1474. X`09`09case`20EAST:`09ty++;`20break;
  1475. X`09`09case`20WEST:`09ty--;`20break;
  1476. X`09`09`7D
  1477. X`09`09ix++;
  1478. X`09`09if`20((tx`20==`20ratInfo->xLoc)`20`26`26`20(ty`20==`20ratInfo->yLoc))
  1479. V`20`7B
  1480. X`09`09`09ratLook->visible`20=`20TRUE;
  1481. X`09`09`09ix12`20=`20ix`20*`2012;
  1482. X`09`09`09ratLook->x`20=`20(viewTable`5Bix12+3`5D.p2.x`20+
  1483. X`09`09`09`09`20`20`20`20`20viewTable`5Bix12+10`5D.p1.x)/2;
  1484. X`09`09`09ratLook->y`20=`20(viewTable`5Bix12+3`5D.p1.y`20+
  1485. X`09`09`09`09`20`20`20`20`20viewTable`5Bix12+3`5D.p2.y)/2;
  1486. X`09`09`09ratLook->tokenId`20=`20relativeTokens`5Btd`5D.t`5BratInfo->dir`5D;
  1487. X`09`09`09ratLook->distance`20=`20ix;
  1488. X`09`09`09break;
  1489. X`09`09`7D
  1490. X`09`7D
  1491. X`7D
  1492. X
  1493. X/*`20
  1494. X`20*`20draw`20him`20into`20the`20maze,`20with`20the`20right`20size`20for`20his
  1495. V`20distance`20away
  1496. X`20*`20and`20facing`20the`20right`20way.
  1497. X`20*/
  1498. X
  1499. XXORToken(hisRatId)
  1500. XRatId`09hisRatId;
  1501. X`7B
  1502. X`09int`09size;
  1503. X`09int`09srcX,`20srcY;
  1504. X
  1505. X`09getRat(hisRatId,`20`26srcX,`20`26srcY,`20`26size);
  1506. X`09DisplayRatBitmap(R2d2`5BhisRatId`5D.x`20-`20size/2,
  1507. X`09`09`09R2d2`5BhisRatId`5D.y`20`20-`20size/2,
  1508. X`09`09`09size,`20size,`20srcX,`20srcY);
  1509. X`7D
  1510. X
  1511. X/*`20
  1512. X`20*`20Dig`20the`20appropriate`20bitmap`20out`20of`20the`20master`20bitmap,
  1513. V`20which`20has`20all
  1514. X`20*`20possible`20views`20neatly`20packed`20into`20place.
  1515. X`20*/
  1516. X
  1517. XgetRat(hisRatId,`20x,`20y,`20size)
  1518. XRatId`09hisRatId;
  1519. Xint`09*x,`20*y,`20*size;
  1520. X`7B
  1521. X`09int`09viewT`20=`20LEFT;
  1522. X`09int`09view`20=`20R2d2`5BhisRatId`5D.tokenId;
  1523. X
  1524. X`09switch`20(R2d2`5BhisRatId`5D.distance)`20`7B
  1525. X`09`09case`201:
  1526. X`09`09`09*size`20=`2064;
  1527. X`09`09`09*x`20=`200;
  1528. X`09`09`09*y`20=`200;
  1529. X`09`09`09for`20(viewT`20=`200;`20viewT`20!=`20view;`20*x`20+=`2064)
  1530. X`09`09`09`09viewT++;
  1531. X`09`09`09return;
  1532. X
  1533. X`09`09case`202:
  1534. X`09`09`09*size`20=`2032;
  1535. X`09`09`09for`20(*x`20=`204*64;`20*x`20!=`2064*5;`20*x`20+=`2032)
  1536. X`09`09`09`09for`20(*y`20=`200;`20*y`20!=`2064;`20*y`20+=`2032)
  1537. X`09`09`09`09`09if`20(viewT`20==`20view)
  1538. X`09`09`09`09`09`09return;
  1539. X`09`09`09`09`09else
  1540. X`09`09`09`09`09`09viewT++;
  1541. X
  1542. X`09`09case`203:
  1543. X`09`09`09*size`20=`2024;
  1544. X`09`09`09for`20(*x`20=`205*64;`20*x`20!=`2064*5+48;`20*x`20+=`2024)
  1545. X`09`09`09`09for`20(*y`20=`200;`20*y`20!=`2048;`20*y`20+=`2024)
  1546. X`09`09`09`09`09if`20(viewT`20==`20view)
  1547. X`09`09`09`09`09`09return;
  1548. X`09`09`09`09`09else
  1549. X`09`09`09`09`09`09viewT++;
  1550. X
  1551. X`09`09case`204:
  1552. X`09`09case`205:
  1553. X`09`09`09*size`20=`2016;
  1554. X`09`09`09*x`20=`2064*5+48;
  1555. X`09`09`09for`20(*y`20=`200;`20*y`20!=`2064;`20*y`20+=`2016)
  1556. X`09`09`09`09if`20(viewT`20==`20view)
  1557. X`09`09`09`09`09return;
  1558. X`09`09`09`09else
  1559. X`09`09`09`09`09viewT++;
  1560. X
  1561. X`09`09case`206:
  1562. X`09`09case`207:
  1563. X`09`09case`208:
  1564. X`09`09`09*size`20=`209;
  1565. X`09`09`09*y`20=`2048;
  1566. X`09`09`09for`20(*x`20=`2064*5;`20*x`20!=`2064*5`20+`204*9;`20*x`20+=`209)
  1567. X`09`09`09`09if`20(viewT`20==`20view)
  1568. X`09`09`09`09`09return;
  1569. X`09`09`09`09else
  1570. X`09`09`09`09`09viewT++;
  1571. X
  1572. X`09`09case`209:
  1573. X`09`09case`2010:
  1574. X`09`09case`2011:
  1575. X`09`09case`2012:
  1576. X`09`09`09*size`20=`206;
  1577. X`09`09`09*y`20=`2048+9;
  1578. X`09`09`09for`20(*x`20=`2064*5;`20*x`20!=`2064*5`20+`204*6;`20*x`20+=`206)
  1579. X`09`09`09`09if`20(viewT`20==`20view)
  1580. X`09`09`09`09`09return;
  1581. X`09`09`09`09else
  1582. X`09`09`09`09`09viewT++;
  1583. X
  1584. X`09`09case`2013:
  1585. X`09`09case`2014:
  1586. X`09`09case`2015:
  1587. X`09`09case`2016:
  1588. X`09`09case`2017:
  1589. X`09`09case`2018:
  1590. X`09`09`09*size`20=`204;
  1591. X`09`09`09*y`20=`2048+9+3;
  1592. X`09`09`09for`20(*x`20=`2064*5`20+`204*6;`20*x`20!=`2064*5`20+4*6`20+`204*4;
  1593. V`20*x`20+=`204)
  1594. X`09`09`09`09if`20(viewT`20==`20view)
  1595. X`09`09`09`09`09return;
  1596. X`09`09`09`09else
  1597. X`09`09`09`09`09viewT++;
  1598. X
  1599. X`09`09default:
  1600. X`09`09`09*size`20=`203;
  1601. X`09`09`09*y`20=`2048+9;
  1602. X`09`09`09for`20(*x`20=`2064*5`20+`204*6;`20*x`20!=`2064*5`20+`204*6`20+`204*3;
  1603. V`20*x`20+=`203)
  1604. X`09`09`09`09if`20(viewT`20==`20view)
  1605. X`09`09`09`09`09return;
  1606. X`09`09`09`09else
  1607. X`09`09`09`09`09viewT++;
  1608. X`09`7D
  1609. X`7D
  1610. X
  1611. X/*`20
  1612. X`20*`20The`20maze`20display.`20This`20is`20controlled`20by`20the`20clearArray
  1613. V`20(another
  1614. X`20*`20historically`20significant`20name,`20I'm`20afraid).`20Each`20player`20h
  1615. Vas`20his
  1616. X`20*`20loaction`20and`20playing`20information`20stored`20here`20as`20well`20as
  1617. V`20in`20M.ratcb.
  1618. X`20*`20This`20is`20to`20tell`20who`20was`20playing`20before`20the`20last`20upd
  1619. Vate/status/location
  1620. X`20*`20packet`20came`20in,`20so`20we`20can`20do`20the`20right`20thing`20for
  1621. V`20adding/deleting`20players.
  1622. X`20*
  1623. X`20*`20There`20are`20various`20hooks`20for`20setting`20the`20contents`20of`20c
  1624. VlearArray
  1625. X`20*`20from`20the`20outside,`20like`20SetMyRatId().
  1626. X`20*/
  1627. X
  1628. XSetMyRatId(ratId)
  1629. XRatId`09ratId;
  1630. X`7B
  1631. X`09clearArray`5BratId`5D.playing`20=`20TRUE;
  1632. X`7D
  1633. X
  1634. X/*`20
  1635. X`20*`20Someone`20joined`20us;`20add`20him`20to`20the`20display.
  1636. X`20*/
  1637. X
  1638. XAddNewPlayer(ratId,`20xloc,`20yloc,`20dir)
  1639. XRatId`09ratId;
  1640. XDirection`20dir;
  1641. X`7B
  1642. X`09clearArray`5BratId`5D.playing`20=`20TRUE;
  1643. X`09clearArray`5BratId`5D.x`20=`20xloc;
  1644. X`09clearArray`5BratId`5D.y`20=`20yloc;
  1645. X`09clearArray`5BratId`5D.dir`20=`20dir;
  1646. X`09DisplayOthersPosition(ratId,`20xloc,`20yloc,`20dir);
  1647. X`09NotifyPlayer();
  1648. X`7D
  1649. X
  1650. X/*
  1651. X`20*`20Someone`20left.
  1652. X`20*/
  1653. XExitPlayer(ratId)
  1654. XRatId`09ratId;
  1655. X`7B
  1656. X`09clearPosition(ratId,`20clearArray`5BratId`5D.x,`20clearArray`5BratId`5D.y);
  1657. V
  1658. X`09clearArray`5BratId`5D.playing`20=`20FALSE;
  1659. X`7D
  1660. X
  1661. X/*`20
  1662. X`20*`20Tell`20the`20display`20controller`20I`20moved.
  1663. X`20*/
  1664. X
  1665. XShowPosition(xloc,`20yloc,`20invincible,`20tdir)
  1666. Xint`09`09xloc,`20yloc;
  1667. XBoolean`09`09invincible;
  1668. XDirection`09tdir;
  1669. X`7B
  1670. X`09clearPosition(M.myRatId,`20clearArray`5BM.myRatId`5D.x,
  1671. X`09`09clearArray`5BM.myRatId`5D.y);
  1672. X`09showMe(xloc,`20yloc,`20invincible,`20tdir);
  1673. X`7D
  1674. X
  1675. X/*`20
  1676. X`20*`20Show`20where`20everybody`20is`20(only`20for`20wizards).
  1677. X`20*/
  1678. X
  1679. XShowAllPositions()
  1680. X`7B
  1681. X`09RatId`09ratId;
  1682. X
  1683. X`09for`20(ratId`20=`200;`20ratId`20<`20MAXRATS;`20ratId++)`20`7B
  1684. X`09`09if`20(ratId`20==`20M.myRatId)
  1685. X`09`09`09continue;
  1686. X`09`09if`20(clearArray`5BratId`5D.playing`20`26`26`20!M.ratcb.rats`5BratId`5D.
  1687. Vplaying)
  1688. X`09`09`09ExitPlayer(ratId);
  1689. X`09`09else`20if`20(!clearArray`5BratId`5D.playing`20`26`26
  1690. X`09`09`09`20M.ratcb.rats`5BratId`5D.playing)
  1691. X`09`09`09AddNewPlayer(ratId,`20M.ratcb.rats`5BratId`5D.xLoc,
  1692. X`09`09`09`09`09`20`20`20`20M.ratcb.rats`5BratId`5D.yLoc,
  1693. X`09`09`09`09`09`20`20`20`20M.ratcb.rats`5BratId`5D.dir);
  1694. X`09`09else`20if`20(clearArray`5BratId`5D.playing)
  1695. X`09`09`09DisplayOthersPosition(ratId,`20M.ratcb.rats`5BratId`5D.xLoc,
  1696. X`09`09`09`09`09`09`20`20`20`20`20M.ratcb.rats`5BratId`5D.yLoc,
  1697. X`09`09`09`09`09`09`20`20`20`20`20M.ratcb.rats`5BratId`5D.dir);
  1698. X`09`7D
  1699. X`7D
  1700. X
  1701. X/*`20
  1702. X`20*`20Someone`20else`20moved;`20update`20his`20info`20and`20display`20the`20n
  1703. Vew`20position.
  1704. X`20*`20Again,`20only`20for`20wizards`20who`20are`20exercising`20their`20powers
  1705. V.
  1706. X`20*/
  1707. X
  1708. XDisplayOthersPosition(ratId,`20xloc,`20yloc,`20dir)
  1709. XRatId`09ratId;
  1710. XDirection`20dir;
  1711. X`7B
  1712. X`09if`20(!clearArray`5BratId`5D.playing`20`26`26`20M.ratcb.rats`5BratId`5D.pla
  1713. Vying)`20`7B
  1714. X`09`09AddNewPlayer(ratId,`20xloc,`20yloc,`20dir);`09/*`20calls`20me`20back`20*
  1715. V/
  1716. X`09`09return;
  1717. X`09`7D
  1718. X`09`09
  1719. X`09clearPosition(ratId,`20clearArray`5BratId`5D.x,`20clearArray`5BratId`5D.y);
  1720. V
  1721. X`09if`20(clearArray`5BratId`5D.playing`20`26`26`20M.omniscient)
  1722. X`09`09showOther(ratId,`20xloc,`20yloc,`20dir);
  1723. X`7D
  1724. X
  1725. X/*`20
  1726. X`20*`20Do`20the`20actual`20work`20of`20showing`20me,`20with`20the`20right`20so
  1727. Vrt`20of`20arrow`20(in
  1728. X`20*`20case`20I'm`20playing`20wizard).
  1729. X`20*/
  1730. X
  1731. XshowMe(xloc,`20yloc,`20invincible,`20dir)
  1732. Xint`09`09xloc,`20yloc;
  1733. XBoolean`09`09invincible;
  1734. XDirection`09dir;
  1735. X`7B
  1736. X`09register`20BitCell`09*bp;
  1737. X`09register`20RatState`09*rsp;
  1738. X
  1739. X`09if`20(invincible)
  1740. X`09`09bp`20=`20invincibleArrows;
  1741. X`09else
  1742. X`09`09bp`20=`20normalArrows;
  1743. X
  1744. X`09HackMazeBitmap(xloc,`20yloc,`20`26bp`5Bdir`5D);
  1745. X
  1746. X`09rsp`20=`20`26clearArray`5BM.myRatId`5D;
  1747. X`09rsp->playing`20=`20TRUE;
  1748. X`09rsp->x`20=`20xloc;
  1749. X`09rsp->y`20=`20yloc;
  1750. X`09rsp->dir`20=`20dir;
  1751. X`09M.invincible`20=`20invincible;
  1752. X`7D
  1753. X
  1754. X/*`20
  1755. X`20*`20Bang`20the`20bits`20to`20show`20the`20other`20guy.
  1756. X`20*/
  1757. X
  1758. XshowOther(ratId,`20xloc,`20yloc,`20dir)
  1759. XDirection`20dir;
  1760. X`7B
  1761. X`09register`20int`09`09i;
  1762. X`09register`20RatState`09*rsp;
  1763. X`09BitCell`09`09`09bits;
  1764. X
  1765. X`09for`20(i`20=`200;`20i`20<`2016;`20i++)
  1766. X`09`09bits.bits`5Bi`5D`20=`20otherArrows`5Bdir`5D.bits`5Bi`5D`20`7C
  1767. X`09`09`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20numbers`5BratId`5D.bits`5Bi
  1768. V`5D;`20
  1769. X
  1770. X`09HackMazeBitmap(xloc,`20yloc,`20`26bits);
  1771. X
  1772. X`09rsp`20=`20`26clearArray`5BratId`5D;
  1773. X`09rsp->playing`20=`20TRUE;
  1774. X`09rsp->x`20=`20xloc;
  1775. X`09rsp->y`20=`20yloc;
  1776. X`09rsp->dir`20=`20dir;
  1777. X`7D
  1778. X
  1779. X/*`20
  1780. X`20*`20When`20someone`20moves`20off`20a`20position,`20clear`20it`20out.`20If
  1781. V`20there's`20someone
  1782. X`20*`20"under"`20him,`20display`20the`20second`20guy.`20
  1783. X`20*/
  1784. X
  1785. XclearPosition(ratId,`20xClear,`20yClear)
  1786. XRatId`09ratId;
  1787. X`7B
  1788. X`09register`20RatState`09*rsp;
  1789. X`09register`20int`09`09i;
  1790. X`09
  1791. X`09clearSquare(xClear,`20yClear);
  1792. X`09for`20(i`20=`200;`20i`20<`20MAXRATS;`20i++)`20`7B
  1793. X`09`09rsp`20=`20`26clearArray`5Bi`5D;
  1794. X`09`09if`20((i`20==`20ratId)`20`7C`7C`20!(rsp->playing))
  1795. X`09`09`09continue;
  1796. X`09`09if`20((rsp->x`20==`20xClear)`20`26`26`20(rsp->y`20==`20yClear))
  1797. X`09`09`09if`20(i`20==`20M.myRatId)
  1798. X`09`09`09`09showMe(rsp->x,`20rsp->y,`20M.invincible,`20rsp->dir);
  1799. X`09`09`09else
  1800. X`09`09`09`09if`20(M.omniscient)
  1801. X`09`09`09`09`09showOther(i,`20rsp->x,`20rsp->y,`20rsp->dir);
  1802. X`09`7D
  1803. X`7D
  1804. X
  1805. Xstatic`20BitCell`20EMPTY`20=`20`7B0,`200,`200,`200,`200,`200,`200,`200,`200,
  1806. V`200,`200,`200,`200,`200,`200,`200`7D;
  1807. X
  1808. X/*`20clear`20out`20a`20square`20of`20the`20maze`20*/
  1809. XclearSquare(xClear,`20yClear)
  1810. X`7B
  1811. X`09HackMazeBitmap(xClear,`20yClear,`20`26EMPTY);
  1812. X`7D
  1813. X
  1814. X/*`20
  1815. X`20*`20Handle`20the`20score`20card`20area.`20Most`20of`20the`20work`20is`20don
  1816. Ve`20in`20window`20system
  1817. X`20*`20dependent`20routines.
  1818. X`20*/
  1819. X
  1820. XNewScoreCard()
  1821. X`7B
  1822. X`09register`20RatId`09ratId;
  1823. X
  1824. X`09for(`20ratId`20=`200;`20ratId`20<`20MAXRATS;`20ratId++)
  1825. X`09`09UpdateScoreCard(ratId);
  1826. X`09if`20(M.omniscient)
  1827. X`09`09ShowAllPositions();
  1828. X`7D
  1829. X
  1830. XUpdateScoreCard(ratId)
  1831. XRatId`09ratId;
  1832. X`7B
  1833. X`09ClearScoreLine(ratId);
  1834. X`09if`20(M.ratcb.rats`5BratId`5D.playing)
  1835. X`09`09WriteScoreString(ratId);
  1836. X`09if`20(R2d2`5BratId`5D.visible`20==`20TRUE)
  1837. X`09`09InvertScoreLine(ratId);
  1838. X`7D
  1839. X
  1840. X/*
  1841. X`20*`20Some`20window`20systems`20(notably`20X10)`20choose`20to`20represent`20b
  1842. Vitmaps`20in
  1843. X`20*`20little-endian`20order.`20That`20is,`20the`20least`20significant`20bit
  1844. V`20in`20the`20word`20is
  1845. X`20*`20the`20leftmost`20bit`20on`20the`20screen.`20This`20means`20that`20bitma
  1846. Vps`20look
  1847. X`20*`20"backwards"`20on`20the`20screen`20from`20the`20way`20they`20look`20in
  1848. V`20source`20code.`20So,`20we
  1849. X`20*`20flip`20them`20all`20here,`20once,`20at`20initialization`20time,`20so
  1850. V`20they`20can`20be`20edited
  1851. X`20*`20"by`20hand".
  1852. X`20*
  1853. X`20*`20It`20is`20up`20to`20the`20window`20system`20initialization`20code`20to
  1854. V`20call`20this,`20if
  1855. X`20*`20deemed`20necessary.
  1856. X`20*
  1857. X`20*`20Hack`20hack.
  1858. X`20*/
  1859. X
  1860. XFlipBitmaps()
  1861. X`7B
  1862. X`09register`20i;
  1863. X
  1864. X`09bitFlip(normalArrows);
  1865. X`09bitFlip(invincibleArrows);
  1866. X`09bitFlip(otherArrows);
  1867. X`09bitFlip(numbers);`09`09/*`20only`20gets`20the`20first`204`20*/
  1868. X`09bitFlip(`26numbers`5B4`5D);`09`09/*`20get`20the`20rest`20*/
  1869. X`09for`20(i`20=`200;`20i`20<`20ratBits_width`20*`20ratBits_height`20/`2016;
  1870. V`20i`20+=`2064)
  1871. X`09`09bitFlip((BitCell`20*)`20`26ratBits`5Bi`5D);
  1872. X`7D
  1873. X
  1874. X/*
  1875. X`20*`20quick`20bit`20flipper`20--`20divide`20and`20conquer`20due`20to`20Jeff
  1876. V`20Mogul.
  1877. X`20*`20unrolled`20to`20do`204`2016`20bit`20words,`20but`20generally`20extensib
  1878. Vle.
  1879. X`20*/
  1880. X
  1881. XbitFlip(bits)
  1882. Xregister`20BitCell`20*bits;
  1883. X`7B
  1884. X`09register`20int`09num,`20top,`20bot,`20i,`20j;
  1885. X
  1886. X`09for`20(i`20=`200;`20i`20<`204;`20i++)`20`7B
  1887. X`09`09for`20(j`20=`200;`20j`20<`2016;`20j++)`20`7B
  1888. X`09`09`09num`20=`20bits->bits`5Bj`5D`20`26`200xffff;
  1889. X`09`09`09top`20=`20num`20`26`200xff00;
  1890. X`09`09`09bot`20=`20num`20`26`200x00ff;
  1891. X`09`09`09top`20>>=`208;
  1892. X`09`09`09bot`20<<=`208;
  1893. X`09`09`09num`20=`20top`7Cbot;
  1894. X
  1895. X`09`09`09top`20=`20num`20`26`200xf0f0;
  1896. X`09`09`09bot`20=`20num`20`26`200x0f0f;
  1897. X`09`09`09top`20>>=`204;
  1898. X`09`09`09bot`20<<=`204;
  1899. X`09`09`09num`20=`20top`7Cbot;
  1900. X
  1901. X`09`09`09top`20=`20num`20`26`200xcccc;
  1902. X`09`09`09bot`20=`20num`20`26`200x3333;
  1903. X`09`09`09top`20>>=`202;
  1904. X`09`09`09bot`20<<=`202;
  1905. X`09`09`09num`20=`20top`7Cbot;
  1906. X
  1907. X`09`09`09top`20=`20num`20`26`200xaaaa;
  1908. X`09`09`09bot`20=`20num`20`26`200x5555;
  1909. X`09`09`09top`20>>=`201;
  1910. X`09`09`09bot`20<<=`201;
  1911. X`09`09`09bits->bits`5Bj`5D`20=`20top`7Cbot;
  1912. X`09`09`7D
  1913. X`09`09bits++;
  1914. X`09`7D
  1915. X`7D
  1916. X
  1917. X
  1918. X/*
  1919. X`20*`20Then`20there`20are`20the`20systems`20that`20are`20perfectly`20happy`20w
  1920. Vith`20MSBFirst`20data,`20but
  1921. X`20*`20byte`20swap`20the`20shorts`20that`20are`20used.`20`20We`20fix`20that
  1922. V`20here.
  1923. X`20*
  1924. X`20*`20The`20htons()`20routine`20is`20a`20defined`20to`20be`20a`20no-op`20on
  1925. V`20machines`20that`20don't`20have
  1926. X`20*`20this`20problem.
  1927. X`20*
  1928. X`20*/
  1929. X
  1930. XSwapBitmaps()
  1931. X`7B
  1932. X`09register`20i;
  1933. X
  1934. X`09byteSwap(normalArrows);
  1935. X`09byteSwap(invincibleArrows);
  1936. X`09byteSwap(otherArrows);
  1937. X`09byteSwap(numbers);`09/*`20only`20gets`20first`204`20*/
  1938. X`09byteSwap(`26numbers`5B4`5D);`09/*`20get`20the`20rest`20*/
  1939. X`09for`20(i`20=`200;`20i`20<`20ratBits_width`20*`20ratBits_height`20/`2016;
  1940. V`20i`20+=`2064)
  1941. X`09`09byteSwap((BitCell`20*)`20`26ratBits`5Bi`5D);
  1942. X`7D
  1943. X
  1944. X/*
  1945. X`20*`20Byte`20swap`204`2016x16`20bitmaps.
  1946. X`20*/
  1947. X
  1948. XbyteSwap(bits)
  1949. Xregister`20BitCell`20*bits;
  1950. X`7B
  1951. X`09register`20int`20i,`20j;
  1952. X`09
  1953. X`09for`20(i`20=`200;`20i`20<`204;`20i++,`20bits++)
  1954. X`09`09for`20(j`20=`200;`20j`20<`2016;`20j++)
  1955. X`09`09`09bits->bits`5Bj`5D`20=`20htons(bits->bits`5Bj`5D`20`26`200xffff);
  1956. X`7D
  1957. $ call unpack [.MAZEWAR]DISPLAY.C;1 1029848417 ""
  1958. $!
  1959. $ create 'f'
  1960. X/*`20$Header:`20init.c,v`201.13`2088/09/07`2014:37:21`20kent`20Exp`20$`20*/
  1961. X
  1962. X/*`20
  1963. X`20*`20init.c`20-`20Initialization`20code`20for`20mazewar
  1964. X`20*`20
  1965. X`20*`20Author:`09Christopher`20A.`20Kent
  1966. X`20*`20`09`09Western`20Research`20Laboratory
  1967. X`20*`09`20`09Digital`20Equipment`20Corporation
  1968. X`20*`20Date:`09Thu`20Oct`20`202`201986
  1969. X`20*/
  1970. X
  1971. X/***********************************************************
  1972. XCopyright`201986`20by`20Digital`20Equipment`20Corporation,`20Maynard,`20Massac
  1973. Vhusetts,
  1974. X
  1975. X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20All
  1976. V`20Rights`20Reserved
  1977. X
  1978. XPermission`20to`20use,`20copy,`20modify,`20and`20distribute`20this`20software
  1979. V`20and`20its`20
  1980. Xdocumentation`20for`20any`20purpose`20and`20without`20fee`20is`20hereby`20gran
  1981. Vted,`20
  1982. Xprovided`20that`20the`20above`20copyright`20notice`20appear`20in`20all`20copie
  1983. Vs`20and`20that
  1984. Xboth`20that`20copyright`20notice`20and`20this`20permission`20notice`20appear
  1985. V`20in`20
  1986. Xsupporting`20documentation,`20and`20that`20the`20names`20of`20Digital`20not
  1987. V`20be
  1988. Xused`20in`20advertising`20or`20publicity`20pertaining`20to`20disstribution`20o
  1989. Vf`20the
  1990. Xsoftware`20without`20specific,`20written`20prior`20permission.`20`20
  1991. X
  1992. XDIGITAL`20DISCLAIMS`20ALL`20WARRANTIES`20WITH`20REGARD`20TO`20THIS`20SOFTWARE,
  1993. V`20INCLUDING
  1994. XALL`20IMPLIED`20WARRANTIES`20OF`20MERCHANTABILITY`20AND`20FITNESS,`20IN`20NO
  1995. V`20EVENT`20SHALL
  1996. XDIGITAL`20BE`20LIABLE`20FOR`20ANY`20SPECIAL,`20INDIRECT`20OR`20CONSEQUENTIAL
  1997. V`20DAMAGES`20OR
  1998. XANY`20DAMAGES`20WHATSOEVER`20RESULTING`20FROM`20LOSS`20OF`20USE,`20DATA`20OR
  1999. V`20PROFITS,
  2000. XWHETHER`20IN`20AN`20ACTION`20OF`20CONTRACT,`20NEGLIGENCE`20OR`20OTHER`20TORTIO
  2001. VUS`20ACTION,
  2002. XARISING`20OUT`20OF`20OR`20IN`20CONNECTION`20WITH`20THE`20USE`20OR`20PERFORMANC
  2003. VE`20OF`20THIS
  2004. XSOFTWARE.
  2005. X
  2006. X******************************************************************/
  2007. X
  2008. X/*
  2009. X`20*`20vms`20port`207/93`20`20scott`20snyder`20<snyder@fnald0.fnal.gov>
  2010. X`20*`20$Log:`09init.c,v`20$
  2011. X`20*`20Revision`201.13`20`2088/09/07`20`2014:37:21`20`20kent
  2012. X`20*`20Portability`20changes`20for`20broadcasts.
  2013. X`20*`20
  2014. X`20*`20Revision`201.12`20`2088/08/25`20`2009:57:53`20`20kent
  2015. X`20*`20Copyright`20and`20changed`20to`20allow`20the`20broadcast`20address`20to
  2016. V`20be`20set`20in`20Makefile.
  2017. X`20*`20
  2018. X`20*`20Revision`201.11`20`2088/06/15`20`2016:36:31`20`20kent
  2019. X`20*`20Updated`20to`20use`20proper`20broadcast`20address.
  2020. X`20*`20
  2021. X`20*`20Revision`201.10`20`2087/07/28`20`2013:51:16`20`20kent
  2022. X`20*`20Fixed`20a`20problem`20in`20netInit();`20didn't`20handle`20the`20case
  2023. V`20when`20gethostname()
  2024. X`20*`20returned`20something`20that`20couldn't`20be`20found`20in`20the`20host
  2025. V`20table.
  2026. X`20*`20
  2027. X`20*`20Revision`201.9`20`2087/03/31`20`2014:42:14`20`20kent
  2028. X`20*`20Portability`20considerations,`20especially`20byteswapping`20to/from`20t
  2029. Vhe`20net.
  2030. X`20*`20
  2031. X`20*`20Revision`201.8`20`2086/12/04`20`2017:48:05`20`20kent
  2032. X`20*`20findDuke's`20return`20value`20pointed`20to`20something`20on`20the`20sta
  2033. Vck!
  2034. X`20*`20
  2035. X`20*`20Revision`201.7`20`2086/12/04`20`2011:16:54`20`20kent
  2036. X`20*`20Handle`20name`20case`20when`20there's`20no`20comma`20in`20the`20gecos
  2037. V`20field.
  2038. X`20*`20
  2039. X`20*`20Revision`201.6`20`2086/12/04`20`2011:14:23`20`20kent
  2040. X`20*`20Clean`20up`20join,`20so`20you`20can`20specify`20any`20host`20in`20a`20g
  2041. Vame,`20not`20just`20the`20duke.
  2042. X`20*`20
  2043. X`20*`20Revision`201.5`20`2086/12/03`20`2013:31:25`20`20kent
  2044. X`20*`20
  2045. X`20*`20
  2046. X`20*`20Revision`201.4`20`2086/12/03`20`2010:00:45`20`20kent
  2047. X`20*`20Changes`20to`20allow`20multiple`20players`20per`20machine.
  2048. X`20*`20
  2049. X`20*`20Revision`201.3`20`2086/12/01`20`2023:44:25`20`20kent
  2050. X`20*`20Housecleaning`20and`20documentation`20pass.
  2051. X`20*`20
  2052. X`20*`20Revision`201.2`20`2086/12/01`20`2014:48:17`20`20kent
  2053. X`20*`20Changes`20for`20a`20realistic`20implementation`20of`20shooting.
  2054. X`20*`20
  2055. X`20*`20Revision`201.1`20`2086/11/26`20`2016:57:42`20`20kent
  2056. X`20*`20Initial`20revision
  2057. X`20*`20
  2058. X`20*/
  2059. X
  2060. X#ifndef`09lint
  2061. Xstatic`20char`20rcs_ident`5B`5D`20=`20"$Header:`20init.c,v`201.13`2088/09/07
  2062. V`2014:37:21`20kent`20Exp`20$";
  2063. X#endif
  2064. X
  2065. X#include`20<sys/types.h>
  2066. X#include`20<sys/socket.h>
  2067. X#include`20<sys/time.h>
  2068. X
  2069. X#include`20<netinet/in.h>
  2070. X
  2071. X#include`20<errno.h>
  2072. X#include`20<netdb.h>
  2073. X#include`20<stdio.h>
  2074. X#ifndef`20VMS
  2075. X#include`20<pwd.h>
  2076. X#include`20<string.h>
  2077. X#endif
  2078. X
  2079. X#include`20"mazewar.h"
  2080. X
  2081. Xint`09RV`5BVECTORSIZE`5D`20=`20`7B
  2082. X`090031575,`200055455,`200147160,`200176745,`200173126,`200117426,`200033612,
  2083. V`200136020,
  2084. X`090054013,`200167672,`200070252,`200033100,`200015700,`200113523,`200170465,
  2085. V`200024344,
  2086. X`090175535,`200137325,`200126211,`200010207,`200173547,`200016071,`200056622,
  2087. V`200014433,
  2088. X`090113225,`200047553,`200103024,`200110174,`200000124,`200173304,`200076700,
  2089. V`200104042,
  2090. X`090135030,`200126234,`200175154,`200140123,`200167542,`200000405,`200035464,
  2091. V`200166537,
  2092. X`090050260,`200167655,`200123715,`200176164,`200172206,`200140365,`200074606,
  2093. V`200075656,
  2094. X`090176163,`200030017,`200022102,`200040051,`200154620,`200017144,`200073372
  2095. X`7D;
  2096. X
  2097. Xstatic`20MazeType`20mazeBits`20=`20`7B
  2098. X`09`7B`201,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1`7D,`09/*`200`20*/
  2099. X`09`7B`201,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1`7D,
  2100. X`09`7B`201,0,1,1,1,1,1,0,1,1,1,1,0,1,1,1`7D,
  2101. X`09`7B`201,0,0,0,0,0,1,0,1,0,0,0,0,0,0,1`7D,
  2102. X
  2103. X`09`7B`201,0,1,0,1,0,0,0,1,0,1,1,1,1,0,1`7D,`09/*`201`20*/
  2104. X`09`7B`201,0,1,1,1,0,1,0,1,0,1,0,0,0,0,1`7D,
  2105. X`09`7B`201,0,0,0,0,0,1,0,0,0,1,0,1,1,0,1`7D,
  2106. X`09`7B`201,1,1,1,1,0,1,1,1,0,0,0,0,0,0,1`7D,
  2107. X
  2108. X`09`7B`201,0,0,0,0,0,0,0,1,0,1,1,1,1,0,1`7D,`09/*`202`20*/
  2109. X`09`7B`201,0,1,1,1,1,1,0,1,0,1,0,0,0,0,1`7D,
  2110. X`09`7B`201,0,0,0,0,0,1,0,0,0,1,0,1,1,1,1`7D,
  2111. X`09`7B`201,0,1,1,1,0,1,0,1,0,1,0,0,0,0,1`7D,
  2112. X
  2113. X`09`7B`201,0,0,0,0,0,1,0,1,0,1,1,1,1,0,1`7D,`09/*`203`20*/
  2114. X`09`7B`201,0,1,1,1,1,1,0,1,0,1,1,0,1,0,1`7D,
  2115. X`09`7B`201,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1`7D,
  2116. X`09`7B`201,0,1,1,1,1,1,1,1,0,1,0,1,1,1,1`7D,
  2117. X
  2118. X`09`7B`201,0,0,0,1,0,0,0,0,0,1,0,0,0,0,1`7D,`09/*`204`20*/
  2119. X`09`7B`201,1,1,0,1,0,1,0,1,0,1,0,1,1,0,1`7D,
  2120. X`09`7B`201,0,0,0,1,0,1,0,1,0,1,0,0,1,0,1`7D,
  2121. X`09`7B`201,0,1,1,1,0,1,0,1,0,1,1,0,0,0,1`7D,
  2122. X
  2123. X`09`7B`201,0,0,0,0,0,0,0,1,0,1,0,0,1,0,1`7D,`09/*`205`20*/
  2124. X`09`7B`201,0,1,1,1,1,1,1,1,0,1,0,1,1,0,1`7D,
  2125. X`09`7B`201,0,0,0,1,0,0,0,1,0,1,0,0,1,0,1`7D,
  2126. X`09`7B`201,0,1,0,1,0,1,0,1,0,1,1,0,0,0,1`7D,
  2127. X
  2128. X`09`7B`201,0,1,0,1,0,1,0,1,0,0,0,0,1,0,1`7D,`09/*`206`20*/
  2129. X`09`7B`201,0,1,0,1,0,1,0,1,0,1,0,1,1,0,1`7D,
  2130. X`09`7B`201,0,1,0,1,0,1,0,1,0,1,0,0,1,0,1`7D,
  2131. X`09`7B`201,0,1,0,0,0,1,0,1,0,1,1,0,1,0,1`7D,
  2132. X
  2133. X`09`7B`201,0,1,0,1,0,1,0,0,0,1,0,0,0,0,1`7D,`09/*`207`20*/
  2134. X`09`7B`201,0,1,0,1,0,1,0,1,0,1,1,1,1,0,1`7D,
  2135. X`09`7B`201,0,0,0,1,0,0,0,1,0,0,0,0,1,0,1`7D,
  2136. X`09`7B`201,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1`7D
  2137. X`7D;
  2138. X
  2139. Xstatic`20char`09*ratName`20=`20NULL;
  2140. Xstatic`20char`09*dukeName`20=`20NULL;
  2141. Xstatic`20Sockaddr`09dukeAddr;
  2142. X
  2143. XSockaddr`09*resolveHost();
  2144. X
  2145. Xextern`20int`09errno;
  2146. X
  2147. XMazeInit(argc,`20argv)
  2148. Xchar`09**argv;
  2149. X`7B
  2150. X`09register`20RatId`09ratId;
  2151. X
  2152. X`09for`20(ratId`20=`200;`20ratId`20<`20MAXRATS;`20ratId++)`20`7B
  2153. X`09`09bzero((char`20*)`20M.ratcb.rats`5BratId`5D.name,`20NAMESIZE);
  2154. X`09`09M.ratcb.rats`5BratId`5D.playing`20=`20FALSE;
  2155. X`09`09R2d2`5BratId`5D.visible`20=`20FALSE;
  2156. X`09`7D
  2157. X`09M.invincible`20=`20FALSE;
  2158. X`09M.omniscient`20=`20FALSE;
  2159. X`09RatKillQ`20=`20(RatKillQ_t)`20NULL;
  2160. X
  2161. X`09getMaze();
  2162. X
  2163. X`09setRandom();
  2164. X`09InitRandom();
  2165. X
  2166. X`09InitDisplay(argc,`20argv);
  2167. X`09getNames();
  2168. X`09NewPosition();
  2169. X
  2170. X`09/*
  2171. X`09`20*`20We`20don't`20do`20ShowPosition()`20or`20ShowView()`20here,`20but`20l
  2172. Vet`20the`20update
  2173. X`09`20*`20routine`20in`20the`20window`20handler`20do`20it`20for`20the`20first
  2174. V`20time`20when
  2175. X`09`20*`20the`20window`20is`20exposed.
  2176. X`09`20*/
  2177. X
  2178. X`09netInit();
  2179. X`09StartDisplay();
  2180. X`09RatCursor();
  2181. X`7D
  2182. X
  2183. X/*`20get`20the`20maze`20into`20memory`20*/
  2184. XgetMaze()
  2185. X`7B
  2186. X`09int`20i,`20j;
  2187. X
  2188. X`09for`20(i`20=`200;`20i`20<`20MAZEXMAX;`20i++)
  2189. X`09`09for`20(j`20=`200;`20j`20<`20MAZEYMAX;`20j++)
  2190. X`09`09`09if`20(mazeBits`5Bi`5D.y`5BMAZEYMAX-1`20-`20j`5D`20==`201)
  2191. X`09`09`09`09M.maze`5Bi`5D.y`5Bj`5D`20=`20TRUE;
  2192. X`09`09`09else
  2193. X`09`09`09`09M.maze`5Bi`5D.y`5Bj`5D`20=`20FALSE;
  2194. X`7D
  2195. X
  2196. X/*`20initialize`20the`20random`20vector`20*/
  2197. XsetRandom()
  2198. X`7B
  2199. X`09register`09i;
  2200. X
  2201. X`09for`20(i`20=`200;`20i`20<`20VECTORSIZE;`20i++)
  2202. X`09`09M.randomVector`5Bi`5D`20=`20RV`5Bi`5D;
  2203. X`7D
  2204. X
  2205. X/*`20get`20player`20and`20duke`20host`20names`20*/
  2206. XgetNames()
  2207. X`7B
  2208. X`09char`09`09buf`5B128`5D,`20*cp;
  2209. X`09char`09`09*comma;
  2210. X`09Sockaddr`09*duke;
  2211. X`09char`09`09*getenv();
  2212. X`09struct`20passwd`09*getpwuid();
  2213. X
  2214. X`09buf`5B0`5D`20=`20'`5C0';
  2215. X`09printf("Welcome`20to`20Alto`20MazeWar!`5Cn`5Cn");
  2216. X`09printf("Your`20Name:`20");
  2217. X`09gets(buf);
  2218. X`09if`20(buf`5B0`5D`20==`20'`5C0')`20`7B
  2219. X`09`09if`20((cp`20=`20getenv("USERNAME"))`20!=`20NULL)
  2220. X`09`09`09strcpy(buf,`20cp);
  2221. X`09`09else`20if`20((cp`20=`20getenv("USER"))`20!=`20NULL)
  2222. X`09`09`09strcpy(buf,`20cp);
  2223. X`09`09else`20`7B
  2224. X#ifdef`20VMS
  2225. X`09`09`20`20`20`20`20`20`20`20strcpy`20(buf,`20"Whozit?");
  2226. X#else
  2227. X`09`09`09strcpy(buf,`20(getpwuid(getuid()))->pw_gecos);
  2228. X`09`09`09comma`20=`20index(buf,`20',');
  2229. X`09`09`09if`20(comma`20!=`20NULL)
  2230. X`09`09`09`09*comma`20=`20'`5C0';
  2231. X#endif
  2232. X`09`09`7D
  2233. X`09`7D
  2234. X`09ratName`20=`20malloc((unsigned)`20(strlen(buf)`20+`201));
  2235. X`09if`20(ratName`20==`20NULL)
  2236. X`09`09MWError("no`20mem`20for`20ratName");
  2237. X`09strcpy(ratName,`20buf);
  2238. X`09for`20(duke`20=`20NULL;`20duke`20==`20NULL;`20)`20`7B
  2239. X#ifndef`09NO_BROADCAST
  2240. X`09`09printf("Duke`20Host`20(CR`20for`20any`20game):`20");
  2241. X#else
  2242. X`09`09printf("Duke`20Host:`20");
  2243. X#endif`09NO_BROADCAST
  2244. X`09`09gets(buf);
  2245. X`09`09if`20(strlen(buf)`20==`200)
  2246. X`09`09`09break;
  2247. X`09`09dukeName`20=`20malloc((unsigned)`20(strlen(buf)`20+`201));
  2248. X`09`09if`20(dukeName`20==`20NULL)
  2249. X`09`09`09MWError("no`20mem`20for`20dukeName");
  2250. X`09`09strcpy(dukeName,`20buf);
  2251. X
  2252. X`09`09/*`20check`20for`20valid`20duke`20name`20*/
  2253. X`09`09duke`20=`20resolveHost(dukeName);
  2254. X`09`09if`20(duke`20==`20(Sockaddr`20*)`20NULL)`20`7B
  2255. X`09`09`09printf("Don't`20know`20host`20%s`5Cn",`20dukeName);
  2256. X`09`09`09free(dukeName);
  2257. X`09`09`09dukeName`20=`20NULL;
  2258. X`09`09`7D
  2259. X`09`7D
  2260. X`09if`20((dukeName`20!=`20NULL)`20`26`26
  2261. X`09`20`20`20`20(strlen(dukeName)`20!=`200))
  2262. X`09`09bcopy((char`20*)`20duke,`20(char`20*)`20`26dukeAddr,`20sizeof(Sockaddr))
  2263. V;
  2264. X`7D
  2265. X
  2266. XnetInit()
  2267. X`7B
  2268. X`09register`20RatId`09ratId;
  2269. X`09Boolean`09`09joinGame();
  2270. X`09struct`20servent`09*mazeService;
  2271. X`09u_short`09`09port;
  2272. X`09Sockaddr`09nullAddr;
  2273. X`09Sockaddr`09*thisHost;
  2274. X`09char`09`09buf`5B128`5D;
  2275. X
  2276. X`09mazeService`20=`20getservbyname(MAZESERVICE,`20"udp");
  2277. X`09if`20(mazeService`20!=`20(struct`20servent`20*)`20NULL)
  2278. X`09`09M.mazePort`20=`20mazeService->s_port;
  2279. X`09else
  2280. X`09`09M.mazePort`20=`20htons(MAZEPORT);
  2281. X
  2282. X`09gethostname(buf,`20sizeof(buf));
  2283. X`09if`20((thisHost`20=`20resolveHost(buf))`20==`20(Sockaddr`20*)`20NULL)
  2284. X`09`09MWError("who`20am`20I?");
  2285. X`09bcopy((caddr_t)`20thisHost,`20(caddr_t)`20`26M.myAddr,`20sizeof(Sockaddr));
  2286. V
  2287. X`09nullAddr`20=`20M.myAddr;
  2288. X`09bzero((char`20*)`26nullAddr.sin_addr,`20sizeof(nullAddr.sin_addr));
  2289. X
  2290. X`09/*`20
  2291. X`09`20*`20Figure`20out`20which`20port`20I`20can`20use.`20Start`20at`20MAZEPORT
  2292. V`20and`20go
  2293. X`09`20*`20up`20till`20there's`20a`20free`20one.`20We`20use`20nullAddr`20so`20t
  2294. Vhat`20we
  2295. X`09`20*`20can`20receive`20any`20incoming`20packet,`20in`20case`20there's`20som
  2296. Ve
  2297. X`09`20*`20multi-homed`20nonsense.`20However,`20not`20binding`20may`20cause`20t
  2298. Vroubles
  2299. X`09`20*`20if`20a`20specified`20duke`20is`20on`20a`20net`20that`20causes`20the
  2300. V`20source`20of`20the
  2301. X`09`20*`20packets`20to`20be`20something`20other`20than`20what`20M.myAddr`20is.
  2302. V..
  2303. X`09`20*`20There`20also`20seems`20to`20be`20a`20problem`20with`20broadcasts`20n
  2304. Vot`20being
  2305. X`09`20*`20accepted`20on`20sockets`20that`20have`20an`20address`20bound`20to
  2306. V`20them.
  2307. X`09`20*/
  2308. X
  2309. X`09M.theSocket`20=`20socket(AF_INET,`20SOCK_DGRAM,`200);
  2310. X`09if`20(M.theSocket`20<`200)
  2311. X`09`09MWError("can't`20get`20socket");
  2312. X
  2313. X`09for`20(port`20=`20ntohs(M.mazePort);`20;`20port++)`20`7B
  2314. X`09`09nullAddr.sin_port`20=`20htons(port);
  2315. X`09`09if`20(bind(M.theSocket,`20`26nullAddr,`20sizeof(nullAddr))`20<`200)
  2316. X#ifdef`20VMS
  2317. X`09`09`09if`20(socket_errno`20!=`20EADDRINUSE)
  2318. X#else
  2319. X`09`09`09if`20(errno`20!=`20EADDRINUSE)
  2320. X#endif
  2321. X`09`09`09`09MWError("netInit`20binding");
  2322. X`09`09`09else
  2323. X`09`09`09`09continue;
  2324. X`09`09else
  2325. X`09`09`09break;
  2326. X`09`7D
  2327. X`09M.myAddr.sin_port`20=`20nullAddr.sin_port;
  2328. X
  2329. X`09/*
  2330. X`09`20*`20Now`20we`20can`20try`20to`20find`20a`20game`20to`20join;`20if`20none
  2331. V,`20start`20one.
  2332. X`09`20*/
  2333. X
  2334. X`09if`20(!joinGame())
  2335. X`09`09startGame();
  2336. X`09printf("`5Cn");
  2337. X
  2338. X`09for`20(ratId`20=`200;`20ratId`20<`20MAXRATS;`20ratId++)
  2339. X`09`09TokenVisible(ratId);`09/*`20oh`20oh`20say`20can`20we`20see?`20*/
  2340. X
  2341. X`7D
  2342. X
  2343. X/*`20
  2344. X`20*`20Find`20a`20game.`20If`20the`20user`20specified`20a`20"duke"`20host,`20c
  2345. Vontact`20that
  2346. X`20*`20duke.`20Otherwise`20broadcast`20to`20find`20a`20duke.`20Finally`20join
  2347. V`20that`20game.
  2348. X`20*/
  2349. X
  2350. XBoolean
  2351. XjoinGame()
  2352. X`7B
  2353. X`09Sockaddr`09*duke,`20*findDuke();
  2354. X`09Boolean`09`09join();
  2355. X
  2356. X`09if`20((dukeName`20==`20NULL)`20`7C`7C
  2357. X`09`20`20`20`20(strlen(dukeName)`20==`200))`20`7B
  2358. X`09`09duke`20=`20findDuke();
  2359. X`09`09if`20(duke`20!=`20NULL)
  2360. X`09`09`09bcopy((char`20*)`20duke,`20(char`20*)`20`26dukeAddr,
  2361. X`09`09`09`09sizeof(Sockaddr));
  2362. X`09`09else
  2363. X`09`09`09return`20FALSE;
  2364. X`09`7D`20else
  2365. X`09`09dukeAddr.sin_port`20=`20M.mazePort;
  2366. X`09return`20join(dukeAddr);
  2367. X`7D
  2368. X
  2369. X/*`20
  2370. X`20*`20No`20game`20to`20join;`20set`20ourselves`20up`20as`20duke`20and`20wait
  2371. V`20for`20others`20to`20join.
  2372. X`20*/
  2373. X
  2374. XstartGame()
  2375. X`7B
  2376. X`09RatId`09i;
  2377. X`09RatInfo`09`09rsp;
  2378. X
  2379. X`09printf("starting`20a`20new`20game");
  2380. X`09M.myRatId`20=`200;
  2381. X`09M.score`20=`200;
  2382. X`09SetMyRatId(0);
  2383. X`09M.ratcb.dukeRat`20=`20M.myRatId;
  2384. X`09M.ratcb.rats`5BM.myRatId`5D.addr`20=`20M.myAddr;
  2385. X`09rsp`20=`20`26M.ratcb.rats`5BM.myRatId`5D;
  2386. X`09rsp->playing`20=`20TRUE;
  2387. X`09rsp->xLoc`20=`20M.xloc;
  2388. X`09rsp->yLoc`20=`20M.yloc;
  2389. X`09rsp->dir`20=`20M.dir;
  2390. X`09rsp->score`20=`20M.score;
  2391. X`09rsp->addr`20=`20M.myAddr;
  2392. X`09strncpy(rsp->name,`20ratName,`20NAMESIZE);
  2393. X`09for`20(i`20=`201;`20i`20<`20MAXRATS;`20i++)
  2394. X`09`09M.ratcb.rats`5Bi`5D.playing`20=`20FALSE;
  2395. X`09M.duke`20=`20TRUE;
  2396. X`7D
  2397. X
  2398. X/*`20
  2399. X`20*`20Join`20an`20existing`20game.`20Send`20a`20RAT_NEW`20packet`20and`20wait
  2400. V`20for`20a
  2401. X`20*`20RAT_STATUS`20packet`20to`20come`20back`20with`20the`20other`20players.
  2402. V`20
  2403. X`20*/
  2404. X
  2405. XBoolean
  2406. Xjoin(addr)
  2407. XSockaddr`20addr;
  2408. X`7B
  2409. X`09RatPacket`09b,`20r;
  2410. X`09RatNew`09`09ratNew;
  2411. X`09RatId`09`09id;
  2412. X`09RatStatus`09status;
  2413. X`09int`09`09i,`20ret;
  2414. X`09fd_set`09`09fds;
  2415. X`09struct`20timeval`09timeout;
  2416. X`09Boolean`09`09retVal`20=`20FALSE;
  2417. X`09
  2418. X`09b.type`20=`20RAT_NEW;
  2419. X`09ratNew`20=`20(RatNew)`20`26b.body;
  2420. X`09ratNew->pass`20=`20RAT_PASSWORD;
  2421. X`09ratNew->xLoc`20=`20M.xloc;
  2422. X`09ratNew->yLoc`20=`20M.yloc;
  2423. X`09ratNew->dir`20=`20M.dir;
  2424. X`09ratNew->addr`20=`20M.myAddr;
  2425. X`09strncpy(ratNew->name,`20ratName,`20NAMESIZE);
  2426. X`09free(ratName);
  2427. X`09ConvertOutgoing(`26b);
  2428. X
  2429. X`09for`20(i`20=`200;`20i`20<`205;`20i++)`20`7B
  2430. X`09`09int`20fromlen;
  2431. X`09`09struct`20sockaddr`20from;
  2432. X
  2433. X`09`09if`20(sendto(M.theSocket,`20(char`20*)`20`26b,`20sizeof(b),`200,`20`26ad
  2434. Vdr,
  2435. X`09`09`09`20`20`20sizeof(addr))`20<`200)
  2436. X`09`09`09MWError("join`20sendto");
  2437. X`09`09FD_ZERO`20(`26fds);
  2438. X`09`09FD_SET`20(M.theSocket,`20`26fds);
  2439. X`09`09timeout.tv_sec`20=`205;
  2440. X`09`09timeout.tv_usec`20=`200;
  2441. X`09`09ret`20=`20select(FD_SETSIZE,`20`26fds,`20NULL,`20NULL,`20`26timeout);
  2442. X`09`09if`20(ret`20<`200)
  2443. X`09`09`09MWError("join`20select");
  2444. X`09`09if`20(ret`20==`200)
  2445. X`09`09`09continue;
  2446. X`09`09if`20(recvfrom(M.theSocket,`20(char`20*)`20`26r,`20sizeof(r),
  2447. X`09`09`09`090,`20`26from,`20`26fromlen)`20<`200)
  2448. X`09`09`09MWError("join`20status`20receive");
  2449. X`09`09ConvertIncoming(`26r);
  2450. X`09`09if`20(r.type`20!=`20RAT_STATUS)
  2451. X`09`09`09continue;
  2452. X
  2453. X`09`09/*`20see`20if`20I`20got`20into`20the`20game`20*/
  2454. X`09`09status`20=`20`26r.body;
  2455. X`09`09for`20(id`20=`200;`20id`20<`20MAXRATS;`20id++)
  2456. X`09`09`09if`20(status->rats`5Bid`5D.playing`20`26`26
  2457. X`09`09`09`20`20`20`20!bcmp(`26status->rats`5Bid`5D.addr,`20`26M.myAddr,
  2458. X`09`09`09`09`20`20sizeof(M.myAddr)))`20`7B
  2459. X`09`09`09`09M.myRatId`20=`20id;
  2460. X`09`09`09`09break;
  2461. X`09`09`09`7D
  2462. X
  2463. X`09`09/*`20
  2464. X`09`09`20*`20Didn't`20find`20me;`20this`20guy`20must`20not`20really`20be`20the
  2465. V
  2466. X`09`09`20*`20duke.`20Contact`20the`20duke`20of`20the`20game`20and`20get`20adde
  2467. Vd.
  2468. X`09`09`20*/
  2469. X
  2470. X`09`09if`20(id`20==`20MAXRATS)`20`7B
  2471. X`09`09`09addr`20=`20status->rats`5Bstatus->dukeRat`5D.addr;
  2472. X`09`09`09continue;
  2473. X`09`09`7D
  2474. X`09`09
  2475. X`09`09bcopy((char`20*)`20status,`20(char`20*)`20`26M.ratcb,`20sizeof(RatCb));
  2476. X`09`09retVal`20=`20TRUE;
  2477. X`09`09break;
  2478. X`09`7D
  2479. X`09return`20retVal;
  2480. X`7D
  2481. X
  2482. X/*`20
  2483. X`20*`20Find`20a`20"duke"`20host.`20Broadcast`20a`20RAT_SURVEY`20packet`20to
  2484. V`20MAZEPORT.
  2485. X`20*
  2486. X`20*`20The`20broadcast`20is`20done`20just`20on`20the`20network`20that`20is`20a
  2487. Vssociated
  2488. X`20*`20with`20the`20name`20returned`20by`20gethostname();`20for`20most`20works
  2489. Vtations
  2490. X`20*`20this`20is`20accurate,`20but`20multi-homed`20hosts`20may`20miss`20some
  2491. V`20games.`20Oh
  2492. X`20*`20well.
  2493. X`20*
  2494. X`20*`20After`20the`20broadcast,`20collect`20responses.`20This`20goes`20on`20un
  2495. Vtil`20no`20packets
  2496. X`20*`20have`20been`20received`20for`205`20seconds`20or`20the`20max`20number
  2497. V`20have`20been`20seen
  2498. X`20*
  2499. X`20*`20All`20players`20are`20supposed`20to`20respond.`20If`20a`20packet`20come
  2500. Vs`20from`20a`20non-duke,
  2501. X`20*`20the`20information`20is`20inspected`20to`20send`20a`20RAT_SURVEY`20direc
  2502. Vtly`20to`20him.
  2503. X`20*`20Otherwise,`20the`20answer`20is`20saved.`20When`20all`20the`20answers
  2504. V`20are`20in,`20the
  2505. X`20*`20first`20game`20with`20an`20empty`20slot`20is`20chosen.
  2506. X`20*
  2507. X`20*`20If`20all`20players`20were`20listening`20on`20MAZEPORT,`20we`20could`20p
  2508. Vrobably`20do
  2509. X`20*`20without`20the`20resending`20nonsense.`20Since`20the`20duke`20might`20no
  2510. Vt`20be`20on
  2511. X`20*`20MAZEPORT,`20this`20is`20necessary.`20It`20also`20adds`20a`20certain`20r
  2512. Vobustness,`20in
  2513. X`20*`20case`20the`20duke`20drops`20the`20packet`20or`20somesuch.`20Care`20is
  2514. V`20taken`20elsewhere
  2515. X`20*`20(ratLeft()`20and`20ratDoctor())to`20make`20sure`20there`20are`20always
  2516. V`20players
  2517. X`20*`20listening`20on`20MAZEPORT.
  2518. X`20*/
  2519. X
  2520. Xstruct`20answer`20`7B
  2521. X`09Sockaddr`09source;
  2522. X`09int`09`09srclen;
  2523. X`09RatPacket`09packet;
  2524. X`7D;
  2525. X
  2526. XSockaddr`20*
  2527. XfindDuke()
  2528. X`7B
  2529. X#ifndef`09NO_BROADCAST
  2530. X`09register`20int`09i;
  2531. X`09int`09`09cnt`20=`200;
  2532. X`09int`09`09maxAnswers`20=`2010;
  2533. X`09static`20Sockaddr`09rmtAddr;
  2534. X`09struct`09timeval`09timeout;
  2535. X`09RatPacket`09*b`20=`20(RatPacket`20*)`20malloc(sizeof(RatPacket));
  2536. X`09struct`20answer`09*answers;
  2537. X`09int`09`09fd`20=`20M.theSocket;
  2538. X`09fd_set`20`20`20`20`20`20`20`20`20`20fds;
  2539. X`09int`09`09ret,`20cc;
  2540. X`09Boolean`09`09duke(),`20freeSlot();
  2541. X`09u_long`09`09inet_makeaddr();
  2542. X
  2543. X`09printf("Checking`20out`20available`20games...");`20fflush(stdout);
  2544. X
  2545. X#ifdef`09SO_BROADCAST
  2546. X#ifdef`09BSD_43
  2547. X`09`7B
  2548. X`09int`09one`20=`201;
  2549. X
  2550. X`09if`20(setsockopt(M.theSocket,`20SOL_SOCKET,`20SO_BROADCAST,`20
  2551. X`09`09`09`09`26one,`20sizeof`20one)`20<`200)
  2552. X`09`09MWError("can't`20get`20broadcast`20permission");
  2553. X`09`7D
  2554. X#else`09BSD_43
  2555. X`09if`20(setsockopt(M.theSocket,`20SOL_SOCKET,`20SO_BROADCAST,`20NULL,`200)
  2556. V`20<`200)
  2557. X`09`09MWError("can't`20get`20broadcast`20permission");
  2558. X#endif`09BSD_43
  2559. X#endif`09SO_BROADCAST
  2560. X
  2561. X`09rmtAddr`20=`20M.myAddr;
  2562. X`09rmtAddr.sin_addr.s_addr`20=`20inet_makeaddr(inet_netof(M.myAddr.sin_addr),
  2563. X`09`09`09`09`09BROAD_ADDR);`09/*`20from`20Makefile`20*/
  2564. X`09rmtAddr.sin_port`20=`20M.mazePort;
  2565. X
  2566. X`09answers`20=`20(struct`20answer`20*)
  2567. X`09`09malloc((unsigned)`20(maxAnswers`20*`20sizeof(*answers)));
  2568. X
  2569. X`09setupSurvey(b);
  2570. X`09ConvertOutgoing(b);
  2571. X`09if`20(sendto(fd,`20(char`20*)`20b,`20sizeof(*b),`200,`20`26rmtAddr,`20sizeo
  2572. Vf(rmtAddr))`20<`200)
  2573. X`09`09fprintf(stderr,`20"findDuke`20survey`20can't`20broadcast`5Cn");
  2574. X
  2575. X`09while`20(1)`20`7B
  2576. X`20`20`09`20`20`20`20`20`20`20`20FD_ZERO`20(`26fds);
  2577. X`09`09FD_SET`20(fd,`20`26fds);
  2578. X`09`09timeout.tv_sec`20=`205;
  2579. X`09`09timeout.tv_usec`20=`200;
  2580. X`09`09ret`20=`20select(FD_SETSIZE,`20`26fds,`20NULL,`20NULL,`20`26timeout);
  2581. X`09`09if`20(ret`20<`200)
  2582. X`09`09`09MWError("findDuke`20select");
  2583. X`09`09if`20(ret`20==`200)
  2584. X`09`09`09break;
  2585. X`09`09answers`5Bcnt`5D.srclen`20=`20sizeof(Sockaddr);
  2586. X`09`09if`20(recvfrom(fd,`20`26answers`5Bcnt`5D.packet,`20sizeof(RatPacket),
  2587. V`200,
  2588. X`09`09`09`20`20`20`20`20`26answers`5Bcnt`5D.source,`20`26answers`5Bcnt`5D.srcl
  2589. Ven)`20<`200)
  2590. X`09`09`09MWError("findDuke`20recv");
  2591. X`09`09ConvertIncoming(`26answers`5Bcnt`5D.packet);
  2592. X`09`09if`20(answers`5Bcnt`5D.packet.type`20!=`20RAT_STATUS)
  2593. X`09`09`09continue;
  2594. X`09`09if`20(!duke(`26answers`5Bcnt`5D))`20`7B
  2595. X`09`09`09RatStatus`09rs;
  2596. X
  2597. X`09`09`09rs`20=`20(RatStatus)`20`26answers`5Bcnt`5D.packet.body;
  2598. X`09`09`09setupSurvey(b);
  2599. X`09`09`09ConvertOutgoing(b);
  2600. X`09`09`09if`20(sendto(fd,`20b,`20sizeof(*b),`200,
  2601. X`09`09`09`09`20`20`20`26rs->rats`5Brs->dukeRat`5D.addr,
  2602. X`09`09`09`09`20`20`20sizeof(rs->rats`5Brs->dukeRat`5D.addr))`20<`200)
  2603. X`09`09`09`09fprintf(stderr,`20
  2604. X`09`09`09`09`09"findDuke`20resend`20can't`20broadcast");
  2605. X`09`09`09continue;
  2606. X`09`09`7D
  2607. X`09`09if`20(freeSlot(`26answers`5Bcnt`5D))
  2608. X`09`09`09if`20(++cnt`20==`20maxAnswers)
  2609. X`09`09`09`09break;
  2610. X`09`7D
  2611. X
  2612. X`09for`20(i`20=`200;`20i`20<`20cnt;`20i++)
  2613. X`09`09if`20(duke(`26answers`5Bi`5D))`20`7B
  2614. X`09`09`09rmtAddr`20=`20answers`5Bi`5D.source;
  2615. X`09`09`09break;
  2616. X`09`09`7D
  2617. X`09free((char`20*)`20answers);
  2618. X`09free((char`20*)`20b);
  2619. X`09if`20(i`20==`20cnt)
  2620. X`09`09return`20(Sockaddr`20*)`20NULL;
  2621. X`09else
  2622. X`09`09return`20`26rmtAddr;
  2623. X#else`09NO_BROADCAST
  2624. X`09return`20(Sockaddr`20*)`20NULL;
  2625. X#endif`09NO_BROADCAST
  2626. X`7D
  2627. X
  2628. X/*`20
  2629. X`20*`20See`20if`20the`20game`20contains`20any`20empty`20slots`20for`20players.
  2630. V
  2631. X`20*/
  2632. X
  2633. XBoolean
  2634. XfreeSlot(a)
  2635. Xstruct`20answer`09*a;
  2636. X`7B
  2637. X`09RatStatus`09test;
  2638. X`09RatId`09`09id;
  2639. X
  2640. X`09test`20=`20(RatStatus)`20`26a->packet.body;
  2641. X`09for`20(id`20=`200;`20id`20<`20MAXRATS;`20id++)
  2642. X`09`09if`20(!test->rats`5Bid`5D.playing)
  2643. X`09`09`09return`20TRUE;
  2644. X`09return`20FALSE;
  2645. X`7D
  2646. X
  2647. X/*`20
  2648. X`20*`20Fill`20in`20the`20RAT_SURVEY`20packet.
  2649. X`20*/
  2650. X
  2651. XsetupSurvey(b)
  2652. XRatPacket`20*b;
  2653. X`7B
  2654. X`09RatNew`09ratSurvey;
  2655. X
  2656. X`09b->type`20=`20RAT_SURVEY;
  2657. X`09ratSurvey`20=`20(RatNew)`20`26b->body;
  2658. X`09ratSurvey->pass`20=`20RAT_PASSWORD;
  2659. X`7D
  2660. X
  2661. X/*`20
  2662. X`20*`20Check`20if`20this`20guy's`20the`20duke`20of`20his`20game.
  2663. X`20*/
  2664. X
  2665. XBoolean
  2666. Xduke(a)
  2667. Xstruct`20answer`09*a;
  2668. X`7B
  2669. X`09RatStatus`09test;
  2670. X
  2671. X`09test`20=`20(RatStatus)`20`26a->packet.body;
  2672. X`09return`20!bcmp((char`20*)`20`26test->rats`5Btest->dukeRat`5D.addr.sin_addr,
  2673. V
  2674. X`09`09`09(char`20*)`20`26a->source.sin_addr,`20sizeof(struct`20in_addr));
  2675. X`7D
  2676. X
  2677. X/*
  2678. X`20*`20Resolve`20the`20specified`20host`20name`20into`20an`20internet`20addres
  2679. Vs.`20`20The`20"name"`20may
  2680. +-+-+-+-+-+-+-+-  END  OF PART 1 +-+-+-+-+-+-+-+-
  2681.