diff options
Diffstat (limited to 'apps/plugins/chessbox/chessbox.c')
-rw-r--r-- | apps/plugins/chessbox/chessbox.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/apps/plugins/chessbox/chessbox.c b/apps/plugins/chessbox/chessbox.c index 5e1f53503e..edebbf234b 100644 --- a/apps/plugins/chessbox/chessbox.c +++ b/apps/plugins/chessbox/chessbox.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #ifdef HAVE_LCD_BITMAP | 24 | #ifdef HAVE_LCD_BITMAP |
25 | 25 | ||
26 | #include "gnuchess.h" | 26 | #include "gnuchess.h" |
27 | #include "opening.h" | ||
27 | 28 | ||
28 | /* type definitions */ | 29 | /* type definitions */ |
29 | struct cb_command { | 30 | struct cb_command { |
@@ -249,20 +250,16 @@ static void cb_drawboard (void) { | |||
249 | } | 250 | } |
250 | 251 | ||
251 | /* draw board limits */ | 252 | /* draw board limits */ |
252 | if ( LCD_WIDTH > TILE_WIDTH*8 ) { | 253 | #if (LCD_WIDTH > TILE_WIDTH*8) && (LCD_HEIGHT > TILE_HEIGHT*8) |
253 | rb->lcd_set_drawmode ( DRMODE_FG ); | 254 | rb->lcd_drawrect(XOFS - 1, YOFS - 1, TILE_WIDTH*8 + 2, TILE_HEIGHT*8 + 2); |
254 | rb->lcd_drawline ( XOFS - 1 , YOFS , | 255 | #elif LCD_WIDTH > TILE_WIDTH*8 |
255 | XOFS - 1 , YOFS + TILE_HEIGHT*8 ); | 256 | rb->lcd_vline(XOFS - 1, 0, LCD_HEIGHT - 1); |
256 | rb->lcd_drawline ( XOFS + 8*TILE_WIDTH , YOFS , | 257 | rb->lcd_vline(XOFS + 8*TILE_WIDTH, 0, LCD_HEIGHT - 1); |
257 | XOFS + 8*TILE_WIDTH , YOFS + TILE_HEIGHT*8 ); | 258 | #elif LCD_HEIGHT > TILE_HEIGHT*8 |
258 | } | 259 | rb->lcd_hline(0, LCD_WIDTH - 1, YOFS - 1); |
259 | if ( LCD_HEIGHT > TILE_HEIGHT*8 ) { | 260 | rb->lcd_hline(0, LCD_WIDTH - 1, YOFS + TILE_HEIGHT*8); |
260 | rb->lcd_set_drawmode ( DRMODE_FG ); | 261 | #endif |
261 | rb->lcd_drawline ( XOFS , YOFS - 1 , | 262 | |
262 | XOFS + TILE_WIDTH*8 , YOFS - 1 ); | ||
263 | rb->lcd_drawline ( XOFS , YOFS + TILE_HEIGHT*8 , | ||
264 | XOFS + 8*TILE_WIDTH , YOFS + TILE_HEIGHT*8 ); | ||
265 | } | ||
266 | rb->lcd_update(); | 263 | rb->lcd_update(); |
267 | } | 264 | } |
268 | 265 | ||
@@ -273,6 +270,7 @@ void cb_switch ( short x , short y ) { | |||
273 | YOFS + ( 7 - y )*TILE_HEIGHT +1 , | 270 | YOFS + ( 7 - y )*TILE_HEIGHT +1 , |
274 | TILE_WIDTH-2 , TILE_HEIGHT-2 ); | 271 | TILE_WIDTH-2 , TILE_HEIGHT-2 ); |
275 | rb->lcd_update(); | 272 | rb->lcd_update(); |
273 | rb->lcd_set_drawmode ( DRMODE_SOLID ); | ||
276 | } | 274 | } |
277 | 275 | ||
278 | /* ---- callback for capturing interaction while thinking ---- */ | 276 | /* ---- callback for capturing interaction while thinking ---- */ |
@@ -370,6 +368,7 @@ void cb_saveposition ( void ) { | |||
370 | rb->write(fd, &(kingmoved[white]), sizeof(kingmoved[white])); | 368 | rb->write(fd, &(kingmoved[white]), sizeof(kingmoved[white])); |
371 | rb->write(fd, &(kingmoved[black]), sizeof(kingmoved[black])); | 369 | rb->write(fd, &(kingmoved[black]), sizeof(kingmoved[black])); |
372 | 370 | ||
371 | rb->write(fd, &(withbook), sizeof(withbook)); | ||
373 | rb->write(fd, &(Level), sizeof(Level)); | 372 | rb->write(fd, &(Level), sizeof(Level)); |
374 | rb->write(fd, &(TCflag), sizeof(TCflag)); | 373 | rb->write(fd, &(TCflag), sizeof(TCflag)); |
375 | rb->write(fd, &(OperatorTime), sizeof(OperatorTime)); | 374 | rb->write(fd, &(OperatorTime), sizeof(OperatorTime)); |
@@ -421,6 +420,7 @@ void cb_restoreposition ( void ) { | |||
421 | rb->read(fd, &(kingmoved[white]), sizeof(kingmoved[white])); | 420 | rb->read(fd, &(kingmoved[white]), sizeof(kingmoved[white])); |
422 | rb->read(fd, &(kingmoved[black]), sizeof(kingmoved[black])); | 421 | rb->read(fd, &(kingmoved[black]), sizeof(kingmoved[black])); |
423 | 422 | ||
423 | rb->read(fd, &(withbook), sizeof(withbook)); | ||
424 | rb->read(fd, &(Level), sizeof(Level)); | 424 | rb->read(fd, &(Level), sizeof(Level)); |
425 | rb->read(fd, &(TCflag), sizeof(TCflag)); | 425 | rb->read(fd, &(TCflag), sizeof(TCflag)); |
426 | rb->read(fd, &(OperatorTime), sizeof(OperatorTime)); | 426 | rb->read(fd, &(OperatorTime), sizeof(OperatorTime)); |