diff options
Diffstat (limited to 'src/devices/machine')
-rw-r--r-- | src/devices/machine/fdc37c665gt.cpp | 8 | ||||
-rw-r--r-- | src/devices/machine/fdc37c93x.cpp | 8 | ||||
-rw-r--r-- | src/devices/machine/ins8250.cpp | 68 | ||||
-rw-r--r-- | src/devices/machine/ins8250.h | 60 | ||||
-rw-r--r-- | src/devices/machine/vrc5074.cpp | 4 |
5 files changed, 74 insertions, 74 deletions
diff --git a/src/devices/machine/fdc37c665gt.cpp b/src/devices/machine/fdc37c665gt.cpp index f2df880d2e8..2f2adb42976 100644 --- a/src/devices/machine/fdc37c665gt.cpp +++ b/src/devices/machine/fdc37c665gt.cpp @@ -16,11 +16,11 @@ READ8_MEMBER(fdc37c665gt_device::read) if ((offset & 0x3f8) == 0x3f8) { - data = m_uart1->ins8250_r(space, offset & 7, mem_mask); + data = m_uart1->ins8250_r(offset & 7); } else if ((offset & 0x3f8) == 0x2f8) { - data = m_uart2->ins8250_r(space, offset & 7, mem_mask); + data = m_uart2->ins8250_r(offset & 7); } else { @@ -33,11 +33,11 @@ WRITE8_MEMBER(fdc37c665gt_device::write) { if ((offset & 0x3f8) == 0x3f8) { - m_uart1->ins8250_w(space, offset & 7, data, mem_mask); + m_uart1->ins8250_w(offset & 7, data); } else if ((offset & 0x3f8) == 0x2f8) { - m_uart2->ins8250_w(space, offset & 7, data, mem_mask); + m_uart2->ins8250_w(offset & 7, data); } else { diff --git a/src/devices/machine/fdc37c93x.cpp b/src/devices/machine/fdc37c93x.cpp index 8ff5afc76d4..0d5b80f2d7d 100644 --- a/src/devices/machine/fdc37c93x.cpp +++ b/src/devices/machine/fdc37c93x.cpp @@ -581,12 +581,12 @@ void fdc37c93x_device::map_serial1(address_map &map) READ8_MEMBER(fdc37c93x_device::serial1_read) { - return pc_serial1_comdev->ins8250_r(space, offset, mem_mask); + return pc_serial1_comdev->ins8250_r(offset); } WRITE8_MEMBER(fdc37c93x_device::serial1_write) { - pc_serial1_comdev->ins8250_w(space, offset, data, mem_mask); + pc_serial1_comdev->ins8250_w(offset, data); } void fdc37c93x_device::map_serial1_addresses() @@ -610,12 +610,12 @@ void fdc37c93x_device::map_serial2(address_map &map) READ8_MEMBER(fdc37c93x_device::serial2_read) { - return pc_serial2_comdev->ins8250_r(space, offset, mem_mask); + return pc_serial2_comdev->ins8250_r(offset); } WRITE8_MEMBER(fdc37c93x_device::serial2_write) { - pc_serial2_comdev->ins8250_w(space, offset, data, mem_mask); + pc_serial2_comdev->ins8250_w(offset, data); } void fdc37c93x_device::map_serial2_addresses() diff --git a/src/devices/machine/ins8250.cpp b/src/devices/machine/ins8250.cpp index d127ce0e40d..d586816c511 100644 --- a/src/devices/machine/ins8250.cpp +++ b/src/devices/machine/ins8250.cpp @@ -107,7 +107,7 @@ DEFINE_DEVICE_TYPE(NS16450, ns16450_device, "ns16450", "National Semiconductor DEFINE_DEVICE_TYPE(NS16550, ns16550_device, "ns16550", "National Semiconductor NS16550 UART") DEFINE_DEVICE_TYPE(PC16552D, pc16552_device, "pc16552d", "National Semiconductor PC16552D UART") -ins8250_uart_device::ins8250_uart_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, dev_type device_type) +ins8250_uart_device::ins8250_uart_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, dev_type device_type) : device_t(mconfig, type, tag, owner, clock) , device_serial_interface(mconfig, *this) , m_device_type(device_type) @@ -126,22 +126,22 @@ ins8250_uart_device::ins8250_uart_device(const machine_config &mconfig, device_t m_regs.ier = 0; } -ins8250_device::ins8250_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) +ins8250_device::ins8250_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : ins8250_uart_device(mconfig, INS8250, tag, owner, clock, dev_type::INS8250) { } -ns16450_device::ns16450_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) +ns16450_device::ns16450_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : ins8250_uart_device(mconfig, NS16450, tag, owner, clock, dev_type::NS16450) { } -ns16550_device::ns16550_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) +ns16550_device::ns16550_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : ins8250_uart_device(mconfig, NS16550, tag, owner, clock, dev_type::NS16550) { } -pc16552_device::pc16552_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) +pc16552_device::pc16552_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : device_t(mconfig, PC16552D, tag, owner, clock) { } @@ -159,27 +159,27 @@ void pc16552_device::device_start() #define COM_INT_PENDING_MODEM_STATUS_REGISTER 0x0008 #define COM_INT_PENDING_CHAR_TIMEOUT 0x0011 -static constexpr uint8_t INS8250_LSR_TSRE = 0x40; -static constexpr uint8_t INS8250_LSR_THRE = 0x20; -static constexpr uint8_t INS8250_LSR_BI = 0x10; -static constexpr uint8_t INS8250_LSR_FE = 0x08; -static constexpr uint8_t INS8250_LSR_PE = 0x04; -static constexpr uint8_t INS8250_LSR_OE = 0x02; -static constexpr uint8_t INS8250_LSR_DR = 0x01; - -static constexpr uint8_t INS8250_MCR_DTR = 0x01; -static constexpr uint8_t INS8250_MCR_RTS = 0x02; -static constexpr uint8_t INS8250_MCR_OUT1 = 0x04; -static constexpr uint8_t INS8250_MCR_OUT2 = 0x08; -static constexpr uint8_t INS8250_MCR_LOOPBACK = 0x10; - -static constexpr uint8_t INS8250_LCR_BITCOUNT_MASK= 0x03; -static constexpr uint8_t INS8250_LCR_2STOP_BITS = 0x04; -//static constexpr uint8_t INS8250_LCR_PEN = 0x08; -//static constexpr uint8_t INS8250_LCR_EVEN_PAR = 0x10; -//static constexpr uint8_t INS8250_LCR_PARITY = 0x20; -//static constexpr uint8_t INS8250_LCR_BREAK = 0x40; -static constexpr uint8_t INS8250_LCR_DLAB = 0x80; +static constexpr u8 INS8250_LSR_TSRE = 0x40; +static constexpr u8 INS8250_LSR_THRE = 0x20; +static constexpr u8 INS8250_LSR_BI = 0x10; +static constexpr u8 INS8250_LSR_FE = 0x08; +static constexpr u8 INS8250_LSR_PE = 0x04; +static constexpr u8 INS8250_LSR_OE = 0x02; +static constexpr u8 INS8250_LSR_DR = 0x01; + +static constexpr u8 INS8250_MCR_DTR = 0x01; +static constexpr u8 INS8250_MCR_RTS = 0x02; +static constexpr u8 INS8250_MCR_OUT1 = 0x04; +static constexpr u8 INS8250_MCR_OUT2 = 0x08; +static constexpr u8 INS8250_MCR_LOOPBACK = 0x10; + +static constexpr u8 INS8250_LCR_BITCOUNT_MASK= 0x03; +static constexpr u8 INS8250_LCR_2STOP_BITS = 0x04; +//static constexpr u8 INS8250_LCR_PEN = 0x08; +//static constexpr u8 INS8250_LCR_EVEN_PAR = 0x10; +//static constexpr u8 INS8250_LCR_PARITY = 0x20; +//static constexpr u8 INS8250_LCR_BREAK = 0x40; +static constexpr u8 INS8250_LCR_DLAB = 0x80; /* ints will continue to be set for as long as there are ints pending */ void ins8250_uart_device::update_interrupt() @@ -257,7 +257,7 @@ void ins8250_uart_device::update_baud_rate() tra_complete(); } -WRITE8_MEMBER( ins8250_uart_device::ins8250_w ) +void ins8250_uart_device::ins8250_w(offs_t offset, u8 data) { int tmp; @@ -399,7 +399,7 @@ WRITE8_MEMBER( ins8250_uart_device::ins8250_w ) } } -READ8_MEMBER( ins8250_uart_device::ins8250_r ) +u8 ins8250_uart_device::ins8250_r(offs_t offset) { int data = 0x0ff; @@ -484,7 +484,7 @@ void ns16550_device::rcv_complete() return; } - uint8_t errors = 0; + u8 errors = 0; if (is_receive_framing_error()) errors |= INS8250_LSR_FE; if (is_receive_parity_error()) @@ -578,7 +578,7 @@ void ins8250_uart_device::tra_callback() void ins8250_uart_device::update_msr() { - uint8_t data; + u8 data; int change; if (m_regs.mcr & INS8250_MCR_LOOPBACK) @@ -720,15 +720,15 @@ void ns16550_device::device_timer(emu_timer &timer, device_timer_id id, int para } } -void ns16550_device::push_tx(uint8_t data) +void ns16550_device::push_tx(u8 data) { m_tfifo[m_thead] = data; ++m_thead &= 0x0f; } -uint8_t ns16550_device::pop_rx() +u8 ns16550_device::pop_rx() { - uint8_t data = m_rfifo[m_rtail]; + u8 data = m_rfifo[m_rtail]; clear_int(COM_INT_PENDING_CHAR_TIMEOUT & ~1); // don't clear bit 1 yet if(m_rnum) @@ -758,7 +758,7 @@ uint8_t ns16550_device::pop_rx() return data; } -void ns16550_device::set_fcr(uint8_t data) +void ns16550_device::set_fcr(u8 data) { const int bytes_per_int[] = {1, 4, 8, 14}; if(!(data & 1)) diff --git a/src/devices/machine/ins8250.h b/src/devices/machine/ins8250.h index 3047b8d6c05..5f9a6bd1793 100644 --- a/src/devices/machine/ins8250.h +++ b/src/devices/machine/ins8250.h @@ -27,8 +27,8 @@ public: auto out_out1_callback() { return m_out_out1_cb.bind(); } auto out_out2_callback() { return m_out_out2_cb.bind(); } - DECLARE_WRITE8_MEMBER(ins8250_w); - DECLARE_READ8_MEMBER(ins8250_r); + void ins8250_w(offs_t offset, u8 data); + u8 ins8250_r(offs_t offset); DECLARE_WRITE_LINE_MEMBER(dcd_w); DECLARE_WRITE_LINE_MEMBER(dsr_w); @@ -46,7 +46,7 @@ protected: NS16550A }; - ins8250_uart_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, dev_type device_type); + ins8250_uart_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, dev_type device_type); virtual void device_start() override; virtual void device_reset() override; @@ -54,9 +54,9 @@ protected: virtual void tra_complete() override; virtual void tra_callback() override; - virtual void set_fcr(uint8_t data) { } - virtual void push_tx(uint8_t data) { } - virtual uint8_t pop_rx() { return 0; } + virtual void set_fcr(u8 data) { } + virtual void push_tx(u8 data) { } + virtual u8 pop_rx() { return 0; } void trigger_int(int flag); void clear_int(int flag); @@ -65,20 +65,20 @@ protected: const dev_type m_device_type; struct { - uint8_t thr; /* 0 -W transmitter holding register */ - uint8_t rbr; /* 0 R- receiver buffer register */ - uint8_t ier; /* 1 RW interrupt enable register */ - uint16_t dl; /* 0/1 RW divisor latch (if DLAB = 1) */ - uint8_t iir; /* 2 R- interrupt identification register */ - uint8_t fcr; - uint8_t lcr; /* 3 RW line control register (bit 7: DLAB) */ - uint8_t mcr; /* 4 RW modem control register */ - uint8_t lsr; /* 5 R- line status register */ - uint8_t msr; /* 6 R- modem status register */ - uint8_t scr; /* 7 RW scratch register */ + u8 thr; /* 0 -W transmitter holding register */ + u8 rbr; /* 0 R- receiver buffer register */ + u8 ier; /* 1 RW interrupt enable register */ + u16 dl; /* 0/1 RW divisor latch (if DLAB = 1) */ + u8 iir; /* 2 R- interrupt identification register */ + u8 fcr; + u8 lcr; /* 3 RW line control register (bit 7: DLAB) */ + u8 mcr; /* 4 RW modem control register */ + u8 lsr; /* 5 R- line status register */ + u8 msr; /* 6 R- modem status register */ + u8 scr; /* 7 RW scratch register */ } m_regs; private: - uint8_t m_int_pending; + u8 m_int_pending; devcb_write_line m_out_tx_cb; devcb_write_line m_out_dtr_cb; @@ -101,34 +101,34 @@ private: class ins8250_device : public ins8250_uart_device { public: - ins8250_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + ins8250_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); }; class ns16450_device : public ins8250_uart_device { public: - ns16450_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + ns16450_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); }; class ns16550_device : public ins8250_uart_device { public: - ns16550_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + ns16550_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); protected: virtual void device_start() override; virtual void device_reset() override; virtual void rcv_complete() override; virtual void tra_complete() override; virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; - virtual void set_fcr(uint8_t data) override; - virtual void push_tx(uint8_t data) override; - virtual uint8_t pop_rx() override; + virtual void set_fcr(u8 data) override; + virtual void push_tx(u8 data) override; + virtual u8 pop_rx() override; private: void set_timer() { m_timeout->adjust(attotime::from_hz((clock()*4*8)/(m_regs.dl*16))); } int m_rintlvl; - uint8_t m_rfifo[16]; - uint8_t m_efifo[16]; - uint8_t m_tfifo[16]; + u8 m_rfifo[16]; + u8 m_efifo[16]; + u8 m_tfifo[16]; int m_rhead, m_rtail, m_rnum; int m_thead, m_ttail; emu_timer *m_timeout; @@ -137,10 +137,10 @@ private: class pc16552_device : public device_t { public: - pc16552_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + pc16552_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); - DECLARE_READ8_MEMBER(read) { return ((offset & 8) ? m_chan1 : m_chan0)->ins8250_r(space, offset & 7, mem_mask); } - DECLARE_WRITE8_MEMBER(write) { ((offset & 8) ? m_chan1 : m_chan0)->ins8250_w(space, offset & 7, data, mem_mask); } + u8 read(offs_t offset) { return ((offset & 8) ? m_chan1 : m_chan0)->ins8250_r(offset & 7); } + void write(offs_t offset, u8 data) { ((offset & 8) ? m_chan1 : m_chan0)->ins8250_w(offset & 7, data); } protected: virtual void device_start() override; diff --git a/src/devices/machine/vrc5074.cpp b/src/devices/machine/vrc5074.cpp index b04b689bd9b..0aeef7ebfdc 100644 --- a/src/devices/machine/vrc5074.cpp +++ b/src/devices/machine/vrc5074.cpp @@ -1008,7 +1008,7 @@ WRITE_LINE_MEMBER(vrc5074_device::uart_irq_callback) READ32_MEMBER(vrc5074_device::serial_r) { - uint32_t result = m_uart->ins8250_r(space, offset>>1); + uint32_t result = m_uart->ins8250_r(offset>>1); if (0 && LOG_NILE) logerror("%s serial_r offset %03X = %08X (%08x)\n", machine().describe_context(), offset>>1, result, offset*4); @@ -1017,7 +1017,7 @@ READ32_MEMBER(vrc5074_device::serial_r) WRITE32_MEMBER(vrc5074_device::serial_w) { - m_uart->ins8250_w(space, offset>>1, data); + m_uart->ins8250_w(offset>>1, data); if (PRINTF_SERIAL && offset == NREG_UARTTHR) { static std::string debugStr; printf("%c", data); |