From a3cfe0a434fd1ef5e4a59e34499d10cd0211f76b Mon Sep 17 00:00:00 2001 From: Dave Chapman Date: Thu, 23 Feb 2006 21:16:51 +0000 Subject: Fixes to Chessclock from Miguel (to make it work again after we broke his patch), plus iPod button mapping changes from me git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8816 a1c6a512-1295-4272-9138-f99709370657 --- apps/plugins/chessbox/gnuchess.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'apps/plugins/chessbox/gnuchess.c') diff --git a/apps/plugins/chessbox/gnuchess.c b/apps/plugins/chessbox/gnuchess.c index ed4a7f2a0f..45ca66e778 100644 --- a/apps/plugins/chessbox/gnuchess.c +++ b/apps/plugins/chessbox/gnuchess.c @@ -66,7 +66,7 @@ #define taxicab(a,b) (abs(column[a]-column[b]) + abs(row[a]-row[b])) /* ---- RockBox datatypes and variables */ -static struct plugin_api* rb; +struct plugin_api* rb; /* ---- Chess datatypes and variables ---- */ struct leaf @@ -332,8 +332,7 @@ short pscore[3]; xside = otherside[side]; pscore[white] = pscore[black] = 0; - /* ok, I will yield here although this function will be called much more - many times than needed I think */ + /* ok, I will yield here for lower levels */ rb->yield(); for (c1 = white; c1 <= black; c1++) @@ -1238,6 +1237,9 @@ short xside,pbst,d,e,cf,score,rcnt; unsigned short mv,nxtline[maxdepth]; struct leaf *node,tmp; + /* ok, I will yield here for higher levels */ + rb->yield(); + NodeCnt++; xside = otherside[side]; @@ -2353,7 +2355,7 @@ void GNUChess_Initialize ( void ) { /*ttable = (struct hashentry *)malloc(ttblsz * (unsigned long)sizeof(struct hashentry));*/ buffer_size = ttblsz * sizeof(struct hashentry); - ttable = rb->plugin_get_buffer( &buffer_size ); + ttable = (struct hashentry *)rb->plugin_get_buffer( &buffer_size ); Level = 1; OperatorTime = 0; TCmoves = 60; -- cgit v1.2.3