\r
VOID SayString(char *mess, BOOL flag)\r
{ // for debug file\r
- char buf[8000], *p;\r
+ static char buf[8000], *p;\r
+ int l = strlen(buf);\r
if(appData.debugMode) fprintf(debugFP, "SAY '%s'\n", mess);\r
- safeStrCpy(buf, mess, sizeof(buf)/sizeof(buf[0]));\r
+ if(l) buf[l++] = ' '; // separate by space from previous\r
+ safeStrCpy(buf+l, mess, 8000-1-l); // buffer\r
+ if(!flag) return; // wait for flush\r
if(p = StrCaseStr(buf, "Xboard adjudication:")) {\r
int i;\r
for(i=19; i>1; i--) p[i] = p[i-1];\r
p[1] = ' ';\r
}\r
- RealSayString(buf, flag);\r
+ RealSayString(buf, !strcmp(mess, " ")); // kludge to indicate flushing of interruptable speach\r
+ if(appData.debugMode) fprintf(debugFP, "SPEAK '%s'\n", buf);\r
+ buf[0] = NULLCHAR;\r
}\r
\r
//static int fromX = 0, fromY = 0;\r
char buf[MSG_SIZ];\r
n = boards[currentMove][fromY][1];\r
snprintf(buf, MSG_SIZ, "%d %s%s", n, PieceToName(currentPiece,0), n == 1 ? "" : "s");\r
- SayString(buf, TRUE);\r
+ SayString(buf, FALSE);\r
}\r
+ SayString(" ", TRUE);\r
} else\r
if(fromX == BOARD_RGHT + 1) {\r
SayString("white holdings", FALSE);\r
char buf[MSG_SIZ];\r
n = boards[currentMove][fromY][BOARD_WIDTH-2];\r
snprintf(buf, MSG_SIZ,"%d %s%s", n, PieceToName(currentPiece,0), n == 1 ? "" : "s");\r
- SayString(buf, TRUE);\r
+ SayString(buf, FALSE);\r
}\r
+ SayString(" ", TRUE);\r
} else\r
if(fromX >= BOARD_LEFT && fromX < BOARD_RGHT) {\r
char buf[MSG_SIZ];\r
xchar = SquareToChar(fromX);\r
ynum = SquareToNum(fromY);\r
if(currentPiece != EmptySquare) {\r
-// SayString(piece[0] == 'W' ? "white" : "black", TRUE);\r
snprintf(buf, MSG_SIZ, "%s %s %s", xchar, ynum, piece);\r
} else snprintf(buf, MSG_SIZ, "%s %s", xchar, ynum);\r
- SayString(buf, TRUE);\r
+ SayString(buf, FALSE);\r
+ SayString(" ", TRUE);\r
}\r
return;\r
}\r
\r
//if(appData.debugMode) fprintf(debugFP, "PossibleAttackMove %d %d %d %d\n", fromX, fromY, oldFromX, oldFromY);\r
if(fromY < 0 || fromY >= BOARD_HEIGHT) return;\r
- if(fromX < BOARD_LEFT || fromX >= BOARD_RGHT) { SayString("holdings",FALSE); return; }\r
+ if(fromX < BOARD_LEFT || fromX >= BOARD_RGHT) { SayString("holdings",TRUE); return; }\r
\r
piece = boards[currentMove][fromY][fromX];\r
if(piece == EmptySquare) { // if square is empty, try to substitute selected piece\r
SayString("Your", FALSE);\r
SayString(PieceToName(piece, 0), FALSE);\r
SayString("would have", FALSE);\r
- } else { SayString("You must select a piece first", FALSE); return; }\r
+ } else { SayString("You must select a piece first", TRUE); return; }\r
}\r
\r
victim = boards[currentMove][fromY][fromX];\r
cl.count = 0; cl.rf = fromY; cl.ff = fromX; cl.rt = cl.ft = -1;\r
GenLegal(boards[currentMove], PosFlags(currentMove + swapColor), ReadCallback, (VOIDSTAR) &cl);\r
if(cl.count == 0) SayString("None", FALSE);\r
+ SayString("", TRUE); // flush\r
boards[currentMove][fromY][fromX] = victim; // repair\r
\r
if( removedSelectedPiece ) boards[currentMove][oldFromY][oldFromX] = piece;\r
ChessSquare piece = EmptySquare, victim;\r
\r
if(fromY < 0 || fromY >= BOARD_HEIGHT) return;\r
- if(fromX < BOARD_LEFT || fromX >= BOARD_RGHT) { SayString("holdings",FALSE); return; }\r
+ if(fromX < BOARD_LEFT || fromX >= BOARD_RGHT) { SayString("holdings",TRUE); return; }\r
\r
if(oldFromX >= 0 && oldFromY >= 0) { // if piece is selected, remove it\r
piece = boards[currentMove][oldFromY][oldFromX];\r
cl.count = 0; cl.rt = fromY; cl.ft = fromX; cl.rf = cl.ff = -1;\r
GenLegal(boards[currentMove], PosFlags(currentMove), ReadCallback, (VOIDSTAR) &cl);\r
if(cl.count == 0) SayString("None", FALSE);\r
+ SayString("", TRUE); // flush\r
boards[currentMove][fromY][fromX] = victim; // put back original occupant\r
\r
if(oldFromX >= 0 && oldFromY >= 0) { // put back possibl selected piece\r
SayString(ynum, FALSE);\r
SayString("empty", FALSE);\r
}\r
+ SayString("", TRUE); // flush\r
}\r
\r
VOID\r
SayString(xchar, FALSE);\r
SayString("file empty", FALSE);\r
}\r
+ SayString("", TRUE); // flush\r
}\r
\r
VOID\r
}\r
}\r
else SayString("There is no squares to your upper left", FALSE);\r
+ SayString("", TRUE); // flush\r
}\r
\r
VOID\r
}\r
}\r
else SayString("There is no squares to your lower left", FALSE);\r
+ SayString("", TRUE); // flush\r
}\r
\r
VOID\r
SayString(piece, FALSE);\r
}\r
}\r
+ SayString("", TRUE); // flush\r
}\r
\r
VOID\r
}\r
}\r
if(count == 0) SayString("nowhere", FALSE);\r
+ SayString("", TRUE); // flush\r
}\r
\r
VOID\r
SayString("on a dark square",FALSE);\r
\r
PossibleAttacked();\r
- return;\r
+ SayString("", TRUE); // flush\r
}\r
\r
VOID\r
}\r
}\r
}\r
-\r
+ SayString("", TRUE); // flush\r
}\r
\r
VOID\r
SayString("White is on move here", FALSE);\r
else SayString("Black is on move here", FALSE);\r
}\r
+ SayString("", TRUE); // flush\r
}\r
\r
extern char *commentList[];\r
SayString(messageText, FALSE);\r
}\r
\r
+ SayString("", TRUE); // flush\r
}\r
\r
VOID\r
SayString(str2, FALSE);\r
lastWhiteTime = whiteTimeRemaining;\r
lastBlackTime = blackTimeRemaining;\r
+ SayString("", TRUE); // flush\r
}\r
\r
VOID\r
SayString(mess, FALSE);\r
SayString("is now", FALSE);\r
SayString(*b ? "on" : "off", FALSE);\r
+ SayString("", TRUE); // flush\r
}\r
\r
/* handles keyboard moves in a click-click fashion */\r
currentpiece = boards[currentMove][fromY][fromX];\r
piece = PieceToName(currentpiece,1);\r
SayString(piece, FALSE);\r
- SayString("selected", FALSE);\r
+ SayString("selected", TRUE);\r
}\r
else {\r
oldFromX = oldFromY = -1;\r
currentpiece = boards[currentMove][fromY][fromX];\r
piece = PieceToName(currentpiece,0);\r
SayString(piece, FALSE);\r
- SayString("unselected", FALSE);\r
+ SayString("unselected", TRUE);\r
}\r
}\r
}\r
case '\020': /* ctrl P */\\r
{ char buf[MSG_SIZ];\\r
if(GetWindowText(hwnd, buf, MSG_SIZ-1))\\r
- SayString(buf, FALSE);\\r
+ SayString(buf, TRUE);\\r
}\\r
return 0;\\r
\r
#define JAWS_COPYRIGHT \\r
SetDlgItemText(hDlg, OPT_MESS, "Auditory/Keyboard Enhancements By: Ed Rodriguez (sort of)");\r
\r
-#define SAY(S) SayString((S), FALSE)\r
+#define SAY(S) SayString((S), TRUE)\r
\r
#define SAYMACHINEMOVE() SayMachineMove(0)\r
\r