Upgrade to .NET 8

Added a separate .NET 6 Windows build because .NET 8 is not available on Windows 7/8
This commit is contained in:
Sour 2024-05-24 23:08:43 +09:00
parent a6ce34bdd8
commit 829c671d6a
7 changed files with 64 additions and 62 deletions

View file

@ -3,14 +3,17 @@ name: Build Mesen
on: [push] on: [push]
env: env:
# I'm not a fan of the telemetry as-is, but this also suppresses some lines in the build log.
DOTNET_CLI_TELEMETRY_OPTOUT: 1 DOTNET_CLI_TELEMETRY_OPTOUT: 1
# This removes even more spurious lines.
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
jobs: jobs:
windows: windows:
strategy: strategy:
matrix:
platform: [
{netversion: 6.x, targetframework: net6.0},
{netversion: 8.x, targetframework: net8.0}
]
fail-fast: false fail-fast: false
runs-on: windows-latest runs-on: windows-latest
@ -23,26 +26,26 @@ jobs:
- name: Install .NET Core - name: Install .NET Core
uses: actions/setup-dotnet@v3 uses: actions/setup-dotnet@v3
with: with:
dotnet-version: 6.x dotnet-version: ${{ matrix.platform.netversion }}
- name: Setup MSBuild.exe - name: Setup MSBuild.exe
uses: microsoft/setup-msbuild@v1.1 uses: microsoft/setup-msbuild@v1.1
with: with:
msbuild-architecture: x64 msbuild-architecture: x64
- name: Execute unit tests - name: Restore packages
run: dotnet test -nologo run: dotnet restore /p:TargetFramework="${{ matrix.platform.targetframework }}"
- name: Build Mesen - name: Build Mesen
run: msbuild -nologo -v:d -clp:ForceConsoleColor -m -p:Configuration=Release -p:Platform=x64 -t:Clean,UI run: msbuild -nologo -v:d -clp:ForceConsoleColor -m -p:Configuration=Release -p:Platform=x64 -t:Clean,UI /p:TargetFramework="${{ matrix.platform.targetframework }}"
- name: Publish Mesen - name: Publish Mesen
run: dotnet publish -nologo -c Release /p:Platform="Any CPU" /p:OptimizeUi="true" Mesen.sln /p:PublishProfile=UI\Properties\PublishProfiles\Release.pubxml run: dotnet publish -nologo --no-restore -c Release /p:Platform="Any CPU" /p:OptimizeUi="true" /p:TargetFramework="${{ matrix.platform.targetframework }}" Mesen.sln /p:PublishProfile=UI\Properties\PublishProfiles\Release.pubxml
- name: Upload Mesen - name: Upload Mesen
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
name: Mesen (Windows) name: Mesen (Windows - ${{ matrix.platform.targetframework }})
path: | path: |
build/TmpReleaseBuild/Mesen.exe build/TmpReleaseBuild/Mesen.exe
@ -73,16 +76,13 @@ jobs:
- name: Install .NET Core - name: Install .NET Core
uses: actions/setup-dotnet@v3 uses: actions/setup-dotnet@v3
with: with:
dotnet-version: 6.x dotnet-version: 8.x
- name: Install dependencies - name: Install dependencies
run: | run: |
sudo apt-get update -qy sudo apt-get update -qy
sudo apt-get install -qy libsdl2-dev # The compilers are already installed on GitHub's runners. sudo apt-get install -qy libsdl2-dev # The compilers are already installed on GitHub's runners.
- name: Execute unit tests
run: dotnet test --nologo
# stderr is not detected as a TTY, so diagnostics are by default printed without colours; # stderr is not detected as a TTY, so diagnostics are by default printed without colours;
# forcing colours makes the log a little nicer to read. # forcing colours makes the log a little nicer to read.
- name: Build Mesen - name: Build Mesen
@ -107,7 +107,7 @@ jobs:
- name: Install .NET Core - name: Install .NET Core
uses: actions/setup-dotnet@v3 uses: actions/setup-dotnet@v3
with: with:
dotnet-version: 6.x dotnet-version: 8.x
- name: Install dependencies - name: Install dependencies
run: | run: |
@ -144,15 +144,12 @@ jobs:
- name: Install .NET Core - name: Install .NET Core
uses: actions/setup-dotnet@v3 uses: actions/setup-dotnet@v3
with: with:
dotnet-version: 6.x dotnet-version: 8.x
- name: Install dependencies - name: Install dependencies
run: | run: |
brew install sdl2 brew install sdl2
- name: Execute unit tests
run: dotnet test --nologo
# stderr is not detected as a TTY, so diagnostics are by default printed without colours; # stderr is not detected as a TTY, so diagnostics are by default printed without colours;
# forcing colours makes the log a little nicer to read. # forcing colours makes the log a little nicer to read.
- name: Build Mesen - name: Build Mesen

