From 93e3205a09560b9e736a6d0f889154f35158a579 Mon Sep 17 00:00:00 2001 From: sudonim1 Date: Mon, 19 Apr 2010 04:20:56 +0000 Subject: [PATCH] The RTC bug doesn't exist. Well, it was a little buggy, but not in the reported way. I've made the code clearer. The PS2 BIOS does not feature automatic DST adjustment! You have to set DST from the triangle button menu on the date/time in the BIOS! git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2872 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/CDVD/CDVD.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pcsx2/CDVD/CDVD.cpp b/pcsx2/CDVD/CDVD.cpp index 9233bd0e8d..2a0f44b7ca 100644 --- a/pcsx2/CDVD/CDVD.cpp +++ b/pcsx2/CDVD/CDVD.cpp @@ -512,13 +512,15 @@ void cdvdReset() cdvd.Action = cdvdAction_None; cdvd.ReadTime = cdvdBlockReadTime( MODE_DVDROM ); + // CDVD internally uses GMT+9. If you think the time's wrong, you're wrong. + // Set up your time zone and winter/summer in the BIOS. No PS2 BIOS I know of features automatic DST. wxDateTime curtime( wxDateTime::GetTimeNow() ); cdvd.RTC.second = (u8)curtime.GetSecond(); cdvd.RTC.minute = (u8)curtime.GetMinute(); - cdvd.RTC.hour = (u8)(curtime.GetHour(wxDateTime::GMT0)+1) % 24; - cdvd.RTC.day = (u8)curtime.GetDay(wxDateTime::GMT0); - cdvd.RTC.month = (u8)curtime.GetMonth(wxDateTime::GMT0) + 1; // WX returns Jan as "0" - cdvd.RTC.year = (u8)(curtime.GetYear(wxDateTime::GMT0) - 2000); + cdvd.RTC.hour = (u8)curtime.GetHour(wxDateTime::GMT9); + cdvd.RTC.day = (u8)curtime.GetDay(wxDateTime::GMT9); + cdvd.RTC.month = (u8)curtime.GetMonth(wxDateTime::GMT9) + 1; // WX returns Jan as "0" + cdvd.RTC.year = (u8)(curtime.GetYear(wxDateTime::GMT9) - 2000); } struct Freeze_v10Compat @@ -1412,10 +1414,9 @@ static void cdvdWrite16(u8 rt) // SCOMMAND cdvd.Result[0] = 0; cdvd.Result[1] = itob(cdvd.RTC.second); //Seconds cdvd.Result[2] = itob(cdvd.RTC.minute); //Minutes - cdvd.Result[3] = itob((cdvd.RTC.hour+8) %24); //Hours + cdvd.Result[3] = itob(cdvd.RTC.hour); //Hours cdvd.Result[4] = 0; //Nothing cdvd.Result[5] = itob(cdvd.RTC.day); //Day - if(cdvd.Result[3] <= 7) cdvd.Result[5] += 1; cdvd.Result[6] = itob(cdvd.RTC.month)+0x80; //Month cdvd.Result[7] = itob(cdvd.RTC.year); //Year /*Console.WriteLn("RTC Read Sec %x Min %x Hr %x Day %x Month %x Year %x", cdvd.Result[1], cdvd.Result[2], @@ -1431,9 +1432,8 @@ static void cdvdWrite16(u8 rt) // SCOMMAND cdvd.RTC.second = btoi(cdvd.Param[cdvd.ParamP-7]); cdvd.RTC.minute = btoi(cdvd.Param[cdvd.ParamP-6]) % 60; - cdvd.RTC.hour = (btoi(cdvd.Param[cdvd.ParamP-5])+16) % 24; + cdvd.RTC.hour = btoi(cdvd.Param[cdvd.ParamP-5]) % 24; cdvd.RTC.day = btoi(cdvd.Param[cdvd.ParamP-3]); - if(cdvd.Param[cdvd.ParamP-5] <= 7) cdvd.RTC.day -= 1; cdvd.RTC.month = btoi(cdvd.Param[cdvd.ParamP-2]-0x80); cdvd.RTC.year = btoi(cdvd.Param[cdvd.ParamP-1]); /*Console.WriteLn("RTC write incomming Sec %x Min %x Hr %x Day %x Month %x Year %x", cdvd.Param[cdvd.ParamP-7], cdvd.Param[cdvd.ParamP-6],