Skip to content
Draft
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
18 changes: 9 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ jobs:
matrix:
platform: [
{netversion: 6.x, targetframework: net6.0, aot: false, singleFile: true, aotString: ""},
{netversion: 8.x, targetframework: net8.0, aot: false, singleFile: true, aotString: ""},
{netversion: 8.x, targetframework: net8.0, aot: true, singleFile: false, aotString: " - AoT"}
{netversion: 10.x, targetframework: net10.0, aot: false, singleFile: true, aotString: ""},
{netversion: 10.x, targetframework: net10.0, aot: true, singleFile: false, aotString: " - AoT"}
]
fail-fast: false
runs-on: windows-latest
Expand Down Expand Up @@ -59,8 +59,8 @@ jobs:
matrix:
compiler: [gcc, clang, clang_aot]
platform: [
{os: ubuntu-22.04, path: x64},
{os: ubuntu-22.04-arm, path: arm64}
{os: ubuntu-24.04, path: x64},
{os: ubuntu-24.04-arm, path: arm64}
]
include:
- compiler: gcc
Expand All @@ -81,7 +81,7 @@ jobs:
- name: Install .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.x
dotnet-version: 10.x

- name: Install dependencies
run: |
Expand Down Expand Up @@ -111,8 +111,8 @@ jobs:
matrix:
compiler: [clang_appimage]
platform: [
{os: ubuntu-22.04, name: x64, script: Linux/appimage/appimage.sh},
{os: ubuntu-22.04-arm, name: ARM64, script: Linux/appimage/appimage-arm64.sh}
{os: ubuntu-24.04, name: x64, script: Linux/appimage/appimage.sh},
{os: ubuntu-24.04-arm, name: ARM64, script: Linux/appimage/appimage-arm64.sh}
]
runs-on: ${{ matrix.platform.os }}

Expand All @@ -125,7 +125,7 @@ jobs:
- name: Install .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.x
dotnet-version: 10.x

- name: Install dependencies
run: |
Expand Down Expand Up @@ -173,7 +173,7 @@ jobs:
- name: Install .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.x
dotnet-version: 10.x

- name: Install dependencies
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/dotnet-format-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
dotnet-version: 10.0.x
- name: Restore dependencies
run: dotnet restore
- name: Format
run: dotnet format --verify-no-changes --verbosity diagnostic
run: dotnet format --verify-no-changes --verbosity diagnostic
2 changes: 1 addition & 1 deletion Linux/appimage/appimage-arm64.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

export PUBLISHFLAGS="-r linux-arm64 --no-self-contained false -p:PublishSingleFile=true -p:PublishReadyToRun=true"
export PUBLISHFLAGS="-r linux-arm64 -p:PublishSingleFile=true -p:PublishReadyToRun=true"
make -j$(nproc) -O LTO=true STATICLINK=true SYSTEM_LIBEVDEV=false

curl -SL https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-aarch64.AppImage -o appimagetool
Expand Down
2 changes: 1 addition & 1 deletion Linux/appimage/appimage.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

export PUBLISHFLAGS="-r linux-x64 --no-self-contained false -p:PublishSingleFile=true -p:PublishReadyToRun=true"
export PUBLISHFLAGS="-r linux-x64 -p:PublishSingleFile=true -p:PublishReadyToRun=true"
make -j$(nproc) -O LTO=true STATICLINK=true SYSTEM_LIBEVDEV=false

