diff options
Diffstat (limited to 'apps/plugins')
-rw-r--r-- | apps/plugins/brickmania.c | 6 | ||||
-rw-r--r-- | apps/plugins/clix.c | 4 | ||||
-rw-r--r-- | apps/plugins/invadrox.c | 2 | ||||
-rw-r--r-- | apps/plugins/mandelbrot.c | 4 | ||||
-rw-r--r-- | apps/plugins/pong.c | 24 | ||||
-rw-r--r-- | apps/plugins/rockblox1d.c | 2 | ||||
-rw-r--r-- | apps/plugins/spacerocks.c | 2 | ||||
-rw-r--r-- | apps/plugins/xobox.c | 2 |
8 files changed, 23 insertions, 23 deletions
diff --git a/apps/plugins/brickmania.c b/apps/plugins/brickmania.c index 3f79f7c7d6..9bf4cf2b06 100644 --- a/apps/plugins/brickmania.c +++ b/apps/plugins/brickmania.c @@ -1067,7 +1067,7 @@ static void brickmania_sleep(int secs) { if (count == 0) count = *rb->current_tick + HZ*secs; - if ( (*rb->current_tick >= count) && (vscore == score) ) + if ( (TIME_AFTER(*rb->current_tick, count)) && (vscore == score) ) done = true; if(vscore != score) @@ -1323,7 +1323,7 @@ static int brickmania_game_loop(void) if (flip_sides) { - if (*rb->current_tick>=sec_count) + if (TIME_AFTER(*rb->current_tick, sec_count)) { sec_count=*rb->current_tick+HZ; if (num_count!=0) @@ -2111,7 +2111,7 @@ static int brickmania_game_loop(void) rb->yield(); /* Sleep for a bit if there is time to spare */ - if (end > *rb->current_tick) + if (TIME_BEFORE(*rb->current_tick, end)) rb->sleep(end-*rb->current_tick); } return 0; diff --git a/apps/plugins/clix.c b/apps/plugins/clix.c index 9c53bdab70..68c56ec1d5 100644 --- a/apps/plugins/clix.c +++ b/apps/plugins/clix.c @@ -684,7 +684,7 @@ static int clix_handle_game(struct clix_game_state_t* state) while(true) { - if (blink_tick < *rb->current_tick) { + if (TIME_AFTER(*rb->current_tick, blink_tick)) { state->blink = state->blink ? false : true; blink_tick = *rb->current_tick + BLINK_TICKCOUNT; } @@ -692,7 +692,7 @@ static int clix_handle_game(struct clix_game_state_t* state) time = 6; /* number of ticks this function will loop reading keys */ start = *rb->current_tick; end = start + time; - while(end > *rb->current_tick) + while(TIME_BEFORE(*rb->current_tick, end)) { oldx = state->x; oldy = state->y; diff --git a/apps/plugins/invadrox.c b/apps/plugins/invadrox.c index 1886ed4b49..b3e5d164c6 100644 --- a/apps/plugins/invadrox.c +++ b/apps/plugins/invadrox.c @@ -1751,7 +1751,7 @@ void game_loop(void) /* Wait until next frame */ DBG("%ld (%d)\n", end - *rb->current_tick, (CYCLETIME * HZ) / 1000); - if (end > *rb->current_tick) { + if (TIME_BEFORE(*rb->current_tick, end)) { rb->sleep(end - *rb->current_tick); } else { rb->yield(); diff --git a/apps/plugins/mandelbrot.c b/apps/plugins/mandelbrot.c index 00542cbb14..dbab55579d 100644 --- a/apps/plugins/mandelbrot.c +++ b/apps/plugins/mandelbrot.c @@ -643,7 +643,7 @@ void calc_mandelbrot_low_prec(void) /* be nice to other threads: * if at least one tick has passed, yield */ - if (*rb->current_tick > last_yield) { + if (TIME_AFTER(*rb->current_tick, last_yield)) { rb->yield(); last_yield = *rb->current_tick; } @@ -706,7 +706,7 @@ void calc_mandelbrot_high_prec(void) /* be nice to other threads: * if at least one tick has passed, yield */ - if (*rb->current_tick > last_yield) { + if (TIME_AFTER(*rb->current_tick, last_yield)) { rb->yield(); last_yield = *rb->current_tick; } diff --git a/apps/plugins/pong.c b/apps/plugins/pong.c index a6144d9664..1c6f02eb0d 100644 --- a/apps/plugins/pong.c +++ b/apps/plugins/pong.c @@ -450,21 +450,21 @@ int keys(struct pong *p) int start = *rb->current_tick; int end = start + time; - while(end > *rb->current_tick) { + while(TIME_BEFORE(*rb->current_tick, end)) { key = rb->button_get_w_tmo(end - *rb->current_tick); #ifdef HAVE_TOUCHSCREEN - short touch_x, touch_y; - if(key & BUTTON_TOUCHSCREEN) - { - touch_x = rb->button_get_data() >> 16; - touch_y = rb->button_get_data() & 0xFFFF; - if(touch_x >= xpos[0] && touch_x <= xpos[0]+(PAD_WIDTH*4)) - padmove(&p->w_pad[0], touch_y-(p->e_pad[0]*2+PAD_HEIGHT)/2); - - if(touch_x >= xpos[1]-(PAD_WIDTH*4) && touch_x <= xpos[1]) - padmove(&p->w_pad[1], touch_y-(p->e_pad[1]*2+PAD_HEIGHT)/2); - } + short touch_x, touch_y; + if(key & BUTTON_TOUCHSCREEN) + { + touch_x = rb->button_get_data() >> 16; + touch_y = rb->button_get_data() & 0xFFFF; + if(touch_x >= xpos[0] && touch_x <= xpos[0]+(PAD_WIDTH*4)) + padmove(&p->w_pad[0], touch_y-(p->e_pad[0]*2+PAD_HEIGHT)/2); + + if(touch_x >= xpos[1]-(PAD_WIDTH*4) && touch_x <= xpos[1]) + padmove(&p->w_pad[1], touch_y-(p->e_pad[1]*2+PAD_HEIGHT)/2); + } #endif #ifdef HAS_BUTTON_HOLD diff --git a/apps/plugins/rockblox1d.c b/apps/plugins/rockblox1d.c index 12f05bb639..441615845d 100644 --- a/apps/plugins/rockblox1d.c +++ b/apps/plugins/rockblox1d.c @@ -302,7 +302,7 @@ enum plugin_status plugin_start(const void* parameter) ++pos_cur_brick; } - if (end > *rb->current_tick) + if (TIME_BEFORE(*rb->current_tick, end)) rb->sleep(end-*rb->current_tick); else rb->yield(); diff --git a/apps/plugins/spacerocks.c b/apps/plugins/spacerocks.c index ded3900b05..0061967f8b 100644 --- a/apps/plugins/spacerocks.c +++ b/apps/plugins/spacerocks.c @@ -2059,7 +2059,7 @@ static int spacerocks_game_loop(void) if(next_thrust_count) next_thrust_count--; - if (end > *rb->current_tick) + if (TIME_BEFORE(*rb->current_tick, end)) rb->sleep(end-*rb->current_tick); else rb->yield(); diff --git a/apps/plugins/xobox.c b/apps/plugins/xobox.c index 3b7ada31f4..423322098a 100644 --- a/apps/plugins/xobox.c +++ b/apps/plugins/xobox.c @@ -1045,7 +1045,7 @@ static int xobox_loop (void) } } - if (end > *rb->current_tick) + if (TIME_BEFORE(*rb->current_tick, end)) rb->sleep (end - *rb->current_tick); else rb->yield (); |