(mess) southbridge: fix dma (nw)

This commit is contained in:
cracyc 2013-11-04 01:47:36 +00:00
parent 89a6e30592
commit 110e6c38a0

View File

@ -331,34 +331,37 @@ WRITE_LINE_MEMBER( southbridge_device::pc_dma_hrq_changed )
READ8_MEMBER(southbridge_device::pc_dma_read_byte)
{
address_space& prog_space = m_maincpu->space(AS_PROGRAM); // get the right address space
if(m_dma_channel == -1)
return 0xff;
UINT8 result;
offs_t page_offset = (((offs_t) m_dma_offset[0][m_dma_channel]) << 16) & 0xFF0000;
result = space.read_byte(page_offset + offset);
result = prog_space.read_byte(page_offset + offset);
return result;
}
WRITE8_MEMBER(southbridge_device::pc_dma_write_byte)
{
address_space& prog_space = m_maincpu->space(AS_PROGRAM); // get the right address space
if(m_dma_channel == -1)
return;
offs_t page_offset = (((offs_t) m_dma_offset[0][m_dma_channel]) << 16) & 0xFF0000;
space.write_byte(page_offset + offset, data);
prog_space.write_byte(page_offset + offset, data);
}
READ8_MEMBER(southbridge_device::pc_dma_read_word)
{
address_space& prog_space = m_maincpu->space(AS_PROGRAM); // get the right address space
if(m_dma_channel == -1)
return 0xff;
UINT16 result;
offs_t page_offset = (((offs_t) m_dma_offset[1][m_dma_channel & 3]) << 16) & 0xFF0000;
result = space.read_word(page_offset + ( offset << 1 ) );
result = prog_space.read_word(page_offset + ( offset << 1 ) );
m_dma_high_byte = result & 0xFF00;
return result & 0xFF;
@ -367,11 +370,12 @@ READ8_MEMBER(southbridge_device::pc_dma_read_word)
WRITE8_MEMBER(southbridge_device::pc_dma_write_word)
{
address_space& prog_space = m_maincpu->space(AS_PROGRAM); // get the right address space
if(m_dma_channel == -1)
return;
offs_t page_offset = (((offs_t) m_dma_offset[1][m_dma_channel & 3]) << 16) & 0xFF0000;
space.write_word(page_offset + ( offset << 1 ), m_dma_high_byte | data);
prog_space.write_word(page_offset + ( offset << 1 ), m_dma_high_byte | data);
}