Realistic CD-ROM timings on ATAPI PIO, ATAPI DMA, SCSI NCR 53c810, and SCSI Adaptec/Buslogic;

Added ability to select emulated CD-ROM drive speed;
The Adaptec and BusLogic SCSI controllers are no longer threaded;
Two fixes in video/vid_s3.c.
This commit is contained in:
OBattler
2018-03-07 20:06:08 +01:00
parent 84fa69c4a6
commit 16c722b32f
18 changed files with 382 additions and 268 deletions

View File

@@ -8,7 +8,7 @@
*
* Application resource script for Windows.
*
* Version: @(#)86Box.rc 1.0.30 2018/02/11
* Version: @(#)86Box.rc 1.0.31 2018/03/06
*
* Authors: Miran Grca, <mgrca8@gmail.com>
* Fred N. van Kempen, <decwiz@yahoo.com>
@@ -473,16 +473,16 @@ BEGIN
PUSHBUTTON "&Remove",IDC_BUTTON_HDD_REMOVE,198,137,62,10
COMBOBOX IDC_COMBO_HD_BUS,33,117,90,12,CBS_DROPDOWNLIST |
WS_VSCROLL | WS_TABSTOP
LTEXT "Bus:",IDT_1721,7,118,24,8
LTEXT "Bus:",IDT_1721,7,119,24,8
COMBOBOX IDC_COMBO_HD_CHANNEL,170,117,90,12,CBS_DROPDOWNLIST |
WS_VSCROLL | WS_TABSTOP
LTEXT "Channel:",IDT_1722,131,118,38,8
LTEXT "Channel:",IDT_1722,131,119,38,8
COMBOBOX IDC_COMBO_HD_ID,170,117,22,12,CBS_DROPDOWNLIST |
WS_VSCROLL | WS_TABSTOP
LTEXT "ID:",IDT_1723,131,118,38,8
LTEXT "ID:",IDT_1723,131,119,38,8
COMBOBOX IDC_COMBO_HD_LUN,239,117,22,12,CBS_DROPDOWNLIST |
WS_VSCROLL | WS_TABSTOP
LTEXT "LUN:",IDT_1724,200,118,38,8
LTEXT "LUN:",IDT_1724,200,119,38,8
COMBOBOX IDC_COMBO_HD_CHANNEL_IDE,170,117,90,12,CBS_DROPDOWNLIST |
WS_VSCROLL | WS_TABSTOP
END
@@ -510,16 +510,16 @@ BEGIN
LTEXT "File name:",IDT_1731,7,7,204,9
COMBOBOX IDC_COMBO_HD_BUS,33,71,58,12,CBS_DROPDOWNLIST |
WS_VSCROLL | WS_TABSTOP
LTEXT "Bus:",IDT_1721,7,72,24,8
LTEXT "Bus:",IDT_1721,7,73,24,8
COMBOBOX IDC_COMBO_HD_CHANNEL,134,71,77,12,CBS_DROPDOWNLIST |
WS_VSCROLL | WS_TABSTOP
LTEXT "Channel:",IDT_1722,99,72,34,8
LTEXT "Channel:",IDT_1722,99,73,34,8
COMBOBOX IDC_COMBO_HD_ID,133,71,26,12,CBS_DROPDOWNLIST |
WS_VSCROLL | WS_TABSTOP
LTEXT "ID:",IDT_1723,117,72,15,8
LTEXT "ID:",IDT_1723,117,73,15,8
COMBOBOX IDC_COMBO_HD_LUN,185,71,26,12,CBS_DROPDOWNLIST |
WS_VSCROLL | WS_TABSTOP
LTEXT "LUN:",IDT_1724,168,72,15,8
LTEXT "LUN:",IDT_1724,168,73,15,8
COMBOBOX IDC_COMBO_HD_CHANNEL_IDE,134,71,77,12,CBS_DROPDOWNLIST |
WS_VSCROLL | WS_TABSTOP
LTEXT "Progress:",IDT_1752,7,7,204,9
@@ -537,7 +537,7 @@ BEGIN
LTEXT "Floppy drives:",IDT_1737,7,7,43,8
COMBOBOX IDC_COMBO_FD_TYPE,33,85,90,12,CBS_DROPDOWNLIST |
WS_VSCROLL | WS_TABSTOP
LTEXT "Type:",IDT_1738,7,86,24,8
LTEXT "Type:",IDT_1738,7,87,24,8
CONTROL "Turbo timings",IDC_CHECKTURBO,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,131,86,64,10
CONTROL "Check BPB",IDC_CHECKBPB,"Button",
@@ -554,34 +554,37 @@ BEGIN
LTEXT "CD-ROM drives:",IDT_1739,7,7,50,8
COMBOBOX IDC_COMBO_CD_BUS,33,85,90,12,CBS_DROPDOWNLIST |
WS_VSCROLL | WS_TABSTOP
LTEXT "Bus:",IDT_1740,7,86,24,8
LTEXT "Bus:",IDT_1740,7,87,24,8
COMBOBOX IDC_COMBO_CD_ID,170,85,22,12,CBS_DROPDOWNLIST |
WS_VSCROLL | WS_TABSTOP
LTEXT "ID:",IDT_1741,131,86,38,8
LTEXT "ID:",IDT_1741,131,87,38,8
COMBOBOX IDC_COMBO_CD_LUN,239,85,22,12,CBS_DROPDOWNLIST |
WS_VSCROLL | WS_TABSTOP
LTEXT "LUN:",IDT_1742,200,86,38,8
LTEXT "LUN:",IDT_1742,200,87,38,8
COMBOBOX IDC_COMBO_CD_CHANNEL_IDE,170,85,90,12,CBS_DROPDOWNLIST |
WS_VSCROLL | WS_TABSTOP
LTEXT "Channel:",IDT_1743,131,86,38,8
LTEXT "Channel:",IDT_1743,131,87,38,8
COMBOBOX IDC_COMBO_CD_SPEED,33,105,90,12,CBS_DROPDOWNLIST |
WS_VSCROLL | WS_TABSTOP
LTEXT "Speed:",IDT_1758,7,107,24,8
CONTROL "List1",IDC_LIST_ZIP_DRIVES,"SysListView32",LVS_REPORT |
LVS_SHOWSELALWAYS | LVS_SINGLESEL | WS_BORDER |
WS_TABSTOP,7,117,253,60
LTEXT "ZIP drives:",IDT_1739,7,107,50,8
COMBOBOX IDC_COMBO_ZIP_BUS,33,184,90,12,CBS_DROPDOWNLIST |
WS_TABSTOP,7,137,253,60
LTEXT "ZIP drives:",IDT_1739,7,127,50,8
COMBOBOX IDC_COMBO_ZIP_BUS,73,204,90,12,CBS_DROPDOWNLIST |
WS_VSCROLL | WS_TABSTOP
LTEXT "Bus:",IDT_1753,7,185,24,8
COMBOBOX IDC_COMBO_ZIP_ID,170,184,22,12,CBS_DROPDOWNLIST |
LTEXT "Bus:",IDT_1753,57,206,14,8
COMBOBOX IDC_COMBO_ZIP_ID,190,204,22,12,CBS_DROPDOWNLIST |
WS_VSCROLL | WS_TABSTOP
LTEXT "ID:",IDT_1754,131,185,38,8
COMBOBOX IDC_COMBO_ZIP_LUN,239,184,22,12,CBS_DROPDOWNLIST |
LTEXT "ID:",IDT_1754,171,206,18,8
COMBOBOX IDC_COMBO_ZIP_LUN,239,204,22,12,CBS_DROPDOWNLIST |
WS_VSCROLL | WS_TABSTOP
LTEXT "LUN:",IDT_1755,200,185,38,8
COMBOBOX IDC_COMBO_ZIP_CHANNEL_IDE,170,184,90,12,CBS_DROPDOWNLIST |
LTEXT "LUN:",IDT_1755,220,206,18,8
COMBOBOX IDC_COMBO_ZIP_CHANNEL_IDE,200,204,60,12,CBS_DROPDOWNLIST |
WS_VSCROLL | WS_TABSTOP
LTEXT "Channel:",IDT_1756,131,185,38,8
LTEXT "Channel:",IDT_1756,171,206,28,8
CONTROL "ZIP 250",IDC_CHECK250,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,7,204,64,10
BS_AUTOCHECKBOX | WS_TABSTOP,7,204,44,10
END
@@ -955,6 +958,7 @@ BEGIN
IDS_2175 "ZIP images (*.IM?;*.ZDI)\0*.IM?;*.ZDI\0All files (*.*)\0*.*\0"
IDS_2176 "ZIP images (*.IM?;*.ZDI)\0*.IM?;*.ZDI\0"
IDS_2177 "ZIP %i (%03i): %ls"
IDS_2178 "Speed"
IDS_4096 "Hard disk (%s)"
IDS_4097 "%01i:%01i"

View File

@@ -8,7 +8,7 @@
*
* Windows resource defines.
*
* Version: @(#)resource.h 1.0.21 2018/02/11
* Version: @(#)resource.h 1.0.22 2018/03/06
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -90,6 +90,7 @@
#define IDT_1755 1755 /* LUN: */
#define IDT_1756 1756 /* Channel: */
#define IDT_1757 1757 /* Progress: */
#define IDT_1758 1758 /* Speed: */
/*
@@ -195,6 +196,7 @@
#define IDC_COMBO_ZIP_LUN 1163
#define IDC_COMBO_ZIP_CHANNEL_IDE 1164
#define IDC_CHECK250 1165
#define IDC_COMBO_CD_SPEED 1166
#define IDC_SLIDER_GAIN 1180 /* sound gain dialog */

View File

@@ -8,7 +8,7 @@
*
* Windows 86Box Settings dialog handler.
*
* Version: @(#)win_settings.c 1.0.40 2018/03/06
* Version: @(#)win_settings.c 1.0.41 2018/03/07
*
* Author: Miran Grca, <mgrca8@gmail.com>
*
@@ -3961,6 +3961,7 @@ static BOOL win_settings_cdrom_drives_recalc_list(HWND hwndList)
{
fsid = combo_id_to_format_string_id(temp_cdrom_drives[i].bus_type);
lvI.iSubItem = 0;
switch (temp_cdrom_drives[i].bus_type)
{
case CDROM_BUS_DISABLED:
@@ -3989,6 +3990,21 @@ static BOOL win_settings_cdrom_drives_recalc_list(HWND hwndList)
if (ListView_InsertItem(hwndList, &lvI) == -1)
return FALSE;
lvI.iSubItem = 1;
if (temp_cdrom_drives[i].bus_type == CDROM_BUS_DISABLED)
lvI.pszText = plat_get_string(IDS_2152);
else {
wsprintf(szText, L"%ix", temp_cdrom_drives[i].speed);
lvI.pszText = szText;
}
lvI.iItem = i;
lvI.iImage = 0;
if (ListView_SetItem(hwndList, &lvI) == -1)
{
return FALSE;
}
}
return TRUE;
@@ -4102,7 +4118,7 @@ static BOOL win_settings_cdrom_drives_init_columns(HWND hwndList)
lvc.iSubItem = 0;
lvc.pszText = plat_get_string(IDS_2082);
lvc.cx = 392;
lvc.cx = 342;
lvc.fmt = LVCFMT_LEFT;
if (ListView_InsertColumn(hwndList, 0, &lvc) == -1)
@@ -4110,6 +4126,17 @@ static BOOL win_settings_cdrom_drives_init_columns(HWND hwndList)
return FALSE;
}
lvc.iSubItem = 1;
lvc.pszText = plat_get_string(IDS_2178);
lvc.cx = 50;
lvc.fmt = LVCFMT_LEFT;
if (ListView_InsertColumn(hwndList, 1, &lvc) == -1)
{
return FALSE;
}
return TRUE;
}
@@ -4130,7 +4157,6 @@ static BOOL win_settings_zip_drives_init_columns(HWND hwndList)
return FALSE;
}
lvc.iSubItem = 1;
lvc.pszText = plat_get_string(IDS_2143);
@@ -4294,6 +4320,21 @@ static void win_settings_cdrom_drives_update_item(HWND hwndList, int i)
{
return;
}
lvI.iSubItem = 1;
if (temp_cdrom_drives[i].bus_type == CDROM_BUS_DISABLED)
lvI.pszText = plat_get_string(IDS_2152);
else {
wsprintf(szText, L"%ix", temp_cdrom_drives[i].speed);
lvI.pszText = szText;
}
lvI.iItem = i;
lvI.iImage = 0;
if (ListView_SetItem(hwndList, &lvI) == -1)
{
return;
}
}
static void win_settings_zip_drives_update_item(HWND hwndList, int i)
@@ -4367,6 +4408,13 @@ static void cdrom_add_locations(HWND hdlg)
}
}
h = GetDlgItem(hdlg, IDC_COMBO_CD_SPEED);
for (i = 1; i <= 52; i++)
{
wsprintf(lptsTemp, L"%ix", i);
SendMessage(h, CB_ADDSTRING, 0, (LPARAM) lptsTemp);
}
h = GetDlgItem(hdlg, IDC_COMBO_CD_ID);
for (i = 0; i < 16; i++)
{
@@ -4390,6 +4438,7 @@ static void cdrom_add_locations(HWND hdlg)
free(lptsTemp);
}
static void cdrom_recalc_location_controls(HWND hdlg, int assign_id)
{
int i = 0;
@@ -4416,6 +4465,16 @@ static void cdrom_recalc_location_controls(HWND hdlg, int assign_id)
EnableWindow(h, FALSE);
ShowWindow(h, SW_HIDE);
h = GetDlgItem(hdlg, IDC_COMBO_CD_SPEED);
if (bus == CDROM_BUS_DISABLED) {
EnableWindow(h, FALSE);
ShowWindow(h, SW_HIDE);
} else {
ShowWindow(h, SW_SHOW);
EnableWindow(h, TRUE);
SendMessage(h, CB_SETCURSEL, temp_cdrom_drives[cdlv_current_sel].speed - 1, 0);
}
switch(bus)
{
case CDROM_BUS_ATAPI_PIO_ONLY: /* ATAPI (PIO-only) */
@@ -4496,6 +4555,7 @@ static void zip_add_locations(HWND hdlg)
free(lptsTemp);
}
static void zip_recalc_location_controls(HWND hdlg, int assign_id)
{
int i = 0;
@@ -4969,6 +5029,8 @@ win_settings_other_removable_devices_proc(HWND hdlg, UINT message, WPARAM wParam
}
cdrom_untrack(cdlv_current_sel);
assign = (temp_cdrom_drives[cdlv_current_sel].bus_type == b2) ? 0 : 1;
if (temp_cdrom_drives[cdlv_current_sel].bus_type == CDROM_BUS_DISABLED)
temp_cdrom_drives[cdlv_current_sel].speed = 8;
if ((b2 == CDROM_BUS_ATAPI_PIO_ONLY) && (temp_cdrom_drives[cdlv_current_sel].bus_type == CDROM_BUS_ATAPI_PIO_AND_DMA))
assign = 0;
else if ((b2 == CDROM_BUS_ATAPI_PIO_AND_DMA) && (temp_cdrom_drives[cdlv_current_sel].bus_type == CDROM_BUS_ATAPI_PIO_ONLY))
@@ -5030,6 +5092,20 @@ cdrom_bus_skip:
rd_ignore_change = 0;
return FALSE;
case IDC_COMBO_CD_SPEED:
if (rd_ignore_change)
{
return FALSE;
}
rd_ignore_change = 1;
h = GetDlgItem(hdlg, IDC_COMBO_CD_SPEED);
temp_cdrom_drives[cdlv_current_sel].speed = SendMessage(h, CB_GETCURSEL, 0, 0) + 1;
h = GetDlgItem(hdlg, IDC_LIST_CDROM_DRIVES);
win_settings_cdrom_drives_update_item(h, cdlv_current_sel);
rd_ignore_change = 0;
return FALSE;
case IDC_COMBO_ZIP_BUS:
if (rd_ignore_change)
{