Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Common.props
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,7 @@
<ItemGroup Condition=" $(IsTargetingNetFramework) ">
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" PrivateAssets="all" />
<PackageReference Include="System.Resources.Extensions" PrivateAssets="all" />
<Reference Include="System.IO.Compression" />
<Reference Include="System.Net.Http" />
</ItemGroup>
</Project>
17 changes: 8 additions & 9 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -27,25 +27,24 @@
<PackageVersion Include="ppy.SDL2-CS" Version="1.0.630-alpha" /> <!-- last version with .NET Standard 2.0 support -->
<PackageVersion Include="Roslynator.Analyzers" Version="4.13.1" />
<PackageVersion Include="SharpCompress" Version="0.40.0" />
<PackageVersion Include="Silk.NET.OpenAL" Version="2.21.0" />
<PackageVersion Include="Silk.NET.OpenAL.Extensions.Creative" Version="2.21.0" />
<PackageVersion Include="Silk.NET.OpenAL.Extensions.Enumeration" Version="2.21.0" />
<PackageVersion Include="Silk.NET.OpenAL.Extensions.EXT" Version="2.21.0" />
<PackageVersion Include="Silk.NET.OpenGL" Version="2.21.0" />
<PackageVersion Include="Silk.NET.WGL.Extensions.NV" Version="2.21.0" />
<PackageVersion Include="Silk.NET.OpenAL" Version="2.23.0" />
<PackageVersion Include="Silk.NET.OpenAL.Extensions.Creative" Version="2.23.0" />
<PackageVersion Include="Silk.NET.OpenAL.Extensions.Enumeration" Version="2.23.0" />
<PackageVersion Include="Silk.NET.OpenAL.Extensions.EXT" Version="2.23.0" />
<PackageVersion Include="Silk.NET.OpenGL" Version="2.23.0" />
<PackageVersion Include="Silk.NET.WGL.Extensions.NV" Version="2.23.0" />
<PackageVersion Include="SQLitePCLRaw.provider.e_sqlite3" Version="2.1.8" />
<PackageVersion Include="StyleCop.Analyzers" Version="1.2.0-beta.556" /><!-- don't forget to update .stylecop.json at the same time -->
<PackageVersion Include="System.Collections.Immutable" Version="8.0.0" />
<PackageVersion Include="System.CommandLine" Version="2.0.3" />
<PackageVersion Include="System.ComponentModel.Annotations" Version="5.0.0" />
<PackageVersion Include="System.Drawing.Common" Version="6.0.0" />
<PackageVersion Include="System.Drawing.Primitives" Version="4.3.0" />
<PackageVersion Include="System.Memory" Version="4.6.0" />
<PackageVersion Include="System.Memory" Version="4.6.3" />
<PackageVersion Include="System.Net.Http" Version="4.3.4" />
<PackageVersion Include="System.Reflection.Emit" Version="4.7.0" />
<PackageVersion Include="System.Resources.Extensions" Version="7.0.0" />
<PackageVersion Include="System.Runtime.CompilerServices.Unsafe" Version="6.1.0" />
<PackageVersion Include="System.Text.Json" Version="9.0.0" /> <!-- transitive dependency of Silk.NET; 8.0.0 generates build warnings -->
<PackageVersion Include="System.Runtime.CompilerServices.Unsafe" Version="6.1.2" />
<PackageVersion Include="Vortice.Direct3D11" Version="2.4.2" /> <!-- last version with .NET Standard 2.0 support -->
<PackageVersion Include="Vortice.D3DCompiler" Version="2.4.2" /> <!-- last version with .NET Standard 2.0 support -->
<PackageVersion Include="Vortice.MediaFoundation" Version="2.4.2" /> <!-- last version with .NET Standard 2.0 support -->
Expand Down
2 changes: 1 addition & 1 deletion src/BizHawk.Bizware.Audio/BizHawk.Bizware.Audio.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFramework>net48</TargetFramework>
</PropertyGroup>
<Import Project="../MainSlnCommon.props" />
<PropertyGroup>
Expand Down
51 changes: 4 additions & 47 deletions src/BizHawk.Bizware.Audio/OpenALSoundOutput.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;

using BizHawk.Client.Common;
using BizHawk.Common;
Expand Down Expand Up @@ -85,53 +84,11 @@ public void Dispose()
_disposed = true;
}

private static unsafe IEnumerable<string> MarshalStringList(byte* stringList)
public static IEnumerable<string> GetDeviceNames()
{
var ret = new List<string>();
var curStr = stringList;
while (true)
{
var nextStr = curStr;
var len = 0;
while (*nextStr++ != 0)
{
len++;
}

var str = Encoding.UTF8.GetString(curStr, len);
if (str.Length == 0)
{
break;
}

ret.Add(str);
curStr = nextStr;
}

return ret;
}

public static unsafe IEnumerable<string> GetDeviceNames()
{
if (_enumAllExt != null)
{
var stringList = _enumAllExt.GetStringList(null, GetEnumerateAllContextStringList.AllDevicesSpecifier);
if (stringList != null)
{
return MarshalStringList(stringList);
}
}

if (_enumExt != null)
{
var stringList = _enumExt.GetStringList(null, GetEnumerationContextStringList.DeviceSpecifiers);
if (stringList != null)
{
return MarshalStringList(stringList);
}
}

return [ ];
return _enumAllExt?.GetStringList(GetEnumerateAllContextStringList.AllDevicesSpecifier)
?? _enumExt?.GetStringList(GetEnumerationContextStringList.DeviceSpecifiers)
?? [ ];
}

private int BufferSizeSamples { get; set; }
Expand Down
13 changes: 3 additions & 10 deletions src/BizHawk.Bizware.Graphics/D3D11/D3D11GLInterop.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Silk.NET.Core.Contexts;
using Silk.NET.OpenGL;
using Silk.NET.WGL;
using Silk.NET.WGL.Extensions.NV;

using Vortice.Direct3D;
Expand Down Expand Up @@ -123,17 +124,9 @@ static D3D11GLInterop()
return;
}

// note: Silk.NET's WGL.IsExtensionPresent function seems to be bugged and just results in NREs...
if (!WGL.GetApi().IsExtensionPresent("NV_DX_interop2")) return;

NVDXInterop = new(new LamdaNativeContext(SDL2OpenGLContext.GetGLProcAddress));
if (NVDXInterop.CurrentVTable.Load("wglDXOpenDeviceNV") == IntPtr.Zero
|| NVDXInterop.CurrentVTable.Load("wglDXCloseDeviceNV") == IntPtr.Zero
|| NVDXInterop.CurrentVTable.Load("wglDXRegisterObjectNV") == IntPtr.Zero
|| NVDXInterop.CurrentVTable.Load("wglDXUnregisterObjectNV") == IntPtr.Zero
|| NVDXInterop.CurrentVTable.Load("wglDXLockObjectsNV") == IntPtr.Zero
|| NVDXInterop.CurrentVTable.Load("wglDXUnlockObjectsNV") == IntPtr.Zero)
{
return;
}

var glVendor = GL.GetStringS(StringName.Vendor);
var vendor = Vendor.Unknown;
Expand Down
1 change: 1 addition & 0 deletions src/BizHawk.Client.Common/Api/Classes/UserDataApi.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Collections.Generic;
using System.Linq;

#if NET5_0_OR_GREATER
using KeyCollectionType = System.Collections.Generic.IReadOnlySet<string>;
Expand Down
2 changes: 1 addition & 1 deletion src/BizHawk.Client.Common/BizHawk.Client.Common.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework><!-- some NuGet packages aren't for Standard, and are only loaded at runtime because EmuHawk is still Framework. More work will be required to move to Core. -->
<TargetFramework>net48</TargetFramework>
</PropertyGroup>
<Import Project="../MainSlnCommon.props" />
<PropertyGroup>
Expand Down
2 changes: 0 additions & 2 deletions src/BizHawk.Client.EmuHawk/BizHawk.Client.EmuHawk.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@
<UseWindowsForms>true</UseWindowsForms>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="System.Net.Http" />
<Reference Include="PresentationFramework" />
<Reference Include="System.IO.Compression" />
</ItemGroup>
<ItemGroup>
<Reference Include="PcxFileTypePlugin.HawkQuantizer" HintPath="$(ProjectDir)../../References/PcxFileTypePlugin.HawkQuantizer.dll" Private="true" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFramework>net48</TargetFramework>
</PropertyGroup>
<Import Project="../MainSlnCommon.props" />
<PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/BizHawk.Emulation.Cores/BizHawk.Emulation.Cores.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFramework>net48</TargetFramework>
</PropertyGroup>
<Import Project="../MainSlnCommon.props" />
<PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/MainSlnCommon.props
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<DefineConstants>$(DefineConstants);AVI_SUPPORT;BIZHAWKBUILD_SUPERHAWK</DefineConstants>
<MeziantouPolyfill_ExcludedPolyfills>@(MeziantouPolyfill_DeferToPolySharp, '|')</MeziantouPolyfill_ExcludedPolyfills>
<NeutralLanguage>en-US</NeutralLanguage>
<NoWarn>$(NoWarn);CS1573;NU1702</NoWarn>
<NoWarn>$(NoWarn);CS1573</NoWarn>
<ProduceReferenceAssembly>true</ProduceReferenceAssembly> <!-- extra assemblies in obj containing only API surface, used to quickly check for changed projects -->
<Product>BizHawk</Product>
<ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>None</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
Expand Down