1
0
Fork 0
forked from len0rd/rockbox

Clean up the (incorrect) #ifdef spaghetti for the timer. We now have a user timer on the ipods, so we use it.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9461 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Dave Chapman 2006-04-03 17:32:46 +00:00
parent 6e3371110e
commit 1d51dce70b

View file

@ -16,7 +16,10 @@
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// $Log$ // $Log$
// Revision 1.5 2006/04/03 17:11:42 kkurbjun // Revision 1.6 2006/04/03 17:32:46 dave
// Clean up the (incorrect) #ifdef spaghetti for the timer. We now have a user timer on the ipods, so we use it.
//
// Revision 1.5 2006-04-03 17:11:42 kkurbjun
// Finishing touches // Finishing touches
// //
// Revision 1.4 2006-04-03 17:00:56 dave // Revision 1.4 2006-04-03 17:00:56 dave
@ -56,7 +59,7 @@
// I_GetTime // I_GetTime
// returns time in 1/35th second tics // returns time in 1/35th second tics
// //
#if (CONFIG_CPU != PP5020) && !defined(HAVE_LCD_COLOR) #if defined(HAVE_LCD_COLOR) && !defined(SIMULATOR)
volatile unsigned int doomtimer=0; volatile unsigned int doomtimer=0;
void doomtime(void) void doomtime(void)
@ -67,18 +70,14 @@ void doomtime(void)
int I_GetTime (void) int I_GetTime (void)
{ {
#if defined(SIMULATOR) || !defined (HAVE_LCD_COLOR) #if defined(HAVE_LCD_COLOR) && !defined(SIMULATOR)
return doomtimer;
#else
#if HZ==100 #if HZ==100
return ((7*(*rb->current_tick))/20); return ((7*(*rb->current_tick))/20);
#else #else
#error FIX - I assumed HZ was 100 #error FIX - I assumed HZ was 100
#endif #endif
#else
#if (CONFIG_CPU == PP5020)
return (USEC_TIMER * 7)/200000;
#else
return doomtimer;
#endif
#endif #endif
} }
@ -92,7 +91,7 @@ int I_GetTime (void)
// The game is much slower now (in terms of game speed). // The game is much slower now (in terms of game speed).
void I_Init (void) void I_Init (void)
{ {
#if (CONFIG_CPU != PP5020) && !defined(SIMULATOR) && defined(HAVE_LCD_COLOR) #if defined(HAVE_LCD_COLOR) && !defined(SIMULATOR)
rb->timer_register(1, NULL, TIMER_FREQ/TICRATE, 1, doomtime); rb->timer_register(1, NULL, TIMER_FREQ/TICRATE, 1, doomtime);
#endif #endif
I_InitSound(); I_InitSound();