mirror of
https://github.com/Oibaf66/uae-wii.git
synced 2024-11-22 10:39:19 +01:00
Refactor joystick setup (so that it is always saved in the .user configuration file)
This commit is contained in:
parent
3d0a18b087
commit
718ff877b5
@ -375,13 +375,11 @@ static void insert_keyboard_map(const char *key, const char *fmt, ...)
|
||||
read_inputdevice_config (&currprefs, buf, key);
|
||||
}
|
||||
|
||||
static void setup_joystick(int joy, const char *key, int sdl_key)
|
||||
static void setup_joystick_defaults(int joy)
|
||||
{
|
||||
int fire_buttons[] = {3,7,9,10};
|
||||
int i;
|
||||
|
||||
insert_keyboard_map(key, "input.1.joystick.%d.button.%d", joy, sdl_key);
|
||||
|
||||
/* For some reason, the user uaerc removes these. The following
|
||||
* lines should be removed when this is properly figured out */
|
||||
for (i = 0; i < 8; i++)
|
||||
@ -415,6 +413,11 @@ static void setup_joystick(int joy, const char *key, int sdl_key)
|
||||
}
|
||||
}
|
||||
|
||||
static void setup_joystick(int joy, const char *key, int sdl_key)
|
||||
{
|
||||
insert_keyboard_map(key, "input.1.joystick.%d.button.%d", joy, sdl_key);
|
||||
}
|
||||
|
||||
static void keyboard_options(void)
|
||||
{
|
||||
const int wiimote_to_sdl[] = {2, 4, 5};
|
||||
@ -734,6 +737,7 @@ void gui_display(int shortcut)
|
||||
if (prefs_has_changed)
|
||||
{
|
||||
char user_options[255] = "";
|
||||
int i;
|
||||
|
||||
#ifdef OPTIONS_IN_HOME
|
||||
char *home = getenv ("HOME");
|
||||
@ -746,6 +750,9 @@ void gui_display(int shortcut)
|
||||
strcat(user_options, OPTIONSFILENAME);
|
||||
strcat(user_options, ".user");
|
||||
|
||||
for (i = 0; i < 2; i++)
|
||||
setup_joystick_defaults(i);
|
||||
|
||||
cfgfile_save(&changed_prefs, user_options, 0);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user