summaryrefslogtreecommitdiff
path: root/apps/plugins/chessclock.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/chessclock.c')
-rw-r--r--apps/plugins/chessclock.c35
1 files changed, 18 insertions, 17 deletions
diff --git a/apps/plugins/chessclock.c b/apps/plugins/chessclock.c
index d81b71ee44..0f5c03d71d 100644
--- a/apps/plugins/chessclock.c
+++ b/apps/plugins/chessclock.c
@@ -103,7 +103,7 @@ static int chessclock_set_int(char* string,
103#define FLAGS_SET_INT_SECONDS 1 103#define FLAGS_SET_INT_SECONDS 1
104 104
105static char * show_time(int secs); 105static char * show_time(int secs);
106static int simple_menu(int nr, char **strarr); 106static int simple_menu(int nr, unsigned char **strarr);
107 107
108static bool pause; 108static bool pause;
109 109
@@ -215,7 +215,7 @@ static void show_pause_mode(bool enabled)
215 static const char pause_icon[] = {0x00,0x7f,0x7f,0x00,0x7f,0x7f,0x00}; 215 static const char pause_icon[] = {0x00,0x7f,0x7f,0x00,0x7f,0x7f,0x00};
216 216
217 if (enabled) 217 if (enabled)
218 rb->lcd_mono_bitmap(pause_icon, 52, 0, 7, 8); 218 rb->lcd_mono_bitmap((unsigned char *)pause_icon, 52, 0, 7, 8);
219 else 219 else
220 { 220 {
221 rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); 221 rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID);
@@ -253,7 +253,7 @@ static int run_timer(int nr)
253 round_time=true; 253 round_time=true;
254 } 254 }
255 rb->snprintf(player_info, sizeof(player_info), "Player %d", nr+1); 255 rb->snprintf(player_info, sizeof(player_info), "Player %d", nr+1);
256 rb->lcd_puts(0, FIRST_LINE, player_info); 256 rb->lcd_puts(0, FIRST_LINE, (unsigned char *)player_info);
257 last_tick=*rb->current_tick; 257 last_tick=*rb->current_tick;
258 258
259 while (!done) { 259 while (!done) {
@@ -261,9 +261,9 @@ static int run_timer(int nr)
261 long now; 261 long now;
262 if (ticks>max_ticks) { 262 if (ticks>max_ticks) {
263 if (round_time) 263 if (round_time)
264 rb->lcd_puts(0, FIRST_LINE+1, "ROUND UP!"); 264 rb->lcd_puts(0, FIRST_LINE+1, (unsigned char *)"ROUND UP!");
265 else 265 else
266 rb->lcd_puts(0, FIRST_LINE+1, "TIME OUT!"); 266 rb->lcd_puts(0, FIRST_LINE+1, (unsigned char *)"TIME OUT!");
267 rb->backlight_on(); 267 rb->backlight_on();
268 } else { 268 } else {
269 /* 269 /*
@@ -273,7 +273,7 @@ static int run_timer(int nr)
273 rb->lcd_puts(0, FIRST_LINE, player_info); 273 rb->lcd_puts(0, FIRST_LINE, player_info);
274 } 274 }
275 */ 275 */
276 rb->lcd_puts(0, FIRST_LINE, player_info); 276 rb->lcd_puts(0, FIRST_LINE, (unsigned char *)player_info);
277 now=*rb->current_tick; 277 now=*rb->current_tick;
278 if (!pause) { 278 if (!pause) {
279 ticks+=now-last_tick; 279 ticks+=now-last_tick;
@@ -291,9 +291,10 @@ static int run_timer(int nr)
291 show_time((timer_holder[nr].total_time*HZ- 291 show_time((timer_holder[nr].total_time*HZ-
292 timer_holder[nr].used_time- 292 timer_holder[nr].used_time-
293 ticks+HZ-1)/HZ)); 293 ticks+HZ-1)/HZ));
294 rb->lcd_puts(0, FIRST_LINE+1, buf); 294 rb->lcd_puts(0, FIRST_LINE+1, (unsigned char *)buf);
295 } else { 295 } else {
296 rb->lcd_puts(0, FIRST_LINE+1, show_time((max_ticks-ticks+HZ-1)/HZ)); 296 rb->lcd_puts(0, FIRST_LINE+1,
297 (unsigned char *)show_time((max_ticks-ticks+HZ-1)/HZ));
297 } 298 }
298 } 299 }
299#ifdef HAVE_LCD_BITMAP 300#ifdef HAVE_LCD_BITMAP
@@ -326,7 +327,7 @@ static int run_timer(int nr)
326 int ret; 327 int ret;
327 char *menu[]={"Delete player", "Restart round", 328 char *menu[]={"Delete player", "Restart round",
328 "Set round time", "Set total time"}; 329 "Set round time", "Set total time"};
329 ret=simple_menu(4, menu); 330 ret=simple_menu(4, (unsigned char **)menu);
330 if (ret==-1) { 331 if (ret==-1) {
331 retval = 3; 332 retval = 3;
332 done=true; 333 done=true;
@@ -401,17 +402,17 @@ static int run_timer(int nr)
401} 402}
402 403
403static int chessclock_set_int(char* string, 404static int chessclock_set_int(char* string,
404 int* variable, 405 int* variable,
405 int step, 406 int step,
406 int min, 407 int min,
407 int max, 408 int max,
408 int flags) 409 int flags)
409{ 410{
410 bool done = false; 411 bool done = false;
411 int button; 412 int button;
412 413
413 rb->lcd_clear_display(); 414 rb->lcd_clear_display();
414 rb->lcd_puts_scroll(0, FIRST_LINE, string); 415 rb->lcd_puts_scroll(0, FIRST_LINE, (unsigned char *)string);
415 416
416 while (!done) { 417 while (!done) {
417 char str[32]; 418 char str[32];
@@ -419,7 +420,7 @@ static int chessclock_set_int(char* string,
419 rb->snprintf(str, sizeof str,"%s (m:s)", show_time(*variable)); 420 rb->snprintf(str, sizeof str,"%s (m:s)", show_time(*variable));
420 else 421 else
421 rb->snprintf(str, sizeof str,"%d", *variable); 422 rb->snprintf(str, sizeof str,"%d", *variable);
422 rb->lcd_puts(0, FIRST_LINE+1, str); 423 rb->lcd_puts(0, FIRST_LINE+1, (unsigned char *)str);
423#ifdef HAVE_LCD_BITMAP 424#ifdef HAVE_LCD_BITMAP
424 rb->lcd_update(); 425 rb->lcd_update();
425#endif 426#endif
@@ -477,7 +478,7 @@ static char * show_time(int seconds)
477/* -1 = USB 478/* -1 = USB
478 -2 = cancel 479 -2 = cancel
479*/ 480*/
480static int simple_menu(int nr, char **strarr) 481static int simple_menu(int nr, unsigned char **strarr)
481{ 482{
482 int show=0; 483 int show=0;
483 int button; 484 int button;