Fix two critical flaws in TimeZone logic
The first one was the month range being different fron Nintendo one (0-11 instead of 1-12) The other flaw was a bad incrementation order during days & months computation.
This commit is contained in:
parent
45125f0e3a
commit
5a2bf60e00
2 changed files with 5 additions and 5 deletions
|
@ -68,7 +68,9 @@ namespace Ryujinx.HLE.HOS.Services.Time
|
|||
TimeSpanType testOffset = context.RequestData.ReadStruct<TimeSpanType>();
|
||||
bool isRtcResetDetected = context.RequestData.ReadBoolean();
|
||||
|
||||
return _timeManager.SetupStandardSteadyClock(context.Thread, clockSourceId, setupValue, internalOffset, testOffset, isRtcResetDetected);
|
||||
_timeManager.SetupStandardSteadyClock(context.Thread, clockSourceId, setupValue, internalOffset, testOffset, isRtcResetDetected);
|
||||
|
||||
return ResultCode.Success;
|
||||
}
|
||||
|
||||
[Command(11)]
|
||||
|
|
|
@ -1357,10 +1357,8 @@ namespace Ryujinx.HLE.HOS.Services.Time.TimeZone
|
|||
|
||||
int[] ip = MonthsLengths[IsLeap((int)year)];
|
||||
|
||||
while (dayOfYear >= ip[calendarTime.Month])
|
||||
for (calendarTime.Month = 0; dayOfYear >= ip[calendarTime.Month]; ++calendarTime.Month)
|
||||
{
|
||||
calendarTime.Month += 1;
|
||||
|
||||
dayOfYear -= ip[calendarTime.Month];
|
||||
}
|
||||
|
||||
|
@ -1709,7 +1707,7 @@ namespace Ryujinx.HLE.HOS.Services.Time.TimeZone
|
|||
Time = new CalendarTime()
|
||||
{
|
||||
Year = (short)calendarTime.Year,
|
||||
Month = calendarTime.Month,
|
||||
Month = (sbyte)(calendarTime.Month + 1),
|
||||
Day = calendarTime.Day,
|
||||
Hour = calendarTime.Hour,
|
||||
Minute = calendarTime.Minute,
|
||||
|
|
Loading…
Add table
Reference in a new issue