diff options
author | 2011-05-04 06:01:07 +0000 | |
---|---|---|
committer | 2011-05-04 06:01:07 +0000 | |
commit | 68ddfa5066402a8afde1fc5f80d2240615d34534 (patch) | |
tree | a9dadeb8553a36d89a319b5be90172d9a06ca01c /src/emu/machine/6850acia.h | |
parent | 2ff70f922058eeca411fe2301c134ced8268126c (diff) |
Cleanup acia6850 modernization, removing trampolines.
Moved a few trivial methods in the ptm6840 device to inline.
Diffstat (limited to 'src/emu/machine/6850acia.h')
-rw-r--r-- | src/emu/machine/6850acia.h | 56 |
1 files changed, 18 insertions, 38 deletions
diff --git a/src/emu/machine/6850acia.h b/src/emu/machine/6850acia.h index 4e5b64702d8..1657a353210 100644 --- a/src/emu/machine/6850acia.h +++ b/src/emu/machine/6850acia.h @@ -34,9 +34,9 @@ DEVICE CONFIGURATION MACROS ***************************************************************************/ -#define MCFG_ACIA6850_ADD(_tag, _config) \ +#define MCFG_ACIA6850_ADD(_tag, _interface) \ MCFG_DEVICE_ADD(_tag, ACIA6850, 0) \ - MCFG_DEVICE_CONFIG(_config) + acia6850_device::static_set_interface(*device, _interface); #define ACIA6850_INTERFACE(_name) \ const acia6850_interface(_name) = @@ -74,17 +74,14 @@ class acia6850_device : public device_t, public: // construction/destruction acia6850_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + + // static configuration helpers + static void static_set_interface(device_t &device, const acia6850_interface &interface); - void acia6850_tx_clock_in(); - void acia6850_rx_clock_in(); - - void acia6850_set_rx_clock(int clock); - void acia6850_set_tx_clock(int clock); - - void acia6850_ctrl_w(UINT32 offset, UINT8 data); - UINT8 acia6850_stat_r(UINT32 offset); - void acia6850_data_w(UINT32 offset, UINT8 data); - UINT8 acia6850_data_r(UINT32 offset); + DECLARE_WRITE8_MEMBER( control_write ); + DECLARE_READ8_MEMBER( status_read ); + DECLARE_WRITE8_MEMBER( data_write ); + DECLARE_READ8_MEMBER( data_read ); void tx_clock_in(); void rx_clock_in(); @@ -96,16 +93,16 @@ public: protected: // device-level overrides - virtual void device_config_complete(); virtual void device_start(); virtual void device_reset(); - virtual void device_post_load() { } - virtual void device_clock_changed() { } - - static TIMER_CALLBACK( transmit_event_callback ); - static TIMER_CALLBACK( receive_event_callback ); + virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); private: + enum + { + TIMER_ID_TRANSMIT, + TIMER_ID_RECEIVE + }; void check_interrupts(); @@ -151,19 +148,19 @@ private: int m_divide; - /* Counters */ + // Counters int m_tx_bits; int m_rx_bits; int m_tx_parity; int m_rx_parity; - /* TX/RX state */ + // TX/RX state int m_bits; parity_type m_parity; int m_stopbits; int m_tx_int; - /* Signals */ + // Signals int m_overrun; int m_reset; int m_rts; @@ -187,21 +184,4 @@ extern const device_type ACIA6850; -/*************************************************************************** - PROTOTYPES -***************************************************************************/ - -void acia6850_tx_clock_in(device_t *device) ATTR_NONNULL(1); -void acia6850_rx_clock_in(device_t *device) ATTR_NONNULL(1); - -void acia6850_set_rx_clock(device_t *device, int clock) ATTR_NONNULL(1); -void acia6850_set_tx_clock(device_t *device, int clock) ATTR_NONNULL(1); - -void acia6850_receive_data(device_t *device, UINT8 data) ATTR_NONNULL(1); - -WRITE8_DEVICE_HANDLER( acia6850_ctrl_w ); -READ8_DEVICE_HANDLER( acia6850_stat_r ); -WRITE8_DEVICE_HANDLER( acia6850_data_w ); -READ8_DEVICE_HANDLER( acia6850_data_r ); - #endif /* __ACIA6850_H__ */ |