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
Use config changed callback to detect SD insertion/ejection #10468
Conversation
This saves the GUI from having to manually call SDIO_EventNotify. With that out of the way, we can let users change the "Insert SD Card" setting on Android while a game is running.
52d44e9
to
90c576e
Compare
|
FifoCI detected that this change impacts graphical rendering. Here are the behavior differences detected by the system:
automated-fifoci-reporter |
| if (m_sd_card_inserted != Config::Get(Config::MAIN_WII_SD_CARD)) | ||
| { | ||
| Core::RunAsCPUThread([this] { | ||
| const bool sd_card_inserted = Config::Get(Config::MAIN_WII_SD_CARD); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this have a Core::IsRunning() check, just in case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My thinking was that the destructor of this class will deregister the callback when emulation ends. Or would that not work as intended?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My thinking was that there might be some multithreading shenanigans where one thread was in the process of shutting down while another was calling RefreshConfig(), but thinking about it in that case we'd have worse problems anyway by writing to an already destructed instance. So... probably fine, then.
|
Other than that, seems like an improvement to me. |
This saves the GUI from having to manually call SDIO_EventNotify. With that out of the way, we can let users change the "Insert SD Card" setting on Android while a game is running.