From da8ef95cd7c0514021b5b52fb209da60fd30ed4f Mon Sep 17 00:00:00 2001 From: yz70s Date: Sun, 11 Oct 2015 16:27:44 +0200 Subject: [PATCH] atahle.c: ultra dma modes shuld be useable now (nw) --- src/devices/machine/atahle.c | 15 +++++++++++++-- src/devices/machine/idehd.c | 2 +- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/devices/machine/atahle.c b/src/devices/machine/atahle.c index 3a1599a3eed..c5351994ea2 100644 --- a/src/devices/machine/atahle.c +++ b/src/devices/machine/atahle.c @@ -346,16 +346,19 @@ int ata_hle_device::bit_to_mode(UINT16 word) return -1; } +// Return the currently selected single word dma mode, -1 if none selected int ata_hle_device::single_word_dma_mode() { return bit_to_mode(m_identify_buffer[62]); } +// Return the currently selected multi word dma mode, -1 if none selected int ata_hle_device::multi_word_dma_mode() { return bit_to_mode(m_identify_buffer[63]); } +// Return the currently selected ultra dma mode, -1 if none selected int ata_hle_device::ultra_dma_mode() { return bit_to_mode(m_identify_buffer[88]); @@ -459,7 +462,7 @@ void ata_hle_device::read_buffer_empty() m_status &= ~IDE_STATUS_DRQ; - if (multi_word_dma_mode() >= 0) + if ((multi_word_dma_mode() >= 0) || (ultra_dma_mode() >= 0)) set_dmarq(CLEAR_LINE); fill_buffer(); @@ -471,7 +474,7 @@ void ata_hle_device::write_buffer_full() m_status &= ~IDE_STATUS_DRQ; - if (multi_word_dma_mode() >= 0) + if ((multi_word_dma_mode() >= 0) || (ultra_dma_mode() >= 0)) set_dmarq(CLEAR_LINE); process_buffer(); @@ -547,6 +550,10 @@ UINT16 ata_hle_device::read_dma() { logerror( "%s: %s dev %d read_dma ignored (!DMARQ)\n", machine().describe_context(), tag(), dev() ); } + else if (!m_dmarq && ultra_dma_mode() >= 0) + { + logerror("%s: %s dev %d read_dma ignored (!DMARQ)\n", machine().describe_context(), tag(), dev()); + } else if (m_status & IDE_STATUS_BSY) { logerror( "%s: %s dev %d read_dma ignored (BSY)\n", machine().describe_context(), tag(), dev() ); @@ -767,6 +774,10 @@ void ata_hle_device::write_dma( UINT16 data ) { logerror( "%s: %s dev %d write_dma %04x ignored (!DMARQ)\n", machine().describe_context(), tag(), dev(), data ); } + else if (!m_dmarq && ultra_dma_mode() >= 0) + { + logerror("%s: %s dev %d write_dma %04x ignored (!DMARQ)\n", machine().describe_context(), tag(), dev(), data); + } else if (m_status & IDE_STATUS_BSY) { logerror( "%s: %s dev %d write_dma %04x ignored (BSY)\n", machine().describe_context(), tag(), dev(), data ); diff --git a/src/devices/machine/idehd.c b/src/devices/machine/idehd.c index aa5517a1a3e..afc6de0c3de 100644 --- a/src/devices/machine/idehd.c +++ b/src/devices/machine/idehd.c @@ -149,7 +149,7 @@ void ata_mass_storage_device::ide_build_identify_device() m_identify_buffer[85] = 0x00; /* 85: command set/feature enabled */ m_identify_buffer[86] = 0x00; /* 86: command set/feature enabled */ m_identify_buffer[87] = 0x00; /* 87: command set/feature default */ - m_identify_buffer[88] = 0x00; /* 88: additional DMA modes */ + m_identify_buffer[88] = 0x00; /* 88: additional DMA modes (ultra dma) */ m_identify_buffer[89] = 0x00; /* 89: time required for security erase unit completion */ m_identify_buffer[90] = 0x00; /* 90: time required for enhanced security erase unit completion */ m_identify_buffer[91] = 0x00; /* 91: current advanced power management value */