-
-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bugfix: Custom controls would not get loaded when starting from cmd l…
…ine (fixes #1355) When starting Amiberry from the command line, with one of the autoload options, if a config file was found and loaded, the custom controls would never be applied. When doing the same from the GUI, it worked, but only by accident. The jports ID was set to -1 by default_prefs for all ports, in the currprefs structure. This didn't apply to changed_prefs, which had the default values of 0 for those fields. When using the GUI, which always applied settings to changed_prefs, it would work by accident since the ID happened to be zero, which also is the first available joystick in the did struct. Additionally, SDL2 detected a JOYSTICK INSERTED/REMOVED event after startup, which triggered the initialization of joysticks, which in turn loaded the default mapping back on them, overwriting any custom mapping previously loaded. To fix the above, some refactoring was needed: - Disabled the detection of JOYSTICK INSERTED/REMOVED during emulation. This is still triggered when the GUI is open. - Set the first two ports (0 and 1) to their default IDs for Mouse and first Joystick. This is diverging from WinUAE's defaults, but I think it will work out fine for us - Moved the loading of custom controls outside of cfgfile.cpp and into amiberry_input.cpp, where it belongs. This makes it easier to read, since it's not part of that huge parse_host function. - Fixed the loading of custom controls to apply to the uae_prefs struct passed into it, instead of always on currprefs, as it was before. - Added logical checks to ensure the port we're working on is valid (not and id of -1) and within the Joystick ports (value 0-8). We don't want to bother with unmapped ports or mouse ports. - Some more minor refactoring and cleanup was done around those areas as well.
- Loading branch information
Showing
5 changed files
with
105 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters