Compare commits
8 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
4250732353 | ||
|
4d1579acbf | ||
|
6279f5e430 | ||
|
b7d2bff6aa | ||
|
7c327fecb3 | ||
|
cc1a933a2f | ||
|
dd574146fb | ||
|
2c94ac455e |
@@ -157,7 +157,7 @@ namespace Ryujinx.Ava
|
|||||||
_isFirmwareTitle = true;
|
_isFirmwareTitle = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
ConfigurationState.Instance.HideCursorOnIdle.Event += HideCursorState_Changed;
|
ConfigurationState.Instance.HideCursor.Event += HideCursorState_Changed;
|
||||||
|
|
||||||
_topLevel.PointerMoved += TopLevel_PointerMoved;
|
_topLevel.PointerMoved += TopLevel_PointerMoved;
|
||||||
|
|
||||||
@@ -468,9 +468,9 @@ namespace Ryujinx.Ava
|
|||||||
(_rendererHost.EmbeddedWindow as EmbeddedWindowOpenGL)?.MakeCurrent(null);
|
(_rendererHost.EmbeddedWindow as EmbeddedWindowOpenGL)?.MakeCurrent(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void HideCursorState_Changed(object sender, ReactiveEventArgs<bool> state)
|
private void HideCursorState_Changed(object sender, ReactiveEventArgs<HideCursorMode> state)
|
||||||
{
|
{
|
||||||
if (state.NewValue)
|
if (state.NewValue == HideCursorMode.OnIdle)
|
||||||
{
|
{
|
||||||
_lastCursorMoveTime = Stopwatch.GetTimestamp();
|
_lastCursorMoveTime = Stopwatch.GetTimestamp();
|
||||||
}
|
}
|
||||||
@@ -964,22 +964,21 @@ namespace Ryujinx.Ava
|
|||||||
NpadManager.Update(ConfigurationState.Instance.Graphics.AspectRatio.Value.ToFloat());
|
NpadManager.Update(ConfigurationState.Instance.Graphics.AspectRatio.Value.ToFloat());
|
||||||
|
|
||||||
if (_viewModel.IsActive)
|
if (_viewModel.IsActive)
|
||||||
{
|
|
||||||
if (ConfigurationState.Instance.Hid.EnableMouse)
|
|
||||||
{
|
{
|
||||||
if (_isCursorInRenderer)
|
if (_isCursorInRenderer)
|
||||||
|
{
|
||||||
|
if (ConfigurationState.Instance.Hid.EnableMouse)
|
||||||
{
|
{
|
||||||
HideCursor();
|
HideCursor();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
switch (ConfigurationState.Instance.HideCursor.Value)
|
||||||
|
{
|
||||||
|
case HideCursorMode.Never:
|
||||||
ShowCursor();
|
ShowCursor();
|
||||||
}
|
break;
|
||||||
}
|
case HideCursorMode.OnIdle:
|
||||||
else
|
|
||||||
{
|
|
||||||
if (ConfigurationState.Instance.HideCursorOnIdle)
|
|
||||||
{
|
|
||||||
if (Stopwatch.GetTimestamp() - _lastCursorMoveTime >= CursorHideIdleTime * Stopwatch.Frequency)
|
if (Stopwatch.GetTimestamp() - _lastCursorMoveTime >= CursorHideIdleTime * Stopwatch.Frequency)
|
||||||
{
|
{
|
||||||
HideCursor();
|
HideCursor();
|
||||||
@@ -988,8 +987,17 @@ namespace Ryujinx.Ava
|
|||||||
{
|
{
|
||||||
ShowCursor();
|
ShowCursor();
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
|
case HideCursorMode.Always:
|
||||||
|
HideCursor();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ShowCursor();
|
||||||
|
}
|
||||||
|
|
||||||
Dispatcher.UIThread.Post(() =>
|
Dispatcher.UIThread.Post(() =>
|
||||||
{
|
{
|
||||||
|
@@ -80,7 +80,10 @@
|
|||||||
"SettingsTabGeneralEnableDiscordRichPresence": "Enable Discord Rich Presence",
|
"SettingsTabGeneralEnableDiscordRichPresence": "Enable Discord Rich Presence",
|
||||||
"SettingsTabGeneralCheckUpdatesOnLaunch": "Check for Updates on Launch",
|
"SettingsTabGeneralCheckUpdatesOnLaunch": "Check for Updates on Launch",
|
||||||
"SettingsTabGeneralShowConfirmExitDialog": "Show \"Confirm Exit\" Dialog",
|
"SettingsTabGeneralShowConfirmExitDialog": "Show \"Confirm Exit\" Dialog",
|
||||||
"SettingsTabGeneralHideCursorOnIdle": "Hide Cursor on Idle",
|
"SettingsTabGeneralHideCursor": "Hide Cursor:",
|
||||||
|
"SettingsTabGeneralHideCursorNever": "Never",
|
||||||
|
"SettingsTabGeneralHideCursorOnIdle": "On Idle",
|
||||||
|
"SettingsTabGeneralHideCursorAlways": "Always",
|
||||||
"SettingsTabGeneralGameDirectories": "Game Directories",
|
"SettingsTabGeneralGameDirectories": "Game Directories",
|
||||||
"SettingsTabGeneralAdd": "Add",
|
"SettingsTabGeneralAdd": "Add",
|
||||||
"SettingsTabGeneralRemove": "Remove",
|
"SettingsTabGeneralRemove": "Remove",
|
||||||
|
@@ -183,6 +183,18 @@ namespace Ryujinx.Ava
|
|||||||
{
|
{
|
||||||
ConfigurationState.Instance.System.EnableDockedMode.Value = CommandLineState.OverrideDockedMode.Value;
|
ConfigurationState.Instance.System.EnableDockedMode.Value = CommandLineState.OverrideDockedMode.Value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check if HideCursor was overridden.
|
||||||
|
if (CommandLineState.OverrideHideCursor is not null)
|
||||||
|
{
|
||||||
|
ConfigurationState.Instance.HideCursor.Value = CommandLineState.OverrideHideCursor!.ToLower() switch
|
||||||
|
{
|
||||||
|
"never" => HideCursorMode.Never,
|
||||||
|
"onidle" => HideCursorMode.OnIdle,
|
||||||
|
"always" => HideCursorMode.Always,
|
||||||
|
_ => ConfigurationState.Instance.HideCursor.Value
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void PrintSystemInfo()
|
private static void PrintSystemInfo()
|
||||||
|
@@ -132,7 +132,7 @@ namespace Ryujinx.Ava.UI.ViewModels
|
|||||||
public bool EnableDiscordIntegration { get; set; }
|
public bool EnableDiscordIntegration { get; set; }
|
||||||
public bool CheckUpdatesOnStart { get; set; }
|
public bool CheckUpdatesOnStart { get; set; }
|
||||||
public bool ShowConfirmExit { get; set; }
|
public bool ShowConfirmExit { get; set; }
|
||||||
public bool HideCursorOnIdle { get; set; }
|
public int HideCursor { get; set; }
|
||||||
public bool EnableDockedMode { get; set; }
|
public bool EnableDockedMode { get; set; }
|
||||||
public bool EnableKeyboard { get; set; }
|
public bool EnableKeyboard { get; set; }
|
||||||
public bool EnableMouse { get; set; }
|
public bool EnableMouse { get; set; }
|
||||||
@@ -375,7 +375,7 @@ namespace Ryujinx.Ava.UI.ViewModels
|
|||||||
EnableDiscordIntegration = config.EnableDiscordIntegration;
|
EnableDiscordIntegration = config.EnableDiscordIntegration;
|
||||||
CheckUpdatesOnStart = config.CheckUpdatesOnStart;
|
CheckUpdatesOnStart = config.CheckUpdatesOnStart;
|
||||||
ShowConfirmExit = config.ShowConfirmExit;
|
ShowConfirmExit = config.ShowConfirmExit;
|
||||||
HideCursorOnIdle = config.HideCursorOnIdle;
|
HideCursor = (int)config.HideCursor.Value;
|
||||||
|
|
||||||
GameDirectories.Clear();
|
GameDirectories.Clear();
|
||||||
GameDirectories.AddRange(config.Ui.GameDirs.Value);
|
GameDirectories.AddRange(config.Ui.GameDirs.Value);
|
||||||
@@ -458,7 +458,7 @@ namespace Ryujinx.Ava.UI.ViewModels
|
|||||||
config.EnableDiscordIntegration.Value = EnableDiscordIntegration;
|
config.EnableDiscordIntegration.Value = EnableDiscordIntegration;
|
||||||
config.CheckUpdatesOnStart.Value = CheckUpdatesOnStart;
|
config.CheckUpdatesOnStart.Value = CheckUpdatesOnStart;
|
||||||
config.ShowConfirmExit.Value = ShowConfirmExit;
|
config.ShowConfirmExit.Value = ShowConfirmExit;
|
||||||
config.HideCursorOnIdle.Value = HideCursorOnIdle;
|
config.HideCursor.Value = (HideCursorMode)HideCursor;
|
||||||
|
|
||||||
if (_directoryChanged)
|
if (_directoryChanged)
|
||||||
{
|
{
|
||||||
|
@@ -37,9 +37,24 @@
|
|||||||
<CheckBox IsChecked="{Binding ShowConfirmExit}">
|
<CheckBox IsChecked="{Binding ShowConfirmExit}">
|
||||||
<TextBlock Text="{locale:Locale SettingsTabGeneralShowConfirmExitDialog}" />
|
<TextBlock Text="{locale:Locale SettingsTabGeneralShowConfirmExitDialog}" />
|
||||||
</CheckBox>
|
</CheckBox>
|
||||||
<CheckBox IsChecked="{Binding HideCursorOnIdle}">
|
<StackPanel Margin="0, 15, 0, 10" Orientation="Horizontal">
|
||||||
|
<TextBlock VerticalAlignment="Center"
|
||||||
|
Text="{locale:Locale SettingsTabGeneralHideCursor}"
|
||||||
|
Width="150" />
|
||||||
|
<ComboBox SelectedIndex="{Binding HideCursor}"
|
||||||
|
HorizontalContentAlignment="Left"
|
||||||
|
MinWidth="100">
|
||||||
|
<ComboBoxItem>
|
||||||
|
<TextBlock Text="{locale:Locale SettingsTabGeneralHideCursorNever}" />
|
||||||
|
</ComboBoxItem>
|
||||||
|
<ComboBoxItem>
|
||||||
<TextBlock Text="{locale:Locale SettingsTabGeneralHideCursorOnIdle}" />
|
<TextBlock Text="{locale:Locale SettingsTabGeneralHideCursorOnIdle}" />
|
||||||
</CheckBox>
|
</ComboBoxItem>
|
||||||
|
<ComboBoxItem>
|
||||||
|
<TextBlock Text="{locale:Locale SettingsTabGeneralHideCursorAlways}" />
|
||||||
|
</ComboBoxItem>
|
||||||
|
</ComboBox>
|
||||||
|
</StackPanel>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<Separator Height="1" />
|
<Separator Height="1" />
|
||||||
<TextBlock Classes="h1" Text="{locale:Locale SettingsTabGeneralGameDirectories}" />
|
<TextBlock Classes="h1" Text="{locale:Locale SettingsTabGeneralGameDirectories}" />
|
||||||
|
9
src/Ryujinx.Common/Configuration/HideCursorMode.cs
Normal file
9
src/Ryujinx.Common/Configuration/HideCursorMode.cs
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
namespace Ryujinx.Common.Configuration
|
||||||
|
{
|
||||||
|
public enum HideCursorMode
|
||||||
|
{
|
||||||
|
Never,
|
||||||
|
OnIdle,
|
||||||
|
Always
|
||||||
|
}
|
||||||
|
}
|
@@ -300,11 +300,16 @@ namespace Ryujinx.Graphics.Gpu.Engine.Twod
|
|||||||
IsCopyRegionComplete(srcCopyTexture, srcCopyTextureFormat, srcX1, srcY1, srcX2, srcY2) &&
|
IsCopyRegionComplete(srcCopyTexture, srcCopyTextureFormat, srcX1, srcY1, srcX2, srcY2) &&
|
||||||
IsCopyRegionComplete(dstCopyTexture, dstCopyTextureFormat, dstX1, dstY1, dstX2, dstY2);
|
IsCopyRegionComplete(dstCopyTexture, dstCopyTextureFormat, dstX1, dstY1, dstX2, dstY2);
|
||||||
|
|
||||||
|
// We can only allow aliasing of color formats as depth if the source and destination textures
|
||||||
|
// are the same, as we can't blit between different depth formats.
|
||||||
|
bool srcDepthAlias = srcCopyTexture.Format == dstCopyTexture.Format;
|
||||||
|
|
||||||
var srcTexture = memoryManager.Physical.TextureCache.FindOrCreateTexture(
|
var srcTexture = memoryManager.Physical.TextureCache.FindOrCreateTexture(
|
||||||
memoryManager,
|
memoryManager,
|
||||||
srcCopyTexture,
|
srcCopyTexture,
|
||||||
offset,
|
offset,
|
||||||
srcCopyTextureFormat,
|
srcCopyTextureFormat,
|
||||||
|
srcDepthAlias,
|
||||||
!canDirectCopy,
|
!canDirectCopy,
|
||||||
false,
|
false,
|
||||||
srcHint);
|
srcHint);
|
||||||
@@ -325,6 +330,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Twod
|
|||||||
// When the source texture that was found has a depth format,
|
// When the source texture that was found has a depth format,
|
||||||
// we must enforce the target texture also has a depth format,
|
// we must enforce the target texture also has a depth format,
|
||||||
// as copies between depth and color formats are not allowed.
|
// as copies between depth and color formats are not allowed.
|
||||||
|
// For depth blit, the destination texture format should always match exactly.
|
||||||
|
|
||||||
if (srcTexture.Format.IsDepthOrStencil())
|
if (srcTexture.Format.IsDepthOrStencil())
|
||||||
{
|
{
|
||||||
@@ -340,7 +346,8 @@ namespace Ryujinx.Graphics.Gpu.Engine.Twod
|
|||||||
dstCopyTexture,
|
dstCopyTexture,
|
||||||
0,
|
0,
|
||||||
dstCopyTextureFormat,
|
dstCopyTextureFormat,
|
||||||
true,
|
depthAlias: false,
|
||||||
|
shouldCreate: true,
|
||||||
srcTexture.ScaleMode == TextureScaleMode.Scaled,
|
srcTexture.ScaleMode == TextureScaleMode.Scaled,
|
||||||
dstHint);
|
dstHint);
|
||||||
|
|
||||||
|
@@ -1,5 +1,4 @@
|
|||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Concurrent;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace Ryujinx.Graphics.Gpu.Image
|
namespace Ryujinx.Graphics.Gpu.Image
|
||||||
@@ -9,6 +8,7 @@ namespace Ryujinx.Graphics.Gpu.Image
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
class ShortTextureCacheEntry
|
class ShortTextureCacheEntry
|
||||||
{
|
{
|
||||||
|
public bool IsAutoDelete;
|
||||||
public readonly TextureDescriptor Descriptor;
|
public readonly TextureDescriptor Descriptor;
|
||||||
public readonly int InvalidatedSequence;
|
public readonly int InvalidatedSequence;
|
||||||
public readonly Texture Texture;
|
public readonly Texture Texture;
|
||||||
@@ -24,6 +24,17 @@ namespace Ryujinx.Graphics.Gpu.Image
|
|||||||
InvalidatedSequence = texture.InvalidatedSequence;
|
InvalidatedSequence = texture.InvalidatedSequence;
|
||||||
Texture = texture;
|
Texture = texture;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Create a new entry on the short duration texture cache from the auto delete cache.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="texture">The texture</param>
|
||||||
|
public ShortTextureCacheEntry(Texture texture)
|
||||||
|
{
|
||||||
|
IsAutoDelete = true;
|
||||||
|
InvalidatedSequence = texture.InvalidatedSequence;
|
||||||
|
Texture = texture;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -199,7 +210,11 @@ namespace Ryujinx.Graphics.Gpu.Image
|
|||||||
{
|
{
|
||||||
texture.DecrementReferenceCount();
|
texture.DecrementReferenceCount();
|
||||||
|
|
||||||
|
if (!texture.ShortCacheEntry.IsAutoDelete)
|
||||||
|
{
|
||||||
_shortCacheLookup.Remove(texture.ShortCacheEntry.Descriptor);
|
_shortCacheLookup.Remove(texture.ShortCacheEntry.Descriptor);
|
||||||
|
}
|
||||||
|
|
||||||
texture.ShortCacheEntry = null;
|
texture.ShortCacheEntry = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -222,6 +237,25 @@ namespace Ryujinx.Graphics.Gpu.Image
|
|||||||
texture.IncrementReferenceCount();
|
texture.IncrementReferenceCount();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Adds a texture to the short duration cache without a descriptor. This typically keeps it alive for two ticks.
|
||||||
|
/// On expiry, it will be removed from the AutoDeleteCache.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="texture">Texture to add to the short cache</param>
|
||||||
|
public void AddShortCache(Texture texture)
|
||||||
|
{
|
||||||
|
if (texture.ShortCacheEntry != null)
|
||||||
|
{
|
||||||
|
var entry = new ShortTextureCacheEntry(texture);
|
||||||
|
|
||||||
|
_shortCacheBuilder.Add(entry);
|
||||||
|
|
||||||
|
texture.ShortCacheEntry = entry;
|
||||||
|
|
||||||
|
texture.IncrementReferenceCount();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Delete textures from the short duration cache.
|
/// Delete textures from the short duration cache.
|
||||||
/// Moves the builder set to be deleted on next process.
|
/// Moves the builder set to be deleted on next process.
|
||||||
@@ -234,7 +268,15 @@ namespace Ryujinx.Graphics.Gpu.Image
|
|||||||
{
|
{
|
||||||
entry.Texture.DecrementReferenceCount();
|
entry.Texture.DecrementReferenceCount();
|
||||||
|
|
||||||
|
if (entry.IsAutoDelete)
|
||||||
|
{
|
||||||
|
Remove(entry.Texture, false);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
_shortCacheLookup.Remove(entry.Descriptor);
|
_shortCacheLookup.Remove(entry.Descriptor);
|
||||||
|
}
|
||||||
|
|
||||||
entry.Texture.ShortCacheEntry = null;
|
entry.Texture.ShortCacheEntry = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -144,6 +144,11 @@ namespace Ryujinx.Graphics.Gpu.Image
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public ShortTextureCacheEntry ShortCacheEntry { get; set; }
|
public ShortTextureCacheEntry ShortCacheEntry { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Whether this texture has ever been referenced by a pool.
|
||||||
|
/// </summary>
|
||||||
|
public bool HadPoolOwner { get; private set; }
|
||||||
|
|
||||||
/// Physical memory ranges where the texture data is located.
|
/// Physical memory ranges where the texture data is located.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public MultiRange Range { get; private set; }
|
public MultiRange Range { get; private set; }
|
||||||
@@ -1113,7 +1118,7 @@ namespace Ryujinx.Graphics.Gpu.Image
|
|||||||
{
|
{
|
||||||
bool forSampler = (flags & TextureSearchFlags.ForSampler) != 0;
|
bool forSampler = (flags & TextureSearchFlags.ForSampler) != 0;
|
||||||
|
|
||||||
TextureMatchQuality matchQuality = TextureCompatibility.FormatMatches(Info, info, forSampler, (flags & TextureSearchFlags.ForCopy) != 0);
|
TextureMatchQuality matchQuality = TextureCompatibility.FormatMatches(Info, info, forSampler, (flags & TextureSearchFlags.DepthAlias) != 0);
|
||||||
|
|
||||||
if (matchQuality == TextureMatchQuality.NoMatch)
|
if (matchQuality == TextureMatchQuality.NoMatch)
|
||||||
{
|
{
|
||||||
@@ -1506,10 +1511,13 @@ namespace Ryujinx.Graphics.Gpu.Image
|
|||||||
/// <param name="gpuVa">GPU VA of the pool reference</param>
|
/// <param name="gpuVa">GPU VA of the pool reference</param>
|
||||||
public void IncrementReferenceCount(TexturePool pool, int id, ulong gpuVa)
|
public void IncrementReferenceCount(TexturePool pool, int id, ulong gpuVa)
|
||||||
{
|
{
|
||||||
|
HadPoolOwner = true;
|
||||||
|
|
||||||
lock (_poolOwners)
|
lock (_poolOwners)
|
||||||
{
|
{
|
||||||
_poolOwners.Add(new TexturePoolOwner { Pool = pool, ID = id, GpuAddress = gpuVa });
|
_poolOwners.Add(new TexturePoolOwner { Pool = pool, ID = id, GpuAddress = gpuVa });
|
||||||
}
|
}
|
||||||
|
|
||||||
_referenceCount++;
|
_referenceCount++;
|
||||||
|
|
||||||
if (ShortCacheEntry != null)
|
if (ShortCacheEntry != null)
|
||||||
@@ -1594,7 +1602,7 @@ namespace Ryujinx.Graphics.Gpu.Image
|
|||||||
_poolOwners.Clear();
|
_poolOwners.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ShortCacheEntry != null && _context.IsGpuThread())
|
if (ShortCacheEntry != null && !ShortCacheEntry.IsAutoDelete && _context.IsGpuThread())
|
||||||
{
|
{
|
||||||
// If this is called from another thread (unmapped), the short cache will
|
// If this is called from another thread (unmapped), the short cache will
|
||||||
// have to remove this texture on a future tick.
|
// have to remove this texture on a future tick.
|
||||||
|
@@ -249,6 +249,8 @@ namespace Ryujinx.Graphics.Gpu.Image
|
|||||||
/// <param name="copyTexture">Copy texture to find or create</param>
|
/// <param name="copyTexture">Copy texture to find or create</param>
|
||||||
/// <param name="offset">Offset to be added to the physical texture address</param>
|
/// <param name="offset">Offset to be added to the physical texture address</param>
|
||||||
/// <param name="formatInfo">Format information of the copy texture</param>
|
/// <param name="formatInfo">Format information of the copy texture</param>
|
||||||
|
/// <param name="depthAlias">Indicates if aliasing between color and depth format should be allowed</param>
|
||||||
|
/// <param name="shouldCreate">Indicates if a new texture should be created if none is found on the cache</param>
|
||||||
/// <param name="preferScaling">Indicates if the texture should be scaled from the start</param>
|
/// <param name="preferScaling">Indicates if the texture should be scaled from the start</param>
|
||||||
/// <param name="sizeHint">A hint indicating the minimum used size for the texture</param>
|
/// <param name="sizeHint">A hint indicating the minimum used size for the texture</param>
|
||||||
/// <returns>The texture</returns>
|
/// <returns>The texture</returns>
|
||||||
@@ -257,6 +259,7 @@ namespace Ryujinx.Graphics.Gpu.Image
|
|||||||
TwodTexture copyTexture,
|
TwodTexture copyTexture,
|
||||||
ulong offset,
|
ulong offset,
|
||||||
FormatInfo formatInfo,
|
FormatInfo formatInfo,
|
||||||
|
bool depthAlias,
|
||||||
bool shouldCreate,
|
bool shouldCreate,
|
||||||
bool preferScaling,
|
bool preferScaling,
|
||||||
Size sizeHint)
|
Size sizeHint)
|
||||||
@@ -293,6 +296,11 @@ namespace Ryujinx.Graphics.Gpu.Image
|
|||||||
|
|
||||||
TextureSearchFlags flags = TextureSearchFlags.ForCopy;
|
TextureSearchFlags flags = TextureSearchFlags.ForCopy;
|
||||||
|
|
||||||
|
if (depthAlias)
|
||||||
|
{
|
||||||
|
flags |= TextureSearchFlags.DepthAlias;
|
||||||
|
}
|
||||||
|
|
||||||
if (preferScaling)
|
if (preferScaling)
|
||||||
{
|
{
|
||||||
flags |= TextureSearchFlags.WithUpscale;
|
flags |= TextureSearchFlags.WithUpscale;
|
||||||
@@ -847,9 +855,19 @@ namespace Ryujinx.Graphics.Gpu.Image
|
|||||||
setData |= modified || flush;
|
setData |= modified || flush;
|
||||||
|
|
||||||
if (overlapInCache)
|
if (overlapInCache)
|
||||||
|
{
|
||||||
|
if (flush || overlap.HadPoolOwner || overlap.IsView)
|
||||||
{
|
{
|
||||||
_cache.Remove(overlap, flush);
|
_cache.Remove(overlap, flush);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// This texture has only ever been referenced in the AutoDeleteCache.
|
||||||
|
// Keep this texture alive with the short duration cache, as it may be used often but not sampled.
|
||||||
|
|
||||||
|
_cache.AddShortCache(overlap);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
removeOverlap = modified;
|
removeOverlap = modified;
|
||||||
}
|
}
|
||||||
@@ -1198,6 +1216,16 @@ namespace Ryujinx.Graphics.Gpu.Image
|
|||||||
_cache.AddShortCache(texture, ref descriptor);
|
_cache.AddShortCache(texture, ref descriptor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Adds a texture to the short duration cache without a descriptor. This typically keeps it alive for two ticks.
|
||||||
|
/// On expiry, it will be removed from the AutoDeleteCache.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="texture">Texture to add to the short cache</param>
|
||||||
|
public void AddShortCache(Texture texture)
|
||||||
|
{
|
||||||
|
_cache.AddShortCache(texture);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Removes a texture from the short duration cache.
|
/// Removes a texture from the short duration cache.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@@ -220,18 +220,18 @@ namespace Ryujinx.Graphics.Gpu.Image
|
|||||||
/// <param name="lhs">Texture information to compare</param>
|
/// <param name="lhs">Texture information to compare</param>
|
||||||
/// <param name="rhs">Texture information to compare with</param>
|
/// <param name="rhs">Texture information to compare with</param>
|
||||||
/// <param name="forSampler">Indicates that the texture will be used for shader sampling</param>
|
/// <param name="forSampler">Indicates that the texture will be used for shader sampling</param>
|
||||||
/// <param name="forCopy">Indicates that the texture will be used as copy source or target</param>
|
/// <param name="depthAlias">Indicates if aliasing between color and depth format should be allowed</param>
|
||||||
/// <returns>A value indicating how well the formats match</returns>
|
/// <returns>A value indicating how well the formats match</returns>
|
||||||
public static TextureMatchQuality FormatMatches(TextureInfo lhs, TextureInfo rhs, bool forSampler, bool forCopy)
|
public static TextureMatchQuality FormatMatches(TextureInfo lhs, TextureInfo rhs, bool forSampler, bool depthAlias)
|
||||||
{
|
{
|
||||||
// D32F and R32F texture have the same representation internally,
|
// D32F and R32F texture have the same representation internally,
|
||||||
// however the R32F format is used to sample from depth textures.
|
// however the R32F format is used to sample from depth textures.
|
||||||
if (lhs.FormatInfo.Format == Format.D32Float && rhs.FormatInfo.Format == Format.R32Float && (forSampler || forCopy))
|
if (lhs.FormatInfo.Format == Format.D32Float && rhs.FormatInfo.Format == Format.R32Float && (forSampler || depthAlias))
|
||||||
{
|
{
|
||||||
return TextureMatchQuality.FormatAlias;
|
return TextureMatchQuality.FormatAlias;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (forCopy)
|
if (depthAlias)
|
||||||
{
|
{
|
||||||
// The 2D engine does not support depth-stencil formats, so it will instead
|
// The 2D engine does not support depth-stencil formats, so it will instead
|
||||||
// use equivalent color formats. We must also consider them as compatible.
|
// use equivalent color formats. We must also consider them as compatible.
|
||||||
|
@@ -11,7 +11,8 @@ namespace Ryujinx.Graphics.Gpu.Image
|
|||||||
None = 0,
|
None = 0,
|
||||||
ForSampler = 1 << 1,
|
ForSampler = 1 << 1,
|
||||||
ForCopy = 1 << 2,
|
ForCopy = 1 << 2,
|
||||||
WithUpscale = 1 << 3,
|
DepthAlias = 1 << 3,
|
||||||
NoCreate = 1 << 4
|
WithUpscale = 1 << 4,
|
||||||
|
NoCreate = 1 << 5
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -1015,8 +1015,8 @@ namespace Ryujinx.Graphics.Vulkan
|
|||||||
|
|
||||||
private void SetRenderTargetsInternal(ITexture[] colors, ITexture depthStencil, bool filterWriteMasked)
|
private void SetRenderTargetsInternal(ITexture[] colors, ITexture depthStencil, bool filterWriteMasked)
|
||||||
{
|
{
|
||||||
FramebufferParams?.UpdateModifications();
|
|
||||||
CreateFramebuffer(colors, depthStencil, filterWriteMasked);
|
CreateFramebuffer(colors, depthStencil, filterWriteMasked);
|
||||||
|
FramebufferParams?.UpdateModifications();
|
||||||
CreateRenderPass();
|
CreateRenderPass();
|
||||||
SignalStateChange();
|
SignalStateChange();
|
||||||
SignalAttachmentChange();
|
SignalAttachmentChange();
|
||||||
|
@@ -327,7 +327,7 @@ namespace Ryujinx.HLE.HOS
|
|||||||
private void StartNewServices()
|
private void StartNewServices()
|
||||||
{
|
{
|
||||||
ServiceTable = new ServiceTable();
|
ServiceTable = new ServiceTable();
|
||||||
var services = ServiceTable.GetServices(new HorizonOptions(Device.Configuration.IgnoreMissingServices));
|
var services = ServiceTable.GetServices(new HorizonOptions(Device.Configuration.IgnoreMissingServices, LibHacHorizonManager.BcatClient));
|
||||||
|
|
||||||
foreach (var service in services)
|
foreach (var service in services)
|
||||||
{
|
{
|
||||||
|
@@ -1,85 +0,0 @@
|
|||||||
using LibHac;
|
|
||||||
using LibHac.Common;
|
|
||||||
using Ryujinx.Common;
|
|
||||||
using Ryujinx.HLE.HOS.Services.Arp;
|
|
||||||
using Ryujinx.HLE.HOS.Services.Bcat.ServiceCreator;
|
|
||||||
|
|
||||||
namespace Ryujinx.HLE.HOS.Services.Bcat
|
|
||||||
{
|
|
||||||
[Service("bcat:a", "bcat:a")]
|
|
||||||
[Service("bcat:m", "bcat:m")]
|
|
||||||
[Service("bcat:u", "bcat:u")]
|
|
||||||
[Service("bcat:s", "bcat:s")]
|
|
||||||
class IServiceCreator : DisposableIpcService
|
|
||||||
{
|
|
||||||
private SharedRef<LibHac.Bcat.Impl.Ipc.IServiceCreator> _base;
|
|
||||||
|
|
||||||
public IServiceCreator(ServiceCtx context, string serviceName)
|
|
||||||
{
|
|
||||||
var applicationClient = context.Device.System.LibHacHorizonManager.ApplicationClient;
|
|
||||||
applicationClient.Sm.GetService(ref _base, serviceName).ThrowIfFailure();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void Dispose(bool isDisposing)
|
|
||||||
{
|
|
||||||
if (isDisposing)
|
|
||||||
{
|
|
||||||
_base.Destroy();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[CommandCmif(0)]
|
|
||||||
// CreateBcatService(pid) -> object<nn::bcat::detail::ipc::IBcatService>
|
|
||||||
public ResultCode CreateBcatService(ServiceCtx context)
|
|
||||||
{
|
|
||||||
// TODO: Call arp:r GetApplicationLaunchProperty with the pid to get the TitleId.
|
|
||||||
// Add an instance of nn::bcat::detail::service::core::PassphraseManager.
|
|
||||||
// Add an instance of nn::bcat::detail::service::ServiceMemoryManager.
|
|
||||||
// Add an instance of nn::bcat::detail::service::core::TaskManager who load "bcat-sys:/" system save data and open "dc/task.bin".
|
|
||||||
// If the file don't exist, create a new one (size of 0x800) and write 2 empty struct with a size of 0x400.
|
|
||||||
|
|
||||||
MakeObject(context, new IBcatService(ApplicationLaunchProperty.GetByPid(context)));
|
|
||||||
|
|
||||||
// NOTE: If the IBcatService is null this error is returned, Doesn't occur in our case.
|
|
||||||
// return ResultCode.NullObject;
|
|
||||||
|
|
||||||
return ResultCode.Success;
|
|
||||||
}
|
|
||||||
|
|
||||||
[CommandCmif(1)]
|
|
||||||
// CreateDeliveryCacheStorageService(pid) -> object<nn::bcat::detail::ipc::IDeliveryCacheStorageService>
|
|
||||||
public ResultCode CreateDeliveryCacheStorageService(ServiceCtx context)
|
|
||||||
{
|
|
||||||
ulong pid = context.RequestData.ReadUInt64();
|
|
||||||
|
|
||||||
using var serv = new SharedRef<LibHac.Bcat.Impl.Ipc.IDeliveryCacheStorageService>();
|
|
||||||
|
|
||||||
Result rc = _base.Get.CreateDeliveryCacheStorageService(ref serv.Ref, pid);
|
|
||||||
|
|
||||||
if (rc.IsSuccess())
|
|
||||||
{
|
|
||||||
MakeObject(context, new IDeliveryCacheStorageService(context, ref serv.Ref));
|
|
||||||
}
|
|
||||||
|
|
||||||
return (ResultCode)rc.Value;
|
|
||||||
}
|
|
||||||
|
|
||||||
[CommandCmif(2)]
|
|
||||||
// CreateDeliveryCacheStorageServiceWithApplicationId(nn::ApplicationId) -> object<nn::bcat::detail::ipc::IDeliveryCacheStorageService>
|
|
||||||
public ResultCode CreateDeliveryCacheStorageServiceWithApplicationId(ServiceCtx context)
|
|
||||||
{
|
|
||||||
ApplicationId applicationId = context.RequestData.ReadStruct<ApplicationId>();
|
|
||||||
|
|
||||||
using var service = new SharedRef<LibHac.Bcat.Impl.Ipc.IDeliveryCacheStorageService>();
|
|
||||||
|
|
||||||
Result rc = _base.Get.CreateDeliveryCacheStorageServiceWithApplicationId(ref service.Ref, applicationId);
|
|
||||||
|
|
||||||
if (rc.IsSuccess())
|
|
||||||
{
|
|
||||||
MakeObject(context, new IDeliveryCacheStorageService(context, ref service.Ref));
|
|
||||||
}
|
|
||||||
|
|
||||||
return (ResultCode)rc.Value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,29 +0,0 @@
|
|||||||
namespace Ryujinx.HLE.HOS.Services.Bcat
|
|
||||||
{
|
|
||||||
enum ResultCode
|
|
||||||
{
|
|
||||||
ModuleId = 122,
|
|
||||||
ErrorCodeShift = 9,
|
|
||||||
|
|
||||||
Success = 0,
|
|
||||||
|
|
||||||
InvalidArgument = (1 << ErrorCodeShift) | ModuleId,
|
|
||||||
NotFound = (2 << ErrorCodeShift) | ModuleId,
|
|
||||||
TargetLocked = (3 << ErrorCodeShift) | ModuleId,
|
|
||||||
TargetAlreadyMounted = (4 << ErrorCodeShift) | ModuleId,
|
|
||||||
TargetNotMounted = (5 << ErrorCodeShift) | ModuleId,
|
|
||||||
AlreadyOpen = (6 << ErrorCodeShift) | ModuleId,
|
|
||||||
NotOpen = (7 << ErrorCodeShift) | ModuleId,
|
|
||||||
InternetRequestDenied = (8 << ErrorCodeShift) | ModuleId,
|
|
||||||
ServiceOpenLimitReached = (9 << ErrorCodeShift) | ModuleId,
|
|
||||||
SaveDataNotFound = (10 << ErrorCodeShift) | ModuleId,
|
|
||||||
NetworkServiceAccountNotAvailable = (31 << ErrorCodeShift) | ModuleId,
|
|
||||||
PassphrasePathNotFound = (80 << ErrorCodeShift) | ModuleId,
|
|
||||||
DataVerificationFailed = (81 << ErrorCodeShift) | ModuleId,
|
|
||||||
PermissionDenied = (90 << ErrorCodeShift) | ModuleId,
|
|
||||||
AllocationFailed = (91 << ErrorCodeShift) | ModuleId,
|
|
||||||
InvalidOperation = (98 << ErrorCodeShift) | ModuleId,
|
|
||||||
InvalidDeliveryCacheStorageFile = (204 << ErrorCodeShift) | ModuleId,
|
|
||||||
StorageOpenLimitReached = (205 << ErrorCodeShift) | ModuleId
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,18 +0,0 @@
|
|||||||
using Ryujinx.HLE.HOS.Services.Arp;
|
|
||||||
|
|
||||||
namespace Ryujinx.HLE.HOS.Services.Bcat.ServiceCreator
|
|
||||||
{
|
|
||||||
class IBcatService : IpcService
|
|
||||||
{
|
|
||||||
public IBcatService(ApplicationLaunchProperty applicationLaunchProperty) { }
|
|
||||||
|
|
||||||
[CommandCmif(10100)]
|
|
||||||
// RequestSyncDeliveryCache() -> object<nn::bcat::detail::ipc::IDeliveryCacheProgressService>
|
|
||||||
public ResultCode RequestSyncDeliveryCache(ServiceCtx context)
|
|
||||||
{
|
|
||||||
MakeObject(context, new IDeliveryCacheProgressService(context));
|
|
||||||
|
|
||||||
return ResultCode.Success;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,65 +0,0 @@
|
|||||||
using LibHac;
|
|
||||||
using LibHac.Bcat;
|
|
||||||
using LibHac.Common;
|
|
||||||
using Ryujinx.Common;
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
|
|
||||||
namespace Ryujinx.HLE.HOS.Services.Bcat.ServiceCreator
|
|
||||||
{
|
|
||||||
class IDeliveryCacheDirectoryService : DisposableIpcService
|
|
||||||
{
|
|
||||||
private SharedRef<LibHac.Bcat.Impl.Ipc.IDeliveryCacheDirectoryService> _base;
|
|
||||||
|
|
||||||
public IDeliveryCacheDirectoryService(ref SharedRef<LibHac.Bcat.Impl.Ipc.IDeliveryCacheDirectoryService> baseService)
|
|
||||||
{
|
|
||||||
_base = SharedRef<LibHac.Bcat.Impl.Ipc.IDeliveryCacheDirectoryService>.CreateMove(ref baseService);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void Dispose(bool isDisposing)
|
|
||||||
{
|
|
||||||
if (isDisposing)
|
|
||||||
{
|
|
||||||
_base.Destroy();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[CommandCmif(0)]
|
|
||||||
// Open(nn::bcat::DirectoryName)
|
|
||||||
public ResultCode Open(ServiceCtx context)
|
|
||||||
{
|
|
||||||
DirectoryName directoryName = context.RequestData.ReadStruct<DirectoryName>();
|
|
||||||
|
|
||||||
Result result = _base.Get.Open(ref directoryName);
|
|
||||||
|
|
||||||
return (ResultCode)result.Value;
|
|
||||||
}
|
|
||||||
|
|
||||||
[CommandCmif(1)]
|
|
||||||
// Read() -> (u32, buffer<nn::bcat::DeliveryCacheDirectoryEntry, 6>)
|
|
||||||
public ResultCode Read(ServiceCtx context)
|
|
||||||
{
|
|
||||||
ulong bufferAddress = context.Request.ReceiveBuff[0].Position;
|
|
||||||
ulong bufferLen = context.Request.ReceiveBuff[0].Size;
|
|
||||||
|
|
||||||
using (var region = context.Memory.GetWritableRegion(bufferAddress, (int)bufferLen, true))
|
|
||||||
{
|
|
||||||
Result result = _base.Get.Read(out int entriesRead, MemoryMarshal.Cast<byte, DeliveryCacheDirectoryEntry>(region.Memory.Span));
|
|
||||||
|
|
||||||
context.ResponseData.Write(entriesRead);
|
|
||||||
|
|
||||||
return (ResultCode)result.Value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[CommandCmif(2)]
|
|
||||||
// GetCount() -> u32
|
|
||||||
public ResultCode GetCount(ServiceCtx context)
|
|
||||||
{
|
|
||||||
Result result = _base.Get.GetCount(out int count);
|
|
||||||
|
|
||||||
context.ResponseData.Write(count);
|
|
||||||
|
|
||||||
return (ResultCode)result.Value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,78 +0,0 @@
|
|||||||
using LibHac;
|
|
||||||
using LibHac.Bcat;
|
|
||||||
using LibHac.Common;
|
|
||||||
using Ryujinx.Common;
|
|
||||||
|
|
||||||
namespace Ryujinx.HLE.HOS.Services.Bcat.ServiceCreator
|
|
||||||
{
|
|
||||||
class IDeliveryCacheFileService : DisposableIpcService
|
|
||||||
{
|
|
||||||
private SharedRef<LibHac.Bcat.Impl.Ipc.IDeliveryCacheFileService> _base;
|
|
||||||
|
|
||||||
public IDeliveryCacheFileService(ref SharedRef<LibHac.Bcat.Impl.Ipc.IDeliveryCacheFileService> baseService)
|
|
||||||
{
|
|
||||||
_base = SharedRef<LibHac.Bcat.Impl.Ipc.IDeliveryCacheFileService>.CreateMove(ref baseService);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void Dispose(bool isDisposing)
|
|
||||||
{
|
|
||||||
if (isDisposing)
|
|
||||||
{
|
|
||||||
_base.Destroy();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[CommandCmif(0)]
|
|
||||||
// Open(nn::bcat::DirectoryName, nn::bcat::FileName)
|
|
||||||
public ResultCode Open(ServiceCtx context)
|
|
||||||
{
|
|
||||||
DirectoryName directoryName = context.RequestData.ReadStruct<DirectoryName>();
|
|
||||||
FileName fileName = context.RequestData.ReadStruct<FileName>();
|
|
||||||
|
|
||||||
Result result = _base.Get.Open(ref directoryName, ref fileName);
|
|
||||||
|
|
||||||
return (ResultCode)result.Value;
|
|
||||||
}
|
|
||||||
|
|
||||||
[CommandCmif(1)]
|
|
||||||
// Read(u64) -> (u64, buffer<bytes, 6>)
|
|
||||||
public ResultCode Read(ServiceCtx context)
|
|
||||||
{
|
|
||||||
ulong bufferAddress = context.Request.ReceiveBuff[0].Position;
|
|
||||||
ulong bufferLen = context.Request.ReceiveBuff[0].Size;
|
|
||||||
|
|
||||||
long offset = context.RequestData.ReadInt64();
|
|
||||||
|
|
||||||
using (var region = context.Memory.GetWritableRegion(bufferAddress, (int)bufferLen, true))
|
|
||||||
{
|
|
||||||
Result result = _base.Get.Read(out long bytesRead, offset, region.Memory.Span);
|
|
||||||
|
|
||||||
context.ResponseData.Write(bytesRead);
|
|
||||||
|
|
||||||
return (ResultCode)result.Value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[CommandCmif(2)]
|
|
||||||
// GetSize() -> u64
|
|
||||||
public ResultCode GetSize(ServiceCtx context)
|
|
||||||
{
|
|
||||||
Result result = _base.Get.GetSize(out long size);
|
|
||||||
|
|
||||||
context.ResponseData.Write(size);
|
|
||||||
|
|
||||||
return (ResultCode)result.Value;
|
|
||||||
}
|
|
||||||
|
|
||||||
[CommandCmif(3)]
|
|
||||||
// GetDigest() -> nn::bcat::Digest
|
|
||||||
public ResultCode GetDigest(ServiceCtx context)
|
|
||||||
{
|
|
||||||
Result result = _base.Get.GetDigest(out Digest digest);
|
|
||||||
|
|
||||||
context.ResponseData.WriteStruct(digest);
|
|
||||||
|
|
||||||
return (ResultCode)result.Value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,63 +0,0 @@
|
|||||||
using Ryujinx.Common.Logging;
|
|
||||||
using Ryujinx.Cpu;
|
|
||||||
using Ryujinx.HLE.HOS.Ipc;
|
|
||||||
using Ryujinx.HLE.HOS.Kernel.Threading;
|
|
||||||
using Ryujinx.HLE.HOS.Services.Bcat.ServiceCreator.Types;
|
|
||||||
using Ryujinx.Horizon.Common;
|
|
||||||
using System;
|
|
||||||
|
|
||||||
namespace Ryujinx.HLE.HOS.Services.Bcat.ServiceCreator
|
|
||||||
{
|
|
||||||
class IDeliveryCacheProgressService : IpcService
|
|
||||||
{
|
|
||||||
private KEvent _event;
|
|
||||||
private int _eventHandle;
|
|
||||||
|
|
||||||
public IDeliveryCacheProgressService(ServiceCtx context)
|
|
||||||
{
|
|
||||||
_event = new KEvent(context.Device.System.KernelContext);
|
|
||||||
}
|
|
||||||
|
|
||||||
[CommandCmif(0)]
|
|
||||||
// GetEvent() -> handle<copy>
|
|
||||||
public ResultCode GetEvent(ServiceCtx context)
|
|
||||||
{
|
|
||||||
if (_eventHandle == 0)
|
|
||||||
{
|
|
||||||
if (context.Process.HandleTable.GenerateHandle(_event.ReadableEvent, out _eventHandle) != Result.Success)
|
|
||||||
{
|
|
||||||
throw new InvalidOperationException("Out of handles!");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
context.Response.HandleDesc = IpcHandleDesc.MakeCopy(_eventHandle);
|
|
||||||
|
|
||||||
Logger.Stub?.PrintStub(LogClass.ServiceBcat);
|
|
||||||
|
|
||||||
return ResultCode.Success;
|
|
||||||
}
|
|
||||||
|
|
||||||
[CommandCmif(1)]
|
|
||||||
// GetImpl() -> buffer<nn::bcat::detail::DeliveryCacheProgressImpl, 0x1a>
|
|
||||||
public ResultCode GetImpl(ServiceCtx context)
|
|
||||||
{
|
|
||||||
DeliveryCacheProgressImpl deliveryCacheProgress = new DeliveryCacheProgressImpl
|
|
||||||
{
|
|
||||||
State = DeliveryCacheProgressImpl.Status.Done,
|
|
||||||
Result = 0
|
|
||||||
};
|
|
||||||
|
|
||||||
ulong dcpSize = WriteDeliveryCacheProgressImpl(context, context.Request.RecvListBuff[0], deliveryCacheProgress);
|
|
||||||
context.Response.PtrBuff[0] = context.Response.PtrBuff[0].WithSize(dcpSize);
|
|
||||||
|
|
||||||
Logger.Stub?.PrintStub(LogClass.ServiceBcat);
|
|
||||||
|
|
||||||
return ResultCode.Success;
|
|
||||||
}
|
|
||||||
|
|
||||||
private ulong WriteDeliveryCacheProgressImpl(ServiceCtx context, IpcRecvListBuffDesc ipcDesc, DeliveryCacheProgressImpl deliveryCacheProgress)
|
|
||||||
{
|
|
||||||
return MemoryHelper.Write(context.Memory, ipcDesc.Position, deliveryCacheProgress);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,74 +0,0 @@
|
|||||||
using LibHac;
|
|
||||||
using LibHac.Bcat;
|
|
||||||
using LibHac.Common;
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
|
|
||||||
namespace Ryujinx.HLE.HOS.Services.Bcat.ServiceCreator
|
|
||||||
{
|
|
||||||
class IDeliveryCacheStorageService : DisposableIpcService
|
|
||||||
{
|
|
||||||
private SharedRef<LibHac.Bcat.Impl.Ipc.IDeliveryCacheStorageService> _base;
|
|
||||||
|
|
||||||
public IDeliveryCacheStorageService(ServiceCtx context, ref SharedRef<LibHac.Bcat.Impl.Ipc.IDeliveryCacheStorageService> baseService)
|
|
||||||
{
|
|
||||||
_base = SharedRef<LibHac.Bcat.Impl.Ipc.IDeliveryCacheStorageService>.CreateMove(ref baseService);
|
|
||||||
}
|
|
||||||
|
|
||||||
[CommandCmif(0)]
|
|
||||||
// CreateFileService() -> object<nn::bcat::detail::ipc::IDeliveryCacheFileService>
|
|
||||||
public ResultCode CreateFileService(ServiceCtx context)
|
|
||||||
{
|
|
||||||
using var service = new SharedRef<LibHac.Bcat.Impl.Ipc.IDeliveryCacheFileService>();
|
|
||||||
|
|
||||||
Result result = _base.Get.CreateFileService(ref service.Ref);
|
|
||||||
|
|
||||||
if (result.IsSuccess())
|
|
||||||
{
|
|
||||||
MakeObject(context, new IDeliveryCacheFileService(ref service.Ref));
|
|
||||||
}
|
|
||||||
|
|
||||||
return (ResultCode)result.Value;
|
|
||||||
}
|
|
||||||
|
|
||||||
[CommandCmif(1)]
|
|
||||||
// CreateDirectoryService() -> object<nn::bcat::detail::ipc::IDeliveryCacheDirectoryService>
|
|
||||||
public ResultCode CreateDirectoryService(ServiceCtx context)
|
|
||||||
{
|
|
||||||
using var service = new SharedRef<LibHac.Bcat.Impl.Ipc.IDeliveryCacheDirectoryService>();
|
|
||||||
|
|
||||||
Result result = _base.Get.CreateDirectoryService(ref service.Ref);
|
|
||||||
|
|
||||||
if (result.IsSuccess())
|
|
||||||
{
|
|
||||||
MakeObject(context, new IDeliveryCacheDirectoryService(ref service.Ref));
|
|
||||||
}
|
|
||||||
|
|
||||||
return (ResultCode)result.Value;
|
|
||||||
}
|
|
||||||
|
|
||||||
[CommandCmif(10)]
|
|
||||||
// EnumerateDeliveryCacheDirectory() -> (u32, buffer<nn::bcat::DirectoryName, 6>)
|
|
||||||
public ResultCode EnumerateDeliveryCacheDirectory(ServiceCtx context)
|
|
||||||
{
|
|
||||||
ulong bufferAddress = context.Request.ReceiveBuff[0].Position;
|
|
||||||
ulong bufferLen = context.Request.ReceiveBuff[0].Size;
|
|
||||||
|
|
||||||
using (var region = context.Memory.GetWritableRegion(bufferAddress, (int)bufferLen, true))
|
|
||||||
{
|
|
||||||
Result result = _base.Get.EnumerateDeliveryCacheDirectory(out int count, MemoryMarshal.Cast<byte, DirectoryName>(region.Memory.Span));
|
|
||||||
|
|
||||||
context.ResponseData.Write(count);
|
|
||||||
|
|
||||||
return (ResultCode)result.Value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void Dispose(bool isDisposing)
|
|
||||||
{
|
|
||||||
if (isDisposing)
|
|
||||||
{
|
|
||||||
_base.Destroy();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,9 +0,0 @@
|
|||||||
namespace Ryujinx.Headless.SDL2
|
|
||||||
{
|
|
||||||
public enum HideCursor
|
|
||||||
{
|
|
||||||
Never,
|
|
||||||
OnIdle,
|
|
||||||
Always
|
|
||||||
}
|
|
||||||
}
|
|
@@ -107,8 +107,8 @@ namespace Ryujinx.Headless.SDL2.OpenGL
|
|||||||
GraphicsDebugLevel glLogLevel,
|
GraphicsDebugLevel glLogLevel,
|
||||||
AspectRatio aspectRatio,
|
AspectRatio aspectRatio,
|
||||||
bool enableMouse,
|
bool enableMouse,
|
||||||
HideCursor hideCursor)
|
HideCursorMode hideCursorMode)
|
||||||
: base(inputManager, glLogLevel, aspectRatio, enableMouse, hideCursor)
|
: base(inputManager, glLogLevel, aspectRatio, enableMouse, hideCursorMode)
|
||||||
{
|
{
|
||||||
_glLogLevel = glLogLevel;
|
_glLogLevel = glLogLevel;
|
||||||
}
|
}
|
||||||
|
@@ -76,8 +76,8 @@ namespace Ryujinx.Headless.SDL2
|
|||||||
[Option("enable-mouse", Required = false, Default = false, HelpText = "Enable or disable mouse support.")]
|
[Option("enable-mouse", Required = false, Default = false, HelpText = "Enable or disable mouse support.")]
|
||||||
public bool EnableMouse { get; set; }
|
public bool EnableMouse { get; set; }
|
||||||
|
|
||||||
[Option("hide-cursor", Required = false, Default = HideCursor.OnIdle, HelpText = "Change when the cursor gets hidden.")]
|
[Option("hide-cursor", Required = false, Default = HideCursorMode.OnIdle, HelpText = "Change when the cursor gets hidden.")]
|
||||||
public HideCursor HideCursor { get; set; }
|
public HideCursorMode HideCursorMode { get; set; }
|
||||||
|
|
||||||
[Option("list-input-profiles", Required = false, HelpText = "List inputs profiles.")]
|
[Option("list-input-profiles", Required = false, HelpText = "List inputs profiles.")]
|
||||||
public bool ListInputProfiles { get; set; }
|
public bool ListInputProfiles { get; set; }
|
||||||
|
@@ -478,8 +478,8 @@ namespace Ryujinx.Headless.SDL2
|
|||||||
private static WindowBase CreateWindow(Options options)
|
private static WindowBase CreateWindow(Options options)
|
||||||
{
|
{
|
||||||
return options.GraphicsBackend == GraphicsBackend.Vulkan
|
return options.GraphicsBackend == GraphicsBackend.Vulkan
|
||||||
? new VulkanWindow(_inputManager, options.LoggingGraphicsDebugLevel, options.AspectRatio, options.EnableMouse, options.HideCursor)
|
? new VulkanWindow(_inputManager, options.LoggingGraphicsDebugLevel, options.AspectRatio, options.EnableMouse, options.HideCursorMode)
|
||||||
: new OpenGLWindow(_inputManager, options.LoggingGraphicsDebugLevel, options.AspectRatio, options.EnableMouse, options.HideCursor);
|
: new OpenGLWindow(_inputManager, options.LoggingGraphicsDebugLevel, options.AspectRatio, options.EnableMouse, options.HideCursorMode);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static IRenderer CreateRenderer(Options options, WindowBase window)
|
private static IRenderer CreateRenderer(Options options, WindowBase window)
|
||||||
|
@@ -1,4 +1,5 @@
|
|||||||
using Ryujinx.Input;
|
using Ryujinx.Common.Configuration;
|
||||||
|
using Ryujinx.Input;
|
||||||
using System;
|
using System;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
@@ -13,7 +14,7 @@ namespace Ryujinx.Headless.SDL2
|
|||||||
private const int CursorHideIdleTime = 5; // seconds
|
private const int CursorHideIdleTime = 5; // seconds
|
||||||
|
|
||||||
private bool _isDisposed;
|
private bool _isDisposed;
|
||||||
private HideCursor _hideCursor;
|
private HideCursorMode _hideCursorMode;
|
||||||
private bool _isHidden;
|
private bool _isHidden;
|
||||||
private long _lastCursorMoveTime;
|
private long _lastCursorMoveTime;
|
||||||
|
|
||||||
@@ -23,12 +24,12 @@ namespace Ryujinx.Headless.SDL2
|
|||||||
public Vector2 Scroll { get; private set; }
|
public Vector2 Scroll { get; private set; }
|
||||||
public Size _clientSize;
|
public Size _clientSize;
|
||||||
|
|
||||||
public SDL2MouseDriver(HideCursor hideCursor)
|
public SDL2MouseDriver(HideCursorMode hideCursorMode)
|
||||||
{
|
{
|
||||||
PressedButtons = new bool[(int)MouseButton.Count];
|
PressedButtons = new bool[(int)MouseButton.Count];
|
||||||
_hideCursor = hideCursor;
|
_hideCursorMode = hideCursorMode;
|
||||||
|
|
||||||
if (_hideCursor == HideCursor.Always)
|
if (_hideCursorMode == HideCursorMode.Always)
|
||||||
{
|
{
|
||||||
SDL_ShowCursor(SDL_DISABLE);
|
SDL_ShowCursor(SDL_DISABLE);
|
||||||
_isHidden = true;
|
_isHidden = true;
|
||||||
@@ -59,7 +60,7 @@ namespace Ryujinx.Headless.SDL2
|
|||||||
|
|
||||||
private void CheckIdle()
|
private void CheckIdle()
|
||||||
{
|
{
|
||||||
if (_hideCursor != HideCursor.OnIdle)
|
if (_hideCursorMode != HideCursorMode.OnIdle)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@@ -17,8 +17,8 @@ namespace Ryujinx.Headless.SDL2.Vulkan
|
|||||||
GraphicsDebugLevel glLogLevel,
|
GraphicsDebugLevel glLogLevel,
|
||||||
AspectRatio aspectRatio,
|
AspectRatio aspectRatio,
|
||||||
bool enableMouse,
|
bool enableMouse,
|
||||||
HideCursor hideCursor)
|
HideCursorMode hideCursorMode)
|
||||||
: base(inputManager, glLogLevel, aspectRatio, enableMouse, hideCursor)
|
: base(inputManager, glLogLevel, aspectRatio, enableMouse, hideCursorMode)
|
||||||
{
|
{
|
||||||
_glLogLevel = glLogLevel;
|
_glLogLevel = glLogLevel;
|
||||||
}
|
}
|
||||||
|
@@ -78,9 +78,9 @@ namespace Ryujinx.Headless.SDL2
|
|||||||
GraphicsDebugLevel glLogLevel,
|
GraphicsDebugLevel glLogLevel,
|
||||||
AspectRatio aspectRatio,
|
AspectRatio aspectRatio,
|
||||||
bool enableMouse,
|
bool enableMouse,
|
||||||
HideCursor hideCursor)
|
HideCursorMode hideCursorMode)
|
||||||
{
|
{
|
||||||
MouseDriver = new SDL2MouseDriver(hideCursor);
|
MouseDriver = new SDL2MouseDriver(hideCursorMode);
|
||||||
_inputManager = inputManager;
|
_inputManager = inputManager;
|
||||||
_inputManager.SetMouseDriver(MouseDriver);
|
_inputManager.SetMouseDriver(MouseDriver);
|
||||||
NpadManager = _inputManager.CreateNpadManager();
|
NpadManager = _inputManager.CreateNpadManager();
|
||||||
|
48
src/Ryujinx.Horizon/Bcat/BcatIpcServer.cs
Normal file
48
src/Ryujinx.Horizon/Bcat/BcatIpcServer.cs
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
using Ryujinx.Horizon.Bcat.Ipc;
|
||||||
|
using Ryujinx.Horizon.Bcat.Types;
|
||||||
|
using Ryujinx.Horizon.Sdk.Sf.Hipc;
|
||||||
|
using Ryujinx.Horizon.Sdk.Sm;
|
||||||
|
|
||||||
|
namespace Ryujinx.Horizon.Bcat
|
||||||
|
{
|
||||||
|
internal class BcatIpcServer
|
||||||
|
{
|
||||||
|
private const int BcatMaxSessionsCount = 8;
|
||||||
|
private const int BcatTotalMaxSessionsCount = BcatMaxSessionsCount * 4;
|
||||||
|
|
||||||
|
private const int PointerBufferSize = 0x400;
|
||||||
|
private const int MaxDomains = 64;
|
||||||
|
private const int MaxDomainObjects = 64;
|
||||||
|
private const int MaxPortsCount = 4;
|
||||||
|
|
||||||
|
private SmApi _sm;
|
||||||
|
private BcatServerManager _serverManager;
|
||||||
|
|
||||||
|
private static readonly ManagerOptions _bcatManagerOptions = new(PointerBufferSize, MaxDomains, MaxDomainObjects, false);
|
||||||
|
|
||||||
|
internal void Initialize()
|
||||||
|
{
|
||||||
|
HeapAllocator allocator = new();
|
||||||
|
|
||||||
|
_sm = new SmApi();
|
||||||
|
_sm.Initialize().AbortOnFailure();
|
||||||
|
|
||||||
|
_serverManager = new BcatServerManager(allocator, _sm, MaxPortsCount, _bcatManagerOptions, BcatTotalMaxSessionsCount);
|
||||||
|
|
||||||
|
_serverManager.RegisterServer((int)BcatPortIndex.Admin, ServiceName.Encode("bcat:a"), BcatMaxSessionsCount);
|
||||||
|
_serverManager.RegisterServer((int)BcatPortIndex.Manager, ServiceName.Encode("bcat:m"), BcatMaxSessionsCount);
|
||||||
|
_serverManager.RegisterServer((int)BcatPortIndex.User, ServiceName.Encode("bcat:u"), BcatMaxSessionsCount);
|
||||||
|
_serverManager.RegisterServer((int)BcatPortIndex.System, ServiceName.Encode("bcat:s"), BcatMaxSessionsCount);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ServiceRequests()
|
||||||
|
{
|
||||||
|
_serverManager.ServiceRequests();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Shutdown()
|
||||||
|
{
|
||||||
|
_serverManager.Dispose();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
24
src/Ryujinx.Horizon/Bcat/BcatMain.cs
Normal file
24
src/Ryujinx.Horizon/Bcat/BcatMain.cs
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
using Ryujinx.Horizon.LogManager;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Ryujinx.Horizon.Bcat
|
||||||
|
{
|
||||||
|
internal class BcatMain : IService
|
||||||
|
{
|
||||||
|
public static void Main(ServiceTable serviceTable)
|
||||||
|
{
|
||||||
|
BcatIpcServer ipcServer = new();
|
||||||
|
|
||||||
|
ipcServer.Initialize();
|
||||||
|
|
||||||
|
serviceTable.SignalServiceReady();
|
||||||
|
|
||||||
|
ipcServer.ServiceRequests();
|
||||||
|
ipcServer.Shutdown();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
29
src/Ryujinx.Horizon/Bcat/BcatResult.cs
Normal file
29
src/Ryujinx.Horizon/Bcat/BcatResult.cs
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
using Ryujinx.Horizon.Common;
|
||||||
|
|
||||||
|
namespace Ryujinx.Horizon.Bcat
|
||||||
|
{
|
||||||
|
class BcatResult
|
||||||
|
{
|
||||||
|
private const int ModuleId = 122;
|
||||||
|
|
||||||
|
public static Result Success => new(ModuleId, 0);
|
||||||
|
public static Result InvalidArgument => new(ModuleId, 1);
|
||||||
|
public static Result NotFound => new(ModuleId, 2);
|
||||||
|
public static Result TargetLocked => new(ModuleId, 3);
|
||||||
|
public static Result TargetAlreadyMounted => new(ModuleId, 4);
|
||||||
|
public static Result TargetNotMounted => new(ModuleId, 5);
|
||||||
|
public static Result AlreadyOpen => new(ModuleId, 6);
|
||||||
|
public static Result NotOpen => new(ModuleId, 7);
|
||||||
|
public static Result InternetRequestDenied => new(ModuleId, 8);
|
||||||
|
public static Result ServiceOpenLimitReached => new(ModuleId, 9);
|
||||||
|
public static Result SaveDataNotFound => new(ModuleId, 10);
|
||||||
|
public static Result NetworkServiceAccountNotAvailable => new(ModuleId, 31);
|
||||||
|
public static Result PassphrasePathNotFound => new(ModuleId, 80);
|
||||||
|
public static Result DataVerificationFailed => new(ModuleId, 81);
|
||||||
|
public static Result PermissionDenied => new(ModuleId, 90);
|
||||||
|
public static Result AllocationFailed => new(ModuleId, 91);
|
||||||
|
public static Result InvalidOperation => new(ModuleId, 98);
|
||||||
|
public static Result InvalidDeliveryCacheStorageFile => new(ModuleId, 204);
|
||||||
|
public static Result StorageOpenLimitReached => new(ModuleId, 205);
|
||||||
|
}
|
||||||
|
}
|
28
src/Ryujinx.Horizon/Bcat/BcatServerManager.cs
Normal file
28
src/Ryujinx.Horizon/Bcat/BcatServerManager.cs
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
using Ryujinx.Horizon.Bcat.Ipc;
|
||||||
|
using Ryujinx.Horizon.Bcat.Types;
|
||||||
|
using Ryujinx.Horizon.Common;
|
||||||
|
using Ryujinx.Horizon.Sdk.Sf.Hipc;
|
||||||
|
using Ryujinx.Horizon.Sdk.Sm;
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace Ryujinx.Horizon.Bcat
|
||||||
|
{
|
||||||
|
class BcatServerManager : ServerManager
|
||||||
|
{
|
||||||
|
public BcatServerManager(HeapAllocator allocator, SmApi sm, int maxPorts, ManagerOptions options, int maxSessions) : base(allocator, sm, maxPorts, options, maxSessions)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override Result OnNeedsToAccept(int portIndex, Server server)
|
||||||
|
{
|
||||||
|
return (BcatPortIndex)portIndex switch
|
||||||
|
{
|
||||||
|
BcatPortIndex.Admin => AcceptImpl(server, new BcatService(BcatServicePermissionLevel.Admin)),
|
||||||
|
BcatPortIndex.Manager => AcceptImpl(server, new BcatService(BcatServicePermissionLevel.Manager)),
|
||||||
|
BcatPortIndex.User => AcceptImpl(server, new BcatService(BcatServicePermissionLevel.User)),
|
||||||
|
BcatPortIndex.System => AcceptImpl(server, new BcatService(BcatServicePermissionLevel.System)),
|
||||||
|
_ => throw new ArgumentOutOfRangeException(nameof(portIndex)),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
82
src/Ryujinx.Horizon/Bcat/Ipc/ServiceCreator.cs
Normal file
82
src/Ryujinx.Horizon/Bcat/Ipc/ServiceCreator.cs
Normal file
@@ -0,0 +1,82 @@
|
|||||||
|
using LibHac.Common;
|
||||||
|
using Ryujinx.Horizon.Common;
|
||||||
|
using Ryujinx.Horizon.Sdk.Bcat;
|
||||||
|
using Ryujinx.Horizon.Sdk.Sf;
|
||||||
|
using System;
|
||||||
|
using System.Threading;
|
||||||
|
using ApplicationId = Ryujinx.Horizon.Sdk.Ncm.ApplicationId;
|
||||||
|
|
||||||
|
namespace Ryujinx.Horizon.Bcat.Ipc
|
||||||
|
{
|
||||||
|
partial class ServiceCreator : IServiceCreator, IDisposable
|
||||||
|
{
|
||||||
|
private SharedRef<LibHac.Bcat.Impl.Ipc.IServiceCreator> _libHacService;
|
||||||
|
|
||||||
|
private int _disposalState;
|
||||||
|
|
||||||
|
public ServiceCreator(string serviceName)
|
||||||
|
{
|
||||||
|
HorizonStatic.Options.BcatClient.Sm.GetService(ref _libHacService, serviceName).ThrowIfFailure();
|
||||||
|
}
|
||||||
|
|
||||||
|
[CmifCommand(0)]
|
||||||
|
public Result CreateBcatService(out IBcatService bcatService, [ClientProcessId] ulong pid)
|
||||||
|
{
|
||||||
|
// TODO: Call arp:r GetApplicationLaunchProperty with the pid to get the TitleId.
|
||||||
|
// Add an instance of nn::bcat::detail::service::core::PassphraseManager.
|
||||||
|
// Add an instance of nn::bcat::detail::service::ServiceMemoryManager.
|
||||||
|
// Add an instance of nn::bcat::detail::service::core::TaskManager who loads "bcat-sys:/" system save data and opens "dc/task.bin".
|
||||||
|
// If the file don't exist, create a new one (with a size of 0x800 bytes) and write 2 empty structs with a size of 0x400 bytes.
|
||||||
|
|
||||||
|
bcatService = new BcatService(Bcat.Types.BcatServicePermissionLevel.User);
|
||||||
|
|
||||||
|
return Result.Success;
|
||||||
|
}
|
||||||
|
|
||||||
|
[CmifCommand(1)]
|
||||||
|
public Result CreateDeliveryCacheStorageService(out IDeliveryCacheStorageService service, [ClientProcessId] ulong pid)
|
||||||
|
{
|
||||||
|
using var libHacService = new SharedRef<LibHac.Bcat.Impl.Ipc.IDeliveryCacheStorageService>();
|
||||||
|
|
||||||
|
var resultCode = _libHacService.Get.CreateDeliveryCacheStorageService(ref libHacService.Ref, pid);
|
||||||
|
|
||||||
|
if (resultCode.IsSuccess())
|
||||||
|
{
|
||||||
|
service = new DeliveryCacheStorageService(ref libHacService.Ref);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
service = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return resultCode.ToHorizonResult();
|
||||||
|
}
|
||||||
|
|
||||||
|
[CmifCommand(2)]
|
||||||
|
public Result CreateDeliveryCacheStorageServiceWithApplicationId(out IDeliveryCacheStorageService service, ApplicationId applicationId)
|
||||||
|
{
|
||||||
|
using var libHacService = new SharedRef<LibHac.Bcat.Impl.Ipc.IDeliveryCacheStorageService>();
|
||||||
|
|
||||||
|
var resultCode = _libHacService.Get.CreateDeliveryCacheStorageServiceWithApplicationId(ref libHacService.Ref, new LibHac.ApplicationId(applicationId.Id));
|
||||||
|
|
||||||
|
if (resultCode.IsSuccess())
|
||||||
|
{
|
||||||
|
service = new DeliveryCacheStorageService(ref libHacService.Ref);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
service = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return resultCode.ToHorizonResult();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Dispose()
|
||||||
|
{
|
||||||
|
if (Interlocked.Exchange(ref _disposalState, 1) == 0)
|
||||||
|
{
|
||||||
|
_libHacService.Destroy();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
25
src/Ryujinx.Horizon/Bcat/Ipc/ServiceCreator/BcatService.cs
Normal file
25
src/Ryujinx.Horizon/Bcat/Ipc/ServiceCreator/BcatService.cs
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
using Ryujinx.Horizon.Bcat.Types;
|
||||||
|
using Ryujinx.Horizon.Common;
|
||||||
|
using Ryujinx.Horizon.Sdk.Bcat;
|
||||||
|
using Ryujinx.Horizon.Sdk.Sf;
|
||||||
|
|
||||||
|
namespace Ryujinx.Horizon.Bcat.Ipc
|
||||||
|
{
|
||||||
|
partial class BcatService : IBcatService
|
||||||
|
{
|
||||||
|
private readonly BcatServicePermissionLevel _permissionLevel;
|
||||||
|
|
||||||
|
public BcatService(BcatServicePermissionLevel permissionLevel)
|
||||||
|
{
|
||||||
|
_permissionLevel = permissionLevel;
|
||||||
|
}
|
||||||
|
|
||||||
|
[CmifCommand(10100)]
|
||||||
|
public Result RequestSyncDeliveryCache(out IDeliveryCacheProgressService deliveryCacheProgressService)
|
||||||
|
{
|
||||||
|
deliveryCacheProgressService = new DeliveryCacheProgressService();
|
||||||
|
|
||||||
|
return Result.Success;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,48 @@
|
|||||||
|
using LibHac.Bcat;
|
||||||
|
using LibHac.Common;
|
||||||
|
using Ryujinx.Horizon.Common;
|
||||||
|
using Ryujinx.Horizon.Sdk.Bcat;
|
||||||
|
using Ryujinx.Horizon.Sdk.Sf;
|
||||||
|
using Ryujinx.Horizon.Sdk.Sf.Hipc;
|
||||||
|
using System;
|
||||||
|
using System.Threading;
|
||||||
|
|
||||||
|
namespace Ryujinx.Horizon.Bcat.Ipc
|
||||||
|
{
|
||||||
|
partial class DeliveryCacheDirectoryService : IDeliveryCacheDirectoryService, IDisposable
|
||||||
|
{
|
||||||
|
private SharedRef<LibHac.Bcat.Impl.Ipc.IDeliveryCacheDirectoryService> _libHacService;
|
||||||
|
private int _disposalState;
|
||||||
|
|
||||||
|
public DeliveryCacheDirectoryService(ref SharedRef<LibHac.Bcat.Impl.Ipc.IDeliveryCacheDirectoryService> libHacService)
|
||||||
|
{
|
||||||
|
_libHacService = SharedRef<LibHac.Bcat.Impl.Ipc.IDeliveryCacheDirectoryService>.CreateMove(ref libHacService);
|
||||||
|
}
|
||||||
|
|
||||||
|
[CmifCommand(0)]
|
||||||
|
public Result Open(DirectoryName directoryName)
|
||||||
|
{
|
||||||
|
return _libHacService.Get.Open(ref directoryName).ToHorizonResult();
|
||||||
|
}
|
||||||
|
|
||||||
|
[CmifCommand(1)]
|
||||||
|
public Result Read(out int entriesRead, [Buffer(Sdk.Sf.Hipc.HipcBufferFlags.Out | HipcBufferFlags.MapAlias)] Span<DeliveryCacheDirectoryEntry> entriesBuffer)
|
||||||
|
{
|
||||||
|
return _libHacService.Get.Read(out entriesRead, entriesBuffer).ToHorizonResult();
|
||||||
|
}
|
||||||
|
|
||||||
|
[CmifCommand(2)]
|
||||||
|
public Result GetCount(out int count)
|
||||||
|
{
|
||||||
|
return _libHacService.Get.GetCount(out count).ToHorizonResult();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Dispose()
|
||||||
|
{
|
||||||
|
if (Interlocked.Exchange(ref _disposalState, 1) == 0)
|
||||||
|
{
|
||||||
|
_libHacService.Destroy();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,54 @@
|
|||||||
|
using LibHac.Bcat;
|
||||||
|
using LibHac.Common;
|
||||||
|
using Ryujinx.Horizon.Common;
|
||||||
|
using Ryujinx.Horizon.Sdk.Bcat;
|
||||||
|
using Ryujinx.Horizon.Sdk.Sf;
|
||||||
|
using Ryujinx.Horizon.Sdk.Sf.Hipc;
|
||||||
|
using System;
|
||||||
|
using System.Threading;
|
||||||
|
|
||||||
|
namespace Ryujinx.Horizon.Bcat.Ipc
|
||||||
|
{
|
||||||
|
partial class DeliveryCacheFileService : IDeliveryCacheFileService, IDisposable
|
||||||
|
{
|
||||||
|
private SharedRef<LibHac.Bcat.Impl.Ipc.IDeliveryCacheFileService> _libHacService;
|
||||||
|
private int _disposalState;
|
||||||
|
|
||||||
|
public DeliveryCacheFileService(ref SharedRef<LibHac.Bcat.Impl.Ipc.IDeliveryCacheFileService> libHacService)
|
||||||
|
{
|
||||||
|
_libHacService = SharedRef<LibHac.Bcat.Impl.Ipc.IDeliveryCacheFileService>.CreateMove(ref libHacService);
|
||||||
|
}
|
||||||
|
|
||||||
|
[CmifCommand(0)]
|
||||||
|
public Result Open(DirectoryName directoryName, FileName fileName)
|
||||||
|
{
|
||||||
|
return _libHacService.Get.Open(ref directoryName, ref fileName).ToHorizonResult();
|
||||||
|
}
|
||||||
|
|
||||||
|
[CmifCommand(1)]
|
||||||
|
public Result Read(long offset, out long bytesRead, [Buffer(HipcBufferFlags.Out | HipcBufferFlags.MapAlias)] Span<byte> data)
|
||||||
|
{
|
||||||
|
return _libHacService.Get.Read(out bytesRead, offset, data).ToHorizonResult();
|
||||||
|
}
|
||||||
|
|
||||||
|
[CmifCommand(2)]
|
||||||
|
public Result GetSize(out long size)
|
||||||
|
{
|
||||||
|
return _libHacService.Get.GetSize(out size).ToHorizonResult();
|
||||||
|
}
|
||||||
|
|
||||||
|
[CmifCommand(3)]
|
||||||
|
public Result GetDigest(out Digest digest)
|
||||||
|
{
|
||||||
|
return _libHacService.Get.GetDigest(out digest).ToHorizonResult();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Dispose()
|
||||||
|
{
|
||||||
|
if (Interlocked.Exchange(ref _disposalState, 1) == 0)
|
||||||
|
{
|
||||||
|
_libHacService.Destroy();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,58 @@
|
|||||||
|
using Ryujinx.Common.Logging;
|
||||||
|
using Ryujinx.Horizon.Bcat.Ipc.Types;
|
||||||
|
using Ryujinx.Horizon.Common;
|
||||||
|
using Ryujinx.Horizon.Sdk.Bcat;
|
||||||
|
using Ryujinx.Horizon.Sdk.OsTypes;
|
||||||
|
using Ryujinx.Horizon.Sdk.Sf;
|
||||||
|
using Ryujinx.Horizon.Sdk.Sf.Hipc;
|
||||||
|
using System;
|
||||||
|
using System.Threading;
|
||||||
|
|
||||||
|
namespace Ryujinx.Horizon.Bcat.Ipc
|
||||||
|
{
|
||||||
|
partial class DeliveryCacheProgressService : IDeliveryCacheProgressService, IDisposable
|
||||||
|
{
|
||||||
|
private int _handle;
|
||||||
|
private SystemEventType _systemEvent;
|
||||||
|
private int _disposalState;
|
||||||
|
|
||||||
|
[CmifCommand(0)]
|
||||||
|
public Result GetEvent([CopyHandle] out int handle)
|
||||||
|
{
|
||||||
|
if (_handle == 0)
|
||||||
|
{
|
||||||
|
Os.CreateSystemEvent(out _systemEvent, EventClearMode.ManualClear, true).AbortOnFailure();
|
||||||
|
|
||||||
|
_handle = Os.GetReadableHandleOfSystemEvent(ref _systemEvent);
|
||||||
|
}
|
||||||
|
|
||||||
|
handle = _handle;
|
||||||
|
|
||||||
|
Logger.Stub?.PrintStub(LogClass.ServiceBcat);
|
||||||
|
|
||||||
|
return Result.Success;
|
||||||
|
}
|
||||||
|
|
||||||
|
[CmifCommand(1)]
|
||||||
|
public Result GetImpl([Buffer(HipcBufferFlags.Out | HipcBufferFlags.Pointer, 0x200)] out DeliveryCacheProgressImpl deliveryCacheProgressImpl)
|
||||||
|
{
|
||||||
|
deliveryCacheProgressImpl = new DeliveryCacheProgressImpl
|
||||||
|
{
|
||||||
|
State = DeliveryCacheProgressImpl.Status.Done,
|
||||||
|
Result = 0
|
||||||
|
};
|
||||||
|
|
||||||
|
Logger.Stub?.PrintStub(LogClass.ServiceBcat);
|
||||||
|
|
||||||
|
return Result.Success;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Dispose()
|
||||||
|
{
|
||||||
|
if (_handle != 0 && Interlocked.Exchange(ref _disposalState, 1) == 0)
|
||||||
|
{
|
||||||
|
Os.DestroySystemEvent(ref _systemEvent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,74 @@
|
|||||||
|
using LibHac.Bcat;
|
||||||
|
using LibHac.Common;
|
||||||
|
using Ryujinx.Horizon.Common;
|
||||||
|
using Ryujinx.Horizon.Sdk.Bcat;
|
||||||
|
using Ryujinx.Horizon.Sdk.Sf;
|
||||||
|
using Ryujinx.Horizon.Sdk.Sf.Hipc;
|
||||||
|
using System;
|
||||||
|
using System.Threading;
|
||||||
|
|
||||||
|
namespace Ryujinx.Horizon.Bcat.Ipc
|
||||||
|
{
|
||||||
|
partial class DeliveryCacheStorageService : IDeliveryCacheStorageService, IDisposable
|
||||||
|
{
|
||||||
|
private SharedRef<LibHac.Bcat.Impl.Ipc.IDeliveryCacheStorageService> _libHacService;
|
||||||
|
private int _disposalState;
|
||||||
|
|
||||||
|
public DeliveryCacheStorageService(ref SharedRef<LibHac.Bcat.Impl.Ipc.IDeliveryCacheStorageService> libHacService)
|
||||||
|
{
|
||||||
|
_libHacService = SharedRef<LibHac.Bcat.Impl.Ipc.IDeliveryCacheStorageService>.CreateMove(ref libHacService);
|
||||||
|
}
|
||||||
|
|
||||||
|
[CmifCommand(0)]
|
||||||
|
public Result CreateFileService(out IDeliveryCacheFileService service)
|
||||||
|
{
|
||||||
|
using var libHacService = new SharedRef<LibHac.Bcat.Impl.Ipc.IDeliveryCacheFileService>();
|
||||||
|
|
||||||
|
var resultCode = _libHacService.Get.CreateFileService(ref libHacService.Ref);
|
||||||
|
|
||||||
|
if (resultCode.IsSuccess())
|
||||||
|
{
|
||||||
|
service = new DeliveryCacheFileService(ref libHacService.Ref);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
service = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return resultCode.ToHorizonResult();
|
||||||
|
}
|
||||||
|
|
||||||
|
[CmifCommand(1)]
|
||||||
|
public Result CreateDirectoryService(out IDeliveryCacheDirectoryService service)
|
||||||
|
{
|
||||||
|
using var libHacService = new SharedRef<LibHac.Bcat.Impl.Ipc.IDeliveryCacheDirectoryService>();
|
||||||
|
|
||||||
|
var resultCode = _libHacService.Get.CreateDirectoryService(ref libHacService.Ref);
|
||||||
|
|
||||||
|
if (resultCode.IsSuccess())
|
||||||
|
{
|
||||||
|
service = new DeliveryCacheDirectoryService(ref libHacService.Ref);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
service = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return resultCode.ToHorizonResult();
|
||||||
|
}
|
||||||
|
|
||||||
|
[CmifCommand(10)]
|
||||||
|
public Result EnumerateDeliveryCacheDirectory(out int count, [Buffer(HipcBufferFlags.Out | HipcBufferFlags.MapAlias)] Span<DirectoryName> directoryNames)
|
||||||
|
{
|
||||||
|
return _libHacService.Get.EnumerateDeliveryCacheDirectory(out count, directoryNames).ToHorizonResult();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Dispose()
|
||||||
|
{
|
||||||
|
if (Interlocked.Exchange(ref _disposalState, 1) == 0)
|
||||||
|
{
|
||||||
|
_libHacService.Destroy();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -1,6 +1,6 @@
|
|||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
namespace Ryujinx.HLE.HOS.Services.Bcat.ServiceCreator.Types
|
namespace Ryujinx.Horizon.Bcat.Ipc.Types
|
||||||
{
|
{
|
||||||
[StructLayout(LayoutKind.Sequential, Size = 0x200)]
|
[StructLayout(LayoutKind.Sequential, Size = 0x200)]
|
||||||
public struct DeliveryCacheProgressImpl
|
public struct DeliveryCacheProgressImpl
|
10
src/Ryujinx.Horizon/Bcat/Types/BcatPortIndex.cs
Normal file
10
src/Ryujinx.Horizon/Bcat/Types/BcatPortIndex.cs
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
namespace Ryujinx.Horizon.Bcat.Types
|
||||||
|
{
|
||||||
|
enum BcatPortIndex
|
||||||
|
{
|
||||||
|
Admin,
|
||||||
|
Manager,
|
||||||
|
User,
|
||||||
|
System
|
||||||
|
}
|
||||||
|
}
|
10
src/Ryujinx.Horizon/Bcat/Types/BcatServicePermissionLevel.cs
Normal file
10
src/Ryujinx.Horizon/Bcat/Types/BcatServicePermissionLevel.cs
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
namespace Ryujinx.Horizon.Bcat.Types
|
||||||
|
{
|
||||||
|
enum BcatServicePermissionLevel
|
||||||
|
{
|
||||||
|
Admin = -1,
|
||||||
|
User = 1,
|
||||||
|
System = 2,
|
||||||
|
Manager = 6
|
||||||
|
}
|
||||||
|
}
|
@@ -1,3 +1,5 @@
|
|||||||
|
using LibHac;
|
||||||
|
|
||||||
namespace Ryujinx.Horizon
|
namespace Ryujinx.Horizon
|
||||||
{
|
{
|
||||||
public struct HorizonOptions
|
public struct HorizonOptions
|
||||||
@@ -5,10 +7,13 @@ namespace Ryujinx.Horizon
|
|||||||
public bool IgnoreMissingServices { get; }
|
public bool IgnoreMissingServices { get; }
|
||||||
public bool ThrowOnInvalidCommandIds { get; }
|
public bool ThrowOnInvalidCommandIds { get; }
|
||||||
|
|
||||||
public HorizonOptions(bool ignoreMissingServices)
|
public HorizonClient BcatClient { get; }
|
||||||
|
|
||||||
|
public HorizonOptions(bool ignoreMissingServices, HorizonClient bcatClient)
|
||||||
{
|
{
|
||||||
IgnoreMissingServices = ignoreMissingServices;
|
IgnoreMissingServices = ignoreMissingServices;
|
||||||
ThrowOnInvalidCommandIds = true;
|
ThrowOnInvalidCommandIds = true;
|
||||||
|
BcatClient = bcatClient;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
12
src/Ryujinx.Horizon/LibHacResultExtensions.cs
Normal file
12
src/Ryujinx.Horizon/LibHacResultExtensions.cs
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
using Ryujinx.Horizon.Common;
|
||||||
|
|
||||||
|
namespace Ryujinx.Horizon
|
||||||
|
{
|
||||||
|
internal static class LibHacResultExtensions
|
||||||
|
{
|
||||||
|
public static Result ToHorizonResult(this LibHac.Result result)
|
||||||
|
{
|
||||||
|
return new Result((int)result.Module, (int)result.Description);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -9,12 +9,12 @@ namespace Ryujinx.Horizon.Prepo
|
|||||||
private const int PrepoMaxSessionsCount = 12;
|
private const int PrepoMaxSessionsCount = 12;
|
||||||
private const int PrepoTotalMaxSessionsCount = PrepoMaxSessionsCount * 6;
|
private const int PrepoTotalMaxSessionsCount = PrepoMaxSessionsCount * 6;
|
||||||
|
|
||||||
private const int PointerBufferSize = 0x3800;
|
private const int PointerBufferSize = 0x80;
|
||||||
private const int MaxDomains = 64;
|
private const int MaxDomains = 64;
|
||||||
private const int MaxDomainObjects = 16;
|
private const int MaxDomainObjects = 16;
|
||||||
private const int MaxPortsCount = 6;
|
private const int MaxPortsCount = 6;
|
||||||
|
|
||||||
private static readonly ManagerOptions _logManagerOptions = new(PointerBufferSize, MaxDomains, MaxDomainObjects, false);
|
private static readonly ManagerOptions _prepoManagerOptions = new(PointerBufferSize, MaxDomains, MaxDomainObjects, false);
|
||||||
|
|
||||||
private SmApi _sm;
|
private SmApi _sm;
|
||||||
private PrepoServerManager _serverManager;
|
private PrepoServerManager _serverManager;
|
||||||
@@ -26,7 +26,7 @@ namespace Ryujinx.Horizon.Prepo
|
|||||||
_sm = new SmApi();
|
_sm = new SmApi();
|
||||||
_sm.Initialize().AbortOnFailure();
|
_sm.Initialize().AbortOnFailure();
|
||||||
|
|
||||||
_serverManager = new PrepoServerManager(allocator, _sm, MaxPortsCount, _logManagerOptions, PrepoTotalMaxSessionsCount);
|
_serverManager = new PrepoServerManager(allocator, _sm, MaxPortsCount, _prepoManagerOptions, PrepoTotalMaxSessionsCount);
|
||||||
|
|
||||||
_serverManager.RegisterServer((int)PrepoPortIndex.Admin, ServiceName.Encode("prepo:a"), PrepoMaxSessionsCount); // 1.0.0-5.1.0
|
_serverManager.RegisterServer((int)PrepoPortIndex.Admin, ServiceName.Encode("prepo:a"), PrepoMaxSessionsCount); // 1.0.0-5.1.0
|
||||||
_serverManager.RegisterServer((int)PrepoPortIndex.Admin2, ServiceName.Encode("prepo:a2"), PrepoMaxSessionsCount); // 6.0.0+
|
_serverManager.RegisterServer((int)PrepoPortIndex.Admin2, ServiceName.Encode("prepo:a2"), PrepoMaxSessionsCount); // 6.0.0+
|
||||||
|
10
src/Ryujinx.Horizon/Sdk/Bcat/IBcatService.cs
Normal file
10
src/Ryujinx.Horizon/Sdk/Bcat/IBcatService.cs
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
using Ryujinx.Horizon.Common;
|
||||||
|
using Ryujinx.Horizon.Sdk.Sf;
|
||||||
|
|
||||||
|
namespace Ryujinx.Horizon.Sdk.Bcat
|
||||||
|
{
|
||||||
|
internal interface IBcatService : IServiceObject
|
||||||
|
{
|
||||||
|
Result RequestSyncDeliveryCache(out IDeliveryCacheProgressService deliveryCacheProgressService);
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,14 @@
|
|||||||
|
using LibHac.Bcat;
|
||||||
|
using Ryujinx.Horizon.Common;
|
||||||
|
using Ryujinx.Horizon.Sdk.Sf;
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace Ryujinx.Horizon.Sdk.Bcat
|
||||||
|
{
|
||||||
|
internal interface IDeliveryCacheDirectoryService : IServiceObject
|
||||||
|
{
|
||||||
|
Result GetCount(out int count);
|
||||||
|
Result Open(DirectoryName directoryName);
|
||||||
|
Result Read(out int entriesRead, Span<DeliveryCacheDirectoryEntry> entriesBuffer);
|
||||||
|
}
|
||||||
|
}
|
15
src/Ryujinx.Horizon/Sdk/Bcat/IDeliveryCacheFileService.cs
Normal file
15
src/Ryujinx.Horizon/Sdk/Bcat/IDeliveryCacheFileService.cs
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
using LibHac.Bcat;
|
||||||
|
using Ryujinx.Horizon.Common;
|
||||||
|
using Ryujinx.Horizon.Sdk.Sf;
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace Ryujinx.Horizon.Sdk.Bcat
|
||||||
|
{
|
||||||
|
internal interface IDeliveryCacheFileService : IServiceObject
|
||||||
|
{
|
||||||
|
Result GetDigest(out Digest digest);
|
||||||
|
Result GetSize(out long size);
|
||||||
|
Result Open(DirectoryName directoryName, FileName fileName);
|
||||||
|
Result Read(long offset, out long bytesRead, Span<byte> data);
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,12 @@
|
|||||||
|
using Ryujinx.Horizon.Bcat.Ipc.Types;
|
||||||
|
using Ryujinx.Horizon.Common;
|
||||||
|
using Ryujinx.Horizon.Sdk.Sf;
|
||||||
|
|
||||||
|
namespace Ryujinx.Horizon.Sdk.Bcat
|
||||||
|
{
|
||||||
|
internal interface IDeliveryCacheProgressService : IServiceObject
|
||||||
|
{
|
||||||
|
Result GetEvent(out int handle);
|
||||||
|
Result GetImpl(out DeliveryCacheProgressImpl deliveryCacheProgressImpl);
|
||||||
|
}
|
||||||
|
}
|
14
src/Ryujinx.Horizon/Sdk/Bcat/IDeliveryCacheStorageService.cs
Normal file
14
src/Ryujinx.Horizon/Sdk/Bcat/IDeliveryCacheStorageService.cs
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
using LibHac.Bcat;
|
||||||
|
using Ryujinx.Horizon.Common;
|
||||||
|
using Ryujinx.Horizon.Sdk.Sf;
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace Ryujinx.Horizon.Sdk.Bcat
|
||||||
|
{
|
||||||
|
internal interface IDeliveryCacheStorageService : IServiceObject
|
||||||
|
{
|
||||||
|
Result CreateDirectoryService(out IDeliveryCacheDirectoryService service);
|
||||||
|
Result CreateFileService(out IDeliveryCacheFileService service);
|
||||||
|
Result EnumerateDeliveryCacheDirectory(out int count, Span<DirectoryName> directoryNames);
|
||||||
|
}
|
||||||
|
}
|
12
src/Ryujinx.Horizon/Sdk/Bcat/IServiceCreator.cs
Normal file
12
src/Ryujinx.Horizon/Sdk/Bcat/IServiceCreator.cs
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
using Ryujinx.Horizon.Common;
|
||||||
|
using Ryujinx.Horizon.Sdk.Sf;
|
||||||
|
|
||||||
|
namespace Ryujinx.Horizon.Sdk.Bcat
|
||||||
|
{
|
||||||
|
internal interface IServiceCreator : IServiceObject
|
||||||
|
{
|
||||||
|
Result CreateBcatService(out IBcatService service, ulong pid);
|
||||||
|
Result CreateDeliveryCacheStorageService(out IDeliveryCacheStorageService service, ulong pid);
|
||||||
|
Result CreateDeliveryCacheStorageServiceWithApplicationId(out IDeliveryCacheStorageService service, Ncm.ApplicationId applicationId);
|
||||||
|
}
|
||||||
|
}
|
@@ -1,3 +1,4 @@
|
|||||||
|
using Ryujinx.Horizon.Bcat;
|
||||||
using Ryujinx.Horizon.LogManager;
|
using Ryujinx.Horizon.LogManager;
|
||||||
using Ryujinx.Horizon.Prepo;
|
using Ryujinx.Horizon.Prepo;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
@@ -23,6 +24,7 @@ namespace Ryujinx.Horizon
|
|||||||
|
|
||||||
RegisterService<LmMain>();
|
RegisterService<LmMain>();
|
||||||
RegisterService<PrepoMain>();
|
RegisterService<PrepoMain>();
|
||||||
|
RegisterService<BcatMain>();
|
||||||
|
|
||||||
_totalServices = entries.Count;
|
_totalServices = entries.Count;
|
||||||
|
|
||||||
|
@@ -162,9 +162,9 @@ namespace Ryujinx.Ui.Common.Configuration
|
|||||||
public bool ShowConfirmExit { get; set; }
|
public bool ShowConfirmExit { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Hide Cursor on Idle
|
/// Whether to hide cursor on idle, always or never
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool HideCursorOnIdle { get; set; }
|
public HideCursorMode HideCursor { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Enables or disables Vertical Sync
|
/// Enables or disables Vertical Sync
|
||||||
|
@@ -613,7 +613,7 @@ namespace Ryujinx.Ui.Common.Configuration
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Hide Cursor on Idle
|
/// Hide Cursor on Idle
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public ReactiveObject<bool> HideCursorOnIdle { get; private set; }
|
public ReactiveObject<HideCursorMode> HideCursor { get; private set; }
|
||||||
|
|
||||||
private ConfigurationState()
|
private ConfigurationState()
|
||||||
{
|
{
|
||||||
@@ -626,7 +626,7 @@ namespace Ryujinx.Ui.Common.Configuration
|
|||||||
EnableDiscordIntegration = new ReactiveObject<bool>();
|
EnableDiscordIntegration = new ReactiveObject<bool>();
|
||||||
CheckUpdatesOnStart = new ReactiveObject<bool>();
|
CheckUpdatesOnStart = new ReactiveObject<bool>();
|
||||||
ShowConfirmExit = new ReactiveObject<bool>();
|
ShowConfirmExit = new ReactiveObject<bool>();
|
||||||
HideCursorOnIdle = new ReactiveObject<bool>();
|
HideCursor = new ReactiveObject<HideCursorMode>();
|
||||||
}
|
}
|
||||||
|
|
||||||
public ConfigurationFileFormat ToFileFormat()
|
public ConfigurationFileFormat ToFileFormat()
|
||||||
@@ -662,7 +662,7 @@ namespace Ryujinx.Ui.Common.Configuration
|
|||||||
EnableDiscordIntegration = EnableDiscordIntegration,
|
EnableDiscordIntegration = EnableDiscordIntegration,
|
||||||
CheckUpdatesOnStart = CheckUpdatesOnStart,
|
CheckUpdatesOnStart = CheckUpdatesOnStart,
|
||||||
ShowConfirmExit = ShowConfirmExit,
|
ShowConfirmExit = ShowConfirmExit,
|
||||||
HideCursorOnIdle = HideCursorOnIdle,
|
HideCursor = HideCursor,
|
||||||
EnableVsync = Graphics.EnableVsync,
|
EnableVsync = Graphics.EnableVsync,
|
||||||
EnableShaderCache = Graphics.EnableShaderCache,
|
EnableShaderCache = Graphics.EnableShaderCache,
|
||||||
EnableTextureRecompression = Graphics.EnableTextureRecompression,
|
EnableTextureRecompression = Graphics.EnableTextureRecompression,
|
||||||
@@ -767,7 +767,7 @@ namespace Ryujinx.Ui.Common.Configuration
|
|||||||
EnableDiscordIntegration.Value = true;
|
EnableDiscordIntegration.Value = true;
|
||||||
CheckUpdatesOnStart.Value = true;
|
CheckUpdatesOnStart.Value = true;
|
||||||
ShowConfirmExit.Value = true;
|
ShowConfirmExit.Value = true;
|
||||||
HideCursorOnIdle.Value = false;
|
HideCursor.Value = Ryujinx.Common.Configuration.HideCursorMode.Never;
|
||||||
Graphics.EnableVsync.Value = true;
|
Graphics.EnableVsync.Value = true;
|
||||||
Graphics.EnableShaderCache.Value = true;
|
Graphics.EnableShaderCache.Value = true;
|
||||||
Graphics.EnableTextureRecompression.Value = false;
|
Graphics.EnableTextureRecompression.Value = false;
|
||||||
@@ -1046,7 +1046,7 @@ namespace Ryujinx.Ui.Common.Configuration
|
|||||||
{
|
{
|
||||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 22.");
|
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 22.");
|
||||||
|
|
||||||
configurationFileFormat.HideCursorOnIdle = false;
|
configurationFileFormat.HideCursor = HideCursorMode.Never;
|
||||||
|
|
||||||
configurationFileUpdated = true;
|
configurationFileUpdated = true;
|
||||||
}
|
}
|
||||||
@@ -1427,7 +1427,7 @@ namespace Ryujinx.Ui.Common.Configuration
|
|||||||
EnableDiscordIntegration.Value = configurationFileFormat.EnableDiscordIntegration;
|
EnableDiscordIntegration.Value = configurationFileFormat.EnableDiscordIntegration;
|
||||||
CheckUpdatesOnStart.Value = configurationFileFormat.CheckUpdatesOnStart;
|
CheckUpdatesOnStart.Value = configurationFileFormat.CheckUpdatesOnStart;
|
||||||
ShowConfirmExit.Value = configurationFileFormat.ShowConfirmExit;
|
ShowConfirmExit.Value = configurationFileFormat.ShowConfirmExit;
|
||||||
HideCursorOnIdle.Value = configurationFileFormat.HideCursorOnIdle;
|
HideCursor.Value = configurationFileFormat.HideCursor;
|
||||||
Graphics.EnableVsync.Value = configurationFileFormat.EnableVsync;
|
Graphics.EnableVsync.Value = configurationFileFormat.EnableVsync;
|
||||||
Graphics.EnableShaderCache.Value = configurationFileFormat.EnableShaderCache;
|
Graphics.EnableShaderCache.Value = configurationFileFormat.EnableShaderCache;
|
||||||
Graphics.EnableTextureRecompression.Value = configurationFileFormat.EnableTextureRecompression;
|
Graphics.EnableTextureRecompression.Value = configurationFileFormat.EnableTextureRecompression;
|
||||||
|
@@ -9,6 +9,7 @@ namespace Ryujinx.Ui.Common.Helper
|
|||||||
|
|
||||||
public static bool? OverrideDockedMode { get; private set; }
|
public static bool? OverrideDockedMode { get; private set; }
|
||||||
public static string OverrideGraphicsBackend { get; private set; }
|
public static string OverrideGraphicsBackend { get; private set; }
|
||||||
|
public static string OverrideHideCursor { get; private set; }
|
||||||
public static string BaseDirPathArg { get; private set; }
|
public static string BaseDirPathArg { get; private set; }
|
||||||
public static string Profile { get; private set; }
|
public static string Profile { get; private set; }
|
||||||
public static string LaunchPathArg { get; private set; }
|
public static string LaunchPathArg { get; private set; }
|
||||||
@@ -76,6 +77,16 @@ namespace Ryujinx.Ui.Common.Helper
|
|||||||
case "--handheld-mode":
|
case "--handheld-mode":
|
||||||
OverrideDockedMode = false;
|
OverrideDockedMode = false;
|
||||||
break;
|
break;
|
||||||
|
case "--hide-cursor":
|
||||||
|
if (i + 1 >= args.Length)
|
||||||
|
{
|
||||||
|
Logger.Error?.Print(LogClass.Application, $"Invalid option '{arg}'");
|
||||||
|
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
OverrideHideCursor = args[++i];
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
LaunchPathArg = arg;
|
LaunchPathArg = arg;
|
||||||
break;
|
break;
|
||||||
|
@@ -209,7 +209,7 @@ namespace Ryujinx
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if graphics backend was overridden
|
// Check if graphics backend was overridden.
|
||||||
if (CommandLineState.OverrideGraphicsBackend != null)
|
if (CommandLineState.OverrideGraphicsBackend != null)
|
||||||
{
|
{
|
||||||
if (CommandLineState.OverrideGraphicsBackend.ToLower() == "opengl")
|
if (CommandLineState.OverrideGraphicsBackend.ToLower() == "opengl")
|
||||||
@@ -224,7 +224,19 @@ namespace Ryujinx
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if docked mode was overriden.
|
// Check if HideCursor was overridden.
|
||||||
|
if (CommandLineState.OverrideHideCursor is not null)
|
||||||
|
{
|
||||||
|
ConfigurationState.Instance.HideCursor.Value = CommandLineState.OverrideHideCursor!.ToLower() switch
|
||||||
|
{
|
||||||
|
"never" => HideCursorMode.Never,
|
||||||
|
"onidle" => HideCursorMode.OnIdle,
|
||||||
|
"always" => HideCursorMode.Always,
|
||||||
|
_ => ConfigurationState.Instance.HideCursor.Value
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check if docked mode was overridden.
|
||||||
if (CommandLineState.OverrideDockedMode.HasValue)
|
if (CommandLineState.OverrideDockedMode.HasValue)
|
||||||
{
|
{
|
||||||
ConfigurationState.Instance.System.EnableDockedMode.Value = CommandLineState.OverrideDockedMode.Value;
|
ConfigurationState.Instance.System.EnableDockedMode.Value = CommandLineState.OverrideDockedMode.Value;
|
||||||
|
@@ -72,7 +72,7 @@ namespace Ryujinx.Ui
|
|||||||
const int CursorHideIdleTime = 5; // seconds
|
const int CursorHideIdleTime = 5; // seconds
|
||||||
private static readonly Cursor _invisibleCursor = new Cursor(Display.Default, CursorType.BlankCursor);
|
private static readonly Cursor _invisibleCursor = new Cursor(Display.Default, CursorType.BlankCursor);
|
||||||
private long _lastCursorMoveTime;
|
private long _lastCursorMoveTime;
|
||||||
private bool _hideCursorOnIdle;
|
private HideCursorMode _hideCursorMode;
|
||||||
private InputManager _inputManager;
|
private InputManager _inputManager;
|
||||||
private IKeyboard _keyboardInterface;
|
private IKeyboard _keyboardInterface;
|
||||||
private GraphicsDebugLevel _glLogLevel;
|
private GraphicsDebugLevel _glLogLevel;
|
||||||
@@ -113,10 +113,10 @@ namespace Ryujinx.Ui
|
|||||||
|
|
||||||
_gpuCancellationTokenSource = new CancellationTokenSource();
|
_gpuCancellationTokenSource = new CancellationTokenSource();
|
||||||
|
|
||||||
_hideCursorOnIdle = ConfigurationState.Instance.HideCursorOnIdle;
|
_hideCursorMode = ConfigurationState.Instance.HideCursor;
|
||||||
_lastCursorMoveTime = Stopwatch.GetTimestamp();
|
_lastCursorMoveTime = Stopwatch.GetTimestamp();
|
||||||
|
|
||||||
ConfigurationState.Instance.HideCursorOnIdle.Event += HideCursorStateChanged;
|
ConfigurationState.Instance.HideCursor.Event += HideCursorStateChanged;
|
||||||
ConfigurationState.Instance.Graphics.AntiAliasing.Event += UpdateAnriAliasing;
|
ConfigurationState.Instance.Graphics.AntiAliasing.Event += UpdateAnriAliasing;
|
||||||
ConfigurationState.Instance.Graphics.ScalingFilter.Event += UpdateScalingFilter;
|
ConfigurationState.Instance.Graphics.ScalingFilter.Event += UpdateScalingFilter;
|
||||||
ConfigurationState.Instance.Graphics.ScalingFilterLevel.Event += UpdateScalingFilterLevel;
|
ConfigurationState.Instance.Graphics.ScalingFilterLevel.Event += UpdateScalingFilterLevel;
|
||||||
@@ -145,26 +145,32 @@ namespace Ryujinx.Ui
|
|||||||
return Renderer.GetHardwareInfo().GpuVendor;
|
return Renderer.GetHardwareInfo().GpuVendor;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void HideCursorStateChanged(object sender, ReactiveEventArgs<bool> state)
|
private void HideCursorStateChanged(object sender, ReactiveEventArgs<HideCursorMode> state)
|
||||||
{
|
{
|
||||||
Application.Invoke(delegate
|
Application.Invoke(delegate
|
||||||
{
|
{
|
||||||
_hideCursorOnIdle = state.NewValue;
|
_hideCursorMode = state.NewValue;
|
||||||
|
|
||||||
if (_hideCursorOnIdle)
|
switch (_hideCursorMode)
|
||||||
{
|
|
||||||
_lastCursorMoveTime = Stopwatch.GetTimestamp();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
|
case HideCursorMode.Never:
|
||||||
Window.Cursor = null;
|
Window.Cursor = null;
|
||||||
|
break;
|
||||||
|
case HideCursorMode.OnIdle:
|
||||||
|
_lastCursorMoveTime = Stopwatch.GetTimestamp();
|
||||||
|
break;
|
||||||
|
case HideCursorMode.Always:
|
||||||
|
Window.Cursor = _invisibleCursor;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
throw new ArgumentOutOfRangeException();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Renderer_Destroyed(object sender, EventArgs e)
|
private void Renderer_Destroyed(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
ConfigurationState.Instance.HideCursorOnIdle.Event -= HideCursorStateChanged;
|
ConfigurationState.Instance.HideCursor.Event -= HideCursorStateChanged;
|
||||||
ConfigurationState.Instance.Graphics.AntiAliasing.Event -= UpdateAnriAliasing;
|
ConfigurationState.Instance.Graphics.AntiAliasing.Event -= UpdateAnriAliasing;
|
||||||
ConfigurationState.Instance.Graphics.ScalingFilter.Event -= UpdateScalingFilter;
|
ConfigurationState.Instance.Graphics.ScalingFilter.Event -= UpdateScalingFilter;
|
||||||
ConfigurationState.Instance.Graphics.ScalingFilterLevel.Event -= UpdateScalingFilterLevel;
|
ConfigurationState.Instance.Graphics.ScalingFilterLevel.Event -= UpdateScalingFilterLevel;
|
||||||
@@ -180,7 +186,7 @@ namespace Ryujinx.Ui
|
|||||||
|
|
||||||
protected override bool OnMotionNotifyEvent(EventMotion evnt)
|
protected override bool OnMotionNotifyEvent(EventMotion evnt)
|
||||||
{
|
{
|
||||||
if (_hideCursorOnIdle)
|
if (_hideCursorMode == HideCursorMode.OnIdle)
|
||||||
{
|
{
|
||||||
_lastCursorMoveTime = Stopwatch.GetTimestamp();
|
_lastCursorMoveTime = Stopwatch.GetTimestamp();
|
||||||
}
|
}
|
||||||
@@ -315,17 +321,30 @@ namespace Ryujinx.Ui
|
|||||||
|
|
||||||
_toggleDockedMode = toggleDockedMode;
|
_toggleDockedMode = toggleDockedMode;
|
||||||
|
|
||||||
if (_hideCursorOnIdle && !ConfigurationState.Instance.Hid.EnableMouse)
|
if (ConfigurationState.Instance.Hid.EnableMouse.Value)
|
||||||
{
|
{
|
||||||
long cursorMoveDelta = Stopwatch.GetTimestamp() - _lastCursorMoveTime;
|
if (_isMouseInClient)
|
||||||
Window.Cursor = (cursorMoveDelta >= CursorHideIdleTime * Stopwatch.Frequency) ? _invisibleCursor : null;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ConfigurationState.Instance.Hid.EnableMouse && _isMouseInClient)
|
|
||||||
{
|
{
|
||||||
Window.Cursor = _invisibleCursor;
|
Window.Cursor = _invisibleCursor;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
switch (_hideCursorMode)
|
||||||
|
{
|
||||||
|
case HideCursorMode.OnIdle:
|
||||||
|
long cursorMoveDelta = Stopwatch.GetTimestamp() - _lastCursorMoveTime;
|
||||||
|
Window.Cursor = (cursorMoveDelta >= CursorHideIdleTime * Stopwatch.Frequency) ? _invisibleCursor : null;
|
||||||
|
break;
|
||||||
|
case HideCursorMode.Always:
|
||||||
|
Window.Cursor = _invisibleCursor;
|
||||||
|
break;
|
||||||
|
case HideCursorMode.Never:
|
||||||
|
Window.Cursor = null;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void Initialize(Switch device)
|
public void Initialize(Switch device)
|
||||||
{
|
{
|
||||||
|
@@ -52,7 +52,9 @@ namespace Ryujinx.Ui.Windows
|
|||||||
[GUI] CheckButton _discordToggle;
|
[GUI] CheckButton _discordToggle;
|
||||||
[GUI] CheckButton _checkUpdatesToggle;
|
[GUI] CheckButton _checkUpdatesToggle;
|
||||||
[GUI] CheckButton _showConfirmExitToggle;
|
[GUI] CheckButton _showConfirmExitToggle;
|
||||||
[GUI] CheckButton _hideCursorOnIdleToggle;
|
[GUI] RadioButton _hideCursorNever;
|
||||||
|
[GUI] RadioButton _hideCursorOnIdle;
|
||||||
|
[GUI] RadioButton _hideCursorAlways;
|
||||||
[GUI] CheckButton _vSyncToggle;
|
[GUI] CheckButton _vSyncToggle;
|
||||||
[GUI] CheckButton _shaderCacheToggle;
|
[GUI] CheckButton _shaderCacheToggle;
|
||||||
[GUI] CheckButton _textureRecompressionToggle;
|
[GUI] CheckButton _textureRecompressionToggle;
|
||||||
@@ -226,9 +228,17 @@ namespace Ryujinx.Ui.Windows
|
|||||||
_showConfirmExitToggle.Click();
|
_showConfirmExitToggle.Click();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ConfigurationState.Instance.HideCursorOnIdle)
|
switch (ConfigurationState.Instance.HideCursor.Value)
|
||||||
{
|
{
|
||||||
_hideCursorOnIdleToggle.Click();
|
case HideCursorMode.Never:
|
||||||
|
_hideCursorNever.Click();
|
||||||
|
break;
|
||||||
|
case HideCursorMode.OnIdle:
|
||||||
|
_hideCursorOnIdle.Click();
|
||||||
|
break;
|
||||||
|
case HideCursorMode.Always:
|
||||||
|
_hideCursorAlways.Click();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ConfigurationState.Instance.Graphics.EnableVsync)
|
if (ConfigurationState.Instance.Graphics.EnableVsync)
|
||||||
@@ -560,6 +570,18 @@ namespace Ryujinx.Ui.Windows
|
|||||||
_directoryChanged = false;
|
_directoryChanged = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
HideCursorMode hideCursor = HideCursorMode.Never;
|
||||||
|
|
||||||
|
if (_hideCursorOnIdle.Active)
|
||||||
|
{
|
||||||
|
hideCursor = HideCursorMode.OnIdle;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_hideCursorAlways.Active)
|
||||||
|
{
|
||||||
|
hideCursor = HideCursorMode.Always;
|
||||||
|
}
|
||||||
|
|
||||||
if (!float.TryParse(_resScaleText.Buffer.Text, out float resScaleCustom) || resScaleCustom <= 0.0f)
|
if (!float.TryParse(_resScaleText.Buffer.Text, out float resScaleCustom) || resScaleCustom <= 0.0f)
|
||||||
{
|
{
|
||||||
resScaleCustom = 1.0f;
|
resScaleCustom = 1.0f;
|
||||||
@@ -602,7 +624,7 @@ namespace Ryujinx.Ui.Windows
|
|||||||
ConfigurationState.Instance.EnableDiscordIntegration.Value = _discordToggle.Active;
|
ConfigurationState.Instance.EnableDiscordIntegration.Value = _discordToggle.Active;
|
||||||
ConfigurationState.Instance.CheckUpdatesOnStart.Value = _checkUpdatesToggle.Active;
|
ConfigurationState.Instance.CheckUpdatesOnStart.Value = _checkUpdatesToggle.Active;
|
||||||
ConfigurationState.Instance.ShowConfirmExit.Value = _showConfirmExitToggle.Active;
|
ConfigurationState.Instance.ShowConfirmExit.Value = _showConfirmExitToggle.Active;
|
||||||
ConfigurationState.Instance.HideCursorOnIdle.Value = _hideCursorOnIdleToggle.Active;
|
ConfigurationState.Instance.HideCursor.Value = hideCursor;
|
||||||
ConfigurationState.Instance.Graphics.EnableVsync.Value = _vSyncToggle.Active;
|
ConfigurationState.Instance.Graphics.EnableVsync.Value = _vSyncToggle.Active;
|
||||||
ConfigurationState.Instance.Graphics.EnableShaderCache.Value = _shaderCacheToggle.Active;
|
ConfigurationState.Instance.Graphics.EnableShaderCache.Value = _shaderCacheToggle.Active;
|
||||||
ConfigurationState.Instance.Graphics.EnableTextureRecompression.Value = _textureRecompressionToggle.Active;
|
ConfigurationState.Instance.Graphics.EnableTextureRecompression.Value = _textureRecompressionToggle.Active;
|
||||||
@@ -698,6 +720,7 @@ namespace Ryujinx.Ui.Windows
|
|||||||
if (Directory.Exists(_addGameDirBox.Buffer.Text))
|
if (Directory.Exists(_addGameDirBox.Buffer.Text))
|
||||||
{
|
{
|
||||||
_gameDirsBoxStore.AppendValues(_addGameDirBox.Buffer.Text);
|
_gameDirsBoxStore.AppendValues(_addGameDirBox.Buffer.Text);
|
||||||
|
_directoryChanged = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@@ -160,21 +160,85 @@
|
|||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkCheckButton" id="_hideCursorOnIdleToggle">
|
<object class="GtkBox" id="_hideCursorBox">
|
||||||
<property name="label" translatable="yes">Hide Cursor On Idle</property>
|
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can-focus">True</property>
|
<property name="can-focus">False</property>
|
||||||
<property name="receives-default">False</property>
|
<child>
|
||||||
<property name="halign">start</property>
|
<object class="GtkLabel">
|
||||||
<property name="draw-indicator">True</property>
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">False</property>
|
||||||
|
<property name="halign">end</property>
|
||||||
|
<property name="label" translatable="yes">Hide Cursor:</property>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="expand">False</property>
|
<property name="expand">False</property>
|
||||||
<property name="fill">True</property>
|
<property name="fill">True</property>
|
||||||
<property name="padding">5</property>
|
<property name="padding">5</property>
|
||||||
|
<property name="position">2</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkRadioButton" id="_hideCursorNever">
|
||||||
|
<property name="label" translatable="yes">Never</property>
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">True</property>
|
||||||
|
<property name="receives-default">False</property>
|
||||||
|
<property name="halign">start</property>
|
||||||
|
<property name="margin-top">5</property>
|
||||||
|
<property name="margin-bottom">5</property>
|
||||||
|
<property name="active">True</property>
|
||||||
|
<property name="draw-indicator">True</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
<property name="position">3</property>
|
<property name="position">3</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkRadioButton" id="_hideCursorOnIdle">
|
||||||
|
<property name="label" translatable="yes">On Idle</property>
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">True</property>
|
||||||
|
<property name="receives-default">False</property>
|
||||||
|
<property name="halign">start</property>
|
||||||
|
<property name="margin-top">5</property>
|
||||||
|
<property name="margin-bottom">5</property>
|
||||||
|
<property name="draw-indicator">True</property>
|
||||||
|
<property name="group">_hideCursorNever</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">4</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkRadioButton" id="_hideCursorAlways">
|
||||||
|
<property name="label" translatable="yes">Always</property>
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">True</property>
|
||||||
|
<property name="receives-default">False</property>
|
||||||
|
<property name="halign">start</property>
|
||||||
|
<property name="margin-top">5</property>
|
||||||
|
<property name="margin-bottom">5</property>
|
||||||
|
<property name="draw-indicator">True</property>
|
||||||
|
<property name="group">_hideCursorNever</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">5</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="padding">5</property>
|
||||||
|
<property name="position">4</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="expand">True</property>
|
<property name="expand">True</property>
|
||||||
|
Reference in New Issue
Block a user