--- z80pack-1.24/cpmsim/srcsim/iosim.c 2014-07-16 23:52:45.000000000 +0200 +++ z80pack/cpmsim/srcsim/iosim.c 2014-09-17 20:17:01.000000000 +0200 @@ -40,6 +40,8 @@ * 02-MAR-14 source cleanup and improvements * 03-MAI-14 improved network code, telnet negotiation rewritten * 16-JUL-14 unused I/O ports need to return FF, see survey.mac + * 17-SEP-14 FDC error 8 for DMA overrun, as reported by Alan Cox + * 17_SEP-14 fixed bug in MMU bank select, as reported by Alan Cox */ /* @@ -2149,6 +2151,7 @@ * 5 - read error * 6 - write error * 7 - illegal command to FDC + * 8 - DMA overrun > 0xffff */ static void fdco_out(BYTE data) { @@ -2165,6 +2168,10 @@ status = 3; return; } + if (dmadh == 0xff && dmadl > 0x80) { + status = 8; + return; + } pos = (((long)track) * ((long)disks[drive].sectors) + sector - 1) << 7; if (lseek(*disks[drive].fd, pos, SEEK_SET) == -1L) { status = 4; @@ -2300,8 +2307,9 @@ { if (data == selbnk) return; - if (data > maxbnk) { - printf("Try to select unallocated bank %d\r\n", data); + if (data >= maxbnk) { + printf("0x%04lx: Try to select unallocated bank %d\r\n", + PC - ram, data); exit(1); } //printf("SIM: memory select bank %d from %d\r\n", data, PC-ram);