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

Use config changed callback to detect SD insertion/ejection #10468

Merged
merged 1 commit into from Feb 26, 2022

Conversation

JosJuice
Copy link
Member

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.

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.
@dolphin-emu-bot
Copy link
Contributor

FifoCI detected that this change impacts graphical rendering. Here are the behavior differences detected by the system:

  • aeon-charge-attack on ogl-lin-mesa: diff
  • bk-tev on ogl-lin-mesa: diff
  • burnout2-vehicletextures on ogl-lin-mesa: diff
  • chibi-robo-fastdepth on ogl-lin-mesa: diff
  • chibi-robo-zfighting on ogl-lin-mesa: diff
  • custom-brawl-char on ogl-lin-mesa: diff
  • dbz-depth on ogl-lin-mesa: diff
  • djhero2-blend on ogl-lin-mesa: diff
  • DKCR-Char on ogl-lin-mesa: diff
  • DKCR-fast-depth on ogl-lin-mesa: diff
  • ea-pink on ogl-lin-mesa: diff
  • ed-updated on ogl-lin-mesa: diff
  • find-mii on ogl-lin-mesa: diff
  • fishing-resort-map on ogl-lin-mesa: diff
  • fog-adj on ogl-lin-mesa: diff
  • fortune-street on ogl-lin-mesa: diff
  • fortune-street-fog on ogl-lin-mesa: diff
  • fortune-street-white-box on ogl-lin-mesa: diff
  • f-zero-rain on ogl-lin-mesa: diff
  • goldeneye-depth on ogl-lin-mesa: diff
  • inverted-depth-range on ogl-lin-mesa: diff
  • jb-shadow on ogl-lin-mesa: diff
  • jd2-fmv on ogl-lin-mesa: diff
  • jj-awae-mirrored on ogl-lin-mesa: diff
  • kirby-logicop on ogl-lin-mesa: diff
  • kirby-shadows on ogl-lin-mesa: diff
  • last-story-shadows on ogl-lin-mesa: diff
  • lego-star-wars-crane-shadow on ogl-lin-mesa: diff
  • lesson08 on ogl-lin-mesa: diff
  • lm-mario-portrait on ogl-lin-mesa: diff
  • luigi-shadows on ogl-lin-mesa: diff
  • mario-baseball-shadows on ogl-lin-mesa: diff
  • mario-golf-oob on ogl-lin-mesa: diff
  • mario-sluggers-bar on ogl-lin-mesa: diff
  • mario-tennis-menu on ogl-lin-mesa: diff
  • MaS-LOG-wiimote on ogl-lin-mesa: diff
  • megaman-heat on ogl-lin-mesa: diff
  • melee-depth on ogl-lin-mesa: diff
  • melee-lighting on ogl-lin-mesa: diff
  • metroid-visor on ogl-lin-mesa: diff
  • mii-channel on ogl-lin-mesa: diff
  • milotic-texture on ogl-lin-mesa: diff
  • mini-ninjas on ogl-lin-mesa: diff
  • mkdd-babypark on ogl-lin-mesa: diff
  • mkdd-efb on ogl-lin-mesa: diff
  • mkw-bridge on ogl-lin-mesa: diff
  • mkwii-bluebox on ogl-lin-mesa: diff
  • monkeyball-fuse on ogl-lin-mesa: diff
  • mp2-scanner on ogl-lin-mesa: diff
  • mp3-bloom on ogl-lin-mesa: diff
  • mp4-vertexcache on ogl-lin-mesa: diff
  • mp7-text on ogl-lin-mesa: diff
  • mtennis-zfreeze on ogl-lin-mesa: diff
  • my-word-coach on ogl-lin-mesa: diff
  • nddemo-bumpmapping on ogl-lin-mesa: diff
  • nddemo-lighting on ogl-lin-mesa: diff
  • nfsu-purplerect on ogl-lin-mesa: diff
  • nfsu-reflections on ogl-lin-mesa: diff
  • nhl-slap on ogl-lin-mesa: diff
  • nsmbw-coins on ogl-lin-mesa: diff
  • nsmbw-intro on ogl-lin-mesa: diff
  • pbr-sfx on ogl-lin-mesa: diff
  • pm-hc-jp on ogl-lin-mesa: diff
  • rs2-bumpmapping on ogl-lin-mesa: diff
  • rs2-glass on ogl-lin-mesa: diff
  • rs2-skybox on ogl-lin-mesa: diff
  • rs2-zfreeze on ogl-lin-mesa: diff
  • rs3-bumpmapping on ogl-lin-mesa: diff
  • rs3-skybox2 on ogl-lin-mesa: diff
  • sadx-ui on ogl-lin-mesa: diff
  • sfa-shadows on ogl-lin-mesa: diff
  • sf-assault-flashing on ogl-lin-mesa: diff
  • shadow-eyes on ogl-lin-mesa: diff
  • simpsons-game on ogl-lin-mesa: diff
  • smb-mirror on ogl-lin-mesa: diff
  • smg2-fog on ogl-lin-mesa: diff
  • smg-marioeyes on ogl-lin-mesa: diff
  • smg-mmg on ogl-lin-mesa: diff
  • smg-roar on ogl-lin-mesa: diff
  • sms-bubbles on ogl-lin-mesa: diff
  • sms-gc on ogl-lin-mesa: diff
  • sms-water on ogl-lin-mesa: diff
  • soa-black on ogl-lin-mesa: diff
  • soniccolors-mm on ogl-lin-mesa: diff
  • sonic-riders-blur on ogl-lin-mesa: diff
  • sonic-riders-zg-4p on ogl-lin-mesa: diff
  • sonicriderszg-gb on ogl-lin-mesa: diff
  • spyro-bloom on ogl-lin-mesa: diff
  • spyro-depth on ogl-lin-mesa: diff
  • ssbb-mod-lloyd on ogl-lin-mesa: diff
  • ssbm-pointsize on ogl-lin-mesa: diff
  • ss-map on ogl-lin-mesa: diff
  • super-sluggers-white-out on ogl-lin-mesa: diff
  • sw3-dt on ogl-lin-mesa: diff
  • thps3-earlyz on ogl-lin-mesa: diff
  • thps4-shadow on ogl-lin-mesa: diff
  • tla-menu on ogl-lin-mesa: diff
  • tos-invis-char on ogl-lin-mesa: diff
  • tp-skin on ogl-lin-mesa: diff
  • tsp3-pinkgrass on ogl-lin-mesa: diff
  • vegas-party-depth on ogl-lin-mesa: diff
  • viewitful-joe-distortion on ogl-lin-mesa: diff
  • xenoblade-menu on ogl-lin-mesa: diff
  • ztp-grass on ogl-lin-mesa: diff
  • zww-armos on ogl-lin-mesa: diff
  • zww-water on ogl-lin-mesa: diff
  • zww-waves on ogl-lin-mesa: diff

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);
Copy link
Contributor

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?

Copy link
Member Author

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?

Copy link
Contributor

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.

@AdmiralCurtiss
Copy link
Contributor

Other than that, seems like an improvement to me.

@AdmiralCurtiss AdmiralCurtiss merged commit aa0ac83 into dolphin-emu:master Feb 26, 2022
10 checks passed
@JosJuice JosJuice deleted the sd-card-callback branch February 27, 2022 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants