--- z80pack-1.24/iodevices/imsai-fif.c 2014-08-25 21:50:21.000000000 +0200 +++ z80pack/iodevices/imsai-fif.c 2014-09-17 20:10:49.000000000 +0200 @@ -16,6 +16,7 @@ * 02-MAR-14 improvements * 23-MAR-14 got all 4 disk drives working * AUG-14 some improvements after seeing the original IMSAI CP/M 1.3 BIOS + * 17-SEP-14 FDC error 9 for DMA overrun, as reported by Alan Cox for cpmsim */ #include @@ -135,6 +136,7 @@ * 6 - seek error * 7 - read error * 8 - write error + * 9 - DMA overrun > 0xffff * 15 - invalid command * * These error codes will abort disk I/O, but this are not the ones @@ -178,6 +180,12 @@ sector = *(ram + addr + DD_SECTOR); dma_addr = (*(ram + addr + DD_DMAH) * 256) + *(ram + addr + DD_DMAL); + /* check for DMA overrun */ + if (dma_addr > 0xff80) { + *(ram + addr + DD_RESULT) = 9; + return; + } + /* convert IMSAI unit bit to internal disk no */ switch (unit) { case 1: /* IMDOS drive A: */