home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga MA Magazine 1998 #3
/
amigamamagazinepolishissue1998.iso
/
szachy
/
gnu
/
gnu_4_0_74
/
gnuchess-4.0.pl74.patch
< prev
next >
Wrap
Text File
|
1995-05-02
|
23KB
|
848 lines
Only in gnuchess-4.0.pl74/src: Install
Only in gnuchess-4.0.pl74/src: Install.info
Only in gnuchess-4.0.pl74/src: Makefile.amiga
diff -r -b -c gnuchess-4.0.pl74.orig/src/binsort.c gnuchess-4.0.pl74/src/binsort.c
*** gnuchess-4.0.pl74.orig/src/binsort.c Mon Sep 19 10:23:04 1994
--- gnuchess-4.0.pl74/src/binsort.c Wed May 03 00:32:34 1995
***************
*** 82,89 ****
--- 82,94 ----
# include <sys/types.h> /* for statistics & io */
# include <sys/stat.h> /* for i/o */
# include <errno.h>
+ #ifndef _amigados
# include <sys/param.h> /* for statistics */
# include <sys/times.h> /* for statistics */
+ #else
+ #define NOUNISTD
+ #define FUNCPROTO
+ #endif
# include <time.h>
# include <stdlib.h>
***************
*** 1171,1177 ****
--- 1176,1184 ----
prtstatist(realtime)
long realtime;
{
+ #ifndef _amigados
struct tms spenttime;
+ #endif
int tapenum;
unsigned long one, total;
***************
*** 1188,1198 ****
--- 1195,1207 ----
}
fprintf(stderr,"\t\tTotal : %10ld\n", total);
fprintf(stderr,"\tReal time [s]:\t\t\t%d\n", (int)realtime + 1);
+ #ifndef _amigados
times(&spenttime);
fprintf(stderr,"\tUser time [s]:\t\t\t%.2f\n",
(float)spenttime.tms_utime/(float)CLOCKFREQ);
fprintf(stderr,"\tSystem time [s]:\t\t%.2f\n",
(float)spenttime.tms_stime/(float)CLOCKFREQ);
+ #endif
}
***************
*** 1500,1506 ****
--- 1509,1519 ----
struct stat statstr;
ctape = TAPE + num;
+ #ifndef _amigados
sprintf(scrname, "%s/binsort%07d%d", scrpath, getpid(), num); /* gen name */
+ #else
+ sprintf(scrname, "%s/binsort%s", scrpath, tmpnam(NULL));
+ #endif
if ((fdes = open(scrname, O_RDWR | O_CREAT, S_IREAD|S_IWRITE)) < 0)
/* create scratch file */
ioerr();
diff -r -b -c gnuchess-4.0.pl74.orig/src/book.c gnuchess-4.0.pl74/src/book.c
*** gnuchess-4.0.pl74.orig/src/book.c Wed Feb 22 00:46:32 1995
--- gnuchess-4.0.pl74/src/book.c Wed May 03 00:32:36 1995
***************
*** 23,29 ****
#include "gnuchess.h"
#include "ttable.h" /* uses hashbd, hashkey */
#include "ataks.h"
! #if !defined(AMIGADOS) && !defined(Think_C)
#include <unistd.h>
#endif
#ifdef Think_C
--- 23,29 ----
#include "gnuchess.h"
#include "ttable.h" /* uses hashbd, hashkey */
#include "ataks.h"
! #if !defined(_amigados) && !defined(Think_C)
#include <unistd.h>
#endif
#ifdef Think_C
Only in gnuchess-4.0.pl74/src: doc
diff -r -b -c gnuchess-4.0.pl74.orig/src/dspcom.c gnuchess-4.0.pl74/src/dspcom.c
*** gnuchess-4.0.pl74.orig/src/dspcom.c Sat Feb 11 04:04:13 1995
--- gnuchess-4.0.pl74/src/dspcom.c Wed May 03 00:32:38 1995
***************
*** 59,65 ****
#include <sys/param.h>
#include <sys/types.h>
#include <sys/file.h>
! #ifndef AMIGADOS
#include <sys/ioctl.h>
#endif
#endif /* Think_C */
--- 59,72 ----
#include <sys/param.h>
#include <sys/types.h>
#include <sys/file.h>
! #if defined(_amigados)
! /*
! We cannot use the Amiga headers, as exec/types.h would redefine
! the SHORT type. Fortunately we do not need very much of them:
! */
! #define SIGBREAKF_SET 0xf000 /* SIGBREAKF_CTRL(C|D|E|F) */
! extern long SetSignal(long, long);
! #else
#include <sys/ioctl.h>
#endif
#endif /* Think_C */
***************
*** 1429,1435 ****
{
struct timeval tv;
! #ifndef MSDOS
int nchar;
extern int errno;
int i;
--- 1436,1442 ----
{
struct timeval tv;
! #if !defined(MSDOS) && !defined(_amigados)
int nchar;
extern int errno;
int i;
***************
*** 1451,1463 ****
}
#endif /*FIONREAD*/
#else
if (kbhit ())
{
if (!flag.timeout)
flag.back = true;
flag.bothsides = false;
}
! #endif /* MSDOS */
gettimeofday(&tv,NULL);
et = (tv.tv_sec*100+(tv.tv_usec/10000)) - time0;
ETnodes = NodeCnt + ZNODES;
--- 1458,1482 ----
}
#endif /*FIONREAD*/
#else
+ /*
+ On the Amiga we have two possibilities of interrupting GNU Chess:
+ Breaking with Ctrl-C is less comfortable for the user, but
+ checking for it is faster.
+
+ We choose the comfortable way for curses and the fast way for
+ AmyBoard.
+ */
+ #if defined(_amigados) && defined(XBOARD)
+ if (SetSignal(0, SIGBREAKF_SET) & SIGBREAKF_SET)
+ #else
if (kbhit ())
+ #endif
{
if (!flag.timeout)
flag.back = true;
flag.bothsides = false;
}
! #endif /* MSDOS || _amigados */
gettimeofday(&tv,NULL);
et = (tv.tv_sec*100+(tv.tv_usec/10000)) - time0;
ETnodes = NodeCnt + ZNODES;
***************
*** 1495,1501 ****
*/
{
! #ifndef MSDOS
int nchar;
extern int errno;
int i;
--- 1514,1520 ----
*/
{
! #if !defined(MSDOS) && !defined(_amigados)
int nchar;
extern int errno;
int i;
***************
*** 1523,1529 ****
flag.back = true;
flag.bothsides = false;
}
! #endif /* MSDOS */
et = (time ((time_t *) 0) - time0) * 100;
ETnodes = NodeCnt + ZNODES;
if (et < 0)
--- 1542,1548 ----
flag.back = true;
flag.bothsides = false;
}
! #endif /* MSDOS || _amigados */
et = (time ((time_t *) 0) - time0) * 100;
ETnodes = NodeCnt + ZNODES;
if (et < 0)
diff -r -b -c gnuchess-4.0.pl74.orig/src/eco.c gnuchess-4.0.pl74/src/eco.c
*** gnuchess-4.0.pl74.orig/src/eco.c Mon Sep 19 10:23:05 1994
--- gnuchess-4.0.pl74/src/eco.c Wed May 03 00:32:38 1995
***************
*** 23,29 ****
#include "gnuchess.h"
#include "ttable.h" /* uses hashbd, hashkey */
#include "ataks.h"
! #if !defined(AMIGADOS) && !defined(Think_C)
#include <unistd.h>
#endif
#ifdef Think_C
--- 23,29 ----
#include "gnuchess.h"
#include "ttable.h" /* uses hashbd, hashkey */
#include "ataks.h"
! #if !defined(_amigados) && !defined(Think_C)
#include <unistd.h>
#endif
#ifdef Think_C
diff -r -b -c gnuchess-4.0.pl74.orig/src/ecocvt.c gnuchess-4.0.pl74/src/ecocvt.c
*** gnuchess-4.0.pl74.orig/src/ecocvt.c Tue Sep 20 03:09:34 1994
--- gnuchess-4.0.pl74/src/ecocvt.c Wed May 03 00:32:38 1995
***************
*** 1,5 ****
--- 1,8 ----
#include <fcntl.h>
#include <sys/types.h>
+ #if defined(_amigados)
+ #define LIBRARIES_DOS_H
+ #endif
#include <sys/stat.h>
#include "gnuchess.h"
struct gdxdata
diff -r -b -c gnuchess-4.0.pl74.orig/src/ecosort.c gnuchess-4.0.pl74/src/ecosort.c
*** gnuchess-4.0.pl74.orig/src/ecosort.c Mon Sep 19 10:23:05 1994
--- gnuchess-4.0.pl74/src/ecosort.c Wed May 03 00:32:38 1995
***************
*** 7,12 ****
--- 7,13 ----
utshort cntr;
};
char strcmd[256];
+ #ifndef _amigados
main()
{
sprintf(strcmd,"./binsort -r %d -k L:a:0:2</tmp/step1.eco>/tmp/step2.eco\n",sizeof(struct gdxecodata));
***************
*** 14,16 ****
--- 15,31 ----
system(strcmd);
exit(0);
}
+ #else
+ int main(int argc, char *argv[])
+ {
+ if (argc < 4) {
+ fprintf(stderr, "Usage: ecosort <binsortpath> <step1path> <step2path>");
+ exit(10);
+ }
+
+ sprintf(strcmd, "%s -r %d -k L:a:0:2 <%s >%s\n",
+ argv[1], sizeof(struct gdxecodata), argv[2], argv[3]);
+ system(strcmd);
+ exit(0);
+ }
+ #endif
diff -r -b -c gnuchess-4.0.pl74.orig/src/eval.c gnuchess-4.0.pl74/src/eval.c
*** gnuchess-4.0.pl74.orig/src/eval.c Fri Feb 10 21:54:43 1995
--- gnuchess-4.0.pl74/src/eval.c Wed May 03 00:32:38 1995
***************
*** 1574,1580 ****
pp = false;
break;
}
! z = (pp ? i - ((row (i) == 6) ? 8 : 16) : i);
Pd += ((pp) ? 5 * taxicab (sq, z) : taxicab (sq, z));
}
}
--- 1574,1580 ----
pp = false;
break;
}
! z = (pp ? i - ((row (i) == 1) ? 8 : 16) : i);
Pd += ((pp) ? 5 * taxicab (sq, z) : taxicab (sq, z));
}
}
Only in gnuchess-4.0.pl74/src: gettimeofday.c
diff -r -b -c gnuchess-4.0.pl74.orig/src/gnuan.c gnuchess-4.0.pl74/src/gnuan.c
*** gnuchess-4.0.pl74.orig/src/gnuan.c Mon Sep 19 10:23:06 1994
--- gnuchess-4.0.pl74/src/gnuan.c Wed May 03 00:32:40 1995
***************
*** 77,83 ****
#include <sys/param.h>
#include <sys/types.h>
#include <sys/file.h>
! #ifndef AMIGADOS
#include <sys/ioctl.h>
#endif
void TerminateSearch (int), Die (int);
--- 77,83 ----
#include <sys/param.h>
#include <sys/types.h>
#include <sys/file.h>
! #ifndef _amigados
#include <sys/ioctl.h>
#endif
void TerminateSearch (int), Die (int);
***************
*** 622,628 ****
{
struct timeval tv;
! #ifndef MSDOS
int nchar;
extern int errno;
int i;
--- 622,628 ----
{
struct timeval tv;
! #if !defined(MSDOS) && !defined(_amigados)
int nchar;
extern int errno;
int i;
***************
*** 650,656 ****
flag.back = true;
flag.bothsides = false;
}
! #endif /* MSDOS */
gettimeofday (&tv, NULL);
et = (tv.tv_sec * 100 + (tv.tv_usec / 10000)) - time0;
ETnodes = NodeCnt + ZNODES;
--- 650,656 ----
flag.back = true;
flag.bothsides = false;
}
! #endif /* MSDOS || _amigados */
gettimeofday (&tv, NULL);
et = (tv.tv_sec * 100 + (tv.tv_usec / 10000)) - time0;
ETnodes = NodeCnt + ZNODES;
***************
*** 679,685 ****
*/
{
! #ifndef MSDOS
int nchar;
extern int errno;
int i;
--- 679,685 ----
*/
{
! #if !defined(MSDOS) && !defined(_amigados)
int nchar;
extern int errno;
int i;
***************
*** 707,713 ****
flag.back = true;
flag.bothsides = false;
}
! #endif /* MSDOS */
et = (time ((long *) 0) - time0) * 100;
ETnodes = NodeCnt + ZNODES;
if (et < 0)
--- 707,713 ----
flag.back = true;
flag.bothsides = false;
}
! #endif /* MSDOS || _amigados */
et = (time ((long *) 0) - time0) * 100;
ETnodes = NodeCnt + ZNODES;
if (et < 0)
diff -r -b -c gnuchess-4.0.pl74.orig/src/gnuchess.h gnuchess-4.0.pl74/src/gnuchess.h
*** gnuchess-4.0.pl74.orig/src/gnuchess.h Sat Feb 04 22:05:34 1995
--- gnuchess-4.0.pl74/src/gnuchess.h Wed May 03 00:32:40 1995
***************
*** 32,38 ****
#define huge
#endif
#include <stdio.h>
! #if !defined(NOMEMSET)
#include <memory.h>
#endif
#ifdef SIGNCHAR
--- 32,38 ----
#define huge
#endif
#include <stdio.h>
! #if !defined(NOMEMSET) && !defined(_amigados)
#include <memory.h>
#endif
#ifdef SIGNCHAR
***************
*** 81,87 ****
#ifndef Think_C
#include <sys/param.h>
#include <sys/types.h>
! #ifndef AMIGADOS
#include <sys/times.h>
#endif
#endif /* Think_C */
--- 81,87 ----
#ifndef Think_C
#include <sys/param.h>
#include <sys/types.h>
! #ifndef _amigados
#include <sys/times.h>
#endif
#endif /* Think_C */
***************
*** 89,94 ****
--- 89,102 ----
#define printz printf
#define scanz scanf
#else
+ #ifdef _amigados
+ #define EXEC_TYPES_H /* Prevent exec/types.h from being */
+ typedef unsigned char UBYTE; /* included as this would redefine */
+ typedef short WORD; /* SHORT. Some typedef's required */
+ typedef unsigned short UWORD; /* by curses.h, however. */
+ typedef long LONG;
+ typedef unsigned long ULONG;
+ #endif
#include <curses.h>
#define scanz fflush(stdout),scanw
#define printz printw
***************
*** 238,245 ****
#define QBLOCK false /* if true cache quiescent positions */
#define BESTDELTA 90
/* about 1/2 second worth of nodes for your machine */
! #ifdef Think_C
#define ZNODES 500 /* check the time every ZNODES positions */
#else /* Think_C */
#define ZNODES 4000 /* check the time every ZNODES positions */
#endif /* Think_C */
--- 246,255 ----
#define QBLOCK false /* if true cache quiescent positions */
#define BESTDELTA 90
/* about 1/2 second worth of nodes for your machine */
! #if defined(Think_C)
#define ZNODES 500 /* check the time every ZNODES positions */
+ #elif defined(_amigados)
+ #define ZNODES 1000 /* check the time every ZNODES positions */
#else /* Think_C */
#define ZNODES 4000 /* check the time every ZNODES positions */
#endif /* Think_C */
***************
*** 430,436 ****
extern unsigned int starttime;
extern SHORT distdata[64][64], taxidata[64][64];
extern CHAR mvstr[5][7];
! #ifndef AMIGADOS
extern union U admin;
#endif
extern UTSHORT bookmaxply;
--- 440,446 ----
extern unsigned int starttime;
extern SHORT distdata[64][64], taxidata[64][64];
extern CHAR mvstr[5][7];
! #ifndef _amigados
extern union U admin;
#endif
extern UTSHORT bookmaxply;
***************
*** 554,566 ****
extern int pick (SHORT p1, SHORT p2);
extern int VerifyMove (CHAR *s, SHORT inp, UTSHORT *mv);
extern void VMoveList (SHORT side, register SHORT ply);
! #if !defined(AMIGADOS)
extern struct gdxadmin B;
#endif
- #if defined(AMIGADOS) && !defined(XBOARD)
- #define exit(retcode) CleanExit(retcode)
- #endif
/* Take care of NOMEMSET once and for all... */
#if (defined(NOMEMSET) || defined(MSDOS)) && !defined(__GNUC__)
#define memset(s,c,l) {\
--- 564,573 ----
extern int pick (SHORT p1, SHORT p2);
extern int VerifyMove (CHAR *s, SHORT inp, UTSHORT *mv);
extern void VMoveList (SHORT side, register SHORT ply);
! #if !defined(_amigados)
extern struct gdxadmin B;
#endif
/* Take care of NOMEMSET once and for all... */
#if (defined(NOMEMSET) || defined(MSDOS)) && !defined(__GNUC__)
#define memset(s,c,l) {\
Only in gnuchess-4.0.pl74/src: kbhit.c
diff -r -b -c gnuchess-4.0.pl74.orig/src/nondsp.c gnuchess-4.0.pl74/src/nondsp.c
*** gnuchess-4.0.pl74.orig/src/nondsp.c Fri Feb 10 21:51:25 1995
--- gnuchess-4.0.pl74/src/nondsp.c Wed May 03 00:32:40 1995
***************
*** 29,35 ****
/*#include <conio.h>*/
#elif !defined(Think_C)
#include <sys/file.h>
! #ifndef AMIGADOS
#include <sys/ioctl.h>
#endif
--- 29,35 ----
/*#include <conio.h>*/
#elif !defined(Think_C)
#include <sys/file.h>
! #ifndef _amigados
#include <sys/ioctl.h>
#endif
***************
*** 62,68 ****
{
mycnt1 = mycnt2 = 0;
#if defined CHESSTOOL || defined XBOARD
! #if defined(SYSV) || defined(AMIGADOS)
setvbuf (stdout, NULL, _IOLBF, BUFSIZ);
#else
setlinebuf (stdout);
--- 62,68 ----
{
mycnt1 = mycnt2 = 0;
#if defined CHESSTOOL || defined XBOARD
! #if defined(SYSV) || defined(_amigados)
setvbuf (stdout, NULL, _IOLBF, BUFSIZ);
#else
setlinebuf (stdout);
diff -r -b -c gnuchess-4.0.pl74.orig/src/nuxdsp.c gnuchess-4.0.pl74/src/nuxdsp.c
*** gnuchess-4.0.pl74.orig/src/nuxdsp.c Tue Nov 22 01:36:43 1994
--- gnuchess-4.0.pl74/src/nuxdsp.c Wed May 03 00:32:40 1995
***************
*** 37,43 ****
--- 37,45 ----
#include <sys/param.h>
#include <sys/types.h>
#include <sys/file.h>
+ #ifndef _amigados
#include <curses.h>
+ #endif
#ifdef notdef
#if defined(__STDC__)
***************
*** 104,109 ****
--- 106,116 ----
signal (SIGINT, Die);
#ifndef MSDOS
signal (SIGQUIT, Die);
+ #ifdef _amigados
+ if (atexit((void (*)(void)) endwin))
+ { perror("atexit");
+ }
+ #endif
initscr ();
crmode ();
#else
diff -r -b -c gnuchess-4.0.pl74.orig/src/search.c gnuchess-4.0.pl74/src/search.c
*** gnuchess-4.0.pl74.orig/src/search.c Wed Feb 22 00:46:50 1995
--- gnuchess-4.0.pl74/src/search.c Wed May 03 00:32:42 1995
***************
*** 269,275 ****
/* calculate avg time per move remaining */
ResponseTime = TimeControl.clock[side] / TimeControl.moves[side];
! ResponseTime += TCadd * 3 / 4;
TCleft = (int) ResponseTime / 5;
if (TimeControl.moves[side] < 5)
TCcount = MAXTCCOUNTX - 10;
--- 269,276 ----
/* calculate avg time per move remaining */
ResponseTime = TimeControl.clock[side] / TimeControl.moves[side];
! ResponseTime = ResponseTime * 2 / 3;
! ResponseTime += TCadd / 2;
TCleft = (int) ResponseTime / 5;
if (TimeControl.moves[side] < 5)
TCcount = MAXTCCOUNTX - 10;
***************
*** 1245,1251 ****
#endif
ElapsedTime (2);
TCcount++;
- if (et > ResponseTime) flag.timeout = true;
if (!background && Sdepth > 2)
{
if (best < alpha)
--- 1246,1251 ----
diff -r -b -c gnuchess-4.0.pl74.orig/src/ttable.c gnuchess-4.0.pl74/src/ttable.c
*** gnuchess-4.0.pl74.orig/src/ttable.c Sun Feb 05 06:47:31 1995
--- gnuchess-4.0.pl74/src/ttable.c Wed May 03 00:32:42 1995
***************
*** 21,27 ****
struct hashentry *ttable[2];
unsigned long ttblsize;
! /* unsigned */ SHORT rehash; /* -1 is used as a flag --tpm */
#ifdef NEWAGE
utshort TTage; /* Current ttable age */
UTSHORT TTageClock, /* Count till next age tick */
--- 21,27 ----
struct hashentry *ttable[2];
unsigned long ttblsize;
! SHORT rehash; /* -1 is used as a flag --tpm */
#ifdef NEWAGE
utshort TTage; /* Current ttable age */
UTSHORT TTageClock, /* Count till next age tick */
***************
*** 99,105 ****
{
register struct hashentry *ptbl;
! register /*unsigned*/ SHORT i = 0; /*to match new type of rehash --tpm*/
#ifdef DEBUG
if(flag.nott)return false;
--- 99,105 ----
{
register struct hashentry *ptbl;
! register SHORT i = 0;
#ifdef DEBUG
if(flag.nott)return false;
***************
*** 107,112 ****
--- 107,120 ----
#ifdef HASHSTATS
ttprobe[depth]++;
#endif
+ #ifdef NEWAGE
+ /* Find entry within rehash window or return failure */
+ for (i=rehash, ptbl = &ttable[side][hashkey % ttblsize];
+ ptbl->hashbd != hashbd; ptbl++)
+ if (--i == 0) return false;
+ /* Update age of rediscovered node */
+ ptbl->age = TTage - TTdepthage[ptbl->depth];
+ #else
ptbl = &ttable[side][hashkey % ttblsize];
while (true)
{
***************
*** 115,120 ****
--- 123,129 ----
if (++i > rehash) return false;
ptbl++;
}
+ #endif
PV = SwagHt = ptbl->mv;
if ((ptbl->depth >= (SHORT) depth) || abs(ptbl->score)>9000)
***************
*** 138,151 ****
HashCnt++;
#endif
- #ifdef NEWAGE
- /* Find entry within rehash window or return failure */
- for (i=rehash, ptbl = &ttable[side][hashkey % ttblsize];
- ptbl->hashbd != hashbd; ptbl++)
- if (--i == 0) return false;
- /* Update age of rediscovered node */
- ptbl->age = TTage - TTdepthage[ptbl->depth];
- #endif
if (ptbl->flags & truescore)
{
*score = ptbl->score;
--- 147,152 ----
***************
*** 191,207 ****
{
register struct hashentry *ptbl;
! register /*unsigned*/ SHORT i = 0; /*to match new type of rehash --tpm*/
ptbl = &ttable[side][hashkey % ttblsize];
while (true)
{
! if (ptbl->depth == 0
! #ifdef NEWAGE
! || TTage - ptbl->age > newage
! #endif
! ) break;
! if((ptbl->hashbd) == hashbd)if(ptbl->depth > (UCHAR)depth)return false; else break;
if (++i > rehash)
{
#ifdef HASHSTATS
--- 192,207 ----
{
register struct hashentry *ptbl;
! register SHORT i = 0;
! #ifndef NEWAGE
ptbl = &ttable[side][hashkey % ttblsize];
while (true)
{
! if (ptbl->depth == 0) break;
! if ((ptbl->hashbd) == hashbd) {
! if (ptbl->depth > (UCHAR)depth) return false; else break;
! }
if (++i > rehash)
{
#ifdef HASHSTATS
***************
*** 213,249 ****
}
ptbl++;
}
! #ifdef NEWAGE
! {
/* Look for match or oldest entry to reuse */
! int i;
! SHORT old = 0;
! struct hashentry * oldest = (struct hashentry *)NULL;
! for (i=rehash, ptbl = &ttable[side][hashkey % ttblsize];
! i > 0 && ptbl->hashbd != hashbd; i--, ptbl++)
! if ((TTage - ptbl->age) > old)
! {
old = TTage - ptbl->age;
oldest = ptbl;
}
! if (i == 0)
! {
ptbl = oldest; /* reuse oldest entry */
! if (--TTageClock == 0)
! {
TTageClock = TTageRate;
TTage++; /* Everyone is now just a little older */
}
! }
! ptbl->age = TTage - TTdepthage[ptbl->depth]; /* Set age of this node */
}
! #else
! TTadd++;
! #endif
#ifdef HASHSTATS
HashAdd++;
#endif
- if(ptbl->depth > (UCHAR)depth) return false;
ptbl->hashbd = hashbd;
ptbl->depth = (UCHAR) depth;
ptbl->score = score;
--- 213,257 ----
}
ptbl++;
}
! TTadd++;
! if (ptbl->depth > (UCHAR)depth) return false;
!
! #else /* NEWAGE */
! utshort old;
! struct hashentry *oldest;
!
/* Look for match or oldest entry to reuse */
! /* Note that arithmetic on ages is intentionally modulo 65536 */
! i = rehash;
! oldest = ptbl = &ttable[side][hashkey % ttblsize];
! old = TTage - ptbl->age;
! while (ptbl->hashbd != hashbd) {
! if (--i == 0) break;
! ptbl++;
! if ((TTage - ptbl->age) > old) {
old = TTage - ptbl->age;
oldest = ptbl;
}
! }
! if (i == 0) {
ptbl = oldest; /* reuse oldest entry */
! #ifdef HASHSTATS
! THashCol++;
! #endif
! if (--TTageClock == 0) {
TTageClock = TTageRate;
TTage++; /* Everyone is now just a little older */
}
! } else {
! /*!!! if (ptbl->depth > (UCHAR)depth) return false;*/
}
! /*!!!*/ if (ptbl->depth > (UCHAR)depth) return false;
! ptbl->age = TTage - TTdepthage[depth]; /* Set age of this node */
!
! #endif /* NEWAGE */
#ifdef HASHSTATS
HashAdd++;
#endif
ptbl->hashbd = hashbd;
ptbl->depth = (UCHAR) depth;
ptbl->score = score;
***************
*** 290,296 ****
{
TTageClock = TTageRate;
TTage = newage+1; /* Zero entries are pre-expired. */
- TTageRate = ttblsize/(newage/2); /* Average 1/2 of table will be expired */
/* zero the age of all ttable entries */
memset(ttable[white],0,sizeof(struct hashentry)*(unsigned)(ttblsize+rehash));
memset(ttable[black],0,sizeof(struct hashentry)*(unsigned)(ttblsize+rehash));
--- 298,303 ----
***************
*** 824,827 ****
--- 831,837 ----
#endif
}
}
+
+
+
diff -r -b -c gnuchess-4.0.pl74.orig/src/uxdsp.c gnuchess-4.0.pl74/src/uxdsp.c
*** gnuchess-4.0.pl74.orig/src/uxdsp.c Tue Nov 22 01:36:44 1994
--- gnuchess-4.0.pl74/src/uxdsp.c Wed May 03 00:32:42 1995
***************
*** 37,43 ****
--- 37,45 ----
#include <sys/param.h>
#include <sys/types.h>
#include <sys/file.h>
+ #ifndef _amigados
#include <curses.h>
+ #endif
#ifdef notdef
#if defined(__STDC__)
***************
*** 79,84 ****
--- 81,91 ----
signal (SIGINT, Die);
#ifndef MSDOS
signal (SIGQUIT, Die);
+ #ifdef _amigados
+ if (atexit((void (*) (void)) endwin))
+ { perror("atexit");
+ }
+ #endif
initscr ();
crmode ();
#else