Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom controls not loaded #1355

Closed
midwan opened this issue Jun 13, 2024 · 37 comments
Closed

Custom controls not loaded #1355

midwan opened this issue Jun 13, 2024 · 37 comments
Assignees
Labels

Comments

@midwan
Copy link
Collaborator

midwan commented Jun 13, 2024

The existing uae-files are not recognized in terms of custom controls.
Easy test:
Open a game -> go into GUI -> change in Custom controls for exmple the East button from None to Joy2 Up (should be a Jump in a Jump'n Run Game) -> save the file -> go back to the game and enjoy jumping per button. Quit the game.
Then open the game again -> go into the GUI again -> take a look on the Custom controls and you will see that the change of before is not shown, and it also does not work in the game.
When I check the the uae-file I see it has the right entry but it's not shown and working in the GUI and game.

I tried these things again under 5.7.0. There everything works as it should be, uae-file changes are shown and active at the next start. Only the BattleIsle-Issue is under 5.7.0 worse with the addition of the WHDLoad panel, under 5.6.8 it was still possible to start it with the manual uae-line trick.

By the way:
Would it be possible to make "default sound" to a part of the amiberry.conf-file.
My try of "default_soundcard_default=true" did not work.

Originally posted by @NoobieMaks in #1353 (comment)

@midwan midwan self-assigned this Jun 13, 2024
@midwan
Copy link
Collaborator Author

midwan commented Jun 13, 2024

I cannot really recreate this here, at least with my setup.

I've tested in both Retroarch configs and non-Retroarch systems (e.g. a default RPI-OS installation), since the handling is different in these two scenarios. I created a config for AmigaTestKit, which would allow me to see what is pressed, in the "Controller Test" window it has.

Then I set a custom mapping for my PS4 controller I had connected, changing the East button to Joy2-Up, as you mentioned. Saved the config, started it up one, and verified that indeed, the East button now triggers the "Up" event.

I closed down Amiberry, started it up again and loaded the config. I could see the saved mapping in the GUI, and starting it up would still apply in AmigaTestKit as expected.

I followed the same steps for both environments (RetroArch and non-RA), and had the exact same results.

Could you post your config file here please, along with your controller mapping file? Maybe we can find some difference there.

@NoobieMaks
Copy link

image

@NoobieMaks
Copy link

image

@NoobieMaks
Copy link

image
image
image

@NoobieMaks
Copy link

@midwan Do you mean an uae-file with config file? I could give you my test files of Gremlin 2, do you want it from 5.7.0, 5.7.1, or 5.7.1+?
Which controller mapping file do you want? gamecontrollerdb.txt or one from retroarch/autoconfig folder?

@NoobieMaks
Copy link

NoobieMaks commented Jun 13, 2024

I tried to give my tests more structure, therefore I made the excel-tables.
From my point of view the uae-files and also the xml-file are both not recognized since 5.7.1, but only in terms of the Custom controls.
The BattleIsle issue was solved with 5.7.1+ = 5.7.2.
Unfortunately the more important Custom controls problems have been undetected in my 5.7.1 tests.

@NoobieMaks
Copy link

NoobieMaks commented Jun 13, 2024

I cannot believe that it is something wrong with my controllers, because every other (retrorch-)emulator works fine with it (NES, SNES, GB, PORTS, Megadrive, Masterdrive, Arcade, PS, N64, NDS, PC Engine).
When I'm in the GUI and chose my functions, I have them in the game, and when I save the uae-file, they are saved there under 5.7.1+, BUT when I start again they are not recognized, AND also not shown in the GUI, although they are clearly visible in the uae-file. With 5.7.1 the Custom controls changes have not been saved in the uae-file, so it was clear that this cannot work.

@midwan
Copy link
Collaborator Author

midwan commented Jun 13, 2024

I'll need a copy of your .uae file that contains the custom mapping, your retroarch.cfg file (just in case) and a copy of your controller .cfg file that Retroarch saves, to compare against mine. Even though we probably don't have the same controller, it might help find anything that's different in my setup (which works) vs yours (which doesn't).

The aim here is to recreate the problem on my end, which will allow me to work on a solution. :)

@NoobieMaks
Copy link

NoobieMaks commented Jun 13, 2024

Here you are. Hoping it will help you to find my troubles.
Gremlins2_v1.2_0489.uae.txt
retroarch.cfg.txt
Sony PLAYSTATION(R)3 Controller.cfg.txt
PLAYSTATION(R)3 Controller.cfg.txt
PS 3 Controller wireless and not wireless, I have the issue with both types.
I have chosen this game, because here are two parameters coming from the XML (Jump and Pause).
I guess the the Confirm/Shot functionality on button A will come from the slave.
I wanted to see how I can overwrite these things per uae-file respectively if I can use them in coexistence.

@NoobieMaks
Copy link

NoobieMaks commented Jun 13, 2024

Seems for me that 5.7.1/+/2 are getting more and more problematic beside the most problematic issue with the custom controls.

I just found out that in the Chipset panel "Cycle Exact (Full)" and "Cycle Exact (DMA/Memory)" are now completly firm married. Until 5.7.0 I could activate the lower checkbox (DMA/Memory) what led to an automatic activation also of the upper checkbox (Full) and then I was able to inactivate the automatic appeared upper checkbox again, so that only the lower checkbox "Cycle Exact (DMA/Memory) remained as activated.
This was the solution for me to solve the flickering problem at Lupo Alberto and also at Ninja Mission.
When both checkboxes are activated then my RasPi 3B+ and or the game is extremly slow.
So now I can chose between unplayable slow or graphical issues.

I also found out that it is no more possible to show up the virtual keyboard. I think this is because of the inactivated Amiga Screen menus "Fullscreen:" and "Screen Mode:", both are now greyed out.
When I activate the VKbd checkbox and push the guide button, I can "feel" that the VKbd is opened because then I can't use the A Button for the game itself, but I can't see it, it must be out of the shown screen.
When I push the guide button again, then the invisble VKbd was closed and the A-Button is now again usable for the game and not bound for the VKbd control.
My experience with Auto-Crop (#1273) makes me think in this way.
I have to add that under 5.7.0 the VKbd works very fine, so I have a little experience with it.

@midwan
Copy link
Collaborator Author

midwan commented Jun 13, 2024

Thanks for the files.

I also saved a config for the same game here, but without any modifications. Just whatever it picked up by default from the XML. Then I compared my .uae config with yours.

There are some interesting results that I found, and possibly related to the issue you're seeing.
Most of the differences were in the area of custom controls, so I suspect that something's fishy there. I'd like to suggest one test:

  • Rename your config file, so it's not picked up by the game automatically.
  • Run the game, let it pick up the XML defaults.
  • See if East is mapped to Up, as it should. From what I saw, it is part of the XML default mapping already.

If the above works, then save that config and try restarting the whole process. Does it still work?

If the answer to the above is yes, then save your other modifications (if any) on top of that config again. Does it still work after that?

This step-by-step process should help us figure out where things were wrong.

@NoobieMaks
Copy link

NoobieMaks commented Jun 13, 2024

I already tested these 2 steps in this way in the afteroon and wrote it down in the excel sheets some comments above to see the differences between the versions, too. But of course I try it again.

I go one step further and do not only rename the uae-file, I even delete it.
So the XML file should be picked with the 2 entries (Joy2 Up and F1).
-> same result as in the afternoon: When I run the game and open the GUI I can't see these two entries. All buttons show None.

So I tried to save them per uae-file.
-> same result as in the afternoon with 5.7.1:
nothing was saved to the file, only all 42 buttons with None.
-> same result as in the afternoon with 5.7.1+:
my changes have been saved to the uae-file, but are not shown in the GUI when I open the game again.

In both cases the selected functions are of course also not activ in the game.
Even if I can find them in the XML-file and the uae-file.
They are only active for the time I select them in the Custom controls panel and go back to the game until I leave the it.

With 5.7.0 I see the XML entries in the GUI Custom controls panel.

@midwan
Copy link
Collaborator Author

midwan commented Jun 13, 2024

Hm, that's strange - definitely not what I'm seeing here.
I'll need to run a test under RetroPie itself then, perhaps something there might show me different results. I'll get back to you after I've done that.

PS: The VKBD has a known bug with Auto-Crop enabled, will be fixed separately.

@midwan
Copy link
Collaborator Author

midwan commented Jun 13, 2024

amiberry-master-debian-buster-armhf.zip

@NoobieMaks If you have time, can you do a test with the binary I'm pasting here?
This is a fresh compile from the latest master, for Debian buster 32-bit. It's the SDL2 build (no Dispmanx).
This is to see if the differences are somewhere in the code, between your patched binary and the current code in master.

@giantclambake
Copy link

giantclambake commented Jun 14, 2024

@midwan

I can recreate this here using preview/x86-64 ... example config.uae files attached. For the title Zool, the only custom mapping used is;

joyport1_amiberry_custom_none_dpup=Joy2 CD32 Red

...which maps dpad up to CD32 Red (default 'jump' button for this title)

Test 1:

Launch amiberry, GUI -> load Zool_v2.0_CD32.uae -> Custom controls --> mapping appears correct ;

ex

Quit amiberry.

Direct autoload the whdload title....

./amiberry Zool_v2.0_CD32.lha

After emulation starts and you get to the Zool splash screen, hit F12 to see Custom controls unset ;

ex2

Follow on by hitting F12 again, and checking in game ~ indeed, the custom mapping does not work.

Note: This mapping does work at the time of config.uae file creation, that process being ...ie; when in game -> F12 -> Custom controls --> set dpad up = CD32 Red --> Resume to test mapping (works as expected) --> F12 -> Configurations panel --> Save -> Resume and keep playing, works as expected.

Test 2:

Given the above result made me suspicious that the whd-booter/XML process was overriding config.uae options, I retested using a floppy image based config.uae file .. ie; see attached Highway Hawks (1988)(Anco)(Disk 1 of 2).uae

The only custom controls used here are;

joyport1_amiberry_custom_none_leftshoulder=Insert previous Disk Swapper slot in DF0:
joyport1_amiberry_custom_none_rightshoulder=Insert next Disk Swapper slot in DF0:

Launch amiberry, GUI -> load Highway Hawks (1988)(Anco)(Disk 1 of 2).uae -> Custom controls --> the mappings appear correct...follow on with ...Start -> emulation begins, title gets to 'Insert Disk 2' screen --> hit rightshoulder ---> loads next disk in Disk Mapper, and title continues and loads game ....result: working as expected ... -->> Quit amiberry.

Cross-checks;

Direct autoload the floppy image title....

./amiberry floppies/"Highway Hawks (1988)(Anco)(Disk 1 of 2).adf"

Title starts, but Custom control mappings not present...ie; hitting rightshoulder does nothing --> F12 --> Custom controls shows the leftshoulder/rightshoulder mappings are unset (default values present) ---> Quit amiberry

Note: Examination of the logfile created with the above incantation does disclose that the associated config.uae file for this title is auto-detected and loaded...

Floppy... floppies/Highway Hawks (1988)(Anco)(Disk 1 of 2).adf
Loading configuration file /home/gcb/Amiberry/conf/Highway Hawks (1988)(Anco)(Disk 1 of 2).uae
target_cfgfile_load(): load file /home/gcb/Amiberry/conf/Highway Hawks (1988)(Anco)(Disk 1 of 2).uae
load config '/home/gcb/Amiberry/conf/Highway Hawks (1988)(Anco)(Disk 1 of 2).uae':3

Note2: The logfile also indicates that Highway Hawks (1988)(Anco)(Disk 1 of 2).uae is actually being parsed ~ this is based upon the fact the title 'Highway Hawks' will only run correctly in amiberry using a base A500/OCS/512K chip machine type, with KS-1.2 ROM (else graphics corruption & manic undefined madness ensue...quite funny actually =)...

2-946 [83 038=190]: =KS ROM v1.2 (A500,A1000,A2000) rev 33.180 (256k) [315093-01]

....and although the Custom control mappings are not present, I could ..F12 -> load Disk 2 into DF0: -> Resume, and the game continues and runs properly, which sort of infers that only Custom controls are not being parsed in?

Direct load the config.uae file...

./amiberry conf/"Highway Hawks (1988)(Anco)(Disk 1 of 2).uae"

Title starts, but Custom control mappings not present, exact same result as above example.

As this is debian 12.5 without any retroarch environment present, I'm thinking juicy bug ;^)

Zool_v2.0_CD32.uae.gz

Highway Hawks (1988)(Anco)(Disk 1 of 2).uae.gz

@NoobieMaks
Copy link

NoobieMaks commented Jun 14, 2024

@midwan
I just testet with your fresh binary (called 5.7.3 in the uae-file) and unfortunately all my problems are also present there,
even one more.

Test Game: Gremlins 2

  1. XML-Custom controls not visible in GUI Custom controls panel

  2. AND they are not active in the game (should be Jump on East and Pause on Start)

  3. Personal selected uae-file Custom controls are saved in the uae-file = positiv

  4. BUT they are also not visible in the GUI Custom controls panel after a new game start
    So it seems identical to me as 5.7.1+

  5. BUT I noticed one deterioration: Any change in the GUI (I tried Fullwindow, some custom controls and enabling VKBd) will cause a game abort when you leave the GUI back to the game. If you have saved it before the savings are recognized at the next start, with exception of the Custom controls :)

Positiv is, that in this version the VKBd seems to work for me as it was with 5.7.0.
Also positiv: BattleIsle starts with a manual edited uae-file.

@NoobieMaks
Copy link

@midwan Is it possible for you to compare the coding of 5.7.0 with the current coding especially for the handling of Customer controls from XML first and uae finally. My tests would say it was nearly ok with 5.7.0.
Although it was not possible to overwrite the XML-settings. For me it would be more correct when the same button is setted in XML and uae the uae selection will win.

image

@midwan
Copy link
Collaborator Author

midwan commented Jun 14, 2024

I finally managed to recreate this:

  • It only happens in the process of autoloading something from the command line.
  • If we follow the same process from the GUI, it works normally (custom controls are loaded).
  • It only affects custom controls (from what I can see), all other options, including other Input options, are loaded. I tested with Mouse Map on the LStick, for instance (worked).

Now that I can recreate it, I can start working on a fix.

@midwan midwan added bug and removed can't recreate labels Jun 14, 2024
midwan added a commit that referenced this issue Jun 14, 2024
…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.
@midwan midwan closed this as completed in 5be13eb Jun 14, 2024
@midwan
Copy link
Collaborator Author

midwan commented Jun 14, 2024

This is now fixed, at least according to all my tests 🤞

There were a few issues combined here, which needed some refactoring and some changes to solve correctly.

@giantclambake
Copy link

giantclambake commented Jun 14, 2024

Not fixed wrt my Test 2 case as above....

./amiberry floppies/"Highway Hawks (1988)(Anco)(Disk 1 of 2).adf"

Note: Custom control settings now appear in GUI->Custom controls as they should.

ex

However.... in the emulation, the Custom control events are not recognized.....ie; hitting rightshoulder does NOT insert next disk in Disk Mapper. Check .. F12 ->Custom controls appears as they should but not working.

I'll redo all the tests to establish where we are with this ;)

Edit:

./amiberry Zool_v2.0_CD32.lha //references conf/Zool_v2.0_CD32.uae

Does not work ~ Custom control mapping not shown in GUI, and does not work in game.

./amiberry conf/"Highway Hawks (1988)(Anco)(Disk 1 of 2).uae"

Loads config.uae into GUI -> Custom controls --> custom mappings appear correct ---> Start

Does not work ~ left/rightshoulder not loading Disk Mapper --> F12 -> Custom controls --> custom mappings are now no longer set (defaults present) ....it's as though they got reset to defaults after Start of emulation.

./amiberry conf/"Highway Hawks (1988)(Anco)(Disk 1 of 2).uae" -G

Does not work ~ same as result above.

Launch amiberry, GUI -> load Highway Hawks (1988)(Anco)(Disk 1 of 2).uae -> Custom controls --> the mappings appear correct...follow on with ...Start --- works as expected, so still good being launched this way.

@midwan midwan reopened this Jun 15, 2024
@midwan
Copy link
Collaborator Author

midwan commented Jun 15, 2024

I was checking that it shows up in the GUI as expected, didn't test that it also worked as the mapped function. You're right, this still needs some work.

@midwan
Copy link
Collaborator Author

midwan commented Jun 17, 2024

@giantclambake Could you please run another test with preview after the commit above?
I think it works better now.

@giantclambake
Copy link

@midwan ...Certainly, here's the results....


./amiberry Zool_v2.0_CD32.lha

//references conf/Zool_v2.0_CD32.uae

Working as expected ~ Custom control mapping appears correct in GUI, and also working in game.

|

./amiberry floppies/"Highway Hawks (1988)(Anco)(Disk 1 of 2).adf"

//references conf/Highway Hawks (1988)(Anco)(Disk 1 of 2).uae

Working as expected ~ Custom control mappings appear correct in GUI, and also working in game.

|

./amiberry conf/"Highway Hawks (1988)(Anco)(Disk 1 of 2).uae"

Loads config.uae into GUI -> Custom controls --> custom mappings appear correct ---> Start

Does not work ~ left/rightshoulder not loading Disk Mapper --> F12 -> Custom controls --> custom mappings are now no longer set (defaults present) ....it's as though they got reset to defaults after Start of emulation.

./amiberry conf/"Highway Hawks (1988)(Anco)(Disk 1 of 2).uae" -G

Does not work ~ does not appear to load config.uae at all ?? (boots to KS-1.3 insert disk splash, which is wrong)

|

Launch amiberry, GUI -> load Highway Hawks (1988)(Anco)(Disk 1 of 2).uae -> Custom controls --> the mappings appear correct...follow on with ...Start --- works as expected, so still good being launched this way.


Ergo, 3 out of 4... just direct autoloading of the floppy image based config.uae file not working as expected.

Attaching logfile wrt failed test ./amiberry conf/"Highway Hawks (1988)(Anco)(Disk 1 of 2).uae" -G ....it would seem no attempt made to load the config.uae file?

amiberry.log.gz

@midwan
Copy link
Collaborator Author

midwan commented Jun 18, 2024

@giantclambake
Can you try again now, please?

@giantclambake
Copy link

@midwan ~ sure, still fails this;

./amiberry conf/"Highway Hawks (1988)(Anco)(Disk 1 of 2).uae"

Loads config.uae into GUI -> Custom controls --> custom mappings appear correct ---> Start

Does not work ~ left/rightshoulder not loading Disk Mapper --> F12 -> Custom controls --> custom mappings are now no longer set (defaults present) ....it's as though they got reset to defaults after Start of emulation.

./amiberry conf/"Highway Hawks (1988)(Anco)(Disk 1 of 2).uae" -G

Does not work ~ does not appear to load config.uae at all ?? (boots to KS-1.3 insert disk splash, which is wrong)

All other tests pass, just direct autoloading of the config.uae file seems to be the stumbling block ;)

@midwan
Copy link
Collaborator Author

midwan commented Jun 18, 2024

@giantclambake
I can't really recreate this anymore. It seems to work properly for me, even using your steps above.
I had to recreate the config manually here of course, since we have different paths, controllers etc.

What mode do you have your controller in? I used CD32 here, perhaps that might be relevant?
I've also added some more logging details in the loading of config files, which I had removed earlier.

@giantclambake
Copy link

giantclambake commented Jun 18, 2024

What mode do you have your controller in? I used CD32 here, perhaps that might be relevant?

The mode was actually set to Default --> recreated Highway Hawks (1988)(Anco)(Disk 1 of 2).uae with mode set to CD32 (same insert next/previous in disk mapper to DF0: custom controls ), and retested...

./amiberry conf/"Highway Hawks (1988)(Anco)(Disk 1 of 2).uae"

Loads config.uae into GUI -> Custom controls --> custom mappings appear correct ---> Start

Working as expected ~ Custom control mappings appear correct in GUI, and also working in game.
Ergo, controller mode was participle here... nice catch...

However....

./amiberry conf/"Highway Hawks (1988)(Anco)(Disk 1 of 2).uae" -G

Does not work ~ does not appear to load config.uae at all ?? (boots to KS-1.3 insert disk splash, which is wrong)

Logfile attached of the failed invocation (I see no loading of the config.uae file therein at all)

amiberry.log.gz

Edit:

./amiberry -f conf/"Highway Hawks (1988)(Anco)(Disk 1 of 2).uae" -G

./amiberry --config conf/"Highway Hawks (1988)(Anco)(Disk 1 of 2).uae" -G

Both of these above invocations work as expected...

...Question: should ./amiberry conf/"Highway Hawks (1988)(Anco)(Disk 1 of 2).uae" -G direct autoload & start the emulation?

midwan added a commit that referenced this issue Jun 18, 2024
…the last item (#1355)

uae config files and savestates were only accepted from the command line, if they were the last parameters. If we however wanted to include -G after them (to hide the GUI), they would not get loaded.
@midwan
Copy link
Collaborator Author

midwan commented Jun 18, 2024

@giantclambake
By design, the command line options had a fallback to try and load a config file or savestate, if no parameter was specified, but that would only get triggered if it was the last parameter in the line. If you add one more (-G in your case), the file wouldn't get loaded because it never entered the fallback, leading to a default A500 config starting up.

I've changed that with a slight refactoring, so it will work even if it's not the last parameter now. That should conclude the last item in this issue, so hopefully we can close it once you confirm it works. :)

midwan added a commit that referenced this issue Jun 18, 2024
…the last item (#1355)

uae config files and savestates were only accepted from the command line, if they were the last parameters. If we however wanted to include -G after them (to hide the GUI), they would not get loaded.
@giantclambake
Copy link

@midwan
As always, thanks for the details ;)

