Skip to content

Commit

Permalink
Migrate to .NET 9
Browse files Browse the repository at this point in the history
  • Loading branch information
marco-carvalho committed Dec 3, 2024
1 parent 08b7257 commit b41f89c
Show file tree
Hide file tree
Showing 85 changed files with 87 additions and 101 deletions.
5 changes: 5 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<Project>
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
</PropertyGroup>
</Project>
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ failing to meet this requirement may result in a poor gameplay experience or une

## Latest build

Stable builds are made every so often onto a separate "release" branch that then gets put into the releases you know and love.
Stable builds are made every so often onto a separate "release" branch that then gets put into the releases you know and love.
These stable builds exist so that the end user can get a more **enjoyable and stable experience**.

You can find the latest stable release [here](https://github.com/GreemDev/Ryujinx/releases/latest).
Expand Down Expand Up @@ -91,7 +91,7 @@ If you are planning to contribute or just want to learn more about this project
It translates the ARM code to a custom IR, performs a few optimizations, and turns that into x86 code.
There are three memory manager options available depending on the user's preference, leveraging both software-based (slower) and host-mapped modes (much faster).
The fastest option (host, unchecked) is set by default.
Ryujinx also features an optional Profiled Persistent Translation Cache, which essentially caches translated functions so that they do not need to be translated every time the game loads.
Ryujinx also features an optional Profiled Persistent Translation Cache, which essentially caches translated functions so that they do not need to be translated every time the game loads.
The net result is a significant reduction in load times (the amount of time between launching a game and arriving at the title screen) for nearly every game.
NOTE: This feature is enabled by default in the Options menu > System tab.
You must launch the game at least twice to the title screen or beyond before performance improvements are unlocked on the third launch!
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "8.0.100",
"version": "9.0.100",
"rollForward": "latestFeature"
}
}
1 change: 0 additions & 1 deletion src/ARMeilleure/ARMeilleure.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<DefaultItemExcludes>$(DefaultItemExcludes);._*</DefaultItemExcludes>
</PropertyGroup>
Expand Down
3 changes: 2 additions & 1 deletion src/ARMeilleure/Translation/Cache/JitCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Threading;

namespace ARMeilleure.Translation.Cache
{
Expand All @@ -26,7 +27,7 @@ static partial class JitCache

private static readonly List<CacheEntry> _cacheEntries = new();

private static readonly object _lock = new();
private static readonly Lock _lock = new();
private static bool _initialized;

[SupportedOSPlatform("windows")]
Expand Down
4 changes: 1 addition & 3 deletions src/ARMeilleure/Translation/PTC/Ptc.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class Ptc : IPtcLoadState

private readonly ManualResetEvent _waitEvent;

private readonly object _lock;
private readonly Lock _lock = new();

private bool _disposed;

Expand Down Expand Up @@ -89,8 +89,6 @@ public Ptc()

_waitEvent = new ManualResetEvent(true);

_lock = new object();

_disposed = false;

TitleIdText = TitleIdTextDefault;
Expand Down
4 changes: 1 addition & 3 deletions src/ARMeilleure/Translation/PTC/PtcProfiler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class PtcProfiler

private readonly ManualResetEvent _waitEvent;

private readonly object _lock;
private readonly Lock _lock = new();

private bool _disposed;

Expand All @@ -65,8 +65,6 @@ public PtcProfiler(Ptc ptc)

_waitEvent = new ManualResetEvent(true);

_lock = new object();

_disposed = false;

ProfiledFuncs = new Dictionary<ulong, FuncProfile>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Threading;

namespace Ryujinx.Audio.Backends.OpenAL
{
Expand All @@ -18,7 +19,7 @@ class OpenALHardwareDeviceSession : HardwareDeviceSessionOutputBase
private ulong _playedSampleCount;
private float _volume;

private readonly object _lock = new();
private readonly Lock _lock = new();

public OpenALHardwareDeviceSession(OpenALHardwareDeviceDriver driver, IVirtualMemoryManager memoryManager, SampleFormat requestedSampleFormat, uint requestedSampleRate, uint requestedChannelCount) : base(memoryManager, requestedSampleFormat, requestedSampleRate, requestedChannelCount)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<DefaultItemExcludes>$(DefaultItemExcludes);._*</DefaultItemExcludes>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<DefaultItemExcludes>$(DefaultItemExcludes);._*</DefaultItemExcludes>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<RuntimeIdentifiers>win-x64;osx-x64;linux-x64</RuntimeIdentifiers>
<DefaultItemExcludes>$(DefaultItemExcludes);._*</DefaultItemExcludes>
Expand Down
2 changes: 1 addition & 1 deletion src/Ryujinx.Audio/AudioManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class AudioManager : IDisposable
/// <summary>
/// Lock used to control the waiters registration.
/// </summary>
private readonly object _lock = new();
private readonly Lock _lock = new();

/// <summary>
/// Events signaled when the driver played audio buffers.
Expand Down
3 changes: 2 additions & 1 deletion src/Ryujinx.Audio/Backends/Common/DynamicRingBuffer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using Ryujinx.Common.Memory;
using System;
using System.Buffers;
using System.Threading;

namespace Ryujinx.Audio.Backends.Common
{
Expand All @@ -12,7 +13,7 @@ public class DynamicRingBuffer
{
private const int RingBufferAlignment = 2048;

private readonly object _lock = new();
private readonly Lock _lock = new();

private MemoryOwner<byte> _bufferOwner;
private Memory<byte> _buffer;
Expand Down
2 changes: 1 addition & 1 deletion src/Ryujinx.Audio/Input/AudioInputManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace Ryujinx.Audio.Input
/// </summary>
public class AudioInputManager : IDisposable
{
private readonly object _lock = new();
private readonly Lock _lock = new();

/// <summary>
/// Lock used for session allocation.
Expand Down
4 changes: 2 additions & 2 deletions src/Ryujinx.Audio/Input/AudioInputSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public class AudioInputSystem : IDisposable
/// <summary>
/// The lock of the parent.
/// </summary>
private readonly object _parentLock;
private readonly Lock _parentLock;

/// <summary>
/// The dispose state.
Expand All @@ -62,7 +62,7 @@ public class AudioInputSystem : IDisposable
/// <param name="parentLock">The lock of the manager</param>
/// <param name="deviceSession">The hardware device session</param>
/// <param name="bufferEvent">The buffer release event of the audio input</param>
public AudioInputSystem(AudioInputManager manager, object parentLock, IHardwareDeviceSession deviceSession, IWritableEvent bufferEvent)
public AudioInputSystem(AudioInputManager manager, Lock parentLock, IHardwareDeviceSession deviceSession, IWritableEvent bufferEvent)
{
_manager = manager;
_parentLock = parentLock;
Expand Down
2 changes: 1 addition & 1 deletion src/Ryujinx.Audio/Output/AudioOutputManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace Ryujinx.Audio.Output
/// </summary>
public class AudioOutputManager : IDisposable
{
private readonly object _lock = new();
private readonly Lock _lock = new();

/// <summary>
/// Lock used for session allocation.
Expand Down
4 changes: 2 additions & 2 deletions src/Ryujinx.Audio/Output/AudioOutputSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public class AudioOutputSystem : IDisposable
/// <summary>
/// THe lock of the parent.
/// </summary>
private readonly object _parentLock;
private readonly Lock _parentLock;

/// <summary>
/// The dispose state.
Expand All @@ -62,7 +62,7 @@ public class AudioOutputSystem : IDisposable
/// <param name="parentLock">The lock of the manager</param>
/// <param name="deviceSession">The hardware device session</param>
/// <param name="bufferEvent">The buffer release event of the audio output</param>
public AudioOutputSystem(AudioOutputManager manager, object parentLock, IHardwareDeviceSession deviceSession, IWritableEvent bufferEvent)
public AudioOutputSystem(AudioOutputManager manager, Lock parentLock, IHardwareDeviceSession deviceSession, IWritableEvent bufferEvent)
{
_manager = manager;
_parentLock = parentLock;
Expand Down
2 changes: 1 addition & 1 deletion src/Ryujinx.Audio/Renderer/Server/AudioRenderSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ namespace Ryujinx.Audio.Renderer.Server
{
public class AudioRenderSystem : IDisposable
{
private readonly object _lock = new();
private readonly Lock _lock = new();

private AudioRendererRenderingDevice _renderingDevice;
private AudioRendererExecutionMode _executionMode;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Diagnostics;
using System.Threading;

namespace Ryujinx.Audio.Renderer.Server.Upsampler
{
Expand All @@ -16,7 +17,7 @@ public class UpsamplerManager
/// <summary>
/// Global lock of the object.
/// </summary>
private readonly object _lock = new();
private readonly Lock _lock = new();

/// <summary>
/// The upsamplers instances.
Expand Down
1 change: 0 additions & 1 deletion src/Ryujinx.Audio/Ryujinx.Audio.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<DefaultItemExcludes>$(DefaultItemExcludes);._*</DefaultItemExcludes>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Ryujinx.Common/PreciseSleep/NanosleepPool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public void Dispose()
}
}

private readonly object _lock = new();
private readonly Lock _lock = new();
private readonly List<NanosleepThread> _threads = new();
private readonly List<NanosleepThread> _active = new();
private readonly Stack<NanosleepThread> _free = new();
Expand Down
2 changes: 1 addition & 1 deletion src/Ryujinx.Common/PreciseSleep/WindowsGranularTimer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public WaitingObject(long id, EventWaitHandle signal, long timePoint)
private long _lastTicks = PerformanceCounter.ElapsedTicks;
private long _lastId;

private readonly object _lock = new();
private readonly Lock _lock = new();
private readonly List<WaitingObject> _waitingObjects = new();

private WindowsGranularTimer()
Expand Down
1 change: 0 additions & 1 deletion src/Ryujinx.Common/Ryujinx.Common.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<DefineConstants Condition=" '$(ExtraDefineConstants)' != '' ">$(DefineConstants);$(ExtraDefineConstants)</DefineConstants>
<DefaultItemExcludes>$(DefaultItemExcludes);._*</DefaultItemExcludes>
Expand Down
3 changes: 2 additions & 1 deletion src/Ryujinx.Cpu/AppleHv/HvVm.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using Ryujinx.Memory;
using System;
using System.Runtime.Versioning;
using System.Threading;

namespace Ryujinx.Cpu.AppleHv
{
Expand All @@ -12,7 +13,7 @@ static class HvVm

private static int _addressSpaces;
private static HvIpaAllocator _ipaAllocator;
private static readonly object _lock = new();
private static readonly Lock _lock = new();

public static (ulong, HvIpaAllocator) CreateAddressSpace(MemoryBlock block)
{
Expand Down
3 changes: 2 additions & 1 deletion src/Ryujinx.Cpu/LightningJit/Cache/JitCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Threading;

namespace Ryujinx.Cpu.LightningJit.Cache
{
Expand All @@ -23,7 +24,7 @@ static partial class JitCache

private static readonly List<CacheEntry> _cacheEntries = new();

private static readonly object _lock = new();
private static readonly Lock _lock = new();
private static bool _initialized;

[SupportedOSPlatform("windows")]
Expand Down
4 changes: 2 additions & 2 deletions src/Ryujinx.Cpu/LightningJit/Cache/NoWxCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Threading;

namespace Ryujinx.Cpu.LightningJit.Cache
{
Expand Down Expand Up @@ -104,7 +105,7 @@ public void Dispose()
private readonly MemoryCache _sharedCache;
private readonly MemoryCache _localCache;
private readonly PageAlignedRangeList _pendingMap;
private readonly object _lock;
private readonly Lock _lock = new();

class ThreadLocalCacheEntry
{
Expand Down Expand Up @@ -137,7 +138,6 @@ public NoWxCache(IJitMemoryAllocator allocator, IStackWalker stackWalker, Transl
_sharedCache = new(allocator, SharedCacheSize);
_localCache = new(allocator, LocalCacheSize);
_pendingMap = new(_sharedCache.ReprotectAsRx, RegisterFunction);
_lock = new();
}

public unsafe nint Map(nint framePointer, ReadOnlySpan<byte> code, ulong guestAddress, ulong guestSize)
Expand Down
1 change: 0 additions & 1 deletion src/Ryujinx.Cpu/Ryujinx.Cpu.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<DefaultItemExcludes>$(DefaultItemExcludes);._*</DefaultItemExcludes>
</PropertyGroup>
Expand Down
3 changes: 2 additions & 1 deletion src/Ryujinx.Cpu/Signal/NativeSignalHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System.Diagnostics;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Threading;

namespace Ryujinx.Cpu.Signal
{
Expand Down Expand Up @@ -59,7 +60,7 @@ static class NativeSignalHandler

private static MemoryBlock _codeBlock;

private static readonly object _lock = new();
private static readonly Lock _lock = new();
private static bool _initialized;

static NativeSignalHandler()
Expand Down
1 change: 0 additions & 1 deletion src/Ryujinx.Graphics.Device/Ryujinx.Graphics.Device.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<DefaultItemExcludes>$(DefaultItemExcludes);._*</DefaultItemExcludes>
</PropertyGroup>

Expand Down
1 change: 0 additions & 1 deletion src/Ryujinx.Graphics.GAL/Ryujinx.Graphics.GAL.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<DefaultItemExcludes>$(DefaultItemExcludes);._*</DefaultItemExcludes>
</PropertyGroup>

Expand Down
5 changes: 3 additions & 2 deletions src/Ryujinx.Graphics.Gpu/Memory/BufferModifiedRangeList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using Ryujinx.Memory.Range;
using System;
using System.Linq;
using System.Threading;

namespace Ryujinx.Graphics.Gpu.Memory
{
Expand Down Expand Up @@ -76,7 +77,7 @@ class BufferModifiedRangeList : RangeList<BufferModifiedRange>
private BufferMigration _source;
private BufferModifiedRangeList _migrationTarget;

private readonly object _lock = new();
private readonly Lock _lock = new();

/// <summary>
/// Whether the modified range list has any entries or not.
Expand Down Expand Up @@ -435,7 +436,7 @@ public void InheritRanges(BufferModifiedRangeList ranges, Action<ulong, ulong> r

if (_source == null)
{
// Create a new migration.
// Create a new migration.
_source = new BufferMigration(new BufferMigrationSpan[] { span }, this, _context.SyncNumber);

_context.RegisterBufferMigration(_source);
Expand Down
Loading

0 comments on commit b41f89c

Please sign in to comment.