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

Android: Hook up the new config system #8975

Merged
merged 8 commits into from
Sep 16, 2020

Conversation

JosJuice
Copy link
Member

@JosJuice JosJuice commented Jul 22, 2020

This gives users the ability to edit settings while emulation is running, and improves the game settings editor by highlighting settings which are overridden and by showing the user's config instead of defaults for settings which are not overridden. This also makes it relatively easy for a future PR to add SYSCONF settings to the Android GUI.

@JosJuice JosJuice force-pushed the android-new-config branch 2 times, most recently from c0099b6 to 776ffb6 Compare July 22, 2020 21:08
@JosJuice JosJuice force-pushed the android-new-config branch from 776ffb6 to 5808ab5 Compare July 23, 2020 10:10
@JosJuice JosJuice force-pushed the android-new-config branch from 5808ab5 to 5479bc7 Compare July 23, 2020 10:26
@JosJuice JosJuice force-pushed the android-new-config branch 2 times, most recently from 83dbeb4 to 5595ad7 Compare August 3, 2020 16:43
@JosJuice JosJuice force-pushed the android-new-config branch 2 times, most recently from ced1b0b to 9228997 Compare August 7, 2020 09:30
@lioncash
Copy link
Member

lioncash commented Sep 8, 2020

After the conflicts are fixed, feel free to merge this once the buildbot checks pass. This has been sitting around for quite a while (sorry about that!)

@JosJuice
Copy link
Member Author

JosJuice commented Sep 8, 2020

I'd like to leave some additional time before merging this in case @Ebola16 wants to review it. PR #8941 (which this PR was dependent on) was merged just two days ago, and I believe they said they would look in more detail at this PR after the merge of that PR.

@Ebola16
Copy link
Member

Ebola16 commented Sep 8, 2020

I'll probably be able to review this within a day or two. I still need to carefully rebase my Wii Overlay PR. A rebase for this PR would be helpful though.

@JosJuice JosJuice force-pushed the android-new-config branch 2 times, most recently from 832ffe4 to 3dacc00 Compare September 9, 2020 16:59
@Ebola16
Copy link
Member

Ebola16 commented Sep 12, 2020

I'll probably need another two days until I review this, sorry. Game-specific settings in the Wii Overlay PR are giving me trouble after a rebase so I should figure out what's going on there before I look at this PR.

@JMC47
Copy link
Contributor

JMC47 commented Sep 12, 2020

Let's try to get everything with the settings/features setup before the next progress report so we can give Android Users some nice benefits and quality of life features.

@Ebola16
Copy link
Member

Ebola16 commented Sep 12, 2020

@JMC47 If two more days is too much time I can still review this after merge since @lioncash said this PR is good to go. I should definitely look into the custom game settings oddities though, although I highly suspect they're on my end and not caused by anything in Master.

@JMC47
Copy link
Contributor

JMC47 commented Sep 12, 2020

Nope, I'm just saying we try to get this all squared away before the end of the month.

Except controller settings, because those would be annoying
to fit into the same system, and I only need the non-controller
settings to be brought over for the next commits to work.
I was hoping we would be able to pull in the default values
from C++, but it seems like more trouble than it's worth,
partially because of different settings having default values
of different types and partially because we don't have any
convenient way to get a list of all C++ settings.
Copy link
Member

@Ebola16 Ebola16 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • In-game graphics settings changes (tested Aspect Ratio and Post-processing) aren't immediately updated.
  • In-game settings with custom game setting set are still modifiable but the change is ignored. Perhaps either make these non-modifiable and show a toast explaining why or make modifications save to the custom game settings?
  • On Windows, "Insert SD Card" and the CPU Clock Override settings are modifiable in-game.

@JosJuice
Copy link
Member Author

In-game graphics settings changes (tested Aspect Ratio and Post-processing) aren't immediately updated.

Weird, I'm pretty sure it worked before, but it doesn't seem to be working anymore... I'll take a closer look.

In-game settings with custom game setting set are still modifiable but the change is ignored. Perhaps either make these non-modifiable and show a toast explaining why or make modifications save to the custom game settings?

I tried to match the DolphinQt behavior where changes to such settings persist until you end the emulation session, since I had no particular reason to want to go against the DolphinQt behavior.

On Windows, "Insert SD Card" and the CPU Clock Override settings are modifiable in-game.

The reason they aren't modifiable in-game on Android is because they aren't using the new config system yet.

@Ebola16
Copy link
Member

Ebola16 commented Sep 15, 2020

I tried to match the DolphinQt behavior where changes to such settings persist until you end the emulation session, since I had no particular reason to want to go against the DolphinQt behavior.

To clarify with an example, if the OSD display setting is overridden to false, modifying that setting in-game will not allow OSD messages to be displayed. If that's intended behavior I'd like a toast when a user tries to modify an overridden setting in-game explaining that those changes will do nothing and not be retained.

The reason they aren't modifiable in-game on Android is because they aren't using the new config system yet.

That's fine, just making sure this was intentional.

@JosJuice
Copy link
Member Author

JosJuice commented Sep 15, 2020

To clarify with an example, if the OSD display setting is overridden to false, modifying that setting in-game will not allow OSD messages to be displayed. If that's intended behavior I'd like a toast when a user tries to modify an overridden setting in-game explaining that those changes will do nothing and not be retained.

The intended behavior in that case is that OSD messages will be displayed for the rest of the current emulation session. If that's not happening, it sounds like a similar issue to the first of your three issues.

@Ebola16
Copy link
Member

Ebola16 commented Sep 15, 2020

The intended behavior in that case is that OSD messages will be displayed for the rest of the current emulation session. If that's not happening, it sounds like a similar issue to the first of your three issues.

Actually I can't reproduce that anymore. I'll assume I accidentally didn't clear my custom settings while testing unless I can reproduce it again. I think the "In-game graphics settings changes (tested Aspect Ratio and Post-processing) aren't immediately updated" is the only relevant issue now.

The main activity loads settings essentially as soon as it
starts, in order to determine which tab to show. If the process
of stopping emulation has not finished at this point, a race
condition may be triggered where two IOS kernels are created
at once due to the emulation thread loading or saving the
SYSCONF while the GUI thread is loading the SYSCONF. To fix
this, we can wait for emulation to fully end before returning.

Because this race condition is hard to reproduce, I have not
been able to test that this actually fixes the race condition,
or even that the cause of the race condition is exactly what I
believe it is. But I am relatively confident.
@JosJuice
Copy link
Member Author

The issue with the graphics settings is fixed now. Turns out that I have to call Config::InvokeConfigChangedCallbacks manually with the way I'm using the config API.

@JosJuice JosJuice merged commit a7b9e68 into dolphin-emu:master Sep 16, 2020
@JosJuice JosJuice deleted the android-new-config branch September 16, 2020 07:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants