From 908ee7d0468b804e681566ff58131920673547e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Hrdli=C4=8Dka?= Date: Fri, 10 Apr 2020 15:14:34 +0200 Subject: [PATCH 1/2] win: fix confusion with LPT checkboxes/comboboxes --- src/win/win_settings.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/win/win_settings.c b/src/win/win_settings.c index 63512f6cf..a6e34420b 100644 --- a/src/win/win_settings.c +++ b/src/win/win_settings.c @@ -1438,6 +1438,9 @@ win_settings_ports_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam) h=GetDlgItem(hdlg, IDC_CHECK_PARALLEL1 + i); SendMessage(h, BM_SETCHECK, temp_lpt[i], 0); + + h = GetDlgItem(hdlg, IDC_COMBO_LPT1 + i); + EnableWindow(h, temp_lpt[i] ? TRUE : FALSE); } for (i = 0; i < 2; i++) { @@ -1449,6 +1452,27 @@ win_settings_ports_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam) return TRUE; + case WM_COMMAND: + switch (LOWORD(wParam)) { + case IDC_CHECK_PARALLEL1: + case IDC_CHECK_PARALLEL2: + case IDC_CHECK_PARALLEL3: + i = LOWORD(wParam) - IDC_CHECK_PARALLEL1; + h = GetDlgItem(hdlg, IDC_CHECK_PARALLEL1 + i); + if (SendMessage(h, BM_GETCHECK, 0, 0) == BST_CHECKED) + { + h = GetDlgItem(hdlg, IDC_COMBO_LPT1 + i); + EnableWindow(h, TRUE); + } + else + { + h = GetDlgItem(hdlg, IDC_COMBO_LPT1 + i); + EnableWindow(h, FALSE); + } + break; + } + break; + case WM_SAVESETTINGS: for (i = 0; i < 3; i++) { h = GetDlgItem(hdlg, IDC_COMBO_LPT1 + i); From 02af66f86f0293eee53fc8f802a478ad46c0eb07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Hrdli=C4=8Dka?= Date: Fri, 10 Apr 2020 15:42:31 +0200 Subject: [PATCH 2/2] PS/2 mouse absolutely requires the PS/2 connector. --- src/device.c | 2 ++ src/mouse_ps2.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/device.c b/src/device.c index d3c985f8e..9b8cd1d68 100644 --- a/src/device.c +++ b/src/device.c @@ -529,6 +529,8 @@ device_is_valid(const device_t *device, int mflags) if ((device->flags & DEVICE_AGP) && !(mflags & MACHINE_AGP)) return(0); + if ((device->flags & DEVICE_PS2) && !(mflags & MACHINE_PS2)) return(0); + return(1); } diff --git a/src/mouse_ps2.c b/src/mouse_ps2.c index 9c8fae1bf..70f60c568 100644 --- a/src/mouse_ps2.c +++ b/src/mouse_ps2.c @@ -345,7 +345,7 @@ static const device_config_t ps2_config[] = { const device_t mouse_ps2_device = { "Standard PS/2 Mouse", - 0, + DEVICE_PS2, MOUSE_TYPE_PS2, mouse_ps2_init, ps2_close, NULL, ps2_poll, NULL, NULL,