mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2026-04-20 21:52:49 +00:00
Merge branch ryujinx:master into master
This commit is contained in:
commit
8dff5a2556
6 changed files with 19 additions and 142 deletions
|
|
@ -1,22 +0,0 @@
|
||||||
using SharpMetal;
|
|
||||||
using SharpMetal.Foundation;
|
|
||||||
using SharpMetal.ObjectiveCCore;
|
|
||||||
using SharpMetal.QuartzCore;
|
|
||||||
using System.Runtime.Versioning;
|
|
||||||
// ReSharper disable InconsistentNaming
|
|
||||||
|
|
||||||
namespace Ryujinx.Graphics.Metal.SharpMetalExtensions
|
|
||||||
{
|
|
||||||
[SupportedOSPlatform("macOS")]
|
|
||||||
public static class CAMetalLayerExtensions
|
|
||||||
{
|
|
||||||
private static readonly Selector sel_developerHUDProperties = "developerHUDProperties";
|
|
||||||
private static readonly Selector sel_setDeveloperHUDProperties = "setDeveloperHUDProperties:";
|
|
||||||
|
|
||||||
public static NSDictionary GetDeveloperHudProperties(this CAMetalLayer metalLayer)
|
|
||||||
=> new(ObjectiveCRuntime.IntPtr_objc_msgSend(metalLayer.NativePtr, sel_developerHUDProperties));
|
|
||||||
|
|
||||||
public static void SetDeveloperHudProperties(this CAMetalLayer metalLayer, NSDictionary dictionary)
|
|
||||||
=> ObjectiveCRuntime.objc_msgSend(metalLayer.NativePtr, sel_setDeveloperHUDProperties, dictionary);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,32 +0,0 @@
|
||||||
using SharpMetal.Foundation;
|
|
||||||
using SharpMetal.ObjectiveCCore;
|
|
||||||
using System.Runtime.Versioning;
|
|
||||||
// ReSharper disable InconsistentNaming
|
|
||||||
|
|
||||||
namespace Ryujinx.Graphics.Metal.SharpMetalExtensions
|
|
||||||
{
|
|
||||||
[SupportedOSPlatform("macOS")]
|
|
||||||
public static class NSHelper
|
|
||||||
{
|
|
||||||
private static readonly Selector sel_getCStringMaxLengthEncoding = "getCString:maxLength:encoding:";
|
|
||||||
private static readonly Selector sel_stringWithUTF8String = "stringWithUTF8String:";
|
|
||||||
|
|
||||||
public static unsafe string ToDotNetString(this NSString source)
|
|
||||||
{
|
|
||||||
char[] sourceBuffer = new char[source.Length];
|
|
||||||
fixed (char* pSourceBuffer = sourceBuffer)
|
|
||||||
{
|
|
||||||
ObjectiveC.bool_objc_msgSend(source,
|
|
||||||
sel_getCStringMaxLengthEncoding,
|
|
||||||
pSourceBuffer,
|
|
||||||
source.MaximumLengthOfBytes(NSStringEncoding.UTF16) + 1,
|
|
||||||
(ulong)NSStringEncoding.UTF16);
|
|
||||||
}
|
|
||||||
|
|
||||||
return new string(sourceBuffer);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static NSString ToNSString(this string source)
|
|
||||||
=> new(ObjectiveC.IntPtr_objc_msgSend(new ObjectiveCClass(nameof(NSString)), sel_stringWithUTF8String, source));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,11 +0,0 @@
|
||||||
<Project Sdk="Microsoft.NET.Sdk">
|
|
||||||
<PropertyGroup>
|
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
|
||||||
<Nullable>enable</Nullable>
|
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<PackageReference Include="SharpMetal" />
|
|
||||||
</ItemGroup>
|
|
||||||
</Project>
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
using Ryujinx.Common.Logging;
|
using Ryujinx.Common.Logging;
|
||||||
using Ryujinx.HLE.Debugger.Gdb;
|
using Ryujinx.HLE.Debugger.Gdb;
|
||||||
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Net.Sockets;
|
using System.Net.Sockets;
|
||||||
|
|
@ -9,11 +10,22 @@ namespace Ryujinx.HLE.Debugger
|
||||||
{
|
{
|
||||||
public partial class Debugger
|
public partial class Debugger
|
||||||
{
|
{
|
||||||
private void DebuggerThreadMain()
|
private void MainLoop()
|
||||||
{
|
{
|
||||||
IPEndPoint endpoint = new(IPAddress.Any, GdbStubPort);
|
IPEndPoint endpoint = new(IPAddress.Any, GdbStubPort);
|
||||||
_listenerSocket = new TcpListener(endpoint);
|
_listenerSocket = new TcpListener(endpoint);
|
||||||
_listenerSocket.Start();
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
_listenerSocket.Start();
|
||||||
|
}
|
||||||
|
catch (SocketException se)
|
||||||
|
{
|
||||||
|
Logger.Error?.Print(LogClass.GdbStub,
|
||||||
|
$"Failed to create TCP server on {endpoint} for GDB client: {Enum.GetName(se.SocketErrorCode)}");
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
|
||||||
Logger.Notice.Print(LogClass.GdbStub, $"Currently waiting on {endpoint} for GDB client");
|
Logger.Notice.Print(LogClass.GdbStub, $"Currently waiting on {endpoint} for GDB client");
|
||||||
|
|
||||||
while (!_shuttingDown)
|
while (!_shuttingDown)
|
||||||
|
|
@ -22,8 +34,10 @@ namespace Ryujinx.HLE.Debugger
|
||||||
{
|
{
|
||||||
_clientSocket = _listenerSocket.AcceptSocket();
|
_clientSocket = _listenerSocket.AcceptSocket();
|
||||||
}
|
}
|
||||||
catch (SocketException)
|
catch (SocketException se)
|
||||||
{
|
{
|
||||||
|
Logger.Error?.Print(LogClass.GdbStub,
|
||||||
|
$"Failed to accept incoming GDB client connection: {Enum.GetName(se.SocketErrorCode)}");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -31,7 +45,7 @@ namespace Ryujinx.HLE.Debugger
|
||||||
int retries = 10;
|
int retries = 10;
|
||||||
while ((DebugProcess == null || GetThreads().Length == 0) && retries-- > 0)
|
while ((DebugProcess == null || GetThreads().Length == 0) && retries-- > 0)
|
||||||
{
|
{
|
||||||
Thread.Sleep(200);
|
Thread.Sleep(500);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (DebugProcess == null || GetThreads().Length == 0)
|
if (DebugProcess == null || GetThreads().Length == 0)
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ namespace Ryujinx.HLE.Debugger
|
||||||
|
|
||||||
ARMeilleure.Optimizations.EnableDebugging = true;
|
ARMeilleure.Optimizations.EnableDebugging = true;
|
||||||
|
|
||||||
_debuggerThread = new Thread(DebuggerThreadMain);
|
_debuggerThread = new Thread(MainLoop);
|
||||||
_debuggerThread.Start();
|
_debuggerThread.Start();
|
||||||
_messageHandlerThread = new Thread(MessageHandlerMain);
|
_messageHandlerThread = new Thread(MessageHandlerMain);
|
||||||
_messageHandlerThread.Start();
|
_messageHandlerThread.Start();
|
||||||
|
|
|
||||||
|
|
@ -1,72 +0,0 @@
|
||||||
<Project Sdk="Microsoft.NET.Sdk">
|
|
||||||
|
|
||||||
<PropertyGroup>
|
|
||||||
<RuntimeIdentifiers>win-x64;osx-x64;linux-x64</RuntimeIdentifiers>
|
|
||||||
<OutputType>Exe</OutputType>
|
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
|
||||||
<Version>1.0.0-dirty</Version>
|
|
||||||
<DefineConstants Condition=" '$(ExtraDefineConstants)' != '' ">$(DefineConstants);$(ExtraDefineConstants)</DefineConstants>
|
|
||||||
<SigningCertificate Condition=" '$(SigningCertificate)' == '' ">-</SigningCertificate>
|
|
||||||
<TieredPGO>true</TieredPGO>
|
|
||||||
<DefaultItemExcludes>$(DefaultItemExcludes);._*</DefaultItemExcludes>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<PackageReference Include="OpenTK.Core" />
|
|
||||||
<PackageReference Include="Ryujinx.Graphics.Nvdec.Dependencies" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<Target Name="PostBuild" AfterTargets="PostBuildEvent" Condition="$([MSBuild]::IsOSPlatform('OSX'))">
|
|
||||||
<Exec Command="codesign --entitlements '$(ProjectDir)..\..\distribution\macos\entitlements.xml' -f -s $(SigningCertificate) '$(TargetDir)$(TargetName)'" />
|
|
||||||
</Target>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<ProjectReference Include="..\Ryujinx.Graphics.Vulkan\Ryujinx.Graphics.Vulkan.csproj" />
|
|
||||||
<ProjectReference Include="..\Ryujinx.Input\Ryujinx.Input.csproj" />
|
|
||||||
<ProjectReference Include="..\Ryujinx.Input.SDL2\Ryujinx.Input.SDL2.csproj" />
|
|
||||||
<ProjectReference Include="..\Ryujinx.Audio.Backends.SDL2\Ryujinx.Audio.Backends.SDL2.csproj" />
|
|
||||||
<ProjectReference Include="..\Ryujinx.Common\Ryujinx.Common.csproj" />
|
|
||||||
<ProjectReference Include="..\Ryujinx.HLE\Ryujinx.HLE.csproj" />
|
|
||||||
<ProjectReference Include="..\ARMeilleure\ARMeilleure.csproj" />
|
|
||||||
<ProjectReference Include="..\Ryujinx.Graphics.OpenGL\Ryujinx.Graphics.OpenGL.csproj" />
|
|
||||||
<ProjectReference Include="..\Ryujinx.Graphics.Gpu\Ryujinx.Graphics.Gpu.csproj" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<PackageReference Include="CommandLineParser" />
|
|
||||||
<PackageReference Include="Ryujinx.Graphics.Vulkan.Dependencies.MoltenVK" Condition="'$(RuntimeIdentifier)' != 'linux-x64' AND '$(RuntimeIdentifier)' != 'linux-arm64' AND '$(RuntimeIdentifier)' != 'win-x64'" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<Content Include="..\..\distribution\legal\THIRDPARTY.md">
|
|
||||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
|
||||||
<TargetPath>THIRDPARTY.md</TargetPath>
|
|
||||||
</Content>
|
|
||||||
<Content Include="..\..\LICENSE.txt">
|
|
||||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
|
||||||
<TargetPath>LICENSE.txt</TargetPath>
|
|
||||||
</Content>
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup Condition="'$(RuntimeIdentifier)' == 'linux-x64' OR '$(RuntimeIdentifier)' == 'linux-arm64' OR ('$(RuntimeIdentifier)' == '' AND $([MSBuild]::IsOSPlatform('Linux')))">
|
|
||||||
<Content Include="..\..\distribution\linux\Ryujinx.sh">
|
|
||||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
|
||||||
</Content>
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<EmbeddedResource Include="Ryujinx.bmp" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<!-- Due to .net core 3.1 embedded resource loading -->
|
|
||||||
<PropertyGroup>
|
|
||||||
<EmbeddedResourceUseDependentUponConvention>false</EmbeddedResourceUseDependentUponConvention>
|
|
||||||
<ApplicationIcon>..\Ryujinx\Ryujinx.ico</ApplicationIcon>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<PropertyGroup Condition="'$(RuntimeIdentifier)' != ''">
|
|
||||||
<PublishSingleFile>true</PublishSingleFile>
|
|
||||||
<PublishTrimmed>true</PublishTrimmed>
|
|
||||||
<TrimMode>partial</TrimMode>
|
|
||||||
</PropertyGroup>
|
|
||||||
</Project>
|
|
||||||
Loading…
Reference in a new issue