summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author AJR <ajrhacker@users.noreply.github.com>2018-02-09 07:46:30 -0500
committer AJR <ajrhacker@users.noreply.github.com>2018-02-09 07:46:37 -0500
commita7dcee56672b49badf59401396a15195aec8c26f (patch)
tree89d766f6540e27ac9c5788a04af9936976cf7206
parent0084a0b73ead56b25562dfc0b02f6ab9242d18e2 (diff)
deco146/deco104: Synchronize soundlatch writes (fixes dropouts in dblewing)
-rw-r--r--src/mame/machine/deco146.cpp17
-rw-r--r--src/mame/machine/deco146.h2
2 files changed, 13 insertions, 6 deletions
diff --git a/src/mame/machine/deco146.cpp b/src/mame/machine/deco146.cpp
index fd15795691a..34e0d7d0486 100644
--- a/src/mame/machine/deco146.cpp
+++ b/src/mame/machine/deco146.cpp
@@ -1233,6 +1233,12 @@ uint16_t deco_146_base_device::read_protport(uint16_t address, uint16_t mem_mask
return realret;
}
+TIMER_CALLBACK_MEMBER(deco_146_base_device::write_soundlatch)
+{
+ m_soundlatch = param;
+ m_soundlatch_irq_cb(ASSERT_LINE);
+}
+
void deco_146_base_device::write_protport(address_space &space, uint16_t address, uint16_t data, uint16_t mem_mask)
{
m_latchaddr = address;
@@ -1241,19 +1247,18 @@ void deco_146_base_device::write_protport(address_space &space, uint16_t address
if ((address&0xff) == m_xor_port)
{
- logerror("LOAD XOR REGISTER %04x %04x\n", data, mem_mask);
- COMBINE_DATA(&m_xor);
+ logerror("LOAD XOR REGISTER %04x %04x\n", data, mem_mask);
+ COMBINE_DATA(&m_xor);
}
else if ((address&0xff) == m_mask_port)
{
// logerror("LOAD NAND REGISTER %04x %04x\n", data, mem_mask);
- COMBINE_DATA(&m_nand);
+ COMBINE_DATA(&m_nand);
}
else if ((address&0xff) == m_soundlatch_port)
{
- logerror("LOAD SOUND LATCH: %04x\n", data);
- m_soundlatch = data & 0xff;
- m_soundlatch_irq_cb(ASSERT_LINE);
+ logerror("LOAD SOUND LATCH: %04x\n", data);
+ machine().scheduler().synchronize(timer_expired_delegate(FUNC(deco_146_base_device::write_soundlatch), this), data & 0xff);
}
// always store
diff --git a/src/mame/machine/deco146.h b/src/mame/machine/deco146.h
index 3b817d864f2..b791bd31bf9 100644
--- a/src/mame/machine/deco146.h
+++ b/src/mame/machine/deco146.h
@@ -133,6 +133,8 @@ protected:
int m_latchflag;
private:
+ TIMER_CALLBACK_MEMBER(write_soundlatch);
+
uint8_t region_selects[6];
uint8_t m_soundlatch;