mirror of
https://github.com/holub/mame
synced 2025-04-23 08:49:55 +03:00
Applied IBM AT 16-bit DMA wrap round fix to other implementations. (nw)
This commit is contained in:
parent
ffdb2befff
commit
48774d6c8a
@ -329,7 +329,7 @@ READ8_MEMBER(southbridge_device::pc_dma_read_byte)
|
||||
if(m_dma_channel == -1)
|
||||
return 0xff;
|
||||
UINT8 result;
|
||||
offs_t page_offset = (((offs_t) m_dma_offset[0][m_dma_channel]) << 16) & 0xFF0000;
|
||||
offs_t page_offset = ((offs_t) m_dma_offset[0][m_dma_channel]) << 16;
|
||||
|
||||
result = prog_space.read_byte(page_offset + offset);
|
||||
return result;
|
||||
@ -341,7 +341,7 @@ 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;
|
||||
offs_t page_offset = ((offs_t) m_dma_offset[0][m_dma_channel]) << 16;
|
||||
|
||||
prog_space.write_byte(page_offset + offset, data);
|
||||
}
|
||||
@ -353,9 +353,9 @@ READ8_MEMBER(southbridge_device::pc_dma_read_word)
|
||||
if(m_dma_channel == -1)
|
||||
return 0xff;
|
||||
UINT16 result;
|
||||
offs_t page_offset = (((offs_t) m_dma_offset[1][m_dma_channel & 3]) << 16) & 0xFE0000;
|
||||
offs_t page_offset = ((offs_t) m_dma_offset[1][m_dma_channel & 3]) << 16;
|
||||
|
||||
result = prog_space.read_word(page_offset + ( offset << 1 ) );
|
||||
result = prog_space.read_word(page_offset + ((offset << 1) & 0xffff));
|
||||
m_dma_high_byte = result & 0xFF00;
|
||||
|
||||
return result & 0xFF;
|
||||
@ -367,9 +367,9 @@ 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) & 0xFE0000;
|
||||
offs_t page_offset = ((offs_t) m_dma_offset[1][m_dma_channel & 3]) << 16;
|
||||
|
||||
prog_space.write_word(page_offset + ( offset << 1 ), m_dma_high_byte | data);
|
||||
prog_space.write_word(page_offset + ((offset << 1) & 0xffff), m_dma_high_byte | data);
|
||||
}
|
||||
|
||||
|
||||
|
@ -372,7 +372,7 @@ READ8_MEMBER( wd7600_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;
|
||||
@ -383,7 +383,7 @@ WRITE8_MEMBER( wd7600_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( wd7600_device::dma2_dack0_w )
|
||||
|
@ -713,11 +713,11 @@ READ8_MEMBER(ngen_state::dma_read_word)
|
||||
|
||||
if(m_dma_channel == -1)
|
||||
return 0xff;
|
||||
offs_t page_offset = (((offs_t) m_dma_offset[m_dma_channel]) << 16) & 0xFE0000;
|
||||
offs_t page_offset = ((offs_t) m_dma_offset[m_dma_channel]) << 16;
|
||||
|
||||
result = prog_space.read_word(page_offset + (offset << 1));
|
||||
result = prog_space.read_word(page_offset + ((offset << 1) & 0xffff));
|
||||
m_dma_high_byte = result & 0xFF00;
|
||||
popmessage("DMA byte address %06x read %04x\n",page_offset+(offset<<1),result);
|
||||
popmessage("DMA byte address %06x read %04x\n", page_offset + ((offset << 1) & 0xffff),result);
|
||||
return result & 0xff;
|
||||
}
|
||||
|
||||
@ -734,10 +734,10 @@ WRITE8_MEMBER(ngen_state::dma_write_word)
|
||||
|
||||
if(m_dma_channel == -1)
|
||||
return;
|
||||
offs_t page_offset = (((offs_t) m_dma_offset[m_dma_channel]) << 16) & 0xFE0000;
|
||||
offs_t page_offset = ((offs_t) m_dma_offset[m_dma_channel]) << 16;
|
||||
|
||||
prog_space.write_word(page_offset + (offset << 1), data);
|
||||
popmessage("DMA byte address %06x write %04x\n",page_offset+(offset<<1), m_dma_high_byte | data);
|
||||
prog_space.write_word(page_offset + ((offset << 1) & 0xffff), data);
|
||||
popmessage("DMA byte address %06x write %04x\n", page_offset + ((offset << 1) & 0xffff), m_dma_high_byte | data);
|
||||
}
|
||||
|
||||
|
||||
|
@ -266,7 +266,7 @@ READ8_MEMBER(at_mb_device::dma_read_byte)
|
||||
if(m_dma_channel == -1)
|
||||
return 0xff;
|
||||
UINT8 result;
|
||||
offs_t page_offset = (((offs_t) m_dma_offset[0][m_dma_channel]) << 16) & 0xFF0000;
|
||||
offs_t page_offset = ((offs_t) m_dma_offset[0][m_dma_channel]) << 16;
|
||||
|
||||
result = prog_space.read_byte(page_offset + offset);
|
||||
return result;
|
||||
@ -278,7 +278,7 @@ WRITE8_MEMBER(at_mb_device::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;
|
||||
offs_t page_offset = ((offs_t) m_dma_offset[0][m_dma_channel]) << 16;
|
||||
|
||||
prog_space.write_byte(page_offset + offset, data);
|
||||
}
|
||||
@ -290,9 +290,9 @@ READ8_MEMBER(at_mb_device::dma_read_word)
|
||||
if(m_dma_channel == -1)
|
||||
return 0xff;
|
||||
UINT16 result;
|
||||
offs_t page_offset = (((offs_t) m_dma_offset[1][m_dma_channel & 3]) << 16) & 0xFE0000;
|
||||
offs_t page_offset = ((offs_t) m_dma_offset[1][m_dma_channel & 3]) << 16;
|
||||
|
||||
result = prog_space.read_word(page_offset + ( offset << 1 ) );
|
||||
result = prog_space.read_word(page_offset + ((offset << 1) & 0xffff));
|
||||
m_dma_high_byte = result & 0xFF00;
|
||||
|
||||
return result & 0xFF;
|
||||
@ -304,9 +304,9 @@ WRITE8_MEMBER(at_mb_device::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) & 0xFE0000;
|
||||
offs_t page_offset = ((offs_t) m_dma_offset[1][m_dma_channel & 3]) << 16;
|
||||
|
||||
prog_space.write_word(page_offset + ( offset << 1 ), m_dma_high_byte | data);
|
||||
prog_space.write_word(page_offset + ((offset << 1) & 0xffff), m_dma_high_byte | data);
|
||||
}
|
||||
|
||||
READ8_MEMBER( at_mb_device::dma8237_0_dack_r ) { return m_isabus->dack_r(0); }
|
||||
|
Loading…
Reference in New Issue
Block a user