From 82ad52674514891f5a3b880e3d6846e1676e7a15 Mon Sep 17 00:00:00 2001 From: SarahW Date: Sun, 8 Apr 2018 07:56:48 +0100 Subject: [PATCH] PIIX zero length transfer represents 64 kbytes. Fixes CD-ROM on BeOS. --- src/piix.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/piix.c b/src/piix.c index 342cce5..d8a2a18 100644 --- a/src/piix.c +++ b/src/piix.c @@ -154,6 +154,8 @@ static void piix_bus_master_next_addr(int channel) { piix_busmaster[channel].addr = (*(uint32_t *)(&ram[piix_busmaster[channel].ptr_cur])) & ~1; piix_busmaster[channel].count = (*(uint32_t *)(&ram[piix_busmaster[channel].ptr_cur + 4])) & 0xfffe; + if (!piix_busmaster[channel].count) + piix_busmaster[channel].count = 0x10000; piix_busmaster[channel].eot = (*(uint32_t *)(&ram[piix_busmaster[channel].ptr_cur + 4])) >> 31; piix_busmaster[channel].ptr_cur += 8; // pclog("New DMA settings on channel %i - Addr %08X Count %04X EOT %i\n", channel, piix_busmaster[channel].addr, piix_busmaster[channel].count, piix_busmaster[channel].eot);