diff --git a/src/core/memory_card.h b/src/core/memory_card.h index e29f59feb..3f50e6c2e 100644 --- a/src/core/memory_card.h +++ b/src/core/memory_card.h @@ -19,6 +19,8 @@ public: static std::unique_ptr Open(std::string_view filename); const MemoryCardImage::DataArray& GetData() const { return m_data; } + const std::string& GetFilename() const { return m_filename; } + void SetFilename(std::string filename) { m_filename = std::move(filename); } void Reset(); bool DoState(StateWrapper& sw); diff --git a/src/core/pad.cpp b/src/core/pad.cpp index e18aa6caa..b41776c1a 100644 --- a/src/core/pad.cpp +++ b/src/core/pad.cpp @@ -110,6 +110,7 @@ bool Pad::DoState(StateWrapper& sw) if (m_memory_cards[i]->GetData() == card_from_state->GetData()) { Log_DevPrintf("Using memory card %u state from save state", i); + card_from_state->SetFilename(m_memory_cards[i]->GetFilename()); m_memory_cards[i] = std::move(card_from_state); } else