mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2025-05-13 16:37:42 +02:00
Compare commits
6 commits
540d68636c
...
055e54fb5b
Author | SHA1 | Date | |
---|---|---|---|
![]() |
055e54fb5b | ||
![]() |
e7d3f39c1b | ||
![]() |
2f064064ca | ||
![]() |
86c2f261af | ||
![]() |
cb154e979b | ||
![]() |
f5b6c872d7 |
4 changed files with 40 additions and 14 deletions
|
@ -117,7 +117,7 @@ namespace Ryujinx.Graphics.Gpu.Shader
|
||||||
private static string GetDiskCachePath()
|
private static string GetDiskCachePath()
|
||||||
{
|
{
|
||||||
return GraphicsConfig.EnableShaderCache && GraphicsConfig.TitleId != null
|
return GraphicsConfig.EnableShaderCache && GraphicsConfig.TitleId != null
|
||||||
? Path.Combine(AppDataManager.GamesDirPath, GraphicsConfig.TitleId, "cache", "shader")
|
? Path.Combine(AppDataManager.GamesDirPath, GraphicsConfig.TitleId.ToLower(), "cache", "shader")
|
||||||
: null;
|
: null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,10 @@
|
||||||
|
using Gommon;
|
||||||
using Ryujinx.Common.Logging;
|
using Ryujinx.Common.Logging;
|
||||||
using Ryujinx.HLE.Exceptions;
|
using Ryujinx.HLE.Exceptions;
|
||||||
using Ryujinx.HLE.HOS.Ipc;
|
using Ryujinx.HLE.HOS.Ipc;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
@ -21,22 +23,43 @@ namespace Ryujinx.HLE.HOS.Services
|
||||||
private int _selfId;
|
private int _selfId;
|
||||||
private bool _isDomain;
|
private bool _isDomain;
|
||||||
|
|
||||||
public IpcService(ServerBase server = null)
|
public IpcService(ServerBase server = null, bool registerTipc = false)
|
||||||
{
|
{
|
||||||
CmifCommands = GetType().Assembly.GetTypes()
|
Stopwatch sw = Stopwatch.StartNew();
|
||||||
.Where(type => type == GetType())
|
|
||||||
.SelectMany(type => type.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public))
|
CmifCommands = GetType()
|
||||||
|
.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public)
|
||||||
.SelectMany(methodInfo => methodInfo.GetCustomAttributes<CommandCmifAttribute>()
|
.SelectMany(methodInfo => methodInfo.GetCustomAttributes<CommandCmifAttribute>()
|
||||||
.Select(command => (command.Id, methodInfo)))
|
.Select(command => (command.Id, methodInfo)))
|
||||||
.ToDictionary(command => command.Id, command => command.methodInfo);
|
.ToDictionary(command => command.Id, command => command.methodInfo);
|
||||||
|
|
||||||
TipcCommands = GetType().Assembly.GetTypes()
|
sw.Stop();
|
||||||
.Where(type => type == GetType())
|
|
||||||
.SelectMany(type => type.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public))
|
Logger.Debug?.Print(
|
||||||
|
LogClass.Emulation,
|
||||||
|
$"{CmifCommands.Count} Cmif commands loaded in {sw.ElapsedTicks} ticks ({Stopwatch.Frequency} tps).",
|
||||||
|
GetType().AsPrettyString()
|
||||||
|
);
|
||||||
|
|
||||||
|
if (registerTipc)
|
||||||
|
{
|
||||||
|
sw.Start();
|
||||||
|
|
||||||
|
TipcCommands = GetType()
|
||||||
|
.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public)
|
||||||
.SelectMany(methodInfo => methodInfo.GetCustomAttributes<CommandTipcAttribute>()
|
.SelectMany(methodInfo => methodInfo.GetCustomAttributes<CommandTipcAttribute>()
|
||||||
.Select(command => (command.Id, methodInfo)))
|
.Select(command => (command.Id, methodInfo)))
|
||||||
.ToDictionary(command => command.Id, command => command.methodInfo);
|
.ToDictionary(command => command.Id, command => command.methodInfo);
|
||||||
|
|
||||||
|
sw.Stop();
|
||||||
|
|
||||||
|
Logger.Debug?.Print(
|
||||||
|
LogClass.Emulation,
|
||||||
|
$"{TipcCommands.Count} Tipc commands loaded in {sw.ElapsedTicks} ticks ({Stopwatch.Frequency} tps).",
|
||||||
|
GetType().AsPrettyString()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
Server = server;
|
Server = server;
|
||||||
|
|
||||||
_parent = this;
|
_parent = this;
|
||||||
|
|
|
@ -21,7 +21,7 @@ namespace Ryujinx.HLE.HOS.Services.Sm
|
||||||
|
|
||||||
private bool _isInitialized;
|
private bool _isInitialized;
|
||||||
|
|
||||||
public IUserInterface(KernelContext context, SmRegistry registry)
|
public IUserInterface(KernelContext context, SmRegistry registry) : base(registerTipc: true)
|
||||||
{
|
{
|
||||||
_commonServer = new ServerBase(context, "CommonServer");
|
_commonServer = new ServerBase(context, "CommonServer");
|
||||||
_registry = registry;
|
_registry = registry;
|
||||||
|
|
|
@ -57,16 +57,19 @@ namespace Ryujinx.Input.SDL2
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Remove the first 4 char of the guid (CRC part) to make it stable
|
||||||
|
string guidString = "0000" + guid.ToString().Substring(4);
|
||||||
|
|
||||||
string id;
|
string id;
|
||||||
|
|
||||||
lock (_lock)
|
lock (_lock)
|
||||||
{
|
{
|
||||||
int guidIndex = 0;
|
int guidIndex = 0;
|
||||||
id = guidIndex + "-" + guid;
|
id = guidIndex + "-" + guidString;
|
||||||
|
|
||||||
while (_gamepadsIds.Contains(id))
|
while (_gamepadsIds.Contains(id))
|
||||||
{
|
{
|
||||||
id = (++guidIndex) + "-" + guid;
|
id = (++guidIndex) + "-" + guidString;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue