Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
aac7bbd378 | ||
|
bed516bfda |
@@ -5,6 +5,7 @@
|
|||||||
public Stick Joystick { get; set; }
|
public Stick Joystick { get; set; }
|
||||||
public bool InvertStickX { get; set; }
|
public bool InvertStickX { get; set; }
|
||||||
public bool InvertStickY { get; set; }
|
public bool InvertStickY { get; set; }
|
||||||
|
public bool Rotate90CW { get; set; }
|
||||||
public Button StickButton { get; set; }
|
public Button StickButton { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,13 +1,15 @@
|
|||||||
using Ryujinx.Common;
|
using Ryujinx.Common;
|
||||||
using Ryujinx.Common.Logging;
|
using Ryujinx.Common.Logging;
|
||||||
using Ryujinx.HLE.HOS.Services.Account.Acc;
|
using Ryujinx.HLE.HOS.Services.Account.Acc;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace Ryujinx.HLE.HOS.Services.Olsc
|
namespace Ryujinx.HLE.HOS.Services.Olsc
|
||||||
{
|
{
|
||||||
[Service("olsc:u")] // 10.0.0+
|
[Service("olsc:u")] // 10.0.0+
|
||||||
class IOlscServiceForApplication : IpcService
|
class IOlscServiceForApplication : IpcService
|
||||||
{
|
{
|
||||||
private bool _initialized;
|
private bool _initialized;
|
||||||
|
private Dictionary<UserId, bool> _saveDataBackupSettingDatabase;
|
||||||
|
|
||||||
public IOlscServiceForApplication(ServiceCtx context) { }
|
public IOlscServiceForApplication(ServiceCtx context) { }
|
||||||
|
|
||||||
@@ -16,7 +18,9 @@ namespace Ryujinx.HLE.HOS.Services.Olsc
|
|||||||
public ResultCode Initialize(ServiceCtx context)
|
public ResultCode Initialize(ServiceCtx context)
|
||||||
{
|
{
|
||||||
// NOTE: Service call arp:r GetApplicationInstanceUnregistrationNotifier with the pid and initialize some internal struct.
|
// NOTE: Service call arp:r GetApplicationInstanceUnregistrationNotifier with the pid and initialize some internal struct.
|
||||||
// Since we will not support online savedata backup. It's fine to stub it for now.
|
// Since we will not support online savedata backup, it's fine to stub it for now.
|
||||||
|
|
||||||
|
_saveDataBackupSettingDatabase = new Dictionary<UserId, bool>();
|
||||||
|
|
||||||
_initialized = true;
|
_initialized = true;
|
||||||
|
|
||||||
@@ -25,12 +29,11 @@ namespace Ryujinx.HLE.HOS.Services.Olsc
|
|||||||
return ResultCode.Success;
|
return ResultCode.Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
[CommandHipc(14)]
|
[CommandHipc(13)]
|
||||||
// SetSaveDataBackupSettingEnabled(nn::account::Uid, bool)
|
// GetSaveDataBackupSetting(nn::account::Uid) -> u8
|
||||||
public ResultCode SetSaveDataBackupSettingEnabled(ServiceCtx context)
|
public ResultCode GetSaveDataBackupSetting(ServiceCtx context)
|
||||||
{
|
{
|
||||||
UserId userId = context.RequestData.ReadStruct<UserId>();
|
UserId userId = context.RequestData.ReadStruct<UserId>();
|
||||||
ulong saveDataBackupSettingEnabled = context.RequestData.ReadUInt64();
|
|
||||||
|
|
||||||
if (!_initialized)
|
if (!_initialized)
|
||||||
{
|
{
|
||||||
@@ -42,8 +45,42 @@ namespace Ryujinx.HLE.HOS.Services.Olsc
|
|||||||
return ResultCode.NullArgument;
|
return ResultCode.NullArgument;
|
||||||
}
|
}
|
||||||
|
|
||||||
// NOTE: Service store the UserId and the boolean in an internal SaveDataBackupSettingDatabase object.
|
if (_saveDataBackupSettingDatabase[userId])
|
||||||
// Since we will not support online savedata backup. It's fine to stub it for now.
|
{
|
||||||
|
context.ResponseData.Write((byte)1); // TODO: Determine value.
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
context.ResponseData.Write((byte)2); // TODO: Determine value.
|
||||||
|
}
|
||||||
|
|
||||||
|
// NOTE: Since we will not support online savedata backup, it's fine to stub it for now.
|
||||||
|
|
||||||
|
Logger.Stub?.PrintStub(LogClass.ServiceOlsc, new { userId });
|
||||||
|
|
||||||
|
return ResultCode.Success;
|
||||||
|
}
|
||||||
|
|
||||||
|
[CommandHipc(14)]
|
||||||
|
// SetSaveDataBackupSettingEnabled(nn::account::Uid, bool)
|
||||||
|
public ResultCode SetSaveDataBackupSettingEnabled(ServiceCtx context)
|
||||||
|
{
|
||||||
|
bool saveDataBackupSettingEnabled = context.RequestData.ReadUInt64() != 0;
|
||||||
|
UserId userId = context.RequestData.ReadStruct<UserId>();
|
||||||
|
|
||||||
|
if (!_initialized)
|
||||||
|
{
|
||||||
|
return ResultCode.NotInitialized;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (userId.IsNull)
|
||||||
|
{
|
||||||
|
return ResultCode.NullArgument;
|
||||||
|
}
|
||||||
|
|
||||||
|
_saveDataBackupSettingDatabase[userId] = saveDataBackupSettingEnabled;
|
||||||
|
|
||||||
|
// NOTE: Since we will not support online savedata backup, it's fine to stub it for now.
|
||||||
|
|
||||||
Logger.Stub?.PrintStub(LogClass.ServiceOlsc, new { userId, saveDataBackupSettingEnabled });
|
Logger.Stub?.PrintStub(LogClass.ServiceOlsc, new { userId, saveDataBackupSettingEnabled });
|
||||||
|
|
||||||
|
@@ -220,6 +220,7 @@ namespace Ryujinx.Headless.SDL2
|
|||||||
StickButton = ConfigGamepadInputId.LeftStick,
|
StickButton = ConfigGamepadInputId.LeftStick,
|
||||||
InvertStickX = false,
|
InvertStickX = false,
|
||||||
InvertStickY = false,
|
InvertStickY = false,
|
||||||
|
Rotate90CW = false,
|
||||||
},
|
},
|
||||||
|
|
||||||
RightJoycon = new RightJoyconCommonConfig<ConfigGamepadInputId>
|
RightJoycon = new RightJoyconCommonConfig<ConfigGamepadInputId>
|
||||||
@@ -241,6 +242,7 @@ namespace Ryujinx.Headless.SDL2
|
|||||||
StickButton = ConfigGamepadInputId.RightStick,
|
StickButton = ConfigGamepadInputId.RightStick,
|
||||||
InvertStickX = false,
|
InvertStickX = false,
|
||||||
InvertStickY = false,
|
InvertStickY = false,
|
||||||
|
Rotate90CW = false,
|
||||||
},
|
},
|
||||||
|
|
||||||
Motion = new StandardMotionConfigController
|
Motion = new StandardMotionConfigController
|
||||||
|
@@ -350,6 +350,14 @@ namespace Ryujinx.Input.SDL2
|
|||||||
{
|
{
|
||||||
resultY = -resultY;
|
resultY = -resultY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((inputId == StickInputId.Left && _configuration.LeftJoyconStick.Rotate90CW) ||
|
||||||
|
(inputId == StickInputId.Right && _configuration.RightJoyconStick.Rotate90CW))
|
||||||
|
{
|
||||||
|
float temp = resultX;
|
||||||
|
resultX = resultY;
|
||||||
|
resultY = -temp;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return (resultX, resultY);
|
return (resultX, resultY);
|
||||||
|
@@ -73,6 +73,7 @@ namespace Ryujinx.Ui.Windows
|
|||||||
[GUI] ToggleButton _lStick;
|
[GUI] ToggleButton _lStick;
|
||||||
[GUI] CheckButton _invertLStickX;
|
[GUI] CheckButton _invertLStickX;
|
||||||
[GUI] CheckButton _invertLStickY;
|
[GUI] CheckButton _invertLStickY;
|
||||||
|
[GUI] CheckButton _rotateL90CW;
|
||||||
[GUI] ToggleButton _lStickUp;
|
[GUI] ToggleButton _lStickUp;
|
||||||
[GUI] ToggleButton _lStickDown;
|
[GUI] ToggleButton _lStickDown;
|
||||||
[GUI] ToggleButton _lStickLeft;
|
[GUI] ToggleButton _lStickLeft;
|
||||||
@@ -88,6 +89,7 @@ namespace Ryujinx.Ui.Windows
|
|||||||
[GUI] ToggleButton _rStick;
|
[GUI] ToggleButton _rStick;
|
||||||
[GUI] CheckButton _invertRStickX;
|
[GUI] CheckButton _invertRStickX;
|
||||||
[GUI] CheckButton _invertRStickY;
|
[GUI] CheckButton _invertRStickY;
|
||||||
|
[GUI] CheckButton _rotateR90CW;
|
||||||
[GUI] ToggleButton _rStickUp;
|
[GUI] ToggleButton _rStickUp;
|
||||||
[GUI] ToggleButton _rStickDown;
|
[GUI] ToggleButton _rStickDown;
|
||||||
[GUI] ToggleButton _rStickLeft;
|
[GUI] ToggleButton _rStickLeft;
|
||||||
@@ -490,6 +492,7 @@ namespace Ryujinx.Ui.Windows
|
|||||||
_lStick.Label = controllerConfig.LeftJoyconStick.Joystick.ToString();
|
_lStick.Label = controllerConfig.LeftJoyconStick.Joystick.ToString();
|
||||||
_invertLStickX.Active = controllerConfig.LeftJoyconStick.InvertStickX;
|
_invertLStickX.Active = controllerConfig.LeftJoyconStick.InvertStickX;
|
||||||
_invertLStickY.Active = controllerConfig.LeftJoyconStick.InvertStickY;
|
_invertLStickY.Active = controllerConfig.LeftJoyconStick.InvertStickY;
|
||||||
|
_rotateL90CW.Active = controllerConfig.LeftJoyconStick.Rotate90CW;
|
||||||
_lStickButton.Label = controllerConfig.LeftJoyconStick.StickButton.ToString();
|
_lStickButton.Label = controllerConfig.LeftJoyconStick.StickButton.ToString();
|
||||||
_dpadUp.Label = controllerConfig.LeftJoycon.DpadUp.ToString();
|
_dpadUp.Label = controllerConfig.LeftJoycon.DpadUp.ToString();
|
||||||
_dpadDown.Label = controllerConfig.LeftJoycon.DpadDown.ToString();
|
_dpadDown.Label = controllerConfig.LeftJoycon.DpadDown.ToString();
|
||||||
@@ -503,6 +506,7 @@ namespace Ryujinx.Ui.Windows
|
|||||||
_rStick.Label = controllerConfig.RightJoyconStick.Joystick.ToString();
|
_rStick.Label = controllerConfig.RightJoyconStick.Joystick.ToString();
|
||||||
_invertRStickX.Active = controllerConfig.RightJoyconStick.InvertStickX;
|
_invertRStickX.Active = controllerConfig.RightJoyconStick.InvertStickX;
|
||||||
_invertRStickY.Active = controllerConfig.RightJoyconStick.InvertStickY;
|
_invertRStickY.Active = controllerConfig.RightJoyconStick.InvertStickY;
|
||||||
|
_rotateR90CW.Active = controllerConfig.RightJoyconStick.Rotate90CW;
|
||||||
_rStickButton.Label = controllerConfig.RightJoyconStick.StickButton.ToString();
|
_rStickButton.Label = controllerConfig.RightJoyconStick.StickButton.ToString();
|
||||||
_a.Label = controllerConfig.RightJoycon.ButtonA.ToString();
|
_a.Label = controllerConfig.RightJoycon.ButtonA.ToString();
|
||||||
_b.Label = controllerConfig.RightJoycon.ButtonB.ToString();
|
_b.Label = controllerConfig.RightJoycon.ButtonB.ToString();
|
||||||
@@ -718,6 +722,7 @@ namespace Ryujinx.Ui.Windows
|
|||||||
Joystick = lStick,
|
Joystick = lStick,
|
||||||
InvertStickY = _invertLStickY.Active,
|
InvertStickY = _invertLStickY.Active,
|
||||||
StickButton = lStickButton,
|
StickButton = lStickButton,
|
||||||
|
Rotate90CW = _rotateL90CW.Active,
|
||||||
},
|
},
|
||||||
RightJoycon = new RightJoyconCommonConfig<ConfigGamepadInputId>
|
RightJoycon = new RightJoyconCommonConfig<ConfigGamepadInputId>
|
||||||
{
|
{
|
||||||
@@ -737,6 +742,7 @@ namespace Ryujinx.Ui.Windows
|
|||||||
Joystick = rStick,
|
Joystick = rStick,
|
||||||
InvertStickY = _invertRStickY.Active,
|
InvertStickY = _invertRStickY.Active,
|
||||||
StickButton = rStickButton,
|
StickButton = rStickButton,
|
||||||
|
Rotate90CW = _rotateR90CW.Active,
|
||||||
},
|
},
|
||||||
Motion = motionConfig,
|
Motion = motionConfig,
|
||||||
Rumble = new RumbleConfigController
|
Rumble = new RumbleConfigController
|
||||||
@@ -1056,6 +1062,7 @@ namespace Ryujinx.Ui.Windows
|
|||||||
StickButton = ConfigGamepadInputId.LeftStick,
|
StickButton = ConfigGamepadInputId.LeftStick,
|
||||||
InvertStickX = false,
|
InvertStickX = false,
|
||||||
InvertStickY = false,
|
InvertStickY = false,
|
||||||
|
Rotate90CW = false,
|
||||||
},
|
},
|
||||||
|
|
||||||
RightJoycon = new RightJoyconCommonConfig<ConfigGamepadInputId>
|
RightJoycon = new RightJoyconCommonConfig<ConfigGamepadInputId>
|
||||||
@@ -1077,6 +1084,7 @@ namespace Ryujinx.Ui.Windows
|
|||||||
StickButton = ConfigGamepadInputId.RightStick,
|
StickButton = ConfigGamepadInputId.RightStick,
|
||||||
InvertStickX = false,
|
InvertStickX = false,
|
||||||
InvertStickY = false,
|
InvertStickY = false,
|
||||||
|
Rotate90CW = false,
|
||||||
},
|
},
|
||||||
|
|
||||||
Motion = new StandardMotionConfigController
|
Motion = new StandardMotionConfigController
|
||||||
|
@@ -740,6 +740,19 @@
|
|||||||
<property name="top_attach">1</property>
|
<property name="top_attach">1</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkCheckButton" id="_rotateL90CW">
|
||||||
|
<property name="label" translatable="yes">Rotate 90° Clockwise</property>
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">True</property>
|
||||||
|
<property name="receives_default">False</property>
|
||||||
|
<property name="draw_indicator">True</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="left_attach">2</property>
|
||||||
|
<property name="top_attach">2</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="expand">False</property>
|
<property name="expand">False</property>
|
||||||
@@ -1697,6 +1710,19 @@
|
|||||||
<property name="top_attach">1</property>
|
<property name="top_attach">1</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkCheckButton" id="_rotateR90CW">
|
||||||
|
<property name="label" translatable="yes">Rotate 90° Clockwise</property>
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">True</property>
|
||||||
|
<property name="receives_default">False</property>
|
||||||
|
<property name="draw_indicator">True</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="left_attach">2</property>
|
||||||
|
<property name="top_attach">2</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="expand">False</property>
|
<property name="expand">False</property>
|
||||||
|
Reference in New Issue
Block a user