Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
4d804ed45e | |||
4a27d29412 | |||
5bd2c58ad6 | |||
cf4c78b9c8 | |||
52aa4b6c22 | |||
5a02433080 |
2
.github/assign/global.yml
vendored
2
.github/assign/global.yml
vendored
@ -1,4 +1,4 @@
|
|||||||
addReviewers: true
|
addReviewers: true
|
||||||
|
|
||||||
reviewers:
|
reviewers:
|
||||||
- Developers
|
- Ryujinx/developers
|
38
.github/labeler.yml
vendored
38
.github/labeler.yml
vendored
@ -1,33 +1,33 @@
|
|||||||
audio: 'src/Ryujinx.Audio*'
|
audio: 'src/Ryujinx.Audio*/**'
|
||||||
|
|
||||||
cpu:
|
cpu:
|
||||||
- 'src/ARMeilleure//*'
|
- 'src/ARMeilleure/**'
|
||||||
- 'src/Ryujinx.Cpu/*'
|
- 'src/Ryujinx.Cpu/**'
|
||||||
- 'src/Ryujinx.Memory/*'
|
- 'src/Ryujinx.Memory/**'
|
||||||
|
|
||||||
gpu:
|
gpu:
|
||||||
- 'src/Ryujinx.Graphics.*'
|
- 'src/Ryujinx.Graphics.*/**'
|
||||||
- 'src/Spv.Generator/*'
|
- 'src/Spv.Generator/**'
|
||||||
- 'src/Ryujinx.ShaderTools/*'
|
- 'src/Ryujinx.ShaderTools/**'
|
||||||
|
|
||||||
'graphics-backend:opengl': 'src/Ryujinx.Graphics.OpenGL/*'
|
'graphics-backend:opengl': 'src/Ryujinx.Graphics.OpenGL/**'
|
||||||
'graphics-backend:vulkan':
|
'graphics-backend:vulkan':
|
||||||
- 'src/Ryujinx.Graphics.Vulkan/*'
|
- 'src/Ryujinx.Graphics.Vulkan/**'
|
||||||
- 'src/Spv.Generator/*'
|
- 'src/Spv.Generator/**'
|
||||||
|
|
||||||
gui:
|
gui:
|
||||||
- 'src/Ryujinx/*'
|
- 'src/Ryujinx/**'
|
||||||
- 'src/Ryujinx.Ui.Common/*'
|
- 'src/Ryujinx.Ui.Common/**'
|
||||||
- 'src/Ryujinx.Ui.LocaleGenerator/*'
|
- 'src/Ryujinx.Ui.LocaleGenerator/**'
|
||||||
- 'src/Ryujinx.Ava/*'
|
- 'src/Ryujinx.Ava/**'
|
||||||
|
|
||||||
horizon:
|
horizon:
|
||||||
- 'src/Ryujinx.HLE/*'
|
- 'src/Ryujinx.HLE/**'
|
||||||
- 'src/Ryujinx.Horizon*'
|
- 'src/Ryujinx.Horizon*/**'
|
||||||
|
|
||||||
kernel: 'src/Ryujinx.HLE/HOS/Kernel/*'
|
kernel: 'src/Ryujinx.HLE/HOS/Kernel/**'
|
||||||
|
|
||||||
infra:
|
infra:
|
||||||
- '.github/*'
|
- '.github/**'
|
||||||
- 'distribution/*'
|
- 'distribution/**'
|
||||||
- 'Directory.Packages.props'
|
- 'Directory.Packages.props'
|
12
.github/workflows/build.yml
vendored
12
.github/workflows/build.yml
vendored
@ -3,19 +3,13 @@ name: Build job
|
|||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs: {}
|
inputs: {}
|
||||||
#push:
|
|
||||||
# branches: [ master ]
|
|
||||||
# paths-ignore:
|
|
||||||
# - '.github/*'
|
|
||||||
# - '.github/ISSUE_TEMPLATE/**'
|
|
||||||
# - '*.yml'
|
|
||||||
# - 'README.md'
|
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ master ]
|
branches: [ master ]
|
||||||
paths-ignore:
|
paths-ignore:
|
||||||
- '.github/*'
|
- '.github/**'
|
||||||
- '.github/ISSUE_TEMPLATE/**'
|
|
||||||
- '*.yml'
|
- '*.yml'
|
||||||
|
- '*.json'
|
||||||
|
- '*.config'
|
||||||
- 'README.md'
|
- 'README.md'
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
|
33
.github/workflows/pr_triage.yml
vendored
33
.github/workflows/pr_triage.yml
vendored
@ -1,13 +1,16 @@
|
|||||||
name: "Pull Request Triage"
|
name: "Pull Request Triage"
|
||||||
on:
|
on:
|
||||||
- pull_request_target
|
pull_request_target:
|
||||||
|
types: [opened, ready_for_review]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
triage:
|
triage:
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
pull-requests: write
|
pull-requests: write
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Update labels based on changes
|
- name: Update labels based on changes
|
||||||
uses: actions/labeler@v4
|
uses: actions/labeler@v4
|
||||||
@ -15,37 +18,37 @@ jobs:
|
|||||||
sync-labels: true
|
sync-labels: true
|
||||||
dot: true
|
dot: true
|
||||||
|
|
||||||
- uses: kentaro-m/auto-assign-action@v1.2.5
|
- name: Auto Assign [Audio]
|
||||||
|
uses: kentaro-m/auto-assign-action@v1.2.5
|
||||||
with:
|
with:
|
||||||
configuration-path: '.github/assign/audio.yml'
|
configuration-path: '.github/assign/audio.yml'
|
||||||
if: github.event.action == 'opened'
|
|
||||||
|
|
||||||
- uses: kentaro-m/auto-assign-action@v1.2.5
|
- name: Auto Assign [CPU]
|
||||||
|
uses: kentaro-m/auto-assign-action@v1.2.5
|
||||||
with:
|
with:
|
||||||
configuration-path: '.github/assign/cpu.yml'
|
configuration-path: '.github/assign/cpu.yml'
|
||||||
if: github.event.action == 'opened'
|
|
||||||
|
|
||||||
- uses: kentaro-m/auto-assign-action@v1.2.5
|
- name: Auto Assign [GPU]
|
||||||
|
uses: kentaro-m/auto-assign-action@v1.2.5
|
||||||
with:
|
with:
|
||||||
configuration-path: '.github/assign/gpu.yml'
|
configuration-path: '.github/assign/gpu.yml'
|
||||||
if: github.event.action == 'opened'
|
|
||||||
|
|
||||||
- uses: kentaro-m/auto-assign-action@v1.2.5
|
- name: Auto Assign [GUI]
|
||||||
|
uses: kentaro-m/auto-assign-action@v1.2.5
|
||||||
with:
|
with:
|
||||||
configuration-path: '.github/assign/gui.yml'
|
configuration-path: '.github/assign/gui.yml'
|
||||||
if: github.event.action == 'opened'
|
|
||||||
|
|
||||||
- uses: kentaro-m/auto-assign-action@v1.2.5
|
- name: Auto Assign [Horizon]
|
||||||
|
uses: kentaro-m/auto-assign-action@v1.2.5
|
||||||
with:
|
with:
|
||||||
configuration-path: '.github/assign/horizon.yml'
|
configuration-path: '.github/assign/horizon.yml'
|
||||||
if: github.event.action == 'opened'
|
|
||||||
|
|
||||||
- uses: kentaro-m/auto-assign-action@v1.2.5
|
- name: Auto Assign [Infra]
|
||||||
|
uses: kentaro-m/auto-assign-action@v1.2.5
|
||||||
with:
|
with:
|
||||||
configuration-path: '.github/assign/infra.yml'
|
configuration-path: '.github/assign/infra.yml'
|
||||||
if: github.event.action == 'opened'
|
|
||||||
|
|
||||||
- uses: kentaro-m/auto-assign-action@v1.2.5
|
- name: Auto Assign [Global]
|
||||||
|
uses: kentaro-m/auto-assign-action@v1.2.5
|
||||||
with:
|
with:
|
||||||
configuration-path: '.github/assign/global.yml'
|
configuration-path: '.github/assign/global.yml'
|
||||||
if: github.event.action == 'opened'
|
|
||||||
|
5
.github/workflows/release.yml
vendored
5
.github/workflows/release.yml
vendored
@ -6,9 +6,10 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches: [ master ]
|
branches: [ master ]
|
||||||
paths-ignore:
|
paths-ignore:
|
||||||
- '.github/*'
|
- '.github/**'
|
||||||
- '.github/ISSUE_TEMPLATE/**'
|
|
||||||
- '*.yml'
|
- '*.yml'
|
||||||
|
- '*.json'
|
||||||
|
- '*.config'
|
||||||
- 'README.md'
|
- 'README.md'
|
||||||
|
|
||||||
concurrency: release
|
concurrency: release
|
||||||
|
@ -24,6 +24,24 @@ namespace Ryujinx.Common.Memory
|
|||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool TryRead<T>(out T value) where T : unmanaged
|
||||||
|
{
|
||||||
|
int valueSize = Unsafe.SizeOf<T>();
|
||||||
|
|
||||||
|
if (valueSize > _input.Length)
|
||||||
|
{
|
||||||
|
value = default;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
value = MemoryMarshal.Cast<byte, T>(_input)[0];
|
||||||
|
|
||||||
|
_input = _input.Slice(valueSize);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public ReadOnlySpan<byte> GetSpan(int size)
|
public ReadOnlySpan<byte> GetSpan(int size)
|
||||||
{
|
{
|
||||||
ReadOnlySpan<byte> data = _input.Slice(0, size);
|
ReadOnlySpan<byte> data = _input.Slice(0, size);
|
||||||
|
@ -154,7 +154,7 @@ namespace Ryujinx.HLE.HOS
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static DirectoryInfo FindTitleDir(DirectoryInfo contentsDir, string titleId)
|
private static DirectoryInfo FindTitleDir(DirectoryInfo contentsDir, string titleId)
|
||||||
=> contentsDir.EnumerateDirectories($"{titleId}*", DirEnumOptions).FirstOrDefault();
|
=> contentsDir.EnumerateDirectories(titleId, DirEnumOptions).FirstOrDefault();
|
||||||
|
|
||||||
private static void AddModsFromDirectory(ModCache mods, DirectoryInfo dir, string titleId)
|
private static void AddModsFromDirectory(ModCache mods, DirectoryInfo dir, string titleId)
|
||||||
{
|
{
|
||||||
|
@ -75,7 +75,11 @@ namespace Ryujinx.Horizon.LogManager.Ipc
|
|||||||
private bool LogImpl(ReadOnlySpan<byte> message)
|
private bool LogImpl(ReadOnlySpan<byte> message)
|
||||||
{
|
{
|
||||||
SpanReader reader = new(message);
|
SpanReader reader = new(message);
|
||||||
LogPacketHeader header = reader.Read<LogPacketHeader>();
|
|
||||||
|
if (!reader.TryRead(out LogPacketHeader header))
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
bool isHeadPacket = (header.Flags & LogPacketFlags.IsHead) != 0;
|
bool isHeadPacket = (header.Flags & LogPacketFlags.IsHead) != 0;
|
||||||
bool isTailPacket = (header.Flags & LogPacketFlags.IsTail) != 0;
|
bool isTailPacket = (header.Flags & LogPacketFlags.IsTail) != 0;
|
||||||
@ -84,8 +88,10 @@ namespace Ryujinx.Horizon.LogManager.Ipc
|
|||||||
|
|
||||||
while (reader.Length > 0)
|
while (reader.Length > 0)
|
||||||
{
|
{
|
||||||
int type = ReadUleb128(ref reader);
|
if (!TryReadUleb128(ref reader, out int type) || !TryReadUleb128(ref reader, out int size))
|
||||||
int size = ReadUleb128(ref reader);
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
LogDataChunkKey key = (LogDataChunkKey)type;
|
LogDataChunkKey key = (LogDataChunkKey)type;
|
||||||
|
|
||||||
@ -101,15 +107,24 @@ namespace Ryujinx.Horizon.LogManager.Ipc
|
|||||||
}
|
}
|
||||||
else if (key == LogDataChunkKey.Line)
|
else if (key == LogDataChunkKey.Line)
|
||||||
{
|
{
|
||||||
_logPacket.Line = reader.Read<int>();
|
if (!reader.TryRead<int>(out _logPacket.Line))
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (key == LogDataChunkKey.DropCount)
|
else if (key == LogDataChunkKey.DropCount)
|
||||||
{
|
{
|
||||||
_logPacket.DropCount = reader.Read<long>();
|
if (!reader.TryRead<long>(out _logPacket.DropCount))
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (key == LogDataChunkKey.Time)
|
else if (key == LogDataChunkKey.Time)
|
||||||
{
|
{
|
||||||
_logPacket.Time = reader.Read<long>();
|
if (!reader.TryRead<long>(out _logPacket.Time))
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (key == LogDataChunkKey.Message)
|
else if (key == LogDataChunkKey.Message)
|
||||||
{
|
{
|
||||||
@ -154,23 +169,25 @@ namespace Ryujinx.Horizon.LogManager.Ipc
|
|||||||
return isTailPacket;
|
return isTailPacket;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static int ReadUleb128(ref SpanReader reader)
|
private static bool TryReadUleb128(ref SpanReader reader, out int result)
|
||||||
{
|
{
|
||||||
int result = 0;
|
result = 0;
|
||||||
int count = 0;
|
int count = 0;
|
||||||
|
|
||||||
byte encoded;
|
byte encoded;
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
encoded = reader.Read<byte>();
|
if (!reader.TryRead<byte>(out encoded))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
result += (encoded & 0x7F) << (7 * count);
|
result += (encoded & 0x7F) << (7 * count);
|
||||||
|
|
||||||
count++;
|
count++;
|
||||||
} while ((encoded & 0x80) != 0);
|
} while ((encoded & 0x80) != 0);
|
||||||
|
|
||||||
return result;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -11,10 +11,10 @@ namespace Ryujinx.Ui.Common.Helper
|
|||||||
{
|
{
|
||||||
public static partial class FileAssociationHelper
|
public static partial class FileAssociationHelper
|
||||||
{
|
{
|
||||||
private static string[] _fileExtensions = new string[] { ".nca", ".nro", ".nso", ".nsp", ".xci" };
|
private static readonly string[] _fileExtensions = { ".nca", ".nro", ".nso", ".nsp", ".xci" };
|
||||||
|
|
||||||
[SupportedOSPlatform("linux")]
|
[SupportedOSPlatform("linux")]
|
||||||
private static string _mimeDbPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".local", "share", "mime");
|
private static readonly string _mimeDbPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".local", "share", "mime");
|
||||||
|
|
||||||
private const int SHCNE_ASSOCCHANGED = 0x8000000;
|
private const int SHCNE_ASSOCCHANGED = 0x8000000;
|
||||||
private const int SHCNF_FLUSH = 0x1000;
|
private const int SHCNF_FLUSH = 0x1000;
|
||||||
@ -32,7 +32,7 @@ namespace Ryujinx.Ui.Common.Helper
|
|||||||
{
|
{
|
||||||
string installKeyword = uninstall ? "uninstall" : "install";
|
string installKeyword = uninstall ? "uninstall" : "install";
|
||||||
|
|
||||||
if (!AreMimeTypesRegisteredLinux())
|
if ((uninstall && AreMimeTypesRegisteredLinux()) || (!uninstall && !AreMimeTypesRegisteredLinux()))
|
||||||
{
|
{
|
||||||
string mimeTypesFile = Path.Combine(ReleaseInformation.GetBaseApplicationDirectory(), "mime", "Ryujinx.xml");
|
string mimeTypesFile = Path.Combine(ReleaseInformation.GetBaseApplicationDirectory(), "mime", "Ryujinx.xml");
|
||||||
string additionalArgs = !uninstall ? "--novendor" : "";
|
string additionalArgs = !uninstall ? "--novendor" : "";
|
||||||
@ -81,9 +81,9 @@ namespace Ryujinx.Ui.Common.Helper
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
key.OpenSubKey(@"shell\open\command");
|
var openCmd = key.OpenSubKey(@"shell\open\command");
|
||||||
|
|
||||||
string keyValue = (string)key.GetValue("");
|
string keyValue = (string)openCmd.GetValue("");
|
||||||
|
|
||||||
return keyValue is not null && (keyValue.Contains("Ryujinx") || keyValue.Contains(AppDomain.CurrentDomain.FriendlyName));
|
return keyValue is not null && (keyValue.Contains("Ryujinx") || keyValue.Contains(AppDomain.CurrentDomain.FriendlyName));
|
||||||
}
|
}
|
||||||
@ -107,30 +107,31 @@ namespace Ryujinx.Ui.Common.Helper
|
|||||||
|
|
||||||
if (uninstall)
|
if (uninstall)
|
||||||
{
|
{
|
||||||
|
// If the types don't already exist, there's nothing to do and we can call this operation successful.
|
||||||
if (!AreMimeTypesRegisteredWindows())
|
if (!AreMimeTypesRegisteredWindows())
|
||||||
{
|
{
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
|
Logger.Debug?.Print(LogClass.Application, $"Removing type association {ext}");
|
||||||
Registry.CurrentUser.DeleteSubKeyTree(keyString);
|
Registry.CurrentUser.DeleteSubKeyTree(keyString);
|
||||||
|
Logger.Debug?.Print(LogClass.Application, $"Removed type association {ext}");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
RegistryKey key = Registry.CurrentUser.CreateSubKey(keyString);
|
using var key = Registry.CurrentUser.CreateSubKey(keyString);
|
||||||
|
|
||||||
if (key is null)
|
if (key is null)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
key.CreateSubKey(@"shell\open\command");
|
Logger.Debug?.Print(LogClass.Application, $"Adding type association {ext}");
|
||||||
|
using var openCmd = key.CreateSubKey(@"shell\open\command");
|
||||||
|
openCmd.SetValue("", $"\"{Environment.ProcessPath}\" \"%1\"");
|
||||||
|
Logger.Debug?.Print(LogClass.Application, $"Added type association {ext}");
|
||||||
|
|
||||||
key.SetValue("", $"\"{Environment.ProcessPath}\" \"%1\"");
|
|
||||||
key.Close();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Notify Explorer the file association has been changed.
|
|
||||||
SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_FLUSH, IntPtr.Zero, IntPtr.Zero);
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -141,6 +142,9 @@ namespace Ryujinx.Ui.Common.Helper
|
|||||||
registered |= RegisterExtension(ext, uninstall);
|
registered |= RegisterExtension(ext, uninstall);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Notify Explorer the file association has been changed.
|
||||||
|
SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_FLUSH, IntPtr.Zero, IntPtr.Zero);
|
||||||
|
|
||||||
return registered;
|
return registered;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user