per-game vmu A1 option

When enabled, each game has its own A1 vmu file.
Issue #555
This commit is contained in:
Flyinghead 2023-03-05 15:32:47 +01:00
parent 67c070c20f
commit cd6152b193
4 changed files with 6 additions and 0 deletions

View File

@ -181,6 +181,7 @@ std::array<std::array<Option<MapleDeviceType>, 2>, 4> MapleExpansionDevices {
Option<MapleDeviceType>("device4.1", MDT_None, "input"),
Option<MapleDeviceType>("device4.2", MDT_None, "input"),
};
Option<bool> PerGameVmu("PerGameVmu", false, "config");
#ifdef _WIN32
Option<bool, false> UseRawInput("RawInput", false, "input");
#endif

View File

@ -521,6 +521,7 @@ extern Option<int> MouseSensitivity;
extern Option<int> VirtualGamepadVibration;
extern std::array<Option<MapleDeviceType>, 4> MapleMainDevices;
extern std::array<std::array<Option<MapleDeviceType>, 2>, 4> MapleExpansionDevices;
extern Option<bool> PerGameVmu;
#ifdef _WIN32
extern Option<bool, false> UseRawInput;
#else

View File

@ -30,6 +30,9 @@ namespace hostfs
std::string getVmuPath(const std::string& port)
{
if (port == "A1" && config::PerGameVmu && !settings.content.path.empty())
return get_game_save_prefix() + "_vmu_save_A1.bin";
char tempy[512];
sprintf(tempy, "vmu_save_%s.bin", port.c_str());
// VMU saves used to be stored in .reicast, not in .reicast/data

View File

@ -1652,6 +1652,7 @@ static void gui_display_settings()
}
ImGui::PopItemWidth();
}
OptionCheckbox("Per Game VMU A1", config::PerGameVmu, "When enabled, each game has its own VMU on port 1 of controller A.");
}
ImGui::PopStyleVar();