2019-09-19 01:45:11 +01:00
|
|
|
|
namespace Ryujinx.HLE.HOS.Services.Lbl
|
|
|
|
|
{
|
am/lbl/hid/pctl: Enabled VR Rendering (#1688)
* am/lbl/hid/pctl: Enabled VR Rendering
This PR enable VR rendering on games which support it through the Toy-Con VR Goggles.
Please remember Ryujinx currently don't support console SixAxis sensor and for now, in some games, the view can't be moved.
Everything is implemented accordingly to RE:
- am: ICommonStateGetter: SetVrModeEnabled, BeginVrModeEx, EndVrModeEx.
- lbl: ILblController: SetBrightnessReflectionDelayLevel, GetBrightnessReflectionDelayLevel, SetCurrentAmbientLightSensorMapping, GetCurrentAmbientLightSensorMapping, SetCurrentBrightnessSettingForVrMode, GetCurrentBrightnessSettingForVrMode, EnableVrMode, DisableVrMode, IsVrModeEnabled.
- pctl: IParentalControlService: ConfirmStereoVisionPermission, ConfirmStereoVisionRestrictionConfigurable, GetStereoVisionRestriction, SetStereoVisionRestriction, ResetConfirmedStereoVisionPermission, IsStereoVisionPermitted.
- hid: IHidServer: ResetSevenSixAxisSensorTimestamp is stubbed because we don't support console SixAxisSensor for now.
Maybe we could add a setting later to enable or disable VR. But I think it's fine to keep this always available since you have to enable it in games.
* Fix permission flag check
* Address gdkchan feedback
2020-11-15 21:30:20 +00:00
|
|
|
|
abstract class ILblController : IpcService
|
2019-09-19 01:45:11 +01:00
|
|
|
|
{
|
|
|
|
|
public ILblController(ServiceCtx context) { }
|
am/lbl/hid/pctl: Enabled VR Rendering (#1688)
* am/lbl/hid/pctl: Enabled VR Rendering
This PR enable VR rendering on games which support it through the Toy-Con VR Goggles.
Please remember Ryujinx currently don't support console SixAxis sensor and for now, in some games, the view can't be moved.
Everything is implemented accordingly to RE:
- am: ICommonStateGetter: SetVrModeEnabled, BeginVrModeEx, EndVrModeEx.
- lbl: ILblController: SetBrightnessReflectionDelayLevel, GetBrightnessReflectionDelayLevel, SetCurrentAmbientLightSensorMapping, GetCurrentAmbientLightSensorMapping, SetCurrentBrightnessSettingForVrMode, GetCurrentBrightnessSettingForVrMode, EnableVrMode, DisableVrMode, IsVrModeEnabled.
- pctl: IParentalControlService: ConfirmStereoVisionPermission, ConfirmStereoVisionRestrictionConfigurable, GetStereoVisionRestriction, SetStereoVisionRestriction, ResetConfirmedStereoVisionPermission, IsStereoVisionPermitted.
- hid: IHidServer: ResetSevenSixAxisSensorTimestamp is stubbed because we don't support console SixAxisSensor for now.
Maybe we could add a setting later to enable or disable VR. But I think it's fine to keep this always available since you have to enable it in games.
* Fix permission flag check
* Address gdkchan feedback
2020-11-15 21:30:20 +00:00
|
|
|
|
|
|
|
|
|
protected abstract void SetCurrentBrightnessSettingForVrMode(float currentBrightnessSettingForVrMode);
|
|
|
|
|
protected abstract float GetCurrentBrightnessSettingForVrMode();
|
|
|
|
|
internal abstract void EnableVrMode();
|
|
|
|
|
internal abstract void DisableVrMode();
|
|
|
|
|
protected abstract bool IsVrModeEnabled();
|
|
|
|
|
|
|
|
|
|
[Command(17)]
|
|
|
|
|
// SetBrightnessReflectionDelayLevel(float, float)
|
|
|
|
|
public ResultCode SetBrightnessReflectionDelayLevel(ServiceCtx context)
|
|
|
|
|
{
|
|
|
|
|
return ResultCode.Success;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Command(18)]
|
|
|
|
|
// GetBrightnessReflectionDelayLevel(float) -> float
|
|
|
|
|
public ResultCode GetBrightnessReflectionDelayLevel(ServiceCtx context)
|
|
|
|
|
{
|
|
|
|
|
context.ResponseData.Write(0.0f);
|
|
|
|
|
|
|
|
|
|
return ResultCode.Success;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Command(21)]
|
|
|
|
|
// SetCurrentAmbientLightSensorMapping(unknown<0xC>)
|
|
|
|
|
public ResultCode SetCurrentAmbientLightSensorMapping(ServiceCtx context)
|
|
|
|
|
{
|
|
|
|
|
return ResultCode.Success;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Command(22)]
|
|
|
|
|
// GetCurrentAmbientLightSensorMapping() -> unknown<0xC>
|
|
|
|
|
public ResultCode GetCurrentAmbientLightSensorMapping(ServiceCtx context)
|
|
|
|
|
{
|
|
|
|
|
return ResultCode.Success;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Command(24)] // 3.0.0+
|
|
|
|
|
// SetCurrentBrightnessSettingForVrMode(float)
|
|
|
|
|
public ResultCode SetCurrentBrightnessSettingForVrMode(ServiceCtx context)
|
|
|
|
|
{
|
|
|
|
|
float currentBrightnessSettingForVrMode = context.RequestData.ReadSingle();
|
|
|
|
|
|
|
|
|
|
SetCurrentBrightnessSettingForVrMode(currentBrightnessSettingForVrMode);
|
|
|
|
|
|
|
|
|
|
return ResultCode.Success;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Command(25)] // 3.0.0+
|
|
|
|
|
// GetCurrentBrightnessSettingForVrMode() -> float
|
|
|
|
|
public ResultCode GetCurrentBrightnessSettingForVrMode(ServiceCtx context)
|
|
|
|
|
{
|
|
|
|
|
float currentBrightnessSettingForVrMode = GetCurrentBrightnessSettingForVrMode();
|
|
|
|
|
|
|
|
|
|
context.ResponseData.Write(currentBrightnessSettingForVrMode);
|
|
|
|
|
|
|
|
|
|
return ResultCode.Success;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Command(26)] // 3.0.0+
|
|
|
|
|
// EnableVrMode()
|
|
|
|
|
public ResultCode EnableVrMode(ServiceCtx context)
|
|
|
|
|
{
|
|
|
|
|
EnableVrMode();
|
|
|
|
|
|
|
|
|
|
return ResultCode.Success;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Command(27)] // 3.0.0+
|
|
|
|
|
// DisableVrMode()
|
|
|
|
|
public ResultCode DisableVrMode(ServiceCtx context)
|
|
|
|
|
{
|
|
|
|
|
DisableVrMode();
|
|
|
|
|
|
|
|
|
|
return ResultCode.Success;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Command(28)] // 3.0.0+
|
|
|
|
|
// IsVrModeEnabled() -> bool
|
|
|
|
|
public ResultCode IsVrModeEnabled(ServiceCtx context)
|
|
|
|
|
{
|
|
|
|
|
context.ResponseData.Write(IsVrModeEnabled());
|
|
|
|
|
|
|
|
|
|
return ResultCode.Success;
|
|
|
|
|
}
|
2019-09-19 01:45:11 +01:00
|
|
|
|
}
|
|
|
|
|
}
|