Address comments

This commit is contained in:
Thog 2019-10-01 21:19:05 +02:00
commit 3ae1763efa
No known key found for this signature in database
GPG key ID: 0CD291558FAFDBC6
9 changed files with 15 additions and 17 deletions

View file

@ -12,6 +12,7 @@
protected override ResultCode Update() protected override ResultCode Update()
{ {
_sharedMemory.UpdateLocalSystemClockContext(_context); _sharedMemory.UpdateLocalSystemClockContext(_context);
return ResultCode.Success; return ResultCode.Success;
} }
} }

View file

@ -12,6 +12,7 @@
protected override ResultCode Update() protected override ResultCode Update()
{ {
_sharedMemory.UpdateNetworkSystemClockContext(_context); _sharedMemory.UpdateNetworkSystemClockContext(_context);
return ResultCode.Success; return ResultCode.Success;
} }
} }

View file

@ -54,7 +54,7 @@ namespace Ryujinx.HLE.HOS.Services.Time.Clock
SystemClockContext clockContext = new SystemClockContext() SystemClockContext clockContext = new SystemClockContext()
{ {
Offset = posixTime - currentTimePoint.TimePoint, Offset = posixTime - currentTimePoint.TimePoint,
SteadyTimePoint = currentTimePoint SteadyTimePoint = currentTimePoint
}; };

View file

@ -121,9 +121,7 @@ namespace Ryujinx.HLE.HOS.Services.Time
{ {
if (!NxSettings.Settings.TryGetValue("time!standard_user_clock_initial_year", out object standardUserSystemClockInitialYear)) if (!NxSettings.Settings.TryGetValue("time!standard_user_clock_initial_year", out object standardUserSystemClockInitialYear))
{ {
// Fallback if not found in settings (nintendo actually abort here) throw new System.InvalidOperationException("standard_user_clock_initial_year isn't defined in system settings!");
standardUserSystemClockInitialYear = 2019;
//throw new System.InvalidOperationException("standard_user_clock_initial_year isn't defined in system settings!");
} }
context.ResponseData.Write((int)standardUserSystemClockInitialYear); context.ResponseData.Write((int)standardUserSystemClockInitialYear);

View file

@ -102,6 +102,7 @@ namespace Ryujinx.HLE.HOS.Services.Time
public ResultCode SetupStandardUserSystemClock(ServiceCtx context) public ResultCode SetupStandardUserSystemClock(ServiceCtx context)
{ {
bool isAutomaticCorrectionEnabled = context.RequestData.ReadBoolean(); bool isAutomaticCorrectionEnabled = context.RequestData.ReadBoolean();
context.RequestData.BaseStream.Position += 7; context.RequestData.BaseStream.Position += 7;
SteadyClockTimePoint steadyClockTimePoint = context.RequestData.ReadStruct<SteadyClockTimePoint>(); SteadyClockTimePoint steadyClockTimePoint = context.RequestData.ReadStruct<SteadyClockTimePoint>();
@ -196,7 +197,7 @@ namespace Ryujinx.HLE.HOS.Services.Time
public ResultCode GetAlarmRegistrationEvent(ServiceCtx context) public ResultCode GetAlarmRegistrationEvent(ServiceCtx context)
{ {
// TODO // TODO
return ResultCode.NotImplemented; throw new ServiceNotImplementedException(context);
} }
[Command(201)] [Command(201)]
@ -204,7 +205,7 @@ namespace Ryujinx.HLE.HOS.Services.Time
public ResultCode UpdateSteadyAlarms(ServiceCtx context) public ResultCode UpdateSteadyAlarms(ServiceCtx context)
{ {
// TODO // TODO
return ResultCode.NotImplemented; throw new ServiceNotImplementedException(context);
} }
[Command(202)] [Command(202)]
@ -212,7 +213,7 @@ namespace Ryujinx.HLE.HOS.Services.Time
public ResultCode TryGetNextSteadyClockAlarmSnapshot(ServiceCtx context) public ResultCode TryGetNextSteadyClockAlarmSnapshot(ServiceCtx context)
{ {
// TODO // TODO
return ResultCode.NotImplemented; throw new ServiceNotImplementedException(context);
} }
} }
} }

View file

