summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/sound/315-5641.cpp
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2018-05-06 19:19:48 +1000
committer Vas Crabb <vas@vastheman.com>2018-05-06 19:19:48 +1000
commit138b60e6c6078260b12becbc6706fa0523eea506 (patch)
tree6c5bb013da8e6ea0500148169adf2c8436e900ab /src/devices/sound/315-5641.cpp
parent495ec11fdf79e06fb5102b395b7316fa273006a7 (diff)
(nw) misc follow-up
Fix MT06964 Fix µPD7759 class hierarchy, and reset callback before resolving it (fixed assert in Sega C2) Remove some more low-value device add indirection macros, default some more clocks Make cards inherit clock from slot by default
Diffstat (limited to 'src/devices/sound/315-5641.cpp')
-rw-r--r--src/devices/sound/315-5641.cpp34
1 files changed, 17 insertions, 17 deletions
diff --git a/src/devices/sound/315-5641.cpp b/src/devices/sound/315-5641.cpp
index f45f3071ae7..10ab5502691 100644
--- a/src/devices/sound/315-5641.cpp
+++ b/src/devices/sound/315-5641.cpp
@@ -8,38 +8,38 @@
DEFINE_DEVICE_TYPE(SEGA_315_5641_PCM, sega_315_5641_pcm_device, "315_5641_pcm", "Sega 315-5641 PCM")
sega_315_5641_pcm_device::sega_315_5641_pcm_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : upd7759_device(mconfig, SEGA_315_5641_PCM, tag, owner, clock), m_fifo_read(0), m_fifo_write(0)
+ : upd7756_device(mconfig, SEGA_315_5641_PCM, tag, owner, clock), m_fifo_read(0), m_fifo_write(0)
{
}
void sega_315_5641_pcm_device::device_start()
{
+ upd7756_device::device_start();
+
save_item(NAME(m_fifo_data), 0x40);
save_item(NAME(m_fifo_read));
save_item(NAME(m_fifo_write));
-
- upd7759_device::device_start();
}
void sega_315_5641_pcm_device::advance_state()
{
switch (m_state)
{
- case STATE_DROP_DRQ:
- if (m_rombase == nullptr)
+ case STATE_DROP_DRQ:
+ if (m_rombase == nullptr)
+ {
+ // Slave Mode: get data from FIFO buffer
+ uint8_t fiforead = (m_fifo_read + 1) & 0x3F;
+ if (fiforead != m_fifo_write)
{
- // Slave Mode: get data from FIFO buffer
- uint8_t fiforead = (m_fifo_read + 1) & 0x3F;
- if (fiforead != m_fifo_write)
- {
- m_fifo_in = m_fifo_data[fiforead];
- m_fifo_read = fiforead;
- }
+ m_fifo_in = m_fifo_data[fiforead];
+ m_fifo_read = fiforead;
}
- break;
+ }
+ break;
}
- upd775x_device::advance_state();
+ upd7756_device::advance_state();
}
@@ -47,7 +47,7 @@ WRITE8_MEMBER( sega_315_5641_pcm_device::port_w )
{
if (m_rombase != nullptr)
{
- /* update the FIFO value */
+ // update the FIFO value
m_fifo_in = data;
}
else
@@ -65,8 +65,8 @@ uint8_t sega_315_5641_pcm_device::get_fifo_space()
void sega_315_5641_pcm_device::device_reset()
{
+ upd7756_device::device_reset();
+
m_fifo_read = 0x3F;
m_fifo_write = 0x00;
-
- upd775x_device::device_reset();
}