| 3032 | } |
| 3033 | |
| 3034 | void VMManager::CheckForMemoryCardConfigChanges(const Pcsx2Config& old_config) |
| 3035 | { |
| 3036 | bool changed = false; |
| 3037 | |
| 3038 | for (size_t i = 0; i < std::size(EmuConfig.Mcd); i++) |
| 3039 | { |
| 3040 | if (EmuConfig.Mcd[i].Enabled != old_config.Mcd[i].Enabled || |
| 3041 | EmuConfig.Mcd[i].Filename != old_config.Mcd[i].Filename) |
| 3042 | { |
| 3043 | changed = true; |
| 3044 | break; |
| 3045 | } |
| 3046 | } |
| 3047 | |
| 3048 | if (!changed) |
| 3049 | return; |
| 3050 | |
| 3051 | Console.WriteLn("Updating memory card configuration"); |
| 3052 | |
| 3053 | // force card eject when files change |
| 3054 | for (u32 port = 0; port < 2; port++) |
| 3055 | { |
| 3056 | for (u32 slot = 0; slot < 4; slot++) |
| 3057 | { |
| 3058 | const uint index = FileMcd_ConvertToSlot(port, slot); |
| 3059 | if (EmuConfig.Mcd[index].Enabled != old_config.Mcd[index].Enabled || |
| 3060 | EmuConfig.Mcd[index].Filename != old_config.Mcd[index].Filename) |
| 3061 | { |
| 3062 | Console.WriteLn("Ejecting memory card %u (port %u slot %u) due to source change", index, port, slot); |
| 3063 | AutoEject::Set(port, slot); |
| 3064 | } |
| 3065 | } |
| 3066 | } |
| 3067 | // force reindexing, mc folder code is janky |
| 3068 | std::string sioSerial; |
| 3069 | { |
| 3070 | std::unique_lock lock(s_info_mutex); |
| 3071 | if (const GameDatabaseSchema::GameEntry* game = GameDatabase::findGame(s_disc_serial)) |
| 3072 | sioSerial = game->memcardFiltersAsString(); |
| 3073 | if (sioSerial.empty()) |
| 3074 | sioSerial = s_disc_serial; |
| 3075 | } |
| 3076 | |
| 3077 | if (!GSDumpReplayer::IsReplayingDump()) |
| 3078 | FileMcd_Reopen(sioSerial); |
| 3079 | } |
| 3080 | |
| 3081 | void VMManager::CheckForMiscConfigChanges(const Pcsx2Config& old_config) |
| 3082 | { |
nothing calls this directly
no test coverage detected