1
0
Fork 0
forked from len0rd/rockbox

Use TIME_BEFORE() and redo a macro slightly.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23010 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Thomas Martitz 2009-10-08 19:04:53 +00:00
parent 3e57104c5a
commit 284ccb8d4e

View file

@ -171,18 +171,21 @@ CONFIG_KEYPAD == MROBE500_PAD
#define LEVEL_MODE_STEEP 1 #define LEVEL_MODE_STEEP 1
#if LCD_HEIGHT <= 64 #if LCD_HEIGHT <= 64
#define CYCLETIME 100 #define CYCLES 100
static inline int SCALE(int x) static inline int SCALE(int x)
{ {
return x == 1 ? x : x >> 1; return x == 1 ? x : x >> 1;
} }
#define SIZE 2 #define SIZE 2
#else #else
#define CYCLETIME 60 #define CYCLES 60
#define SCALE(x) (x) #define SCALE(x) (x)
#define SIZE 1 #define SIZE 1
#endif #endif
/* in 10 milisecond (ticks) */
#define CYCLETIME ((CYCLES*HZ)/1000)
/*Chopper's local variables to track the terrain position etc*/ /*Chopper's local variables to track the terrain position etc*/
static int chopCounter; static int chopCounter;
static int iRotorOffset; static int iRotorOffset;
@ -792,7 +795,7 @@ static int chopGameLoop(void)
while (!exit) { while (!exit) {
end = *rb->current_tick + (CYCLETIME * HZ) / 1000; end = *rb->current_tick + CYCLETIME;
if(chopUpdateTerrainRecycling(&mGround) == 1) if(chopUpdateTerrainRecycling(&mGround) == 1)
/* mirror the sky if we've changed the ground */ /* mirror the sky if we've changed the ground */
@ -907,8 +910,8 @@ static int chopGameLoop(void)
return ret; return ret;
} }
if (end > *rb->current_tick) if (TIME_BEFORE(*rb->current_tick, end))
rb->sleep(end-*rb->current_tick); rb->sleep(end - *rb->current_tick); /* wait until time is over */
else else
rb->yield(); rb->yield();