From be878ede582870a70532890b85fbd43e6f242e8d Mon Sep 17 00:00:00 2001 From: TC1995 Date: Mon, 13 Jan 2025 00:56:04 +0100 Subject: [PATCH] Okay, maybe for the 53c400 only so. Based on my tests, the former 5380 commit will apply to the 53c400 only, for now... --- src/scsi/scsi_ncr5380.c | 4 ++-- src/scsi/scsi_t128.c | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/scsi/scsi_ncr5380.c b/src/scsi/scsi_ncr5380.c index 092cc08e9..0c3af9282 100644 --- a/src/scsi/scsi_ncr5380.c +++ b/src/scsi/scsi_ncr5380.c @@ -197,7 +197,7 @@ ncr5380_bus_read(ncr_t *ncr) phase = (ncr->cur_bus & SCSI_PHASE_MESSAGE_IN); if (phase == SCSI_PHASE_DATA_IN) { - if (ncr->dma_mode == DMA_IDLE) { + if ((ncr->dma_mode == DMA_IDLE) || ncr->dma_initiator_receive_ext) { ncr5380_log("Phase Data In.\n"); if ((dev->sc != NULL) && (dev->sc->temp_buffer != NULL)) ncr->tx_data = dev->sc->temp_buffer[ncr->data_pos++]; @@ -210,7 +210,7 @@ ncr5380_bus_read(ncr_t *ncr) ncr->state = STATE_IDLE; ncr->cur_bus &= ~BUS_BSY; } else { - if (ncr->dma_mode == DMA_IDLE) + if ((ncr->dma_mode == DMA_IDLE) || ncr->dma_send_ext) ncr->state = STATE_DATAOUT; } } else if (phase == SCSI_PHASE_STATUS) { diff --git a/src/scsi/scsi_t128.c b/src/scsi/scsi_t128.c index faad87052..c878bbb91 100644 --- a/src/scsi/scsi_t128.c +++ b/src/scsi/scsi_t128.c @@ -287,7 +287,6 @@ write_again: t128->block_count = (t128->block_count - 1) & 0xff; t128_log("T128 Remaining blocks to be written=%d\n", t128->block_count); if (!t128->block_count) { - ncr->dma_mode = DMA_IDLE; t128->block_loaded = 0; t128_log("IO End of write transfer\n"); ncr->tcr |= TCR_LAST_BYTE_SENT; @@ -344,7 +343,6 @@ read_again: t128_log("T128 Remaining blocks to be read=%d, status=%02x, len=%i, cdb[0] = %02x\n", t128->block_count, t128->status, dev->buffer_length, ncr->command[0]); if (!t128->block_count) { t128->block_loaded = 0; - ncr->dma_mode = DMA_IDLE; t128_log("IO End of read transfer\n"); ncr->isr |= STATUS_END_OF_DMA; timer_stop(&t128->timer);