mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-22 22:00:39 -06:00
Android: Show how long ago each savestate was created
This commit is contained in:
@ -482,6 +482,17 @@ std::string GetInfoStringOfSlot(int slot, bool translate)
|
||||
return Common::Timer::GetDateTimeFormatted(header.time);
|
||||
}
|
||||
|
||||
u64 GetUnixTimeOfSlot(int slot)
|
||||
{
|
||||
State::StateHeader header;
|
||||
if (!ReadHeader(MakeStateFilename(slot), header))
|
||||
return 0;
|
||||
|
||||
constexpr u64 MS_PER_SEC = 1000;
|
||||
return static_cast<u64>(header.time * MS_PER_SEC) +
|
||||
(Common::Timer::DOUBLE_TIME_OFFSET * MS_PER_SEC);
|
||||
}
|
||||
|
||||
static void LoadFileStateData(const std::string& filename, std::vector<u8>& ret_data)
|
||||
{
|
||||
Flush();
|
||||
|
@ -36,6 +36,9 @@ bool ReadHeader(const std::string& filename, StateHeader& header);
|
||||
// which can be presented to the user for identification purposes
|
||||
std::string GetInfoStringOfSlot(int slot, bool translate = true);
|
||||
|
||||
// Returns when the savestate in the given slot was created, or 0 if the slot is empty.
|
||||
u64 GetUnixTimeOfSlot(int slot);
|
||||
|
||||
// These don't happen instantly - they get scheduled as events.
|
||||
// ...But only if we're not in the main CPU thread.
|
||||
// If we're in the main CPU thread then they run immediately instead
|
||||
|
Reference in New Issue
Block a user