revision 1127:4b8194e3974c
summary |
tree |
shortlog |
changelog |
graph |
changeset |
raw | bz2 | zip | gz changeset | 1127:4b8194e3974c |
parent | 1126:1f2c7cdee73e |
child | 1128:180abbb2a1f3 |
author | nkeynes |
date | Tue Sep 14 19:59:05 2010 +1000 (13 years ago) |
Fix TMU counter reading to only update the count if the timer is actually
running - fixes various timing issues in KOS
running - fixes various timing issues in KOS
src/sh4/timer.c | view | annotate | diff | log |
1.1 --- a/src/sh4/timer.c Mon Sep 13 19:01:15 2010 +10001.2 +++ b/src/sh4/timer.c Tue Sep 14 19:59:05 2010 +10001.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 );
.