diff --git a/apps/plugins/chessclock.c b/apps/plugins/chessclock.c old mode 100644 new mode 100755 index a69b3bb..5f13b84 --- a/apps/plugins/chessclock.c +++ b/apps/plugins/chessclock.c @@ -311,7 +311,10 @@ enum plugin_status plugin_start(const void* parameter) int nr; (void)parameter; - rb->memset(&settings, 0, sizeof(settings)); + + settings.nr_timers = 1; + settings.total_time = 0; + settings.round_time = 0; /* now go ahead and have fun! */ rb->splash(HZ, "Chess Clock"); @@ -367,17 +370,22 @@ enum plugin_status plugin_start(const void* parameter) do { int ret=0; done=true; - for (i=0; done && ibacklight_on(); } + rb->lcd_puts(0, FIRST_LINE, (unsigned char *)player_info); } last_tick=now; if (round_time) { @@ -521,7 +532,7 @@ static int run_timer(int nr) switch(rb->do_menu(&menu, NULL, NULL, false)) { case 0: - /* delete timer */ + /* delete player */ timer_holder[nr].hidden=true; retval=1; done=true; @@ -529,10 +540,11 @@ static int run_timer(int nr) case 1: /* restart */ ticks=0; + last_tick = *rb->current_tick; break; case 2: /* set round time */ - val=(max_ticks-ticks)/HZ; + val = (max_ticks > ticks)? (max_ticks-ticks)/HZ : 0; res=chessclock_set_int("Round time", &val, 10, 0, MAX_TIME,