Compare commits
5 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
36f10df775 | ||
|
680e548022 | ||
|
21c4176157 | ||
|
3b4ff2d6d9 | ||
|
12504f280c |
@@ -44,7 +44,7 @@
|
|||||||
<PackageVersion Include="SixLabors.ImageSharp.Drawing" Version="1.0.0-beta11" />
|
<PackageVersion Include="SixLabors.ImageSharp.Drawing" Version="1.0.0-beta11" />
|
||||||
<PackageVersion Include="SPB" Version="0.0.4-build28" />
|
<PackageVersion Include="SPB" Version="0.0.4-build28" />
|
||||||
<PackageVersion Include="System.Drawing.Common" Version="7.0.0" />
|
<PackageVersion Include="System.Drawing.Common" Version="7.0.0" />
|
||||||
<PackageVersion Include="System.IdentityModel.Tokens.Jwt" Version="6.29.0" />
|
<PackageVersion Include="System.IdentityModel.Tokens.Jwt" Version="6.30.0" />
|
||||||
<PackageVersion Include="System.IO.Hashing" Version="7.0.0" />
|
<PackageVersion Include="System.IO.Hashing" Version="7.0.0" />
|
||||||
<PackageVersion Include="System.Management" Version="7.0.1" />
|
<PackageVersion Include="System.Management" Version="7.0.1" />
|
||||||
<PackageVersion Include="UnicornEngine.Unicorn" Version="2.0.2-rc1-fb78016" />
|
<PackageVersion Include="UnicornEngine.Unicorn" Version="2.0.2-rc1-fb78016" />
|
||||||
|
@@ -41,12 +41,10 @@ then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# NOTE: Currently require https://github.com/indygreg/apple-platform-rs/pull/44 to work on other OSes.
|
# cargo install apple-codesign
|
||||||
# cargo install --git "https://github.com/marysaka/apple-platform-rs" --branch "fix/adhoc-app-bundle" apple-codesign --bin "rcodesign"
|
|
||||||
echo "Usign rcodesign for ad-hoc signing"
|
echo "Usign rcodesign for ad-hoc signing"
|
||||||
rcodesign sign --entitlements-xml-path "$ENTITLEMENTS_FILE_PATH" "$APP_BUNDLE_DIRECTORY"
|
rcodesign sign --entitlements-xml-path "$ENTITLEMENTS_FILE_PATH" "$APP_BUNDLE_DIRECTORY"
|
||||||
else
|
else
|
||||||
echo "Usign codesign for ad-hoc signing"
|
echo "Usign codesign for ad-hoc signing"
|
||||||
codesign --entitlements "$ENTITLEMENTS_FILE_PATH" -f --deep -s - "$APP_BUNDLE_DIRECTORY"
|
codesign --entitlements "$ENTITLEMENTS_FILE_PATH" -f --deep -s - "$APP_BUNDLE_DIRECTORY"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@@ -30,14 +30,14 @@ mkdir -p "$TEMP_DIRECTORY"
|
|||||||
DOTNET_COMMON_ARGS="-p:DebugType=embedded -p:Version=$VERSION -p:SourceRevisionId=$SOURCE_REVISION_ID --self-contained true"
|
DOTNET_COMMON_ARGS="-p:DebugType=embedded -p:Version=$VERSION -p:SourceRevisionId=$SOURCE_REVISION_ID --self-contained true"
|
||||||
|
|
||||||
dotnet restore
|
dotnet restore
|
||||||
dotnet build -c Release Ryujinx.Ava
|
dotnet build -c Release src/Ryujinx.Ava
|
||||||
dotnet publish -c Release -r osx-arm64 -o "$TEMP_DIRECTORY/publish_arm64" $DOTNET_COMMON_ARGS Ryujinx.Ava
|
dotnet publish -c Release -r osx-arm64 -o "$TEMP_DIRECTORY/publish_arm64" $DOTNET_COMMON_ARGS src/Ryujinx.Ava
|
||||||
dotnet publish -c Release -r osx-x64 -o "$TEMP_DIRECTORY/publish_x64" $DOTNET_COMMON_ARGS Ryujinx.Ava
|
dotnet publish -c Release -r osx-x64 -o "$TEMP_DIRECTORY/publish_x64" $DOTNET_COMMON_ARGS src/Ryujinx.Ava
|
||||||
|
|
||||||
# Get ride of the support library for ARMeilleur for x64 (that's only for arm64)
|
# Get rid of the support library for ARMeilleure for x64 (that's only for arm64)
|
||||||
rm -rf "$TEMP_DIRECTORY/publish_x64/libarmeilleure-jitsupport.dylib"
|
rm -rf "$TEMP_DIRECTORY/publish_x64/libarmeilleure-jitsupport.dylib"
|
||||||
|
|
||||||
# Get ride of libsoundio from arm64 builds as we don't have a arm64 variant
|
# Get rid of libsoundio from arm64 builds as we don't have a arm64 variant
|
||||||
# TODO: remove this once done
|
# TODO: remove this once done
|
||||||
rm -rf "$TEMP_DIRECTORY/publish_arm64/libsoundio.dylib"
|
rm -rf "$TEMP_DIRECTORY/publish_arm64/libsoundio.dylib"
|
||||||
|
|
||||||
|
@@ -95,6 +95,9 @@ namespace Ryujinx.Ava.UI.ViewModels
|
|||||||
private string _currentEmulatedGamePath;
|
private string _currentEmulatedGamePath;
|
||||||
private AutoResetEvent _rendererWaitEvent;
|
private AutoResetEvent _rendererWaitEvent;
|
||||||
private WindowState _windowState;
|
private WindowState _windowState;
|
||||||
|
private double _windowWidth;
|
||||||
|
private double _windowHeight;
|
||||||
|
|
||||||
private bool _isActive;
|
private bool _isActive;
|
||||||
|
|
||||||
public ApplicationData ListSelectedApplication;
|
public ApplicationData ListSelectedApplication;
|
||||||
@@ -623,6 +626,28 @@ namespace Ryujinx.Ava.UI.ViewModels
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public double WindowWidth
|
||||||
|
{
|
||||||
|
get => _windowWidth;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_windowWidth = value;
|
||||||
|
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public double WindowHeight
|
||||||
|
{
|
||||||
|
get => _windowHeight;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_windowHeight = value;
|
||||||
|
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public bool IsGrid => Glyph == Glyph.Grid;
|
public bool IsGrid => Glyph == Glyph.Grid;
|
||||||
public bool IsList => Glyph == Glyph.List;
|
public bool IsList => Glyph == Glyph.List;
|
||||||
|
|
||||||
|
@@ -12,15 +12,14 @@
|
|||||||
Cursor="{Binding Cursor}"
|
Cursor="{Binding Cursor}"
|
||||||
Title="{Binding Title}"
|
Title="{Binding Title}"
|
||||||
WindowState="{Binding WindowState}"
|
WindowState="{Binding WindowState}"
|
||||||
Width="1280"
|
Width="{Binding WindowWidth}"
|
||||||
Height="777"
|
Height="{Binding WindowHeight}"
|
||||||
MinWidth="1092"
|
MinWidth="1092"
|
||||||
MinHeight="672"
|
MinHeight="672"
|
||||||
d:DesignHeight="720"
|
d:DesignHeight="720"
|
||||||
d:DesignWidth="1280"
|
d:DesignWidth="1280"
|
||||||
x:CompileBindings="True"
|
x:CompileBindings="True"
|
||||||
x:DataType="viewModels:MainWindowViewModel"
|
x:DataType="viewModels:MainWindowViewModel"
|
||||||
WindowStartupLocation="CenterScreen"
|
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
Focusable="True">
|
Focusable="True">
|
||||||
<Window.Styles>
|
<Window.Styles>
|
||||||
|
@@ -62,6 +62,8 @@ namespace Ryujinx.Ava.UI.Windows
|
|||||||
|
|
||||||
DataContext = ViewModel;
|
DataContext = ViewModel;
|
||||||
|
|
||||||
|
SetWindowSizePosition();
|
||||||
|
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
Load();
|
Load();
|
||||||
|
|
||||||
@@ -297,6 +299,51 @@ namespace Ryujinx.Ava.UI.Windows
|
|||||||
LoadHotKeys();
|
LoadHotKeys();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void SetWindowSizePosition()
|
||||||
|
{
|
||||||
|
PixelPoint SavedPoint = new PixelPoint(ConfigurationState.Instance.Ui.WindowStartup.WindowPositionX,
|
||||||
|
ConfigurationState.Instance.Ui.WindowStartup.WindowPositionY);
|
||||||
|
|
||||||
|
ViewModel.WindowHeight = ConfigurationState.Instance.Ui.WindowStartup.WindowSizeHeight * Program.WindowScaleFactor;
|
||||||
|
ViewModel.WindowWidth = ConfigurationState.Instance.Ui.WindowStartup.WindowSizeWidth * Program.WindowScaleFactor;
|
||||||
|
|
||||||
|
ViewModel.WindowState = ConfigurationState.Instance.Ui.WindowStartup.WindowMaximized.Value is true ? WindowState.Maximized : WindowState.Normal;
|
||||||
|
|
||||||
|
if (CheckScreenBounds(SavedPoint))
|
||||||
|
{
|
||||||
|
Position = SavedPoint;
|
||||||
|
}
|
||||||
|
|
||||||
|
else WindowStartupLocation = WindowStartupLocation.CenterScreen;
|
||||||
|
}
|
||||||
|
|
||||||
|
private bool CheckScreenBounds(PixelPoint configPoint)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < Screens.ScreenCount; i++)
|
||||||
|
{
|
||||||
|
if (Screens.All[i].Bounds.Contains(configPoint))
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Logger.Warning?.Print(LogClass.Application, $"Failed to find valid start-up coordinates. Defaulting to primary monitor center.");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SaveWindowSizePosition()
|
||||||
|
{
|
||||||
|
ConfigurationState.Instance.Ui.WindowStartup.WindowSizeHeight.Value = (int)Height;
|
||||||
|
ConfigurationState.Instance.Ui.WindowStartup.WindowSizeWidth.Value = (int)Width;
|
||||||
|
|
||||||
|
ConfigurationState.Instance.Ui.WindowStartup.WindowPositionX.Value = Position.X;
|
||||||
|
ConfigurationState.Instance.Ui.WindowStartup.WindowPositionY.Value = Position.Y;
|
||||||
|
|
||||||
|
ConfigurationState.Instance.Ui.WindowStartup.WindowMaximized.Value = WindowState == WindowState.Maximized;
|
||||||
|
|
||||||
|
MainWindowViewModel.SaveConfig();
|
||||||
|
}
|
||||||
|
|
||||||
protected override void OnOpened(EventArgs e)
|
protected override void OnOpened(EventArgs e)
|
||||||
{
|
{
|
||||||
base.OnOpened(e);
|
base.OnOpened(e);
|
||||||
@@ -388,6 +435,8 @@ namespace Ryujinx.Ava.UI.Windows
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SaveWindowSizePosition();
|
||||||
|
|
||||||
ApplicationLibrary.CancelLoading();
|
ApplicationLibrary.CancelLoading();
|
||||||
InputManager.Dispose();
|
InputManager.Dispose();
|
||||||
Program.Exit();
|
Program.Exit();
|
||||||
|
@@ -252,6 +252,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.GPFifo
|
|||||||
public void Interrupt()
|
public void Interrupt()
|
||||||
{
|
{
|
||||||
_interrupt = true;
|
_interrupt = true;
|
||||||
|
_event.Set();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@@ -1610,6 +1610,8 @@ namespace Ryujinx.Graphics.Gpu.Image
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public void UpdatePoolMappings()
|
public void UpdatePoolMappings()
|
||||||
{
|
{
|
||||||
|
ChangedMapping = true;
|
||||||
|
|
||||||
lock (_poolOwners)
|
lock (_poolOwners)
|
||||||
{
|
{
|
||||||
ulong address = 0;
|
ulong address = 0;
|
||||||
@@ -1685,8 +1687,6 @@ namespace Ryujinx.Graphics.Gpu.Image
|
|||||||
{
|
{
|
||||||
Group.ClearModified(unmapRange);
|
Group.ClearModified(unmapRange);
|
||||||
}
|
}
|
||||||
|
|
||||||
UpdatePoolMappings();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@@ -64,7 +64,7 @@ namespace Ryujinx.Graphics.Gpu.Image
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Handles removal of textures written to a memory region being unmapped.
|
/// Handles marking of textures written to a memory region being (partially) remapped.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="sender">Sender object</param>
|
/// <param name="sender">Sender object</param>
|
||||||
/// <param name="e">Event arguments</param>
|
/// <param name="e">Event arguments</param>
|
||||||
@@ -80,26 +80,41 @@ namespace Ryujinx.Graphics.Gpu.Image
|
|||||||
overlapCount = _textures.FindOverlaps(unmapped, ref overlaps);
|
overlapCount = _textures.FindOverlaps(unmapped, ref overlaps);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (overlapCount > 0)
|
||||||
|
{
|
||||||
for (int i = 0; i < overlapCount; i++)
|
for (int i = 0; i < overlapCount; i++)
|
||||||
{
|
{
|
||||||
overlaps[i].Unmapped(unmapped);
|
overlaps[i].Unmapped(unmapped);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// If any range was previously unmapped, we also need to purge
|
lock (_partiallyMappedTextures)
|
||||||
// all partially mapped texture, as they might be fully mapped now.
|
|
||||||
for (int i = 0; i < unmapped.Count; i++)
|
|
||||||
{
|
{
|
||||||
if (unmapped.GetSubRange(i).Address == MemoryManager.PteUnmapped)
|
if (overlapCount > 0 || _partiallyMappedTextures.Count > 0)
|
||||||
|
{
|
||||||
|
e.AddRemapAction(() =>
|
||||||
{
|
{
|
||||||
lock (_partiallyMappedTextures)
|
lock (_partiallyMappedTextures)
|
||||||
{
|
{
|
||||||
foreach (var texture in _partiallyMappedTextures)
|
if (overlapCount > 0)
|
||||||
{
|
{
|
||||||
texture.Unmapped(unmapped);
|
for (int i = 0; i < overlapCount; i++)
|
||||||
|
{
|
||||||
|
_partiallyMappedTextures.Add(overlaps[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
// Any texture that has been unmapped at any point or is partially unmapped
|
||||||
|
// should update their pool references after the remap completes.
|
||||||
|
|
||||||
|
MultiRange unmapped = ((MemoryManager)sender).GetPhysicalRegions(e.Address, e.Size);
|
||||||
|
|
||||||
|
foreach (var texture in _partiallyMappedTextures)
|
||||||
|
{
|
||||||
|
texture.UpdatePoolMappings();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1135,6 +1150,44 @@ namespace Ryujinx.Graphics.Gpu.Image
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Queries a texture's memory range and marks it as partially mapped or not.
|
||||||
|
/// Partially mapped textures re-evaluate their memory range after each time GPU memory is mapped.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="memoryManager">GPU memory manager where the texture is mapped</param>
|
||||||
|
/// <param name="address">The virtual address of the texture</param>
|
||||||
|
/// <param name="texture">The texture to be marked</param>
|
||||||
|
/// <returns>The physical regions for the texture, found when evaluating whether the texture was partially mapped</returns>
|
||||||
|
public MultiRange UpdatePartiallyMapped(MemoryManager memoryManager, ulong address, Texture texture)
|
||||||
|
{
|
||||||
|
MultiRange range;
|
||||||
|
lock (_partiallyMappedTextures)
|
||||||
|
{
|
||||||
|
range = memoryManager.GetPhysicalRegions(address, texture.Size);
|
||||||
|
bool partiallyMapped = false;
|
||||||
|
|
||||||
|
for (int i = 0; i < range.Count; i++)
|
||||||
|
{
|
||||||
|
if (range.GetSubRange(i).Address == MemoryManager.PteUnmapped)
|
||||||
|
{
|
||||||
|
partiallyMapped = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (partiallyMapped)
|
||||||
|
{
|
||||||
|
_partiallyMappedTextures.Add(texture);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_partiallyMappedTextures.Remove(texture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return range;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Adds a texture to the short duration cache. This typically keeps it alive for two ticks.
|
/// Adds a texture to the short duration cache. This typically keeps it alive for two ticks.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@@ -272,7 +272,15 @@ namespace Ryujinx.Graphics.Gpu.Image
|
|||||||
|
|
||||||
ulong address = descriptor.UnpackAddress();
|
ulong address = descriptor.UnpackAddress();
|
||||||
|
|
||||||
MultiRange range = _channel.MemoryManager.GetPhysicalRegions(address, texture.Size);
|
if (!descriptor.Equals(ref DescriptorCache[request.ID]))
|
||||||
|
{
|
||||||
|
// If the pool entry has already been replaced, just remove the texture.
|
||||||
|
|
||||||
|
texture.DecrementReferenceCount();
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
MultiRange range = _channel.MemoryManager.Physical.TextureCache.UpdatePartiallyMapped(_channel.MemoryManager, address, texture);
|
||||||
|
|
||||||
// If the texture is not mapped at all, delete its reference.
|
// If the texture is not mapped at all, delete its reference.
|
||||||
|
|
||||||
|
@@ -365,6 +365,22 @@ namespace Ryujinx.Graphics.Gpu.Memory
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Runs remap actions that are added to an unmap event.
|
||||||
|
/// These must run after the mapping completes.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="e">Event with remap actions</param>
|
||||||
|
private void RunRemapActions(UnmapEventArgs e)
|
||||||
|
{
|
||||||
|
if (e.RemapActions != null)
|
||||||
|
{
|
||||||
|
foreach (Action action in e.RemapActions)
|
||||||
|
{
|
||||||
|
action();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Maps a given range of pages to the specified CPU virtual address.
|
/// Maps a given range of pages to the specified CPU virtual address.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -379,12 +395,15 @@ namespace Ryujinx.Graphics.Gpu.Memory
|
|||||||
{
|
{
|
||||||
lock (_pageTable)
|
lock (_pageTable)
|
||||||
{
|
{
|
||||||
MemoryUnmapped?.Invoke(this, new UnmapEventArgs(va, size));
|
UnmapEventArgs e = new(va, size);
|
||||||
|
MemoryUnmapped?.Invoke(this, e);
|
||||||
|
|
||||||
for (ulong offset = 0; offset < size; offset += PageSize)
|
for (ulong offset = 0; offset < size; offset += PageSize)
|
||||||
{
|
{
|
||||||
SetPte(va + offset, PackPte(pa + offset, kind));
|
SetPte(va + offset, PackPte(pa + offset, kind));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RunRemapActions(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -398,12 +417,15 @@ namespace Ryujinx.Graphics.Gpu.Memory
|
|||||||
lock (_pageTable)
|
lock (_pageTable)
|
||||||
{
|
{
|
||||||
// Event handlers are not expected to be thread safe.
|
// Event handlers are not expected to be thread safe.
|
||||||
MemoryUnmapped?.Invoke(this, new UnmapEventArgs(va, size));
|
UnmapEventArgs e = new(va, size);
|
||||||
|
MemoryUnmapped?.Invoke(this, e);
|
||||||
|
|
||||||
for (ulong offset = 0; offset < size; offset += PageSize)
|
for (ulong offset = 0; offset < size; offset += PageSize)
|
||||||
{
|
{
|
||||||
SetPte(va + offset, PteUnmapped);
|
SetPte(va + offset, PteUnmapped);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RunRemapActions(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,14 +1,24 @@
|
|||||||
namespace Ryujinx.Graphics.Gpu.Memory
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace Ryujinx.Graphics.Gpu.Memory
|
||||||
{
|
{
|
||||||
public class UnmapEventArgs
|
public class UnmapEventArgs
|
||||||
{
|
{
|
||||||
public ulong Address { get; }
|
public ulong Address { get; }
|
||||||
public ulong Size { get; }
|
public ulong Size { get; }
|
||||||
|
public List<Action> RemapActions { get; private set; }
|
||||||
|
|
||||||
public UnmapEventArgs(ulong address, ulong size)
|
public UnmapEventArgs(ulong address, ulong size)
|
||||||
{
|
{
|
||||||
Address = address;
|
Address = address;
|
||||||
Size = size;
|
Size = size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void AddRemapAction(Action action)
|
||||||
|
{
|
||||||
|
RemapActions ??= new List<Action>();
|
||||||
|
RemapActions.Add(action);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -57,5 +57,19 @@
|
|||||||
|
|
||||||
return thisAddress < otherEndAddress && otherAddress < thisEndAddress;
|
return thisAddress < otherEndAddress && otherAddress < thisEndAddress;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns a string summary of the memory range.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>A string summary of the memory range</returns>
|
||||||
|
public override string ToString()
|
||||||
|
{
|
||||||
|
if (Address == ulong.MaxValue)
|
||||||
|
{
|
||||||
|
return $"[Unmapped 0x{Size:X}]";
|
||||||
|
}
|
||||||
|
|
||||||
|
return $"[0x{Address:X}, 0x{EndAddress:X})";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -319,5 +319,14 @@ namespace Ryujinx.Memory.Range
|
|||||||
|
|
||||||
return hash.ToHashCode();
|
return hash.ToHashCode();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns a string summary of the ranges contained in the MultiRange.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>A string summary of the ranges contained within</returns>
|
||||||
|
public override string ToString()
|
||||||
|
{
|
||||||
|
return HasSingleRange ? _singleRange.ToString() : string.Join(", ", _ranges);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -14,7 +14,7 @@ namespace Ryujinx.Ui.Common.Configuration
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// The current version of the file format
|
/// The current version of the file format
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public const int CurrentVersion = 46;
|
public const int CurrentVersion = 47;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Version of the configuration file format
|
/// Version of the configuration file format
|
||||||
@@ -251,6 +251,11 @@ namespace Ryujinx.Ui.Common.Configuration
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public ShownFileTypes ShownFileTypes { get; set; }
|
public ShownFileTypes ShownFileTypes { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Main window start-up position, size and state
|
||||||
|
/// </summary>
|
||||||
|
public WindowStartup WindowStartup { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Language Code for the UI
|
/// Language Code for the UI
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@@ -83,6 +83,27 @@ namespace Ryujinx.Ui.Common.Configuration
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// <summary>
|
||||||
|
/// Determines main window start-up position, size and state
|
||||||
|
///<summary>
|
||||||
|
public class WindowStartupSettings
|
||||||
|
{
|
||||||
|
public ReactiveObject<int> WindowSizeWidth { get; private set; }
|
||||||
|
public ReactiveObject<int> WindowSizeHeight { get; private set; }
|
||||||
|
public ReactiveObject<int> WindowPositionX { get; private set; }
|
||||||
|
public ReactiveObject<int> WindowPositionY { get; private set; }
|
||||||
|
public ReactiveObject<bool> WindowMaximized { get; private set; }
|
||||||
|
|
||||||
|
public WindowStartupSettings()
|
||||||
|
{
|
||||||
|
WindowSizeWidth = new ReactiveObject<int>();
|
||||||
|
WindowSizeHeight = new ReactiveObject<int>();
|
||||||
|
WindowPositionX = new ReactiveObject<int>();
|
||||||
|
WindowPositionY = new ReactiveObject<int>();
|
||||||
|
WindowMaximized = new ReactiveObject<bool>();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Used to toggle columns in the GUI
|
/// Used to toggle columns in the GUI
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -103,6 +124,11 @@ namespace Ryujinx.Ui.Common.Configuration
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public ShownFileTypeSettings ShownFileTypes { get; private set; }
|
public ShownFileTypeSettings ShownFileTypes { get; private set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Determines main window start-up position, size and state
|
||||||
|
/// </summary>
|
||||||
|
public WindowStartupSettings WindowStartup { get; private set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Language Code for the UI
|
/// Language Code for the UI
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -164,6 +190,7 @@ namespace Ryujinx.Ui.Common.Configuration
|
|||||||
ColumnSort = new ColumnSortSettings();
|
ColumnSort = new ColumnSortSettings();
|
||||||
GameDirs = new ReactiveObject<List<string>>();
|
GameDirs = new ReactiveObject<List<string>>();
|
||||||
ShownFileTypes = new ShownFileTypeSettings();
|
ShownFileTypes = new ShownFileTypeSettings();
|
||||||
|
WindowStartup = new WindowStartupSettings();
|
||||||
EnableCustomTheme = new ReactiveObject<bool>();
|
EnableCustomTheme = new ReactiveObject<bool>();
|
||||||
CustomThemePath = new ReactiveObject<string>();
|
CustomThemePath = new ReactiveObject<string>();
|
||||||
BaseStyle = new ReactiveObject<string>();
|
BaseStyle = new ReactiveObject<string>();
|
||||||
@@ -678,6 +705,14 @@ namespace Ryujinx.Ui.Common.Configuration
|
|||||||
NRO = Ui.ShownFileTypes.NRO,
|
NRO = Ui.ShownFileTypes.NRO,
|
||||||
NSO = Ui.ShownFileTypes.NSO,
|
NSO = Ui.ShownFileTypes.NSO,
|
||||||
},
|
},
|
||||||
|
WindowStartup = new WindowStartup
|
||||||
|
{
|
||||||
|
WindowSizeWidth = Ui.WindowStartup.WindowSizeWidth,
|
||||||
|
WindowSizeHeight = Ui.WindowStartup.WindowSizeHeight,
|
||||||
|
WindowPositionX = Ui.WindowStartup.WindowPositionX,
|
||||||
|
WindowPositionY = Ui.WindowStartup.WindowPositionY,
|
||||||
|
WindowMaximized = Ui.WindowStartup.WindowMaximized,
|
||||||
|
},
|
||||||
LanguageCode = Ui.LanguageCode,
|
LanguageCode = Ui.LanguageCode,
|
||||||
EnableCustomTheme = Ui.EnableCustomTheme,
|
EnableCustomTheme = Ui.EnableCustomTheme,
|
||||||
CustomThemePath = Ui.CustomThemePath,
|
CustomThemePath = Ui.CustomThemePath,
|
||||||
@@ -781,6 +816,11 @@ namespace Ryujinx.Ui.Common.Configuration
|
|||||||
Ui.IsAscendingOrder.Value = true;
|
Ui.IsAscendingOrder.Value = true;
|
||||||
Ui.StartFullscreen.Value = false;
|
Ui.StartFullscreen.Value = false;
|
||||||
Ui.ShowConsole.Value = true;
|
Ui.ShowConsole.Value = true;
|
||||||
|
Ui.WindowStartup.WindowSizeWidth.Value = 1280;
|
||||||
|
Ui.WindowStartup.WindowSizeHeight.Value = 760;
|
||||||
|
Ui.WindowStartup.WindowPositionX.Value = 0;
|
||||||
|
Ui.WindowStartup.WindowPositionY.Value = 0;
|
||||||
|
Ui.WindowStartup.WindowMaximized.Value = false;
|
||||||
Hid.EnableKeyboard.Value = false;
|
Hid.EnableKeyboard.Value = false;
|
||||||
Hid.EnableMouse.Value = false;
|
Hid.EnableMouse.Value = false;
|
||||||
Hid.Hotkeys.Value = new KeyboardHotkeys
|
Hid.Hotkeys.Value = new KeyboardHotkeys
|
||||||
@@ -1334,13 +1374,29 @@ namespace Ryujinx.Ui.Common.Configuration
|
|||||||
|
|
||||||
if (configurationFileFormat.Version < 46)
|
if (configurationFileFormat.Version < 46)
|
||||||
{
|
{
|
||||||
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 45.");
|
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 46.");
|
||||||
|
|
||||||
configurationFileFormat.MultiplayerLanInterfaceId = "0";
|
configurationFileFormat.MultiplayerLanInterfaceId = "0";
|
||||||
|
|
||||||
configurationFileUpdated = true;
|
configurationFileUpdated = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (configurationFileFormat.Version < 47)
|
||||||
|
{
|
||||||
|
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 47.");
|
||||||
|
|
||||||
|
configurationFileFormat.WindowStartup = new WindowStartup
|
||||||
|
{
|
||||||
|
WindowPositionX = 0,
|
||||||
|
WindowPositionY = 0,
|
||||||
|
WindowSizeHeight = 760,
|
||||||
|
WindowSizeWidth = 1280,
|
||||||
|
WindowMaximized = false,
|
||||||
|
};
|
||||||
|
|
||||||
|
configurationFileUpdated = true;
|
||||||
|
}
|
||||||
|
|
||||||
Logger.EnableFileLog.Value = configurationFileFormat.EnableFileLog;
|
Logger.EnableFileLog.Value = configurationFileFormat.EnableFileLog;
|
||||||
Graphics.ResScale.Value = configurationFileFormat.ResScale;
|
Graphics.ResScale.Value = configurationFileFormat.ResScale;
|
||||||
Graphics.ResScaleCustom.Value = configurationFileFormat.ResScaleCustom;
|
Graphics.ResScaleCustom.Value = configurationFileFormat.ResScaleCustom;
|
||||||
@@ -1416,6 +1472,11 @@ namespace Ryujinx.Ui.Common.Configuration
|
|||||||
Ui.ApplicationSort.Value = configurationFileFormat.ApplicationSort;
|
Ui.ApplicationSort.Value = configurationFileFormat.ApplicationSort;
|
||||||
Ui.StartFullscreen.Value = configurationFileFormat.StartFullscreen;
|
Ui.StartFullscreen.Value = configurationFileFormat.StartFullscreen;
|
||||||
Ui.ShowConsole.Value = configurationFileFormat.ShowConsole;
|
Ui.ShowConsole.Value = configurationFileFormat.ShowConsole;
|
||||||
|
Ui.WindowStartup.WindowSizeWidth.Value = configurationFileFormat.WindowStartup.WindowSizeWidth;
|
||||||
|
Ui.WindowStartup.WindowSizeHeight.Value = configurationFileFormat.WindowStartup.WindowSizeHeight;
|
||||||
|
Ui.WindowStartup.WindowPositionX.Value = configurationFileFormat.WindowStartup.WindowPositionX;
|
||||||
|
Ui.WindowStartup.WindowPositionY.Value = configurationFileFormat.WindowStartup.WindowPositionY;
|
||||||
|
Ui.WindowStartup.WindowMaximized.Value = configurationFileFormat.WindowStartup.WindowMaximized;
|
||||||
Hid.EnableKeyboard.Value = configurationFileFormat.EnableKeyboard;
|
Hid.EnableKeyboard.Value = configurationFileFormat.EnableKeyboard;
|
||||||
Hid.EnableMouse.Value = configurationFileFormat.EnableMouse;
|
Hid.EnableMouse.Value = configurationFileFormat.EnableMouse;
|
||||||
Hid.Hotkeys.Value = configurationFileFormat.Hotkeys;
|
Hid.Hotkeys.Value = configurationFileFormat.Hotkeys;
|
||||||
|
11
src/Ryujinx.Ui.Common/Configuration/Ui/WindowStartup.cs
Normal file
11
src/Ryujinx.Ui.Common/Configuration/Ui/WindowStartup.cs
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
namespace Ryujinx.Ui.Common.Configuration.Ui
|
||||||
|
{
|
||||||
|
public struct WindowStartup
|
||||||
|
{
|
||||||
|
public int WindowSizeWidth { get; set; }
|
||||||
|
public int WindowSizeHeight { get; set; }
|
||||||
|
public int WindowPositionX { get; set; }
|
||||||
|
public int WindowPositionY { get; set; }
|
||||||
|
public bool WindowMaximized { get; set; }
|
||||||
|
}
|
||||||
|
}
|
@@ -153,13 +153,8 @@ namespace Ryujinx.Ui
|
|||||||
|
|
||||||
// Apply custom theme if needed.
|
// Apply custom theme if needed.
|
||||||
ThemeHelper.ApplyTheme();
|
ThemeHelper.ApplyTheme();
|
||||||
Gdk.Monitor monitor = Display.GetMonitor(0);
|
|
||||||
// Sets overridden fields.
|
|
||||||
int monitorWidth = monitor.Geometry.Width * monitor.ScaleFactor;
|
|
||||||
int monitorHeight = monitor.Geometry.Height * monitor.ScaleFactor;
|
|
||||||
|
|
||||||
DefaultWidth = monitorWidth < 1280 ? monitorWidth : 1280;
|
SetWindowSizePosition();
|
||||||
DefaultHeight = monitorHeight < 760 ? monitorHeight : 760;
|
|
||||||
|
|
||||||
Icon = new Gdk.Pixbuf(Assembly.GetAssembly(typeof(ConfigurationState)), "Ryujinx.Ui.Common.Resources.Logo_Ryujinx.png");
|
Icon = new Gdk.Pixbuf(Assembly.GetAssembly(typeof(ConfigurationState)), "Ryujinx.Ui.Common.Resources.Logo_Ryujinx.png");
|
||||||
Title = $"Ryujinx {Program.Version}";
|
Title = $"Ryujinx {Program.Version}";
|
||||||
@@ -1314,6 +1309,7 @@ namespace Ryujinx.Ui
|
|||||||
{
|
{
|
||||||
if (!_gameLoaded || !ConfigurationState.Instance.ShowConfirmExit || GtkDialog.CreateExitDialog())
|
if (!_gameLoaded || !ConfigurationState.Instance.ShowConfirmExit || GtkDialog.CreateExitDialog())
|
||||||
{
|
{
|
||||||
|
SaveWindowSizePosition();
|
||||||
End();
|
End();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1322,6 +1318,7 @@ namespace Ryujinx.Ui
|
|||||||
{
|
{
|
||||||
if (!_gameLoaded || !ConfigurationState.Instance.ShowConfirmExit || GtkDialog.CreateExitDialog())
|
if (!_gameLoaded || !ConfigurationState.Instance.ShowConfirmExit || GtkDialog.CreateExitDialog())
|
||||||
{
|
{
|
||||||
|
SaveWindowSizePosition();
|
||||||
End();
|
End();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -1330,6 +1327,33 @@ namespace Ryujinx.Ui
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void SetWindowSizePosition()
|
||||||
|
{
|
||||||
|
DefaultWidth = ConfigurationState.Instance.Ui.WindowStartup.WindowSizeWidth;
|
||||||
|
DefaultHeight = ConfigurationState.Instance.Ui.WindowStartup.WindowSizeHeight;
|
||||||
|
|
||||||
|
Move(ConfigurationState.Instance.Ui.WindowStartup.WindowPositionX, ConfigurationState.Instance.Ui.WindowStartup.WindowPositionY);
|
||||||
|
|
||||||
|
if (ConfigurationState.Instance.Ui.WindowStartup.WindowMaximized)
|
||||||
|
{
|
||||||
|
Maximize();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SaveWindowSizePosition()
|
||||||
|
{
|
||||||
|
GetSize(out int windowWidth, out int windowHeight);
|
||||||
|
GetPosition(out int windowXPos, out int windowYPos);
|
||||||
|
|
||||||
|
ConfigurationState.Instance.Ui.WindowStartup.WindowMaximized.Value = IsMaximized;
|
||||||
|
ConfigurationState.Instance.Ui.WindowStartup.WindowSizeWidth.Value = windowWidth;
|
||||||
|
ConfigurationState.Instance.Ui.WindowStartup.WindowSizeHeight.Value = windowHeight;
|
||||||
|
ConfigurationState.Instance.Ui.WindowStartup.WindowPositionX.Value = windowXPos;
|
||||||
|
ConfigurationState.Instance.Ui.WindowStartup.WindowPositionY.Value = windowYPos;
|
||||||
|
|
||||||
|
SaveConfig();
|
||||||
|
}
|
||||||
|
|
||||||
private void StopEmulation_Pressed(object sender, EventArgs args)
|
private void StopEmulation_Pressed(object sender, EventArgs args)
|
||||||
{
|
{
|
||||||
if (_emulationContext != null)
|
if (_emulationContext != null)
|
||||||
|
Reference in New Issue
Block a user