Add RTC display for movie recording, and small modifications.
This commit is contained in:
parent
67465b636f
commit
50c7b966e2
|
@ -164,6 +164,11 @@ void HudStruct::reset()
|
|||
Microphone.xsize=20;
|
||||
Microphone.ysize=10;
|
||||
|
||||
RTCDisplay.x=0;
|
||||
RTCDisplay.y=105;
|
||||
RTCDisplay.xsize=220;
|
||||
RTCDisplay.ysize=10;
|
||||
|
||||
SavestateSlots.x = 8;
|
||||
SavestateSlots.y = 160;
|
||||
SavestateSlots.xsize = 240;
|
||||
|
@ -558,6 +563,13 @@ void DrawHUD()
|
|||
}
|
||||
#endif
|
||||
|
||||
if (CommonSettings.hud.ShowRTC)
|
||||
{
|
||||
struct tm *tm = rtcGetTime();
|
||||
const char *wday[] = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" };
|
||||
osd->addFixed(Hud.RTCDisplay.x, Hud.RTCDisplay.y, "%04d-%02d-%02d %s %02d:%02d:%02d", 1900 + tm->tm_year, 1 + tm->tm_mon, tm->tm_mday, wday[tm->tm_wday%7], tm->tm_hour, tm->tm_min, tm->tm_sec);
|
||||
}
|
||||
|
||||
DrawStateSlots();
|
||||
}
|
||||
|
||||
|
|
|
@ -70,6 +70,7 @@ public:
|
|||
HudCoordinates GraphicalInputDisplay;
|
||||
HudCoordinates LagFrameCounter;
|
||||
HudCoordinates Microphone;
|
||||
HudCoordinates RTCDisplay;
|
||||
HudCoordinates Dummy;
|
||||
|
||||
HudCoordinates &hud(int i) { return ((HudCoordinates*)this)[i]; }
|
||||
|
|
|
@ -572,8 +572,9 @@ extern struct TCommonSettings {
|
|||
, FrameCounterDisplay(false)
|
||||
, ShowLagFrameCounter(false)
|
||||
, ShowMicrophone(false)
|
||||
, ShowRTC(false)
|
||||
{}
|
||||
bool ShowInputDisplay, ShowGraphicalInputDisplay, FpsDisplay, FrameCounterDisplay, ShowLagFrameCounter, ShowMicrophone;
|
||||
bool ShowInputDisplay, ShowGraphicalInputDisplay, FpsDisplay, FrameCounterDisplay, ShowLagFrameCounter, ShowMicrophone, ShowRTC;
|
||||
} hud;
|
||||
|
||||
} CommonSettings;
|
||||
|
|
|
@ -114,10 +114,11 @@ bool moviemode=false;
|
|||
|
||||
struct tm* rtcGetTime(void)
|
||||
{
|
||||
struct tm *tm = NULL;
|
||||
if(movieMode == MOVIEMODE_INACTIVE) {
|
||||
time_t timer;
|
||||
time(&timer);
|
||||
return localtime(&timer);
|
||||
tm = localtime(&timer);
|
||||
}
|
||||
else {
|
||||
//now, you might think it is silly to go through all these conniptions
|
||||
|
@ -140,8 +141,10 @@ struct tm* rtcGetTime(void)
|
|||
t.tm_sec += totalseconds;
|
||||
// then, normalize it
|
||||
timer = gmmktime(&t);
|
||||
return gmtime(&timer);
|
||||
tm = gmtime(&timer);
|
||||
}
|
||||
tm->tm_year = 100 + (tm->tm_year % 100); // 20XX
|
||||
return tm;
|
||||
}
|
||||
|
||||
static void rtcRecv()
|
||||
|
|
|
@ -2378,6 +2378,7 @@ int _main()
|
|||
CommonSettings.hud.ShowGraphicalInputDisplay = GetPrivateProfileBool("Display","Display Graphical Input", false, IniName);
|
||||
CommonSettings.hud.ShowLagFrameCounter = GetPrivateProfileBool("Display","Display Lag Counter", false, IniName);
|
||||
CommonSettings.hud.ShowMicrophone = GetPrivateProfileBool("Display","Display Microphone", false, IniName);
|
||||
CommonSettings.hud.ShowRTC = GetPrivateProfileBool("Display","Display RTC", false, IniName);
|
||||
|
||||
CommonSettings.micMode = (TCommonSettings::MicMode)GetPrivateProfileInt("MicSettings", "MicMode", (int)TCommonSettings::InternalNoise, IniName);
|
||||
GetPrivateProfileString("MicSettings", "MicSampleFile", "micsample.raw", MicSampleName, MAX_PATH, IniName);
|
||||
|
@ -3690,6 +3691,7 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM
|
|||
MainWindow->checkMenu(ID_VIEW_DISPLAYGRAPHICALINPUT,CommonSettings.hud.ShowGraphicalInputDisplay);
|
||||
MainWindow->checkMenu(ID_VIEW_DISPLAYLAG,CommonSettings.hud.ShowLagFrameCounter);
|
||||
MainWindow->checkMenu(ID_VIEW_DISPLAYMICROPHONE,CommonSettings.hud.ShowMicrophone);
|
||||
MainWindow->checkMenu(ID_VIEW_DISPLAYRTC,CommonSettings.hud.ShowRTC);
|
||||
MainWindow->checkMenu(ID_VIEW_HUDEDITOR, HudEditorMode);
|
||||
MainWindow->checkMenu(IDC_FRAMELIMIT, FrameLimit);
|
||||
|
||||
|
@ -4979,6 +4981,12 @@ DOKEYDOWN:
|
|||
osd->clear();
|
||||
return 0;
|
||||
|
||||
case ID_VIEW_DISPLAYRTC:
|
||||
CommonSettings.hud.ShowRTC ^= true;
|
||||
WritePrivateProfileBool("Display", "Display RTC", CommonSettings.hud.ShowRTC, IniName);
|
||||
osd->clear();
|
||||
return 0;
|
||||
|
||||
case ID_VIEW_HUDEDITOR:
|
||||
HudEditorMode ^= true;
|
||||
osd->clear();
|
||||
|
|
|
@ -259,7 +259,7 @@ static INT_PTR CALLBACK RecordDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam,
|
|||
|
||||
time_t timer = FCEUI_MovieGetRTCDefault();
|
||||
struct tm *t = gmtime(&timer);
|
||||
ZeroMemory(&systime, sizeof(systime));
|
||||
ZeroMemory(&systime, sizeof(SYSTEMTIME));
|
||||
systime.wYear = t->tm_year + 1900;
|
||||
systime.wMonth = t->tm_mon + 1;
|
||||
systime.wDay = t->tm_mday;
|
||||
|
@ -270,6 +270,21 @@ static INT_PTR CALLBACK RecordDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam,
|
|||
systime.wMilliseconds = 0;
|
||||
DateTime_SetSystemtime(GetDlgItem(hwndDlg, IDC_DTP_DATE), GDT_VALID, &systime);
|
||||
DateTime_SetSystemtime(GetDlgItem(hwndDlg, IDC_DTP_TIME), GDT_VALID, &systime);
|
||||
|
||||
SYSTEMTIME rtcMin;
|
||||
SYSTEMTIME rtcMax;
|
||||
ZeroMemory(&rtcMin, sizeof(SYSTEMTIME));
|
||||
ZeroMemory(&rtcMax, sizeof(SYSTEMTIME));
|
||||
rtcMin.wYear = 2000;
|
||||
rtcMin.wMonth = 1;
|
||||
rtcMin.wDay = 1;
|
||||
rtcMin.wDayOfWeek = 6;
|
||||
rtcMax.wYear = 2099;
|
||||
rtcMax.wMonth = 12;
|
||||
rtcMax.wDay = 31;
|
||||
rtcMax.wDayOfWeek = 4;
|
||||
DateTime_SetRange(GetDlgItem(hwndDlg, IDC_DTP_DATE), GDTR_MIN, &rtcMin);
|
||||
DateTime_SetRange(GetDlgItem(hwndDlg, IDC_DTP_DATE), GDTR_MAX, &rtcMax);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -811,6 +811,7 @@
|
|||
#define ID_VIEWLAYERS_MAINOBJ 40075
|
||||
#define IDM_MOBJ 40076
|
||||
#define IDM_SOBJ 40077
|
||||
#define ID_VIEW_DISPLAYRTC 40078
|
||||
#define IDC_LABEL_UP 50000
|
||||
#define IDC_LABEL_RIGHT 50001
|
||||
#define IDC_LABEL_LEFT 50002
|
||||
|
@ -909,7 +910,7 @@
|
|||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 121
|
||||
#define _APS_NEXT_COMMAND_VALUE 40078
|
||||
#define _APS_NEXT_COMMAND_VALUE 40079
|
||||
#define _APS_NEXT_CONTROL_VALUE 1029
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
#endif
|
||||
|
|
Binary file not shown.
Loading…
Reference in New Issue