Index: rockbox/apps/plugins/brickmania.c =================================================================== --- rockbox/apps/plugins/brickmania.c (revision 22730) +++ rockbox/apps/plugins/brickmania.c (working copy) @@ -275,26 +275,27 @@ */ #define SPEED_SCALE GAMESCREEN_HEIGHT/176 +#define SPEED_CONVERT(x) (x*SPEED_SCALE!=0?x*SPEED_SCALE:x>0?1:-1) /* These are all used as ball speeds depending on where the ball hit the * paddle. */ -#define SPEED_1Q_X ( 6 * SPEED_SCALE) -#define SPEED_1Q_Y (-2 * SPEED_SCALE) -#define SPEED_2Q_X ( 4 * SPEED_SCALE) -#define SPEED_2Q_Y (-3 * SPEED_SCALE) -#define SPEED_3Q_X ( 3 * SPEED_SCALE) -#define SPEED_3Q_Y (-4 * SPEED_SCALE) -#define SPEED_4Q_X ( 2 * SPEED_SCALE) -#define SPEED_4Q_Y (-4 * SPEED_SCALE) +#define SPEED_1Q_X SPEED_CONVERT(6) +#define SPEED_1Q_Y SPEED_CONVERT(-2) +#define SPEED_2Q_X SPEED_CONVERT(4) +#define SPEED_2Q_Y SPEED_CONVERT(-3) +#define SPEED_3Q_X SPEED_CONVERT(3) +#define SPEED_3Q_Y SPEED_CONVERT(-4) +#define SPEED_4Q_X SPEED_CONVERT(2) +#define SPEED_4Q_Y SPEED_CONVERT(-4) /* This is used to determine the speed of the paddle */ -#define SPEED_PAD ( 8 * SPEED_SCALE) +#define SPEED_PAD SPEED_CONVERT(8) /* This defines the speed that the powerups drop */ -#define SPEED_POWER ( 2 * SPEED_SCALE) +#define SPEED_POWER SPEED_CONVERT(2) /* This defines the speed that the shot moves */ -#define SPEED_FIRE ( 4 * SPEED_SCALE) +#define SPEED_FIRE SPEED_CONVERT(4) /*calculate paddle y-position */ #define PAD_POS_Y (GAMESCREEN_HEIGHT - PAD_HEIGHT - 1) @@ -985,9 +986,10 @@ resume = false; resume_file = false; + end = *rb->current_tick; while(true) { /* Convert CYCLETIME (in ms) to HZ */ - end = *rb->current_tick + (CYCLETIME * HZ) / 1000; + end += (CYCLETIME * HZ) / 1000; if (life >= 0) { #ifdef HAVE_LCD_COLOR @@ -1109,6 +1111,7 @@ if (life>=0) { brickmania_init_game(0); brickmania_sleep(2); + end = *rb->current_tick; } break; case 2: @@ -1478,6 +1481,7 @@ /* No lives left reset game */ brickmania_init_game(0); brickmania_sleep(2); + end = *rb->current_tick; } } } @@ -1592,6 +1596,7 @@ score+=100; brickmania_init_game(1); brickmania_sleep(2); + end = *rb->current_tick; } else { rb->lcd_getstringsize("Congratulations!", &sw, NULL);