summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatarGravatar MooglyGuy <therealmogminer@gmail.com>2019-06-24 05:07:44 +0200
committerGravatarGravatar MooglyGuy <therealmogminer@gmail.com>2019-06-24 05:07:58 +0200
commitceb558070e93dd6f6ef3bd9df048048208876d1c (patch) (github)
tree67e9028703d6900d1b09c0340d151585358c4024
parentb8d433a8376ecc0f6e4ba2aec6fb7079e5a95a10 (diff)
downloadmame-ceb558070e93dd6f6ef3bd9df048048208876d1c.tar.bz2
mame-ceb558070e93dd6f6ef3bd9df048048208876d1c.zip
-save: Print all duplicate savestate entries found rather than bailing after the first one, nw
-rw-r--r--src/emu/save.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/emu/save.cpp b/src/emu/save.cpp
index d8051c72390..a8a59c90817 100644
--- a/src/emu/save.cpp
+++ b/src/emu/save.cpp
@@ -84,9 +84,18 @@ void save_manager::allow_registration(bool allowed)
std::sort(m_entry_list.begin(), m_entry_list.end(),
[](std::unique_ptr<state_entry> const& a, std::unique_ptr<state_entry> const& b) { return a->m_name < b->m_name; });
+ int dupes_found = 0;
for (int i = 0; i < m_entry_list.size() - 1; i++)
+ {
if (m_entry_list[i]->m_name == m_entry_list[i + 1]->m_name)
- fatalerror("Duplicate save state registration entry (%s)\n", m_entry_list[i]->m_name.c_str());
+ {
+ osd_printf_error("Duplicate save state registration entry (%s)\n", m_entry_list[i]->m_name.c_str());
+ dupes_found++;
+ }
+ }
+
+ if (dupes_found)
+ fatalerror("%d duplicate save state entries found.\n", dupes_found);
dump_registry();