summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/machine/z80sio.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/machine/z80sio.h')
-rw-r--r--src/devices/machine/z80sio.h391
1 files changed, 146 insertions, 245 deletions
diff --git a/src/devices/machine/z80sio.h b/src/devices/machine/z80sio.h
index 4e18b377872..f4363d23ce6 100644
--- a/src/devices/machine/z80sio.h
+++ b/src/devices/machine/z80sio.h
@@ -67,9 +67,6 @@
#define SIO_CHANB_TAG "chb"
/* Generic macros */
-#define MCFG_Z80SIO_OFFSETS(_rxa, _txa, _rxb, _txb) \
- z80sio_device::configure_channels(*device, _rxa, _txa, _rxb, _txb);
-
#define MCFG_Z80SIO_OUT_INT_CB(_devcb) \
devcb = &z80sio_device::set_out_int_callback(*device, DEVCB_##_devcb);
@@ -78,47 +75,47 @@
// Port A callbacks
#define MCFG_Z80SIO_OUT_TXDA_CB(_devcb) \
- devcb = &z80sio_device::set_out_txda_callback(*device, DEVCB_##_devcb);
+ devcb = &z80sio_device::set_out_txd_callback<0>(*device, DEVCB_##_devcb);
#define MCFG_Z80SIO_OUT_DTRA_CB(_devcb) \
- devcb = &z80sio_device::set_out_dtra_callback(*device, DEVCB_##_devcb);
+ devcb = &z80sio_device::set_out_dtr_callback<0>(*device, DEVCB_##_devcb);
#define MCFG_Z80SIO_OUT_RTSA_CB(_devcb) \
- devcb = &z80sio_device::set_out_rtsa_callback(*device, DEVCB_##_devcb);
+ devcb = &z80sio_device::set_out_rts_callback<0>(*device, DEVCB_##_devcb);
#define MCFG_Z80SIO_OUT_WRDYA_CB(_devcb) \
- devcb = &z80sio_device::set_out_wrdya_callback(*device, DEVCB_##_devcb);
+ devcb = &z80sio_device::set_out_wrdy_callback<0>(*device, DEVCB_##_devcb);
#define MCFG_Z80SIO_OUT_SYNCA_CB(_devcb) \
- devcb = &z80sio_device::set_out_synca_callback(*device, DEVCB_##_devcb);
+ devcb = &z80sio_device::set_out_sync_callback<0>(*device, DEVCB_##_devcb);
#define MCFG_Z80SIO_OUT_RXDRQA_CB(_devcb) \
- devcb = &z80sio_device::set_out_rxdrqa_callback(*device, DEVCB_##_devcb);
+ devcb = &z80sio_device::set_out_rxdrq_callback<0>(*device, DEVCB_##_devcb);
#define MCFG_Z80SIO_OUT_TXDRQA_CB(_devcb) \
- devcb = &z80sio_device::set_out_txdrqa_callback(*device, DEVCB_##_devcb);
+ devcb = &z80sio_device::set_out_txdrq_callback<0>(*device, DEVCB_##_devcb);
// Port B callbacks
#define MCFG_Z80SIO_OUT_TXDB_CB(_devcb) \
- devcb = &z80sio_device::set_out_txdb_callback(*device, DEVCB_##_devcb);
+ devcb = &z80sio_device::set_out_txd_callback<1>(*device, DEVCB_##_devcb);
#define MCFG_Z80SIO_OUT_DTRB_CB(_devcb) \
- devcb = &z80sio_device::set_out_dtrb_callback(*device, DEVCB_##_devcb);
+ devcb = &z80sio_device::set_out_dtr_callback<1>(*device, DEVCB_##_devcb);
#define MCFG_Z80SIO_OUT_RTSB_CB(_devcb) \
- devcb = &z80sio_device::set_out_rtsb_callback(*device, DEVCB_##_devcb);
+ devcb = &z80sio_device::set_out_rts_callback<1>(*device, DEVCB_##_devcb);
#define MCFG_Z80SIO_OUT_WRDYB_CB(_devcb) \
- devcb = &z80sio_device::set_out_wrdyb_callback(*device, DEVCB_##_devcb);
+ devcb = &z80sio_device::set_out_wrdy_callback<1>(*device, DEVCB_##_devcb);
#define MCFG_Z80SIO_OUT_SYNCB_CB(_devcb) \
- devcb = &z80sio_device::set_out_syncb_callback(*device, DEVCB_##_devcb);
+ devcb = &z80sio_device::set_out_sync_callback<1>(*device, DEVCB_##_devcb);
#define MCFG_Z80SIO_OUT_RXDRQB_CB(_devcb) \
- devcb = &z80sio_device::set_out_rxdrqb_callback(*device, DEVCB_##_devcb);
+ devcb = &z80sio_device::set_out_rxdrq_callback<1>(*device, DEVCB_##_devcb);
#define MCFG_Z80SIO_OUT_TXDRQB_CB(_devcb) \
- devcb = &z80sio_device::set_out_txdrqb_callback(*device, DEVCB_##_devcb);
+ devcb = &z80sio_device::set_out_txdrq_callback<1>(*device, DEVCB_##_devcb);
//**************************************************************************
@@ -129,24 +126,15 @@
class z80sio_device;
-class z80sio_channel : public device_t,
- public device_serial_interface
+class z80sio_channel : public device_t
{
friend class z80sio_device;
+ friend class i8274_new_device;
+ friend class upd7201_new_device;
public:
z80sio_channel(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
- virtual void device_reset() override;
-
- // device_serial_interface overrides
- virtual void tra_callback() override;
- virtual void tra_complete() override;
- virtual void rcv_callback() override;
- virtual void rcv_complete() override;
-
// read register handlers
uint8_t do_sioreg_rr0();
uint8_t do_sioreg_rr1();
@@ -169,23 +157,17 @@ public:
uint8_t data_read();
void data_write(uint8_t data);
- void receive_data(uint8_t data);
-
- DECLARE_WRITE_LINE_MEMBER( write_rx );
+ DECLARE_WRITE_LINE_MEMBER( write_rx ) { m_rxd = state; }
DECLARE_WRITE_LINE_MEMBER( cts_w );
DECLARE_WRITE_LINE_MEMBER( dcd_w );
DECLARE_WRITE_LINE_MEMBER( rxc_w );
DECLARE_WRITE_LINE_MEMBER( txc_w );
DECLARE_WRITE_LINE_MEMBER( sync_w );
- int m_rxc;
- int m_txc;
-
// Register state
// read registers enum
uint8_t m_rr0; // REG_RR0_STATUS
uint8_t m_rr1; // REG_RR1_SPEC_RCV_COND
- uint8_t m_rr2; // REG_RR2_INTERRUPT_VECT
// write registers enum
uint8_t m_wr0; // REG_WR0_COMMAND_REGPT
uint8_t m_wr1; // REG_WR1_INT_DMA_ENABLE
@@ -196,15 +178,12 @@ public:
uint8_t m_wr6; // REG_WR6_SYNC_OR_SDLC_A
uint8_t m_wr7; // REG_WR7_SYNC_OR_SDLC_F
- int m_variant; // Set in device
-
protected:
enum
{
INT_TRANSMIT = 0,
INT_EXTERNAL,
- INT_RECEIVE,
- INT_SPECIAL
+ INT_RECEIVE
};
enum
@@ -235,174 +214,116 @@ protected:
REG_WR7_SYNC_OR_SDLC_F = 7
};
- enum
- {
- RR0_RX_CHAR_AVAILABLE = 0x01,
- RR0_INTERRUPT_PENDING = 0x02,
- RR0_TX_BUFFER_EMPTY = 0x04,
- RR0_DCD = 0x08,
- RR0_SYNC_HUNT = 0x10,
- RR0_CTS = 0x20,
- RR0_TX_UNDERRUN = 0x40,
- RR0_BREAK_ABORT = 0x80
- };
-
- enum
+ // used in a flag bitmap variable
+ enum : uint8_t
{
- RR1_ALL_SENT = 0x01,
- RR1_RESIDUE_CODE_MASK = 0x0e,
- RR1_PARITY_ERROR = 0x10,
- RR1_RX_OVERRUN_ERROR = 0x20,
- RR1_CRC_FRAMING_ERROR = 0x40,
- RR1_END_OF_FRAME = 0x80
+ TX_FLAG_CRC = 1U << 0, // include in checksum calculation
+ TX_FLAG_FRAMING = 1U << 1, // tranmitting framing bits
+ TX_FLAG_SPECIAL = 1U << 2 // transmitting checksum or abort sequence
};
- enum
- {
- RR2_INT_VECTOR_MASK = 0xff,
- RR2_INT_VECTOR_V1 = 0x02,
- RR2_INT_VECTOR_V2 = 0x04,
- RR2_INT_VECTOR_V3 = 0x08
- };
+ z80sio_channel(
+ const machine_config &mconfig,
+ device_type type,
+ const char *tag,
+ device_t *owner,
+ uint32_t clock,
+ uint8_t rr1_auto_reset);
- enum
- {
- WR0_REGISTER_MASK = 0x07,
- WR0_COMMAND_MASK = 0x38,
- WR0_NULL = 0x00,
- WR0_SEND_ABORT = 0x08,
- WR0_RESET_EXT_STATUS = 0x10,
- WR0_CHANNEL_RESET = 0x18,
- WR0_ENABLE_INT_NEXT_RX = 0x20,
- WR0_RESET_TX_INT = 0x28,
- WR0_ERROR_RESET = 0x30,
- WR0_RETURN_FROM_INT = 0x38,
- WR0_CRC_RESET_CODE_MASK = 0xc0,
- WR0_CRC_RESET_NULL = 0x00,
- WR0_CRC_RESET_RX = 0x40,
- WR0_CRC_RESET_TX = 0x80,
- WR0_CRC_RESET_TX_UNDERRUN = 0xc0
- };
-
- enum
- {
- WR1_EXT_INT_ENABLE = 0x01,
- WR1_TX_INT_ENABLE = 0x02,
- WR1_STATUS_VECTOR = 0x04,
- WR1_RX_INT_MODE_MASK = 0x18,
- WR1_RX_INT_DISABLE = 0x00,
- WR1_RX_INT_FIRST = 0x08,
- WR1_RX_INT_ALL_PARITY = 0x10, // not supported
- WR1_RX_INT_ALL = 0x18,
- WR1_WRDY_ON_RX_TX = 0x20, // not supported
- WR1_WRDY_FUNCTION = 0x40, // not supported
- WR1_WRDY_ENABLE = 0x80 // not supported
- };
-
- enum
- {
- WR2_DATA_XFER_INT = 0x00, // not supported
- WR2_DATA_XFER_DMA_INT = 0x01, // not supported
- WR2_DATA_XFER_DMA = 0x02, // not supported
- WR2_DATA_XFER_ILLEGAL = 0x03, // not supported
- WR2_DATA_XFER_MASK = 0x03, // not supported
- WR2_PRIORITY = 0x04, // not supported
- WR2_MODE_8085_1 = 0x00, // not supported
- WR2_MODE_8085_2 = 0x08, // not supported
- WR2_MODE_8086_8088 = 0x10, // not supported
- WR2_MODE_ILLEGAL = 0x18, // not supported
- WR2_MODE_MASK = 0x18, // not supported
- WR2_VECTORED_INT = 0x20, // not supported
- WR2_PIN10_SYNDETB_RTSB = 0x80 // not supported
- };
-
- enum
- {
- WR3_RX_ENABLE = 0x01,
- WR3_SYNC_CHAR_LOAD_INHIBIT= 0x02, // not supported
- WR3_ADDRESS_SEARCH_MODE = 0x04, // not supported
- WR3_RX_CRC_ENABLE = 0x08, // not supported
- WR3_ENTER_HUNT_PHASE = 0x10, // not supported
- WR3_AUTO_ENABLES = 0x20,
- WR3_RX_WORD_LENGTH_MASK = 0xc0,
- WR3_RX_WORD_LENGTH_5 = 0x00,
- WR3_RX_WORD_LENGTH_7 = 0x40,
- WR3_RX_WORD_LENGTH_6 = 0x80,
- WR3_RX_WORD_LENGTH_8 = 0xc0
- };
-
- enum
- {
- WR4_PARITY_ENABLE = 0x01,
- WR4_PARITY_EVEN = 0x02,
- WR4_STOP_BITS_MASK = 0x0c,
- WR4_STOP_BITS_1 = 0x04,
- WR4_STOP_BITS_1_5 = 0x08, // not supported
- WR4_STOP_BITS_2 = 0x0c,
- WR4_SYNC_MODE_MASK = 0x30, // not supported
- WR4_SYNC_MODE_8_BIT = 0x00, // not supported
- WR4_SYNC_MODE_16_BIT = 0x10, // not supported
- WR4_SYNC_MODE_SDLC = 0x20, // not supported
- WR4_SYNC_MODE_EXT = 0x30, // not supported
- WR4_CLOCK_RATE_MASK = 0xc0,
- WR4_CLOCK_RATE_X1 = 0x00,
- WR4_CLOCK_RATE_X16 = 0x40,
- WR4_CLOCK_RATE_X32 = 0x80,
- WR4_CLOCK_RATE_X64 = 0xc0
- };
-
- enum
- {
- WR5_TX_CRC_ENABLE = 0x01, // not supported
- WR5_RTS = 0x02,
- WR5_CRC16 = 0x04, // not supported
- WR5_TX_ENABLE = 0x08,
- WR5_SEND_BREAK = 0x10,
- WR5_TX_WORD_LENGTH_MASK = 0x60,
- WR5_TX_WORD_LENGTH_5 = 0x00,
- WR5_TX_WORD_LENGTH_6 = 0x40,
- WR5_TX_WORD_LENGTH_7 = 0x20,
- WR5_TX_WORD_LENGTH_8 = 0x60,
- WR5_DTR = 0x80
- };
+ // device-level overrides
+ virtual void device_resolve_objects() override;
+ virtual void device_start() override;
+ virtual void device_reset() override;
- void update_serial();
- void update_rts();
+ void update_dtr_rts_break();
void set_dtr(int state);
void set_rts(int state);
int get_clock_mode();
- stop_bits_t get_stop_bits();
int get_rx_word_length();
- int get_tx_word_length();
+ int get_tx_word_length() const;
+ int get_tx_word_length(uint8_t data) const;
// receiver state
- util::fifo<uint8_t, 3> m_rx_data_fifo;
- util::fifo<uint8_t, 3> m_rx_error_fifo;
- uint8_t m_rx_error; // current receive error
+ int m_rx_fifo_depth;
+ uint32_t m_rx_data_fifo;
+ uint32_t m_rx_error_fifo;
+
+ int m_rx_clock; // receive clock line state
+ int m_rx_count; // clocks until next sample
+ int m_rx_bit; // receive data bit (0 = start bit, 1 = LSB, etc.)
+ uint16_t m_rx_sr; // receive shift register
- int m_rx_clock; // receive clock pulse count
int m_rx_first; // first character received
int m_rx_break; // receive break condition
- uint8_t m_rx_rr0_latch; // read register 0 latched
int m_rxd;
int m_sh; // sync hunt
- int m_cts; // clear to send latch
- int m_dcd; // data carrier detect latch
// transmitter state
- uint8_t m_tx_data; // transmit data register
- int m_tx_clock; // transmit clock pulse count
-
+ uint8_t m_tx_data;
+
+ int m_tx_clock; // transmit clock line state
+ int m_tx_count; // clocks until next bit transition
+ int m_tx_bits; // remaining bits in shift register
+ int m_tx_parity; // parity bit position or zero if disabled
+ uint16_t m_tx_sr; // transmit shift register
+ uint16_t m_tx_crc; // calculated transmit checksum
+ uint8_t m_tx_hist; // transmit history (for bitstuffing)
+ uint8_t m_tx_flags; // internal transmit control flags
+
+ int m_txd;
int m_dtr; // data terminal ready
int m_rts; // request to send
+ // external/status monitoring
+ int m_ext_latched; // changed data lines
+ int m_brk_latched; // break status latched
+ int m_cts; // clear to send line state
+ int m_dcd; // data carrier detect line state
+ int m_sync; // sync line state
+
// synchronous state
- uint16_t m_sync; // sync character
int m_index;
z80sio_device *m_uart;
+
+private:
+ // helpers
+ void out_txd_cb(int state);
+ void out_rts_cb(int state);
+ void out_dtr_cb(int state);
+ void set_ready(bool ready);
+ bool receive_allowed() const;
+ bool transmit_allowed() const;
+
+ void receive_enabled();
+ void sync_receive();
+ void receive_data();
+ void queue_received(uint16_t data, uint32_t error);
+ void advance_rx_fifo();
+
+ void transmit_enable();
+ void transmit_complete();
+ void async_tx_setup();
+ void sync_tx_sr_empty();
+ void tx_setup(uint16_t data, int bits, int parity, bool framing, bool special);
+ void tx_setup_idle();
+
+ void reset_ext_status();
+ void read_ext();
+ void trigger_ext_int();
+
+ uint8_t const m_rr1_auto_reset;
+};
+
+
+// ======================> i8274_channel
+
+class i8274_channel : public z80sio_channel
+{
+public:
+ i8274_channel(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
};
@@ -417,21 +338,14 @@ public:
// construction/destruction
z80sio_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- template <class Object> static devcb_base &set_out_txda_callback(device_t &device, Object &&cb) { return downcast<z80sio_device &>(device).m_out_txda_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_out_dtra_callback(device_t &device, Object &&cb) { return downcast<z80sio_device &>(device).m_out_dtra_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_out_rtsa_callback(device_t &device, Object &&cb) { return downcast<z80sio_device &>(device).m_out_rtsa_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_out_wrdya_callback(device_t &device, Object &&cb) { return downcast<z80sio_device &>(device).m_out_wrdya_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_out_synca_callback(device_t &device, Object &&cb) { return downcast<z80sio_device &>(device).m_out_synca_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_out_txdb_callback(device_t &device, Object &&cb) { return downcast<z80sio_device &>(device).m_out_txdb_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_out_dtrb_callback(device_t &device, Object &&cb) { return downcast<z80sio_device &>(device).m_out_dtrb_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_out_rtsb_callback(device_t &device, Object &&cb) { return downcast<z80sio_device &>(device).m_out_rtsb_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_out_wrdyb_callback(device_t &device, Object &&cb) { return downcast<z80sio_device &>(device).m_out_wrdyb_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_out_syncb_callback(device_t &device, Object &&cb) { return downcast<z80sio_device &>(device).m_out_syncb_cb.set_callback(std::forward<Object>(cb)); }
+ template <unsigned N, class Object> static devcb_base &set_out_txd_callback(device_t &device, Object &&cb) { return downcast<z80sio_device &>(device).m_out_txd_cb[N].set_callback(std::forward<Object>(cb)); }
+ template <unsigned N, class Object> static devcb_base &set_out_dtr_callback(device_t &device, Object &&cb) { return downcast<z80sio_device &>(device).m_out_dtr_cb[N].set_callback(std::forward<Object>(cb)); }
+ template <unsigned N, class Object> static devcb_base &set_out_rts_callback(device_t &device, Object &&cb) { return downcast<z80sio_device &>(device).m_out_rts_cb[N].set_callback(std::forward<Object>(cb)); }
+ template <unsigned N, class Object> static devcb_base &set_out_wrdy_callback(device_t &device, Object &&cb) { return downcast<z80sio_device &>(device).m_out_wrdy_cb[N].set_callback(std::forward<Object>(cb)); }
+ template <unsigned N, class Object> static devcb_base &set_out_sync_callback(device_t &device, Object &&cb) { return downcast<z80sio_device &>(device).m_out_sync_cb[N].set_callback(std::forward<Object>(cb)); }
template <class Object> static devcb_base &set_out_int_callback(device_t &device, Object &&cb) { return downcast<z80sio_device &>(device).m_out_int_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_out_rxdrqa_callback(device_t &device, Object &&cb) { return downcast<z80sio_device &>(device).m_out_rxdrqa_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_out_txdrqa_callback(device_t &device, Object &&cb) { return downcast<z80sio_device &>(device).m_out_txdrqa_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_out_rxdrqb_callback(device_t &device, Object &&cb) { return downcast<z80sio_device &>(device).m_out_rxdrqb_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_out_txdrqb_callback(device_t &device, Object &&cb) { return downcast<z80sio_device &>(device).m_out_txdrqb_cb.set_callback(std::forward<Object>(cb)); }
+ template <unsigned N, class Object> static devcb_base &set_out_rxdrq_callback(device_t &device, Object &&cb) { return downcast<z80sio_device &>(device).m_out_rxdrq_cb[N].set_callback(std::forward<Object>(cb)); }
+ template <unsigned N, class Object> static devcb_base &set_out_txdrq_callback(device_t &device, Object &&cb) { return downcast<z80sio_device &>(device).m_out_txdrq_cb[N].set_callback(std::forward<Object>(cb)); }
static void static_set_cputag(device_t &device, const char *tag)
{
@@ -439,15 +353,6 @@ public:
dev.m_cputag = tag;
}
- static void configure_channels(device_t &device, int rxa, int txa, int rxb, int txb)
- {
- z80sio_device &dev = downcast<z80sio_device &>(device);
- dev.m_rxca = rxa;
- dev.m_txca = txa;
- dev.m_rxcb = rxb;
- dev.m_txcb = txb;
- }
-
DECLARE_READ8_MEMBER( cd_ba_r );
DECLARE_WRITE8_MEMBER( cd_ba_w );
DECLARE_READ8_MEMBER( ba_cd_r );
@@ -464,7 +369,7 @@ public:
DECLARE_WRITE8_MEMBER( cb_w ) { m_chanB->control_write(data); }
// interrupt acknowledge
- int m1_r();
+ virtual int m1_r();
DECLARE_WRITE_LINE_MEMBER( rxa_w ) { m_chanA->write_rx(state); }
DECLARE_WRITE_LINE_MEMBER( rxb_w ) { m_chanB->write_rx(state); }
@@ -481,9 +386,10 @@ public:
DECLARE_WRITE_LINE_MEMBER( syncb_w ) { m_chanB->sync_w(state); }
protected:
- z80sio_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, uint32_t variant);
+ z80sio_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
// device-level overrides
+ virtual void device_resolve_objects() override;
virtual void device_start() override;
virtual void device_reset() override;
virtual void device_add_mconfig(machine_config &config) override;
@@ -496,18 +402,13 @@ protected:
// internal interrupt management
void check_interrupts();
void reset_interrupts();
- int get_interrupt_prio(int index, int type);
- uint8_t modify_vector(int index, int type);
- void trigger_interrupt(int index, int state);
- int get_channel_index(z80sio_channel *ch) { return (ch == m_chanA) ? 0 : 1; }
+ void trigger_interrupt(int index, int type);
+ void clear_interrupt(int index, int type);
+ void return_from_interrupt();
+ virtual uint8_t read_vector();
+ virtual int const *interrupt_priorities() const;
- // CPU types that has slightly different behaviour
- enum
- {
- TYPE_Z80SIO = 0x001,
- TYPE_UPD7201 = 0x002,
- TYPE_I8274 = 0x004
- };
+ int get_channel_index(z80sio_channel const *ch) const { return (ch == m_chanA) ? 0 : 1; }
enum
{
@@ -519,51 +420,51 @@ protected:
required_device<z80sio_channel> m_chanB;
// internal state
- int m_rxca;
- int m_txca;
- int m_rxcb;
- int m_txcb;
-
- devcb_write_line m_out_txda_cb;
- devcb_write_line m_out_dtra_cb;
- devcb_write_line m_out_rtsa_cb;
- devcb_write_line m_out_wrdya_cb;
- devcb_write_line m_out_synca_cb;
-
- devcb_write_line m_out_txdb_cb;
- devcb_write_line m_out_dtrb_cb;
- devcb_write_line m_out_rtsb_cb;
- devcb_write_line m_out_wrdyb_cb;
- devcb_write_line m_out_syncb_cb;
+ devcb_write_line m_out_txd_cb[2];
+ devcb_write_line m_out_dtr_cb[2];
+ devcb_write_line m_out_rts_cb[2];
+ devcb_write_line m_out_wrdy_cb[2];
+ devcb_write_line m_out_sync_cb[2];
devcb_write_line m_out_int_cb;
- devcb_write_line m_out_rxdrqa_cb;
- devcb_write_line m_out_txdrqa_cb;
- devcb_write_line m_out_rxdrqb_cb;
- devcb_write_line m_out_txdrqb_cb;
+ devcb_write_line m_out_rxdrq_cb[2];
+ devcb_write_line m_out_txdrq_cb[2];
int m_int_state[8]; // interrupt state
int m_int_source[8]; // interrupt source
- int m_variant;
const char *m_cputag;
};
-class upd7201_new_device : public z80sio_device
+class i8274_new_device : public z80sio_device
{
public:
- upd7201_new_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ i8274_new_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+
+ virtual int m1_r() override;
+
+protected:
+ i8274_new_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
+
+ // device_t overrides
+ virtual void device_add_mconfig(machine_config &config) override;
+
+ // device_z80daisy_interface overrides
+ virtual int z80daisy_irq_ack() override;
+ virtual void z80daisy_irq_reti() override;
+
+ virtual uint8_t read_vector() override;
+ virtual int const *interrupt_priorities() const override;
};
-class i8274_new_device : public z80sio_device
+class upd7201_new_device : public i8274_new_device
{
public:
- i8274_new_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ upd7201_new_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
};
-// device type definition
+// device type declaration
DECLARE_DEVICE_TYPE(Z80SIO, z80sio_device)
-DECLARE_DEVICE_TYPE(Z80SIO_CHANNEL, z80sio_channel)
-DECLARE_DEVICE_TYPE(UPD7201_NEW, upd7201_new_device)
DECLARE_DEVICE_TYPE(I8274_NEW, i8274_new_device)
+DECLARE_DEVICE_TYPE(UPD7201_NEW, upd7201_new_device)
#endif // MAME_MACHINE_Z80SIO_H