When using Windowed mode, if the emulation window is manually resized, that position will be remembered and restored, if the GUI is opened and closed again.
When starting up, keep track of the GUI window size and position. If it's resized or moved, store the new values and re-use them when re-opening the GUI.
The `disk_selection` function in `amiberry_gui.cpp` has been updated to handle various types of shortcuts. The parameter name has been changed from `drive` to `shortcut`. The function now supports:
- Floppy disk images (shortcuts 0-3)
- Loading save states (shortcut 4)
- Saving save states (shortcut 5)
- Selecting CD images (shortcut 6)
Enhanced readability and consistency by replacing manual comparisons and assignments with std::max and std::min functions. Updated #include directives to use modern C++-style headers (e.g., <cmath> instead of <math.h>).
- Updated various functions to use `std::max` and `std::min` for clamping values.
- Removed `#ifdef PICASSO96` block in `updatepicasso96`.
- Changed surface format in `setupcursor` to `SDL_PIXELFORMAT_BGRA32`.
- The config name was always changed when inserting media into a drive (floppy, CD, whdload). However, this should not happen if we already had a config file loaded earlier.
- Refactor code in Floppy panel, reduce action listeners
- Add Save Config for Disk button: saves the configuration with the name of the inserted floppy image of DF0
- Replace NULL with nullptr
- initialize structs that needed intializing
- replace _stprintf() which is deprecated, with _sntprintf() (both are macros defined in string.h)
- Changed gui_update() to void, since it always returned zero and we never checked for the result value anywhere
- other minor code improvements
Some socket connections would not work properly in Amiberry (but also in most/all UAE implementations that were not WinUAE it seems, as they all use the same code).
Specifically, the optvalue would not cover cases that the type was SO_RCVTIMEO, SO_SNDTIMEO and SO_LINGER. All of these use a different struct, instead of an int value, and the result was that we'd get an error when we called setsockopt() - which got reflected back to AmigaOS, as an invalid parameter.
- When adding a hard drive, the text field with the path was annoyingly replaced on every widget refresh.
- Set active status on the dropdowns after initializing also, not after a widget action. This means that uaehf.device does not get to have controller type and feature level, as they don't make sense for it.
- Refactored some logic away from the GUI class
- Use TCHAR* instead of string() for the filename, when getting the timestamp
- Use last_active_config as a fallback, when checking for the filename to pick. The previous "last_loaded_config" would be empty, if we run things from the command line and just loaded a savestate (.uss) file.
- Ensure that the variable txt is freed after we have processed it with SetLastActiveConfig(), not before
Use the same pixel format that WinUAE uses, to avoid headaches like incorrect colors in custom gfx boards.
Previously, RGBA was used, after benchmarks showed that it performed better on slower devices (like the RPI) than BGRA.
* bugfix: set last active config to the savestate name (#1545)
* Enhance filename determination in gui_update()
The code now includes additional conditions to determine the `filename` in the `gui_update()` function. Specifically, it checks if `whdload_prefs.whdload_filename` is not empty and uses it to set the `filename`. If that condition is not met, it then checks if `last_loaded_config` has a non-zero length and uses it to set the `filename`. The previous logic that set `filename` to either `last_loaded_config` or "default.uae" has been removed.
* Improve savestate handling and UI feedback in PanelSavestate
Only enable buttons is a savestate title is set.
Show the title when displaying a not found message.
If a savestate is not found, don't try to load the screenshot for it either.
Minor code optimization.
The bundled plugins of capsimg and floppybridge, were not included in the final app bundle.
Furthermore, they need to be signed with the same digital certificate, otherwise MacOS will block them from loading.