home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 October
/
usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso
/
games
/
volume11
/
vcraps
/
patch2
/
patches02
Wrap
Text File
|
1990-08-28
|
5KB
|
192 lines
*** dist/vcraps.c Fri Aug 24 13:22:14 1990
--- vcraps.c Fri Aug 24 13:13:39 1990
***************
*** 2,11 ****
#include <curses.h>
#include <setjmp.h>
extern int CrapsErrorDatum;
extern int optind;
! extern char *optarg;
jmp_buf LoopEnv;
WINDOW *dontplace4win, *dontplace5win, *dontplace6win, *dontplace8win;
--- 2,16 ----
#include <curses.h>
#include <setjmp.h>
+ #define MSGQUEUELEN (20)
+
extern int CrapsErrorDatum;
extern int optind;
! extern char *optarg, *malloc();
+ int MsgQueueLen, MsgQueueLatest;
+ char *MsgQueue[MSGQUEUELEN];
+
jmp_buf LoopEnv;
WINDOW *dontplace4win, *dontplace5win, *dontplace6win, *dontplace8win;
***************
*** 123,128 ****
--- 128,135 ----
{
int c;
+ MsgQueueLen = 0;
+ MsgQueueLatest = -1;
init();
Craps_SetBankroll(&Table, 1000);
while ((c = getopt(argc, argv, "b:sx")) != EOF) {
***************
*** 147,152 ****
--- 154,160 ----
Driver()
{
int c, amount, fullupdate = 1, jmpval, die1, die2, i;
+ int msgptr, msgcount;
char buf[20];
CrapsError_t err;
CrapsTable_t *t = &Table;
***************
*** 159,168 ****
Update(fullupdate);
bcopy(&Table, &OldTable, (sizeof(CrapsTable_t)));
fullupdate = 0;
! Prompt("Command [12345689abcdfhprt$X?]:");
wclear(commandwin);
wrefresh(commandwin);
! c = Getch("12345689abcdfhprt$X?", 1);
switch (c) {
case '1':
Prompt("[012]:");
--- 167,176 ----
Update(fullupdate);
bcopy(&Table, &OldTable, (sizeof(CrapsTable_t)));
fullupdate = 0;
! Prompt("Command [12345689abcdfhmprt$X?]:");
wclear(commandwin);
wrefresh(commandwin);
! c = Getch("12345689abcdfhmprt$X?", 1);
switch (c) {
case '1':
Prompt("[012]:");
***************
*** 546,551 ****
--- 554,575 ----
break;
}
break;
+ case 'm':
+ msgptr = MsgQueueLatest;
+ msgcount = 0;
+ do {
+ if (++msgcount > MsgQueueLen)
+ c = ' ';
+ else {
+ wcenter(msgwin, MsgQueue[msgptr], 0, 0);
+ wrefresh(msgwin);
+ msgptr = (msgptr - 1 + MSGQUEUELEN) % MSGQUEUELEN;
+ c = wgetch(msgwin);
+ wclear(msgwin);
+ }
+ } while (c != ' ');
+ wrefresh(msgwin);
+ break;
case 'p':
if (Craps_Point(&Table)) {
Prompt("Amount for odds on Pass Line:");
***************
*** 885,893 ****
Message(str)
char *str;
{
wcenter(msgwin, str, 0, 0);
wrefresh(msgwin);
! while (wgetch(msgwin) != ' ');
wclear(msgwin);
wrefresh(msgwin);
}
--- 909,942 ----
Message(str)
char *str;
{
+ char *copy = malloc(1 + strlen(str));
+ int c, msgptr, msgcount;
+
+ if (copy) {
+ strcpy(copy, str);
+ MsgQueueLatest = (MsgQueueLatest + 1) % MSGQUEUELEN;
+ if (MsgQueueLen == MSGQUEUELEN)
+ free(MsgQueue[MsgQueueLatest]);
+ else
+ ++MsgQueueLen;
+ MsgQueue[MsgQueueLatest] = copy;
+ }
+ msgptr = (MsgQueueLatest - 1 + MSGQUEUELEN) % MSGQUEUELEN;
+ msgcount = 1;
wcenter(msgwin, str, 0, 0);
wrefresh(msgwin);
! do {
! c = wgetch(msgwin);
! if (c == 'm') {
! if (++msgcount > MsgQueueLen)
! c = ' ';
! else {
! wcenter(msgwin, MsgQueue[msgptr], 0, 0);
! wrefresh(msgwin);
! msgptr = (msgptr - 1 + MSGQUEUELEN) % MSGQUEUELEN;
! }
! }
! } while (c != ' ');
wclear(msgwin);
wrefresh(msgwin);
}
***************
*** 1697,1704 ****
addstr("4dc - don't-come odds on 4 4dp - don't place 4\n\n");
addstr("Bets are taken down by typing t followed by one of the\n");
addstr("bet commands above.\n\n");
! addstr("$ - show total bets X - Exit program\n");
! addstr(" continue...");
refresh();
getch();
longjmp(LoopEnv, 2);
--- 1746,1753 ----
addstr("4dc - don't-come odds on 4 4dp - don't place 4\n\n");
addstr("Bets are taken down by typing t followed by one of the\n");
addstr("bet commands above.\n\n");
! addstr("$ - show total bets m - review messages X - exit\n");
! addstr(" continue...");
refresh();
getch();
longjmp(LoopEnv, 2);
***************
*** 1706,1713 ****
ShowTotal()
{
! int i, total = 0;
! char buf[80];
for (i = craps_PassLine; i < craps_Bets; ++i)
total += Craps_GetBet(&Table, i);
--- 1755,1762 ----
ShowTotal()
{
! int i, total = 0;
! char buf[80];
for (i = craps_PassLine; i < craps_Bets; ++i)
total += Craps_GetBet(&Table, i);
*** patchlevel.h.orig Fri Aug 24 11:04:33 1990
--- patchlevel.h Fri Aug 24 12:09:14 1990
***************
*** 1 ****
! #define PATCHLEVEL 1
--- 1 ----
! #define PATCHLEVEL 2