Limit the selection of ISA RTCs, memory expansions and the ISABugger to machines with the ISA bus available
This commit is contained in:
@@ -4905,21 +4905,25 @@ win_settings_peripherals_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lPa
|
|||||||
|
|
||||||
if (!device_name[0])
|
if (!device_name[0])
|
||||||
break;
|
break;
|
||||||
|
dev = isartc_get_device(d);
|
||||||
if (d == 0) {
|
if (device_is_valid(dev, temp_machine)) {
|
||||||
settings_add_string(hdlg, IDC_COMBO_ISARTC, win_get_string(IDS_2103));
|
if (d == 0) {
|
||||||
settings_set_cur_sel(hdlg, IDC_COMBO_ISARTC, 0);
|
settings_add_string(hdlg, IDC_COMBO_ISARTC, win_get_string(IDS_2103));
|
||||||
} else
|
settings_set_cur_sel(hdlg, IDC_COMBO_ISARTC, 0);
|
||||||
settings_add_string(hdlg, IDC_COMBO_ISARTC, (LPARAM) device_name);
|
} else
|
||||||
settings_list_to_device[1][e] = d;
|
settings_add_string(hdlg, IDC_COMBO_ISARTC, (LPARAM) device_name);
|
||||||
if (d == temp_isartc)
|
settings_list_to_device[1][e] = d;
|
||||||
settings_set_cur_sel(hdlg, IDC_COMBO_ISARTC, e);
|
if (d == temp_isartc)
|
||||||
e++;
|
settings_set_cur_sel(hdlg, IDC_COMBO_ISARTC, e);
|
||||||
|
e++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
settings_enable_window(hdlg, IDC_CONFIGURE_ISARTC, temp_isartc != 0);
|
settings_enable_window(hdlg, IDC_COMBO_ISARTC, machine_has_bus(temp_machine, MACHINE_BUS_ISA));
|
||||||
|
settings_enable_window(hdlg, IDC_CONFIGURE_ISARTC, ((temp_isartc != 0) && machine_has_bus(temp_machine, MACHINE_BUS_ISA)));
|
||||||
|
|
||||||
/* Populate the ISA memory card dropdowns. */
|
/* Populate the ISA memory card dropdowns. */
|
||||||
for (c = 0; c < ISAMEM_MAX; c++) {
|
for (c = 0; c < ISAMEM_MAX; c++) {
|
||||||
|
e = 0;
|
||||||
settings_reset_content(hdlg, IDC_COMBO_ISAMEM_1 + c);
|
settings_reset_content(hdlg, IDC_COMBO_ISAMEM_1 + c);
|
||||||
for (d = 0; ; d++) {
|
for (d = 0; ; d++) {
|
||||||
generate_device_name(isamem_get_device(d), (char *) isamem_get_internal_name(d), 0);
|
generate_device_name(isamem_get_device(d), (char *) isamem_get_internal_name(d), 0);
|
||||||
@@ -4927,16 +4931,24 @@ win_settings_peripherals_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lPa
|
|||||||
if (!device_name[0])
|
if (!device_name[0])
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (d == 0) {
|
dev = isamem_get_device(d);
|
||||||
settings_add_string(hdlg, IDC_COMBO_ISAMEM_1 + c, win_get_string(IDS_2103));
|
if (device_is_valid(dev, temp_machine)) {
|
||||||
settings_set_cur_sel(hdlg, IDC_COMBO_ISAMEM_1 + c, 0);
|
if (d == 0) {
|
||||||
} else
|
settings_add_string(hdlg, IDC_COMBO_ISAMEM_1 + c, win_get_string(IDS_2103));
|
||||||
settings_add_string(hdlg, IDC_COMBO_ISAMEM_1 + c, (LPARAM) device_name);
|
settings_set_cur_sel(hdlg, IDC_COMBO_ISAMEM_1 + c, 0);
|
||||||
|
} else
|
||||||
|
settings_add_string(hdlg, IDC_COMBO_ISAMEM_1 + c, (LPARAM) device_name);
|
||||||
|
settings_list_to_device[0][e] = d;
|
||||||
|
if (d == temp_isamem[c])
|
||||||
|
settings_set_cur_sel(hdlg, IDC_COMBO_ISAMEM_1 + c, e);
|
||||||
|
e++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
settings_set_cur_sel(hdlg, IDC_COMBO_ISAMEM_1 + c, temp_isamem[c]);
|
settings_enable_window(hdlg, IDC_COMBO_ISAMEM_1 + c, machine_has_bus(temp_machine, MACHINE_BUS_ISA));
|
||||||
settings_enable_window(hdlg, IDC_CONFIGURE_ISAMEM_1 + c, temp_isamem[c] != 0);
|
settings_enable_window(hdlg, IDC_CONFIGURE_ISAMEM_1 + c, ((temp_isamem[c] != 0) && machine_has_bus(temp_machine, MACHINE_BUS_ISA)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
settings_enable_window(hdlg, IDC_CHECK_BUGGER, machine_has_bus(temp_machine, MACHINE_BUS_ISA));
|
||||||
settings_set_check(hdlg, IDC_CHECK_BUGGER, temp_bugger);
|
settings_set_check(hdlg, IDC_CHECK_BUGGER, temp_bugger);
|
||||||
settings_set_check(hdlg, IDC_CHECK_POSTCARD, temp_postcard);
|
settings_set_check(hdlg, IDC_CHECK_POSTCARD, temp_postcard);
|
||||||
|
|
||||||
@@ -4960,21 +4972,23 @@ win_settings_peripherals_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lPa
|
|||||||
case IDC_COMBO_ISAMEM_1: case IDC_COMBO_ISAMEM_2:
|
case IDC_COMBO_ISAMEM_1: case IDC_COMBO_ISAMEM_2:
|
||||||
case IDC_COMBO_ISAMEM_3: case IDC_COMBO_ISAMEM_4:
|
case IDC_COMBO_ISAMEM_3: case IDC_COMBO_ISAMEM_4:
|
||||||
c = LOWORD(wParam) - IDC_COMBO_ISAMEM_1;
|
c = LOWORD(wParam) - IDC_COMBO_ISAMEM_1;
|
||||||
temp_isamem[c] = settings_get_cur_sel(hdlg, LOWORD(wParam));
|
temp_isamem[c] = settings_list_to_device[0][settings_get_cur_sel(hdlg, LOWORD(wParam))];
|
||||||
settings_enable_window(hdlg, IDC_CONFIGURE_ISAMEM_1 + c, temp_isamem[c] != 0);
|
settings_enable_window(hdlg, IDC_CONFIGURE_ISAMEM_1 + c, temp_isamem[c] != 0);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case IDC_CONFIGURE_ISAMEM_1: case IDC_CONFIGURE_ISAMEM_2:
|
case IDC_CONFIGURE_ISAMEM_1: case IDC_CONFIGURE_ISAMEM_2:
|
||||||
case IDC_CONFIGURE_ISAMEM_3: case IDC_CONFIGURE_ISAMEM_4:
|
case IDC_CONFIGURE_ISAMEM_3: case IDC_CONFIGURE_ISAMEM_4:
|
||||||
c = LOWORD(wParam) - IDC_CONFIGURE_ISAMEM_1;
|
c = LOWORD(wParam) - IDC_CONFIGURE_ISAMEM_1;
|
||||||
dev = isamem_get_device(temp_isamem[c]);
|
temp_deviceconfig |= deviceconfig_inst_open(hdlg, (void *)isamem_get_device(temp_isamem[c]), c + 1);
|
||||||
temp_deviceconfig |= deviceconfig_inst_open(hdlg, (void *)dev, c + 1);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
case WM_SAVESETTINGS:
|
case WM_SAVESETTINGS:
|
||||||
temp_isartc = settings_list_to_device[1][settings_get_cur_sel(hdlg, IDC_COMBO_ISARTC)];
|
temp_isartc = settings_list_to_device[1][settings_get_cur_sel(hdlg, IDC_COMBO_ISARTC)];
|
||||||
|
for (c = 0; c < ISAMEM_MAX; c++) {
|
||||||
|
temp_isamem[c] = settings_list_to_device[0][settings_get_cur_sel(hdlg, IDC_COMBO_ISAMEM_1 + c)];
|
||||||
|
}
|
||||||
temp_bugger = settings_get_check(hdlg, IDC_CHECK_BUGGER);
|
temp_bugger = settings_get_check(hdlg, IDC_CHECK_BUGGER);
|
||||||
temp_postcard = settings_get_check(hdlg, IDC_CHECK_POSTCARD);
|
temp_postcard = settings_get_check(hdlg, IDC_CHECK_POSTCARD);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user