From ffdb2befff1ac2dd28e3c0820c03e9ea7445682a Mon Sep 17 00:00:00 2001 From: smf- Date: Thu, 6 Oct 2016 09:20:42 +0100 Subject: [PATCH] Drop the upper bit of the address when shifting left, as described http://wiki.osdev.org/ISA_DMA#16_bit_issues. This fixes 16 bit audio in sb16 diagnose.exe [smf-] --- src/devices/machine/cs4031.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/devices/machine/cs4031.cpp b/src/devices/machine/cs4031.cpp index 4331747e506..f9d9108597a 100644 --- a/src/devices/machine/cs4031.cpp +++ b/src/devices/machine/cs4031.cpp @@ -362,7 +362,7 @@ READ8_MEMBER( cs4031_device::dma_read_word ) if (m_dma_channel == -1) return 0xff; - UINT16 result = m_space->read_word(page_offset() + (offset << 1)); + UINT16 result = m_space->read_word(page_offset() + ((offset << 1) & 0xffff)); m_dma_high_byte = result >> 8; return result; @@ -373,7 +373,7 @@ WRITE8_MEMBER( cs4031_device::dma_write_word ) if (m_dma_channel == -1) return; - m_space->write_word(page_offset() + (offset << 1), (m_dma_high_byte << 8) | data); + m_space->write_word(page_offset() + ((offset << 1) & 0xffff), (m_dma_high_byte << 8) | data); } WRITE_LINE_MEMBER( cs4031_device::dma2_dack0_w )