diff options
| author | Alex Barney <thealexbarney@gmail.com> | 2018-12-06 05:16:24 -0600 |
|---|---|---|
| committer | gdkchan <gab.dark.100@gmail.com> | 2018-12-06 09:16:24 -0200 |
| commit | fb1d9493a3d43f2b86c551682586905a1f0e9ea7 (patch) | |
| tree | d842685ff5bdd45d11d94bd1a45a002b9d532fe7 /Ryujinx.HLE/HOS/Services/Nfp | |
| parent | 3615a70cae3f89197fe185dfc5d0a47fa42151d9 (diff) | |
Adjust naming conventions and general refactoring in HLE Project (#527)
* Rename enum fields
* Naming conventions
* Remove unneeded ".this"
* Remove unneeded semicolons
* Remove unused Usings
* Don't use var
* Remove unneeded enum underlying types
* Explicitly label class visibility
* Remove unneeded @ prefixes
* Remove unneeded commas
* Remove unneeded if expressions
* Method doesn't use unsafe code
* Remove unneeded casts
* Initialized objects don't need an empty constructor
* Remove settings from DotSettings
* Revert "Explicitly label class visibility"
This reverts commit ad5eb5787cc5b27a4631cd46ef5f551c4ae95e51.
* Small changes
* Revert external enum renaming
* Changes from feedback
* Apply previous refactorings to the merged code
Diffstat (limited to 'Ryujinx.HLE/HOS/Services/Nfp')
| -rw-r--r-- | Ryujinx.HLE/HOS/Services/Nfp/IUser.cs | 60 | ||||
| -rw-r--r-- | Ryujinx.HLE/HOS/Services/Nfp/IUserManager.cs | 10 |
2 files changed, 35 insertions, 35 deletions
diff --git a/Ryujinx.HLE/HOS/Services/Nfp/IUser.cs b/Ryujinx.HLE/HOS/Services/Nfp/IUser.cs index f0dc825b..9e19e77f 100644 --- a/Ryujinx.HLE/HOS/Services/Nfp/IUser.cs +++ b/Ryujinx.HLE/HOS/Services/Nfp/IUser.cs @@ -9,25 +9,25 @@ namespace Ryujinx.HLE.HOS.Services.Nfp { class IUser : IpcService { - private Dictionary<int, ServiceProcessRequest> m_Commands; + private Dictionary<int, ServiceProcessRequest> _commands; - public override IReadOnlyDictionary<int, ServiceProcessRequest> Commands => m_Commands; + public override IReadOnlyDictionary<int, ServiceProcessRequest> Commands => _commands; - private const HidControllerId NpadId = HidControllerId.CONTROLLER_PLAYER_1; + private const HidControllerId NpadId = HidControllerId.ControllerPlayer1; - private State State = State.NonInitialized; + private State _state = State.NonInitialized; - private DeviceState DeviceState = DeviceState.Initialized; + private DeviceState _deviceState = DeviceState.Initialized; - private KEvent ActivateEvent; + private KEvent _activateEvent; - private KEvent DeactivateEvent; + private KEvent _deactivateEvent; - private KEvent AvailabilityChangeEvent; + private KEvent _availabilityChangeEvent; - public IUser(Horizon System) + public IUser(Horizon system) { - m_Commands = new Dictionary<int, ServiceProcessRequest>() + _commands = new Dictionary<int, ServiceProcessRequest> { { 0, Initialize }, { 17, AttachActivateEvent }, @@ -38,85 +38,85 @@ namespace Ryujinx.HLE.HOS.Services.Nfp { 23, AttachAvailabilityChangeEvent } }; - ActivateEvent = new KEvent(System); - DeactivateEvent = new KEvent(System); - AvailabilityChangeEvent = new KEvent(System); + _activateEvent = new KEvent(system); + _deactivateEvent = new KEvent(system); + _availabilityChangeEvent = new KEvent(system); } - public long Initialize(ServiceCtx Context) + public long Initialize(ServiceCtx context) { Logger.PrintStub(LogClass.ServiceNfp, "Stubbed."); - State = State.Initialized; + _state = State.Initialized; return 0; } - public long AttachActivateEvent(ServiceCtx Context) + public long AttachActivateEvent(ServiceCtx context) { Logger.PrintStub(LogClass.ServiceNfp, "Stubbed."); - if (Context.Process.HandleTable.GenerateHandle(ActivateEvent.ReadableEvent, out int Handle) != KernelResult.Success) + if (context.Process.HandleTable.GenerateHandle(_activateEvent.ReadableEvent, out int handle) != KernelResult.Success) { throw new InvalidOperationException("Out of handles!"); } - Context.Response.HandleDesc = IpcHandleDesc.MakeCopy(Handle);; + context.Response.HandleDesc = IpcHandleDesc.MakeCopy(handle); return 0; } - public long AttachDeactivateEvent(ServiceCtx Context) + public long AttachDeactivateEvent(ServiceCtx context) { Logger.PrintStub(LogClass.ServiceNfp, "Stubbed."); - if (Context.Process.HandleTable.GenerateHandle(DeactivateEvent.ReadableEvent, out int Handle) != KernelResult.Success) + if (context.Process.HandleTable.GenerateHandle(_deactivateEvent.ReadableEvent, out int handle) != KernelResult.Success) { throw new InvalidOperationException("Out of handles!"); } - Context.Response.HandleDesc = IpcHandleDesc.MakeCopy(Handle); + context.Response.HandleDesc = IpcHandleDesc.MakeCopy(handle); return 0; } - public long GetState(ServiceCtx Context) + public long GetState(ServiceCtx context) { - Context.ResponseData.Write((int)State); + context.ResponseData.Write((int)_state); Logger.PrintStub(LogClass.ServiceNfp, "Stubbed."); return 0; } - public long GetDeviceState(ServiceCtx Context) + public long GetDeviceState(ServiceCtx context) { - Context.ResponseData.Write((int)DeviceState); + context.ResponseData.Write((int)_deviceState); Logger.PrintStub(LogClass.ServiceNfp, "Stubbed."); return 0; } - public long GetNpadId(ServiceCtx Context) + public long GetNpadId(ServiceCtx context) { - Context.ResponseData.Write((int)NpadId); + context.ResponseData.Write((int)NpadId); Logger.PrintStub(LogClass.ServiceNfp, "Stubbed."); return 0; } - public long AttachAvailabilityChangeEvent(ServiceCtx Context) + public long AttachAvailabilityChangeEvent(ServiceCtx context) { Logger.PrintStub(LogClass.ServiceNfp, "Stubbed."); - if (Context.Process.HandleTable.GenerateHandle(AvailabilityChangeEvent.ReadableEvent, out int Handle) != KernelResult.Success) + if (context.Process.HandleTable.GenerateHandle(_availabilityChangeEvent.ReadableEvent, out int handle) != KernelResult.Success) { throw new InvalidOperationException("Out of handles!"); } - Context.Response.HandleDesc = IpcHandleDesc.MakeCopy(Handle); + context.Response.HandleDesc = IpcHandleDesc.MakeCopy(handle); return 0; } diff --git a/Ryujinx.HLE/HOS/Services/Nfp/IUserManager.cs b/Ryujinx.HLE/HOS/Services/Nfp/IUserManager.cs index e5d5a4f1..1bf93746 100644 --- a/Ryujinx.HLE/HOS/Services/Nfp/IUserManager.cs +++ b/Ryujinx.HLE/HOS/Services/Nfp/IUserManager.cs @@ -5,21 +5,21 @@ namespace Ryujinx.HLE.HOS.Services.Nfp { class IUserManager : IpcService { - private Dictionary<int, ServiceProcessRequest> m_Commands; + private Dictionary<int, ServiceProcessRequest> _commands; - public override IReadOnlyDictionary<int, ServiceProcessRequest> Commands => m_Commands; + public override IReadOnlyDictionary<int, ServiceProcessRequest> Commands => _commands; public IUserManager() { - m_Commands = new Dictionary<int, ServiceProcessRequest>() + _commands = new Dictionary<int, ServiceProcessRequest> { { 0, GetUserInterface } }; } - public long GetUserInterface(ServiceCtx Context) + public long GetUserInterface(ServiceCtx context) { - MakeObject(Context, new IUser(Context.Device.System)); + MakeObject(context, new IUser(context.Device.System)); return 0; } |