@ -7,7 +7,7 @@ namespace Ryujinx.HLE.HOS.Services.Time.StaticService
{ {
private SteadyClockCore _steadyClock; private SteadyClockCore _steadyClock;
private bool _writePermission; private bool _writePermission;
private bool _bypassUninitializedClock; private bool _bypassUninitializedClock;
public ISteadyClock(SteadyClockCore steadyClock, bool writePermission, bool bypassUninitializedClock) public ISteadyClock(SteadyClockCore steadyClock, bool writePermission, bool bypassUninitializedClock)
{ {

View file

@ -9,9 +9,9 @@ namespace Ryujinx.HLE.HOS.Services.Time.StaticService
{ {
class ITimeZoneServiceForGlue : IpcService class ITimeZoneServiceForGlue : IpcService
{ {
private TimeZoneContentManager _timeZoneContentManager; private TimeZoneContentManager _timeZoneContentManager;
private ITimeZoneServiceForPsc _inner; private ITimeZoneServiceForPsc _inner;
private bool _writePermission; private bool _writePermission;
public ITimeZoneServiceForGlue(TimeZoneContentManager timeZoneContentManager, bool writePermission) public ITimeZoneServiceForGlue(TimeZoneContentManager timeZoneContentManager, bool writePermission)
{ {

View file

@ -117,7 +117,6 @@ namespace Ryujinx.HLE.HOS.Services.Time
StandardLocalSystemClock.MarkInitialized(); StandardLocalSystemClock.MarkInitialized();
// TODO: propagate IPC late binding of "time:s" and "time:p" // TODO: propagate IPC late binding of "time:s" and "time:p"
} }
public void SetupStandardNetworkSystemClock(SystemClockContext clockContext, TimeSpanType sufficientAccuracy) public void SetupStandardNetworkSystemClock(SystemClockContext clockContext, TimeSpanType sufficientAccuracy)
@ -133,7 +132,6 @@ namespace Ryujinx.HLE.HOS.Services.Time
StandardNetworkSystemClock.MarkInitialized(); StandardNetworkSystemClock.MarkInitialized();
// TODO: propagate IPC late binding of "time:s" and "time:p" // TODO: propagate IPC late binding of "time:s" and "time:p"
} }
public void SetupTimeZoneManager(string locationName, SteadyClockTimePoint timeZoneUpdatedTimePoint, uint totalLocationNameCount, UInt128 timeZoneRuleVersion, Stream timeZoneBinaryStream) public void SetupTimeZoneManager(string locationName, SteadyClockTimePoint timeZoneUpdatedTimePoint, uint totalLocationNameCount, UInt128 timeZoneRuleVersion, Stream timeZoneBinaryStream)
@ -149,7 +147,6 @@ namespace Ryujinx.HLE.HOS.Services.Time
TimeZone.Manager.MarkInitialized(); TimeZone.Manager.MarkInitialized();
// TODO: propagate IPC late binding of "time:s" and "time:p" // TODO: propagate IPC late binding of "time:s" and "time:p"
} }
public void SetupEphemeralNetworkSystemClock() public void SetupEphemeralNetworkSystemClock()
@ -158,7 +155,6 @@ namespace Ryujinx.HLE.HOS.Services.Time
EphemeralNetworkSystemClock.MarkInitialized(); EphemeralNetworkSystemClock.MarkInitialized();
// TODO: propagate IPC late binding of "time:s" and "time:p" // TODO: propagate IPC late binding of "time:s" and "time:p"
} }
public void SetupStandardUserSystemClock(KThread thread, bool isAutomaticCorrectionEnabled, SteadyClockTimePoint steadyClockTimePoint) public void SetupStandardUserSystemClock(KThread thread, bool isAutomaticCorrectionEnabled, SteadyClockTimePoint steadyClockTimePoint)
@ -174,7 +170,6 @@ namespace Ryujinx.HLE.HOS.Services.Time
SharedMemory.SetAutomaticCorrectionEnabled(isAutomaticCorrectionEnabled); SharedMemory.SetAutomaticCorrectionEnabled(isAutomaticCorrectionEnabled);
// TODO: propagate IPC late binding of "time:s" and "time:p" // TODO: propagate IPC late binding of "time:s" and "time:p"
} }
public void SetStandardSteadyClockRtcOffset(KThread thread, TimeSpanType rtcOffset) public void SetStandardSteadyClockRtcOffset(KThread thread, TimeSpanType rtcOffset)

View file

@ -87,6 +87,7 @@ namespace Ryujinx.HLE.HOS.Services.Time.TimeZone
return true; return true;
} }
} }
return false; return false;
} }
@ -152,8 +153,9 @@ namespace Ryujinx.HLE.HOS.Services.Time.TimeZone
using (IStorage ncaFileStream = new LocalStorage(_device.FileSystem.SwitchPathToSystemPath(GetTimeZoneBinaryTitleContentPath()), FileAccess.Read, FileMode.Open)) using (IStorage ncaFileStream = new LocalStorage(_device.FileSystem.SwitchPathToSystemPath(GetTimeZoneBinaryTitleContentPath()), FileAccess.Read, FileMode.Open))
{ {
Nca nca = new Nca(_device.System.KeySet, ncaFileStream); Nca nca = new Nca(_device.System.KeySet, ncaFileStream);
IFileSystem romfs = nca.OpenFileSystem(NcaSectionType.Data, _device.System.FsIntegrityCheckLevel); IFileSystem romfs = nca.OpenFileSystem(NcaSectionType.Data, _device.System.FsIntegrityCheckLevel);
timeZoneBinaryStream = romfs.OpenFile($"zoneinfo/{locationName}", OpenMode.Read).AsStream(); timeZoneBinaryStream = romfs.OpenFile($"zoneinfo/{locationName}", OpenMode.Read).AsStream();
} }