diff --git a/src/Makefile.mingw b/src/Makefile.mingw index 24fb51f8b..02c65792b 100644 --- a/src/Makefile.mingw +++ b/src/Makefile.mingw @@ -8,7 +8,7 @@ # # Modified Makefile for Win32 MinGW 32-bit environment. # -# Version: @(#)Makefile.mingw 1.0.22 2017/06/01 +# Version: @(#)Makefile.mingw 1.0.23 2017/06/03 # # Authors: Miran Grca, # Fred N. van Kempen, @@ -48,6 +48,9 @@ endif ifndef RELEASE RELEASE = n endif +ifndef USB +USB = n +endif ######################################################################### @@ -154,7 +157,9 @@ DEVOBJ = bugger.o lpt.o serial.o \ disc_random.o disc_td0.o \ cdrom.o \ cdrom_dosbox.o cdrom_image.o cdrom_ioctl.o cdrom_null.o +ifeq ($(USB), y) USBOBJ = usb.o +endif NETOBJ = network.o \ net_pcap.o net_slirp.o \ net_ne2000.o @@ -170,7 +175,7 @@ SNDOBJ = sound.o \ snd_adlib.o snd_adlibgold.o snd_ad1848.o \ snd_sb.o snd_sb_dsp.o snd_cms.o snd_dbopl.o \ snd_emu8k.o snd_gus.o snd_opl.o \ - snd_mpu401.o snd_pas16.o snd_resid.o \ + snd_mpu401.o snd_resid.o \ snd_sn76489.o snd_ssi2001.o snd_wss.o \ snd_ym7128.o VIDOBJ = video.o \ diff --git a/src/SOUND/snd_sb_dsp.c b/src/SOUND/snd_sb_dsp.c index ba4e556f0..3d7c95cf8 100644 --- a/src/SOUND/snd_sb_dsp.c +++ b/src/SOUND/snd_sb_dsp.c @@ -6,6 +6,7 @@ #include #include #include "../ibm.h" +#include "../device.h" #include "../io.h" #include "../pic.h" #include "../dma.h" @@ -515,7 +516,7 @@ void sb_exec_command(sb_dsp_t *dsp) sb_add_data(dsp, dsp->sb_asp_regs[dsp->sb_data[0]]); break; case 0xF8: - if (dsp->sb_type < SB16) break; + if (dsp->sb_type >= SB16) break; sb_add_data(dsp, 0); break; case 0xF9: diff --git a/src/SOUND/sound.c b/src/SOUND/sound.c index fb0237ac9..5a96ff15c 100644 --- a/src/SOUND/sound.c +++ b/src/SOUND/sound.c @@ -28,7 +28,7 @@ #include "snd_opl.h" #include "snd_adlib.h" #include "snd_adlibgold.h" -#include "snd_pas16.h" +/* #include "snd_pas16.h" */ #include "snd_sb.h" #include "snd_sb_dsp.h" #include "snd_wss.h" @@ -62,7 +62,9 @@ static SOUND_CARD sound_cards[] = {"Sound Blaster AWE32", "sbawe32", &sb_awe32_device}, {"Adlib Gold", "adlibgold", &adgold_device}, {"Windows Sound System", "wss", &wss_device}, +#if 0 {"Pro Audio Spectrum 16", "pas16", &pas16_device}, +#endif {"", "", NULL} }; diff --git a/src/WIN/86Box.rc b/src/WIN/86Box.rc index 0d8b6d8d2..1020c2767 100644 --- a/src/WIN/86Box.rc +++ b/src/WIN/86Box.rc @@ -440,13 +440,15 @@ BEGIN LVS_REPORT | LVS_SHOWSELALWAYS | LVS_SINGLESEL | WS_BORDER | WS_TABSTOP,7,18,253,60 LTEXT "Floppy drives:",-1,7,7,43,8 + COMBOBOX IDC_COMBO_FD_TYPE,33,85,90,12,CBS_DROPDOWNLIST | + WS_VSCROLL | WS_TABSTOP + LTEXT "Type:",1803,7,86,24,8 + CONTROL "Turbo timings (no accuracy)",IDC_CHECKTURBO,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,131,86,129,10 CONTROL "List1",IDC_LIST_CDROM_DRIVES,"SysListView32",LVS_REPORT | LVS_SHOWSELALWAYS | LVS_SINGLESEL | WS_BORDER | WS_TABSTOP,7,116,253,60 LTEXT "CD-ROM drives:",-1,7,106,50,8 - COMBOBOX IDC_COMBO_FD_TYPE,33,85,90,12,CBS_DROPDOWNLIST | - WS_VSCROLL | WS_TABSTOP - LTEXT "Type:",1803,7,86,24,8 COMBOBOX IDC_COMBO_CD_BUS,33,183,90,12,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP LTEXT "Bus:",1798,7,184,24,8 @@ -872,9 +874,13 @@ BEGIN IDS_2218 "&Image..." IDS_2219 "PCap failed to set up because it may not be initialized" IDS_2220 "Image (&Write-protected)..." - IDS_2221 "English (United States)" + IDS_2221 "Turbo" + IDS_2222 "On" + IDS_2223 "Off" + IDS_2224 "" + IDS_2225 "English (United States)" END -#define IDS_LANG_ENUS IDS_2221 +#define IDS_LANG_ENUS IDS_2225 #ifndef _MAC diff --git a/src/WIN/resource.h b/src/WIN/resource.h index 73a8f97c4..52edb590a 100644 --- a/src/WIN/resource.h +++ b/src/WIN/resource.h @@ -66,6 +66,7 @@ #define IDC_BUTTON_HDD_ADD 1028 #define IDC_BUTTON_CDROM_REMOVE 1029 #define IDC_BUTTON_HDD_REMOVE 1029 +#define IDC_CHECKTURBO 1030 #define IDC_HDIMAGE_NEW 1035 #define IDC_HD_BUS 1036 #define IDC_HDIMAGE_EXISTING 1037 @@ -285,8 +286,12 @@ #define IDS_2219 2219 #define IDS_2220 2220 #define IDS_2221 2221 +#define IDS_2222 2222 +#define IDS_2223 2223 +#define IDS_2224 2224 +#define IDS_2225 2225 -#define IDS_LANG_ENUS IDS_2221 +#define IDS_LANG_ENUS IDS_2225 #define IDM_ABOUT 40001 @@ -473,4 +478,4 @@ # endif #endif -#define STRINGS_NUM 174 +#define STRINGS_NUM 178 diff --git a/src/WIN/win_settings.c b/src/WIN/win_settings.c index 7c187fe89..b09e801fa 100644 --- a/src/WIN/win_settings.c +++ b/src/WIN/win_settings.c @@ -74,6 +74,7 @@ static hard_disk_t temp_hdc[HDC_NUM]; /* Removable devices category */ static int temp_fdd_types[FDD_NUM]; +static int temp_fdd_turbo[FDD_NUM]; static cdrom_drive_t temp_cdrom_drives[CDROM_NUM]; static HWND hwndParentDialog, hwndChildDialog; @@ -149,6 +150,7 @@ static void win_settings_init(void) for (i = 0; i < FDD_NUM; i++) { temp_fdd_types[i] = fdd_get_type(i); + temp_fdd_turbo[i] = fdd_get_turbo(i); } memcpy(temp_cdrom_drives, cdrom_drives, CDROM_NUM * sizeof(cdrom_drive_t)); } @@ -212,6 +214,7 @@ static int win_settings_changed(void) for (j = 0; j < FDD_NUM; j++) { i = i || (temp_fdd_types[j] != fdd_get_type(j)); + i = i || (temp_fdd_turbo[j] != fdd_get_turbo(j)); } i = i || memcmp(cdrom_drives, temp_cdrom_drives, CDROM_NUM * sizeof(cdrom_drive_t)); @@ -309,6 +312,7 @@ static void win_settings_save(void) for (i = 0; i < FDD_NUM; i++) { fdd_set_type(i, temp_fdd_types[i]); + fdd_set_turbo(i, temp_fdd_turbo[i]); } memcpy(cdrom_drives, temp_cdrom_drives, CDROM_NUM * sizeof(cdrom_drive_t)); @@ -3454,6 +3458,16 @@ static BOOL win_settings_floppy_drives_recalc_list(HWND hwndList) if (ListView_InsertItem(hwndList, &lvI) == -1) return FALSE; + + lvI.iSubItem = 1; + lvI.pszText = win_language_get_string_from_id(temp_fdd_turbo[i] ? 2222 : 2223); + lvI.iItem = i; + lvI.iImage = 0; + + if (ListView_SetItem(hwndList, &lvI) == -1) + { + return FALSE; + } } return TRUE; @@ -3515,7 +3529,7 @@ static BOOL win_settings_floppy_drives_init_columns(HWND hwndList) lvc.iSubItem = 0; lvc.pszText = win_language_get_string_from_id(2188); - lvc.cx = 392; + lvc.cx = 292; lvc.fmt = LVCFMT_LEFT; if (ListView_InsertColumn(hwndList, 0, &lvc) == -1) @@ -3523,6 +3537,17 @@ static BOOL win_settings_floppy_drives_init_columns(HWND hwndList) return FALSE; } + lvc.iSubItem = 1; + lvc.pszText = win_language_get_string_from_id(2221); + + lvc.cx = 100; + lvc.fmt = LVCFMT_LEFT; + + if (ListView_InsertColumn(hwndList, 1, &lvc) == -1) + { + return FALSE; + } + return TRUE; } @@ -3612,6 +3637,16 @@ static void win_settings_floppy_drives_update_item(HWND hwndList, int i) { return; } + + lvI.iSubItem = 1; + lvI.pszText = win_language_get_string_from_id(temp_fdd_turbo[i] ? 2222 : 2223); + lvI.iItem = i; + lvI.iImage = 0; + + if (ListView_SetItem(hwndList, &lvI) == -1) + { + return; + } } static void win_settings_cdrom_drives_update_item(HWND hwndList, int i) @@ -3796,6 +3831,9 @@ static BOOL CALLBACK win_settings_removable_devices_proc(HWND hdlg, UINT message } SendMessage(h, CB_SETCURSEL, temp_fdd_types[fdlv_current_sel], 0); + h = GetDlgItem(hdlg, IDC_CHECKTURBO); + SendMessage(h, BM_SETCHECK, temp_fdd_turbo[fdlv_current_sel], 0); + cdlv_current_sel = 0; h = GetDlgItem(hdlg, IDC_LIST_CDROM_DRIVES); win_settings_cdrom_drives_init_columns(h); @@ -3855,6 +3893,8 @@ static BOOL CALLBACK win_settings_removable_devices_proc(HWND hdlg, UINT message rd_ignore_change = 1; h = GetDlgItem(hdlg, IDC_COMBO_FD_TYPE); SendMessage(h, CB_SETCURSEL, temp_fdd_types[fdlv_current_sel], 0); + h = GetDlgItem(hdlg, IDC_CHECKTURBO); + SendMessage(h, BM_SETCHECK, temp_fdd_turbo[fdlv_current_sel], 0); rd_ignore_change = 0; } else if ((((LPNMHDR)lParam)->code == LVN_ITEMCHANGED) && (((LPNMHDR)lParam)->idFrom == IDC_LIST_CDROM_DRIVES)) @@ -3918,6 +3958,20 @@ static BOOL CALLBACK win_settings_removable_devices_proc(HWND hdlg, UINT message rd_ignore_change = 0; return FALSE; + case IDC_CHECKTURBO: + if (rd_ignore_change) + { + return FALSE; + } + + rd_ignore_change = 1; + h = GetDlgItem(hdlg, IDC_CHECKTURBO); + temp_fdd_turbo[fdlv_current_sel] = SendMessage(h, BM_GETCHECK, 0, 0); + h = GetDlgItem(hdlg, IDC_LIST_FLOPPY_DRIVES); + win_settings_floppy_drives_update_item(h, fdlv_current_sel); + rd_ignore_change = 0; + return FALSE; + case IDC_COMBO_CD_BUS: if (rd_ignore_change) { diff --git a/src/config.c b/src/config.c index 2a7913629..0b4dbce53 100644 --- a/src/config.c +++ b/src/config.c @@ -1480,6 +1480,8 @@ static void loadconfig_removable_devices(void) printf("Floppy: %ws\n", discfns[c]); sprintf(temps, "fdd_%02i_writeprot", c + 1); ui_writeprot[c] = !!config_get_int(cat, temps, 0); + sprintf(temps, "fdd_%02i_turbo", c + 1); + fdd_set_turbo(c, !!config_get_int(cat, temps, 0)); /* Check, whether each value is default, if yes, delete it so that only non-default values will later be saved. */ if (fdd_get_type(c) == ((c < 2) ? 2 : 0)) @@ -1499,6 +1501,12 @@ static void loadconfig_removable_devices(void) sprintf(temps, "fdd_%02i_writeprot", c + 1); config_delete_var(cat, temps); } + + if (fdd_get_turbo(c) == 0) + { + sprintf(temps, "fdd_%02i_turbo", c + 1); + config_delete_var(cat, temps); + } } memset(temps, 0, 512); @@ -2352,6 +2360,16 @@ static void saveconfig_removable_devices(void) { config_set_int(cat, temps, ui_writeprot[c]); } + + sprintf(temps, "fdd_%02i_turbo", c + 1); + if (fdd_get_turbo(c) == 0) + { + config_delete_var(cat, temps); + } + else + { + config_set_int(cat, temps, fdd_get_turbo(c)); + } } memset(temps, '\0', sizeof(temps)); diff --git a/src/disc.c b/src/disc.c index e7af927bd..46b2517c6 100644 --- a/src/disc.c +++ b/src/disc.c @@ -195,6 +195,11 @@ double disc_byteperiod(int drive) if (drives[drive].byteperiod) { + if (fdd_get_turbo(drive)) + { + return 1.0; + } + return drives[drive].byteperiod(drive); } else @@ -213,7 +218,7 @@ double disc_real_period(int drive) dusec = (double) TIMER_USEC; /* This is a giant hack but until the timings become even more correct, this is needed to make floppies work right on that BIOS. */ - if (romset == ROM_MRTHOR) + if ((romset == ROM_MRTHOR) && !fdd_get_turbo(drive)) { return (ddbp * dusec) / 4.0; } diff --git a/src/fdd.c b/src/fdd.c index 449bf02bd..dd6649ee2 100644 --- a/src/fdd.c +++ b/src/fdd.c @@ -30,6 +30,8 @@ static struct int densel; int head; + + int turbo; } fdd[FDD_NUM]; /* Flags: @@ -312,6 +314,16 @@ int fdd_get_head(int drive) return fdd[drive].head; } +void fdd_set_turbo(int drive, int turbo) +{ + fdd[drive].turbo = turbo; +} + +int fdd_get_turbo(int drive) +{ + return fdd[drive].turbo; +} + int fdd_get_densel(int drive) { if (drive_types[fdd[drive].type].flags & FLAG_INVERT_DENSEL) diff --git a/src/fdd.h b/src/fdd.h index 7b34c4a1a..e8de9db96 100644 --- a/src/fdd.h +++ b/src/fdd.h @@ -30,6 +30,8 @@ int fdd_is_ed(int drive); int fdd_is_double_sided(int drive); void fdd_set_head(int drive, int head); int fdd_get_head(int drive); +void fdd_set_turbo(int drive, int turbo); +int fdd_get_turbo(int drive); void fdd_set_type(int drive, int type); int fdd_get_type(int drive); diff --git a/src/model.c b/src/model.c index a96b0a906..209bbb017 100644 --- a/src/model.c +++ b/src/model.c @@ -123,14 +123,18 @@ void at_endeavor_init(); void at_dtk486_init(); void at_r418_init(); +#if 0 void at_586mc1_init(); +#endif void at_plato_init(); void at_mb500n_init(); void at_p54tp4xe_init(); void at_ap53_init(); void at_p55t2s_init(); void at_acerm3a_init(); +#if 0 void at_acerv35n_init(); +#endif void at_p55t2p4_init(); void at_p55tvp4_init(); void at_p55va_init(); @@ -204,7 +208,9 @@ MODEL models[] = {"Award SiS 496/497", ROM_SIS496, "sis496", { "Intel", cpus_i486, "AMD", cpus_Am486, "Cyrix", cpus_Cx486, "", NULL, "", NULL}, 0, MODEL_AT | MODEL_HAS_IDE | MODEL_PCI, 1, 64, 1, at_sis496_init, NULL}, {"Rise Computer R418", ROM_R418, "r418", { "Intel", cpus_i486, "AMD", cpus_Am486, "Cyrix", cpus_Cx486, "", NULL, "", NULL}, 0, MODEL_AT | MODEL_HAS_IDE | MODEL_PCI, 1, 64, 1, at_r418_init, NULL}, {"Intel Premiere/PCI", ROM_REVENGE, "revenge", { "Intel", cpus_Pentium5V, "", NULL, "", NULL, "", NULL, "", NULL}, 0, MODEL_AT | MODEL_PS2 | MODEL_HAS_IDE | MODEL_PCI, 1, 128, 1, at_batman_init, NULL}, +#if 0 {"Micro Star 586MC1", ROM_586MC1, "586mc1", { "Intel", cpus_Pentium5V50, "", NULL, "", NULL, "", NULL, "", NULL}, 0, MODEL_AT | MODEL_HAS_IDE | MODEL_PCI, 1, 128, 1, at_586mc1_init, NULL}, +#endif {"Intel Premiere/PCI II", ROM_PLATO, "plato", { "Intel", cpus_PentiumS5, "IDT", cpus_WinChip, "AMD", cpus_K5, "", NULL, "", NULL}, 0, MODEL_AT | MODEL_PS2 | MODEL_HAS_IDE | MODEL_PCI, 1, 128, 1, at_plato_init, NULL}, {"Intel Advanced/EV", ROM_ENDEAVOR, "endeavor", { "Intel", cpus_PentiumS5, "IDT", cpus_WinChip, "AMD", cpus_K5, "", NULL, "", NULL}, 0, MODEL_AT | MODEL_PS2 | MODEL_HAS_IDE | MODEL_PCI, 1, 128, 1, at_endeavor_init, NULL}, {"Intel Advanced/ZP", ROM_ZAPPA, "zappa", { "Intel", cpus_PentiumS5, "IDT", cpus_WinChip, "AMD", cpus_K5, "", NULL, "", NULL}, 0, MODEL_AT | MODEL_PS2 | MODEL_HAS_IDE | MODEL_PCI, 1, 128, 1, at_endeavor_init, NULL}, @@ -215,7 +221,9 @@ MODEL models[] = {"AOpen AP53", ROM_AP53, "ap53", { "Intel", cpus_Pentium, "IDT", cpus_WinChip, "Cyrix", cpus_6x86, "AMD", cpus_K56, "", NULL}, 0, MODEL_AT | MODEL_PS2 | MODEL_HAS_IDE | MODEL_PCI, 1, 256, 1, at_ap53_init, NULL}, {"ASUS P/I-P55T2S", ROM_P55T2S, "p55t2s", { "Intel", cpus_Pentium, "IDT", cpus_WinChip, "Cyrix", cpus_6x86, "AMD", cpus_K56, "", NULL}, 0, MODEL_AT | MODEL_PS2 | MODEL_HAS_IDE | MODEL_PCI, 1, 256, 1, at_p55t2s_init, NULL}, {"Acer M3a", ROM_ACERM3A, "acerm3a", { "Intel", cpus_Pentium, "IDT", cpus_WinChip, "Cyrix", cpus_6x86, "AMD", cpus_K56, "", NULL}, 0, MODEL_AT | MODEL_PS2 | MODEL_HAS_IDE | MODEL_PCI, 1, 256, 1, at_acerm3a_init, NULL}, +#if 0 {"Acer V35N", ROM_ACERV35N, "acerv3n", { "Intel", cpus_Pentium, "IDT", cpus_WinChip, "Cyrix", cpus_6x86, "AMD", cpus_K56, "", NULL}, 0, MODEL_AT | MODEL_PS2 | MODEL_HAS_IDE | MODEL_PCI, 1, 256, 1, at_acerv35n_init, NULL}, +#endif {"ASUS P/I-P55T2P4", ROM_P55T2P4, "p55r2p4", { "Intel", cpus_Pentium, "IDT", cpus_WinChip, "Cyrix", cpus_6x86, "AMD", cpus_K56, "", NULL}, 0, MODEL_AT | MODEL_PS2 | MODEL_HAS_IDE | MODEL_PCI, 1, 256, 1, at_p55t2p4_init, NULL}, {"Award 430VX PCI", ROM_430VX, "430vx", { "Intel", cpus_Pentium, "IDT", cpus_WinChip, "Cyrix", cpus_6x86, "AMD", cpus_K56, "", NULL}, 0, MODEL_AT | MODEL_PS2 | MODEL_HAS_IDE | MODEL_PCI, 1, 256, 1, at_i430vx_init, NULL}, {"Epox P55-VA", ROM_P55VA, "p55va", { "Intel", cpus_Pentium, "IDT", cpus_WinChip, "Cyrix", cpus_6x86, "AMD", cpus_K56, "", NULL}, 0, MODEL_AT | MODEL_PS2 | MODEL_HAS_IDE | MODEL_PCI, 1, 256, 1, at_p55va_init, NULL}, @@ -652,6 +660,7 @@ void at_batman_init() i430lx_init(); } +#if 0 void at_586mc1_init() { at_ide_init(); @@ -665,6 +674,7 @@ void at_586mc1_init() device_add(&intel_flash_bxt_device); secondary_ide_check(); } +#endif void at_plato_init() { @@ -772,6 +782,7 @@ void at_acerm3a_init() device_add(&intel_flash_bxb_device); } +#if 0 void at_acerv35n_init() { at_ide_init(); @@ -788,6 +799,7 @@ void at_acerv35n_init() acerm3a_io_init(); device_add(&intel_flash_bxb_device); } +#endif void at_p55t2p4_init() {