curl -SL https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage -o appimagetool
Expand Down
4 changes: 2 additions & 2 deletions UI/Properties/PublishProfiles/Release.pubxml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<Platform>x64</Platform>
<PublishDir>../build/TmpReleaseBuild</PublishDir>
<PublishProtocol>FileSystem</PublishProtocol>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<PublishAot>true</PublishAot>
<OptimizeUi>true</OptimizeUi>
</PropertyGroup>
</Project>
</Project>
3 changes: 2 additions & 1 deletion UI/UI.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<Nullable>enable</Nullable>
<GenerateEmbeddedFilesManifest>true</GenerateEmbeddedFilesManifest>
Expand Down Expand Up @@ -120,6 +120,7 @@
<PackageReference Include="Dotnet.Bundle" Version="*" />
<PackageReference Include="ELFSharp" Version="2.17.3" />
<PackageReference Include="ReactiveUI.Fody" Version="19.5.41" />
<PackageReference Include="Tmds.DBus.Protocol" Version="0.21.3" />
</ItemGroup>
<ItemGroup>
<Compile Update="Controls\ButtonWithIcon.axaml.cs">
Expand Down
4 changes: 3 additions & 1 deletion UI/Utilities/EnumExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Reflection;
using System.Text;
Expand All @@ -9,9 +10,10 @@ namespace Mesen.Utilities
{
public static class EnumExtensions
{
[UnconditionalSuppressMessage("Trimming", "IL2075", Justification = "Fields are not trimmed for enum types")]
public static T? GetAttribute<T>(this Enum val) where T : Attribute
{
return val.GetType().GetMember(val.ToString())[0].GetCustomAttribute<T>();
return val.GetType().GetField(val.ToString(), BindingFlags.Public | BindingFlags.Static)!.GetCustomAttribute<T>();
}
}
}
2 changes: 1 addition & 1 deletion UI/Utilities/LoadRomHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ private static bool IsPatchFile(string filename)
using(FileStream? stream = FileHelper.OpenRead(filename)) {
if(stream != null) {
byte[] header = new byte[5];
stream.Read(header, 0, 5);
stream.ReadExactly(header);
if(header[0] == 'P' && header[1] == 'A' && header[2] == 'T' && header[3] == 'C' && header[4] == 'H') {
return true;
} else if((header[0] == 'U' || header[0] == 'B') && header[1] == 'P' && header[2] == 'S' && header[3] == '1') {
Expand Down
9 changes: 5 additions & 4 deletions UI/Utilities/ReactiveHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,19 @@
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics.CodeAnalysis;
using System.Reflection;

namespace Mesen.Utilities
{
public static class ReactiveHelper
{
public static IDisposable RegisterRecursiveObserver(ReactiveObject target, PropertyChangedEventHandler handler)
public static IDisposable RegisterRecursiveObserver<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties)] T>(T target, PropertyChangedEventHandler handler) where T : ReactiveObject
{
Dictionary<string, ReactiveObject> observableObjects = new();
Dictionary<string, PropertyInfo> props = new();

foreach(PropertyInfo prop in target.GetType().GetProperties(BindingFlags.Instance | BindingFlags.Public)) {
foreach(PropertyInfo prop in typeof(T).GetProperties(BindingFlags.Instance | BindingFlags.Public)) {
if(prop.GetCustomAttribute<ReactiveAttribute>() != null) {
object? value = prop.GetValue(target);
if(value is ReactiveObject propValue) {
Expand Down Expand Up @@ -55,9 +56,9 @@ public static IDisposable RegisterRecursiveObserver(ReactiveObject target, Prope
return new RecursiveObserver(target, handler);
}

public static void UnregisterRecursiveObserver(ReactiveObject target, PropertyChangedEventHandler handler)
public static void UnregisterRecursiveObserver<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties)] T>(T target, PropertyChangedEventHandler handler) where T : ReactiveObject
{
foreach(PropertyInfo prop in target.GetType().GetProperties(BindingFlags.Instance | BindingFlags.Public)) {
foreach(PropertyInfo prop in typeof(T).GetProperties(BindingFlags.Instance | BindingFlags.Public)) {
if(prop.GetCustomAttribute<ReactiveAttribute>() != null) {
object? value = prop.GetValue(target);
if(value is ReactiveObject propValue) {
Expand Down
2 changes: 2 additions & 0 deletions UI/ViewModels/ViewModelBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;

namespace Mesen.ViewModels
{
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties)]
public class ViewModelBase : ReactiveObject
{
}
Expand Down
4 changes: 2 additions & 2 deletions UI/global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"rollForward": "latestFeature",
"version": "8.0.0"
"version": "10.0.0"
}
}
}
2 changes: 1 addition & 1 deletion makefile
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ endif
ifeq ($(USE_AOT),true)
PUBLISHFLAGS ?= -r $(MESENPLATFORM) -p:PublishSingleFile=false -p:PublishAot=true -p:SelfContained=true
else
PUBLISHFLAGS ?= -r $(MESENPLATFORM) --no-self-contained true -p:PublishSingleFile=true
PUBLISHFLAGS ?= -r $(MESENPLATFORM) --no-self-contained -p:PublishSingleFile=true
endif


Expand Down
Loading