1.1 --- a/src/sh4/timer.c Wed Jan 03 09:00:17 2007 +0000
1.2 +++ b/src/sh4/timer.c Sat Jan 06 04:05:32 2007 +0000
1.5 - * $Id: timer.c,v 1.5 2007-01-03 09:00:17 nkeynes Exp $
1.6 + * $Id: timer.c,v 1.6 2007-01-06 04:05:32 nkeynes Exp $
1.8 * SH4 Timer/Clock peripheral modules (CPG, TMU, RTC), combined together to
1.9 * keep things simple (they intertwine a bit).
1.10 @@ -191,9 +191,13 @@
1.11 TMU_timers[timer].timer_remainder = 0;
1.15 + * Stop the given timer. Run it up to the current time and leave it there.
1.17 void TMU_stop( int timer )
1.20 + TMU_count( timer, sh4r.slice_cycle );
1.21 + TMU_timers[timer].timer_run = sh4r.slice_cycle;
1.26 oldval = MMIO_READ( TMU, TSTR );
1.27 for( i=0; i<3; i++ ) {
1.28 uint32_t tmp = 1<<i;
1.29 - if( (oldval & tmp) == 1 && (val&tmp) == 0 )
1.30 + if( (oldval & tmp) != 0 && (val&tmp) == 0 )
1.32 - else if( (oldval&tmp) == 0 && (val&tmp) == 1 )
1.33 + else if( (oldval&tmp) == 0 && (val&tmp) != 0 )