Skip to content

Commit

Permalink
Ensure the Plug-And-Play works as much as possible.
Browse files Browse the repository at this point in the history
Reset all the IO handlers every time a card is inserted / removed.

Signed-off-by: Andrea Odetti <mariofutire@gmail.com>
  • Loading branch information
audetto committed Nov 19, 2021
1 parent 3c09d75 commit 3128fdb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions source/frontends/sdl/imgui/sdlsettings.cpp
Expand Up @@ -331,6 +331,8 @@ namespace sa2
if (ImGui::Selectable(getCardName(card).c_str(), isSelected))
{
SetExpansionMemType(card);
CreateLanguageCard();
MemInitializeIO();
}
if (isSelected)
{
Expand Down
4 changes: 4 additions & 0 deletions source/frontends/sdl/imgui/settingshelper.cpp
Expand Up @@ -184,6 +184,10 @@ namespace sa2
};

cardManager.Insert(slot, card);

// keep everything consistent
// a bit of a heavy call, but nothing simpler is available now
MemInitializeIO();
}

void setVideoStyle(Video & video, const VideoStyle_e style, const bool enabled)
Expand Down

0 comments on commit 3128fdb

Please sign in to comment.