./amiberry conf/"Highway Hawks (1988)(Anco)(Disk 1 of 2).uae" -G now works as expected, as do the other tests...

However.... this problem has returned;

./amiberry conf/"Highway Hawks (1988)(Anco)(Disk 1 of 2).uae"

Loads config.uae into GUI -> Custom controls --> custom mappings appear correct ---> Start

Does not work ~ left/rightshoulder not loading Disk Mapper --> F12 -> Custom controls --> custom mappings are now no longer set (defaults present) ....it's as though they got reset to defaults after Start of emulation.

You can check that by invoking ./amiberry conf/"Highway Hawks (1988)(Anco)(Disk 1 of 2).uae" --> in the GUI all seems correct, Start emulation, but after title starts (highway hawks splash screen) --> F12 -> Custom controls --> custom mappings have been reset to defaults. Also apparent with;

./amiberry -f conf/"Highway Hawks (1988)(Anco)(Disk 1 of 2).uae"
./amiberry --config conf/"Highway Hawks (1988)(Anco)(Disk 1 of 2).uae"

Note: the config.uae seems to be parsed correctly, just the Custom control settings are reset to defaults after the emulation starts.

Logfile & config.uae attached.

amiberry.log.gz
Highway Hawks (1988)(Anco)(Disk 1 of 2).uae.gz

@midwan
Copy link
Collaborator Author

midwan commented Jun 19, 2024

It's interesting that it's rather specific to the above config - i.e. testing the exact same thing with a config for another game (like Zool CD32), to which I also assigned custom controls, does work.

I'll investigate further.

@giantclambake
Copy link

Indeed, that's why I attached it ~ the same thought crossed my mind.

Do note, appending -G to any of these failing invocations, actually works as expected ~ it's only when loading the config.uae into the GUI --> Start, that the issue manifests itself....

...as you note, whdload titles are good it seems ~ I'll test another set of floppy image & CDimage config loading after dinner ;)

@midwan
Copy link
Collaborator Author

midwan commented Jun 19, 2024

I found that the difference in configs that triggers the change in behavior, is the Open GUI setting. If that's enabled, then the behavior is incorrect (custom mapping shows in the GUI, but is reset after we leave it). If it's disabled, the GUI doesn't open and the mapping remains correct.

@midwan
Copy link
Collaborator Author

midwan commented Jun 19, 2024

I found the source: the SDL2 event for Joystick Inserted or Removed is triggered after the GUI opens and has already loaded the config. That even in turn, triggers an import of all joysticks, which triggers the default mapping being applied for every joystick detected. At that point, we lose any custom mapping previously applied.

You want the above process to happen if you insert or remove a joystick when the GUI is open, since you want it to be picked up and show in the dropdowns. But it should not happen if you didn't add or remove a joystick, of course. Yet, SDL2 triggers it for some reason, even if I didn't touch my controller. :(

I'll think about some kind of failsafe mechanism, to avoid re-applying the mapping if the joysticks haven't actually changed.

@giantclambake
Copy link

I admire your diligence/patience/skill with these sorts of issues ~ such makes the process of testing, a truly rewarding chore ; kudos =)

TBH, that's been an unasked question in my head, wrt reading through logfiles, and wondering just why the blazes the input controllers were being initialized multiple times, when as you say, IRL nothing had changed. Now, I need not ask the question... yet another instance of 1 - 1 = SDL2 =)

@midwan
Copy link
Collaborator Author

midwan commented Jun 19, 2024

New update, hopefully fixing this behavior. This can still be improved further, but it will require more refactoring (ripping out WinUAE stuff and making it simpler).

@giantclambake
Copy link

Happy to report, all test cases work correctly and as expected, great work kind sir ;)

I'd consider this fixed now afaict with my various tests ~ if you need any further testing done wrt removing WinUAE stuffs, just give me a heads-up ;)

@midwan
Copy link
Collaborator Author

midwan commented Jun 19, 2024

Thanks for confirming!

@midwan midwan closed this as completed Jun 19, 2024
midwan added a commit that referenced this issue Sep 24, 2024
* enhancement: Gayle Null check (merged from WinUAE)

* enhancement: Line 0 A1000 and OCS Agnus strobe fix

* enhancement: OCS Agnus + OCS Denise config also has line 0 visible at the bottom of screen (like A1000)

* Fix base color for Radiobuttons in SaveStates panel (#1293)

* doc: added new option in usage help text (fixes #1319)

* Update PanelChipset.cpp

* bugfix: Always clear the text fields when deleting a config (fixes #1321)

* bugfix: Fullscreen toggle didn't quite work (fixes #1322)

* bugfix: Set right colors for checkboxes that were missed, so that themes work properly on them

* bugfix: Use the right APMODE when toggling full-screen (fixes #1324)

* Use the Default toggle screenmode instead of windowed<->fullscreen

* feat: added window scaling option in amiberry.conf

This option allows you to set the window scaling for the GUI window.
The default option is 1.0, which is the normal 100% scaling.
The value is a float, so you can dynamically set it to whatever you need, depending on your monitor's resolution.

For example, you can set it to:
1.250 = 125%
1.50  = 150%
2.0   = 200%

* enhancement: Fix AGA genlock transparency bit being detected as special blanking bits

(merged from WinUAE)

* refactor: rename gui theme internal variables

* feat: implemented GUI foreground color option for themes

* bugfix: Quickstart - enabling 2nd floppy drive did not refresh panel

* doc: updated help text

the --cdimage option does not change configuration, only inserts the CD. The help text did not clearly reflect that

* bugfix: Make guisan widgets active/inactive status more visible (fixes #1326)

Some widgets were not greyed out when disabled

* enhancement: CPU panel had widgets that were not shown as disabled (#1326)

The MMU and CPU Data Cache options were not visibly disabled as they should

* Remove HighDPI window flag

* bugfix: Fixed textbox background color in Create hardfile dialog (fixes #1327)

* include <string> in CommonBridgeTemplate.h

* refactor: minor tidy in SelectFolderf

* Add stdint.h include in SerialIO.h (fixes compile with newer GCC)

* sync resource.h with upstream

* bugfix: Floppy GUI panel didn't show the select file buttons anymore (fixes #1331)

* refactor: Create plugins directory, use it for external plugins (like floppybridge)

From now on, external libraries such as the CAPSimg.so and libfloppybridge.so, will live in a separate directory named "plugins". This cleans up the main dir from such files.

The new path is added to the GUI (Paths) and config files accordingly. The default value is <start_path>/plugins.

The Makefile will now build floppybridge by default - CAPSimg is a submodule, so it needs to be checked out before it can be built.

MacOS is a special case, since the libs there should be under the Resources folder. So, we're leaving that as-is for now.

* ci: update pipeline with plugin changes

* bugfix: only add the module extension if it's actually missing

* ci: allow floppybridge to use older CMake versions also (3.13 for buster)

* minor tidy

* bugfix: Under KMSDRM the GUI would not open a second time (fixes #1333)

- The window focus was not grabbed when resuming emulation after the GUI, so any subsequent attempt to re-enter the GUI failed.
- Removed single_window_mode option, as it's too buggy and not really worth the trouble.

* refactor: Use CD32 model as a fallback for CD auto-detection (fixes #1325)

Instead of checking for CDTV, then CD32 and as a fallback going for A1200CD, we will look for CDTV and use CD32 as a fallback always.

Most of the titles will be in those two categories anyway, and many might not contain that in the file path, leading to incorrectly trying to boot them (and failing) as an A1200 CD config.

* enhancement: improved console handling in writelog

* bugfix: if console_logging is requested, ensure it's activated always

If console_logging was enabled, but write_logfile was not, then write_log would not show any output.
This changes the behavior so that if console_logging is enabled, we always get output.

* bugfix: Use WHDLoad custom1-5 values if they are not zero (fixes #1328)

Since we always set the default value to zero, this should be safe to use.
Apparently some games do not have some custom fields set, but still use them if specified (e.g. BattleIsle)

* enhancement: ATAPI Write / Mode Select fix (merged from WinUAE)

* enhancement: Serial port undocumented OVRUN behavior emulated. Fast CPU mode + loopback serial port mode fix.

Merged from WinUAE

* Updated version date

* bugfix: the floppy dropdown wasn't updated properly after a selection (fixes #1334)

* refactor: Use "Plugins" directory for macOS

* Resize and center icon

* Leave .so files in Resources for macOS, otherwise dlopen doesn't find them

* Try to fix extension .so being added under macOS always

* Revert "Resize and center icon"

This reverts commit 5386f2b.

* enhancement: Set config name automatically for CD images as well (fixes #1336)

When Floppies or WHDLoad archives are inserted from the Quickstart panel, the last active config name is updated to the filename used.
This did not apply to CD images however.

This commit fixes that behavior, so it's consistent across all types of disk images.

* feat: Added button to Create new folder in the dialogs (fixes #1329)

A new button is now available in the Select File/Folder dialogs: Create Folder

This allows the user to create a new directory inside the currently selected one.

* bugfix: Fixed CD dropdown did not refresh properly (fixes #1337)

When selecting a new CD image, the items in the dropdown did not refresh as expected in the Quickstart panel.
This worked correctly in the HD/CD panel.

Also synced the behavior a bit between the two panels.

* bugfix: Fixed plugins directory name in macOS script

* refactor: Remove CreateFolder button from SelectFile (fixes #1338)

There's no need to Create a new folder, when you're about to select a File

* ci: CMake will now copy libfloppybridge.so into plugins when finished

* ci: add the new folders in flatpak as well

* Updated version date

* build: fix CMake copy of floppybridge lib destination path

* ci: avoid relative paths for placing floppybridge library

Apparently, this won't work everywhere - flatpak failed with the relative paths

* ci: change destination of floppybridge library

It should be the top-level source dir, not the floppybridge one

* Try to fix the relative path once more

* Revert "Try to fix the relative path once more"

This reverts commit 9946d56.

* Revert "ci: change destination of floppybridge library"

This reverts commit af14d19.

* ci: change copying of floppybridge lib, do it on the root CMake file instead

* ci: Removed Buster platforms from pipeline targets

Debian Buster is EOL soon, might as well remove it from the pipelines

* Update README.md

Minor updates, to indicate dropping support for Buster

* Add keywords to .desktop file (#1342)

These are also used by Flathub, KDE Discover and Gnome Software

* enhancement: Improve WHDLoad config handling

* bugfix: load any .uae config after parsing the XML settings, not before (fixes #1343)

* ci: copy lib into plugins after the dir is created

* bugfix: Fixed crash when saving config files (fixes #1345)

* enhancement: When selecting CD32 model, set joystick port to CD32 also (fixes #1346)

* Updated version to 6.3.2

* doc: Updated help text in Input panel (fixes #1349)

* Update README.md

* Update README.md

* Change gui_always_on_top to true, by default (fixes #1351)

Set the GUI to be always on top by default.
This should help with cases where we are in Full screen mode, and sometimes the GUI opens behind the emulation screen.

* feat: Implemented Integer scaling (fixes #1352)

Added Integer scaling as an option in the Display panel.
This saves to the config file, and can be set in amiberry.conf as well.
The value 2 can be used in the scaling_method option, to set this as the default.

* Package macOS bundles on each build

* fix integer scaling was blurry (#1352)

When using Integer scaling, the Nearest Neighbor SDL2 hint should be used

* only enable GUI always on top, if we have fullscreen by default (#1351)

We don't want the GUI to be always on top in Windowed mode also

* improve integer scaling (#1352)

* Remove obsolete option from amiberry.conf

* Revert "improve integer scaling (#1352)"

This reverts commit f3db2f2.

* Don't set GUI always on top, try to raise the GUI window when it opens, instead (#1351)

* build: ensure the floppybridge build is completed, before attempting to copy the lib

* feat: implemented Resolution Autoswitch option

This option comes from WinUAE, and when enabled, allows the automatic selection between horizontal LowRes/HiRes and vertical Single/Double line modes

* enhancement: auto-crop scaling improvements, for integer scaling

When we use Integer scaling, we don't want the width/height doubled during autocrop.
One exception to that is when we have HiRes horizontally, and single line mode (where we need to double the height, in order to keep the aspect ratio correct)

* bring back HighDPI support on windows

This was removed as a test, but it didn't make a difference

* enhancement: make "System Default" sound card option the default

The System Default will now be enabled by default, as it seems to work best for most cases.
If you want another sound output device selected, you can always change that.

Config files should not be affected anyway, this is just a more sensible default.

* bump version to 6.3.3

* enhancement: GUI window improvements

- Set window to always on top, if we're running it in Full-window
- RaiseWindow later in the process

* bugfix: keyboard and mouse was not always grabbed (#1351)

When going from GUI->Emulation repeatedly, sometimes the input was not grabbed as expected

* bugfix: don't grab mouse/keyboard in the GUI window (fixes #1357)

* Update README.md

Added Ko-Fi support button

* bugfix: VKBD would not show if Auto-Crop was enabled

When Auto-Crop was enabled, the texture size was changed. However, VKBD did not update the X/Y coordinates it uses, so the image it showed could happen to be off-screen.

* ci: Rename macOS M1 to macOS Apple Silicon

* ci: fix apple silicon build

* bugfix: Custom controls would not get loaded when starting from cmd line (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.

* enhancement: Make GUI window follow the same logic as the emulation one (#1351)

- If KMSDRM is detected, set the mode to FULL-WINDOW
- If a resolution less than 800x600 is detected, go for Full-window as well
- Otherwise, we'll follow the settings requested regarding Windowed/Fullscreen/Full-window mode

* feat: Added default option to control resolution autoswitch from amiberry.conf

This option helps get the best results out of integer scaling, in combination with auto-crop and full-window modes

* Updated version date

* Change Full-screen toggle behavior - use full-window <-> window (#1351)

Let's prefer Full-window instead of Fullscreen, to avoid screenmode changes on the monitor

* refactor: return to previous approach: GUI window is always Windowed, except on KMSDRM (#1351)

Due to how modern Window Managers handle things, if we open the GUI in full-window while the emulation screen is also opened in full-window, the second one gets minimized. That means that when we resume from the GUI, we don't get back to the emulation screen, even if we call for SDL_RaiseWindow() - it gets ignored.

To resolve this, I'm reverting this behavior to the previous approach: The GUI is always Windowed, and opens on top of the emulation screen. The exception is when we're using KMSDRM, which doesn't have the notion of windows.

But under KMSDRM we might run into a similar problem as well, so that needs a separate solution.

* Update c-cpp.yml

Try adding a `brew upgrade` step

* Update c-cpp.yml

* Update c-cpp.yml

* Update c-cpp.yml

* bugfix: Fix KMSDRM problems when switching between GUI -> emulation (fixes #1351)

The emulation screen would not get the focus always, when resuming from the GUI, if running under KMSDRM.
Removed the code that checked if the window had focus, and instead trying to grab it right away now.

It still sometimes doesn't get it (not sure why), but at least you can click on it once and resume properly now.

* bugfix: when loading custom mapping, skip the check for isrealbutton (#1355)

* refactor: Refactored target_cfgfile_load

* Updated version date

* refactor: remove more checks for isrealbutton from controller mapping (#1355)

* refactor: added some more logging in target_cfgfile_load function (#1355)

* refactor: accept .uae config files in cmd line, even if they are not the last item (#1355)

uae config files and savestates were only accepted from the command line, if they were the last parameters. If we however wanted to include -G after them (to hide the GUI), they would not get loaded.

* Updated version date

* build: add USE_GPIOD in CMakeLists.txt also

* Remove some entries from CMakeSettings.json

* bugfix: store joystick GUID, use it to check before re-importing joysticks (#1355)

* feat: Auto-detect MT32 titles in whdbooter

Auto-detect any titles supporting MT32 MIDI output in WHDBooter, and enable the relevant feature in Amiberry (if the ROMs are installed).
This currently works based on the filename (it has to contain the word "MT32"), as it's not included in the XML.
Not many title supported MT32, so maybe this is good enough.

* Updated version date

* Merged latest WinUAE updates

Added support for Picmatic Tierras Salvajes and Marbella Vice

* Update README.md

* bugfix: fixed typo in Sound panel (fixes #1369)

* refactor: use string.empty()

* enhancement: Added VSync options from WinUAE in Display panel (#1368)

Added the WinUAE VSync options for Native and RTG as dropdowns, instead of the single checkbox we had before.
The Lagless modes are not implemented, not even sure we can do that in SDL2.
The other modes work the same way as in WinUAE.

Amiberry still uses V-Sync internally for the SDL_Presenter, so this only changes what is passed internally in the emulation. These options only make sense to enable if the monitor is already set to the right refresh rate - i.e. don't enable if your monitor only does 60Hz and you want to emulate a PAL machine (which needs 50).

* bugfix: Fixed changing logfile name would append "amiberry.log" at the end

The SelectFile dialog had an incorrect filter setting, which ended up appending the whole default filename instead of only the ".log" extension, if it wasn't found.

* refactor: slight refactor of mapping from retroarch function

* bugfix: joystick input didn't work with retroarch mapping after latest changes (#1363)

* Bumped version to 6.3.4

* Macos folder changes (#1373)

* refactor: use separate dir for amiberry.conf and data under macOS (#1372)

Moving the contents of the data folder and amiberry.conf, under <user>/Library/Application Support/Amiberry for macOS platforms

* Fix capsimg (#1374)

* Remove capsimg submodule

* Add capsimg sources

* Add dependencies in Makefile and CMakeLists.txt to build libcapsimage.so

* Fix path in makefile

* Add libs to make clean also

* Automatically build capsimg as well

* Remove extra step to build capsimg from pipeline

* bugfix: Fixed new/free mismatch in amiberry_filesys (#1387)

* bugfix: Fixed display modes iteration (fixes #1394)

* enhancement: Make Paths panel textboxes read-only (fixes #1385)

* bugfix: always refresh floppy/quickstart panels after disk changes (fixes #1378)

* bugfix: Refresh all panels when WHDLoad action from Quickstart is taken (fixes #1383)

* Add FPS Adjustment options to the Display panel (#1399)

* enhancement: Add FPS Adjustment options to the Display panel (fixes #1397)

* Fix build under macOS

* Updated version date

* bugfix: Fix Picmatic (100Hz TV only) light gun positioning in lores or shres resolutions

* bugfix: Fix duplicated Golem SCSI II / HD3000 name prefix.

* bugfix: Always clear intreq2 in audio state 5.

* enhancement: add secondary check when loading cfg files, look in configs folder for filename (fixes #1388)

* enhancement: resample audio during Push operations (#1397)

* bugfix: detect uppercase MT32 filenames also (fixes #1386) (#1400)

* Updated XML to latest version

* Improve macOS instructions (fixes #1382)

* enhancement: fix inconsistency regarding default config name (fixes #1395)

* Minor sync with WinUAE

No functional changes, just minimizing diffs from WinUAE sources

* Another round of syncs to WinUAE

* enhancement: GUI - Make read-only textboxes in WHDLoad panel show as such (fixes #1403)

Make the read-only text boxes show as such (disabled), since no user input is supported there

* Updated version date

* Minor sync with WinUAE

* enhancement: updated FloppyBridge to v1.6.4

* Updated version date

* enhancement: updated game controller DB to latest version

* enhancement: updated WHDLoad XML to latest version

* bugfix: don't refresh the emulation screen when GUI is open, under KMSDRM (#1401)

* bugfix: Don't replace spaces in native_dos_op

With the newer version of host-run (v1.6 onwards), this should not be necessary anymore

* bugfix: Fixed bug under KMSDRM, where the emulation screen would not show (#1401)

Under KMSDRM, if you started Amiberry from the command line with the -G parameter, and you entered the GUI once, resuming would not show the emulation screen.

* bugfix: remove newlines from debugger input (#1407)

The "fd" command didn't work in the debugger. This was because the "d"
was followed in the input buffer by \n rather than \0.

The Windows version of console_get replaces the terminating \r with \0.
amiberry's version uses fgets, which doesn't do this; it did adjust the
length value returned, but the debugger code doesn't look at the length.

Make it actually strip the newline characters when adjusting the length.

* bugfix: release window grab in the debugger (#1406)

When the debugger is entered with Shift-F12, this function is called to
release the mouse pointer. The second argument to SDL_SetWindowGrab
should be SDL_FALSE to disable the grab; previously, both _acquire and
_release had SDL_TRUE, which enables the grab.

* enhancement: improve help text in Misc panel (fixes #1408)

* Revert "enhancement: resample audio during Push operations (#1397)"

This reverts commit a70dd17.

* enhancement: auto-select the first item in the Configs list (fixes #1391)

If we have items in the Configs list, automatically select the first one.

* enhancement: Log command line parameters on startup (fixes #1380)

If logging is enabled, also log the full command line used to start up

* enhancement: harmonize buttons in HDD GUI panel

Change label on Add Directory, to indicate it also supports archives.
Harmonize the widths of those buttons.
Improve label on CD select image file.

* Added CMakePresets.json

* enhancement: use string.empty() instead of comparing with ""

* bugfix: When using KMSDRM, controller input was lost after entering the GUI once (fixes #1384)

This seems to be caused by SDL2 when using KMSDRM only, as it works properly under X.
As a workaround, I'm changing the logic to keep only a single window and renderer when KMSDRM is detected.

* Updated version date

* bugfix: KMSDRM fixes for when using a single window (fixes #1411)

Disable integer scaling when opening the GUI, trigger an update of scaling options when resuming

* enhancement: separate data from home directories, improve handling (fixes #1073)

- Separate DATA from HOME directories
- Use special ENV variables to override locations: AMIBERRY_DATA_DIR and AMIBERRY_HOME_DIR respectively
- Use the standard Linux locations if the env variables are not set: /usr/share/amiberry/data for the DATA folder, and $HOME/.amiberry for the HOME folder
- Fallback to the Portable mode used before, if all the above fail

* enhancement: Fix new paths logic for Flatpak also (#1073)

* enhancement: improve look of GUI Misc panel scrollbar (fixes #1412)

* 1376 add a3000 scsi controller and tape support for amiga unix amix (#1414)

* enhancement: added CD and Tape drive buttons

Added new buttons in the GUI: HDD panel, for handling CD and Tape drives.

* Refactoring of GUI HD Panel

- Added TapeDrive option
- Refactored GUI panels to look more like WinUAE
- Refactored functionality to closer match that of WinUAE

* bugfix: Fixes for HDD panel windows

* bugfix: Fixed default paths in dialogs

* enhancement: Harmonize TapeDrive dialog logic with others

Set the default path (harddrives) if no path is configured, before opening the dialog

* enhancement: Updated Create HF dialog

- The dialog will now only create HDFs, not add them as well

* enhancement: fix navigation in Create HDF dialog

* enhancement: Added Special Monitors support

* enhancement: Added special monitors support in GUI

* enhancement: fixed navigation for Tape Drive and other HDD panel dialogs

* enhancement: improvements in the Add HardDrive dialog

Added controller, unit, type and feature level dropdowns

* enhancement: fixed navigation in Panel Harddrive

* disable button that's not implemented yet

* Updated version date

* ci: Remove Manjaro RPI4 target from releases

Only AmiKit was using that, and it moved to Debian12 with the new update

* refactor: Move "abr" under plugins directory

- Handle "abr" as one of the plugins, instead of having it living on a directory in the home dir.
- Moved directory, updated paths and macOS scripts accordingly.
- get_plugin_path() now returns the actual plugins path

* enhancement: expanded DBus support with new events

New DBus events added:
- Insert Floppy
- Insert CD

* enhancement: added one more native lib path

Added /usr/lib/amiberry as one more native lib search path

* enhancement: Added option to use JST instead of WHDLoad binary

In case someone needs this, there is now an option to use JST instead of WHDLoad for the Booter.

use_jst_instead_of_whd (boolean)

The option is saved in the global configuration of amiberry.conf and when enabled, will switch out the startup-sequence references from WHDLoad to JST, including any differences in options.

The old AMOS-based booter is not changed with this.

* enhancement: add filetype associations under macOS

Handle .uae, .adf and .lha files with Amiberry, under macOS

* bugfix: Fixed various glitches in SelectFile dialog (fixes #1417)

- Do not attempt to scroll if the items are less than 32, as they fit in the screen already
- Show the selected item in the text field
- Allow existing files to be selected and used, even when the "createNew" flag is set
- Fixed path building, it would always append to the existing string
- Fixed string assignment in changeDir

* enhancement: always show horizontal scrollbar in Selectfile dialog (fixes #1415)

* build(deps): bump actions/download-artifact in /.github/workflows (#1419)

Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 4.1.2 to 4.1.7.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](actions/download-artifact@v4.1.2...v4.1.7)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* enhancement: upgrade libguisan to latest version, fix various bugs

Guisan has been getting several updates lately, improving and fixing various bugs.
Upgrading to the current version, but keeping my own improvements until I've had time to push them upstream

* bugfix: Listboxes would not resize in width (fixes #1415)

* enhancement: Guisan: Window widget needs to draw frame in inverted colors

* bugfix: Fixed guisan theme colors (fixes #1420)

* bugfix: Some Textboxes should not have a frame drawn

* enhancement: Guisan: improve widget help text

* bugfix: Fixed capitalization in RAM panel (fixes #1422)

* enhancement: apply scaling factor to emulation window also (fixes #1421)

* enhancement: Guisan updates

Added Text class, refactored textbox, textfield etc.

* bugfix: Fixed slider background color after guisan updates

* bugfix: Fix CPU speed slider scale, when Fastest Possible was selected

* enhancement: added .bin, .cdtv and .cd32 as valid rom extensions

* bugfix: fixed dropdown and checkbox colors when disabled

* bugfix: text widget should clear previous rows when setting context

* bugfix: macOS Bundle name should be Amiberry

* cleanup: remove CMakeSettings.json (obsolete)

This is no longer needed, as we're using CMakePresets.json instead

* enhancement: Check if the GUI theme font has the full path also

- If the gui_theme.font_name contains the full path to the font, open it from there directly. This means we can now use system fonts as well, from /usr/share/fonts/...
- If the filename is not found, then try to open it from the data directory, as before

* ci: added Debian files

* build: added CMake install section

* build: change paths for cmake install

* build: added install targets for guisan and floppybridge

* build: ensure external libs are built before binary under CMake

* build: added CPack support

* chore: guisan: harmonize all files to use spaces and same line endings

* enhancement: guisan: radiobutton and togglebutton fixes

These widgets didn't use the proper disabled color

* enhancement: guisan: fix remaining widgets colors

These widgets were also missing their disabled color

* enhancement: guisan: clang tidy, use const when possible

* bugfix: Fixed navigation in Sound panel

It wasn't possible to navigate into the Sound panel, since the first control (dropdown at the top) was disabled by default.

* enhancement: add support for XDG_CONFIG_HOME (fixes #1425)

Added logic to pick up the config directory, from the first match of the following:
- $AMIBERY_CONFIG_DIR
- $XDG_CONFIG_HOME/amiberry
- $HOME/.config/amiberry
- $HOME/.amiberry/conf

if none of the above is found, the fallback is the current logic (portable mode, <current dir>/conf)

* enhancement: Gracefully handle iconv failures

If iconv_open() fails for some reason, do not fail completely but instead try to copy the entries verbatim.

* bugfix: Refresh RTG panel when CPU changes are modified

- The 24-bit addressing option blocks RTG cards from being used. When it's disabled, the RTG panel should refresh, to enable any relevant widgets
- Fixed navigation in RTG panel (the VRAM slider could not be accessed)

* chore: remove unneeded ifdef

* Big bang winuae merge (#1428)

* enhancement: Merge more WinUAE code

- Added PPC
- Added PCEM
- Added PCI
- Added MAME (A2410 and TM34010)
- Added QEMU (various gfx cards, network cards, SCSI, etc)
- Enabled relevant ifdefs

* enhancement: Added luascript, slirp_uae

- Removed unused ersatz
- Added luascript (disabled for now, needs an extra library)
- Added slirp_uae (disabled for now)
- Added sources for separate tool "uaeunp"

* enhancement: Added DSP emulation

- Added DSP emulation files from WinUAE, with slight modifications (disabled for now)

* enhancement: Enabled TabletLibrary, DSP, Draco

Not implemented on the GUI yet, but enabled related ifdefs in the code

* enhancement: Added SANA2 support

Not visible on the GUI yet

* enhancement: sync includes and other details with WinUAE

* enhancement: added support for more RTG boards

* bugfix: added missing arm/arm64 headers for pcem codegen_backend

WinUAE didn't have these, so let's grab them from PCem v16 directly

* enhancement: Fixed defines in picasso96.cpp

* bugfix: Maybe we should actually sleep for a few ms in sleep_millis2

* enhancement: P96 - added ifdefs where Amiberry-specific pieces are added

* chore: sync time/rpt headers with WinUAE

* chore: reduce the lines of ifdefs in ahi_v2

* enhancement: use SDL_Delay instead of waiting for the cpu_wakeup_event

* perf: only call init_row_map if the pixels have changed

* enhancement: Added GVP T-Rex II

Merged from WinUAE

* enhancement: Added DKB WildFire v1.0 and Masoboshi v2.197

Merged from WinUAE

* enhancement: Flush trap queues during reset.

* bugfix: Added missing S3 Virge PCI byteswap mode

Merged from WinUAE

* perf: Do not unnecessarily call SetCursor() continuously.

* bugfix: Fixed uae_sem_unpost

This should be SemPost, not SemWait

* enhancement: Allow 16-bit only if D3D9 is selected.

Merged from WinUAE - Amiberry uses gfx_api value 2 anyway.

* bugfix: Fix SPRxPOS modification just before horizontal match if sprite had lowest horizontal bit set.

Merged from WinUAE

* enhancement: Both COPxJMP strobe emulation update

Merged from WinUAE

* enhancement: Serial emulation updates, more accurate transmit timing, receive timing is not anymore instant except in direct mode.

Merged from WinUAE

* enhancement: OpalVision undocumented horizontal panning emulation

address load was ignored if it was included in second control line.

* perf: Reduce amount of read_processor_time() calls.

Merged from WinUAE

* build: updated makefile with new files

* enhancement: added PPC options to GUI

* enhancement: added MapROM option in GUI

* bugfix: GUI RAM Panel did not highlight selected items properly

* enhancement: added label in Input panel for Parallel Port joystick adapter

The label should make it more clear that the last two ports are for the emulated parallel port joystick adapter

* enhancement: GUI listbox inactive color improvement

The guisan listbox would use an inactive color of a fixed value.
It should use something from the color scheme, instead.

* enhancement: added more models and configs in Quickstart

* build: set the compiler standard higher in the Makefile

* bugfix: fix ambiguous variable names

* ci: avoid using named initializers in file, otherwise we run into a GCC bug

This code won't compile with older GCC versions, due to a known bug:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55227

* ci: fixed voodo file as well (see previous commit reason)

* ci: fixed one more file with named initializers

* ci: upgrade the minimum CMake version for capsimage

Get rid of a warning about older CMake versions being deprecated soon

* ci: change SDL_ttf include in sdltruetypefont.hpp

* ci: updated more SDL includes in guisan

* ci: Cmake builds would fail if started under a subdir (#1430)

* ci: Cmake builds would fail if started under a subdir

* ci: add cmake files needed for bullseye

* ci: updated macOS include directories

* ci: fix compiler error under clang/macOS

* ci: remove unused linker flag

* ci: add cmake in macOS homebrew

* chore: fix compiler warnings in calc

Well, most of them anyway

* Revert "build: set the compiler standard higher in the Makefile"

This reverts commit e822fe8.

* bugfix: Editing entries in HD GUI panel was broken

* ci: ensure Apple ARM builds don't detect both arm32 and arm64 defines

* ci: more Cmake files for MacOS

* ci: macos fixes, guisan should be static

* ci: cleanup makefile macos targets

* ci: fix macos apple silicon flags

* ci: fix cmake linker flags for macos

* ci: more macos Makefile fixes

* ci: MacOS fix - remove rt lib from linker in Makefile

* ci: MacOS fixes - Remove one more lib from the linker in the Makefile

* ci: MacOS Makefile fixes: link to iconv

* ci: Fixed typo

* chore: make it clear that these flags are for ARM builds only

* ci: Remove cmake and wget from MacOS homebrew runner

these are already installed in the runner environment anyway

* ci: remove autoconf from macos homebrew runner as well

* ci: Fix capsimg filename for MacOS

* Update make-bundle.sh

* Remove unnecessary architecture detection

* First imports of toolchain files for cross-compiling

* Yet another fix for CMake that will help both OSX and Debian Bullseye

* Cmake packaging (#1431)

* modify CMakeLists.txt to be able to build packages for MacOS and Linux

* Moved pull request template to .github dir

* Moved code of conduct file under .github directory

* Removed gitmodules file

* Moved install extra dirs to only if we're not building an Apple bundle

* Added first version of a Deb package option to CPack

* Fixed double directory creation during installation/packaging

* Remove debian directory

We won't be using this, going for CPack instead

* Fixed package version

* Clean up contents of packages

* Fix dependencies and filename of .deb package

* Bump version to 6.3.5

* Add desktop file for Deb package

* Remove archive generator, the DEB one is good enough

* Change pipeline to use CMake for Linux targets

Let's generate some .deb files!
This is most likely missing stuff, like the distro name...

* Fix incorrect architecture names in cross-compiler

* Fix 32-bit arm package architecture

* ci: Allow 32-bit arm builds

* ci: disable the bullseye builds for now

Until we figure out a solution with Bullseye + CMake + SDL2_image/SDL2_ttf

* ci: fix expected targets

* ci: bring back bullseye builds

* Remove path from desktop shortcut

* Fixed typo in comment

* Set the version in the Project, use that for CPack

* Updated compiled and linker flags with no-pie properly

- There were some differences between the Makefile flags and CMake. Now they are identical
- Updated the Findmpg123.cmake file with the latest one from upstream

* Include bullseye build targets again

* Increase GFX MAX_RTG_Boards to 4 as it looks like Picasso96 code is expecting 4 not the 1 listed. (#1434)

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Alexander Wilms <Alexander-Wilms@users.noreply.github.com>
Co-authored-by: Adam Sampson <ats-github@offog.org>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Solskogen <christer.solskogen@gmail.com>
Co-authored-by: BluewizardNet <ryan@bluewizard.net>
midwan added a commit that referenced this issue Sep 24, 2024
* enhancement: OCS Agnus + OCS Denise config also has line 0 visible at the bottom of screen (like A1000)

* Fix base color for Radiobuttons in SaveStates panel (#1293)

* doc: added new option in usage help text (fixes #1319)

* Update PanelChipset.cpp

* bugfix: Always clear the text fields when deleting a config (fixes #1321)

* bugfix: Fullscreen toggle didn't quite work (fixes #1322)

* bugfix: Set right colors for checkboxes that were missed, so that themes work properly on them

* bugfix: Use the right APMODE when toggling full-screen (fixes #1324)

* Use the Default toggle screenmode instead of windowed<->fullscreen

* feat: added window scaling option in amiberry.conf

This option allows you to set the window scaling for the GUI window.
The default option is 1.0, which is the normal 100% scaling.
The value is a float, so you can dynamically set it to whatever you need, depending on your monitor's resolution.

For example, you can set it to:
1.250 = 125%
1.50  = 150%
2.0   = 200%

* enhancement: Fix AGA genlock transparency bit being detected as special blanking bits

(merged from WinUAE)

* refactor: rename gui theme internal variables

* feat: implemented GUI foreground color option for themes

* bugfix: Quickstart - enabling 2nd floppy drive did not refresh panel

* doc: updated help text

the --cdimage option does not change configuration, only inserts the CD. The help text did not clearly reflect that

* bugfix: Make guisan widgets active/inactive status more visible (fixes #1326)

Some widgets were not greyed out when disabled

* enhancement: CPU panel had widgets that were not shown as disabled (#1326)

The MMU and CPU Data Cache options were not visibly disabled as they should

* Remove HighDPI window flag

* bugfix: Fixed textbox background color in Create hardfile dialog (fixes #1327)

* include <string> in CommonBridgeTemplate.h

* refactor: minor tidy in SelectFolderf

* Add stdint.h include in SerialIO.h (fixes compile with newer GCC)

* sync resource.h with upstream

* bugfix: Floppy GUI panel didn't show the select file buttons anymore (fixes #1331)

* refactor: Create plugins directory, use it for external plugins (like floppybridge)

From now on, external libraries such as the CAPSimg.so and libfloppybridge.so, will live in a separate directory named "plugins". This cleans up the main dir from such files.

The new path is added to the GUI (Paths) and config files accordingly. The default value is <start_path>/plugins.

The Makefile will now build floppybridge by default - CAPSimg is a submodule, so it needs to be checked out before it can be built.

MacOS is a special case, since the libs there should be under the Resources folder. So, we're leaving that as-is for now.

* ci: update pipeline with plugin changes

* bugfix: only add the module extension if it's actually missing

* ci: allow floppybridge to use older CMake versions also (3.13 for buster)

* minor tidy

* bugfix: Under KMSDRM the GUI would not open a second time (fixes #1333)

- The window focus was not grabbed when resuming emulation after the GUI, so any subsequent attempt to re-enter the GUI failed.
- Removed single_window_mode option, as it's too buggy and not really worth the trouble.

* refactor: Use CD32 model as a fallback for CD auto-detection (fixes #1325)

Instead of checking for CDTV, then CD32 and as a fallback going for A1200CD, we will look for CDTV and use CD32 as a fallback always.

Most of the titles will be in those two categories anyway, and many might not contain that in the file path, leading to incorrectly trying to boot them (and failing) as an A1200 CD config.

* enhancement: improved console handling in writelog

* bugfix: if console_logging is requested, ensure it's activated always

If console_logging was enabled, but write_logfile was not, then write_log would not show any output.
This changes the behavior so that if console_logging is enabled, we always get output.

* bugfix: Use WHDLoad custom1-5 values if they are not zero (fixes #1328)

Since we always set the default value to zero, this should be safe to use.
Apparently some games do not have some custom fields set, but still use them if specified (e.g. BattleIsle)

* enhancement: ATAPI Write / Mode Select fix (merged from WinUAE)

* enhancement: Serial port undocumented OVRUN behavior emulated. Fast CPU mode + loopback serial port mode fix.

Merged from WinUAE

* Updated version date

* bugfix: the floppy dropdown wasn't updated properly after a selection (fixes #1334)

* refactor: Use "Plugins" directory for macOS

* Resize and center icon

* Leave .so files in Resources for macOS, otherwise dlopen doesn't find them

* Try to fix extension .so being added under macOS always

* Revert "Resize and center icon"

This reverts commit 5386f2b.

* enhancement: Set config name automatically for CD images as well (fixes #1336)

When Floppies or WHDLoad archives are inserted from the Quickstart panel, the last active config name is updated to the filename used.
This did not apply to CD images however.

This commit fixes that behavior, so it's consistent across all types of disk images.

* feat: Added button to Create new folder in the dialogs (fixes #1329)

A new button is now available in the Select File/Folder dialogs: Create Folder

This allows the user to create a new directory inside the currently selected one.

* bugfix: Fixed CD dropdown did not refresh properly (fixes #1337)

When selecting a new CD image, the items in the dropdown did not refresh as expected in the Quickstart panel.
This worked correctly in the HD/CD panel.

Also synced the behavior a bit between the two panels.

* bugfix: Fixed plugins directory name in macOS script

* refactor: Remove CreateFolder button from SelectFile (fixes #1338)

There's no need to Create a new folder, when you're about to select a File

* ci: CMake will now copy libfloppybridge.so into plugins when finished

* ci: add the new folders in flatpak as well

* Updated version date

* build: fix CMake copy of floppybridge lib destination path

* ci: avoid relative paths for placing floppybridge library

Apparently, this won't work everywhere - flatpak failed with the relative paths

* ci: change destination of floppybridge library

It should be the top-level source dir, not the floppybridge one

* Try to fix the relative path once more

* Revert "Try to fix the relative path once more"

This reverts commit 9946d56.

* Revert "ci: change destination of floppybridge library"

This reverts commit af14d19.

* ci: change copying of floppybridge lib, do it on the root CMake file instead

* ci: Removed Buster platforms from pipeline targets

Debian Buster is EOL soon, might as well remove it from the pipelines

* Update README.md

Minor updates, to indicate dropping support for Buster

* Add keywords to .desktop file (#1342)

These are also used by Flathub, KDE Discover and Gnome Software

* enhancement: Improve WHDLoad config handling

* bugfix: load any .uae config after parsing the XML settings, not before (fixes #1343)

* ci: copy lib into plugins after the dir is created

* bugfix: Fixed crash when saving config files (fixes #1345)

* enhancement: When selecting CD32 model, set joystick port to CD32 also (fixes #1346)

* Updated version to 6.3.2

* doc: Updated help text in Input panel (fixes #1349)

* Update README.md

* Update README.md

* Change gui_always_on_top to true, by default (fixes #1351)

Set the GUI to be always on top by default.
This should help with cases where we are in Full screen mode, and sometimes the GUI opens behind the emulation screen.

* feat: Implemented Integer scaling (fixes #1352)

Added Integer scaling as an option in the Display panel.
This saves to the config file, and can be set in amiberry.conf as well.
The value 2 can be used in the scaling_method option, to set this as the default.

* Package macOS bundles on each build

* fix integer scaling was blurry (#1352)

When using Integer scaling, the Nearest Neighbor SDL2 hint should be used

* only enable GUI always on top, if we have fullscreen by default (#1351)

We don't want the GUI to be always on top in Windowed mode also

* improve integer scaling (#1352)

* Remove obsolete option from amiberry.conf

* Revert "improve integer scaling (#1352)"

This reverts commit f3db2f2.

* Don't set GUI always on top, try to raise the GUI window when it opens, instead (#1351)

* build: ensure the floppybridge build is completed, before attempting to copy the lib

* feat: implemented Resolution Autoswitch option

This option comes from WinUAE, and when enabled, allows the automatic selection between horizontal LowRes/HiRes and vertical Single/Double line modes

* enhancement: auto-crop scaling improvements, for integer scaling

When we use Integer scaling, we don't want the width/height doubled during autocrop.
One exception to that is when we have HiRes horizontally, and single line mode (where we need to double the height, in order to keep the aspect ratio correct)

* bring back HighDPI support on windows

This was removed as a test, but it didn't make a difference

* enhancement: make "System Default" sound card option the default

The System Default will now be enabled by default, as it seems to work best for most cases.
If you want another sound output device selected, you can always change that.

Config files should not be affected anyway, this is just a more sensible default.

* bump version to 6.3.3

* enhancement: GUI window improvements

- Set window to always on top, if we're running it in Full-window
- RaiseWindow later in the process

* bugfix: keyboard and mouse was not always grabbed (#1351)

When going from GUI->Emulation repeatedly, sometimes the input was not grabbed as expected

* bugfix: don't grab mouse/keyboard in the GUI window (fixes #1357)

* Update README.md

Added Ko-Fi support button

* bugfix: VKBD would not show if Auto-Crop was enabled

When Auto-Crop was enabled, the texture size was changed. However, VKBD did not update the X/Y coordinates it uses, so the image it showed could happen to be off-screen.

* ci: Rename macOS M1 to macOS Apple Silicon

* ci: fix apple silicon build

* bugfix: Custom controls would not get loaded when starting from cmd line (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.

* enhancement: Make GUI window follow the same logic as the emulation one (#1351)

- If KMSDRM is detected, set the mode to FULL-WINDOW
- If a resolution less than 800x600 is detected, go for Full-window as well
- Otherwise, we'll follow the settings requested regarding Windowed/Fullscreen/Full-window mode

* feat: Added default option to control resolution autoswitch from amiberry.conf

This option helps get the best results out of integer scaling, in combination with auto-crop and full-window modes

* Updated version date

* Change Full-screen toggle behavior - use full-window <-> window (#1351)

Let's prefer Full-window instead of Fullscreen, to avoid screenmode changes on the monitor

* refactor: return to previous approach: GUI window is always Windowed, except on KMSDRM (#1351)

Due to how modern Window Managers handle things, if we open the GUI in full-window while the emulation screen is also opened in full-window, the second one gets minimized. That means that when we resume from the GUI, we don't get back to the emulation screen, even if we call for SDL_RaiseWindow() - it gets ignored.

To resolve this, I'm reverting this behavior to the previous approach: The GUI is always Windowed, and opens on top of the emulation screen. The exception is when we're using KMSDRM, which doesn't have the notion of windows.

But under KMSDRM we might run into a similar problem as well, so that needs a separate solution.

* Update c-cpp.yml

Try adding a `brew upgrade` step

* Update c-cpp.yml

* Update c-cpp.yml

* Update c-cpp.yml

* bugfix: Fix KMSDRM problems when switching between GUI -> emulation (fixes #1351)

The emulation screen would not get the focus always, when resuming from the GUI, if running under KMSDRM.
Removed the code that checked if the window had focus, and instead trying to grab it right away now.

It still sometimes doesn't get it (not sure why), but at least you can click on it once and resume properly now.

* bugfix: when loading custom mapping, skip the check for isrealbutton (#1355)

* refactor: Refactored target_cfgfile_load

* Updated version date

* refactor: remove more checks for isrealbutton from controller mapping (#1355)

* refactor: added some more logging in target_cfgfile_load function (#1355)

* refactor: accept .uae config files in cmd line, even if they are not the last item (#1355)

uae config files and savestates were only accepted from the command line, if they were the last parameters. If we however wanted to include -G after them (to hide the GUI), they would not get loaded.

* Updated version date

* build: add USE_GPIOD in CMakeLists.txt also

* Remove some entries from CMakeSettings.json

* bugfix: store joystick GUID, use it to check before re-importing joysticks (#1355)

* feat: Auto-detect MT32 titles in whdbooter

Auto-detect any titles supporting MT32 MIDI output in WHDBooter, and enable the relevant feature in Amiberry (if the ROMs are installed).
This currently works based on the filename (it has to contain the word "MT32"), as it's not included in the XML.
Not many title supported MT32, so maybe this is good enough.

* Updated version date

* Merged latest WinUAE updates

Added support for Picmatic Tierras Salvajes and Marbella Vice

* Update README.md

* bugfix: fixed typo in Sound panel (fixes #1369)

* refactor: use string.empty()

* enhancement: Added VSync options from WinUAE in Display panel (#1368)

Added the WinUAE VSync options for Native and RTG as dropdowns, instead of the single checkbox we had before.
The Lagless modes are not implemented, not even sure we can do that in SDL2.
The other modes work the same way as in WinUAE.

Amiberry still uses V-Sync internally for the SDL_Presenter, so this only changes what is passed internally in the emulation. These options only make sense to enable if the monitor is already set to the right refresh rate - i.e. don't enable if your monitor only does 60Hz and you want to emulate a PAL machine (which needs 50).

* bugfix: Fixed changing logfile name would append "amiberry.log" at the end

The SelectFile dialog had an incorrect filter setting, which ended up appending the whole default filename instead of only the ".log" extension, if it wasn't found.

* refactor: slight refactor of mapping from retroarch function

* bugfix: joystick input didn't work with retroarch mapping after latest changes (#1363)

* Bumped version to 6.3.4

* Macos folder changes (#1373)

* refactor: use separate dir for amiberry.conf and data under macOS (#1372)

Moving the contents of the data folder and amiberry.conf, under <user>/Library/Application Support/Amiberry for macOS platforms

* Fix capsimg (#1374)

* Remove capsimg submodule

* Add capsimg sources

* Add dependencies in Makefile and CMakeLists.txt to build libcapsimage.so

* Fix path in makefile

* Add libs to make clean also

* Automatically build capsimg as well

* Remove extra step to build capsimg from pipeline

* bugfix: Fixed new/free mismatch in amiberry_filesys (#1387)

* bugfix: Fixed display modes iteration (fixes #1394)

* enhancement: Make Paths panel textboxes read-only (fixes #1385)

* bugfix: always refresh floppy/quickstart panels after disk changes (fixes #1378)

* bugfix: Refresh all panels when WHDLoad action from Quickstart is taken (fixes #1383)

* Add FPS Adjustment options to the Display panel (#1399)

* enhancement: Add FPS Adjustment options to the Display panel (fixes #1397)

* Fix build under macOS

* Updated version date

* bugfix: Fix Picmatic (100Hz TV only) light gun positioning in lores or shres resolutions

* bugfix: Fix duplicated Golem SCSI II / HD3000 name prefix.

* bugfix: Always clear intreq2 in audio state 5.

* enhancement: add secondary check when loading cfg files, look in configs folder for filename (fixes #1388)

* enhancement: resample audio during Push operations (#1397)

* bugfix: detect uppercase MT32 filenames also (fixes #1386) (#1400)

* Updated XML to latest version

* Improve macOS instructions (fixes #1382)

* enhancement: fix inconsistency regarding default config name (fixes #1395)

* Minor sync with WinUAE

No functional changes, just minimizing diffs from WinUAE sources

* Another round of syncs to WinUAE

* enhancement: GUI - Make read-only textboxes in WHDLoad panel show as such (fixes #1403)

Make the read-only text boxes show as such (disabled), since no user input is supported there

* Updated version date

* Minor sync with WinUAE

* enhancement: updated FloppyBridge to v1.6.4

* Updated version date

* enhancement: updated game controller DB to latest version

* enhancement: updated WHDLoad XML to latest version

* bugfix: don't refresh the emulation screen when GUI is open, under KMSDRM (#1401)

* bugfix: Don't replace spaces in native_dos_op

With the newer version of host-run (v1.6 onwards), this should not be necessary anymore

* bugfix: Fixed bug under KMSDRM, where the emulation screen would not show (#1401)

Under KMSDRM, if you started Amiberry from the command line with the -G parameter, and you entered the GUI once, resuming would not show the emulation screen.

* bugfix: remove newlines from debugger input (#1407)

The "fd" command didn't work in the debugger. This was because the "d"
was followed in the input buffer by \n rather than \0.

The Windows version of console_get replaces the terminating \r with \0.
amiberry's version uses fgets, which doesn't do this; it did adjust the
length value returned, but the debugger code doesn't look at the length.

Make it actually strip the newline characters when adjusting the length.

* bugfix: release window grab in the debugger (#1406)

When the debugger is entered with Shift-F12, this function is called to
release the mouse pointer. The second argument to SDL_SetWindowGrab
should be SDL_FALSE to disable the grab; previously, both _acquire and
_release had SDL_TRUE, which enables the grab.

* enhancement: improve help text in Misc panel (fixes #1408)

* Revert "enhancement: resample audio during Push operations (#1397)"

This reverts commit a70dd17.

* enhancement: auto-select the first item in the Configs list (fixes #1391)

If we have items in the Configs list, automatically select the first one.

* enhancement: Log command line parameters on startup (fixes #1380)

If logging is enabled, also log the full command line used to start up

* enhancement: harmonize buttons in HDD GUI panel

Change label on Add Directory, to indicate it also supports archives.
Harmonize the widths of those buttons.
Improve label on CD select image file.

* Added CMakePresets.json

* enhancement: use string.empty() instead of comparing with ""

* bugfix: When using KMSDRM, controller input was lost after entering the GUI once (fixes #1384)

This seems to be caused by SDL2 when using KMSDRM only, as it works properly under X.
As a workaround, I'm changing the logic to keep only a single window and renderer when KMSDRM is detected.

* Updated version date

* bugfix: KMSDRM fixes for when using a single window (fixes #1411)

Disable integer scaling when opening the GUI, trigger an update of scaling options when resuming

* enhancement: separate data from home directories, improve handling (fixes #1073)

- Separate DATA from HOME directories
- Use special ENV variables to override locations: AMIBERRY_DATA_DIR and AMIBERRY_HOME_DIR respectively
- Use the standard Linux locations if the env variables are not set: /usr/share/amiberry/data for the DATA folder, and $HOME/.amiberry for the HOME folder
- Fallback to the Portable mode used before, if all the above fail

* enhancement: Fix new paths logic for Flatpak also (#1073)

* enhancement: improve look of GUI Misc panel scrollbar (fixes #1412)

* 1376 add a3000 scsi controller and tape support for amiga unix amix (#1414)

* enhancement: added CD and Tape drive buttons

Added new buttons in the GUI: HDD panel, for handling CD and Tape drives.

* Refactoring of GUI HD Panel

- Added TapeDrive option
- Refactored GUI panels to look more like WinUAE
- Refactored functionality to closer match that of WinUAE

* bugfix: Fixes for HDD panel windows

* bugfix: Fixed default paths in dialogs

* enhancement: Harmonize TapeDrive dialog logic with others

Set the default path (harddrives) if no path is configured, before opening the dialog

* enhancement: Updated Create HF dialog

- The dialog will now only create HDFs, not add them as well

* enhancement: fix navigation in Create HDF dialog

* enhancement: Added Special Monitors support

* enhancement: Added special monitors support in GUI

* enhancement: fixed navigation for Tape Drive and other HDD panel dialogs

* enhancement: improvements in the Add HardDrive dialog

Added controller, unit, type and feature level dropdowns

* enhancement: fixed navigation in Panel Harddrive

* disable button that's not implemented yet

* Updated version date

* ci: Remove Manjaro RPI4 target from releases

Only AmiKit was using that, and it moved to Debian12 with the new update

* refactor: Move "abr" under plugins directory

- Handle "abr" as one of the plugins, instead of having it living on a directory in the home dir.
- Moved directory, updated paths and macOS scripts accordingly.
- get_plugin_path() now returns the actual plugins path

* enhancement: expanded DBus support with new events

New DBus events added:
- Insert Floppy
- Insert CD

* enhancement: added one more native lib path

Added /usr/lib/amiberry as one more native lib search path

* enhancement: Added option to use JST instead of WHDLoad binary

In case someone needs this, there is now an option to use JST instead of WHDLoad for the Booter.

use_jst_instead_of_whd (boolean)

The option is saved in the global configuration of amiberry.conf and when enabled, will switch out the startup-sequence references from WHDLoad to JST, including any differences in options.

The old AMOS-based booter is not changed with this.

* enhancement: add filetype associations under macOS

Handle .uae, .adf and .lha files with Amiberry, under macOS

* bugfix: Fixed various glitches in SelectFile dialog (fixes #1417)

- Do not attempt to scroll if the items are less than 32, as they fit in the screen already
- Show the selected item in the text field
- Allow existing files to be selected and used, even when the "createNew" flag is set
- Fixed path building, it would always append to the existing string
- Fixed string assignment in changeDir

* enhancement: always show horizontal scrollbar in Selectfile dialog (fixes #1415)

* build(deps): bump actions/download-artifact in /.github/workflows (#1419)

Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 4.1.2 to 4.1.7.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](actions/download-artifact@v4.1.2...v4.1.7)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* enhancement: upgrade libguisan to latest version, fix various bugs

Guisan has been getting several updates lately, improving and fixing various bugs.
Upgrading to the current version, but keeping my own improvements until I've had time to push them upstream

* bugfix: Listboxes would not resize in width (fixes #1415)

* enhancement: Guisan: Window widget needs to draw frame in inverted colors

* bugfix: Fixed guisan theme colors (fixes #1420)

* bugfix: Some Textboxes should not have a frame drawn

* enhancement: Guisan: improve widget help text

* bugfix: Fixed capitalization in RAM panel (fixes #1422)

* enhancement: apply scaling factor to emulation window also (fixes #1421)

* enhancement: Guisan updates

Added Text class, refactored textbox, textfield etc.

* bugfix: Fixed slider background color after guisan updates

* bugfix: Fix CPU speed slider scale, when Fastest Possible was selected

* enhancement: added .bin, .cdtv and .cd32 as valid rom extensions

* bugfix: fixed dropdown and checkbox colors when disabled

* bugfix: text widget should clear previous rows when setting context

* bugfix: macOS Bundle name should be Amiberry

* cleanup: remove CMakeSettings.json (obsolete)

This is no longer needed, as we're using CMakePresets.json instead

* enhancement: Check if the GUI theme font has the full path also

- If the gui_theme.font_name contains the full path to the font, open it from there directly. This means we can now use system fonts as well, from /usr/share/fonts/...
- If the filename is not found, then try to open it from the data directory, as before

* ci: added Debian files

* build: added CMake install section

* build: change paths for cmake install

* build: added install targets for guisan and floppybridge

* build: ensure external libs are built before binary under CMake

* build: added CPack support

* chore: guisan: harmonize all files to use spaces and same line endings

* enhancement: guisan: radiobutton and togglebutton fixes

These widgets didn't use the proper disabled color

* enhancement: guisan: fix remaining widgets colors

These widgets were also missing their disabled color

* enhancement: guisan: clang tidy, use const when possible

* bugfix: Fixed navigation in Sound panel

It wasn't possible to navigate into the Sound panel, since the first control (dropdown at the top) was disabled by default.

* enhancement: add support for XDG_CONFIG_HOME (fixes #1425)

Added logic to pick up the config directory, from the first match of the following:
- $AMIBERY_CONFIG_DIR
- $XDG_CONFIG_HOME/amiberry
- $HOME/.config/amiberry
- $HOME/.amiberry/conf

if none of the above is found, the fallback is the current logic (portable mode, <current dir>/conf)

* enhancement: Gracefully handle iconv failures

If iconv_open() fails for some reason, do not fail completely but instead try to copy the entries verbatim.

* bugfix: Refresh RTG panel when CPU changes are modified

- The 24-bit addressing option blocks RTG cards from being used. When it's disabled, the RTG panel should refresh, to enable any relevant widgets
- Fixed navigation in RTG panel (the VRAM slider could not be accessed)

* chore: remove unneeded ifdef

* Big bang winuae merge (#1428)

* enhancement: Merge more WinUAE code

- Added PPC
- Added PCEM
- Added PCI
- Added MAME (A2410 and TM34010)
- Added QEMU (various gfx cards, network cards, SCSI, etc)
- Enabled relevant ifdefs

* enhancement: Added luascript, slirp_uae

- Removed unused ersatz
- Added luascript (disabled for now, needs an extra library)
- Added slirp_uae (disabled for now)
- Added sources for separate tool "uaeunp"

* enhancement: Added DSP emulation

- Added DSP emulation files from WinUAE, with slight modifications (disabled for now)

* enhancement: Enabled TabletLibrary, DSP, Draco

Not implemented on the GUI yet, but enabled related ifdefs in the code

* enhancement: Added SANA2 support

Not visible on the GUI yet

* enhancement: sync includes and other details with WinUAE

* enhancement: added support for more RTG boards

* bugfix: added missing arm/arm64 headers for pcem codegen_backend

WinUAE didn't have these, so let's grab them from PCem v16 directly

* enhancement: Fixed defines in picasso96.cpp

* bugfix: Maybe we should actually sleep for a few ms in sleep_millis2

* enhancement: P96 - added ifdefs where Amiberry-specific pieces are added

* chore: sync time/rpt headers with WinUAE

* chore: reduce the lines of ifdefs in ahi_v2

* enhancement: use SDL_Delay instead of waiting for the cpu_wakeup_event

* perf: only call init_row_map if the pixels have changed

* enhancement: Added GVP T-Rex II

Merged from WinUAE

* enhancement: Added DKB WildFire v1.0 and Masoboshi v2.197

Merged from WinUAE

* enhancement: Flush trap queues during reset.

* bugfix: Added missing S3 Virge PCI byteswap mode

Merged from WinUAE

* perf: Do not unnecessarily call SetCursor() continuously.

* bugfix: Fixed uae_sem_unpost

This should be SemPost, not SemWait

* enhancement: Allow 16-bit only if D3D9 is selected.

Merged from WinUAE - Amiberry uses gfx_api value 2 anyway.

* bugfix: Fix SPRxPOS modification just before horizontal match if sprite had lowest horizontal bit set.

Merged from WinUAE

* enhancement: Both COPxJMP strobe emulation update

Merged from WinUAE

* enhancement: Serial emulation updates, more accurate transmit timing, receive timing is not anymore instant except in direct mode.

Merged from WinUAE

* enhancement: OpalVision undocumented horizontal panning emulation

address load was ignored if it was included in second control line.

* perf: Reduce amount of read_processor_time() calls.

Merged from WinUAE

* build: updated makefile with new files

* enhancement: added PPC options to GUI

* enhancement: added MapROM option in GUI

* bugfix: GUI RAM Panel did not highlight selected items properly

* enhancement: added label in Input panel for Parallel Port joystick adapter

The label should make it more clear that the last two ports are for the emulated parallel port joystick adapter

* enhancement: GUI listbox inactive color improvement

The guisan listbox would use an inactive color of a fixed value.
It should use something from the color scheme, instead.

* enhancement: added more models and configs in Quickstart

* build: set the compiler standard higher in the Makefile

* bugfix: fix ambiguous variable names

* ci: avoid using named initializers in file, otherwise we run into a GCC bug

This code won't compile with older GCC versions, due to a known bug:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55227

* ci: fixed voodo file as well (see previous commit reason)

* ci: fixed one more file with named initializers

* ci: upgrade the minimum CMake version for capsimage

Get rid of a warning about older CMake versions being deprecated soon

* ci: change SDL_ttf include in sdltruetypefont.hpp

* ci: updated more SDL includes in guisan

* ci: Cmake builds would fail if started under a subdir (#1430)

* ci: Cmake builds would fail if started under a subdir

* ci: add cmake files needed for bullseye

* ci: updated macOS include directories

* ci: fix compiler error under clang/macOS

* ci: remove unused linker flag

* ci: add cmake in macOS homebrew

* chore: fix compiler warnings in calc

Well, most of them anyway

* Revert "build: set the compiler standard higher in the Makefile"

This reverts commit e822fe8.

* bugfix: Editing entries in HD GUI panel was broken

* ci: ensure Apple ARM builds don't detect both arm32 and arm64 defines

* ci: more Cmake files for MacOS

* ci: macos fixes, guisan should be static

* ci: cleanup makefile macos targets

* ci: fix macos apple silicon flags

* ci: fix cmake linker flags for macos

* ci: more macos Makefile fixes

* ci: MacOS fix - remove rt lib from linker in Makefile

* ci: MacOS fixes - Remove one more lib from the linker in the Makefile

* ci: MacOS Makefile fixes: link to iconv

* ci: Fixed typo

* chore: make it clear that these flags are for ARM builds only

* ci: Remove cmake and wget from MacOS homebrew runner

these are already installed in the runner environment anyway

* ci: remove autoconf from macos homebrew runner as well

* ci: Fix capsimg filename for MacOS

* Update make-bundle.sh

* Remove unnecessary architecture detection

* First imports of toolchain files for cross-compiling

* Yet another fix for CMake that will help both OSX and Debian Bullseye

* Cmake packaging (#1431)

* modify CMakeLists.txt to be able to build packages for MacOS and Linux

* Moved pull request template to .github dir

* Moved code of conduct file under .github directory

* Removed gitmodules file

* Moved install extra dirs to only if we're not building an Apple bundle

* Added first version of a Deb package option to CPack

* Fixed double directory creation during installation/packaging

* Remove debian directory

We won't be using this, going for CPack instead

* Fixed package version

* Clean up contents of packages

* Fix dependencies and filename of .deb package

* Bump version to 6.3.5

* Add desktop file for Deb package

* Remove archive generator, the DEB one is good enough

* Change pipeline to use CMake for Linux targets

Let's generate some .deb files!
This is most likely missing stuff, like the distro name...

* Fix incorrect architecture names in cross-compiler

* Fix 32-bit arm package architecture

* ci: Allow 32-bit arm builds

* ci: disable the bullseye builds for now

Until we figure out a solution with Bullseye + CMake + SDL2_image/SDL2_ttf

* ci: fix expected targets

* ci: bring back bullseye builds

* Remove path from desktop shortcut

* Fixed typo in comment

* Set the version in the Project, use that for CPack

* Updated compiled and linker flags with no-pie properly

- There were some differences between the Makefile flags and CMake. Now they are identical
- Updated the Findmpg123.cmake file with the latest one from upstream

* Include bullseye build targets again

* Increase GFX MAX_RTG_Boards to 4 as it looks like Picasso96 code is expecting 4 not the 1 listed. (#1434)

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Alexander Wilms <Alexander-Wilms@users.noreply.github.com>
Co-authored-by: Adam Sampson <ats-github@offog.org>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Solskogen <christer.solskogen@gmail.com>
Co-authored-by: BluewizardNet <ryan@bluewizard.net>
Co-authored-by: Dimitris Panokostas <dimitris.panokostas@norce.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants