home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / games / volume11 / vcraps / patch2 / patches02
Text File  |  1990-08-28  |  5KB  |  192 lines

  1. *** dist/vcraps.c    Fri Aug 24 13:22:14 1990
  2. --- vcraps.c    Fri Aug 24 13:13:39 1990
  3. ***************
  4. *** 2,11 ****
  5.   #include <curses.h>
  6.   #include <setjmp.h>
  7.   
  8.   extern int      CrapsErrorDatum;
  9.   extern int      optind;
  10. ! extern char    *optarg;
  11.   
  12.   jmp_buf         LoopEnv;
  13.   
  14.   WINDOW         *dontplace4win, *dontplace5win, *dontplace6win, *dontplace8win;
  15. --- 2,16 ----
  16.   #include <curses.h>
  17.   #include <setjmp.h>
  18.   
  19. + #define MSGQUEUELEN (20)
  20.   extern int      CrapsErrorDatum;
  21.   extern int      optind;
  22. ! extern char    *optarg, *malloc();
  23.   
  24. + int             MsgQueueLen, MsgQueueLatest;
  25. + char           *MsgQueue[MSGQUEUELEN];
  26.   jmp_buf         LoopEnv;
  27.   
  28.   WINDOW         *dontplace4win, *dontplace5win, *dontplace6win, *dontplace8win;
  29. ***************
  30. *** 123,128 ****
  31. --- 128,135 ----
  32.   {
  33.       int             c;
  34.   
  35. +     MsgQueueLen = 0;
  36. +     MsgQueueLatest = -1;
  37.       init();
  38.       Craps_SetBankroll(&Table, 1000);
  39.       while ((c = getopt(argc, argv, "b:sx")) != EOF) {
  40. ***************
  41. *** 147,152 ****
  42. --- 154,160 ----
  43.   Driver()
  44.   {
  45.       int             c, amount, fullupdate = 1, jmpval, die1, die2, i;
  46. +     int             msgptr, msgcount;
  47.       char            buf[20];
  48.       CrapsError_t    err;
  49.       CrapsTable_t   *t = &Table;
  50. ***************
  51. *** 159,168 ****
  52.       Update(fullupdate);
  53.       bcopy(&Table, &OldTable, (sizeof(CrapsTable_t)));
  54.       fullupdate = 0;
  55. !     Prompt("Command [12345689abcdfhprt$X?]:");
  56.       wclear(commandwin);
  57.       wrefresh(commandwin);
  58. !     c = Getch("12345689abcdfhprt$X?", 1);
  59.       switch (c) {
  60.           case '1':
  61.           Prompt("[012]:");
  62. --- 167,176 ----
  63.       Update(fullupdate);
  64.       bcopy(&Table, &OldTable, (sizeof(CrapsTable_t)));
  65.       fullupdate = 0;
  66. !     Prompt("Command [12345689abcdfhmprt$X?]:");
  67.       wclear(commandwin);
  68.       wrefresh(commandwin);
  69. !     c = Getch("12345689abcdfhmprt$X?", 1);
  70.       switch (c) {
  71.           case '1':
  72.           Prompt("[012]:");
  73. ***************
  74. *** 546,551 ****
  75. --- 554,575 ----
  76.               break;
  77.           }
  78.           break;
  79. +         case 'm':
  80. +         msgptr = MsgQueueLatest;
  81. +         msgcount = 0;
  82. +         do {
  83. +             if (++msgcount > MsgQueueLen)
  84. +             c = ' ';
  85. +             else {
  86. +             wcenter(msgwin, MsgQueue[msgptr], 0, 0);
  87. +             wrefresh(msgwin);
  88. +             msgptr = (msgptr - 1 + MSGQUEUELEN) % MSGQUEUELEN;
  89. +             c = wgetch(msgwin);
  90. +             wclear(msgwin);
  91. +             }
  92. +         } while (c != ' ');
  93. +         wrefresh(msgwin);
  94. +         break;
  95.           case 'p':
  96.           if (Craps_Point(&Table)) {
  97.               Prompt("Amount for odds on Pass Line:");
  98. ***************
  99. *** 885,893 ****
  100.   Message(str)
  101.   char           *str;
  102.   {
  103.       wcenter(msgwin, str, 0, 0);
  104.       wrefresh(msgwin);
  105. !     while (wgetch(msgwin) != ' ');
  106.       wclear(msgwin);
  107.       wrefresh(msgwin);
  108.   }
  109. --- 909,942 ----
  110.   Message(str)
  111.   char           *str;
  112.   {
  113. +     char           *copy = malloc(1 + strlen(str));
  114. +     int             c, msgptr, msgcount;
  115. +     if (copy) {
  116. +     strcpy(copy, str);
  117. +     MsgQueueLatest = (MsgQueueLatest + 1) % MSGQUEUELEN;
  118. +     if (MsgQueueLen == MSGQUEUELEN)
  119. +         free(MsgQueue[MsgQueueLatest]);
  120. +     else
  121. +         ++MsgQueueLen;
  122. +     MsgQueue[MsgQueueLatest] = copy;
  123. +     }
  124. +     msgptr = (MsgQueueLatest - 1 + MSGQUEUELEN) % MSGQUEUELEN;
  125. +     msgcount = 1;
  126.       wcenter(msgwin, str, 0, 0);
  127.       wrefresh(msgwin);
  128. !     do {
  129. !     c = wgetch(msgwin);
  130. !     if (c == 'm') {
  131. !         if (++msgcount > MsgQueueLen)
  132. !         c = ' ';
  133. !         else {
  134. !         wcenter(msgwin, MsgQueue[msgptr], 0, 0);
  135. !         wrefresh(msgwin);
  136. !         msgptr = (msgptr - 1 + MSGQUEUELEN) % MSGQUEUELEN;
  137. !         }
  138. !     }
  139. !     } while (c != ' ');
  140.       wclear(msgwin);
  141.       wrefresh(msgwin);
  142.   }
  143. ***************
  144. *** 1697,1704 ****
  145.       addstr("4dc - don't-come odds on 4    4dp - don't place 4\n\n");
  146.       addstr("Bets are taken down by typing t followed by one of the\n");
  147.       addstr("bet commands above.\n\n");
  148. !     addstr("$   - show total bets         X   - Exit program\n");
  149. !     addstr("                                                    continue...");
  150.       refresh();
  151.       getch();
  152.       longjmp(LoopEnv, 2);
  153. --- 1746,1753 ----
  154.       addstr("4dc - don't-come odds on 4    4dp - don't place 4\n\n");
  155.       addstr("Bets are taken down by typing t followed by one of the\n");
  156.       addstr("bet commands above.\n\n");
  157. !     addstr("$ - show total bets   m - review messages   X - exit\n");
  158. !     addstr("                                                        continue...");
  159.       refresh();
  160.       getch();
  161.       longjmp(LoopEnv, 2);
  162. ***************
  163. *** 1706,1713 ****
  164.   
  165.   ShowTotal()
  166.   {
  167. !     int i, total = 0;
  168. !     char buf[80];
  169.   
  170.       for (i = craps_PassLine; i < craps_Bets; ++i)
  171.       total += Craps_GetBet(&Table, i);
  172. --- 1755,1762 ----
  173.   
  174.   ShowTotal()
  175.   {
  176. !     int             i, total = 0;
  177. !     char            buf[80];
  178.   
  179.       for (i = craps_PassLine; i < craps_Bets; ++i)
  180.       total += Craps_GetBet(&Table, i);
  181.  
  182. *** patchlevel.h.orig    Fri Aug 24 11:04:33 1990
  183. --- patchlevel.h    Fri Aug 24 12:09:14 1990
  184. ***************
  185. *** 1 ****
  186. ! #define PATCHLEVEL    1
  187. --- 1 ----
  188. ! #define PATCHLEVEL    2
  189.