From 6df1235c3f2a33a7d72aecceb31a582657015f2d Mon Sep 17 00:00:00 2001 From: MooglyGuy Date: Sat, 16 Feb 2019 13:05:22 +0100 Subject: [PATCH] -sgi_mc_device: Fixed Graphics-to-Host DMAs to happen a qword at a time, nw --- src/mame/machine/sgi.cpp | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/src/mame/machine/sgi.cpp b/src/mame/machine/sgi.cpp index 9e0db63c884..fd605fb03a5 100644 --- a/src/mame/machine/sgi.cpp +++ b/src/mame/machine/sgi.cpp @@ -223,9 +223,22 @@ void sgi_mc_device::dma_tick() } else { - m_space->write_byte(addr, m_space->read_byte(m_dma_gio64_addr)); - m_dma_mem_addr++; - m_dma_count--; + const uint32_t remaining = m_dma_count & 0x0000ffff; + uint32_t length = 8; + uint64_t shift = 56; + if (remaining < 8) + length = remaining; + + uint64_t data = m_space->read_qword(m_dma_gio64_addr); + for (uint32_t i = 0; i < length; i++) + { + m_space->write_byte(addr, (uint8_t)(data >> shift)); + addr++; + shift -= 8; + } + + m_dma_mem_addr += length; + m_dma_count -= length; } } else