dl1416: even better signal level behaviour (/CE, A0 and A1 latched on falling edge of /WR)

aim65: add logging for PIA writes (nw)

sticomtmr: don't get stuck if user holds shutter button while changing machine config (nw)
This commit is contained in:
Vas Crabb 2017-02-13 01:02:44 +11:00
parent 58090053b8
commit b6beaa619f
4 changed files with 40 additions and 7 deletions

View File

@ -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;
}
}
}

View File

@ -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;
};

View File

@ -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)

View File

@ -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<dl1416_device> &ds : m_ds)
{
ds->cu_w(BIT(data, 7));