mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2026-06-22 12:19:15 +00:00
Compare commits
3 Commits
Canary-1.3
...
Canary-1.3
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e777e3f93b | ||
|
|
7b19e041cb | ||
|
|
e7a3c94b9c |
@@ -63,6 +63,6 @@
|
||||
<PackageVersion Include="SkiaSharp.NativeAssets.Linux.NoDependencies" Version="2.88.9" />
|
||||
<PackageVersion Include="SPB" Version="0.0.4-build32" />
|
||||
<PackageVersion Include="System.IO.Hashing" Version="9.0.15" />
|
||||
<PackageVersion Include="UnicornEngine.Unicorn" Version="2.1.3" />
|
||||
<PackageVersion Include="UnicornEngine.Unicorn" Version="2.1.0" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
||||
@@ -53,7 +53,7 @@ namespace Ryujinx.Cpu.Signal
|
||||
public SignalHandlerRangeArray Ranges;
|
||||
}
|
||||
|
||||
static class NativeSignalHandler
|
||||
public static class NativeSignalHandler
|
||||
{
|
||||
private static readonly nint _handlerConfig;
|
||||
private static nint _signalHandlerPtr;
|
||||
|
||||
@@ -1,10 +1,23 @@
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using UnicornEngine.Const;
|
||||
|
||||
namespace Ryujinx.Tests.Unicorn
|
||||
{
|
||||
public class UnicornAArch32 : IDisposable
|
||||
{
|
||||
struct UcArmCpReg
|
||||
{
|
||||
public uint Cp;
|
||||
public uint Is64;
|
||||
public uint Sec;
|
||||
public uint CRn;
|
||||
public uint CRm;
|
||||
public uint Opc1;
|
||||
public uint Opc2;
|
||||
public uint Val;
|
||||
}
|
||||
|
||||
internal readonly UnicornEngine.Unicorn Uc;
|
||||
private bool _isDisposed;
|
||||
|
||||
@@ -38,7 +51,7 @@ namespace Ryujinx.Tests.Unicorn
|
||||
|
||||
public int Fpscr
|
||||
{
|
||||
get => (int)GetRegister(Arm.UC_ARM_REG_FPSCR) | ((int)GetRegister(Arm.UC_ARM_REG_FPSCR_NZCV));
|
||||
get => (int)GetRegister(Arm.UC_ARM_REG_FPSCR);
|
||||
set => SetRegister(Arm.UC_ARM_REG_FPSCR, (uint)value);
|
||||
}
|
||||
|
||||
@@ -85,8 +98,22 @@ namespace Ryujinx.Tests.Unicorn
|
||||
public UnicornAArch32()
|
||||
{
|
||||
Uc = new UnicornEngine.Unicorn(Common.UC_ARCH_ARM, Common.UC_MODE_LITTLE_ENDIAN);
|
||||
|
||||
SetRegister(Arm.UC_ARM_REG_C1_C0_2, GetRegister(Arm.UC_ARM_REG_C1_C0_2) | 0xf00000);
|
||||
|
||||
UcArmCpReg reg = new()
|
||||
{
|
||||
Cp = 15,
|
||||
Is64 = 0,
|
||||
Sec = 0,
|
||||
CRn = 13,
|
||||
Opc1 = 0,
|
||||
CRm = 0,
|
||||
Opc2 = 2
|
||||
};
|
||||
|
||||
GetRegister(Arm.UC_ARM_REG_CP_REG, ref reg);
|
||||
reg.Val |= 0xf00000;
|
||||
SetRegister(Arm.UC_ARM_REG_CP_REG, reg);
|
||||
|
||||
SetRegister(Arm.UC_ARM_REG_FPEXC, 0x40000000);
|
||||
}
|
||||
|
||||
@@ -204,6 +231,17 @@ namespace Ryujinx.Tests.Unicorn
|
||||
SetVector(Arm.UC_ARM_REG_D0 + index * 2, value);
|
||||
}
|
||||
|
||||
public void GetRegister<T>(int register, ref T obj) where T : unmanaged
|
||||
{
|
||||
Span<T> span = new(ref obj);
|
||||
Span<byte> dataSpan = MemoryMarshal.Cast<T, byte>(span);
|
||||
byte[] data = dataSpan.ToArray();
|
||||
|
||||
Uc.RegRead(register, data);
|
||||
|
||||
data.AsSpan().CopyTo(dataSpan);
|
||||
}
|
||||
|
||||
public uint GetRegister(int register)
|
||||
{
|
||||
byte[] data = new byte[4];
|
||||
@@ -213,6 +251,13 @@ namespace Ryujinx.Tests.Unicorn
|
||||
return BitConverter.ToUInt32(data, 0);
|
||||
}
|
||||
|
||||
public void SetRegister<T>(int register, T obj) where T : unmanaged
|
||||
{
|
||||
byte[] data = MemoryMarshal.Cast<T, byte>(new Span<T>(ref obj)).ToArray();
|
||||
|
||||
Uc.RegWrite(register, data);
|
||||
}
|
||||
|
||||
public void SetRegister(int register, uint value)
|
||||
{
|
||||
byte[] data = BitConverter.GetBytes(value);
|
||||
|
||||
@@ -7,6 +7,7 @@ using Ryujinx.Common.Memory;
|
||||
using Ryujinx.Common.Memory.PartialUnmaps;
|
||||
using Ryujinx.Cpu;
|
||||
using Ryujinx.Cpu.Jit;
|
||||
using Ryujinx.Cpu.Signal;
|
||||
using Ryujinx.Memory;
|
||||
using Ryujinx.Memory.Tracking;
|
||||
using System;
|
||||
@@ -60,6 +61,8 @@ namespace Ryujinx.Tests.Memory
|
||||
new JitMemoryAllocator(),
|
||||
new MockMemoryManager(),
|
||||
AddressTable<ulong>.CreateForArm(true, MemoryManagerType.SoftwarePageTable));
|
||||
|
||||
NativeSignalHandler.InitializeSignalHandler();
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace Ryujinx.Ava.Systems
|
||||
LargeImageText = TruncateToByteLength(_description)
|
||||
},
|
||||
Details = "Main Menu",
|
||||
State = "Idling",
|
||||
State = "Waiting",
|
||||
Timestamps = EmulatorStartedAt
|
||||
};
|
||||
|
||||
|
||||
@@ -1069,7 +1069,6 @@ namespace Ryujinx.Ava.Systems.PlayReport
|
||||
|
||||
_ => FormattedValue.ForceReset
|
||||
};
|
||||
|
||||
private static FormattedValue TomodachiLifeLTD_Status(SingleValue value)
|
||||
{
|
||||
MessagePackObject messagePackObject = value.Matched.PackedValue;
|
||||
@@ -1077,8 +1076,9 @@ namespace Ryujinx.Ava.Systems.PlayReport
|
||||
|
||||
int miiCount = messagePackObjectDictionary["MiiNum"].AsInt32();
|
||||
int fountainLevel = messagePackObjectDictionary["FountainLevel"].AsInt32();
|
||||
|
||||
return $"Looking after {"Mii".ToQuantity(miiCount)}, with an island level of {fountainLevel}";
|
||||
|
||||
// Fountain Level should be kept consistent throughout code, so I basically made sure of it
|
||||
return $"Looking after {"Mii".ToQuantity(miiCount)}, with a fountain level of {fountainLevel}";
|
||||
}
|
||||
|
||||
private static FormattedValue AnimalCrossingNewHorizons_AppCommon(SingleValue value)
|
||||
|
||||
@@ -13,6 +13,7 @@ using System.Collections.ObjectModel;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using static Ryujinx.Ava.Utilities.StorageProviderExtensions;
|
||||
|
||||
namespace Ryujinx.Ava.UI.ViewModels
|
||||
{
|
||||
@@ -128,7 +129,7 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||
|
||||
public async void Add()
|
||||
{
|
||||
IReadOnlyList<IStorageFile> result = await _storageProvider.OpenFilePickerAsync(new FilePickerOpenOptions
|
||||
IReadOnlyList<IStorageFile> result = await CoreDumpable(() => _storageProvider.OpenFilePickerAsync(new FilePickerOpenOptions
|
||||
{
|
||||
Title = LocaleManager.Instance[LocaleKeys.SelectDlcDialogTitle],
|
||||
AllowMultiple = true,
|
||||
@@ -141,7 +142,7 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||
MimeTypes = ["application/x-nx-nsp"],
|
||||
},
|
||||
},
|
||||
});
|
||||
}));
|
||||
|
||||
int totalDlcAdded = 0;
|
||||
foreach (IStorageFile file in result)
|
||||
|
||||
@@ -17,6 +17,7 @@ using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using static Ryujinx.Ava.Utilities.StorageProviderExtensions;
|
||||
|
||||
namespace Ryujinx.Ava.UI.ViewModels
|
||||
{
|
||||
@@ -288,11 +289,11 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||
|
||||
public async void Add()
|
||||
{
|
||||
IReadOnlyList<IStorageFolder> result = await _storageProvider.OpenFolderPickerAsync(new FolderPickerOpenOptions
|
||||
IReadOnlyList<IStorageFolder> result = await CoreDumpable(() => _storageProvider.OpenFolderPickerAsync(new FolderPickerOpenOptions
|
||||
{
|
||||
Title = LocaleManager.Instance[LocaleKeys.SelectModDialogTitle],
|
||||
AllowMultiple = true,
|
||||
});
|
||||
}));
|
||||
|
||||
foreach (IStorageFolder folder in result)
|
||||
{
|
||||
|
||||
@@ -11,6 +11,7 @@ using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using static Ryujinx.Ava.Utilities.StorageProviderExtensions;
|
||||
|
||||
namespace Ryujinx.Ava.UI.ViewModels
|
||||
{
|
||||
@@ -148,7 +149,7 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||
|
||||
public async Task Add()
|
||||
{
|
||||
IReadOnlyList<IStorageFile> result = await _storageProvider.OpenFilePickerAsync(new FilePickerOpenOptions
|
||||
IReadOnlyList<IStorageFile> result = await CoreDumpable(() => _storageProvider.OpenFilePickerAsync(new FilePickerOpenOptions
|
||||
{
|
||||
AllowMultiple = true,
|
||||
FileTypeFilter = new List<FilePickerFileType>
|
||||
@@ -160,7 +161,7 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||
MimeTypes = ["application/x-nx-nsp"],
|
||||
},
|
||||
},
|
||||
});
|
||||
}));
|
||||
|
||||
int totalUpdatesAdded = 0;
|
||||
foreach (IStorageFile file in result)
|
||||
|
||||
@@ -4,10 +4,12 @@ using Avalonia.Platform.Storage;
|
||||
using Avalonia.VisualTree;
|
||||
using FluentAvalonia.UI.Controls;
|
||||
using FluentAvalonia.UI.Navigation;
|
||||
using Gommon;
|
||||
using Ryujinx.Ava.Common.Locale;
|
||||
using Ryujinx.Ava.UI.Controls;
|
||||
using Ryujinx.Ava.UI.Models;
|
||||
using Ryujinx.Ava.UI.ViewModels;
|
||||
using Ryujinx.Ava.Utilities;
|
||||
using Ryujinx.HLE.FileSystem;
|
||||
using SkiaSharp;
|
||||
using System.Collections.Generic;
|
||||
@@ -62,7 +64,7 @@ namespace Ryujinx.Ava.UI.Views.User
|
||||
|
||||
private async void Import_OnClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
IReadOnlyList<IStorageFile> result = await ((Window)this.GetVisualRoot()!).StorageProvider.OpenFilePickerAsync(new FilePickerOpenOptions
|
||||
Optional<IStorageFile> result = await ((Window)this.GetVisualRoot()!).StorageProvider.OpenSingleFilePickerAsync(new FilePickerOpenOptions
|
||||
{
|
||||
AllowMultiple = false,
|
||||
FileTypeFilter = new List<FilePickerFileType>
|
||||
@@ -76,9 +78,9 @@ namespace Ryujinx.Ava.UI.Views.User
|
||||
},
|
||||
});
|
||||
|
||||
if (result.Count > 0)
|
||||
if (result.HasValue)
|
||||
{
|
||||
_profile.Image = ProcessProfileImage(File.ReadAllBytes(result[0].Path.LocalPath));
|
||||
_profile.Image = ProcessProfileImage(File.ReadAllBytes(result.Value.Path.LocalPath));
|
||||
_parent.GoBack();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace Ryujinx.Ava.Utilities
|
||||
.Then(files => files.Count > 0 ? Optional.Of(files) : default);
|
||||
}
|
||||
|
||||
private static async Task<T> CoreDumpable<T>(Func<Task<T>> picker)
|
||||
public static async Task<T> CoreDumpable<T>(Func<Task<T>> picker)
|
||||
{
|
||||
OsUtils.SetCoreDumpable(true);
|
||||
try
|
||||
|
||||
Reference in New Issue
Block a user