home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / x / volume18 / xmris / patch1.04 < prev    next >
Encoding:
Text File  |  1992-07-28  |  50.5 KB  |  1,739 lines

  1. Newsgroups: comp.sources.x
  2. Path: uunet!uunet!elroy.jpl.nasa.gov!sdd.hp.com!mips!msi!dcmartin
  3. From: Nathan Sidwell <nathan@inmos.co.uk>
  4. Subject: v18i075: xmris version 2.00, Patch1, Part04/05
  5. Message-ID: <1992Jul29.181129.15707@msi.com>
  6. Originator: dcmartin@fascet
  7. Sender: dcmartin@msi.com (David C. Martin - Moderator)
  8. Organization: Molecular Simulations, Inc.
  9. References: <csx-18i072-xmris@uunet.UU.NET>
  10. Date: Wed, 29 Jul 1992 18:11:29 GMT
  11. Approved: dcmartin@msi.com
  12. Lines: 1725
  13.  
  14. Submitted-by: Nathan Sidwell <nathan@inmos.co.uk>
  15. Posting-number: Volume 18, Issue 75
  16. Archive-name: xmris/patch1.04
  17. Patch-To: xmris: Volume XXX, Issue XXX
  18.  
  19. #!/bin/sh
  20. # this is part.04 (part 4 of a multipart archive)
  21. # do not concatenate these parts, unpack them in order with /bin/sh
  22. # file patch.v2.00 continued
  23. #
  24. if test ! -r _shar_seq_.tmp; then
  25.     echo 'Please unpack part 1 first!'
  26.     exit 1
  27. fi
  28. (read Scheck
  29.  if test "$Scheck" != 4; then
  30.     echo Please unpack part "$Scheck" next!
  31.     exit 1
  32.  else
  33.     exit 0
  34.  fi
  35. ) < _shar_seq_.tmp || exit 1
  36. if test ! -f _shar_wnt_.tmp; then
  37.     echo 'x - still skipping patch.v2.00'
  38. else
  39. echo 'x - continuing file patch.v2.00'
  40. sed 's/^X//' << 'SHAR_EOF' >> 'patch.v2.00' &&
  41. X              cptr[-CELL_STRIDE-1].depths[1] > VEL_Y))
  42. X                type = 4 * GAP_HEIGHT;
  43. !             munch_back(0, (int)type,
  44. X              EDGE_WIDTH >> 1, GAP_HEIGHT,
  45. X              pixel.x + (CELL_WIDTH >> 1) - (EDGE_WIDTH >> 1),
  46. X              pixel.y - GAP_HEIGHT, sptr);
  47. ***************
  48. *** 412,418 ****
  49. X            /*{{{  munch the right half of the edge above*/
  50. X            {
  51. X              unsigned  type;
  52. !                             
  53. X              type = 0;
  54. X              if(cptr[0].depths[3] > VEL_X)
  55. X                type = 2 * GAP_HEIGHT;
  56. --- 396,402 ----
  57. X            /*{{{  munch the right half of the edge above*/
  58. X            {
  59. X              unsigned  type;
  60. !                                                     
  61. X              type = 0;
  62. X              if(cptr[0].depths[3] > VEL_X)
  63. X                type = 2 * GAP_HEIGHT;
  64. ***************
  65. *** 422,428 ****
  66. X              (cptr[1].depths[0] < -VEL_Y ||
  67. X              cptr[-CELL_STRIDE+1].depths[1] > VEL_Y))
  68. X                type = 4 * GAP_HEIGHT;
  69. !             munch_back(EDGE_WIDTH >> 1, type,
  70. X              EDGE_WIDTH >> 1, GAP_HEIGHT,
  71. X              pixel.x + (CELL_WIDTH >> 1),
  72. X              pixel.y - GAP_HEIGHT, sptr);
  73. --- 406,412 ----
  74. X              (cptr[1].depths[0] < -VEL_Y ||
  75. X              cptr[-CELL_STRIDE+1].depths[1] > VEL_Y))
  76. X                type = 4 * GAP_HEIGHT;
  77. !             munch_back(EDGE_WIDTH >> 1, (int)type,
  78. X              EDGE_WIDTH >> 1, GAP_HEIGHT,
  79. X              pixel.x + (CELL_WIDTH >> 1),
  80. X              pixel.y - GAP_HEIGHT, sptr);
  81. ***************
  82. *** 525,531 ****
  83. X            /*{{{  munch the left half of the edge below*/
  84. X            {
  85. X              unsigned  type;
  86. !                             
  87. X              type = 0;
  88. X              if(cptr[0].depths[2] < -VEL_X)
  89. X                type = GAP_HEIGHT;
  90. --- 509,515 ----
  91. X            /*{{{  munch the left half of the edge below*/
  92. X            {
  93. X              unsigned  type;
  94. !                                                     
  95. X              type = 0;
  96. X              if(cptr[0].depths[2] < -VEL_X)
  97. X                type = GAP_HEIGHT;
  98. ***************
  99. *** 535,541 ****
  100. X              (cptr[-1].depths[1] > VEL_Y ||
  101. X              cptr[CELL_STRIDE-1].depths[0] < -VEL_Y))
  102. X                type = 4 * GAP_HEIGHT;
  103. !             munch_back(0, type,
  104. X              EDGE_WIDTH >> 1, GAP_HEIGHT,
  105. X              pixel.x + (CELL_WIDTH >> 1) - (EDGE_WIDTH >> 1),
  106. X              pixel.y + CELL_HEIGHT, sptr);
  107. --- 519,525 ----
  108. X              (cptr[-1].depths[1] > VEL_Y ||
  109. X              cptr[CELL_STRIDE-1].depths[0] < -VEL_Y))
  110. X                type = 4 * GAP_HEIGHT;
  111. !             munch_back(0, (int)type,
  112. X              EDGE_WIDTH >> 1, GAP_HEIGHT,
  113. X              pixel.x + (CELL_WIDTH >> 1) - (EDGE_WIDTH >> 1),
  114. X              pixel.y + CELL_HEIGHT, sptr);
  115. ***************
  116. *** 548,554 ****
  117. X            /*{{{  munch the right half of the edge below*/
  118. X            {
  119. X              unsigned  type;
  120. !                             
  121. X              type = 0;
  122. X              if(cptr[0].depths[3] > VEL_X)
  123. X                type = GAP_HEIGHT;
  124. --- 532,538 ----
  125. X            /*{{{  munch the right half of the edge below*/
  126. X            {
  127. X              unsigned  type;
  128. !                                                     
  129. X              type = 0;
  130. X              if(cptr[0].depths[3] > VEL_X)
  131. X                type = GAP_HEIGHT;
  132. ***************
  133. *** 558,564 ****
  134. X              (cptr[1].depths[1] > VEL_Y ||
  135. X              cptr[CELL_STRIDE+1].depths[0] < -VEL_Y))
  136. X                type = 4 * GAP_HEIGHT;
  137. !             munch_back(EDGE_WIDTH >> 1, type,
  138. X              EDGE_WIDTH >> 1, GAP_HEIGHT,
  139. X              pixel.x + (CELL_WIDTH >> 1),
  140. X              pixel.y + CELL_HEIGHT, sptr);
  141. --- 542,548 ----
  142. X              (cptr[1].depths[1] > VEL_Y ||
  143. X              cptr[CELL_STRIDE+1].depths[0] < -VEL_Y))
  144. X                type = 4 * GAP_HEIGHT;
  145. !             munch_back(EDGE_WIDTH >> 1, (int)type,
  146. X              EDGE_WIDTH >> 1, GAP_HEIGHT,
  147. X              pixel.x + (CELL_WIDTH >> 1),
  148. X              pixel.y + CELL_HEIGHT, sptr);
  149. ***************
  150. *** 660,666 ****
  151. X            /*{{{  munch the top half of the edge left*/
  152. X            {
  153. X              unsigned  type;
  154. !                             
  155. X              type = 0;
  156. X              if(cptr[0].depths[0] < -VEL_Y)
  157. X                type = 2 * GAP_WIDTH;
  158. --- 644,650 ----
  159. X            /*{{{  munch the top half of the edge left*/
  160. X            {
  161. X              unsigned  type;
  162. !                                                     
  163. X              type = 0;
  164. X              if(cptr[0].depths[0] < -VEL_Y)
  165. X                type = 2 * GAP_WIDTH;
  166. ***************
  167. *** 670,676 ****
  168. X              (cptr[-CELL_STRIDE].depths[2] < -VEL_X ||
  169. X              cptr[-CELL_STRIDE-1].depths[3] > VEL_X))
  170. X                type = 4 * GAP_WIDTH;
  171. !             munch_back(type, 0,
  172. X              GAP_HEIGHT, EDGE_HEIGHT >> 1,
  173. X              pixel.x - GAP_WIDTH,
  174. X              pixel.y + (CELL_HEIGHT >> 1) - (EDGE_HEIGHT >> 1),
  175. --- 654,660 ----
  176. X              (cptr[-CELL_STRIDE].depths[2] < -VEL_X ||
  177. X              cptr[-CELL_STRIDE-1].depths[3] > VEL_X))
  178. X                type = 4 * GAP_WIDTH;
  179. !             munch_back((int)type, 0,
  180. X              GAP_HEIGHT, EDGE_HEIGHT >> 1,
  181. X              pixel.x - GAP_WIDTH,
  182. X              pixel.y + (CELL_HEIGHT >> 1) - (EDGE_HEIGHT >> 1),
  183. ***************
  184. *** 685,691 ****
  185. X            /*{{{  munch the bottom half of the edge left*/
  186. X            {
  187. X              unsigned  type;
  188. !                             
  189. X              type = 0;
  190. X              if(cptr[0].depths[1] > VEL_Y)
  191. X                type = 2 * GAP_WIDTH;
  192. --- 669,675 ----
  193. X            /*{{{  munch the bottom half of the edge left*/
  194. X            {
  195. X              unsigned  type;
  196. !                                                     
  197. X              type = 0;
  198. X              if(cptr[0].depths[1] > VEL_Y)
  199. X                type = 2 * GAP_WIDTH;
  200. ***************
  201. *** 695,701 ****
  202. X              (cptr[CELL_STRIDE].depths[2] < -VEL_X ||
  203. X              cptr[CELL_STRIDE-1].depths[3] > VEL_X))
  204. X                type = 4 * GAP_WIDTH;
  205. !             munch_back(type, EDGE_HEIGHT >> 1,
  206. X              GAP_WIDTH, EDGE_HEIGHT >> 1,
  207. X              pixel.x - GAP_WIDTH,
  208. X              pixel.y + (CELL_HEIGHT >> 1), sptr);
  209. --- 679,685 ----
  210. X              (cptr[CELL_STRIDE].depths[2] < -VEL_X ||
  211. X              cptr[CELL_STRIDE-1].depths[3] > VEL_X))
  212. X                type = 4 * GAP_WIDTH;
  213. !             munch_back((int)type, EDGE_HEIGHT >> 1,
  214. X              GAP_WIDTH, EDGE_HEIGHT >> 1,
  215. X              pixel.x - GAP_WIDTH,
  216. X              pixel.y + (CELL_HEIGHT >> 1), sptr);
  217. ***************
  218. *** 799,805 ****
  219. X            /*{{{  munch the top half of the edge right*/
  220. X            {
  221. X              unsigned  type;
  222. !                             
  223. X              type = 0;
  224. X              if(cptr[0].depths[0] < -VEL_Y)
  225. X                type = GAP_WIDTH;
  226. --- 783,789 ----
  227. X            /*{{{  munch the top half of the edge right*/
  228. X            {
  229. X              unsigned  type;
  230. !                                                     
  231. X              type = 0;
  232. X              if(cptr[0].depths[0] < -VEL_Y)
  233. X                type = GAP_WIDTH;
  234. ***************
  235. *** 809,815 ****
  236. X                (cptr[-CELL_STRIDE].depths[3] > VEL_X ||
  237. X              cptr[-CELL_STRIDE+1].depths[2] < -VEL_X))
  238. X                type = 4 * GAP_WIDTH;
  239. !             munch_back(type, 0,
  240. X              GAP_WIDTH, EDGE_HEIGHT >> 1,
  241. X              pixel.x + CELL_WIDTH, pixel.y +
  242. X              (CELL_HEIGHT >> 1) - (EDGE_HEIGHT >> 1), sptr);
  243. --- 793,799 ----
  244. X                (cptr[-CELL_STRIDE].depths[3] > VEL_X ||
  245. X              cptr[-CELL_STRIDE+1].depths[2] < -VEL_X))
  246. X                type = 4 * GAP_WIDTH;
  247. !             munch_back((int)type, 0,
  248. X              GAP_WIDTH, EDGE_HEIGHT >> 1,
  249. X              pixel.x + CELL_WIDTH, pixel.y +
  250. X              (CELL_HEIGHT >> 1) - (EDGE_HEIGHT >> 1), sptr);
  251. ***************
  252. *** 822,828 ****
  253. X            /*{{{  munch the bottom half of the edge right*/
  254. X            {
  255. X              unsigned  type;
  256. !                             
  257. X              type = 0;
  258. X              if(cptr[0].depths[1] > VEL_Y)
  259. X                type = GAP_WIDTH;
  260. --- 806,812 ----
  261. X            /*{{{  munch the bottom half of the edge right*/
  262. X            {
  263. X              unsigned  type;
  264. !                                                     
  265. X              type = 0;
  266. X              if(cptr[0].depths[1] > VEL_Y)
  267. X                type = GAP_WIDTH;
  268. ***************
  269. *** 832,838 ****
  270. X              (cptr[CELL_STRIDE].depths[3] > VEL_X ||
  271. X              cptr[CELL_STRIDE+1].depths[2] < -VEL_X))
  272. X                type = 4 * GAP_WIDTH;
  273. !             munch_back(type, EDGE_HEIGHT >> 1,
  274. X              GAP_WIDTH, EDGE_HEIGHT >> 1,
  275. X              pixel.x + CELL_WIDTH,
  276. X              pixel.y + (CELL_HEIGHT >> 1), sptr);
  277. --- 816,822 ----
  278. X              (cptr[CELL_STRIDE].depths[3] > VEL_X ||
  279. X              cptr[CELL_STRIDE+1].depths[2] < -VEL_X))
  280. X                type = 4 * GAP_WIDTH;
  281. !             munch_back((int)type, EDGE_HEIGHT >> 1,
  282. X              GAP_WIDTH, EDGE_HEIGHT >> 1,
  283. X              pixel.x + CELL_WIDTH,
  284. X              pixel.y + (CELL_HEIGHT >> 1), sptr);
  285. ***************
  286. *** 1003,1009 ****
  287. X    if(cherry && cherry->sprite)
  288. X      {
  289. X        SPRITE    *sptr;
  290. !       
  291. X        if(!nptr || cherry->sprite == SPRITE_DEN ||
  292. X        cherry->sprite == SPRITE_NORMAL + 2 ||
  293. X        (cherry->sprite != SPRITE_CHERRY && mptr->type != 4))
  294. --- 987,993 ----
  295. X    if(cherry && cherry->sprite)
  296. X      {
  297. X        SPRITE    *sptr;
  298. !     
  299. X        if(!nptr || cherry->sprite == SPRITE_DEN ||
  300. X        cherry->sprite == SPRITE_NORMAL + 2 ||
  301. X        (cherry->sprite != SPRITE_CHERRY && mptr->type != 4))
  302. ***************
  303. *** 1026,1054 ****
  304. X    /*}}}*/
  305. X    if(update.set)
  306. X      add_background(update.tl.x, update.tl.y,
  307. !     update.br.x - update.tl.x, update.br.y - update.tl.y);
  308. X    if(broke || nptr)
  309. X      global.broken = 1;
  310. X    assert(!nptr || nptr->visit);
  311. !   assert(mptr->cell.y >= 0 && mptr->cell.y < CELLS_DOWN &&
  312. !       mptr->cell.x >= 0 && mptr->cell.x < CELLS_ACROSS &&
  313. !       (mptr->cell.x || mptr->offset.x >= 0) &&
  314. !       (mptr->cell.y || mptr->offset.y >= 0) &&
  315. !       (mptr->cell.x < CELLS_ACROSS - 1 || mptr->offset.x <= 0) &&
  316. !       (mptr->cell.y < CELLS_DOWN - 1 || mptr->offset.y <= 0) &&
  317. !       (!mptr->offset.x || !mptr->offset.y));
  318. X    return nptr;
  319. X  }
  320. X  /*}}}*/
  321. X  /*{{{  void munch_back(sx, sy, width, height, dx, dy, sprite)*/
  322. X  static void munch_back FUNCARGLIST((sx, sy, width, height, dx, dy, sprite))
  323. ! int     sx      FUNCARGSEP
  324. ! int     sy      FUNCARGSEP
  325. ! int     width   FUNCARGSEP
  326. ! int     height  FUNCARGSEP
  327. ! int     dx      FUNCARGSEP
  328. ! int     dy      FUNCARGSEP
  329. ! SPRITE  *sprite FUNCARGTERM
  330. X  /*
  331. X   * munches the background image with the specified sprite
  332. X   */
  333. --- 1010,1040 ----
  334. X    /*}}}*/
  335. X    if(update.set)
  336. X      add_background(update.tl.x, update.tl.y,
  337. !     (unsigned)(update.br.x - update.tl.x), 
  338. !     (unsigned)(update.br.y - update.tl.y));
  339. X    if(broke || nptr)
  340. X      global.broken = 1;
  341. +   /*  check we haven't wandered off the board */
  342. X    assert(!nptr || nptr->visit);
  343. !   assert(mptr->cell.y >= 0 && mptr->cell.y < CELLS_DOWN);
  344. !   assert(mptr->cell.x >= 0 && mptr->cell.x < CELLS_ACROSS);
  345. !   assert(mptr->cell.x || mptr->offset.x >= 0);
  346. !   assert(mptr->cell.y || mptr->offset.y >= 0);
  347. !   assert(mptr->cell.x < CELLS_ACROSS - 1 || mptr->offset.x <= 0);
  348. !   assert(mptr->cell.y < CELLS_DOWN - 1 || mptr->offset.y <= 0);
  349. !   assert(!mptr->offset.x || !mptr->offset.y);
  350. X    return nptr;
  351. X  }
  352. X  /*}}}*/
  353. X  /*{{{  void munch_back(sx, sy, width, height, dx, dy, sprite)*/
  354. X  static void munch_back FUNCARGLIST((sx, sy, width, height, dx, dy, sprite))
  355. ! int       sx      FUNCARGSEP
  356. ! int       sy      FUNCARGSEP
  357. ! unsigned  width   FUNCARGSEP
  358. ! unsigned  height  FUNCARGSEP
  359. ! int       dx      FUNCARGSEP
  360. ! int       dy      FUNCARGSEP
  361. ! SPRITE    *sprite FUNCARGTERM
  362. X  /*
  363. X   * munches the background image with the specified sprite
  364. X   */
  365. ***************
  366. *** 1113,1119 ****
  367. X      if(type == 3 * GAP_HEIGHT && (cptr[-1].depths[0] < -VEL_Y ||
  368. X          cptr[-CELL_STRIDE-1].depths[1] > VEL_Y))
  369. X        type = 4 * GAP_HEIGHT;
  370. !     munch_back(0, type, EDGE_WIDTH >> 1, GAP_HEIGHT,
  371. X          x + (CELL_WIDTH >> 1) - (EDGE_WIDTH >> 1), y - GAP_HEIGHT, sptr);
  372. X        }
  373. X        /*}}}*/
  374. --- 1099,1105 ----
  375. X      if(type == 3 * GAP_HEIGHT && (cptr[-1].depths[0] < -VEL_Y ||
  376. X          cptr[-CELL_STRIDE-1].depths[1] > VEL_Y))
  377. X        type = 4 * GAP_HEIGHT;
  378. !     munch_back(0, (int)type, EDGE_WIDTH >> 1, GAP_HEIGHT,
  379. X          x + (CELL_WIDTH >> 1) - (EDGE_WIDTH >> 1), y - GAP_HEIGHT, sptr);
  380. X        }
  381. X        /*}}}*/
  382. ***************
  383. *** 1129,1135 ****
  384. X      if(type == 3 * GAP_HEIGHT && (cptr[1].depths[0] < -VEL_Y ||
  385. X          cptr[-CELL_STRIDE+1].depths[1] > VEL_Y))
  386. X        type = 4 * GAP_HEIGHT;
  387. !     munch_back(EDGE_WIDTH >> 1, type, EDGE_WIDTH >> 1, GAP_HEIGHT,
  388. X          x + (CELL_WIDTH >> 1), y - GAP_HEIGHT, sptr);
  389. X        }
  390. X        /*}}}*/
  391. --- 1115,1121 ----
  392. X      if(type == 3 * GAP_HEIGHT && (cptr[1].depths[0] < -VEL_Y ||
  393. X          cptr[-CELL_STRIDE+1].depths[1] > VEL_Y))
  394. X        type = 4 * GAP_HEIGHT;
  395. !     munch_back(EDGE_WIDTH >> 1, (int)type, EDGE_WIDTH >> 1, GAP_HEIGHT,
  396. X          x + (CELL_WIDTH >> 1), y - GAP_HEIGHT, sptr);
  397. X        }
  398. X        /*}}}*/
  399. ***************
  400. *** 1150,1156 ****
  401. X      if(type == 3 * GAP_HEIGHT && (cptr[-1].depths[1] > VEL_Y ||
  402. X          cptr[CELL_STRIDE-1].depths[0] < -VEL_Y))
  403. X        type = 4 * GAP_HEIGHT;
  404. !     munch_back(0, type, EDGE_WIDTH >> 1, GAP_HEIGHT,
  405. X          x + (CELL_WIDTH >> 1) - (EDGE_WIDTH >> 1),
  406. X          y + CELL_HEIGHT, sptr);
  407. X        }
  408. --- 1136,1142 ----
  409. X      if(type == 3 * GAP_HEIGHT && (cptr[-1].depths[1] > VEL_Y ||
  410. X          cptr[CELL_STRIDE-1].depths[0] < -VEL_Y))
  411. X        type = 4 * GAP_HEIGHT;
  412. !     munch_back(0, (int)type, EDGE_WIDTH >> 1, GAP_HEIGHT,
  413. X          x + (CELL_WIDTH >> 1) - (EDGE_WIDTH >> 1),
  414. X          y + CELL_HEIGHT, sptr);
  415. X        }
  416. ***************
  417. *** 1168,1174 ****
  418. X          (cptr[1].depths[1] > VEL_Y ||
  419. X          cptr[CELL_STRIDE+1].depths[0] < -VEL_Y))
  420. X        type = 4 * GAP_HEIGHT;
  421. !     munch_back(EDGE_WIDTH >> 1, type, EDGE_WIDTH >> 1, GAP_HEIGHT,
  422. X          x + (CELL_WIDTH >> 1), y + CELL_HEIGHT, sptr);
  423. X        }
  424. X        /*}}}*/
  425. --- 1154,1160 ----
  426. X          (cptr[1].depths[1] > VEL_Y ||
  427. X          cptr[CELL_STRIDE+1].depths[0] < -VEL_Y))
  428. X        type = 4 * GAP_HEIGHT;
  429. !     munch_back(EDGE_WIDTH >> 1, (int)type, EDGE_WIDTH >> 1, GAP_HEIGHT,
  430. X          x + (CELL_WIDTH >> 1), y + CELL_HEIGHT, sptr);
  431. X        }
  432. X        /*}}}*/
  433. ***************
  434. *** 1191,1197 ****
  435. X          (cptr[-CELL_STRIDE].depths[2] < -VEL_X ||
  436. X          cptr[-CELL_STRIDE-1].depths[3] > VEL_X))
  437. X        type = 4 * GAP_WIDTH;
  438. !     munch_back(type, 0, GAP_HEIGHT, EDGE_HEIGHT >> 1,
  439. X          x - GAP_WIDTH, y + (CELL_HEIGHT >> 1) - (EDGE_HEIGHT >> 1),
  440. X          sptr);
  441. X        }
  442. --- 1177,1183 ----
  443. X          (cptr[-CELL_STRIDE].depths[2] < -VEL_X ||
  444. X          cptr[-CELL_STRIDE-1].depths[3] > VEL_X))
  445. X        type = 4 * GAP_WIDTH;
  446. !     munch_back((int)type, 0, GAP_HEIGHT, EDGE_HEIGHT >> 1,
  447. X          x - GAP_WIDTH, y + (CELL_HEIGHT >> 1) - (EDGE_HEIGHT >> 1),
  448. X          sptr);
  449. X        }
  450. ***************
  451. *** 1209,1215 ****
  452. X          (cptr[CELL_STRIDE].depths[2] < -VEL_X ||
  453. X          cptr[CELL_STRIDE-1].depths[3] > VEL_X))
  454. X        type = 4 * GAP_WIDTH;
  455. !     munch_back(type, EDGE_HEIGHT >> 1, GAP_WIDTH, EDGE_HEIGHT >> 1,
  456. X          x - GAP_WIDTH, y + (CELL_HEIGHT >> 1), sptr);
  457. X        }
  458. X        /*}}}*/
  459. --- 1195,1201 ----
  460. X          (cptr[CELL_STRIDE].depths[2] < -VEL_X ||
  461. X          cptr[CELL_STRIDE-1].depths[3] > VEL_X))
  462. X        type = 4 * GAP_WIDTH;
  463. !     munch_back((int)type, EDGE_HEIGHT >> 1, GAP_WIDTH, EDGE_HEIGHT >> 1,
  464. X          x - GAP_WIDTH, y + (CELL_HEIGHT >> 1), sptr);
  465. X        }
  466. X        /*}}}*/
  467. ***************
  468. *** 1231,1237 ****
  469. X          (cptr[-CELL_STRIDE].depths[3] > VEL_X ||
  470. X          cptr[-CELL_STRIDE+1].depths[2] < -VEL_X))
  471. X        type = 4 * GAP_WIDTH;
  472. !     munch_back(type, 0, GAP_WIDTH, EDGE_HEIGHT >> 1,
  473. X          x + CELL_WIDTH, y + (CELL_HEIGHT >> 1) - (EDGE_HEIGHT >> 1),
  474. X          sptr);
  475. X        }
  476. --- 1217,1223 ----
  477. X          (cptr[-CELL_STRIDE].depths[3] > VEL_X ||
  478. X          cptr[-CELL_STRIDE+1].depths[2] < -VEL_X))
  479. X        type = 4 * GAP_WIDTH;
  480. !     munch_back((int)type, 0, GAP_WIDTH, EDGE_HEIGHT >> 1,
  481. X          x + CELL_WIDTH, y + (CELL_HEIGHT >> 1) - (EDGE_HEIGHT >> 1),
  482. X          sptr);
  483. X        }
  484. ***************
  485. *** 1249,1255 ****
  486. X          (cptr[CELL_STRIDE].depths[3] > VEL_X ||
  487. X          cptr[CELL_STRIDE+1].depths[2] < -VEL_X))
  488. X        type = 4 * GAP_WIDTH;
  489. !     munch_back(type, EDGE_HEIGHT >> 1, GAP_WIDTH, EDGE_HEIGHT >> 1,
  490. X          x + CELL_WIDTH, y + (CELL_HEIGHT >> 1), sptr);
  491. X        }
  492. X        /*}}}*/
  493. --- 1235,1241 ----
  494. X          (cptr[CELL_STRIDE].depths[3] > VEL_X ||
  495. X          cptr[CELL_STRIDE+1].depths[2] < -VEL_X))
  496. X        type = 4 * GAP_WIDTH;
  497. !     munch_back((int)type, EDGE_HEIGHT >> 1, GAP_WIDTH, EDGE_HEIGHT >> 1,
  498. X          x + CELL_WIDTH, y + (CELL_HEIGHT >> 1), sptr);
  499. X        }
  500. X        /*}}}*/
  501. diff -c -r exp.v1.01/patchlevel.h exp.v2.00/patchlevel.h
  502. *** exp.v1.01/patchlevel.h    Fri Jul 24 09:55:56 1992
  503. --- exp.v2.00/patchlevel.h    Fri Jul 24 13:43:03 1992
  504. ***************
  505. *** 1 ****
  506. ! #define XMRISVERSION "V1.01"
  507. --- 1,2 ----
  508. ! #define XMRISVERSION "V2.00"
  509. ! #define DATE "24 Jul 1992"
  510. diff -c -r exp.v1.01/player.c exp.v2.00/player.c
  511. *** exp.v1.01/player.c    Fri Jul 24 09:56:13 1992
  512. --- exp.v2.00/player.c    Fri Jul 24 13:43:20 1992
  513. ***************
  514. *** 1,21 ****
  515. ! /*{{{  (C) 1992 Nathan Sidwell*/
  516. ! /*****************************************************************************
  517. !             X M R I S V1.01
  518. !             ---------------
  519. !             (C) 1992 Nathan Sidwell
  520. ! This program is copyright (C) 1992 Nathan Sidwell. This software and documentation
  521. ! is in the public domain. Permission is granted to distribute and compile
  522. ! verbatim copies of this software for non-commercial, non-profit use,
  523. ! without fee. The software may be modified, provided that both the above copyright
  524. ! notice and this permission notice appear.
  525. ! No guarantee is given as to the robustness or suitability of this
  526. ! software for your computer.
  527. ! Nathan Sidwell  INMOS UK |                 | nathan@inmos.co.uk       DoD#0390
  528. ! *****************************************************************************/
  529. ! /*}}}*/
  530. X  #include "xmris.h"
  531. X  /*{{{  void bounce_ball()*/
  532. X  extern void bounce_ball FUNCARGVOID
  533. --- 1,4 ----
  534. ! /* (C) 1992 Nathan Sidwell */
  535. X  #include "xmris.h"
  536. X  /*{{{  void bounce_ball()*/
  537. X  extern void bounce_ball FUNCARGVOID
  538. ***************
  539. *** 179,185 ****
  540. X        {
  541. X          unsigned  quadrant;
  542. X          /* quadrants to, bo, lo, ro, ti, bi, li, ri, t, b, l, r */
  543. !             
  544. X          /* work out where we are in the cell */
  545. X          quadrant = 0x000;
  546. X          /*{{{  y place*/
  547. --- 162,168 ----
  548. X        {
  549. X          unsigned  quadrant;
  550. X          /* quadrants to, bo, lo, ro, ti, bi, li, ri, t, b, l, r */
  551. !                             
  552. X          /* work out where we are in the cell */
  553. X          quadrant = 0x000;
  554. X          /*{{{  y place*/
  555. ***************
  556. *** 219,225 ****
  557. X          if(quadrant & 0x808)
  558. X            {
  559. X              unsigned  mask;
  560. !                   
  561. X              if(quadrant & 0x800)
  562. X                mask = 0x93;
  563. X              else
  564. --- 202,208 ----
  565. X          if(quadrant & 0x808)
  566. X            {
  567. X              unsigned  mask;
  568. !                                   
  569. X              if(quadrant & 0x800)
  570. X                mask = 0x93;
  571. X              else
  572. ***************
  573. *** 259,265 ****
  574. X          if(quadrant & 0x404)
  575. X            {
  576. X              unsigned  mask;
  577. !                   
  578. X              if(quadrant & 0x400)
  579. X                mask = 0x63;
  580. X              else
  581. --- 242,248 ----
  582. X          if(quadrant & 0x404)
  583. X            {
  584. X              unsigned  mask;
  585. !                                   
  586. X              if(quadrant & 0x400)
  587. X                mask = 0x63;
  588. X              else
  589. ***************
  590. *** 299,305 ****
  591. X          if(quadrant & 0x202)
  592. X            {
  593. X              unsigned  mask;
  594. !                   
  595. X              if(quadrant & 0x200)
  596. X                mask = 0xAC;
  597. X              else
  598. --- 282,288 ----
  599. X          if(quadrant & 0x202)
  600. X            {
  601. X              unsigned  mask;
  602. !                                   
  603. X              if(quadrant & 0x200)
  604. X                mask = 0xAC;
  605. X              else
  606. ***************
  607. *** 320,326 ****
  608. X          if(quadrant & 0x101)
  609. X            {
  610. X              unsigned  mask;
  611. !                   
  612. X              if(quadrant & 0x100)
  613. X                mask = 0x5C;
  614. X              else
  615. --- 303,309 ----
  616. X          if(quadrant & 0x101)
  617. X            {
  618. X              unsigned  mask;
  619. !                                   
  620. X              if(quadrant & 0x100)
  621. X                mask = 0x5C;
  622. X              else
  623. ***************
  624. *** 338,350 ****
  625. X        {
  626. X          unsigned  i;
  627. X          APPLE     *aptr;
  628. !             
  629. X          for(aptr = apple.list, i = apple.apples; i--; aptr++)
  630. X            {
  631. X          int     x, y;
  632. X          int     edge;
  633. X          /* edge ot, ob, ol, or, t, b, l, r */
  634. !               
  635. X          if(aptr->state < 4)
  636. X            {
  637. X              x = aptr->pixel.x;
  638. --- 321,333 ----
  639. X        {
  640. X          unsigned  i;
  641. X          APPLE     *aptr;
  642. !                             
  643. X          for(aptr = apple.list, i = apple.apples; i--; aptr++)
  644. X            {
  645. X          int     x, y;
  646. X          int     edge;
  647. X          /* edge ot, ob, ol, or, t, b, l, r */
  648. !                               
  649. X          if(aptr->state < 4)
  650. X            {
  651. X              x = aptr->pixel.x;
  652. ***************
  653. *** 530,536 ****
  654. X      {
  655. X        unsigned  i;
  656. X        MONSTER   *mptr;
  657. !         
  658. X        for(mptr = monster.list, i = monster.monsters; i--; mptr++)
  659. X          if(!mptr->shot && !mptr->apple &&
  660. X          player.ball.pixel.x - mptr->pixel.x >= 0 &&
  661. --- 513,519 ----
  662. X      {
  663. X        unsigned  i;
  664. X        MONSTER   *mptr;
  665. !                         
  666. X        for(mptr = monster.list, i = monster.monsters; i--; mptr++)
  667. X          if(!mptr->shot && !mptr->apple &&
  668. X          player.ball.pixel.x - mptr->pixel.x >= 0 &&
  669. ***************
  670. *** 610,751 ****
  671. X  {
  672. X    CELL      *cptr;
  673. X    unsigned  dir;
  674. X  
  675. X    dir = monster.list[0].dir;
  676. !   /*{{{  motionevent?*/
  677. !   if(player.motionevent && !player.keyboard &&
  678. !       (!monster.list[0].stop ||
  679. !        player.raw_mouse.x - player.mouse.x * (CELL_WIDTH + GAP_WIDTH) >
  680. !       BORDER_LEFT + GAP_WIDTH / 2 + (CELL_WIDTH + GAP_WIDTH) / 4 +
  681. !       CELL_WIDTH + GAP_WIDTH ||
  682. !        player.raw_mouse.y - (int)player.mouse.y * (CELL_HEIGHT + GAP_HEIGHT) >
  683. !       BORDER_TOP + GAP_HEIGHT / 2 + (CELL_HEIGHT + GAP_HEIGHT) / 4 +
  684. !       CELL_HEIGHT + GAP_HEIGHT ||
  685. !        player.raw_mouse.x - (int)player.mouse.x * (CELL_WIDTH + GAP_WIDTH) <
  686. !       BORDER_LEFT + GAP_WIDTH / 2 - (GAP_WIDTH + CELL_WIDTH) / 4||
  687. !        player.raw_mouse.y - (int)player.mouse.y * (CELL_HEIGHT + GAP_HEIGHT) <
  688. !       BORDER_TOP + GAP_HEIGHT / 2 - (GAP_HEIGHT + CELL_HEIGHT) / 4))
  689. !     /*
  690. !      * for mouse motion, we get the cell number for the mouse, and
  691. !      * set dir & mouse dir to point towards it
  692. !      */
  693. !     {
  694. !       int       x, y;
  695. !     
  696. !       x = (player.raw_mouse.x - BORDER_LEFT - GAP_WIDTH / 2) /
  697. !       (GAP_WIDTH + CELL_WIDTH);
  698. !       y = (player.raw_mouse.y - BORDER_TOP - GAP_HEIGHT / 2) /
  699. !       (GAP_HEIGHT + CELL_HEIGHT);
  700. !       /*{{{  clip x*/
  701. !       if(x < 0)
  702. !     x = 0;
  703. !       else if(x > CELLS_ACROSS - 1)
  704. !     x = CELLS_ACROSS - 1;
  705. !       /*}}}*/
  706. !       /*{{{  clip y*/
  707. !       if(y < 0)
  708. !     y = 0;
  709. !       else if(y > CELLS_DOWN - 1)
  710. !     y = CELLS_DOWN - 1;
  711. !       /*}}}*/
  712. !       if(y != player.mouse.y || x != player.mouse.x)
  713. !     {
  714. !       unsigned  dir;
  715. !       unsigned  second;
  716. !     
  717. !       player.mouse.x = x;
  718. !       player.mouse.y = y;
  719. !       /*{{{  calc x direction*/
  720. !       if(x == monster.list[0].cell.x && !monster.list[0].offset.x)
  721. !         x = 0;
  722. !       else if(x < monster.list[0].cell.x ||
  723. !           (x == monster.list[0].cell.x && monster.list[0].offset.x > 0))
  724. !         x = 6;
  725. !       else
  726. !         x = 7;
  727. !       /*}}}*/
  728. !       /*{{{  calc y direction*/
  729. !       if(y == monster.list[0].cell.y && !monster.list[0].offset.y)
  730. !         y = 0;
  731. !       else if(y < monster.list[0].cell.y ||
  732. !           (y == monster.list[0].cell.y && monster.list[0].offset.y > 0))
  733. !         y = 4;
  734. !       else
  735. !         y = 5;
  736. !       /*}}}*/
  737. !       /*{{{  select which way round to do them*/
  738. !       if(monster.list[0].dir & 2)
  739. !         {
  740. !           if(monster.list[0].dir != x)
  741. !         {
  742. !           dir = y;
  743. !           second = x;
  744. !         }
  745. !           else
  746. !         {
  747. !           dir = x;
  748. !           second = y;
  749. !         }
  750. !         }
  751. !       else
  752. !         {
  753. !           if(monster.list[0].dir != y)
  754. !         {
  755. !           dir = x;
  756. !           second = y;
  757. !         }
  758. !           else
  759. !         {
  760. !           dir = y;
  761. !           second = x;
  762. !         }
  763. !         }
  764. !       /*}}}*/
  765. !       player.next_dir = 0;
  766. !       /*{{{  do u turn fiddling*/
  767. !       if(!dir)
  768. !         dir = second;
  769. !       else if(!second)
  770. !         second = dir;
  771. !       else if(monster.list[0].offset.x && !(dir & 2))
  772. !         {
  773. !           player.next_dir = dir;
  774. !           if(monster.list[0].offset.x < -(CELL_WIDTH + GAP_WIDTH) * 3 / 4)
  775. !         dir = 6;
  776. !           else if(monster.list[0].offset.x > (CELL_WIDTH + GAP_WIDTH) * 3 / 4)
  777. !         dir = 7;
  778. !           else if(monster.list[0].offset.x > 0 &&
  779. !           monster.list[0].offset.x <= (CELL_WIDTH + GAP_WIDTH) / 4)
  780. !         dir = 6;
  781. !           else if(monster.list[0].offset.x < 0 &&
  782. !           monster.list[0].offset.x >= -(CELL_WIDTH + GAP_WIDTH) / 4)
  783. !         dir = 7;
  784. !           else
  785. !         dir = monster.list[0].dir | 4;
  786. !         }
  787. !       else if(monster.list[0].offset.y && (dir & 2))
  788. !         {
  789. !           player.next_dir = dir;
  790. !           if(monster.list[0].offset.y < -(CELL_HEIGHT + GAP_HEIGHT) * 3 / 4)
  791. !         dir = 4;
  792. !           else if(monster.list[0].offset.y > (CELL_HEIGHT + GAP_HEIGHT) * 3 / 4)
  793. !         dir = 5;
  794. !           else if(monster.list[0].offset.y > 0 &&
  795. !           monster.list[0].offset.y <= (CELL_HEIGHT + GAP_HEIGHT) / 4)
  796. !         dir = 4;
  797. !           else if(monster.list[0].offset.y < 0 &&
  798. !           monster.list[0].offset.y >= -(CELL_HEIGHT + GAP_HEIGHT) / 4)
  799. !         dir = 5;
  800. !           else
  801. !         dir = monster.list[0].dir | 4;
  802. !         }
  803. !       /*}}}*/
  804. !       monster.list[0].dir = dir & 3;
  805. !       monster.list[0].stop = !(dir & 4);
  806. !       player.mouse_dir = second;
  807. !     }
  808. !     }
  809. !   /*}}}*/
  810. X    /*{{{  key change?*/
  811. X    if(player.bashed || (player.old_pressed ^ player.pressed) & 0xF)
  812. X    /*
  813. --- 593,604 ----
  814. X  {
  815. X    CELL      *cptr;
  816. X    unsigned  dir;
  817. +   unsigned  onestep;
  818. +   unsigned  was_stop;
  819. X  
  820. X    dir = monster.list[0].dir;
  821. !   onestep = 0;
  822. !   was_stop = monster.list[0].stop;
  823. X    /*{{{  key change?*/
  824. X    if(player.bashed || (player.old_pressed ^ player.pressed) & 0xF)
  825. X    /*
  826. ***************
  827. *** 757,766 ****
  828. X    {
  829. X      unsigned  valid;
  830. X      unsigned  pressed;
  831. !     
  832. !     player.mouse_dir = 0;
  833. !     pressed = player.pressed & ~player.bashed;
  834. X      if(!pressed)
  835. X        pressed = player.pressed;
  836. X      valid = 0xF;
  837. X      /*{{{  work out valid direction and the edges*/
  838. --- 610,636 ----
  839. X    {
  840. X      unsigned  valid;
  841. X      unsigned  pressed;
  842. !     
  843. !     pressed = player.pressed;
  844. X      if(!pressed)
  845. +       {
  846. +     if(dir == 0 && monster.list[0].offset.y <=
  847. +         VEL_Y * STEP_OFF - CELL_HEIGHT - GAP_HEIGHT)
  848. +       pressed = 0x1;
  849. +     else if(dir == 1 && monster.list[0].offset.y >=
  850. +         CELL_HEIGHT + GAP_HEIGHT - VEL_Y * STEP_OFF)
  851. +       pressed = 0x2;
  852. +     else if(dir == 2 && monster.list[0].offset.x <=
  853. +         VEL_X * STEP_OFF - CELL_WIDTH - GAP_WIDTH)
  854. +       pressed = 0x4;
  855. +     else if(dir == 3 && monster.list[0].offset.x >=
  856. +         CELL_WIDTH + GAP_WIDTH - VEL_X * STEP_OFF)
  857. +       pressed = 0x8;
  858. +     if(pressed)
  859. +       onestep = 1;
  860. +       }
  861. +     pressed &= ~player.bashed;
  862. +     if(!pressed)
  863. X        pressed = player.pressed;
  864. X      valid = 0xF;
  865. X      /*{{{  work out valid direction and the edges*/
  866. ***************
  867. *** 799,804 ****
  868. --- 669,675 ----
  869. X        pressed &= 0x3;
  870. X      if(!pressed)
  871. X        {
  872. +     onestep = 0;
  873. X      monster.list[0].stop = 1;
  874. X      player.next_dir = 0;
  875. X        }
  876. ***************
  877. *** 805,811 ****
  878. X      else if((valid & pressed) == pressed)
  879. X        {
  880. X      unsigned  dir;
  881. !     
  882. X      if((pressed & 0x3) && (pressed & 0xC))
  883. X        pressed &= monster.list[0].dir & 2 ? 0x3 : 0xC;
  884. X      for(dir = 0; !(pressed & 1); dir++, pressed >>= 1)
  885. --- 676,682 ----
  886. X      else if((valid & pressed) == pressed)
  887. X        {
  888. X      unsigned  dir;
  889. !     
  890. X      if((pressed & 0x3) && (pressed & 0xC))
  891. X        pressed &= monster.list[0].dir & 2 ? 0x3 : 0xC;
  892. X      for(dir = 0; !(pressed & 1); dir++, pressed >>= 1)
  893. ***************
  894. *** 817,823 ****
  895. X      else
  896. X        {
  897. X      unsigned  dir;
  898. !     
  899. X      pressed &= ~valid;
  900. X      for(dir = 0; !(pressed & 1); pressed >>= 1)
  901. X        dir++;
  902. --- 688,694 ----
  903. X      else
  904. X        {
  905. X      unsigned  dir;
  906. !     
  907. X      pressed &= ~valid;
  908. X      for(dir = 0; !(pressed & 1); pressed >>= 1)
  909. X        dir++;
  910. ***************
  911. *** 878,884 ****
  912. X        player.bashed = 0x10;
  913. X    }
  914. X    /*}}}*/
  915. -   player.old_pressed = player.pressed;
  916. X    if(player.throw == 2)
  917. X      {
  918. X        if(!player.button)
  919. --- 749,754 ----
  920. ***************
  921. *** 887,893 ****
  922. X    else if(player.throw == 0)
  923. X      player.throw = player.button;
  924. X    if(dir != monster.list[0].dir)
  925. !     new_face(&monster.list[0]);
  926. X    if(monster.list[0].pause)
  927. X      {
  928. X        player.cherry = player.distance = 0;
  929. --- 757,767 ----
  930. X    else if(player.throw == 0)
  931. X      player.throw = player.button;
  932. X    if(dir != monster.list[0].dir)
  933. !     {
  934. !       if(was_stop || dir == monster.list[0].dir ^ 1)
  935. !     monster.list[0].pause = 1;
  936. !       new_face(&monster.list[0]);
  937. !     }
  938. X    if(monster.list[0].pause)
  939. X      {
  940. X        player.cherry = player.distance = 0;
  941. ***************
  942. *** 947,954 ****
  943. X            cptr->sprite < SPRITE_PRIZE_BASE + SPRITE_PRIZES)
  944. X          /*{{{  eat prize*/
  945. X          {
  946. !           int     score;
  947. !             
  948. X            history.prize |= 1;
  949. X            cptr->sprite = 0;
  950. X            score = player.screen * 500 + 500;
  951. --- 821,828 ----
  952. X            cptr->sprite < SPRITE_PRIZE_BASE + SPRITE_PRIZES)
  953. X          /*{{{  eat prize*/
  954. X          {
  955. !           unsigned  score;
  956. !                             
  957. X            history.prize |= 1;
  958. X            cptr->sprite = 0;
  959. X            score = player.screen * 500 + 500;
  960. ***************
  961. *** 964,969 ****
  962. --- 838,845 ----
  963. X          /*}}}*/
  964. X      }
  965. X      }
  966. +   if(!onestep)
  967. +     player.old_pressed = player.pressed;
  968. X    if(player.distance)
  969. X      player.distance--;
  970. X    else
  971. ***************
  972. *** 972,993 ****
  973. X    if(monster.list[0].stop ||
  974. X        monster.list[0].offset.x || monster.list[0].offset.y)
  975. X      /*EMPTY*/;
  976. -   else if(player.mouse_dir &&
  977. -       monster.list[0].cell.x == player.mouse.x &&
  978. -       monster.list[0].cell.y == player.mouse.y)
  979. -     {
  980. -       player.next_dir = player.mouse_dir = 0;
  981. -       monster.list[0].stop = 1;
  982. -     }
  983. -   else if(player.mouse_dir &&
  984. -       monster.list[0].dir != (player.mouse_dir & 3) &&
  985. -       (monster.list[0].cell.x == player.mouse.x ||
  986. -        monster.list[0].cell.y == player.mouse.y))
  987. -     {
  988. -       monster.list[0].dir = player.mouse_dir & 3;
  989. -       player.next_dir = 0;
  990. -       new_face(&monster.list[0]);
  991. -     }
  992. X    else if((!monster.list[0].cell.x && monster.list[0].dir == 2) ||
  993. X        (!monster.list[0].cell.y && monster.list[0].dir == 0) ||
  994. X        (monster.list[0].cell.x == CELLS_ACROSS - 1 &&
  995. --- 848,853 ----
  996. ***************
  997. *** 1005,1032 ****
  998. X        player.next_dir = 0;
  999. X        new_face(&monster.list[0]);
  1000. X      }
  1001. X    /*}}}*/
  1002. X    if(!monster.list[0].shot)
  1003. -     /*{{{  hit monster?*/
  1004. X      {
  1005. X        unsigned  i;
  1006. X        MONSTER   *mptr;
  1007. X        int       x, y;
  1008. X      
  1009. !       x = monster.list[0].pixel.x - CELL_WIDTH + GAP_WIDTH;
  1010. !       y = monster.list[0].pixel.y - CELL_HEIGHT + GAP_HEIGHT;
  1011. X        for(mptr = &monster.list[1], i = monster.monsters - 1; i--; mptr++)
  1012. !     if(!mptr->chew && !mptr->shot && !mptr->apple &&
  1013. !         mptr->pixel.x - x > 0 &&
  1014. !         mptr->pixel.x - x < 2 * (CELL_WIDTH - GAP_WIDTH) &&
  1015. !         mptr->pixel.y - y > 0 &&
  1016. !         mptr->pixel.y - y < 2 * (CELL_HEIGHT - GAP_HEIGHT))
  1017. X        {
  1018. !         monster.list[0].shot = 1;
  1019. !         break;
  1020. X        }
  1021. X      }
  1022. -     /*}}}*/
  1023. X    return;
  1024. X  }
  1025. X  /*}}}*/
  1026. --- 865,909 ----
  1027. X        player.next_dir = 0;
  1028. X        new_face(&monster.list[0]);
  1029. X      }
  1030. +   else if(onestep)
  1031. +     monster.list[0].stop = 1;
  1032. X    /*}}}*/
  1033. +   return;
  1034. + }
  1035. + /*}}}*/
  1036. + /*{{{  void killed_player()*/
  1037. + extern void killed_player FUNCARGVOID
  1038. + /* 
  1039. +  * sees if the player has walked into a live monster
  1040. +  */
  1041. + {
  1042. X    if(!monster.list[0].shot)
  1043. X      {
  1044. X        unsigned  i;
  1045. X        MONSTER   *mptr;
  1046. X        int       x, y;
  1047. X      
  1048. !       x = monster.list[0].pixel.x;
  1049. !       y = monster.list[0].pixel.y;
  1050. X        for(mptr = &monster.list[1], i = monster.monsters - 1; i--; mptr++)
  1051. !     if(!mptr->chew && !mptr->shot && !mptr->apple)
  1052. X        {
  1053. !         int     dx, dy;
  1054. !         
  1055. !         dx = mptr->pixel.x - x;
  1056. !         dy = mptr->pixel.y - y;
  1057. !         if(dx < 0)
  1058. !           dx = -1 - dx;
  1059. !         if(dy < 0)
  1060. !           dy = -1 - dy;
  1061. !         if(dx * CELL_HEIGHT + dy * CELL_WIDTH < 
  1062. !         CELL_WIDTH * CELL_HEIGHT)
  1063. !           {
  1064. !         monster.list[0].shot = 1;
  1065. !         break;
  1066. !           }
  1067. X        }
  1068. X      }
  1069. X    return;
  1070. X  }
  1071. X  /*}}}*/
  1072. diff -c -r exp.v1.01/timer.c exp.v2.00/timer.c
  1073. *** exp.v1.01/timer.c    Fri Jul 24 09:56:15 1992
  1074. --- exp.v2.00/timer.c    Fri Jul 24 13:43:20 1992
  1075. ***************
  1076. *** 1,21 ****
  1077. ! /*{{{  (C) 1992 Nathan Sidwell*/
  1078. ! /*****************************************************************************
  1079. !             X M R I S V1.01
  1080. !             ---------------
  1081. !             (C) 1992 Nathan Sidwell
  1082. ! This program is copyright (C) 1992 Nathan Sidwell. This software and documentation
  1083. ! is in the public domain. Permission is granted to distribute and compile
  1084. ! verbatim copies of this software for non-commercial, non-profit use,
  1085. ! without fee. The software may be modified, provided that both the above copyright
  1086. ! notice and this permission notice appear.
  1087. ! No guarantee is given as to the robustness or suitability of this
  1088. ! software for your computer.
  1089. ! Nathan Sidwell  INMOS UK |                 | nathan@inmos.co.uk       DoD#0390
  1090. ! *****************************************************************************/
  1091. ! /*}}}*/
  1092. X  #include "xmris.h"
  1093. X  #include <time.h>
  1094. X  #include <sys/time.h>
  1095. --- 1,4 ----
  1096. ! /* (C) 1992 Nathan Sidwell */
  1097. X  #include "xmris.h"
  1098. X  #include <time.h>
  1099. X  #include <sys/time.h>
  1100. ***************
  1101. *** 89,95 ****
  1102. X    timer.interval.it_value.tv_usec = 0;
  1103. X    timer_wait();
  1104. X    XDrawLine(display.display, display.window, GCN(GC_BALL),
  1105. !       WINDOW_WIDTH - global.missed, WINDOW_HEIGHT - 1,
  1106. X        WINDOW_WIDTH, WINDOW_HEIGHT - 1);
  1107. X    global.missed = 0;
  1108. X    return;
  1109. --- 72,78 ----
  1110. X    timer.interval.it_value.tv_usec = 0;
  1111. X    timer_wait();
  1112. X    XDrawLine(display.display, display.window, GCN(GC_BALL),
  1113. !       WINDOW_WIDTH - (int)global.missed, WINDOW_HEIGHT - 1,
  1114. X        WINDOW_WIDTH, WINDOW_HEIGHT - 1);
  1115. X    global.missed = 0;
  1116. X    return;
  1117. ***************
  1118. *** 104,129 ****
  1119. X  {
  1120. X    if(!timer.counter)
  1121. X      {
  1122. X        int     mask;
  1123. X        
  1124. X        mask = sigblock(sigmask(SIGALRM));
  1125. X        if(!timer.counter)
  1126. X      {
  1127. X        if(global.missed)
  1128. X          {
  1129. X            XDrawPoint(display.display, display.window, GCN(GC_BALL),
  1130. !           WINDOW_WIDTH - global.missed, WINDOW_HEIGHT - 1);
  1131. X            global.missed--;
  1132. X          }
  1133. X        sigpause(0);
  1134. X      }
  1135. X        sigsetmask(mask);
  1136. X      }
  1137. X    else if(global.missed < WINDOW_WIDTH)
  1138. X      {
  1139. X        global.missed++;
  1140. X        XDrawPoint(display.display, display.window, GCN(GC_BALL),
  1141. !       WINDOW_WIDTH - global.missed, WINDOW_HEIGHT - 1);
  1142. X      }
  1143. X    timer.counter = 0;
  1144. X    setitimer(ITIMER_REAL, &timer.interval, (struct itimerval *)NULL);
  1145. --- 87,120 ----
  1146. X  {
  1147. X    if(!timer.counter)
  1148. X      {
  1149. + #ifdef SYSV
  1150. +     sighold(SIGALRM);
  1151. + #else
  1152. X        int     mask;
  1153. X        
  1154. X        mask = sigblock(sigmask(SIGALRM));
  1155. + #endif
  1156. X        if(!timer.counter)
  1157. X      {
  1158. X        if(global.missed)
  1159. X          {
  1160. X            XDrawPoint(display.display, display.window, GCN(GC_BALL),
  1161. !           WINDOW_WIDTH - (int)global.missed, WINDOW_HEIGHT - 1);
  1162. X            global.missed--;
  1163. X          }
  1164. X        sigpause(0);
  1165. X      }
  1166. + #ifdef SYSV
  1167. +       sigrelse(SIGALRM);
  1168. + #else
  1169. X        sigsetmask(mask);
  1170. + #endif
  1171. X      }
  1172. X    else if(global.missed < WINDOW_WIDTH)
  1173. X      {
  1174. X        global.missed++;
  1175. X        XDrawPoint(display.display, display.window, GCN(GC_BALL),
  1176. !       WINDOW_WIDTH - (int)global.missed, WINDOW_HEIGHT - 1);
  1177. X      }
  1178. X    timer.counter = 0;
  1179. X    setitimer(ITIMER_REAL, &timer.interval, (struct itimerval *)NULL);
  1180. Only in exp.v1.01: xmris.01
  1181. Only in exp.v1.01: xmris.02
  1182. Only in exp.v1.01: xmris.03
  1183. Only in exp.v1.01: xmris.04
  1184. Only in exp.v1.01: xmris.05
  1185. Only in exp.v1.01: xmris.06
  1186. Only in exp.v1.01: xmris.07
  1187. Only in exp.v1.01: xmris.08
  1188. Only in exp.v1.01: xmris.09
  1189. diff -c -r exp.v1.01/xmris.c exp.v2.00/xmris.c
  1190. *** exp.v1.01/xmris.c    Fri Jul 24 09:56:16 1992
  1191. --- exp.v2.00/xmris.c    Fri Jul 24 13:43:22 1992
  1192. ***************
  1193. *** 1,30 ****
  1194. ! /*{{{  (C) 1992 Nathan Sidwell*/
  1195. ! /*****************************************************************************
  1196. !             X M R I S V1.01
  1197. !             ---------------
  1198. !             (C) 1992 Nathan Sidwell
  1199. ! This program is copyright (C) 1992 Nathan Sidwell. This software and documentation
  1200. ! is in the public domain. Permission is granted to distribute and compile
  1201. ! verbatim copies of this software for non-commercial, non-profit use,
  1202. ! without fee. The software may be modified, provided that both the above copyright
  1203. ! notice and this permission notice appear.
  1204. ! No guarantee is given as to the robustness or suitability of this
  1205. ! software for your computer.
  1206. ! Nathan Sidwell  INMOS UK |                 | nathan@inmos.co.uk       DoD#0390
  1207. ! *****************************************************************************/
  1208. ! /*}}}*/
  1209. X  #include "xmris.h"
  1210. X  #include <time.h>
  1211. X  /*{{{  prototypes*/
  1212. X  static void age_scores PROTOARGLIST((void));
  1213. X  static void parse_args PROTOARGLIST((int, char **));
  1214. X  /*}}}*/
  1215. X  /*{{{  void add_score(increment, x, y)*/
  1216. X  extern void add_score FUNCARGLIST((points, x, y))
  1217. ! int       points  FUNCARGSEP
  1218. X  int       x       FUNCARGSEP
  1219. X  int       y       FUNCARGTERM
  1220. X  /*
  1221. --- 1,14 ----
  1222. ! /* (C) 1992 Nathan Sidwell */
  1223. X  #include "xmris.h"
  1224. X  #include <time.h>
  1225. X  /*{{{  prototypes*/
  1226. X  static void age_scores PROTOARGLIST((void));
  1227. X  static void parse_args PROTOARGLIST((int, char **));
  1228. + static int xio_error PROTOARGLIST((Display *));
  1229. X  /*}}}*/
  1230. X  /*{{{  void add_score(increment, x, y)*/
  1231. X  extern void add_score FUNCARGLIST((points, x, y))
  1232. ! unsigned  points  FUNCARGSEP
  1233. X  int       x       FUNCARGSEP
  1234. X  int       y       FUNCARGTERM
  1235. X  /*
  1236. ***************
  1237. *** 38,58 ****
  1238. X    {
  1239. X      unsigned  length;
  1240. X      char      text[10];
  1241. -     int       ascent, descent;
  1242. -     int       direction;
  1243. -     XCharStruct chars;
  1244. X      int       x, y;
  1245. X      
  1246. X      length = itoa(text, player.score, 0);
  1247. !     XQueryTextExtents(display.display, font.font, text, length,
  1248. !     &direction, &ascent, &descent, &chars);
  1249. !     x = BORDER_LEFT + (CELL_WIDTH + GAP_WIDTH) * 4 -
  1250. !     CELL_WIDTH / 2 - chars.width;
  1251. !     y = (CELL_HEIGHT - ascent - descent) / 2 + ascent +
  1252. !     BORDER_TOP - CELL_HEIGHT;
  1253. X      XDrawImageString(display.display, display.back, GCN(GC_TEXT),
  1254. !     x, y, text, length);
  1255. !     add_background(x, y - ascent, chars.width, ascent + descent);
  1256. X    }
  1257. X    /*}}}*/
  1258. X    /*{{{  board score?*/
  1259. --- 22,36 ----
  1260. X    {
  1261. X      unsigned  length;
  1262. X      char      text[10];
  1263. X      int       x, y;
  1264. X      
  1265. X      length = itoa(text, player.score, 0);
  1266. !     x = PIXELX(4, -GAP_WIDTH) - (length + 2) * font.width;
  1267. !     y = PIXELY(-1, CELL_HEIGHT / 2) + font.center;
  1268. X      XDrawImageString(display.display, display.back, GCN(GC_TEXT),
  1269. !     x, y, text, (int)length);
  1270. !     add_background(x, y - font.ascent, 
  1271. !     length * font.width, (unsigned)(font.ascent + font.descent));
  1272. X    }
  1273. X    /*}}}*/
  1274. X    /*{{{  board score?*/
  1275. ***************
  1276. *** 74,80 ****
  1277. X            DIGIT_WIDTH * 4, DIGIT_HEIGHT);
  1278. X        update.score.scores--;
  1279. X        memmove(&update.score.list[0], &update.score.list[1],
  1280. !           sizeof(SCORE) * update.score.scores);
  1281. X      }
  1282. X        /*}}}*/
  1283. X        sptr = &update.score.list[update.score.scores++];
  1284. --- 52,58 ----
  1285. X            DIGIT_WIDTH * 4, DIGIT_HEIGHT);
  1286. X        update.score.scores--;
  1287. X        memmove(&update.score.list[0], &update.score.list[1],
  1288. !           (size_t)(sizeof(SCORE) * update.score.scores));
  1289. X      }
  1290. X        /*}}}*/
  1291. X        sptr = &update.score.list[update.score.scores++];
  1292. ***************
  1293. *** 86,98 ****
  1294. X      {
  1295. X        x = (4 - length) * (DIGIT_WIDTH / 2);
  1296. X        XCopyArea(display.display, dptr->image, sptr->image, GCN(GC_COPY),
  1297. !           10 * DIGIT_WIDTH, 0, x, DIGIT_HEIGHT, 0, 0);
  1298. X        XCopyArea(display.display, dptr->image, sptr->image, GCN(GC_COPY),
  1299. !           10 * DIGIT_WIDTH, 0, x, DIGIT_HEIGHT, 4 * DIGIT_WIDTH - x, 0);
  1300. X        XCopyArea(display.display, dptr->mask, sptr->mask, GCN(GC_COPY),
  1301. !           10 * DIGIT_WIDTH, 0, x, DIGIT_HEIGHT, 0, 0);
  1302. X        XCopyArea(display.display, dptr->mask, sptr->mask, GCN(GC_COPY),
  1303. !           10 * DIGIT_WIDTH, 0, x, DIGIT_HEIGHT, 4 * DIGIT_WIDTH - x, 0);
  1304. X      }
  1305. X        else
  1306. X      x = 0;
  1307. --- 64,76 ----
  1308. X      {
  1309. X        x = (4 - length) * (DIGIT_WIDTH / 2);
  1310. X        XCopyArea(display.display, dptr->image, sptr->image, GCN(GC_COPY),
  1311. !           10 * DIGIT_WIDTH, 0, (unsigned)x, DIGIT_HEIGHT, 0, 0);
  1312. X        XCopyArea(display.display, dptr->image, sptr->image, GCN(GC_COPY),
  1313. !           10 * DIGIT_WIDTH, 0, (unsigned)x, DIGIT_HEIGHT, 4 * DIGIT_WIDTH - x, 0);
  1314. X        XCopyArea(display.display, dptr->mask, sptr->mask, GCN(GC_COPY),
  1315. !           10 * DIGIT_WIDTH, 0, (unsigned)x, DIGIT_HEIGHT, 0, 0);
  1316. X        XCopyArea(display.display, dptr->mask, sptr->mask, GCN(GC_COPY),
  1317. !           10 * DIGIT_WIDTH, 0, (unsigned)x, DIGIT_HEIGHT, 4 * DIGIT_WIDTH - x, 0);
  1318. X      }
  1319. X        else
  1320. X      x = 0;
  1321. ***************
  1322. *** 242,252 ****
  1323. X    exit(1);
  1324. X  }
  1325. X  /*}}}*/
  1326. ! /*{{{  int itoa(text, n, width)*/
  1327. ! extern int itoa FUNCARGLIST((text, number, digits))
  1328. ! char    *text   FUNCARGSEP  /* output text (include 0) */
  1329. ! int     number  FUNCARGSEP  /* number to convert */
  1330. ! int     digits  FUNCARGTERM /* field width to convert into */
  1331. X  /*
  1332. X   * formats an integer to a string
  1333. X   * in the specified number of digits
  1334. --- 220,230 ----
  1335. X    exit(1);
  1336. X  }
  1337. X  /*}}}*/
  1338. ! /*{{{  unsigned itoa(text, n, width)*/
  1339. ! extern unsigned itoa FUNCARGLIST((text, number, digits))
  1340. ! char      *text   FUNCARGSEP  /* output text (include 0) */
  1341. ! unsigned  number  FUNCARGSEP  /* number to convert */
  1342. ! unsigned  digits  FUNCARGTERM /* field width to convert into */
  1343. X  /*
  1344. X   * formats an integer to a string
  1345. X   * in the specified number of digits
  1346. ***************
  1347. *** 288,300 ****
  1348. X  char    **argv  FUNCARGTERM
  1349. X  {
  1350. X  #ifndef __STDC__
  1351. !   sprintf(title_text[1], "%s %s", XMRISVERSION, DATE);
  1352. X  #endif
  1353. X    /*{{{  set defaults*/
  1354. X    {
  1355. X      argv[argc] = NULL;
  1356. X      display.name = NULL;
  1357. -     font.name = FONT_NAME;
  1358. X      flags.gender = GAME_GENDER;
  1359. X    }
  1360. X    /*}}}*/
  1361. --- 266,277 ----
  1362. X  char    **argv  FUNCARGTERM
  1363. X  {
  1364. X  #ifndef __STDC__
  1365. !   sprintf(title_text[1].text, "%s %s", XMRISVERSION, DATE);
  1366. X  #endif
  1367. X    /*{{{  set defaults*/
  1368. X    {
  1369. X      argv[argc] = NULL;
  1370. X      display.name = NULL;
  1371. X      flags.gender = GAME_GENDER;
  1372. X    }
  1373. X    /*}}}*/
  1374. ***************
  1375. *** 315,332 ****
  1376. X            break;
  1377. X      }
  1378. X        fprintf(stderr, "%s [option ...]\n", ptr);
  1379. !       fprintf(stderr, "%s %s\n", game_name, title_text[1]);
  1380. !       fprintf(stderr, "%s\n", title_text[0]);
  1381. X        for(aptr = args; aptr->arg; aptr++)
  1382. X      fprintf(stderr, "  %-8s %s\n", aptr->arg, aptr->help);
  1383. X        return 0;
  1384. X      }
  1385. X    /*}}}*/
  1386. X    create_resources(argc, argv);
  1387. X    timer_open();
  1388. X    XMapWindow(display.display, display.window);
  1389. -   XSelectInput(display.display, display.window, display.event_mask |
  1390. -       KeyPressMask | ButtonPressMask | KeyReleaseMask | PointerMotionMask);
  1391. X    while(!demo_mode())
  1392. X      /*{{{  game*/
  1393. X      {
  1394. --- 292,326 ----
  1395. X            break;
  1396. X      }
  1397. X        fprintf(stderr, "%s [option ...]\n", ptr);
  1398. !       fprintf(stderr, "%s %s\n", game_name, title_text[1].text);
  1399. !       fprintf(stderr, "%s\n", title_text[0].text);
  1400. X        for(aptr = args; aptr->arg; aptr++)
  1401. X      fprintf(stderr, "  %-8s %s\n", aptr->arg, aptr->help);
  1402. X        return 0;
  1403. X      }
  1404. X    /*}}}*/
  1405. +   display.display = XOpenDisplay(display.name);
  1406. +   /*{{{  opened?*/
  1407. +   if(!display.display)
  1408. +     fatal_error("Cannot open display \"%s\"",
  1409. +     display.name ? display.name : "DEFAULT", stderr);
  1410. +   /*}}}*/
  1411. +   read_xdefaults();
  1412. +   if(!font.name)
  1413. +     font.name = FONT_NAME;
  1414. +   if(!score_file)
  1415. +     score_file = SCORE_FILE;
  1416. X    create_resources(argc, argv);
  1417. + #if !HIGH_SCORE_FILE
  1418. +   if(score_file)
  1419. +     fputs("Warning: High score file not supported\n", stderr);
  1420. + #endif
  1421. +   init_scores();
  1422. +   XSetIOErrorHandler(xio_error);
  1423. X    timer_open();
  1424. +   XSelectInput(display.display, display.window, (int)display.event_mask |
  1425. +       KeyPressMask | KeyReleaseMask | EnterWindowMask | LeaveWindowMask);
  1426. X    XMapWindow(display.display, display.window);
  1427. X    while(!demo_mode())
  1428. X      /*{{{  game*/
  1429. X      {
  1430. ***************
  1431. *** 338,344 ****
  1432. X        player.lives = START_LIVES;
  1433. X        player.score = 0;
  1434. X        player.screen = 0;
  1435. !       player.pressed = 0;
  1436. X        while(player.lives)
  1437. X      {
  1438. X        new_board();
  1439. --- 332,338 ----
  1440. X        player.lives = START_LIVES;
  1441. X        player.score = 0;
  1442. X        player.screen = 0;
  1443. !       /*{{{  bop til you drop*/
  1444. X        while(player.lives)
  1445. X      {
  1446. X        new_board();
  1447. ***************
  1448. *** 354,362 ****
  1449. X            count = SCORE_SHOW;
  1450. X            /*{{{  initialize stuff*/
  1451. X            {
  1452. !         player.mouse.x = PLAYER_START_X;
  1453. !         player.mouse.y = PLAYER_START_Y;
  1454. !         player.mouse_dir = player.next_dir = 0;
  1455. X          global.state = 0;
  1456. X          monster.monsters = 0;
  1457. X          monster.delay = 0;
  1458. --- 348,354 ----
  1459. X            count = SCORE_SHOW;
  1460. X            /*{{{  initialize stuff*/
  1461. X            {
  1462. !         player.next_dir = 0;
  1463. X          global.state = 0;
  1464. X          monster.monsters = 0;
  1465. X          monster.delay = 0;
  1466. ***************
  1467. *** 365,370 ****
  1468. --- 357,363 ----
  1469. X          spawn_monster(4, 2, 2, PLAYER_START_X, PLAYER_START_Y, 0, 0);
  1470. X          monster.list[0].stop = 1;
  1471. X          player.pressed = 0;
  1472. +         player.bashed = 0;
  1473. X          player.ball.state = 8;
  1474. X          player.ball.count = 0;
  1475. X          player.old_ball.state = 0;
  1476. ***************
  1477. *** 378,384 ****
  1478. X            while(count)
  1479. X            {
  1480. X          age_scores();
  1481. !         if(process_xevents(1))
  1482. X            {
  1483. X              player.lives = 1;
  1484. X              monster.list[0].shot = 1;
  1485. --- 371,377 ----
  1486. X            while(count)
  1487. X            {
  1488. X          age_scores();
  1489. !         if(process_xevents(!monster.list[0].shot))
  1490. X            {
  1491. X              player.lives = 1;
  1492. X              monster.list[0].shot = 1;
  1493. ***************
  1494. *** 399,410 ****
  1495. X                {
  1496. X              monster.delay--;
  1497. X              if(!(monster.delay % DEN_ESCAPE_FLASH))
  1498. !               draw_center(monster.delay / DEN_ESCAPE_FLASH &
  1499. !                   1 ? SPRITE_NORMAL + 4 : SPRITE_DEN);
  1500. X              if(!monster.delay)
  1501. X                {
  1502. X                  MONSTER   *mptr;
  1503. !                                                   
  1504. X                  mptr = spawn_monster(0, 2, 2, DEN_X, DEN_Y, 0, 0);
  1505. X                  monster.den--;
  1506. X                  if(!monster.den)
  1507. --- 392,403 ----
  1508. X                {
  1509. X              monster.delay--;
  1510. X              if(!(monster.delay % DEN_ESCAPE_FLASH))
  1511. !               draw_center((unsigned)(monster.delay / DEN_ESCAPE_FLASH &
  1512. !                   1 ? SPRITE_NORMAL + 4 : SPRITE_DEN));
  1513. X              if(!monster.delay)
  1514. X                {
  1515. X                  MONSTER   *mptr;
  1516. !                                                                                                   
  1517. X                  mptr = spawn_monster(0, 2, 2, DEN_X, DEN_Y, 0, 0);
  1518. X                  monster.den--;
  1519. X                  if(!monster.den)
  1520. ***************
  1521. *** 421,426 ****
  1522. --- 414,420 ----
  1523. X              !monster.den && !monster.drones)
  1524. X            global.state = 3;
  1525. X          fall_monsters();
  1526. +         killed_player();
  1527. X          /*{{{  ending?*/
  1528. X          if(global.state == 4)
  1529. X            {
  1530. ***************
  1531. *** 430,436 ****
  1532. X                {
  1533. X              APPLE   *aptr;
  1534. X              int     i;
  1535. !                                             
  1536. X              for(aptr = apple.list, i = apple.apples; i--; aptr++)
  1537. X                if(aptr->state)
  1538. X                  {
  1539. --- 424,430 ----
  1540. X                {
  1541. X              APPLE   *aptr;
  1542. X              int     i;
  1543. !                                                                                             
  1544. X              for(aptr = apple.list, i = apple.apples; i--; aptr++)
  1545. X                if(aptr->state)
  1546. X                  {
  1547. ***************
  1548. *** 452,458 ****
  1549. X          if(!extra.escape)
  1550. X            {
  1551. X              unsigned  temp;
  1552. !                                             
  1553. X              if(random() < NEXT_XTRA_PROB)
  1554. X                new_xtra();
  1555. X              temp = player.score / 5000;
  1556. --- 446,452 ----
  1557. X          if(!extra.escape)
  1558. X            {
  1559. X              unsigned  temp;
  1560. !                                                                                             
  1561. X              if(random() < NEXT_XTRA_PROB)
  1562. X                new_xtra();
  1563. X              temp = player.score / 5000;
  1564. ***************
  1565. *** 497,503 ****
  1566. X            unsigned  i;
  1567. X            unsigned  base, offset;
  1568. X            MONSTER   *mptr;
  1569. !                                         
  1570. X            player.ball.count = 8;
  1571. X            i = monster.list[0].face;
  1572. X            if(i >= 6)
  1573. --- 491,497 ----
  1574. X            unsigned  i;
  1575. X            unsigned  base, offset;
  1576. X            MONSTER   *mptr;
  1577. !                                                                                         
  1578. X            player.ball.count = 8;
  1579. X            i = monster.list[0].face;
  1580. X            if(i >= 6)
  1581. ***************
  1582. *** 511,517 ****
  1583. X            for(i = 0; i != 8; i++)
  1584. X              {
  1585. X                unsigned  delay;
  1586. !                                         
  1587. X                if(process_xevents(0))
  1588. X              player.lives = 1;
  1589. X                monster.list[0].type =
  1590. --- 505,511 ----
  1591. X            for(i = 0; i != 8; i++)
  1592. X              {
  1593. X                unsigned  delay;
  1594. !                                                                                         
  1595. X                if(process_xevents(0))
  1596. X              player.lives = 1;
  1597. X                monster.list[0].type =
  1598. ***************
  1599. *** 528,536 ****
  1600. X            if(player.lives)
  1601. X              {
  1602. X                XFillRectangle(display.display, display.back, GCN(GC_CLEAR),
  1603. !               PIXELX(player.lives - 1, 0), PIXELY(CELLS_DOWN, 0),
  1604. X                CELL_WIDTH, CELL_HEIGHT);
  1605. !               add_background(PIXELX(player.lives - 1, 0),
  1606. X                PIXELY(CELLS_DOWN, 0), CELL_WIDTH, CELL_HEIGHT);
  1607. X              }
  1608. X            if(extra.escape)
  1609. --- 522,530 ----
  1610. X            if(player.lives)
  1611. X              {
  1612. X                XFillRectangle(display.display, display.back, GCN(GC_CLEAR),
  1613. !               PIXELX((int)player.lives - 1, 0), PIXELY(CELLS_DOWN, 0),
  1614. X                CELL_WIDTH, CELL_HEIGHT);
  1615. !               add_background(PIXELX((int)player.lives - 1, 0),
  1616. X                PIXELY(CELLS_DOWN, 0), CELL_WIDTH, CELL_HEIGHT);
  1617. X              }
  1618. X            if(extra.escape)
  1619. ***************
  1620. *** 547,552 ****
  1621. --- 541,548 ----
  1622. X        while(monster.list[0].shot && player.lives);
  1623. X        timer_stop();
  1624. X      }
  1625. +       /*}}}*/
  1626. +       high_score(player.score, player.screen);
  1627. X      }
  1628. X      /*}}}*/
  1629. X    release_resources();
  1630. ***************
  1631. *** 583,589 ****
  1632. X    /*{{{  parse all the arguments*/
  1633. X    while(*++vptr)
  1634. X      {
  1635. !       while(**vptr != '-')
  1636. X      vptr++;
  1637. X        if(*vptr)
  1638. X      {
  1639. --- 579,585 ----
  1640. X    /*{{{  parse all the arguments*/
  1641. X    while(*++vptr)
  1642. X      {
  1643. !       while(*vptr && **vptr != '-')
  1644. X      vptr++;
  1645. X        if(*vptr)
  1646. X      {
  1647. ***************
  1648. *** 609,625 ****
  1649. X  extern int process_xevents FUNCARGLIST((pausable))
  1650. X  int     pausable  FUNCARGTERM
  1651. X  {
  1652. X    int       quit;
  1653. X    int       paused;
  1654. X  
  1655. !   player.motionevent = 0;
  1656. X    quit = 0;
  1657. !   paused = 0;
  1658. X    /*{{{  read the events*/
  1659. X    while(QLength(display.display) || paused)
  1660. X      {
  1661. X        XEvent    event;
  1662. X      
  1663. X        XNextEvent(display.display, &event);
  1664. X        if(event.xany.window != display.window)
  1665. X      continue;
  1666. --- 605,647 ----
  1667. X  extern int process_xevents FUNCARGLIST((pausable))
  1668. X  int     pausable  FUNCARGTERM
  1669. X  {
  1670. +   static    int outside = 0;
  1671. X    int       quit;
  1672. X    int       paused;
  1673. X  
  1674. !   if(flags.iconic)
  1675. !     {
  1676. !       flags.iconic = 0;
  1677. !       XIconifyWindow(display.display, display.window, display.screen);
  1678. !     }
  1679. X    quit = 0;
  1680. !   paused = (pausable && outside) || (global.state == MODE_KEY_DEF ? 2 : 0);
  1681. X    /*{{{  read the events*/
  1682. X    while(QLength(display.display) || paused)
  1683. X      {
  1684. X        XEvent    event;
  1685. X      
  1686. +       /*{{{  started to pause?*/
  1687. +       if(paused == 1)
  1688. +     {
  1689. +       char const *text = "Space to continue, Q to quit";
  1690. +       unsigned  length;
  1691. +         
  1692. +       paused++;
  1693. +       length = strlen(text);
  1694. +       add_background(0, PIXELY(CELLS_DOWN, 0), WINDOW_WIDTH, CELL_HEIGHT);
  1695. +       XFillRectangle(display.display, display.copy, GCN(GC_CLEAR),
  1696. +           0, PIXELY(CELLS_DOWN, 0), WINDOW_WIDTH, CELL_HEIGHT);
  1697. +       XDrawImageString(display.display, display.copy, GCN(GC_TEXT),
  1698. +           WINDOW_WIDTH / 2 - (int)(length * font.width / 2),
  1699. +           PIXELY(CELLS_DOWN, CELL_HEIGHT / 2) + font.center,
  1700. +           text, (int)length);
  1701. +       XCopyArea(display.display, display.copy, display.window, GCN(GC_COPY),
  1702. +           0, PIXELY(CELLS_DOWN, 0), WINDOW_WIDTH, CELL_HEIGHT,
  1703. +           0, PIXELY(CELLS_DOWN, 0));
  1704. +       XSync(display.display, False);
  1705. +     }
  1706. +       /*}}}*/
  1707. X        XNextEvent(display.display, &event);
  1708. X        if(event.xany.window != display.window)
  1709. X      continue;
  1710. ***************
  1711. *** 632,669 ****
  1712. X       * a control key. If so, then we set the relevant pressed bit.
  1713. X       */
  1714. X      {
  1715. -       char      chr;
  1716. X        KeySym    symbol;
  1717. !       XComposeStatus status;
  1718. SHAR_EOF
  1719. true || echo 'restore of patch.v2.00 failed'
  1720. fi
  1721. echo 'End of  part 4'
  1722. echo 'File patch.v2.00 is continued in part 5'
  1723. echo 5 > _shar_seq_.tmp
  1724. exit 0
  1725. -- 
  1726. Senior Systems Scientist        mail: dcmartin@msi.com
  1727. Molecular Simulations, Inc.        uucp: uunet!dcmartin
  1728. 796 North Pastoria Avenue        at&t: 408/522-9236
  1729. Sunnyvale, California 94086        fax: 408/732-0831
  1730.