View file

@ -1,6 +1,6 @@
# Mesen # Mesen
Mesen is a multi-system emulator (NES, SNES, Game Boy, PC Engine, Master System/Game Gear) for Windows, Linux and macOS built in C++ and C#. Mesen is a multi-system emulator (NES, SNES, Game Boy, Game Boy Advance, PC Engine, Master System/Game Gear) for Windows, Linux and macOS built in C++ and C#.
## Development Builds ## Development Builds
@ -8,47 +8,27 @@ Mesen is a multi-system emulator (NES, SNES, Game Boy, PC Engine, Master System/
Latest development builds: Latest development builds:
* [Windows](https://nightly.link/SourMesen/Mesen2/workflows/build/master/Mesen%20%28Windows%29.zip) * [Windows 10 / 11 (.NET 8)](https://nightly.link/SourMesen/Mesen2/workflows/build/master/Mesen%20%28Windows%20-%20net8.0%29.zip)
* [Windows 7 / 8 (.NET 6)](https://nightly.link/SourMesen/Mesen2/workflows/build/master/Mesen%20%28Windows%20-%20net6.0%29.zip)
* [macOS - Intel](https://nightly.link/SourMesen/Mesen2/workflows/build/master/Mesen%20%28macOS%20-%20macos-12%29.zip) * [macOS - Intel](https://nightly.link/SourMesen/Mesen2/workflows/build/master/Mesen%20%28macOS%20-%20macos-12%29.zip)
* [macOS - Apple Silicon](https://nightly.link/SourMesen/Mesen2/workflows/build/master/Mesen%20%28macOS%20-%20macos-14%29.zip) * [macOS - Apple Silicon](https://nightly.link/SourMesen/Mesen2/workflows/build/master/Mesen%20%28macOS%20-%20macos-14%29.zip)
* [Linux](https://nightly.link/SourMesen/Mesen2/workflows/build/master/Mesen%20%28Linux%20-%20ubuntu-20.04%20-%20clang%29.zip) * [Linux](https://nightly.link/SourMesen/Mesen2/workflows/build/master/Mesen%20%28Linux%20-%20ubuntu-20.04%20-%20clang%29.zip)
* [Linux - AppImage](https://nightly.link/SourMesen/Mesen2/workflows/build/master/Mesen%20(Linux%20x64%20-%20AppImage).zip) * [Linux - AppImage](https://nightly.link/SourMesen/Mesen2/workflows/build/master/Mesen%20(Linux%20x64%20-%20AppImage).zip)
#### Notes / limitations
**macOS**: The macOS build still has a number of limitations (e.g no gamepad support). **macOS**: The macOS build still has a number of limitations (e.g no gamepad support).
**SteamOS**: Running Mesen through the Steam Deck's _Game Mode_ is possible with some caveats regarding rendering the UI. **SteamOS**: See [SteamOS.md](SteamOS.md)
<details>
<summary>SteamOS instructions and caveats</summary>
<br>
Due to Gamescope (SteamOS' compositor) not handling Avalonia UI's popups very well (a [solution](https://github.com/AvaloniaUI/Avalonia/pull/14366) is available but [has been reverted due to other issues](https://github.com/AvaloniaUI/Avalonia/pull/14573)), Mesen's menus for settings are not working through Gamescope unless running Mesen [through running KDE Plasma's Desktop through a script](https://www.reddit.com/r/SteamDeck/comments/zqgx9g/desktop_mode_within_gaming_mode_updated_for_new/).
Installation instructions:
* Download the **[Linux - AppImage](https://nightly.link/SourMesen/Mesen2/workflows/build/master/Mesen%20(Linux%20x64%20-%20AppImage).zip)** nightly build.
* **Mark the AppImage as executable.** (right click > Properties > Permissions > Is executable)
* Add the application as a non-Steam shortcut to be able to run it through Steam on both _Desktop Mode_ and _Game Mode_. (right click > Add to Steam)
* Customise the non-Steam shortcut through Steam to your desire. (in Steam: search the AppImage's filename, right click > Properties; from there you can change the icon, shortcut name and launch options)
* Create a folder called `Mesen.AppImage.Config` in the same directory where the AppImage is stored.
* Run it the first time. When asking where to store the settings, choose the `Store the data in my user profile` option. ![254295455-88c1942d-b81f-48ee-a3a3-74b9f3ecd9b7-1](https://github.com/kevin-wijnen/Mesen2/assets/58944808/9f4ff1e3-4df6-4441-958b-ce96599ef69d)
* Set up the controls as asked by Mesen.
**Due to Gamescope not rendering the UI menus, it is recommended to bind some keyboard shortcuts to L4/R4/L5/R5 (the Back Grip Buttons).** You can rebind controls in _Game Mode_ by clicking the Controller icon. You can save the layout by clicking the Cog icon (next to `Edit Layout`) > Export Layout > select `New Template` as the Export Type to use it across multiple shortcuts.
It is recommended to:
* Bind `Control Key + O Key` to open the file picker for opening a game file.
* Bind `Escape Key` to pause emulation.
* Bind `F11` to enter in or out of fullscreen.
**If sound does not work**, check if an audio device is chosen by Mesen. (in Mesen: Settings > Audio > General (Device))
**To make game-specific shortcuts**: Repeat the non-Steam shortcut step on the Mesen AppImage. Customise the new shortcut with a Launch Option (in Steam: right click > Properties; Launch Options). To find possible Launch Options, check the Command-line options menu (in Mesen: Help > Command-line options). When you want to supply a game with the shortcut, put the entire file location of the game in double quotes ("game-filepath") as the first part of the launch options. Add additional options (`--fullscreen` for example) _after_ the file location.
</details>
## Requirements ## Requirements
To run Mesen, the following prerequisites must be installed: To run Mesen, the following prerequisites must be installed:
**Windows**: [.NET 6 Runtime](https://dotnet.microsoft.com/en-us/download/dotnet/6.0) **Windows 10 / 11**: [.NET 8 Runtime](https://dotnet.microsoft.com/en-us/download/dotnet/8.0)
**Linux**: [.NET 6 Runtime](https://dotnet.microsoft.com/en-us/download/dotnet/6.0), SDL2 **Windows 7 / 8**: [.NET 6 Runtime](https://dotnet.microsoft.com/en-us/download/dotnet/6.0) (.NET 8 is not supported on Windows 7 / 8)
**macOS**: [.NET 6 Runtime](https://dotnet.microsoft.com/en-us/download/dotnet/6.0), SDL2 **Linux**: [.NET 8 Runtime](https://dotnet.microsoft.com/en-us/download/dotnet/8.0), SDL2
**macOS**: [.NET 8 Runtime](https://dotnet.microsoft.com/en-us/download/dotnet/8.0), SDL2
## Compiling ## Compiling
@ -58,7 +38,7 @@ See [COMPILING.md](COMPILING.md)
Mesen is available under the GPL V3 license. Full text here: <http://www.gnu.org/licenses/gpl-3.0.en.html> Mesen is available under the GPL V3 license. Full text here: <http://www.gnu.org/licenses/gpl-3.0.en.html>
Copyright (C) 2023 Sour Copyright (C) 2014-2024 Sour
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by

21
SteamOS.md Normal file
View file

@ -0,0 +1,21 @@
Running Mesen through the Steam Deck's _Game Mode_ is possible with some caveats regarding rendering the UI.
Due to Gamescope (SteamOS' compositor) not handling Avalonia UI's popups very well (a [solution](https://github.com/AvaloniaUI/Avalonia/pull/14366) is available but [has been reverted due to other issues](https://github.com/AvaloniaUI/Avalonia/pull/14573)), Mesen's menus for settings are not working through Gamescope unless running Mesen [through running KDE Plasma's Desktop through a script](https://www.reddit.com/r/SteamDeck/comments/zqgx9g/desktop_mode_within_gaming_mode_updated_for_new/).
Installation instructions:
* Download the **[Linux - AppImage](https://nightly.link/SourMesen/Mesen2/workflows/build/master/Mesen%20(Linux%20x64%20-%20AppImage).zip)** nightly build.
* **Mark the AppImage as executable.** (right click > Properties > Permissions > Is executable)
* Add the application as a non-Steam shortcut to be able to run it through Steam on both _Desktop Mode_ and _Game Mode_. (right click > Add to Steam)
* Customise the non-Steam shortcut through Steam to your desire. (in Steam: search the AppImage's filename, right click > Properties; from there you can change the icon, shortcut name and launch options)
* Create a folder called `Mesen.AppImage.Config` in the same directory where the AppImage is stored.
* Run it the first time. When asking where to store the settings, choose the `Store the data in my user profile` option. ![254295455-88c1942d-b81f-48ee-a3a3-74b9f3ecd9b7-1](https://github.com/kevin-wijnen/Mesen2/assets/58944808/9f4ff1e3-4df6-4441-958b-ce96599ef69d)
* Set up the controls as asked by Mesen.
**Due to Gamescope not rendering the UI menus, it is recommended to bind some keyboard shortcuts to L4/R4/L5/R5 (the Back Grip Buttons).** You can rebind controls in _Game Mode_ by clicking the Controller icon. You can save the layout by clicking the Cog icon (next to `Edit Layout`) > Export Layout > select `New Template` as the Export Type to use it across multiple shortcuts.
It is recommended to:
* Bind `Control Key + O Key` to open the file picker for opening a game file.
* Bind `Escape Key` to pause emulation.
* Bind `F11` to enter in or out of fullscreen.
**If sound does not work**, check if an audio device is chosen by Mesen. (in Mesen: Settings > Audio > General (Device))
**To make game-specific shortcuts**: Repeat the non-Steam shortcut step on the Mesen AppImage. Customise the new shortcut with a Launch Option (in Steam: right click > Properties; Launch Options). To find possible Launch Options, check the Command-line options menu (in Mesen: Help > Command-line options). When you want to supply a game with the shortcut, put the entire file location of the game in double quotes ("game-filepath") as the first part of the launch options. Add additional options (`--fullscreen` for example) _after_ the file location.

View file

@ -710,6 +710,7 @@
<Control ID="lblLink">www.mesen.ca</Control> <Control ID="lblLink">www.mesen.ca</Control>
<Control ID="lblVersion">Version:</Control> <Control ID="lblVersion">Version:</Control>
<Control ID="lblBuildDate">Build Date:</Control> <Control ID="lblBuildDate">Build Date:</Control>
<Control ID="lblRuntimeVersion">Runtime:</Control>
<Control ID="grpAcknowledgements">Acknowledgements</Control> <Control ID="grpAcknowledgements">Acknowledgements</Control>
<Control ID="lblAcknowledgeList">Thank you to the following people/projects for their direct and indirect help in making Mesen possible:</Control> <Control ID="lblAcknowledgeList">Thank you to the following people/projects for their direct and indirect help in making Mesen possible:</Control>

View file

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<OutputType>WinExe</OutputType> <OutputType>WinExe</OutputType>
<TargetFramework>net6.0</TargetFramework> <TargetFramework>net8.0</TargetFramework>
<RuntimeIdentifier>win-x64</RuntimeIdentifier> <RuntimeIdentifier>win-x64</RuntimeIdentifier>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<GenerateEmbeddedFilesManifest>true</GenerateEmbeddedFilesManifest> <GenerateEmbeddedFilesManifest>true</GenerateEmbeddedFilesManifest>

View file

@ -64,6 +64,10 @@
<TextBlock Text="{l:Translate lblBuildDate}" Margin="0 0 5 0" /> <TextBlock Text="{l:Translate lblBuildDate}" Margin="0 0 5 0" />
<TextBlock Text="{CompiledBinding BuildDate, ElementName=root}" /> <TextBlock Text="{CompiledBinding BuildDate, ElementName=root}" />
</StackPanel> </StackPanel>
<StackPanel Orientation="Horizontal" Margin="3">
<TextBlock Text="{l:Translate lblRuntimeVersion}" Margin="0 0 5 0" />
<TextBlock Text="{CompiledBinding RuntimeVersion, ElementName=root}" />
</StackPanel>
<TextBlock Name="lblCopyright" Margin="3" /> <TextBlock Name="lblCopyright" Margin="3" />
<StackPanel Orientation="Horizontal" Margin="3"> <StackPanel Orientation="Horizontal" Margin="3">
<TextBlock Text="{l:Translate lblWebsite}" Margin="0 0 5 0" /> <TextBlock Text="{l:Translate lblWebsite}" Margin="0 0 5 0" />
@ -83,8 +87,8 @@
</StackPanel> </StackPanel>
<c:GroupBox Header="{l:Translate grpAcknowledgements}" Margin="5 5 5 0"> <c:GroupBox Header="{l:Translate grpAcknowledgements}" Margin="5 5 5 0">
<ScrollViewer AllowAutoHide="True"> <DockPanel>
<StackPanel> <StackPanel DockPanel.Dock="Top">
<TextBlock Text="{l:Translate lblAcknowledgeList}" Margin="0 5 0 5" TextWrapping="Wrap" /> <TextBlock Text="{l:Translate lblAcknowledgeList}" Margin="0 5 0 5" TextWrapping="Wrap" />
<Border BorderBrush="Gray" BorderThickness="1"> <Border BorderBrush="Gray" BorderThickness="1">
<ListBox <ListBox
@ -93,20 +97,17 @@
ScrollViewer.AllowAutoHide="False" ScrollViewer.AllowAutoHide="False"
/> />
</Border> </Border>
<TextBlock Text="{l:Translate lblSpecialThanks}" Margin="0 5 0 5" TextWrapping="Wrap" /> <TextBlock Text="{l:Translate lblSpecialThanks}" Margin="0 5 0 5" TextWrapping="Wrap" />
<TextBlock Text="{l:Translate lblUsedSoftware}" Margin="0 15 0 5" /> <TextBlock Text="{l:Translate lblUsedSoftware}" Margin="0 15 0 5" />
</StackPanel>
<Border BorderBrush="Gray" BorderThickness="1"> <Border BorderBrush="Gray" BorderThickness="1">
<ListBox <ListBox
ItemsSource="{CompiledBinding LibraryList, ElementName=root}" ItemsSource="{CompiledBinding LibraryList, ElementName=root}"
Height="130"
Background="Transparent" Background="Transparent"
ScrollViewer.AllowAutoHide="False"
/> />
</Border> </Border>
</StackPanel> </DockPanel>
</ScrollViewer>
</c:GroupBox> </c:GroupBox>
</DockPanel> </DockPanel>

View file

@ -33,6 +33,7 @@ namespace Mesen.Windows
public string Version { get; } public string Version { get; }
public string BuildDate { get; } public string BuildDate { get; }
public string RuntimeVersion { get; }
public List<AboutListEntry> LibraryList { get; } public List<AboutListEntry> LibraryList { get; }
public List<AboutListEntry> AcknowledgeList { get; } public List<AboutListEntry> AcknowledgeList { get; }
@ -40,6 +41,7 @@ namespace Mesen.Windows
{ {
Version = EmuApi.GetMesenVersion().ToString(); Version = EmuApi.GetMesenVersion().ToString();
BuildDate = EmuApi.GetMesenBuildDate(); BuildDate = EmuApi.GetMesenBuildDate();
RuntimeVersion = ".NET " + Environment.Version;
LibraryList = new List<AboutListEntry>() { LibraryList = new List<AboutListEntry>() {
new("Avalonia", "", "MIT", "https://github.com/AvaloniaUI/Avalonia"), new("Avalonia", "", "MIT", "https://github.com/AvaloniaUI/Avalonia"),