summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/distate.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/emu/distate.cpp')
-rw-r--r--src/emu/distate.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/emu/distate.cpp b/src/emu/distate.cpp
index d0ade8edc4b..d234cd4a69b 100644
--- a/src/emu/distate.cpp
+++ b/src/emu/distate.cpp
@@ -101,7 +101,7 @@ device_state_entry &device_state_entry::formatstr(const char *_format)
// set the DSF_CUSTOM_STRING flag by formatting with a nullptr string
m_flags &= ~DSF_CUSTOM_STRING;
- format(nullptr);
+ format(nullptr, 0);
return *this;
}
@@ -201,12 +201,10 @@ double device_state_entry::entry_dvalue() const
// pieces of indexed state as a string
//-------------------------------------------------
-std::string device_state_entry::format(const char *string, bool maxout) const
+std::string device_state_entry::format(const char *string, u64 result, bool maxout) const
{
- std::string dest;
- u64 result = value();
-
// parse the format
+ std::string dest;
bool leadzero = false;
bool percent = false;
bool explicitsign = false;
@@ -400,7 +398,7 @@ std::string device_state_entry::to_string() const
custom = string_format("%-12G", entry_dvalue());
// ask the entry to format itself
- return format(custom.c_str());
+ return format(custom.c_str(), value());
}
@@ -412,7 +410,7 @@ std::string device_state_entry::to_string() const
int device_state_entry::max_length() const
{
// ask the entry to format itself maximally
- return format("", true).length();
+ return format("", value(), true).length();
}