diff --git a/src/devices/video/dl1416.cpp b/src/devices/video/dl1416.cpp index 752dbc2af13..3925d9b9607 100644 --- a/src/devices/video/dl1416.cpp +++ b/src/devices/video/dl1416.cpp @@ -189,7 +189,9 @@ dl1414_device::dl1414_device( , m_cursor_state{ false, false, false, false } , m_wr_in(true) , m_ce_in(true) + , m_ce_latch(true) , m_addr_in(0x00) + , m_addr_latch(0x00) , m_data_in(0x00) { } @@ -221,13 +223,17 @@ void dl1414_device::device_start() save_item(NAME(m_cursor_state)); save_item(NAME(m_wr_in)); save_item(NAME(m_ce_in)); + save_item(NAME(m_ce_latch)); save_item(NAME(m_addr_in)); + save_item(NAME(m_addr_latch)); save_item(NAME(m_data_in)); // set initial state for input lines m_wr_in = true; m_ce_in = true; + m_ce_latch = true; m_addr_in = 0x00; + m_addr_latch = 0x00; m_data_in = 0x00; // randomise internal RAM @@ -272,8 +278,16 @@ WRITE_LINE_MEMBER( dl1414_device::wr_w ) if (bool(state) != m_wr_in) { m_wr_in = bool(state); - if (!m_ce_in && m_wr_in) - bus_w(machine().dummy_space(), m_addr_in, m_data_in, 0x7f); + if (m_wr_in) + { + if (!m_ce_latch) + bus_w(machine().dummy_space(), m_addr_latch, m_data_in, 0x7f); + } + else + { + m_ce_latch = m_ce_in; + m_addr_latch = m_addr_in; + } } } diff --git a/src/devices/video/dl1416.h b/src/devices/video/dl1416.h index 46672fd7a85..e5f5a894321 100644 --- a/src/devices/video/dl1416.h +++ b/src/devices/video/dl1416.h @@ -81,8 +81,8 @@ private: // input line state bool m_wr_in; - bool m_ce_in; - uint8_t m_addr_in; + bool m_ce_in, m_ce_latch; + uint8_t m_addr_in, m_addr_latch; uint8_t m_data_in; }; diff --git a/src/mame/drivers/sitcom.cpp b/src/mame/drivers/sitcom.cpp index 468737ba611..d67c35b12bd 100644 --- a/src/mame/drivers/sitcom.cpp +++ b/src/mame/drivers/sitcom.cpp @@ -111,6 +111,7 @@ public: DECLARE_READ_LINE_MEMBER(shutter_r); DECLARE_INPUT_CHANGED_MEMBER(update_shutter); + DECLARE_INPUT_CHANGED_MEMBER(update_speed); protected: virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; @@ -180,7 +181,7 @@ INPUT_PORTS_START( sitcomtmr ) PORT_BIT( 0xf8, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_START("SPEED") - PORT_CONFNAME(0xff, 0x1e, "Shutter Speed") + PORT_CONFNAME(0xff, 0x1e, "Shutter Speed") PORT_CHANGED_MEMBER(DEVICE_SELF, sitcom_timer_state, update_speed, 0) PORT_CONFSETTING(0x00, "B") PORT_CONFSETTING(0x01, "1") PORT_CONFSETTING(0x02, "1/2") @@ -270,6 +271,18 @@ INPUT_CHANGED_MEMBER( sitcom_timer_state::update_shutter ) } } +INPUT_CHANGED_MEMBER( sitcom_timer_state::update_speed ) +{ + if (!newval) + { + m_shutter = bool(BIT(m_buttons->read(), 2)); + } + else if (!oldval) + { + m_shutter = false; + } +} + void sitcom_timer_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) { switch (id) diff --git a/src/mame/machine/aim65.cpp b/src/mame/machine/aim65.cpp index d3e333db8d8..d68e7663250 100644 --- a/src/mame/machine/aim65.cpp +++ b/src/mame/machine/aim65.cpp @@ -10,6 +10,9 @@ #include "emu.h" #include "includes/aim65.h" +//#define VERBOSE 1 +#include "logmacro.h" + /****************************************************************************** Interrupt handling @@ -46,17 +49,20 @@ WRITE8_MEMBER( aim65_state::aim65_pia_a_w ) { + LOG("pia a: a=%u /ce=%u,%u,%u,%u,%u /wr=%u\n", + data & 0x03, BIT(data, 2), BIT(data, 3), BIT(data, 4), BIT(data, 5), BIT(data, 6), BIT(data, 7)); for (std::size_t index = 0; m_ds.size() > index; ++index) { - m_ds[index]->addr_w(data & 0x03); - m_ds[index]->ce_w(BIT(data, 2 + index)); m_ds[index]->wr_w(BIT(data, 7)); + m_ds[index]->ce_w(BIT(data, 2 + index)); + m_ds[index]->addr_w(data & 0x03); } } WRITE8_MEMBER( aim65_state::aim65_pia_b_w ) { + LOG("pia b: d=%02x /cu=%u\n", data & 0x7f, BIT(data, 7)); for (required_device &ds : m_ds) { ds->cu_w(BIT(data, 7));