diff options
Diffstat (limited to 'src/devices/machine/scc2698b.cpp')
-rw-r--r-- | src/devices/machine/scc2698b.cpp | 80 |
1 files changed, 22 insertions, 58 deletions
diff --git a/src/devices/machine/scc2698b.cpp b/src/devices/machine/scc2698b.cpp index 8a362e26d45..4fb7b2b3a3f 100644 --- a/src/devices/machine/scc2698b.cpp +++ b/src/devices/machine/scc2698b.cpp @@ -7,10 +7,10 @@ Enhanced Octal Universal Asynchronous Receiver/Transmitter Notes: - This device is similiar to four 2681 DUART chips tied together + This device is similar to four 2681 DUART chips tied together in a single package, with some shared resources. The 2681 DUART is implemented in scn2681_device - but this - chip is being independently emulated seperately for mainly + chip is being independently emulated separately for mainly educational purposes. When functionality for this device is completed we will consider merging the devices if it's practical. @@ -26,7 +26,6 @@ Quirks: #include "emu.h" #include "scc2698b.h" -#define LOG_GENERAL (1U << 0) #define LOG_CONFIG_CHANGE (1U << 1) //#define VERBOSE (LOG_GENERAL | LOG_CONFIG_CHANGE) @@ -342,11 +341,11 @@ void scc2698b_channel::recompute_pin_output(bool force) -WRITE_LINE_MEMBER( scc2698b_channel::mpi0_w ) +void scc2698b_channel::mpi0_w(int state) { } -WRITE_LINE_MEMBER( scc2698b_channel::mpi1_w ) +void scc2698b_channel::mpi1_w(int state) { } @@ -359,39 +358,17 @@ scc2698b_device::scc2698b_device(const machine_config &mconfig, const char *tag, write_intr_B(*this), write_intr_C(*this), write_intr_D(*this), - write_tx{ { *this }, { *this }, { *this }, { *this }, { *this }, { *this }, { *this }, { *this} }, - write_mpp1{ { *this }, { *this }, { *this }, { *this }, { *this }, { *this }, { *this }, { *this } }, - write_mpp2{ { *this }, { *this }, { *this }, { *this }, { *this }, { *this }, { *this }, { *this } }, - write_mpo{ { *this }, { *this }, { *this }, { *this }, { *this }, { *this }, { *this }, { *this } } - + write_tx(*this), + write_mpp1(*this), + write_mpp2(*this), + write_mpo(*this) { - } -void scc2698b_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) -{ - -} - - void scc2698b_device::device_start() { - write_intr_A.resolve_safe(); - write_intr_B.resolve_safe(); - write_intr_C.resolve_safe(); - write_intr_D.resolve_safe(); - - for (auto &cb : write_tx) - cb.resolve_safe(); - for (auto &cb : write_mpp1) - cb.resolve_safe(); - for (auto &cb : write_mpp2) - cb.resolve_safe(); - for (auto &cb : write_mpo) - cb.resolve_safe(); - for (int i = 0; i < 8; i++) { m_channel[i]->channel_port = i; @@ -403,13 +380,12 @@ void scc2698b_device::device_start() void scc2698b_device::device_reset() { - } void scc2698b_device::write_line_tx(int port, int value) { - if ((0 <= port) && (ARRAY_LENGTH(write_tx) > port)) + if ((0 <= port) && (std::size(write_tx) > port)) write_tx[port](value); else logerror("Unsupported port %d in write_line_tx\n", port); @@ -417,7 +393,7 @@ void scc2698b_device::write_line_tx(int port, int value) void scc2698b_device::write_line_mpp1(int port, int value) { - if ((0 <= port) && (ARRAY_LENGTH(write_mpp1) > port)) + if ((0 <= port) && (std::size(write_mpp1) > port)) write_mpp1[port](value); else logerror("Unsupported port %d in write_line_mpp1\n", port); @@ -425,7 +401,7 @@ void scc2698b_device::write_line_mpp1(int port, int value) void scc2698b_device::write_line_mpp2(int port, int value) { - if ((0 <= port) && (ARRAY_LENGTH(write_mpp2) > port)) + if ((0 <= port) && (std::size(write_mpp2) > port)) write_mpp2[port](value); else logerror("Unsupported port %d in write_line_mpp2\n", port); @@ -433,25 +409,13 @@ void scc2698b_device::write_line_mpp2(int port, int value) void scc2698b_device::write_line_mpo(int port, int value) { - if ((0 <= port) && (ARRAY_LENGTH(write_mpo) > port)) + if ((0 <= port) && (std::size(write_mpo) > port)) write_mpo[port](value); else logerror("Unsupported port %d in write_line_mpo\n", port); } - -READ8_MEMBER(scc2698b_device::read) -{ - return read_reg(offset); -} - -WRITE8_MEMBER(scc2698b_device::write) -{ - write_reg(offset, data); -} - - -uint8_t scc2698b_device::read_reg(int offset) +uint8_t scc2698b_device::read(offs_t offset) { int device = (offset >> 4) & 3; int reg = (offset & 15); @@ -501,7 +465,7 @@ uint8_t scc2698b_device::read_reg(int offset) return data; } -void scc2698b_device::write_reg(int offset, uint8_t data) +void scc2698b_device::write(offs_t offset, u8 data) { int device = (offset >> 4) & 3; int reg = (offset & 15); @@ -581,14 +545,14 @@ void scc2698b_device::write_reg(int offset, uint8_t data) } } -WRITE_LINE_MEMBER(scc2698b_device::port_a_rx_w) { m_channel[0]->rx_w(state); } -WRITE_LINE_MEMBER(scc2698b_device::port_b_rx_w) { m_channel[1]->rx_w(state); } -WRITE_LINE_MEMBER(scc2698b_device::port_c_rx_w) { m_channel[2]->rx_w(state); } -WRITE_LINE_MEMBER(scc2698b_device::port_d_rx_w) { m_channel[3]->rx_w(state); } -WRITE_LINE_MEMBER(scc2698b_device::port_e_rx_w) { m_channel[4]->rx_w(state); } -WRITE_LINE_MEMBER(scc2698b_device::port_f_rx_w) { m_channel[5]->rx_w(state); } -WRITE_LINE_MEMBER(scc2698b_device::port_g_rx_w) { m_channel[6]->rx_w(state); } -WRITE_LINE_MEMBER(scc2698b_device::port_h_rx_w) { m_channel[7]->rx_w(state); } +void scc2698b_device::port_a_rx_w(int state) { m_channel[0]->rx_w(state); } +void scc2698b_device::port_b_rx_w(int state) { m_channel[1]->rx_w(state); } +void scc2698b_device::port_c_rx_w(int state) { m_channel[2]->rx_w(state); } +void scc2698b_device::port_d_rx_w(int state) { m_channel[3]->rx_w(state); } +void scc2698b_device::port_e_rx_w(int state) { m_channel[4]->rx_w(state); } +void scc2698b_device::port_f_rx_w(int state) { m_channel[5]->rx_w(state); } +void scc2698b_device::port_g_rx_w(int state) { m_channel[6]->rx_w(state); } +void scc2698b_device::port_h_rx_w(int state) { m_channel[7]->rx_w(state); } scc2698b_channel* scc2698b_device::get_channel(int port) |