Search
lxdream.org :: lxdream/src/sh4/timer.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/sh4/timer.c
changeset 1127:4b8194e3974c
prev1124:aacaae9812ea
author nkeynes
date Tue Sep 14 19:59:05 2010 +1000 (13 years ago)
permissions -rw-r--r--
last change Fix TMU counter reading to only update the count if the timer is actually
running - fixes various timing issues in KOS
file annotate diff log raw
1.1 --- a/src/sh4/timer.c Sat Sep 11 09:58:22 2010 +1000
1.2 +++ b/src/sh4/timer.c Tue Sep 14 19:59:05 2010 +1000
1.3 @@ -283,13 +283,16 @@
1.4 reg &= 0xFFF;
1.5 switch( reg ) {
1.6 case TCNT0:
1.7 - TMU_count( 0, sh4r.slice_cycle );
1.8 + if( TMU_IS_RUNNING(0) )
1.9 + TMU_count( 0, sh4r.slice_cycle );
1.10 break;
1.11 case TCNT1:
1.12 - TMU_count( 1, sh4r.slice_cycle );
1.13 + if( TMU_IS_RUNNING(1) )
1.14 + TMU_count( 1, sh4r.slice_cycle );
1.15 break;
1.16 case TCNT2:
1.17 - TMU_count( 2, sh4r.slice_cycle );
1.18 + if( TMU_IS_RUNNING(2) )
1.19 + TMU_count( 2, sh4r.slice_cycle );
1.20 break;
1.21 }
1.22 return MMIO_READ( TMU, reg );
.