diff --git a/src/game/joystick_ch_flightstick_pro.c b/src/game/joystick_ch_flightstick_pro.c index 229ec3397..ae7539a01 100644 --- a/src/game/joystick_ch_flightstick_pro.c +++ b/src/game/joystick_ch_flightstick_pro.c @@ -87,10 +87,10 @@ joystick_if_t joystick_ch_flightstick_pro = ch_flightstick_pro_write, ch_flightstick_pro_read_axis, ch_flightstick_pro_a0_over, - 1, 3, 4, 1, + 1, {"X axis", "Y axis", "Throttle"}, {"Button 1", "Button 2", "Button 3", "Button 4"}, {"POV"} diff --git a/src/game/joystick_standard.c b/src/game/joystick_standard.c index bbce3fbf1..71be48d3b 100644 --- a/src/game/joystick_standard.c +++ b/src/game/joystick_standard.c @@ -171,8 +171,8 @@ joystick_if_t joystick_standard = joystick_standard_a0_over, 2, 2, - 2, 0, + 2, {"X axis", "Y axis"}, {"Button 1", "Button 2"} }; @@ -185,10 +185,10 @@ joystick_if_t joystick_standard_4button = joystick_standard_write, joystick_standard_read_axis_4button, joystick_standard_a0_over, - 1, 2, 4, 0, + 1, {"X axis", "Y axis"}, {"Button 1", "Button 2", "Button 3", "Button 4"} }; @@ -201,10 +201,10 @@ joystick_if_t joystick_standard_6button = joystick_standard_write, joystick_standard_read_axis_6button, joystick_standard_a0_over, - 1, 2, 6, 0, + 1, {"X axis", "Y axis"}, {"Button 1", "Button 2", "Button 3", "Button 4", "Button 5", "Button 6"} }; @@ -217,10 +217,10 @@ joystick_if_t joystick_standard_8button = joystick_standard_write, joystick_standard_read_axis_8button, joystick_standard_a0_over, - 1, 2, 8, 0, + 1, {"X axis", "Y axis"}, {"Button 1", "Button 2", "Button 3", "Button 4", "Button 5", "Button 6", "Button 7", "Button 8"} }; diff --git a/src/game/joystick_sw_pad.c b/src/game/joystick_sw_pad.c index 39fc4382d..f0bb71e75 100644 --- a/src/game/joystick_sw_pad.c +++ b/src/game/joystick_sw_pad.c @@ -244,10 +244,10 @@ joystick_if_t joystick_sw_pad = sw_write, sw_read_axis, sw_a0_over, - 4, 2, 10, 0, + 4, {"X axis", "Y axis"}, {"A", "B", "C", "X", "Y", "Z", "L", "R", "Start", "M"} }; diff --git a/src/game/joystick_tm_fcs.c b/src/game/joystick_tm_fcs.c index 7d1b7e2fd..892c0d546 100644 --- a/src/game/joystick_tm_fcs.c +++ b/src/game/joystick_tm_fcs.c @@ -86,10 +86,10 @@ joystick_if_t joystick_tm_fcs = tm_fcs_write, tm_fcs_read_axis, tm_fcs_a0_over, - 1, 2, 4, 1, + 1, {"X axis", "Y axis"}, {"Button 1", "Button 2", "Button 3", "Button 4"}, {"POV"} diff --git a/src/win/win.h b/src/win/win.h index 1b716c724..88a03887a 100644 --- a/src/win/win.h +++ b/src/win/win.h @@ -8,15 +8,15 @@ * * Platform support defintions for Win32. * - * Version: @(#)win.h 1.0.13 2017/12/15 + * Version: @(#)win.h 1.0.14 2018/01/21 * * Authors: Sarah Walker, * Miran Grca, * Fred N. van Kempen, * - * Copyright 2008-2017 Sarah Walker. - * Copyright 2016,2017 Miran Grca. - * Copyright 2017 Fred N. van Kempen. + * Copyright 2008-2018 Sarah Walker. + * Copyright 2016-2018 Miran Grca. + * Copyright 2017,2018 Fred N. van Kempen. */ #ifndef PLAT_WIN_H # define PLAT_WIN_H @@ -63,6 +63,8 @@ extern int status_is_open; extern char openfilestring[260]; extern WCHAR wopenfilestring[260]; +extern uint8_t filterindex; + #ifdef __cplusplus extern "C" { @@ -94,7 +96,7 @@ extern intptr_t fdd_type_to_icon(int type); #ifdef EMU_DEVICE_H extern uint8_t deviceconfig_open(HWND hwnd, device_t *device); #endif -extern void joystickconfig_open(HWND hwnd, int joy_nr, int type); +extern uint8_t joystickconfig_open(HWND hwnd, int joy_nr, int type); extern int getfile(HWND hwnd, char *f, char *fn); extern int getsfile(HWND hwnd, char *f, char *fn); diff --git a/src/win/win_dialog.c b/src/win/win_dialog.c index 009f4b503..d578f7aa4 100644 --- a/src/win/win_dialog.c +++ b/src/win/win_dialog.c @@ -8,13 +8,13 @@ * * Several dialogs for the application. * - * Version: @(#)win_dialog.c 1.0.7 2017/12/28 + * Version: @(#)win_dialog.c 1.0.8 2018/01/21 * * Author: Miran Grca, * Fred N. van Kempen, * - * Copyright 2016,2017 Miran Grca. - * Copyright 2017 Fred N. van Kempen. + * Copyright 2016-2018 Miran Grca. + * Copyright 2017,2018 Fred N. van Kempen. */ #define UNICODE #include @@ -35,6 +35,7 @@ WCHAR path[MAX_PATH]; WCHAR wopenfilestring[260]; char openfilestring[260]; +uint8_t filterindex = 0; static int CALLBACK @@ -196,6 +197,7 @@ file_dlg_w(HWND hwnd, WCHAR *f, WCHAR *fn, int save) if (r) { wcstombs(openfilestring, wopenfilestring, sizeof(openfilestring)); + filterindex = ofn.nFilterIndex; // pclog("File dialog return true\n"); return(0); diff --git a/src/win/win_jsconf.c b/src/win/win_jsconf.c index 23158a93d..fe97c5b6c 100644 --- a/src/win/win_jsconf.c +++ b/src/win/win_jsconf.c @@ -21,6 +21,8 @@ static int joystick_config_type; #define AXIS_STRINGS_MAX 3 static char *axis_strings[AXIS_STRINGS_MAX] = {"X Axis", "Y Axis", "Z Axis"}; +static uint8_t joystickconfig_changed = 0; + static void rebuild_axis_button_selections(HWND hdlg) { @@ -271,7 +273,11 @@ joystickconfig_dlgproc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam) } } } + joystickconfig_changed = 1; + EndDialog(hdlg, 0); + return TRUE; case IDCANCEL: + joystickconfig_changed = 0; EndDialog(hdlg, 0); return TRUE; } @@ -280,7 +286,7 @@ joystickconfig_dlgproc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam) return FALSE; } -void joystickconfig_open(HWND hwnd, int joy_nr, int type) +uint8_t joystickconfig_open(HWND hwnd, int joy_nr, int type) { uint16_t *data_block = malloc(16384); uint16_t *data; @@ -289,6 +295,8 @@ void joystickconfig_open(HWND hwnd, int joy_nr, int type) int y = 10; int id = IDC_CONFIG_BASE; int c; + + joystickconfig_changed = 0; joystick_nr = joy_nr; joystick_config_type = type; @@ -546,4 +554,6 @@ void joystickconfig_open(HWND hwnd, int joy_nr, int type) DialogBoxIndirect(hinstance, dlg, hwnd, joystickconfig_dlgproc); free(data_block); + + return joystickconfig_changed; } diff --git a/src/win/win_settings.c b/src/win/win_settings.c index ff3a5c0b3..d1ba0ec2a 100644 --- a/src/win/win_settings.c +++ b/src/win/win_settings.c @@ -8,7 +8,7 @@ * * Windows 86Box Settings dialog handler. * - * Version: @(#)win_settings.c 1.0.29 2018/01/19 + * Version: @(#)win_settings.c 1.0.30 2018/01/21 * * Author: Miran Grca, * @@ -1030,44 +1030,41 @@ win_settings_input_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam) break; case IDC_COMBO_JOYSTICK: - if (HIWORD(wParam) == CBN_SELCHANGE) - { - h = GetDlgItem(hdlg, IDC_COMBO_JOYSTICK); - temp_joystick = SendMessage(h, CB_GETCURSEL, 0, 0); + h = GetDlgItem(hdlg, IDC_COMBO_JOYSTICK); + temp_joystick = SendMessage(h, CB_GETCURSEL, 0, 0); - h = GetDlgItem(hdlg, IDC_JOY1); - EnableWindow(h, (joystick_get_max_joysticks(temp_joystick) >= 1) ? TRUE : FALSE); - h = GetDlgItem(hdlg, IDC_JOY2); - EnableWindow(h, (joystick_get_max_joysticks(temp_joystick) >= 2) ? TRUE : FALSE); - h = GetDlgItem(hdlg, IDC_JOY3); - EnableWindow(h, (joystick_get_max_joysticks(temp_joystick) >= 3) ? TRUE : FALSE); - h = GetDlgItem(hdlg, IDC_JOY4); - EnableWindow(h, (joystick_get_max_joysticks(temp_joystick) >= 4) ? TRUE : FALSE); - } + h = GetDlgItem(hdlg, IDC_JOY1); + EnableWindow(h, (joystick_get_max_joysticks(temp_joystick) >= 1) ? TRUE : FALSE); + h = GetDlgItem(hdlg, IDC_JOY2); + EnableWindow(h, (joystick_get_max_joysticks(temp_joystick) >= 2) ? TRUE : FALSE); + h = GetDlgItem(hdlg, IDC_JOY3); + EnableWindow(h, (joystick_get_max_joysticks(temp_joystick) >= 3) ? TRUE : FALSE); + h = GetDlgItem(hdlg, IDC_JOY4); + EnableWindow(h, (joystick_get_max_joysticks(temp_joystick) >= 4) ? TRUE : FALSE); break; case IDC_JOY1: h = GetDlgItem(hdlg, IDC_COMBO_JOY); temp_joystick = SendMessage(h, CB_GETCURSEL, 0, 0); - joystickconfig_open(hdlg, 0, temp_joystick); + temp_deviceconfig |= joystickconfig_open(hdlg, 0, temp_joystick); break; case IDC_JOY2: h = GetDlgItem(hdlg, IDC_COMBO_JOY); temp_joystick = SendMessage(h, CB_GETCURSEL, 0, 0); - joystickconfig_open(hdlg, 1, temp_joystick); + temp_deviceconfig |= joystickconfig_open(hdlg, 1, temp_joystick); break; case IDC_JOY3: h = GetDlgItem(hdlg, IDC_COMBO_JOY); temp_joystick = SendMessage(h, CB_GETCURSEL, 0, 0); - joystickconfig_open(hdlg, 2, temp_joystick); + temp_deviceconfig |= joystickconfig_open(hdlg, 2, temp_joystick); break; case IDC_JOY4: h = GetDlgItem(hdlg, IDC_COMBO_JOY); temp_joystick = SendMessage(h, CB_GETCURSEL, 0, 0); - joystickconfig_open(hdlg, 3, temp_joystick); + temp_deviceconfig |= joystickconfig_open(hdlg, 3, temp_joystick); break; } return FALSE;