trunk/src/emu/diserial.c
| r24030 | r24031 | |
| 65 | 65 | m_tra_clock = device().machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(device_serial_interface::tra_timer), this)); |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | | void device_serial_interface::set_rcv_rate(int baud) |
| 69 | | { |
| 70 | | m_rcv_rate = baud ? attotime::from_hz(baud) : attotime::never; |
| 71 | | receive_register_reset(); |
| 72 | | m_rcv_clock->adjust(attotime::never); |
| 73 | | } |
| 74 | | |
| 75 | | void device_serial_interface::set_tra_rate(int baud) |
| 76 | | { |
| 77 | | m_tra_rate = baud ? attotime::from_hz(baud) : attotime::never; |
| 78 | | transmit_register_reset(); |
| 79 | | m_tra_clock->adjust(attotime::never); |
| 80 | | } |
| 81 | | |
| 82 | 68 | void device_serial_interface::set_rcv_rate(attotime rate) |
| 83 | 69 | { |
| 84 | 70 | m_rcv_rate = rate; |
| r24030 | r24031 | |
| 93 | 79 | m_tra_clock->adjust(attotime::never); |
| 94 | 80 | } |
| 95 | 81 | |
| 96 | | void device_serial_interface::set_rcv_rate(UINT32 clock, int div) |
| 97 | | { |
| 98 | | m_rcv_rate = attotime::from_hz(clock) * div; |
| 99 | | receive_register_reset(); |
| 100 | | m_rcv_clock->adjust(attotime::never); |
| 101 | | } |
| 102 | | |
| 103 | | void device_serial_interface::set_tra_rate(UINT32 clock, int div) |
| 104 | | { |
| 105 | | m_tra_rate = attotime::from_hz(clock) * div; |
| 106 | | transmit_register_reset(); |
| 107 | | m_tra_clock->adjust(attotime::never); |
| 108 | | } |
| 109 | | |
| 110 | 82 | void device_serial_interface::tra_clock() |
| 111 | 83 | { |
| 112 | 84 | tra_callback(); |
trunk/src/emu/diserial.h
| r24030 | r24031 | |
| 91 | 91 | void receive_register_update_bit(int bit); |
| 92 | 92 | void receive_register_extract(); |
| 93 | 93 | |
| 94 | | void set_rcv_rate(attotime baud); |
| 95 | | void set_tra_rate(attotime baud); |
| 96 | | void set_rcv_rate(UINT32 clock, int div); |
| 97 | | void set_tra_rate(UINT32 clock, int div); |
| 98 | | void set_rcv_rate(int baud); |
| 99 | | void set_tra_rate(int baud); |
| 94 | void set_rcv_rate(attotime rate); |
| 95 | void set_tra_rate(attotime rate); |
| 96 | void set_rcv_rate(UINT32 clock, int div) { set_rcv_rate((clock && div) ? (attotime::from_hz(clock) * div) : attotime::never); } |
| 97 | void set_tra_rate(UINT32 clock, int div) { set_tra_rate((clock && div) ? (attotime::from_hz(clock) * div) : attotime::never); } |
| 98 | void set_rcv_rate(int baud) { set_rcv_rate(baud ? attotime::from_hz(baud) : attotime::never); } |
| 99 | void set_tra_rate(int baud) { set_tra_rate(baud ? attotime::from_hz(baud) : attotime::never); } |
| 100 | void set_rate(attotime rate) { set_rcv_rate(rate); set_tra_rate(rate); } |
| 101 | void set_rate(UINT32 clock, int div) { set_rcv_rate(clock, div); set_tra_rate(clock, div); } |
| 102 | void set_rate(int baud) { set_rcv_rate(baud); set_tra_rate(baud); } |
| 103 | |
| 100 | 104 | void tra_clock(); |
| 101 | 105 | void rcv_clock(); |
| 102 | 106 | |