Merge pull request #4036 from RisingFog/rtc_osd

Display RTC on OSD
This commit is contained in:
Pierre Bourdon authored and GitHub committed 2016-07-25 15:36:03 +02:00
commit c6924b4d03
11 files changed
+41 -1

No files matched your search

+2
View File
@@ -288,6 +288,7 @@ void SConfig::SaveMovieSettings(IniFile& ini)
movie->Set("DumpFrames", m_DumpFrames);
movie->Set("DumpFramesSilent", m_DumpFramesSilent);
movie->Set("ShowInputDisplay", m_ShowInputDisplay);
movie->Set("ShowRTC", m_ShowRTC);
}
void SConfig::SaveDSPSettings(IniFile& ini)
@@ -569,6 +570,7 @@ void SConfig::LoadMovieSettings(IniFile& ini)
movie->Get("DumpFrames", &m_DumpFrames, false);
movie->Get("DumpFramesSilent", &m_DumpFramesSilent, false);
movie->Get("ShowInputDisplay", &m_ShowInputDisplay, false);
movie->Get("ShowRTC", &m_ShowRTC, false);
}
void SConfig::LoadDSPSettings(IniFile& ini)
+1
View File
@@ -259,6 +259,7 @@ struct SConfig : NonCopyable
bool m_PauseMovie;
bool m_ShowLag;
bool m_ShowFrameCount;
bool m_ShowRTC;
std::string m_strMovieAuthor;
unsigned int m_FrameSkip;
bool m_DumpFrames;
+7 -1
View File
@@ -32,6 +32,8 @@ static const char iplverPAL[0x100] = "(C) 1999-2001 Nintendo. All rights reserv
static const char iplverNTSC[0x100] = "(C) 1999-2001 Nintendo. All rights reserved."
"(C) 1999 ArtX Inc. All rights reserved.";
static constexpr u32 cJanuary2000 = 0x386D4380; // Seconds between 1.1.1970 and 1.1.2000
// bootrom descrambler reversed by segher
// Copyright 2008 Segher Boessenkool <[email protected]>
void CEXIIPL::Descrambler(u8* data, u32 size)
@@ -405,7 +407,6 @@ void CEXIIPL::TransferByte(u8& _uByte)
u32 CEXIIPL::GetGCTime()
{
u64 ltime = 0;
static const u32 cJanuary2000 = 0x386D4380; // Seconds between 1.1.1970 and 1.1.2000
if (Movie::IsMovieActive())
{
@@ -446,3 +447,8 @@ u32 CEXIIPL::GetGCTime()
return ((u32)ltime - cJanuary2000 - Bias);
#endif
}
u32 CEXIIPL::GetGCTimeJan1970()
{
return GetGCTime() + cJanuary2000;
}
+1
View File
@@ -21,6 +21,7 @@ public:
void DoState(PointerWrap& p) override;
static u32 GetGCTime();
static u32 GetGCTimeJan1970();
static u64 NetPlay_GetGCTime();
static void Descrambler(u8* data, u32 size);
+12
View File
@@ -179,6 +179,18 @@ std::string GetInputDisplay()
return input_display;
}
// NOTE: GPU Thread
std::string GetRTCDisplay()
{
time_t current_time = CEXIIPL::GetGCTimeJan1970();
tm* gm_time = gmtime(&current_time);
char buffer[256];
strftime(buffer, sizeof(buffer), "Date/Time: %c", gm_time);
std::stringstream format_time;
format_time << buffer;
return format_time.str();
}
// NOTE: GPU Thread
void FrameUpdate()
{
+1
View File
@@ -179,6 +179,7 @@ void CheckWiimoteStatus(int wiimote, u8* data, const struct WiimoteEmu::ReportFe
int ext, const wiimote_key key);
std::string GetInputDisplay();
std::string GetRTCDisplay();
// Done this way to avoid mixing of core and gui code
typedef void (*GCManipFunction)(GCPadStatus*, int);