<html>
<body>
  <div id="body" style="background-color:#ffffff;" >
<table cellspacing="0" cellpadding="0" border="0" rules="cols">
<tr class="head" style="border-bottom-width:1px;border-bottom-style:solid;" ><td class="headtd" style="padding:0;padding-top:.2em;" colspan="4">Commit in <b><tt>lxdream/src/sh4</tt></b></td></tr>
<tr><td><tt><a href="#file1">timer.c</a></tt></td><td id="added" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ddffdd;" align="right">+6</td><td id="removed" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ffdddd;" align="right">-3</td><td class="headtd2" style="padding-left:.3em;padding-right:.3em;" nowrap="nowrap">1f2c7cdee73e -> 4b8194e3974c</td></tr>
</table>
<pre class="comment" style="white-space:-moz-pre-wrap;white-space:-pre-wrap;white-space:-o-pre-wrap;white-space:pre-wrap;word-wrap:break-word;padding:4px;border:1px dashed #000000;background-color:#ffffdd;" >
Fix TMU counter reading to only update the count if the timer is actually
running - fixes various timing issues in KOS
</pre>
<hr /><a name="file1" /><div class="file" style="border:1px solid #eeeeee;margin-top:1em;margin-bottom:1em;" >
<span class="pathname" style="font-family:monospace; float:right;" >lxdream/src/sh4</span><br />
<div class="fileheader" style="margin-bottom:.5em;" ><big><b>timer.c</b></big> <small id="info" style="color: #888888;" >1f2c7cdee73e -> 4b8194e3974c</small></div>
<pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >--- lxdream/src/sh4/timer.c
+++ lxdream/src/sh4/timer.c
@@ -283,13 +283,16 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >     reg &= 0xFFF;
     switch( reg ) {
     case TCNT0:
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-        TMU_count( 0, sh4r.slice_cycle );
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+        if( TMU_IS_RUNNING(0) )
+            TMU_count( 0, sh4r.slice_cycle );
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >         break;
     case TCNT1:
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-        TMU_count( 1, sh4r.slice_cycle );
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+        if( TMU_IS_RUNNING(1) )
+            TMU_count( 1, sh4r.slice_cycle );
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >         break;
     case TCNT2:
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-        TMU_count( 2, sh4r.slice_cycle );
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+        if( TMU_IS_RUNNING(2) )
+            TMU_count( 2, sh4r.slice_cycle );
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >         break;
     }
     return MMIO_READ( TMU, reg );
</pre></div>
<center><small>Chaos Theory</small></center>
</div></body></html>