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:
parent
3e57104c5a
commit
284ccb8d4e
1 changed files with 8 additions and 5 deletions
|
@ -171,18 +171,21 @@ CONFIG_KEYPAD == MROBE500_PAD
|
|||
#define LEVEL_MODE_STEEP 1
|
||||
|
||||
#if LCD_HEIGHT <= 64
|
||||
#define CYCLETIME 100
|
||||
#define CYCLES 100
|
||||
static inline int SCALE(int x)
|
||||
{
|
||||
return x == 1 ? x : x >> 1;
|
||||
}
|
||||
#define SIZE 2
|
||||
#else
|
||||
#define CYCLETIME 60
|
||||
#define CYCLES 60
|
||||
#define SCALE(x) (x)
|
||||
#define SIZE 1
|
||||
#endif
|
||||
|
||||
/* in 10 milisecond (ticks) */
|
||||
#define CYCLETIME ((CYCLES*HZ)/1000)
|
||||
|
||||
/*Chopper's local variables to track the terrain position etc*/
|
||||
static int chopCounter;
|
||||
static int iRotorOffset;
|
||||
|
@ -792,7 +795,7 @@ static int chopGameLoop(void)
|
|||
|
||||
while (!exit) {
|
||||
|
||||
end = *rb->current_tick + (CYCLETIME * HZ) / 1000;
|
||||
end = *rb->current_tick + CYCLETIME;
|
||||
|
||||
if(chopUpdateTerrainRecycling(&mGround) == 1)
|
||||
/* mirror the sky if we've changed the ground */
|
||||
|
@ -907,8 +910,8 @@ static int chopGameLoop(void)
|
|||
return ret;
|
||||
}
|
||||
|
||||
if (end > *rb->current_tick)
|
||||
rb->sleep(end-*rb->current_tick);
|
||||
if (TIME_BEFORE(*rb->current_tick, end))
|
||||
rb->sleep(end - *rb->current_tick); /* wait until time is over */
|
||||
else
|
||||
rb->yield();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue