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
|
||||
|
||||
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:
|
||||
- 'src/ARMeilleure//*'
|
||||
- 'src/Ryujinx.Cpu/*'
|
||||
- 'src/Ryujinx.Memory/*'
|
||||
- 'src/ARMeilleure/**'
|
||||
- 'src/Ryujinx.Cpu/**'
|
||||
- 'src/Ryujinx.Memory/**'
|
||||
|
||||
gpu:
|
||||
- 'src/Ryujinx.Graphics.*'
|
||||
- 'src/Spv.Generator/*'
|
||||
- 'src/Ryujinx.ShaderTools/*'
|
||||
- 'src/Ryujinx.Graphics.*/**'
|
||||
- 'src/Spv.Generator/**'
|
||||
- 'src/Ryujinx.ShaderTools/**'
|
||||
|
||||
'graphics-backend:opengl': 'src/Ryujinx.Graphics.OpenGL/*'
|
||||
'graphics-backend:opengl': 'src/Ryujinx.Graphics.OpenGL/**'
|
||||
'graphics-backend:vulkan':
|
||||
- 'src/Ryujinx.Graphics.Vulkan/*'
|
||||
- 'src/Spv.Generator/*'
|
||||
- 'src/Ryujinx.Graphics.Vulkan/**'
|
||||
- 'src/Spv.Generator/**'
|
||||
|
||||
gui:
|
||||
- 'src/Ryujinx/*'
|
||||
- 'src/Ryujinx.Ui.Common/*'
|
||||
- 'src/Ryujinx.Ui.LocaleGenerator/*'
|
||||
- 'src/Ryujinx.Ava/*'
|
||||
- 'src/Ryujinx/**'
|
||||
- 'src/Ryujinx.Ui.Common/**'
|
||||
- 'src/Ryujinx.Ui.LocaleGenerator/**'
|
||||
- 'src/Ryujinx.Ava/**'
|
||||
|
||||
horizon:
|
||||
- 'src/Ryujinx.HLE/*'
|
||||
- 'src/Ryujinx.Horizon*'
|
||||
- 'src/Ryujinx.HLE/**'
|
||||
- 'src/Ryujinx.Horizon*/**'
|
||||
|
||||
kernel: 'src/Ryujinx.HLE/HOS/Kernel/*'
|
||||
kernel: 'src/Ryujinx.HLE/HOS/Kernel/**'
|
||||
|
||||
infra:
|
||||
- '.github/*'
|
||||
- 'distribution/*'
|
||||
- '.github/**'
|
||||
- 'distribution/**'
|
||||
- 'Directory.Packages.props'
|
12
.github/workflows/build.yml
vendored
12
.github/workflows/build.yml
vendored
@ -3,19 +3,13 @@ name: Build job
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs: {}
|
||||
#push:
|
||||
# branches: [ master ]
|
||||
# paths-ignore:
|
||||
# - '.github/*'
|
||||
# - '.github/ISSUE_TEMPLATE/**'
|
||||
# - '*.yml'
|
||||
# - 'README.md'
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
paths-ignore:
|
||||
- '.github/*'
|
||||
- '.github/ISSUE_TEMPLATE/**'
|
||||
- '.github/**'
|
||||
- '*.yml'
|
||||
- '*.json'
|
||||
- '*.config'
|
||||
- 'README.md'
|
||||
|
||||
concurrency:
|
||||
|
33
.github/workflows/pr_triage.yml
vendored
33
.github/workflows/pr_triage.yml
vendored
@ -1,13 +1,16 @@
|
||||
name: "Pull Request Triage"
|
||||
on:
|
||||
- pull_request_target
|
||||
pull_request_target:
|
||||
types: [opened, ready_for_review]
|
||||
|
||||
jobs:
|
||||
triage:
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: write
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Update labels based on changes
|
||||
uses: actions/labeler@v4
|
||||
@ -15,37 +18,37 @@ jobs:
|
||||
sync-labels: 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:
|
||||
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:
|
||||
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:
|
||||
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:
|
||||
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:
|
||||
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:
|
||||
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:
|
||||
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:
|
||||
branches: [ master ]
|
||||
paths-ignore:
|
||||
- '.github/*'
|
||||
- '.github/ISSUE_TEMPLATE/**'
|
||||
- '.github/**'
|
||||
- '*.yml'
|
||||
- '*.json'
|
||||
- '*.config'
|
||||
- 'README.md'
|
||||
|
||||
concurrency: release
|
||||
|
@ -24,6 +24,24 @@ namespace Ryujinx.Common.Memory
|
||||
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)
|
||||
{
|
||||
ReadOnlySpan<byte> data = _input.Slice(0, size);
|
||||
|
@ -154,7 +154,7 @@ namespace Ryujinx.HLE.HOS
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
|
@ -75,7 +75,11 @@ namespace Ryujinx.Horizon.LogManager.Ipc
|
||||
private bool LogImpl(ReadOnlySpan<byte> 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 isTailPacket = (header.Flags & LogPacketFlags.IsTail) != 0;
|
||||
@ -84,8 +88,10 @@ namespace Ryujinx.Horizon.LogManager.Ipc
|
||||
|
||||
while (reader.Length > 0)
|
||||
{
|
||||
int type = ReadUleb128(ref reader);
|
||||
int size = ReadUleb128(ref reader);
|
||||
if (!TryReadUleb128(ref reader, out int type) || !TryReadUleb128(ref reader, out int size))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
LogDataChunkKey key = (LogDataChunkKey)type;
|
||||
|
||||
@ -101,15 +107,24 @@ namespace Ryujinx.Horizon.LogManager.Ipc
|
||||
}
|
||||
else if (key == LogDataChunkKey.Line)
|
||||
{
|
||||
_logPacket.Line = reader.Read<int>();
|
||||
if (!reader.TryRead<int>(out _logPacket.Line))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if (key == LogDataChunkKey.DropCount)
|
||||
{
|
||||
_logPacket.DropCount = reader.Read<long>();
|
||||
if (!reader.TryRead<long>(out _logPacket.DropCount))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if (key == LogDataChunkKey.Time)
|
||||
{
|
||||
_logPacket.Time = reader.Read<long>();
|
||||
if (!reader.TryRead<long>(out _logPacket.Time))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if (key == LogDataChunkKey.Message)
|
||||
{
|
||||
@ -154,23 +169,25 @@ namespace Ryujinx.Horizon.LogManager.Ipc
|
||||
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;
|
||||
|
||||
byte encoded;
|
||||
|
||||
do
|
||||
{
|
||||
encoded = reader.Read<byte>();
|
||||
if (!reader.TryRead<byte>(out encoded))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
result += (encoded & 0x7F) << (7 * count);
|
||||
|
||||
count++;
|
||||
} while ((encoded & 0x80) != 0);
|
||||
|
||||
return result;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
@ -11,10 +11,10 @@ namespace Ryujinx.Ui.Common.Helper
|
||||
{
|
||||
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")]
|
||||
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 SHCNF_FLUSH = 0x1000;
|
||||
@ -32,7 +32,7 @@ namespace Ryujinx.Ui.Common.Helper
|
||||
{
|
||||
string installKeyword = uninstall ? "uninstall" : "install";
|
||||
|
||||
if (!AreMimeTypesRegisteredLinux())
|
||||
if ((uninstall && AreMimeTypesRegisteredLinux()) || (!uninstall && !AreMimeTypesRegisteredLinux()))
|
||||
{
|
||||
string mimeTypesFile = Path.Combine(ReleaseInformation.GetBaseApplicationDirectory(), "mime", "Ryujinx.xml");
|
||||
string additionalArgs = !uninstall ? "--novendor" : "";
|
||||
@ -81,9 +81,9 @@ namespace Ryujinx.Ui.Common.Helper
|
||||
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));
|
||||
}
|
||||
@ -107,30 +107,31 @@ namespace Ryujinx.Ui.Common.Helper
|
||||
|
||||
if (uninstall)
|
||||
{
|
||||
// If the types don't already exist, there's nothing to do and we can call this operation successful.
|
||||
if (!AreMimeTypesRegisteredWindows())
|
||||
{
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
Logger.Debug?.Print(LogClass.Application, $"Removing type association {ext}");
|
||||
Registry.CurrentUser.DeleteSubKeyTree(keyString);
|
||||
Logger.Debug?.Print(LogClass.Application, $"Removed type association {ext}");
|
||||
}
|
||||
else
|
||||
{
|
||||
RegistryKey key = Registry.CurrentUser.CreateSubKey(keyString);
|
||||
using var key = Registry.CurrentUser.CreateSubKey(keyString);
|
||||
|
||||
if (key is null)
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
@ -141,6 +142,9 @@ namespace Ryujinx.Ui.Common.Helper
|
||||
registered |= RegisterExtension(ext, uninstall);
|
||||
}
|
||||
|
||||
// Notify Explorer the file association has been changed.
|
||||
SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_FLUSH, IntPtr.Zero, IntPtr.Zero);
|
||||
|
||||
return registered;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user