This commit is contained in:
fearlessTobi 2018-06-08 16:47:56 +02:00
commit 78443e3307
2 changed files with 12 additions and 28 deletions

View file

@ -1,16 +0,0 @@
namespace Ryujinx.Core.OsHle.Services.Hid
{
enum ControllerID
{
ControllerPlayer1 = 0,
ControllerPlayer2 = 1,
ControllerPlayer3 = 2,
ControllerPlayer4 = 3,
ControllerPlayer5 = 4,
ControllerPlayer6 = 5,
ControllerPlayer7 = 6,
ControllerPlayer8 = 7,
ControllerHandheld = 8,
ControllerUnknown = 9,
}
}

View file

@ -1,6 +1,7 @@
using Ryujinx.Core.Logging; using Ryujinx.Core.Logging;
using Ryujinx.Core.OsHle.Ipc; using Ryujinx.Core.OsHle.Ipc;
using System.Collections.Generic; using System.Collections.Generic;
using Ryujinx.Core.Input;
using Ryujinx.Core.OsHle.Handles; using Ryujinx.Core.OsHle.Handles;
using Ryujinx.Core.OsHle.Services.Hid; using Ryujinx.Core.OsHle.Services.Hid;
@ -12,10 +13,9 @@ namespace Ryujinx.Core.OsHle.Services.Nfp
public override IReadOnlyDictionary<int, ServiceProcessRequest> Commands => m_Commands; public override IReadOnlyDictionary<int, ServiceProcessRequest> Commands => m_Commands;
ulong device_handle = 0xDEAD; private const HidControllerId NpadId = HidControllerId.CONTROLLER_PLAYER_1;
ControllerID npad_id = ControllerID.ControllerPlayer1; private State state = State.NonInitialized;
State state = State.NonInitialized; private DeviceState DeviceState = DeviceState.Initialized;
DeviceState device_state = DeviceState.Initialized;
private KEvent ActivateEvent; private KEvent ActivateEvent;
private KEvent DeactivateEvent; private KEvent DeactivateEvent;
private KEvent AvailabilityChangeEvent; private KEvent AvailabilityChangeEvent;
@ -24,12 +24,12 @@ namespace Ryujinx.Core.OsHle.Services.Nfp
{ {
m_Commands = new Dictionary<int, ServiceProcessRequest>() m_Commands = new Dictionary<int, ServiceProcessRequest>()
{ {
{ 0, Initialize }, { 0, Initialize },
{ 17, AttachActivateEvent }, { 17, AttachActivateEvent },
{ 18, AttachDeactivateEvent }, { 18, AttachDeactivateEvent },
{ 19, GetState }, { 19, GetState },
{ 20, GetDeviceState }, { 20, GetDeviceState },
{ 21, GetNpadId }, { 21, GetNpadId },
{ 23, AttachAvailabilityChangeEvent } { 23, AttachAvailabilityChangeEvent }
}; };
@ -80,7 +80,7 @@ namespace Ryujinx.Core.OsHle.Services.Nfp
public long GetDeviceState(ServiceCtx Context) public long GetDeviceState(ServiceCtx Context)
{ {
Context.ResponseData.Write((int)device_state); Context.ResponseData.Write((int)DeviceState);
Context.Ns.Log.PrintStub(LogClass.ServiceNfp, "Stubbed."); Context.Ns.Log.PrintStub(LogClass.ServiceNfp, "Stubbed.");
@ -89,7 +89,7 @@ namespace Ryujinx.Core.OsHle.Services.Nfp
public long GetNpadId(ServiceCtx Context) public long GetNpadId(ServiceCtx Context)
{ {
Context.ResponseData.Write((int)npad_id); Context.ResponseData.Write((int)NpadId);
Context.Ns.Log.PrintStub(LogClass.ServiceNfp, "Stubbed."); Context.Ns.Log.PrintStub(LogClass.ServiceNfp, "Stubbed.");