summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author AJR <ajrhacker@users.noreply.github.com>2018-03-01 01:02:07 -0500
committer AJR <ajrhacker@users.noreply.github.com>2018-03-01 01:02:07 -0500
commit18cd4dc1849a687ad7260d66539d9805037fd5f1 (patch)
tree078d452a4766bdd5fc618a6a88a8c8efff2930af
parent27720535c2648fd42cc540edf2e0259884997be9 (diff)
dialog80: UART loopback test passes (nw)
-rw-r--r--src/devices/machine/ay31015.cpp7
-rw-r--r--src/mame/drivers/ampex.cpp28
2 files changed, 31 insertions, 4 deletions
diff --git a/src/devices/machine/ay31015.cpp b/src/devices/machine/ay31015.cpp
index f5bc1c74f94..0cf6a358690 100644
--- a/src/devices/machine/ay31015.cpp
+++ b/src/devices/machine/ay31015.cpp
@@ -198,10 +198,13 @@ void ay31015_device::device_start()
void ay31015_device::device_reset()
{
- m_control_reg = 0;
m_rx_data = 0;
- internal_reset();
+ if (!m_pins[CS])
+ {
+ m_control_reg = 0;
+ internal_reset();
+ }
}
diff --git a/src/mame/drivers/ampex.cpp b/src/mame/drivers/ampex.cpp
index cde38b423d6..b4520ef64d7 100644
--- a/src/mame/drivers/ampex.cpp
+++ b/src/mame/drivers/ampex.cpp
@@ -53,6 +53,7 @@ public:
DECLARE_WRITE8_MEMBER(page_w);
DECLARE_WRITE_LINE_MEMBER(vsyn_w);
+ DECLARE_WRITE_LINE_MEMBER(so_w);
DECLARE_WRITE_LINE_MEMBER(dav_w);
void ampex(machine_config &config);
@@ -63,6 +64,7 @@ private:
u8 m_page;
u8 m_attr;
bool m_attr_readback;
+ bool m_uart_loopback;
std::unique_ptr<u16[]> m_paged_ram;
required_device<cpu_device> m_maincpu;
@@ -100,8 +102,7 @@ READ8_MEMBER(ampex_state::read_5841)
WRITE8_MEMBER(ampex_state::write_5841)
{
- // bit 7 set for UART loopback test
-
+ m_uart_loopback = BIT(data, 7);
m_attr_readback = BIT(data, 5);
}
@@ -160,6 +161,12 @@ WRITE_LINE_MEMBER(ampex_state::vsyn_w)
// should generate RST 6 interrupt
}
+WRITE_LINE_MEMBER(ampex_state::so_w)
+{
+ if (m_uart_loopback)
+ m_uart->write_si(state);
+}
+
WRITE_LINE_MEMBER(ampex_state::dav_w)
{
// DAV should generate RST 7
@@ -188,13 +195,27 @@ void ampex_state::machine_start()
m_page = 0;
m_attr = 0;
m_attr_readback = false;
+ m_uart_loopback = false;
m_paged_ram = std::make_unique<u16[]>(0x1800 * 4);
m_uart->write_swe(0);
+ // Are rates hardwired to DIP switches? They don't seem to be software-controlled...
+ m_dbrg->str_w(0xe);
+ m_dbrg->stt_w(0xe);
+
+ // Make up some settings for the UART (probably also actually controlled by DIP switches)
+ m_uart->write_nb1(1);
+ m_uart->write_nb2(1);
+ m_uart->write_np(1);
+ m_uart->write_eps(1);
+ m_uart->write_tsb(0);
+ m_uart->write_cs(1);
+
save_item(NAME(m_page));
save_item(NAME(m_attr));
save_item(NAME(m_attr_readback));
+ save_item(NAME(m_uart_loopback));
save_pointer(NAME(m_paged_ram.get()), 0x1800 * 4);
}
@@ -212,9 +233,12 @@ MACHINE_CONFIG_START(ampex_state::ampex)
MCFG_VIDEO_SET_SCREEN("screen")
MCFG_DEVICE_ADD("uart", AY31015, 0) // COM8017, actually
+ MCFG_AY31015_WRITE_SO_CB(WRITELINE(ampex_state, so_w))
MCFG_AY31015_WRITE_DAV_CB(WRITELINE(ampex_state, dav_w))
MCFG_DEVICE_ADD("dbrg", COM5016_5, XTAL(4'915'200))
+ MCFG_COM8116_FR_HANDLER(DEVWRITELINE("uart", ay31015_device, write_rcp))
+ MCFG_COM8116_FT_HANDLER(DEVWRITELINE("uart", ay31015_device, write_tcp))
MACHINE_CONFIG_END
ROM_START( dialog80 )