Brought the ISA memory card emulation and some other things up to par with VARCem and fixed the ISA memory card configuration.

This commit is contained in:
OBattler
2018-09-06 14:38:43 +02:00
parent 9a180ed33c
commit ea5a226a97
9 changed files with 267 additions and 265 deletions

View File

@@ -1,4 +1,4 @@
/*
/*
* 86Box A hypervisor and IBM PC system emulator that specializes in
* running old operating systems and software designed for IBM
* PC systems and compatibles from 1981 through fairly recent
@@ -8,7 +8,7 @@
*
* Application resource script for Windows.
*
* Version: @(#)86Box.rc 1.0.41 2018/09/02
* Version: @(#)86Box.rc 1.0.42 2018/09/06
*
* Authors: Miran Grca, <mgrca8@gmail.com>
* Fred N. van Kempen, <decwiz@yahoo.com>
@@ -888,6 +888,7 @@ BEGIN
IDS_2116 "%u MB (CHS: %i, %i, %i)"
IDS_2117 "Floppy %i (%s): %ls"
IDS_2118 "All images (*.0??;*.1??;*.??0;*.86F;*.BIN;*.CQ?;*.DDI;*.DSK;*.FLP;*.HDM;*.IM?;*.JSON;*.TD0;*.*FD?;*.XDF)\0*.0??;*.1??;*.??0;*.86F;*.BIN;*.CQ?;*.DDI;*.DSK;*.FLP;*.HDM;*.IM?;*.JSON;*.TD0;*.*FD?;*.XDF\0Advanced sector images (*.IMD;*.JSON;*.TD0)\0*.IMD;*.JSON;*.TD0\0Basic sector images (*.0??;*.1??;*.??0;*.BIN;*.CQ?;*.DDI;*.DSK;*.FLP;*.HDM;*.IM?;*.XDF;*.*FD?)\0*.0??;*.1??;*.??0;*.BIN;*.CQ?;*.DDI;*.DSK;*.FLP;*.HDM;*.IM?;*.XDF;*.*FD?\0Flux images (*.FDI)\0*.FDI\0Surface images (*.86F)\0*.86F\0All files (*.*)\0*.*\0"
IDS_2119 "You must save the settings first before attempting to configure the memory boards"
END
STRINGTABLE DISCARDABLE

View File

@@ -8,7 +8,7 @@
*
* Windows 86Box Settings dialog handler.
*
* Version: @(#)win_settings.c 1.0.55 2018/09/03
* Version: @(#)win_settings.c 1.0.56 2018/09/06
*
* Authors: Miran Grca, <mgrca8@gmail.com>
* David Hrdlička, <hrdlickadavid@outlook.com>
@@ -1493,6 +1493,8 @@ win_settings_peripherals_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lPa
int c, d, e, temp_hdc_type;
LPTSTR lptsTemp;
const device_t *scsi_dev;
const device_t *dev;
char *s;
switch (message) {
case WM_INITDIALOG:
@@ -1563,7 +1565,7 @@ win_settings_peripherals_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lPa
e = 0;
h = GetDlgItem(hdlg, IDC_COMBO_ISARTC);
for (d = 0; ; d++) {
char *s = isartc_get_name(d);
s = isartc_get_name(d);
if (!s[0])
break;
@@ -1589,26 +1591,21 @@ win_settings_peripherals_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lPa
/* Populate the ISA memory card dropdowns. */
for (c = 0; c < ISAMEM_MAX; c++) {
e = 0;
h = GetDlgItem(hdlg, IDC_COMBO_ISAMEM_1 + c);
for (d = 0; ; d++) {
char *s = isamem_get_name(d);
if (!s[0])
s = (char *) isamem_get_internal_name(d);
if (s == NULL)
break;
settings_device_to_list[2 + c][d] = e;
if (d == 0) {
/* Translate "None". */
SendMessage(h, CB_ADDSTRING, 0, win_get_string(IDS_2112));
SendMessage(h, CB_ADDSTRING, 0,
(LPARAM)win_get_string(IDS_2112));
} else {
s = (char *) isamem_get_name(d);
mbstowcs(lptsTemp, s, strlen(s) + 1);
SendMessage(h, CB_ADDSTRING, 0, (LPARAM) lptsTemp);
SendMessage(h, CB_ADDSTRING, 0, (LPARAM)lptsTemp);
}
settings_list_to_device[2 + c][e] = d;
e++;
}
SendMessage(h, CB_SETCURSEL, temp_isamem[c], 0);
h = GetDlgItem(hdlg, IDC_CONFIGURE_ISAMEM_1 + c);
@@ -1617,7 +1614,7 @@ win_settings_peripherals_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lPa
else
EnableWindow(h, FALSE);
}
free(lptsTemp);
return TRUE;
@@ -1675,76 +1672,31 @@ win_settings_peripherals_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lPa
EnableWindow(h, FALSE);
break;
case IDC_CONFIGURE_ISAMEM_1:
h = GetDlgItem(hdlg, IDC_COMBO_ISAMEM_1);
temp_isamem[0] = settings_list_to_device[2][SendMessage(h, CB_GETCURSEL, 0, 0)];
temp_deviceconfig |= deviceconfig_open(hdlg, (void *)isamem_get_device(temp_isamem[0]));
break;
case IDC_CONFIGURE_ISAMEM_2:
h = GetDlgItem(hdlg, IDC_COMBO_ISAMEM_2);
temp_isamem[1] = settings_list_to_device[3][SendMessage(h, CB_GETCURSEL, 0, 0)];
temp_deviceconfig |= deviceconfig_open(hdlg, (void *)isamem_get_device(temp_isamem[1]));
break;
case IDC_CONFIGURE_ISAMEM_3:
h = GetDlgItem(hdlg, IDC_COMBO_ISAMEM_3);
temp_isamem[2] = settings_list_to_device[4][SendMessage(h, CB_GETCURSEL, 0, 0)];
temp_deviceconfig |= deviceconfig_open(hdlg, (void *)isamem_get_device(temp_isamem[2]));
break;
case IDC_CONFIGURE_ISAMEM_4:
h = GetDlgItem(hdlg, IDC_COMBO_ISAMEM_4);
temp_isamem[3] = settings_list_to_device[5][SendMessage(h, CB_GETCURSEL, 0, 0)];
temp_deviceconfig |= deviceconfig_open(hdlg, (void *)isamem_get_device(temp_isamem[3]));
break;
case IDC_COMBO_ISAMEM_1:
h = GetDlgItem(hdlg, IDC_COMBO_ISAMEM_1);
temp_isamem[0] = settings_list_to_device[2][SendMessage(h, CB_GETCURSEL, 0, 0)];
h = GetDlgItem(hdlg, IDC_CONFIGURE_ISAMEM_1);
if (temp_isamem[0] != 0)
EnableWindow(h, TRUE);
else
EnableWindow(h, FALSE);
break;
case IDC_COMBO_ISAMEM_2:
h = GetDlgItem(hdlg, IDC_COMBO_ISAMEM_2);
temp_isamem[1] = settings_list_to_device[3][SendMessage(h, CB_GETCURSEL, 0, 0)];
h = GetDlgItem(hdlg, IDC_CONFIGURE_ISAMEM_2);
if (temp_isamem[1] != 0)
EnableWindow(h, TRUE);
else
EnableWindow(h, FALSE);
break;
case IDC_COMBO_ISAMEM_3:
h = GetDlgItem(hdlg, IDC_COMBO_ISAMEM_3);
temp_isamem[2] = settings_list_to_device[4][SendMessage(h, CB_GETCURSEL, 0, 0)];
case IDC_COMBO_ISAMEM_4:
c = LOWORD(wParam) - IDC_COMBO_ISAMEM_1;
h = GetDlgItem(hdlg, LOWORD(wParam));
temp_isamem[c] = SendMessage(h, CB_GETCURSEL, 0, 0);
h = GetDlgItem(hdlg, IDC_CONFIGURE_ISAMEM_3);
if (temp_isamem[2] != 0)
h = GetDlgItem(hdlg, IDC_CONFIGURE_ISAMEM_1 + c);
if (temp_isamem[c] != 0)
EnableWindow(h, TRUE);
else
EnableWindow(h, FALSE);
break;
case IDC_COMBO_ISAMEM_4:
h = GetDlgItem(hdlg, IDC_COMBO_ISAMEM_4);
temp_isamem[3] = settings_list_to_device[5][SendMessage(h, CB_GETCURSEL, 0, 0)];
h = GetDlgItem(hdlg, IDC_CONFIGURE_ISAMEM_4);
if (temp_isamem[3] != 0)
EnableWindow(h, TRUE);
case IDC_CONFIGURE_ISAMEM_1:
case IDC_CONFIGURE_ISAMEM_2:
case IDC_CONFIGURE_ISAMEM_3:
case IDC_CONFIGURE_ISAMEM_4:
c = LOWORD(wParam) - IDC_CONFIGURE_ISAMEM_1;
dev = isamem_get_device(c);
if (dev != NULL)
temp_deviceconfig |= deviceconfig_open(hdlg, (void *)dev);
else
EnableWindow(h, FALSE);
ui_msgbox(MBX_INFO, (wchar_t *)IDS_2119);
break;
case IDC_CHECK_IDE_TER:
@@ -1787,11 +1739,6 @@ win_settings_peripherals_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lPa
h = GetDlgItem(hdlg, IDC_COMBO_ISARTC);
temp_isartc = settings_list_to_device[1][SendMessage(h, CB_GETCURSEL, 0, 0)];
for (e = 0; e < ISAMEM_MAX; e++) {
h = GetDlgItem(hdlg, IDC_COMBO_ISAMEM_1 + e);
temp_isamem[e] = settings_list_to_device[2 + e][SendMessage(h, CB_GETCURSEL, 0, 0)];
}
h = GetDlgItem(hdlg, IDC_CHECK_IDE_TER);
temp_ide_ter = SendMessage(h, BM_GETCHECK, 0, 0);