Search
lxdream.org :: lxdream/src/sh4/scif.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/sh4/scif.c
changeset 1078:d8f1cf224e7e
prev1077:136fc24d17ef
author nkeynes
date Wed May 27 09:42:24 2015 +1000 (8 years ago)
permissions -rw-r--r--
last change Fix stack alignment when calling the end-block callback (broken on OS X)
file annotate diff log raw
1.1 --- a/src/sh4/scif.c Wed Oct 07 17:53:56 2009 +1000
1.2 +++ b/src/sh4/scif.c Wed May 27 09:42:24 2015 +1000
1.3 @@ -436,6 +436,7 @@
1.4 (MMIO_READ( SCIF, SCLSR2 ) & SCLSR2_ORER) == 0 )
1.5 intc_clear_interrupt( INT_SCIF_ERI );
1.6 }
1.7 + MMIO_WRITE( SCIF, SCFSR2, result );
1.8 }
1.9
1.10 /**
1.11 @@ -467,12 +468,12 @@
1.12 /* Then process the bitrate register */
1.13 int bbr = MMIO_READ( SCIF, SCBRR2 ) & 0xFF;
1.14
1.15 - int baudrate = sh4_peripheral_freq / (32 * mult * (bbr+1) );
1.16 + SCIF_tick_period = sh4_peripheral_period * (32 * mult * (bbr+1));
1.17 + int baudrate = 1000000000 / SCIF_tick_period;
1.18
1.19 if( serial_device != NULL && serial_device->set_line_speed != NULL )
1.20 serial_device->set_line_speed( serial_device, baudrate );
1.21
1.22 - SCIF_tick_period = sh4_peripheral_period * (32 * mult * (bbr+1));
1.23
1.24 /*
1.25 clock_set_tick_rate( CLOCK_SCIF, baudrate / 10 );
1.26 @@ -666,6 +667,7 @@
1.27 SCIF_tick_remainder -= SCIF_tick_period;
1.28 SCIF_clock_tick();
1.29 }
1.30 + SCIF_slice_cycle = nanosecs;
1.31 }
1.32
1.33 void SCIF_run_slice( uint32_t nanosecs )
.