--- hatari/src/gui-sdl/dlgJoystick.c 2019/04/01 07:12:47 1.1.1.3 +++ hatari/src/gui-sdl/dlgJoystick.c 2019/04/01 07:13:50 1.1.1.5 @@ -4,7 +4,7 @@ This file is distributed under the GNU Public License, version 2 or at your option any later version. Read the file gpl.txt for details. */ -char DlgJoystick_rcsid[] = "Hatari $Id: dlgJoystick.c,v 1.1.1.3 2019/04/01 07:12:47 root Exp $"; +const char DlgJoystick_rcsid[] = "Hatari $Id: dlgJoystick.c,v 1.1.1.5 2019/04/01 07:13:50 root Exp $"; #include "main.h" #include "configuration.h" @@ -53,7 +53,7 @@ static SGOBJ joydlg[] = { SGBUTTON, 0, 0, 1,3, 3,1, "\x04" }, /* Arrow left */ { SGBUTTON, 0, 0, 28,3, 3,1, "\x03" }, /* Arrow right */ - { SGBUTTON, 0, 0, 6,16, 20,1, "Back to main menu" }, + { SGBUTTON, SG_DEFAULT, 0, 6,16, 20,1, "Back to main menu" }, { -1, 0, 0, 0,0, 0,0, NULL } }; @@ -72,7 +72,7 @@ static SGOBJ joykeysdlg[] = }; -static char *sJoystickNames[6] = +static char *sJoystickNames[JOYSTICK_COUNT] = { "ST Joystick 0", "ST Joystick 1", @@ -219,7 +219,7 @@ void Dialog_JoyDlg(void) switch (but) { case DLGJOY_PREVSDLJOY: // Select the previous SDL joystick - if (DialogParams.Joysticks.Joy[nActJoy].nJoyId > '0') + if (DialogParams.Joysticks.Joy[nActJoy].nJoyId > 0) { DialogParams.Joysticks.Joy[nActJoy].nJoyId -= 1; snprintf(sSdlStickName, 20, "%i: %s", DialogParams.Joysticks.Joy[nActJoy].nJoyId, @@ -257,7 +257,8 @@ void Dialog_JoyDlg(void) break; } } - while (but != DLGJOY_EXIT && but != SDLGUI_QUIT && !bQuitProgram ); + while (but != DLGJOY_EXIT && but != SDLGUI_QUIT + && but != SDLGUI_ERROR && !bQuitProgram); DlgJoystick_WriteValuesToConf(nActJoy); }