diff --git a/src/ICONS/hard_disk_removable_scsi.ico b/src/ICONS/hard_disk_removable_scsi.ico new file mode 100644 index 000000000..59f80a96b Binary files /dev/null and b/src/ICONS/hard_disk_removable_scsi.ico differ diff --git a/src/ICONS/hard_disk_removable_scsi_active.ico b/src/ICONS/hard_disk_removable_scsi_active.ico new file mode 100644 index 000000000..de2979539 Binary files /dev/null and b/src/ICONS/hard_disk_removable_scsi_active.ico differ diff --git a/src/ICONS/hard_disk_removable_scsi_empty.ico b/src/ICONS/hard_disk_removable_scsi_empty.ico new file mode 100644 index 000000000..be5da8ee4 Binary files /dev/null and b/src/ICONS/hard_disk_removable_scsi_empty.ico differ diff --git a/src/ICONS/hard_disk_removable_scsi_empty_active.ico b/src/ICONS/hard_disk_removable_scsi_empty_active.ico new file mode 100644 index 000000000..8c08338ba Binary files /dev/null and b/src/ICONS/hard_disk_removable_scsi_empty_active.ico differ diff --git a/src/VIDEO/vid_svga.c b/src/VIDEO/vid_svga.c index 69c954bc9..39a72ae15 100644 --- a/src/VIDEO/vid_svga.c +++ b/src/VIDEO/vid_svga.c @@ -1256,7 +1256,7 @@ uint8_t svga_read(uint32_t addr, void *p) if (svga->chain4 || svga->fb_only) { if (addr >= svga->vram_limit) - return 0x00; + return 0xff; return svga->vram[svga_mask_addr(addr, svga)]; } else if (svga->chain2_read) @@ -1274,7 +1274,7 @@ uint8_t svga_read(uint32_t addr, void *p) addr<<=2; if (addr >= svga->vram_limit) - return 0x00; + return 0xff; addr = svga_mask_addr(addr, svga); diff --git a/src/WIN/86Box.rc b/src/WIN/86Box.rc index a593212e4..7c8395647 100644 --- a/src/WIN/86Box.rc +++ b/src/WIN/86Box.rc @@ -664,6 +664,8 @@ END 163 ICON DISCARDABLE "ICONS/cdrom_atapi_dma_active.ico" 164 ICON DISCARDABLE "ICONS/cdrom_scsi.ico" 165 ICON DISCARDABLE "ICONS/cdrom_scsi_active.ico" +176 ICON DISCARDABLE "ICONS/hard_disk_removable_scsi.ico" +177 ICON DISCARDABLE "ICONS/hard_disk_removable_scsi_active.ico" 192 ICON DISCARDABLE "ICONS/hard_disk_mfm.ico" 193 ICON DISCARDABLE "ICONS/hard_disk_mfm_active.ico" 194 ICON DISCARDABLE "ICONS/hard_disk.ico" @@ -702,6 +704,8 @@ END 419 ICON DISCARDABLE "ICONS/cdrom_atapi_dma_empty_active.ico" 420 ICON DISCARDABLE "ICONS/cdrom_scsi_empty.ico" 421 ICON DISCARDABLE "ICONS/cdrom_scsi_empty_active.ico" +432 ICON DISCARDABLE "ICONS/hard_disk_removable_scsi_empty.ico" +433 ICON DISCARDABLE "ICONS/hard_disk_removable_scsi_empty_active.ico" 512 ICON DISCARDABLE "ICONS/floppy_disabled.ico" 514 ICON DISCARDABLE "ICONS/cdrom_disabled.ico" @@ -1003,7 +1007,9 @@ BEGIN 2198 "Removable disk %i: %s" 2199 "USB is not yet supported" 2200 "Invalid PCap device" - 2201 "English (United States)" + 2201 "SCSI removable disk: %ws" + 2202 "" + 2203 "English (United States)" END diff --git a/src/WIN/win.c b/src/WIN/win.c index 010b67f61..af72b0ef1 100644 --- a/src/WIN/win.c +++ b/src/WIN/win.c @@ -809,6 +809,23 @@ void create_cdrom_tip(int part) } } +void create_removable_hd_tip(int part) +{ + WCHAR *szText; + WCHAR wtext[512]; + + int drive = sb_part_meanings[part] & 0xf; + + if (wcslen(hdd_fn[drive]) == 0) + { + _swprintf(sbTips[part], win_language_get_string_from_id(2201), win_language_get_string_from_id(2185)); + } + else + { + _swprintf(sbTips[part], win_language_get_string_from_id(2179), hdd_fn[drive]); + } +} + void create_hd_tip(int part) { WCHAR *szText; @@ -841,11 +858,9 @@ void update_tip(int meaning) case 0x10: create_cdrom_tip(part); break; -#if 0 case 0x20: create_removable_hd_tip(part); break; -#endif case 0x30: create_hd_tip(part); break; @@ -954,7 +969,6 @@ void update_status_bar_panes(HWND hwnds) sb_parts++; } } -#if 0 for (i = 0; i < 16; i++) { if (hdc[i].bus == 5) @@ -965,7 +979,6 @@ void update_status_bar_panes(HWND hwnds) sb_parts++; } } -#endif if (c_mfm && !(models[model].flags & MODEL_HAS_IDE) && !!memcmp(hdd_controller_name, "none", 4) && !!memcmp(hdd_controller_name, "xtide", 5)) { edge += sb_icon_width; @@ -1047,14 +1060,12 @@ void update_status_bar_panes(HWND hwnds) sb_part_icons[i] = j | sb_icon_flags[i]; create_cdrom_tip(i); break; -#if 0 case 0x20: /* Removable hard disk */ sb_icon_flags[i] = (wcslen(discfns[sb_part_meanings[i] & 0xf]) == 0) ? 256 : 0; sb_part_icons[i] = 176 + sb_icon_flags[i]; - create_floppy_tip(i); + create_removable_hd_tip(i); break; -#endif case 0x30: /* Hard disk */ sb_part_icons[i] = 192 + ((sb_part_meanings[i] & 0xf) << 1); @@ -1107,12 +1118,10 @@ HWND EmulatorStatusBar(HWND hwndParent, int idStatus, HINSTANCE hinst) hIcon[i] = LoadIconEx((PCTSTR) i); } -#if 0 for (i = 176; i < 178; i++) { hIcon[i] = LoadIconEx((PCTSTR) i); } -#endif for (i = 192; i < 200; i++) { @@ -1139,12 +1148,10 @@ HWND EmulatorStatusBar(HWND hwndParent, int idStatus, HINSTANCE hinst) hIcon[i] = LoadIconEx((PCTSTR) i); } -#if 0 for (i = 432; i < 434; i++) { hIcon[i] = LoadIconEx((PCTSTR) i); } -#endif GetWindowRect(hwndParent, &rectDialog); dw = rectDialog.right - rectDialog.left; diff --git a/src/fdc.c b/src/fdc.c index 9e5b66cce..7a640096b 100644 --- a/src/fdc.c +++ b/src/fdc.c @@ -626,6 +626,8 @@ void fdc_implied_seek() } } +int fifo_count = 0; + void fdc_write(uint16_t addr, uint8_t val, void *priv) { int drive, i, drive_num; @@ -805,6 +807,7 @@ void fdc_write(uint16_t addr, uint8_t val, void *priv) case 0x19: /*Scan low or equal*/ case 0x16: /*Verify*/ case 0x1D: /*Scan high or equal*/ + fifo_count = 0; fdc.satisfying_sectors=0; fdc.sc=0; fdc.wrong_am=0; @@ -1261,11 +1264,10 @@ uint8_t fdc_read(uint16_t addr, void *priv) { uint8_t temp; int drive; - fdc_log("Read FDC %04X\n",addr); switch (addr&7) { case 0: /* STA */ - return 0xff; + temp = 0xff; break; case 1: /* STB */ if (is486) @@ -1274,7 +1276,9 @@ uint8_t fdc_read(uint16_t addr, void *priv) } drive = real_drive(fdc.dor & 3); if (!fdc.enable_3f1) - return 0xff; + { + temp = 0xff; + } temp = 0x70; if (drive) temp &= ~0x40; @@ -1314,7 +1318,8 @@ uint8_t fdc_read(uint16_t addr, void *priv) case 4: /*Status*/ if (!(fdc.dor & 4) & !fdc.pcjr) { - return 0; + temp = 0; + break; } temp=fdc.stat; break; @@ -1373,6 +1378,7 @@ uint8_t fdc_read(uint16_t addr, void *priv) default: temp=0xFF; } + fdc_log("Read FDC %04X %02X\n",addr, temp); return temp; } @@ -1430,6 +1436,7 @@ void fdc_poll_common_finish(int compare, int st5) fdc.res[8]=fdc.head; fdc.res[9]=fdc.sector; fdc.res[10]=fdc.params[4]; + fdc_log("Read/write finish (%02X %02X %02X %02X %02X %02X %02X)\n" , fdc.res[4], fdc.res[5], fdc.res[6], fdc.res[7], fdc.res[8], fdc.res[9], fdc.res[10]); update_status_bar_icon(fdc.drive, 0); paramstogo=7; } @@ -1541,7 +1548,31 @@ void fdc_callback() old_sector = fdc.sector; if (fdc.tc) { - fdc.sector++; + /* This is needed so that the correct results are returned + in case of TC. */ + if (fdc.sector == fdc.params[5]) + { + if (!(fdc.command & 0x80)) + { + fdc.rw_track++; + fdc.sector = 1; + } + else + { + if (fdc.head) + { + fdc.rw_track++; + } + + fdc.head ^= 1; + fdd_set_head(fdc.drive, fdc.head); + fdc.sector = 1; + } + } + else + { + fdc.sector++; + } fdc_poll_readwrite_finish(compare); return; } @@ -1777,7 +1808,7 @@ void fdc_callback() fdc.config = fdc.params[1]; fdc.pretrk = fdc.params[2]; fdc.fifo = (fdc.params[1] & 0x20) ? 0 : 1; - fdc.tfifo = (fdc.params[1] & 0xF) + 1; + fdc.tfifo = (fdc.params[1] & 0xF); fdc.stat = 0x80; disctime = 0; return; @@ -1889,7 +1920,7 @@ int fdc_data(uint8_t data) return -1; } - if (fdc.pcjr || !fdc.fifo || (fdc.tfifo <= 1)) + if (fdc.pcjr || !fdc.fifo || (fdc.tfifo < 1)) { fdc.dat = data; fdc.data_ready = 1; @@ -1909,6 +1940,36 @@ int fdc_data(uint8_t data) } else { + if (fdc.tc) + { + fdc_log("FDC read: TC\n"); + return 0; + } + + if (dma_channel_write(2, data) & DMA_OVER) + { + fdc_log("FDC read: DMA over\n"); + fdc.tc = 1; + } + + if (!fdc.fifo) + { + fdc.data_ready = 1; + fdc.stat = 0xd0; + } + else + { + fdc_fifo_buf_advance(); + if (fdc.fifobufpos == 0) + { + /* We have wrapped around, means FIFO is over */ + fifo_count++; + fdc_log("%04X: FIFO wrap around (threshold == %02X), DRQ sent\n", fifo_count, fdc.tfifo); + fdc.data_ready = 1; + fdc.stat = 0xd0; + } + } +#if 0 result = dma_channel_write(2, data); if (fdc.tc) @@ -1922,7 +1983,7 @@ int fdc_data(uint8_t data) return -1; } - if (!fdc.fifo || (fdc.tfifo <= 1)) + if (!fdc.fifo || (fdc.tfifo < 1)) { fdc.data_ready = 1; fdc.stat = 0xd0; @@ -1937,6 +1998,7 @@ int fdc_data(uint8_t data) fdc.stat = 0xd0; } } +#endif } return 0; diff --git a/src/net_ne2000.c b/src/net_ne2000.c index 51fdd7b4e..b0262dafc 100644 --- a/src/net_ne2000.c +++ b/src/net_ne2000.c @@ -1809,12 +1809,13 @@ nic_init(int board) mac = device_get_config_int_ex("mac", -1); /* Set up our MAC address. */ +#if 1 if (dev->is_rtl8029as) { - dev->maclocal[0] = 0x00; /* 00:20:18 (RTL 8029AS PCI vendor prefix). */ + dev->maclocal[0] = 0xDE /* 0x00 */; /* 00:20:18 (RTL 8029AS PCI vendor prefix). */ dev->maclocal[1] = 0x20; dev->maclocal[2] = 0x18; } else { - dev->maclocal[0] = 0x00; /* 00:00:D8 (NE2000 ISA vendor prefix). */ + dev->maclocal[0] = 0xDE /* 0x00 */; /* 00:00:D8 (NE2000 ISA vendor prefix). */ dev->maclocal[1] = 0x00; dev->maclocal[2] = 0xD8; } @@ -1833,6 +1834,14 @@ nic_init(int board) dev->maclocal[5] = (mac & 0xff) | 1; #endif } +#else + dev->maclocal[0] = 0xac; + dev->maclocal[1] = 0xde; + dev->maclocal[2] = 0x48; + dev->maclocal[3] = 0x88; + dev->maclocal[4] = 0xbb; + dev->maclocal[5] = 0xaa; +#endif memcpy(dev->physaddr, dev->maclocal, sizeof(dev->maclocal)); pclog(1,"%s: I/O=%04x, IRQ=%d, MAC=%02x:%02x:%02x:%02x:%02x:%02x BIOS=%d\n", diff --git a/src/net_pcap.c b/src/net_pcap.c index 3ca2e9089..68fafb6d2 100644 --- a/src/net_pcap.c +++ b/src/net_pcap.c @@ -109,6 +109,7 @@ poll_thread(void *arg) int network_pcap_setup(uint8_t *mac, NETRXCB func, void *arg) { + int rc; char temp[PCAP_ERRBUF_SIZE]; char filter_exp[255]; struct bpf_program fp; @@ -140,7 +141,7 @@ network_pcap_setup(uint8_t *mac, NETRXCB func, void *arg) pcap = pcap_open_live(dev, /* interface name */ 1518, /* maximum packet size */ 1, /* promiscuous mode? */ - 10, /* timeout in msec */ + 15, /* timeout in msec */ temp); /* error buffer */ if (pcap == NULL) { pclog("Unable to open WinPcap: %s!\n", temp);