<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">scif.c</a></tt></td><td id="added" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ddffdd;" align="right">+4</td><td id="removed" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ffdddd;" align="right">-2</td><td class="headtd2" style="padding-left:.3em;padding-right:.3em;" nowrap="nowrap">136fc24d17ef -> d8f1cf224e7e</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 SCIF operation
  - status updates weren't being written back to the register (oops)
  - slice cycle not updated on partial tick execution
  - baudrate computation was always 0
</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>scif.c</b></big> <small id="info" style="color: #888888;" >136fc24d17ef -> d8f1cf224e7e</small></div>
<pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >--- lxdream/src/sh4/scif.c
+++ lxdream/src/sh4/scif.c
@@ -436,6 +436,7 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >                 (MMIO_READ( SCIF, SCLSR2 ) & SCLSR2_ORER) == 0 )
             intc_clear_interrupt( INT_SCIF_ERI );
     }
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+    MMIO_WRITE( SCIF, SCFSR2, result );
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > }
 
 /**
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -467,12 +468,12 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >         /* Then process the bitrate register */
         int bbr = MMIO_READ( SCIF, SCBRR2 ) & 0xFF;
 
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-        int baudrate = sh4_peripheral_freq / (32 * mult * (bbr+1) );
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+        SCIF_tick_period = sh4_peripheral_period * (32 * mult * (bbr+1));
+        int baudrate = 1000000000 / SCIF_tick_period;
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > 
         if( serial_device != NULL && serial_device->set_line_speed != NULL )
             serial_device->set_line_speed( serial_device, baudrate );
 
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-        SCIF_tick_period = sh4_peripheral_period * (32 * mult * (bbr+1));
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > 
         /*
          clock_set_tick_rate( CLOCK_SCIF, baudrate / 10 );
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -666,6 +667,7 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >         SCIF_tick_remainder -= SCIF_tick_period;
         SCIF_clock_tick();
     }
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+    SCIF_slice_cycle = nanosecs;
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > }
 
 void SCIF_run_slice( uint32_t nanosecs )
</pre></div>
<center><small>Chaos Theory</small></center>
</div></body></html>