@@ -920,25 +920,35 @@ void cdvdReset()
920920 cdvd.ReadTime = cdvdBlockReadTime (MODE_DVDROM);
921921 cdvd.RotSpeed = cdvdRotationTime (MODE_DVDROM);
922922
923+ ReadOSDConfigParames ();
924+
925+ // Print timezone offset, DST, date format, and time format.
926+ DevCon.WriteLn (Color_StrongGreen, configParams1.timezoneOffset < 0 ? " Timezone Offset: GMT%03d:%02d" : " Timezone Offset: GMT+%02d:%02d" ,
927+ configParams1.timezoneOffset / 60 , std::abs (configParams1.timezoneOffset % 60 ));
928+ DevCon.WriteLn (Color_StrongGreen, " DST: %s Time" , GetDaylightSavings () ? " Summer" : " Winter" );
929+ DevCon.WriteLn (Color_StrongGreen, " Time Format: %s-Hour" , GetTimeFormat () ? " 12" : " 24" );
930+ DevCon.WriteLn (Color_StrongGreen, " Date Format: %s" , GetDateFormat () ? (GetDateFormat () == 2 ? " DD/MM/YYYY" : " MM/DD/YYYY" ) : " YYYY/MM/DD" );
931+
923932 if (EmuConfig.ManuallySetRealTimeClock )
924933 {
925- // Convert to GMT+9 (assumes GMT+0)
926934 std::tm tm{};
927935 tm.tm_sec = EmuConfig.RtcSecond ;
928936 tm.tm_min = EmuConfig.RtcMinute ;
929937 tm.tm_hour = EmuConfig.RtcHour ;
930938 tm.tm_mday = EmuConfig.RtcDay ;
931939 tm.tm_mon = EmuConfig.RtcMonth - 1 ;
932940 tm.tm_year = EmuConfig.RtcYear + 100 ; // 2000 - 1900
933- tm.tm_isdst = 1 ;
941+ tm.tm_isdst = 0 ; // unused but necessary filler
934942
935- // Need this instead of mktime for timezone independence
943+ // Need this instead of mktime for timezone independence.
936944 std::time_t t = 0 ;
945+
946+ // Account for user timezone, DST, and GMT+9 defaultism.
937947 #if defined(_WIN32)
938- t = _mkgmtime (&tm) + 32400 ; // 60 * 60 * 9 for GMT+9
948+ t = _mkgmtime (&tm) + 32400 - 60 * (configParams1. timezoneOffset + GetDaylightSavings () * 60 );
939949 gmtime_s (&tm, &t);
940950 #else
941- t = timegm (&tm) + 32400 ;
951+ t = timegm (&tm) + 32400 - 60 * (configParams1. timezoneOffset + GetDaylightSavings () * 60 ) ;
942952 gmtime_r (&t, &tm);
943953 #endif
944954
@@ -983,6 +993,21 @@ void cdvdReset()
983993 cdvd.RTC .year = static_cast <u8 >(curtime.tm_year - 100 ); // offset from 2000
984994 }
985995
996+ // Print system time and system time basis.
997+ if (EmuConfig.ManuallySetRealTimeClock )
998+ {
999+ DevCon.WriteLn (Color_StrongGreen, " System Time Basis: Manual RTC" );
1000+ DevCon.WriteLn (Color_StrongGreen, " System Time: 20%02u-%02u-%02u %02u:%02u:%02u" ,
1001+ EmuConfig.RtcYear , EmuConfig.RtcMonth , EmuConfig.RtcDay ,
1002+ EmuConfig.RtcHour , EmuConfig.RtcMinute , EmuConfig.RtcSecond );
1003+ }
1004+ else
1005+ {
1006+ DevCon.WriteLn (Color_StrongGreen, " System Time Basis: %s" , g_InputRecording.isActive () ? " Default Input Recording Time" : " Operating System Time" );
1007+ DevCon.WriteLn (Color_StrongGreen, " System Time: 20%02u-%02u-%02u %02u:%02u:%02u" ,
1008+ cdvd.RTC .year , cdvd.RTC .month , cdvd.RTC .day , cdvd.RTC .hour , cdvd.RTC .minute , cdvd.RTC .second );
1009+ }
1010+
9861011 cdvdCtrlTrayClose ();
9871012}
9881013
0 commit comments