[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[XBoard-devel] Winboard: ICS engine anlyze
From: |
Daniel Mehrmann |
Subject: |
[XBoard-devel] Winboard: ICS engine anlyze |
Date: |
Wed, 23 Jun 2004 01:49:14 +0200 |
Hello,
first i wanna say sorry, because i had not really time the last months
for xboard/winboard project.
But now i did the first steps to include my ICS analyze engine function to
winboard/xboard.
I upload the follow lines to our cvs-server.
The ICS engine analyze is not ready, but usable for analyze one game on a
ICS - Server (observe).
I'll do the rest, xboard too, on the next weekend (i hope).
Greetings
Daniel
diff -Pur xboard/backend.c xboard.patchready/backend.c
--- xboard/backend.c 2004-04-28 23:43:39.000000000 +0200
+++ xboard.patchready/backend.c 2004-06-23 00:59:41.546875000 +0200
@@ -4383,6 +4383,9 @@
break;
case AnalyzeMode:
case AnalyzeFile:
+ /* icsEngineAnalyze */
+ case IcsObserving:
+ if (!appData.icsEngineAnalyze) ignore = TRUE;
break;
case TwoMachinesPlay:
if ((cps->twoMachinesColor[0] == 'w') !=
@@ -4445,8 +4448,8 @@
prefixHint ? lastHint : "",
prefixHint ? " " : "", buf1);
- if (currentMove == forwardMostMove ||
- gameMode == AnalyzeMode || gameMode == AnalyzeFile) {
+ if (currentMove == forwardMostMove || gameMode ==
AnalyzeMode
+ || gameMode == AnalyzeFile ||
appData.icsEngineAnalyze) {
DisplayMove(currentMove - 1);
DisplayAnalysis();
}
@@ -4472,7 +4475,7 @@
programStats.line_is_book = 1;
if (currentMove == forwardMostMove ||
gameMode==AnalyzeMode ||
- gameMode == AnalyzeFile) {
+ gameMode == AnalyzeFile || appData.icsEngineAnalyze) {
DisplayMove(currentMove - 1);
DisplayAnalysis();
}
@@ -4517,7 +4520,7 @@
strcat(programStats.movelist, " ");
strcat(programStats.movelist, p);
if (currentMove == forwardMostMove ||
gameMode==AnalyzeMode ||
- gameMode == AnalyzeFile) {
+ gameMode == AnalyzeFile || appData.icsEngineAnalyze) {
DisplayMove(currentMove - 1);
DisplayAnalysis();
}
@@ -7295,8 +7298,10 @@
return;
if (gameMode != AnalyzeFile) {
- EditGameEvent();
- if (gameMode != EditGame) return;
+ if (!appData.icsEngineAnalyze) {
+ EditGameEvent();
+ if (gameMode != EditGame) return;
+ }
ResurrectChessProgram();
SendToProgram("analyze\n", &first);
first.analyzing = TRUE;
@@ -7305,7 +7310,7 @@
AnalysisPopUp(_("Analysis"),
_("Starting analysis mode...\nIf this message stays
up, your chess program does not support analysis."));
}
- gameMode = AnalyzeMode;
+ if (!appData.icsEngineAnalyze) gameMode = AnalyzeMode;
pausing = FALSE;
ModeHighlight();
SetGameInfo();
@@ -7771,6 +7776,9 @@
void
ExitAnalyzeMode()
{
+ /* icsEngineAnalyze - possible call of other functions */
+ if (appData.icsEngineAnalyze) appData.icsEngineAnalyze = FALSE;
+
if (first.analysisSupport && first.analyzing) {
SendToProgram("exit\n", &first);
first.analyzing = FALSE;
@@ -9240,7 +9248,8 @@
{
char buf[MSG_SIZ];
- if (gameMode == AnalyzeMode || gameMode == AnalyzeFile) {
+ if (gameMode == AnalyzeMode || gameMode == AnalyzeFile
+ || appData.icsEngineAnalyze) {
sprintf(buf, "Analysis (%s)", first.tidy);
AnalysisPopUp(buf, text);
}
diff -Pur xboard/common.h xboard.patchready/common.h
--- xboard/common.h 2003-10-27 20:21:00.000000000 +0100
+++ xboard.patchready/common.h 2004-06-23 01:00:25.328125000 +0200
@@ -407,6 +407,7 @@
int firstProtocolVersion;
int secondProtocolVersion;
Boolean showButtonBar;
+ Boolean icsEngineAnalyze;
#if ZIPPY
char *zippyLines;
char *zippyPinhead;
diff -Pur xboard/winboard/winboard.c xboard.patchready/winboard/winboard.c
--- xboard/winboard/winboard.c 2004-06-21 21:59:06.000000000 +0200
+++ xboard.patchready/winboard/winboard.c 2004-06-23
01:00:00.875000000 +0200
@@ -1611,6 +1611,7 @@
appData.reuseFirst = TRUE;
appData.reuseSecond = TRUE;
appData.blindfold = FALSE;
+ appData.icsEngineAnalyze = FALSE;
dcb.DCBlength = sizeof(DCB);
dcb.BaudRate = 9600;
dcb.fBinary = TRUE;
@@ -1627,7 +1628,7 @@
dcb.fAbortOnError = FALSE;
/* Microsoft SDK >= Feb. 2003 (MS VS >= 2002) */
#if (defined(_MSC_VER) && _MSC_VER <= 1200)
- dcb.wReserved = 0;
+ //dcb.wReserved = 0;
#else
dcb.wReserved = 0;
#endif
@@ -3404,6 +3405,7 @@
FILE *f;
UINT number;
char fileTitle[MSG_SIZ];
+ char buf[MSG_SIZ];
switch (message) {
@@ -3638,15 +3640,37 @@
case IDM_AnalysisMode:
if (!first.analysisSupport) {
- char buf[MSG_SIZ];
sprintf(buf, "%s does not support analysis", first.tidy);
DisplayError(buf, 0);
} else {
+ /* icsEngineAnlyze */
+ if (appData.icsActive) {
+ if (gameMode != IcsObserving) {
+ sprintf(buf, "You are not observing a game");
+ DisplayError(buf, 0);
+ /* secure check */
+ if (appData.icsEngineAnalyze) {
+ appData.icsEngineAnalyze = FALSE;
+ ExitAnalyzeMode();
+ ModeHighlight();
+ break;
+ }
+ break;
+ } else {
+ /* if enable, user want disable icsEngineAnalyze
*/
+ if (appData.icsEngineAnalyze) {
+ appData.icsEngineAnalyze = FALSE;
+ ExitAnalyzeMode();
+ ModeHighlight();
+ break;
+ }
+ appData.icsEngineAnalyze = TRUE;
+ }
+ }
if (!appData.showThinking) ToggleShowThinking();
AnalyzeModeEvent();
}
break;
-
case IDM_AnalyzeFile:
if (!first.analysisSupport) {
char buf[MSG_SIZ];
@@ -4019,8 +4043,8 @@
AutoPlayGameLoop(); /* call into back end */
break;
case ANALYSIS_TIMER_ID:
- if ((gameMode == AnalyzeMode || gameMode == AnalyzeFile) &&
- appData.periodicUpdates) {
+ if ((gameMode == AnalyzeMode || gameMode == AnalyzeFile
+ || appData.icsEngineAnalyze) && appData.periodicUpdates)
{
AnalysisPeriodicEvent(0);
} else {
KillTimer(hwnd, analysisTimerEvent);
@@ -6219,6 +6243,14 @@
}
prevChecked = nowChecked;
+ /* icsEngineAnalyze - Do a sceure check too */
+ if (appData.icsEngineAnalyze) {
+ (void) CheckMenuItem(GetMenu(hwndMain), IDM_AnalysisMode,
+ MF_BYCOMMAND|MF_CHECKED);
+ } else {
+ (void) CheckMenuItem(GetMenu(hwndMain), IDM_AnalysisMode,
+ MF_BYCOMMAND|MF_UNCHECKED);
+ }
}
VOID
@@ -6231,6 +6263,10 @@
#ifdef ZIPPY
if (appData.zippyPlay) {
SetMenuEnables(hmenu, zippyEnables);
+ /* icsEngineAnalyze */
+ if (!appData.noChessProgram)
+ (void) EnableMenuItem(GetMenu(hwndMain), IDM_AnalysisMode,
+ MF_BYCOMMAND|MF_ENABLED);
}
#endif
}
diff -Pur xboard/xboard.c xboard.patchready/xboard.c
--- xboard/xboard.c 2004-04-27 05:00:17.000000000 +0200
+++ xboard.patchready/xboard.c 2004-06-23 01:28:49.109375000 +0200
@@ -2466,6 +2466,9 @@
args, 1);
}
+ /* icsEngineAnalyze - Currently not yet implemented in XBoard */
+ appData.icsEngineAnalyze = FALSE;
+
/*
* Create an icon.
*/
smime.p7s
Description: S/MIME cryptographic signature
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [XBoard-devel] Winboard: ICS engine anlyze,
Daniel Mehrmann <=