# HG changeset patch # User nkeynes # Date 1254955479 -36000 # Node ID d8f1cf224e7ea1ecfa1b3a3d415211fa324eef3d # Parent 136fc24d17ef17043fdba641d6ac5cbe487d20f8 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 --- a/src/sh4/scif.c Wed Oct 07 17:53:56 2009 +1000 +++ b/src/sh4/scif.c Thu Oct 08 08:44:39 2009 +1000 @@ -436,6 +436,7 @@ (MMIO_READ( SCIF, SCLSR2 ) & SCLSR2_ORER) == 0 ) intc_clear_interrupt( INT_SCIF_ERI ); } + MMIO_WRITE( SCIF, SCFSR2, result ); } /** @@ -467,12 +468,12 @@ /* Then process the bitrate register */ int bbr = MMIO_READ( SCIF, SCBRR2 ) & 0xFF; - int baudrate = sh4_peripheral_freq / (32 * mult * (bbr+1) ); + SCIF_tick_period = sh4_peripheral_period * (32 * mult * (bbr+1)); + int baudrate = 1000000000 / SCIF_tick_period; if( serial_device != NULL && serial_device->set_line_speed != NULL ) serial_device->set_line_speed( serial_device, baudrate ); - SCIF_tick_period = sh4_peripheral_period * (32 * mult * (bbr+1)); /* clock_set_tick_rate( CLOCK_SCIF, baudrate / 10 ); @@ -666,6 +667,7 @@ SCIF_tick_remainder -= SCIF_tick_period; SCIF_clock_tick(); } + SCIF_slice_cycle = nanosecs; } void SCIF_run_slice( uint32_t nanosecs )