Changes to allow for auto- or selectable Internal HD controller, and some other minor changes.

This commit is contained in:
waltje
2017-10-01 16:29:15 -04:00
parent f21fc0ca44
commit 2dbf5409c0
35 changed files with 374 additions and 254 deletions

View File

@@ -8,7 +8,7 @@
*
* Windows resource script.
*
* Version: @(#)86Box.rc 1.0.10 2017/09/23
* Version: @(#)86Box.rc 1.0.11 2017/09/30
*
* Authors: Miran Grca, <mgrca8@gmail.com>
* Fred N. van Kempen, <decwiz@yahoo.com>
@@ -833,7 +833,7 @@ BEGIN
IDS_2151 "Disabled"
IDS_2152 "None"
IDS_2153 "AT Fixed Disk Adapter"
IDS_2154 "Internal IDE"
IDS_2154 "Internal Controller"
IDS_2155 "IRQ %i"
IDS_2156 "%" PRIu64
IDS_2157 "%" PRIu64 " MB (CHS: %" PRIu64 ", %" PRIu64 ", %" PRIu64 ")"

View File

@@ -8,7 +8,7 @@
*
* The Emulator's Windows core.
*
* Version: @(#)win.c 1.0.13 2017/09/29
* Version: @(#)win.c 1.0.13 2017/09/30
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -1110,7 +1110,7 @@ int display_network_icon(void)
void update_status_bar_panes(HWND hwnds)
{
int i, id;
int i, id, hdint;
int edge = 0;
int c_mfm = 0;
@@ -1119,20 +1119,19 @@ void update_status_bar_panes(HWND hwnds)
int c_ide_pio = 0;
int c_ide_dma = 0;
int c_scsi = 0;
#ifdef USE_NETWORK
int do_net = 0;
#endif
sb_ready = 0;
hdint = (machines[machine].flags & MACHINE_HAS_HDC) ? 1 : 0;
c_mfm = hdd_count(HDD_BUS_MFM);
c_esdi = hdd_count(HDD_BUS_ESDI);
c_xtide = hdd_count(HDD_BUS_XTIDE);
c_ide_pio = hdd_count(HDD_BUS_IDE_PIO_ONLY);
c_ide_dma = hdd_count(HDD_BUS_IDE_PIO_AND_DMA);
c_scsi = hdd_count(HDD_BUS_SCSI);
#ifdef USE_NETWORK
do_net = display_network_icon();
#endif
@@ -1182,11 +1181,15 @@ void update_status_bar_panes(HWND hwnds)
}
for (i = 0; i < CDROM_NUM; i++)
{
if ((cdrom_drives[i].bus_type == CDROM_BUS_ATAPI_PIO_ONLY) && !(machines[machine].flags & MACHINE_HAS_IDE))
/* Could be Internal or External IDE.. */
if ((cdrom_drives[i].bus_type==CDROM_BUS_ATAPI_PIO_ONLY) &&
!(hdint || !memcmp(hdc_name, "ide", 3)))
{
continue;
}
if ((cdrom_drives[i].bus_type == CDROM_BUS_ATAPI_PIO_AND_DMA) && !(machines[machine].flags & MACHINE_HAS_IDE))
/* Could be Internal or External IDE.. */
if ((cdrom_drives[i].bus_type==CDROM_BUS_ATAPI_PIO_AND_DMA) &&
!(hdint || !memcmp(hdc_name, "ide", 3)))
{
continue;
}
@@ -1206,24 +1209,28 @@ void update_status_bar_panes(HWND hwnds)
sb_parts++;
}
}
if (c_mfm && !(machines[machine].flags & MACHINE_HAS_IDE) && !!memcmp(hdc_name, "none", 4) && !!memcmp(hdc_name, "xtide", 5) && !!memcmp(hdc_name, "esdi", 4))
if (c_mfm && (hdint || !memcmp(hdc_name, "mfm", 3)))
{
/* MFM drives, and MFM or Internal controller. */
sb_parts++;
}
if (c_esdi && !memcmp(hdc_name, "esdi", 4))
if (c_esdi && (hdint || !memcmp(hdc_name, "esdi", 4)))
{
/* ESDI drives, and ESDI or Internal controller. */
sb_parts++;
}
if (c_xtide && !memcmp(hdc_name, "xtide", 5))
{
sb_parts++;
}
if (c_ide_pio && (machines[machine].flags & MACHINE_HAS_IDE))
if (c_ide_pio && (hdint || !memcmp(hdc_name, "ide", 3)))
{
/* IDE_PIO drives, and IDE or Internal controller. */
sb_parts++;
}
if (c_ide_dma && (machines[machine].flags & MACHINE_HAS_IDE))
if (c_ide_dma && (hdint || !memcmp(hdc_name, "ide", 3)))
{
/* IDE_DMA drives, and IDE or Internal controller. */
sb_parts++;
}
if (c_scsi && (scsi_card_current != 0))
@@ -1267,11 +1274,15 @@ void update_status_bar_panes(HWND hwnds)
}
for (i = 0; i < CDROM_NUM; i++)
{
if ((cdrom_drives[i].bus_type == CDROM_BUS_ATAPI_PIO_ONLY) && !(machines[machine].flags & MACHINE_HAS_IDE))
/* Could be Internal or External IDE.. */
if ((cdrom_drives[i].bus_type==CDROM_BUS_ATAPI_PIO_ONLY) &&
!(hdint || !memcmp(hdc_name, "ide", 3)))
{
continue;
}
if ((cdrom_drives[i].bus_type == CDROM_BUS_ATAPI_PIO_AND_DMA) && !(machines[machine].flags & MACHINE_HAS_IDE))
/* Could be Internal or External IDE.. */
if ((cdrom_drives[i].bus_type==CDROM_BUS_ATAPI_PIO_AND_DMA) &&
!(hdint || !memcmp(hdc_name, "ide", 3)))
{
continue;
}
@@ -1297,14 +1308,14 @@ void update_status_bar_panes(HWND hwnds)
sb_parts++;
}
}
if (c_mfm && !(machines[machine].flags & MACHINE_HAS_IDE) && !!memcmp(hdc_name, "none", 4) && !!memcmp(hdc_name, "xtide", 5) && !!memcmp(hdc_name, "esdi", 4))
if (c_mfm && (hdint || !memcmp(hdc_name, "mfm", 3)))
{
edge += SB_ICON_WIDTH;
iStatusWidths[sb_parts] = edge;
sb_part_meanings[sb_parts] = SB_HDD | HDD_BUS_MFM;
sb_parts++;
}
if (c_esdi && !memcmp(hdc_name, "esdi", 4))
if (c_esdi && (hdint || !memcmp(hdc_name, "esdi", 4)))
{
edge += SB_ICON_WIDTH;
iStatusWidths[sb_parts] = edge;
@@ -1318,14 +1329,14 @@ void update_status_bar_panes(HWND hwnds)
sb_part_meanings[sb_parts] = SB_HDD | HDD_BUS_XTIDE;
sb_parts++;
}
if (c_ide_pio && (machines[machine].flags & MACHINE_HAS_IDE))
if (c_ide_pio && (hdint || !memcmp(hdc_name, "ide", 3)))
{
edge += SB_ICON_WIDTH;
iStatusWidths[sb_parts] = edge;
sb_part_meanings[sb_parts] = SB_HDD | HDD_BUS_IDE_PIO_ONLY;
sb_parts++;
}
if (c_ide_dma && (machines[machine].flags & MACHINE_HAS_IDE))
if (c_ide_dma && (hdint || !memcmp(hdc_name, "ide", 3)))
{
edge += SB_ICON_WIDTH;
iStatusWidths[sb_parts] = edge;

View File

@@ -8,7 +8,7 @@
*
* Windows 86Box Settings dialog handler.
*
* Version: @(#)win_settings.c 1.0.14 2017/09/29
* Version: @(#)win_settings.c 1.0.14 2017/09/30
*
* Author: Miran Grca, <mgrca8@gmail.com>
* Copyright 2016,2017 Miran Grca.
@@ -82,8 +82,9 @@ static int temp_serial[2], temp_lpt;
/* Peripherals category */
static int temp_scsi_card, hdc_ignore, temp_ide_ter, temp_ide_ter_irq, temp_ide_qua, temp_ide_qua_irq;
static int temp_bugger;
static char temp_hdc_name[16];
static char *hdc_names[16];
static int temp_bugger;
/* Hard disks category */
static hard_disk_t temp_hdd[HDD_NUM];
@@ -96,8 +97,6 @@ static cdrom_drive_t temp_cdrom_drives[CDROM_NUM];
static HWND hwndParentDialog, hwndChildDialog;
int hdd_controller_current;
static int displayed_category = 0;
extern int is486;
@@ -109,7 +108,6 @@ static int settings_scsi_to_list[20], settings_list_to_scsi[20];
#ifdef USE_NETWORK
static int settings_network_to_list[20], settings_list_to_network[20];
#endif
static char *hdc_names[16];
/* This does the initial read of global variables into the temporary ones. */
@@ -1385,7 +1383,7 @@ static BOOL CALLBACK win_settings_ports_proc(HWND hdlg, UINT message, WPARAM wPa
}
static void recalc_hdd_list(HWND hdlg, int machine, int use_selected_hdc)
static void recalc_hdc_list(HWND hdlg, int machine, int use_selected_hdc)
{
HWND h;
@@ -1400,17 +1398,25 @@ static void recalc_hdd_list(HWND hdlg, int machine, int use_selected_hdc)
h = GetDlgItem(hdlg, IDC_COMBO_HDC);
if (machines[temp_machine].flags & MACHINE_HAS_IDE)
#if 0
/*
* We do not ignore this entry, nor do we zap the selection
* list, as we might want to override the internal controller
* with an external one. --FvK
*/
if (machines[temp_machine].flags & MACHINE_HAS_HDC)
{
hdc_ignore = 1;
SendMessage(h, CB_RESETCONTENT, 0, 0);
SendMessage(h, CB_ADDSTRING, 0, (LPARAM) win_language_get_string_from_id(IDS_2154));
/* See above, don't disable it. */
EnableWindow(h, FALSE);
SendMessage(h, CB_SETCURSEL, 0, 0);
SendMessage(h, CB_SETCURSEL, 1, 0);
}
else
{
#endif
hdc_ignore = 0;
valid = 0;
@@ -1462,11 +1468,13 @@ static void recalc_hdd_list(HWND hdlg, int machine, int use_selected_hdc)
c++;
continue;
}
#if 0
if (c < 2)
{
SendMessage(h, CB_ADDSTRING, 0, (LPARAM) win_language_get_string_from_id(2152 + c));
}
else
#endif
{
mbstowcs(lptsTemp, s, strlen(s) + 1);
SendMessage(h, CB_ADDSTRING, 0, (LPARAM) lptsTemp);
@@ -1487,7 +1495,10 @@ static void recalc_hdd_list(HWND hdlg, int machine, int use_selected_hdc)
}
EnableWindow(h, TRUE);
#if 0
if (machines[temp_machine].flags & MACHINE_HAS_HDC)
}
#endif
free(lptsTemp);
}
@@ -1573,7 +1584,7 @@ static BOOL CALLBACK win_settings_peripherals_proc(HWND hdlg, UINT message, WPAR
EnableWindow(h, FALSE);
}
recalc_hdd_list(hdlg, temp_machine, 0);
recalc_hdc_list(hdlg, temp_machine, 0);
h=GetDlgItem(hdlg, IDC_COMBO_IDE_TER);
SendMessage(h, CB_ADDSTRING, 0, (LPARAM) win_language_get_string_from_id(IDS_5376));
@@ -1925,7 +1936,7 @@ static void normalize_hd_list()
int i, j;
j = 0;
memset(ihdd, 0, HDD_NUM * sizeof(hard_disk_t));
memset(ihdd, 0x00, HDD_NUM * sizeof(hard_disk_t));
for (i = 0; i < HDD_NUM; i++)
{