diff --git a/hw/ide/macio.c b/hw/ide/macio.c index 66ac2ba..1d29fb7 100644 --- a/hw/ide/macio.c +++ b/hw/ide/macio.c @@ -31,7 +31,7 @@ #include /* debug MACIO */ -// #define DEBUG_MACIO + #define DEBUG_MACIO #ifdef DEBUG_MACIO static const int debug_macio = 1; @@ -274,8 +274,11 @@ static void pmac_ide_atapi_transfer_cb(void *opaque, int ret) /* Non-block ATAPI transfer - just copy to RAM */ s->io_buffer_size = MIN(s->io_buffer_size, io->len); cpu_physical_memory_write(io->addr, s->io_buffer, s->io_buffer_size); + + /* End of IDE transfer */ + s->io_buffer_size = 0; + io->len = 0; ide_atapi_cmd_ok(s); - m->dma_active = false; goto done; } diff --git a/hw/misc/macio/mac_dbdma.c b/hw/misc/macio/mac_dbdma.c index b25e851..6a59dcd 100644 --- a/hw/misc/macio/mac_dbdma.c +++ b/hw/misc/macio/mac_dbdma.c @@ -42,7 +42,7 @@ #include "qemu/main-loop.h" /* debug DBDMA */ -//#define DEBUG_DBDMA +#define DEBUG_DBDMA #ifdef DEBUG_DBDMA #define DBDMA_DPRINTF(fmt, ...) \ @@ -590,12 +590,13 @@ dbdma_control_write(DBDMA_channel *ch) if ((ch->regs[DBDMA_STATUS] & RUN) && !(status & RUN)) { /* RUN is cleared */ status &= ~(ACTIVE|DEAD); - if ((status & FLUSH) && ch->flush) { - ch->flush(&ch->io); - status &= ~FLUSH; - } } + if ((status & FLUSH) && ch->flush) { + ch->flush(&ch->io); + status &= ~FLUSH; + } + DBDMA_DPRINTF(" status 0x%08x\n", status); ch->regs[DBDMA_STATUS] = status; @@ -603,9 +604,6 @@ dbdma_control_write(DBDMA_channel *ch) if (status & ACTIVE) { DBDMA_kick(dbdma_from_ch(ch)); } - if ((status & FLUSH) && ch->flush) { - ch->flush(&ch->io); - } } static void dbdma_write(void *opaque, hwaddr addr,